-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodPackets.bas
161 lines (152 loc) · 4.03 KB
/
modPackets.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
Attribute VB_Name = "Packets"
Declare Sub SendPacket Lib "packet.dll" (ByVal ProcessID As Long, ByRef Packet() As Byte, Optional ByVal Encrypt As Byte = True, Optional ByVal SafeArray As Byte = True)
Sub sPck(pck() As Byte)
If Compiled = True Then On Error Resume Next
'For a = 0 To UBound(pck)
' tmp = tmp & Hex(pck(a)) & " · "
'Next
'MsgBox tmp
GetWindowThreadProcessId tHvnd, P_ID
SendPacket P_ID, pck
End Sub
Sub Attack(ID As Long)
If Compiled = True Then On Error Resume Next
Dim pck(6) As Byte
pck(0) = &H5
pck(1) = &H0
pck(2) = &HA1
pck(3) = l2b(ID, 1)
pck(4) = l2b(ID, 2)
pck(5) = l2b(ID, 3)
pck(6) = &H40
sPck pck
mWriteLong BOX_3, ID
End Sub
Sub Logout()
If Compiled = True Then On Error Resume Next
'Dim pck(2) As Byte
'pck(0) = &H1
'pck(1) = &H0
'pck(2) = &H14
sPck s2ba("1 0 14") 'pck
End Sub
Sub aFollow()
If Compiled = True Then On Error Resume Next
'Dim pck(5) As Byte
'pck(0) = &H4
'pck(1) = &H0
'pck(2) = &HA0
'pck(3) = &H1
'pck(4) = &H1
'pck(5) = &H1
sPck s2ba("4 0 A0 1 1 1") 'pck
End Sub
Sub use_WithCont(ID As Long, X As Long, Y As Long, Z As Long, Spot As Long, Cont As Long, Optional TileID As Long)
If Compiled = True Then On Error Resume Next
If Spot = -1 Or Cont = -1 Then Exit Sub
Dim pck(18) As Byte
pck(0) = &H11
pck(1) = &H0
pck(2) = &H83
pck(3) = &HFF
pck(4) = &HFF
pck(5) = (Cont + 63)
pck(6) = &H0
pck(7) = Spot - 1
pck(8) = lbol(ID)
pck(9) = hbol(ID)
pck(10) = Spot - 1
pck(11) = lbol(X)
pck(12) = hbol(X)
pck(13) = lbol(Y)
pck(14) = hbol(Y)
pck(15) = Z
If TileID = 0 Then 'mob
pck(16) = &H63
pck(17) = &H0
pck(18) = &H1
Else 'ground
pck(16) = lbol(TileID)
pck(17) = hbol(TileID)
pck(18) = &H0
End If
sPck pck
End Sub
Sub lodItem(Slot As Integer, ID As Long, Cont As Long, iCont As Long, Optional iCount As Integer = 1)
If Compiled = True Then On Error Resume Next
Dim pck(16) As Byte
pck(0) = &HF
pck(1) = &H0
pck(2) = &H78
pck(3) = &HFF
pck(4) = &HFF
pck(5) = (Cont + 63)
pck(6) = &H0
pck(7) = iCont - 1
pck(8) = lbol(ID)
pck(9) = hbol(ID)
pck(10) = iCont - 1
pck(11) = &HFF
pck(12) = &HFF
pck(13) = Slot '2=amulet, 6=left, 9=ring, a=ammo
pck(14) = &H0
pck(15) = &H0
pck(16) = iCount
sPck pck
End Sub
Sub tosItem(Slot As Integer, ID As Long, Cont As Long, Optional iCount As Integer = 1)
If Compiled = True Then On Error Resume Next
Dim pck(16) As Byte
pck(0) = &HF
pck(1) = &H0
pck(2) = &H78
pck(3) = &HFF
pck(4) = &HFF
pck(5) = Slot '2=amulet, 6=left, 9=ring, a=ammo
pck(6) = &H0
pck(7) = &H0
pck(8) = lbol(ID)
pck(9) = hbol(ID)
pck(10) = &H0
pck(11) = &HFF
pck(12) = &HFF
pck(13) = (Cont + 63)
pck(14) = &H0
pck(15) = &H0
pck(16) = iCount
sPck pck
End Sub
Sub useItem(ID As Long, Cont As Long, iCont As Long)
If Compiled = True Then On Error Resume Next
Dim pck(11) As Byte
pck(0) = &HA
pck(1) = &H0
pck(2) = &H82
pck(3) = &HFF
pck(4) = &HFF
pck(5) = Cont + 63
pck(6) = &H0
pck(7) = iCont - 1
pck(8) = lbol(ID)
pck(9) = hbol(ID)
pck(10) = iCont - 1
pck(11) = Cont - 1
sPck pck
End Sub
Sub OpenBody(X As Long, Y As Long, Z As Long, MobID As Long, RelPos As Long, OpenBPs As Long)
If Compiled = True Then On Error Resume Next
Dim pck(11) As Byte
pck(0) = &HA
pck(1) = &H0
pck(2) = &H82
pck(3) = l2b(X, 1)
pck(4) = l2b(X, 2)
pck(5) = l2b(Y, 1)
pck(6) = l2b(Y, 2)
pck(7) = Z
pck(8) = l2b(MobID, 1)
pck(9) = l2b(MobID, 2)
pck(10) = RelPos '2 if you're standing next to creature. 3 if you're standing on it
pck(11) = OpenBPs 'Number of open backpacks
sPck pck
End Sub