|
转载
- E7 U+ J" H4 t& n: B自动合成的逻辑过于复杂就不给出了主要就是利用以下汇编点:- b9 s9 R7 ]! \$ z- N
D2Client:9 p: w6 ]% f) J! D- |! B
6FB20AE1为拦截输入框(用于获得命令)
+ x( z5 h2 V% J+ v* [) v9 |+ d p; t6FB5E11C为客户端获得0x9C 0x04数据包位置 也就是进入储存的触发- ?/ Z( |5 `! ?$ K
6FB5E8D0为客户端获得0x9D 0x05数据包的位置 也是从储存中提起的触发
- n$ b( B5 Z- ~" A3 ^6FAF4230为hackmap的loop点 我用的hackmap导出位置& H% y8 w7 |: a7 a/ o$ c+ P
% E2 ]! l, `/ E# [& z" U" Q5 U
( c6 f& j3 m8 O$ }; Q3 d2 j发包函数:5 n( ?3 N7 n) j( i l
class D2PKT_ITEM
. O& w1 f3 h- K0 }{
4 g; o. A2 h# O! c#define ITEM_ACTION_NEW_GROUND 0x00 //9c//新产生在地上 地上! v7 A% X0 [! {9 E. c4 T7 w) \/ E9 ]
#define ITEM_ACTION_PICK_UP 0x01 //9c//拾取 多& y0 [0 q# z9 i0 U
#define ITEM_ACTION_DROP 0x02 //9c//丢弃 地上
& W+ L- T, C0 d# ~#define ITEM_ACTION_OLD_GROUND 0x03 //9c//旧的地上 地上
! e& e4 n+ n8 p! X#define ITEM_ACTION_TO_STORAGE 0x04 //9c //到储存 STASH8 {/ m4 a- a* v) c
#define ITEM_ACTION_FROM_STORAGE 0x05 //9d 从储存 手上1 S B" v8 C# W: ] B
#define ITEM_ACTION_TO_EQUIP 0x06 //9d 装备 装备栏
4 [! |9 a% C8 T0 b0 H#define ITEM_ACTION_FROM_EQUIP 0x08 //9d 从装备 手上
6 p% R9 b3 W2 y4 H#define ITEM_ACTION_SWITCH_EQUIP 0x09 //9d 切装备 -2 o; m8 ]6 X5 r1 H3 Q, T
#define ITEM_ACTION_TO_STORE 0x0B //9c //到商店 商店
: N5 X0 E$ }* e, V#define ITEM_ACTION_FROM_STORE 0x0C //9c 从商店 INV
& ], J1 y* f0 E#define ITEM_ACTION_SWITCH_STORAGE 0x0d //9c 转换储存 不知道 6 x# o, q8 D: n9 ~
#define ITEM_ACTION_TO_BELTSLOT 0x0E //9c 去腰带 腰带
c0 l1 B2 k: g0 @#define ITEM_ACTION_FROM_BELTSLOT 0x0F //9c 从腰带 手上6 ?+ n4 }% Q/ @# A
#define ITEM_ACTION_SWITCH_BELTSLOT 0x10 //9c 转换腰带 -6 C$ e$ ~ n, X0 K7 P
#define ITEM_ACTION_TO_CURSOR 0x12 //9c 到受伤 手上
# g+ i+ c0 p. X- r+ Z#define ITEM_ACTION_SHIFT_BELTSLOT 0x15 //9d 切换腰带 -
; L: i: M3 H) V' y4 _) n8 ]8 j: q3 g
7 F* I) G! o; C0 J. k5 u#define PacketItemMaxTick 1505 `7 ]" a/ d' O7 Z
#define PacketItemPickUpTick 208 a: O i$ C) L/ Q
! g, d1 D; C G# {9 C& P
private:# _; r4 @' `: y# j
static DWORD _PKTItemTick;
( e b5 t/ v7 t# h static DWORD _PKTItemAction;! r6 U" @, C$ k, r. s4 N
static DWORD _PKTItemID;
4 I1 ^7 o* K) w static BYTE _PKTPKTType; O7 w- w' q; a# E9 C
public:/ z) C5 X. z- A7 }& d
static DWORD PKTItemGetTick() { return _PKTItemTick; }* @5 q4 J# p. T8 x$ R/ I" g
2 E4 p9 P+ k4 o8 D4 L% I
static void PKTItemRelease() 9 o& U, M; x( c. k
{# j3 E* `; t# m) _- z- T% H7 a
_PKTItemTick = 0;2 c7 D- v8 C; Z+ L$ A8 o# i
_PKTItemAction = 0;. v. {8 S! ~7 B7 I8 }- |* a% L
_PKTItemID = 0;# I# A7 d6 w X2 ~, T0 i! N
_PKTPKTType = 0;
4 Z' N& O2 i' |9 o8 h, E }
3 R" x/ k) v( s6 u; W( c' k7 Q' v$ N
* P& O/ [- a1 B0 e static void PKTItemTellW8(BYTE aPacket0, DWORD dwItemID, DWORD ItemAction, DWORD tick)
$ b3 q( x- ^6 \6 F. T8 {. e {$ c& e" b, ~4 V5 O
_PKTPKTType = aPacket0;
. Y; `! T3 K6 U+ ?3 O" `2 C7 x _PKTItemTick = tick;# m6 b9 M4 B( F `( V
_PKTItemAction = ItemAction;
# O4 y/ V/ s/ {* z( ? _PKTItemID = dwItemID;
4 M O8 I7 e( K7 I, m# y, Y }6 D9 v4 K: Q+ Z8 E) z
$ ^* I- ]- E+ J1 q
static void PKTItemTellW8(DWORD tick)
, v; X$ \# K% B3 s8 T {
, r+ k8 b; M0 T. X( r5 _4 w _PKTItemTick = tick;( t* e. J' f! d7 S* O
}
, y2 j" V' C4 u4 g; g0 J( m# i r/ D
static void PKTItem9C04(BYTE* aPacket, DWORD aLength,UnitAny* pPlayer)//picktocursor5 E, I# ]3 Y/ w; l
{
* ~7 ^& H6 h; [ if (aLength >= 8)" F5 s% b; k+ a* _# i* X2 M
{6 N, y# ?, O' n) o7 A' @
DWORD dwItemId = 0;
+ o* J0 N- C+ _0 b memcpy(&dwItemId, aPacket + 4, sizeof(DWORD));* ~5 I+ S! D' {" |1 k* {. ~
if (aPacket[0] == PACKET_NEWITEM && aPacket[1] == ITEM_ACTION_TO_STORAGE" P5 O. u7 w' y4 q
&& _PKTItemAction == ITEM_ACTION_TO_STORAGE
: Z% K, H* c6 U8 f3 v && _PKTPKTType == PACKET_NEWITEM5 |% ]; ^( C) C- r/ h v$ z8 R
)* b/ j( D9 u, B" {! x
{
+ |9 E( M8 U. I3 {- C( V, v _7 r if (_PKTItemID == 0 && _PKTItemTick)$ I8 `( J! h0 e( p
{
6 T q! j I1 b: U) I3 \3 Y* P PKTItemRelease();
6 Y$ ~0 a9 m: F) y8 Y/ q* V }
+ i4 f# I! a$ H3 t& P else if(_PKTItemID== dwItemId&& _PKTItemTick)
! @& W! P; p8 J% c% Y6 i {3 K/ X& {. u3 {7 a) e) V
PKTItemRelease();" k; q. Z/ r. I2 c! ]
}
' n& D% D( Y( ? x1 K6 s }
1 ?$ W; N5 p& [) {$ V, P $ U# V A. p( X
}2 x- Z Z4 j3 @, n( Y
}
& ?- P5 T+ R2 F& c- X) r8 O: M( i$ O+ n' `
static void PKTItem9D05(BYTE* aPacket, DWORD aLength, UnitAny* pPlayer)//To Stored
, g* W1 N% J8 M$ ]' [$ N; t% \ {8 m" T" _: V! t6 N
if (aLength >= 8)) H- B, y+ H6 [) q. {' ? C
{
) o! j2 S6 z7 z/ c DWORD dwItemId = 0;
1 S& b/ m2 l& R& r* |: s- ?9 z memcpy(&dwItemId, aPacket + 4, sizeof(DWORD));
% R, @4 P8 p% I6 ]" _ if (aPacket[0] == PACKET_ITEMACTION && aPacket[1] == ITEM_ACTION_FROM_STORAGE+ `' R& l( F+ a& X+ K+ _- y
&& _PKTItemAction == ITEM_ACTION_FROM_STORAGE
+ P7 u7 @1 k9 s# i && _PKTPKTType == PACKET_ITEMACTION# s' x8 h0 g% d6 l3 {5 _9 Z' p
)
! C# ?& S" L8 l& W: E$ O {6 ~" U) s$ g/ I. X9 A2 ?
if (dwItemId == 0 && _PKTItemTick)% }; [3 v, Q, t2 D+ w+ G6 C ?
{
: h! Z5 k6 W; @6 T% Q I+ c8 x PKTItemRelease();
- z9 a! @5 A) @8 H7 ?. C, }0 ^! X5 U }2 w9 b4 a4 _! y1 w9 a+ @
else if (dwItemId == _PKTItemID && _PKTItemTick)
2 z# u# ?/ H0 i- y- Z {
; b2 N. J( j3 F3 ?' r; { PKTItemRelease();( s" I _5 ^# `; r) J3 N
}$ H) a5 B+ q+ o6 O" d" n
}
: e" B. I& H! O: o
: ?: \# [- H" o% c( s# h q4 z5 d }
/ }5 i, C8 ?6 W% E' Q }
0 `6 h3 w3 U5 g: \; K, k6 @* L9 @
7 }2 C6 B8 l+ Y! i' y$ B1 A static void PKTItemGameLoop()
; Z( w. D' F3 y4 j/ e4 H {
- x2 _$ U5 }5 C0 @4 \( \ if (_PKTItemTick > 0): g, }9 i7 m6 H7 }
_PKTItemTick--;
; v' x$ p9 f- _* O else if (_PKTItemTick == 0)
# {. d# F, P' r2 H PKTItemRelease();- Z- F0 A4 Z/ ^) X& |
}. U; k2 a8 A: p
: S* e# n1 R2 V4 s4 ^) C6 o" f9 Z static BOOL PKTItemCando() . ~6 e0 ]0 b# P8 B* k& ~
{( A* W3 a" A) l9 i: o
if (_PKTItemTick == 0)return TRUE;
' o, X+ C& S6 |* W r return FALSE;
' p( h8 j( V1 e4 G v# U+ \ }1 J+ l9 I" l& `- `- R$ r) p9 E8 W
/ e( M. ]- Y4 {) e }1 O- S; c
static BOOL BuyItem(DWORD ItemID, DWORD npcid)5 [9 i {* p4 Y" z
{
( o T- d) l- a PKTItemTellW8(PACKET_NEWITEM, 0, ITEM_ACTION_TO_STORAGE, PacketItemMaxTick);% |: w$ F! Z+ b; {/ m7 Y t3 l
BYTE aPacket[17] = { 0 };7 ^( H1 w! c4 T1 V' A
aPacket[0] = 0x32;3 m; H$ j) e% W: ^5 O
::memcpy(&aPacket[1], &npcid, 4);# J: M4 V( h1 Z G6 h! U
::memcpy(&aPacket[5], &ItemID, 4);
+ o6 \& z' I- x: R9 J* E //return D2Net::D2NetSendPacketToServer(0, aPacket, 17);% [* g9 [/ H7 ?* ], I
D2Net::D2SendToServer(17, 0, aPacket);
4 ?/ q4 h, V, h$ J return TRUE;
; u5 R" C; T. |( t9 y5 O' H }$ t: v6 F* N2 R
6 ]) a3 F) X! w) ^# ]) s static BOOL SellItem(DWORD ItemID, DWORD npcid)
& t7 e% u& {! W' B. j' A {
9 I# b) |4 j: h. f* j% ~8 G PKTItemTellW8(PACKET_ITEMACTION, 0, ITEM_ACTION_FROM_STORAGE, PacketItemMaxTick);
b- k0 Z- u% ~6 \% O9 e. U0 r6 l4 V! V+ H BYTE aPacket[17] = { 0 };
1 | c3 B: e. H9 D* Y6 f% j aPacket[0] = 0x33;% A9 G0 U* v4 u# P8 F
::memcpy(&aPacket[1], &npcid, 4);
- V% S1 H9 k/ L9 S5 V% G ::memcpy(&aPacket[5], &ItemID, 4);
0 f+ l4 z; R, w7 Z //return D2Net::D2NetSendPacketToServer(0, aPacket, 17);! W7 U+ m% t! ?' W( f
D2Net::D2SendToServer(17, 0, aPacket);( p& _* M) N9 {' |1 q$ _9 ]- J
return TRUE;* ]/ k) h( t) I4 l5 |, n3 R4 `
}% s# |* j% y" G- b0 G% b( P4 j$ x
: h* {8 W9 d0 r; ?% ] static BOOL Interact(DWORD nUnitId, DWORD nUnitType);
! B2 L& Y v0 K1 O( W
$ N$ ]( h9 H, k8 f: v2 X static BOOL PickGroundItem(UnitAny* pItem, BOOL bShowClientMove, BOOL bToCursor);
B. j+ B" Z9 C8 s2 n3 C( s5 g9 h' C
static BOOL OpenCube(). A5 E" e2 p& }% c# ^# D* q, r _. R
{" N6 `( s+ _4 i9 d9 N
if (D2Client::D2GetUIToggle(UIVAR_CUBE))return TRUE;) I- T; T. M" M4 w/ F
$ Z/ p6 S% n; m6 U, h: g1 N+ v UnitAny* pCube = CountStorageItems(LOC_INV, D2TXTCODE('box '), ITEMQUALITY_NORMAL, NULL);2 l* ]- t; N7 G" }
if (!pCube): ]3 P7 ?( @7 L9 o3 X9 x5 o7 O
{
# k: t1 p4 ?; y pCube = CountStorageItems(lOC_STASH, D2TXTCODE('box '), ITEMQUALITY_NORMAL, NULL);
$ w& R; O) D) l4 m if (!pCube)
/ {1 V+ U8 F) p& q- L return FALSE;
; V" x2 [1 c, N! J7 G) y7 \ } k3 N) k9 ~- A8 m9 ~/ e7 ]
PKTItemTellW8(PacketItemMaxTick);
! V8 [. n/ B$ R, k% k4 }# B2 P \: P n! x7 [ i7 a1 I
D2CoordStrc mypst = { NULL };3 r7 I: }) I/ h' R0 C/ D
D2Common::D2GetUnitXY(*D2Client::ptPlayerClient, &mypst);
u% Y1 p. W- |- i* |4 n+ w/ ?+ ?- ^+ W& Z- p% [" O" K4 t
BYTE aPacket[13] = { 0x20,0 };
- w; u. S; Y( g ::memcpy(aPacket + 1, &pCube->nItemNum, 4);
& X) @1 M9 l# ?: m ::memcpy(aPacket + 5, &(mypst.nX), 4); Q) {! c* v5 ~
::memcpy(aPacket + 9, &(mypst.nY), 4);- F. c1 y' c2 J) t( ]! D: P; G
D2Net::D2SendToServer(13, 0, aPacket);2 Y5 X+ ~5 ^# x) h; z) ^
return TRUE;
% ^6 U! _1 V8 p2 T# D2 w }
; r! h1 |2 T% p, P( n5 @6 B C r% ~8 m/ E; }7 i9 m3 w2 s8 C
static BOOL ToInvxy(DWORD x, DWORD y). {& e- E0 k6 e
{
- u7 V) I5 a c8 A5 Q) p; ` UnitAny* phand = D2Common::D2GetCursorItem((*D2Client::ptPlayerClient)->ptInventory);
: ?8 f. ]* m+ T, v; z$ z$ X' x' |5 N6 w5 q8 ~, r
if (phand == NULL)
' b& M* v* T0 p; D% t7 V$ G( J return FALSE;
% y4 B, W P& m# |
9 h# o* P9 s7 q3 D" H% E& o PKTItemTellW8(PACKET_NEWITEM, phand->nUnitId, ITEM_ACTION_TO_STORAGE, PacketItemMaxTick);2 C* Z7 X5 A A6 a
0 C/ J1 S$ N6 g& H5 x1 Y
BYTE aPacket[17] = { 0x18,0 };+ F' F+ Q2 ^& r! |
::memcpy(aPacket + 1, &phand->nItemNum, 4);0 |* A2 ? {; l; Z# x# u
::memcpy(aPacket + 5, &x, 4);8 b: D9 W2 ^% v k- C& Y
::memcpy(aPacket + 9, &y, 4);: W% M, H8 k7 ?6 h, b
D2Net::D2SendToServer(17, 0, aPacket);- ? a/ s/ D2 u
return TRUE;
+ E. U- H- l6 e9 C }
! @) a2 `9 Q& {& w0 b1 z/ M! Q. s7 Y+ d
static BOOL ToInvRandom(BOOL bBagFix = FALSE) , S5 X3 T, R; @0 u. y; K
{5 j1 A' A* W: [( U
UnitAny* phand = D2Common::D2GetCursorItem((*D2Client::ptPlayerClient)->ptInventory);
( [* D/ ^. ^3 t/ ^! Y, H9 F if (!phand)
3 u$ _' _- Q& D( y9 H+ c' x return FALSE;
! m+ I. L* q x" P* C- T int desx = 0;
$ k% j \ C9 i( T+ c# ^5 R int desy = 0;
0 H& x( y2 K: c( h if (GetTheFirstStoragePlace(LOC_INV, phand->dwTxtFileNo, &desx, &desy, bBagFix))7 N5 Y! k' x9 E# K( _* a& u- p
{
; |3 O9 p. i B) x+ I0 D ToInvxy(desx, desy);1 n; U4 `; G9 b D2 D
return TRUE;+ {" o* ^- P2 g# s
}: |) S5 }4 t6 y0 o; N$ N. H2 U/ m
return FALSE;
# e8 m1 R- c6 q" T! Q }
' D4 e* h$ w) J; c) |3 k* b4 Z a1 V, K. z4 w" I
static BOOL ToCube()% R( S! x! j0 D, |8 z( w! a$ d0 e
{
D- w/ J4 o* g5 ~# i if (!(*D2Client::ptPlayerClient))return FALSE;
$ x1 F7 `. a! X r8 ?3 h
3 v" `7 `# g5 T; ? UnitAny* phand=D2Common::D2GetCursorItem((*D2Client::ptPlayerClient)->ptInventory);
1 g/ e# K5 H: V( p- l% Z7 w if (!phand)return FALSE;
0 |6 ]4 f$ \8 b, W! t- b* ^" b6 `; U# A) l% [ o% o8 k% S
UnitAny* pCube = CountStorageItems(LOC_INV, D2TXTCODE('box '), ITEMQUALITY_NORMAL, NULL);//枚举身上的方块
. `: ]8 ^' U) D0 l1 m [# v if (!pCube)- a, ^" d' v! K. k, |8 k! c! _# d
{7 N. N! }" A' [: ~/ B) F
pCube = CountStorageItems(lOC_STASH, D2TXTCODE('box '), ITEMQUALITY_NORMAL, NULL);//枚举仓库里的方块) Q- O: D# f+ T" S! ]
if (!pCube || !pCube->nItemNum)
# v% {0 w0 Y4 N" N8 [ return FALSE;. C% \+ |3 c j2 g2 C& p$ ^$ i
}
& [* h# w1 Q1 u' I1 ]6 k6 L$ G' Y# _7 }
if (!IsStorageCanStore(LOC_CUBE, phand->dwTxtFileNo, FALSE))3 R9 x5 d4 M4 B+ a5 m
return FALSE;
4 |3 N4 w( D7 Z) p5 J; E
3 C" x# W5 Y2 n' ], }+ y" @ PKTItemTellW8(PACKET_NEWITEM, phand->nItemNum, ITEM_ACTION_TO_STORAGE, PacketItemMaxTick);
/ M5 @0 `: G& O4 l3 A! X. X3 T% m$ ~ ~5 ?
BYTE aPacket[9] = { 0x2A,0 };
: p' f8 l1 e9 v" q! Q% V p6 b ::memcpy(aPacket + 1, &phand->nItemNum, 4);
" a! a* u% t. ~6 j, X" V7 A ::memcpy(aPacket + 5, &pCube->nItemNum, 4);, |6 K, [4 j0 L7 ?3 m7 w" D% K
D2Net::D2SendToServer(9, 0, aPacket);
8 X- n- R1 H; v9 w- r return TRUE;
: T- ?" ~( b4 z7 F
8 p: V: |! Y7 u8 J! }4 A6 Q8 W }
' ?3 `+ }7 T/ ]8 r. Q; N/ ?; G L, |$ P' \1 z
static BOOL ToCube(DWORD dwhandID, DWORD dwtxtno);) X/ A3 G d) F4 o0 F$ E/ K! q
8 Z: D L; u7 X% v6 t: b
static BOOL RCBag(DWORD dwItemID)//使用之前一定要检查能不能储存. I* F+ Z7 \0 z' U" f9 U( f6 T
{
. A% g6 u) [' m7 _ D2CoordStrc mypst = { NULL };/ W, h$ }. s y% g( ], m- t
D2Common::D2GetUnitXY(*D2Client::ptPlayerClient, &mypst);
5 A0 |4 P4 w: N" X3 y' W( l* e' ]% k2 ?0 g; W
if (!mypst.nX)return FALSE;( i8 D! {/ s! U
3 {6 ? p' `0 }3 ^8 W- G& `6 ~ |
PKTItemTellW8(PACKET_NEWITEM, 0, ITEM_ACTION_TO_STORAGE, PacketItemMaxTick);* E' h( P7 Z$ W
$ \7 c8 P3 d% A( [+ ]
BYTE aPacket[13] = { 0x20,0 };
4 X. i! @8 y1 L, ^7 S6 _6 M ::memcpy(aPacket + 1, &dwItemID, 4);
* Y8 r& A' F- u6 S& R" C ::memcpy(aPacket + 5, &mypst.nX, 4);* L7 N* G) q M7 M
::memcpy(aPacket + 9, &mypst.nY, 4);) k' T' T5 n+ W! G
//return D2Net::D2NetSendPacketToServer(0, aPacket, 13);* z0 S8 w$ R9 U- i
D2Net::D2SendToServer(13, 0, aPacket);1 x! m& I+ D2 O+ ^. n; X8 c9 o: e
return TRUE;
" t/ Y9 h+ w* X9 Y } e; K- a, K. p- M+ }0 i
4 `5 I0 T% H; i6 Y2 I
static BOOL DropCursorItemToGround()
' | X0 P3 p, z {% g$ S0 s0 d/ C6 P% R4 y- V" [
UnitAny* phand = D2Common::D2GetCursorItem((*D2Client::ptPlayerClient)->ptInventory);
& N- q. C* V) u! y if (!phand)7 J1 a5 }# q( M3 M, v
return FALSE;
) _, J; G' Z" B) B5 G, A' S! Z
" s7 V2 g6 D6 F" ]+ @+ s/ V PKTItemTellW8(PACKET_NEWITEM, phand->nItemNum, ITEM_ACTION_DROP, PacketItemMaxTick);3 g2 T5 [2 I% T G
: l8 F- ]( u9 T* w BYTE aPacket[5] = { 0x17 };& l4 P$ H+ r0 q6 @4 F+ P
::memcpy(aPacket + 1, &phand->nItemNum, 4);
3 w% P9 E) j0 l4 d$ g D2Net::D2SendToServer(5, 0, aPacket);
\0 `8 g0 o7 w8 ~# j& l' h& T return TRUE;% p9 s# A' i( e& Y2 u- _1 u
' |$ N) {' q2 F# K; t* T8 x }
. [- z# Z/ M8 d) O7 N+ ?
! V2 g1 y5 `* x' H5 R7 u4 } static BOOL PickStorageItemToCursor(DWORD dwItemID)
% x) z9 x+ Z" b {& c j8 S! O2 ~3 p) j6 A
PKTItemTellW8(PACKET_ITEMACTION, dwItemID, ITEM_ACTION_FROM_STORAGE, PacketItemMaxTick);
/ s6 @; s8 I1 s m( X) J8 A" i
. y' u- U( [$ l( J BYTE aPacket[5] = { 0 };
; l* z( @2 X6 ~! c- u ? aPacket[0] = 0x19;; X# R% C$ ^/ A! N# j' E. s
::memcpy(aPacket + 1, &dwItemID, 4);
9 Z7 P; k* H# T! X5 d //return D2Net::D2NetSendPacketToServer(0, aPacket, 5); q8 e1 ?6 t# T/ K1 D, x! q2 c
D2Net::D2SendToServer(5, 0, aPacket);
( p5 R9 I* E! N" Q& W; S' `9 ^/ L return TRUE;+ r$ w0 F! j( D! |7 M
}
0 h& L- G$ ^* F$ c! c) w
; L% s4 p0 D' |. A static BOOL InteractItem(DWORD ItemID1, DWORD ItemID2)
) w; H/ k7 D. G- D( k* w {
$ h- x- x: I" @8 e( w* P PKTItemTellW8(PACKET_ITEMACTION, ItemID1, ITEM_ACTION_FROM_STORAGE, PacketItemMaxTick);
5 H1 d1 `8 e; Q( r0 U# Z0 [ BYTE aPacket[17] = { 0x1f,0 };
4 k }. \: c$ ]: W ::memcpy(aPacket + 1, &ItemID1, 4);
( A Q) U0 B& p& |1 K ::memcpy(aPacket + 5, &ItemID2, 4);
6 P/ O4 M1 \- _) [# X( \" W //return D2Net::D2NetSendPacketToServer(0, aPacket, 17);) C% ?0 v2 F5 ` C! w% X
D2Net::D2SendToServer(17, 0, aPacket);5 W c6 l% G0 e3 f5 W
return TRUE;' r" s Q% x: k6 x+ W
}' ]6 @9 {; g' Z' |/ h7 p2 C
( A& t' f2 d$ R6 y) s% `8 d% c
static BOOL Transmute()0 I' m: M, P7 S1 Q5 \
{% X8 n+ ^1 m4 V+ O& X0 y
if (!(*D2Client::ptPlayerClient))return FALSE;, g; g' c( V' m" z
, }! U; Z; u: J
if (D2Common::D2GetCursorItem((*D2Client::ptPlayerClient)->ptInventory))
. ]4 Z9 i6 M( X return FALSE;" y' a( a" C9 _5 X3 f
6 l! I) p, ]8 i l: `" i$ ]; z
PKTItemTellW8(PACKET_NEWITEM, 0, ITEM_ACTION_TO_STORAGE, PacketItemMaxTick); F% z F* P T: @! D- E
BYTE aPacket[7] = { 0 };
, `2 E3 A' r( X0 w9 X aPacket[0] = 0x4f;
0 ?/ w" H! }0 F# v9 ^ aPacket[1] = 0x18;
& z' [3 z) ]0 U7 J' D# i$ X6 z D2Net::D2SendToServer(7, 0, aPacket);9 m8 [: q& k- P5 [$ d5 v
return TRUE;. v( ?: _5 z) h( u
}
& J3 ^ E7 p0 V- o};) m5 j) h8 V. R6 _, R, z
8 ]2 `* [4 I5 w3 }/ t: ? |
|