-
Notifications
You must be signed in to change notification settings - Fork 9
/
decode_0078_bak.txt
239 lines (237 loc) · 13.3 KB
/
decode_0078_bak.txt
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
If Asc(Mid(inData, 16, 1)) < &H389 Then
Dim NameID As Integer
Dim X As Integer
islist = False
Dim IsPet As Boolean
NameID = MakePort(Mid(inData, 15, 2))
If NameID > 1000 Then GoTo mons
'------------------------------ NPC List ------------------
If NameID = &H2D Then GoTo CheckPortal
If NameID < 40 Then GoTo CheckPeople
'Dim NPCid As Long
If Mid(inData, 3, 4) = CulVertNPC Then
Stat "Found [Culvert NPC] at " & CStr(MakeCoords(Mid(inData, 47, 3)).Y) & ":" & CStr(MakeCoords(Mid(inData, 47, 3)).X) & vbCrLf
End If
'---------- New Add
Dim foundMynpc As Boolean
foundMynpc = False
For X = 0 To UBound(myNPC)
If Mid(inData, 3, 4) = myNPC(X).ID Then
myNPC(X).pos = MakeCoords(Mid(inData, 47, 3))
myNPC(X).location = MapName
foundMynpc = True
Exit For
End If
Next
If Not foundMynpc Then
If myNPC(0).location <> "" Then ReDim Preserve myNPC(UBound(myNPC) + 1)
myNPC(UBound(myNPC)).ID = Mid(inData, 3, 4)
myNPC(UBound(myNPC)).pos = MakeCoords(Mid(inData, 47, 3))
myNPC(UBound(myNPC)).location = MapName
Winsock_SendPacket IntToChr(&H94) & Mid(inData, 3, 4), True
End If
If UBound(NPCList) > 0 Then
For X = 0 To UBound(NPCList) - 1
If Mid(inData, 3, 4) = NPCList(X).ID Then
Clear_Dot NPCList(X).pos
NPCList(X).pos = MakeCoords(Mid(inData, 47, 3))
Plot_Dot NPCList(X).pos, vbYellow
frmMain.UpdateNPC
GoTo end78
End If
Next
End If
NPCList(UBound(NPCList)).NameID = NameID
NPCList(UBound(NPCList)).ID = Mid(inData, 3, 4)
NPCList(UBound(NPCList)).pos = MakeCoords(Mid(inData, 47, 3))
Plot_Dot NPCList(UBound(NPCList)).pos, vbYellow
NPCList(UBound(NPCList)).NameID = MakePort(Mid(inData, 15, 2))
ReDim Preserve NPCList(UBound(NPCList) + 1)
If foundMynpc Then Winsock_SendPacket IntToChr(&H94) & Mid(inData, 3, 4), True
frmMain.UpdateNPC
GoTo end78
'--------- End Add
'------------------------------- Check Exit Portal -----------------------------------
CheckPortal:
If MakePort(Mid(inData, 15, 2)) = &H2D And Not PartyMode Then
Stat "Found Exit Portal at " & CStr(MakeCoords(Mid(inData, 47, 3)).Y) & ":" & CStr(MakeCoords(Mid(inData, 47, 3)).X) & " to " & GetWarpInfo(MapName, MakeCoords(Mid(inData, 47, 3)).Y, MakeCoords(Mid(inData, 47, 3)).X) & vbCrLf
ExitPortal(UBound(ExitPortal)).ID = Mid(inData, 3, 4)
ExitPortal(UBound(ExitPortal)).NameID = &H2D
ExitPortal(UBound(ExitPortal)).pos = MakeCoords(Mid(inData, 47, 3))
ReDim Preserve ExitPortal(UBound(ExitPortal) + 1)
GoTo end78
If Not CanGO(curPos, ExitPortal(UBound(ExitPortal) - 1).pos) Then GoTo end78
If Not MoveOnly And Not SellMode And AutoAI And Not IsOnWayPoint(curPos) Then
Stat "The Bot's waiting to teleport..." & vbCrLf
PortalTime = 0
frmMain.tmrPortal.Enabled = True
ElseIf Not Dead And Not SellMode And MoveOnly And (Not CanUseWP) And AutoAI Then
Stat "Map change go to start map..." + vbCrLf
Winsock_SendPacket IntToChr(&H64 + &H21) + _
MakeCoordString(MakeCoords(Mid(inData, 47, 3))), True
End If
DetectPortal = True
If CurAtkMonster.NameID > 0 And Not MakeDamage And Not IsOnWayPoint(curPos) Then
SkillCounter = 0
DamageCounter = 0
InFight = False
CurAtkMonster.NameID = 0
Clear_Dot CurAtkMonster.pos
CurAtkMonster.ID = String(4, Chr(0))
CurAtkMonster.pos.X = 0
CurAtkMonster.pos.Y = 0
AttCounter = 0
IsAggro = False
IsLock = False
IsDamage = False
CurMonsterName = "None"
frmMain.labCurMons.Caption = "[None]"
Stat "Stop Attacking..." + vbCrLf
TraceMons = False
If Make_Start_Point(curPos) Then
Stat "Back to waypoint..." & vbCrLf
move_to WayPoint(StartPoint)
BackWP = True
End If
End If
endexit:
GoTo end78
End If
'------------------------------- Update People -------------------------------------
CheckPeople:
Check_AvoidID (Mid(inData, 3, 4))
If UBound(People) > 0 Then
For X = 0 To UBound(People) - 1
If Mid(inData, 3, 4) = People(X).ID Then
Clear_Dot People(X).pos
People(X).pos = MakeCoords(Mid(inData, 47, 3))
Plot_Dot People(X).pos, PColor
frmMain.UpdatePeople
GoTo end78
End If
Next
End If
People(UBound(People)).ID = Mid(inData, 3, 4)
People(UBound(People)).pos = MakeCoords(Mid(inData, 47, 3))
Plot_Dot People(UBound(People)).pos, PColor
People(UBound(People)).NameID = MakePort(Mid(inData, 15, 2))
'R 0078 <ID>.l <speed>.w ?.w ?.w <option>.w <class>.w <hair>.w <weapon>.w <head option bottom>.w <sheild>.w <head option top>.w <head option mid>.w <hair color>.w ?.w <head dir>.w <guild>.w ?.w ?.w <manner>.w <karma>.w ?.B <sex>.B <X_Y_dir>.3B ?.B ?.B <sit>.B
' 3 7 9 11 13 15 17 19 21 23 25 27 29
People(UBound(People)).Shield = MakePort(Mid(inData, 21, 2))
People(UBound(People)).HeadB = MakePort(Mid(inData, 23, 2))
People(UBound(People)).HeadT = MakePort(Mid(inData, 25, 2))
People(UBound(People)).HeadM = MakePort(Mid(inData, 27, 2))
People(UBound(People)).HairC = MakePort(Mid(inData, 29, 2))
People(UBound(People)).Weapon = MakePort(Mid(inData, 19, 2))
People(UBound(People)).Hair = MakePort(Mid(inData, 17, 2))
People(UBound(People)).Class = Return_Class(People(UBound(People)).NameID)
If Asc(Mid(inData, 46, 1)) = 0 Then
People(UBound(People)).Sex = " <F>"
Else
People(UBound(People)).Sex = " <M>"
End If
If IsAvoidID(Mid(inData, 3, 4)) Then
CheckEvent "OnGMAppear", "name=" & Get_PeopleName(Mid(inData, 3, 4)) & Chr(0) & "job=" & People(UBound(People)).Class & Chr(0) & "posX=" & People(UBound(People)).pos.Y & Chr(0) & "posY=" & People(UBound(People)).pos.X & Chr(0) & "distance=" & EvalNorm(People(UBound(People)).pos, curPos)
ElseIf IsAvoid(People(UBound(People)).Name) And Len(People(UBound(People)).Name) > 0 Then
CheckEvent "OnAvoidListAppear", "name=" & Get_PeopleName(Mid(inData, 3, 4)) & Chr(0) & "job=" & People(UBound(People)).Class & Chr(0) & "posX=" & People(UBound(People)).pos.Y & Chr(0) & "posY=" & People(UBound(People)).pos.X & Chr(0) & "distance=" & EvalNorm(People(UBound(People)).pos, curPos)
ElseIf isWarpList(People(UBound(People)).Name) And Len(People(UBound(People)).Name) > 0 Then
CheckEvent "OnWarpListAppear", "name=" & Get_PeopleName(Mid(inData, 3, 4)) & Chr(0) & "job=" & People(UBound(People)).Class & Chr(0) & "posX=" & People(UBound(People)).pos.Y & Chr(0) & "posY=" & People(UBound(People)).pos.X & Chr(0) & "distance=" & EvalNorm(People(UBound(People)).pos, curPos)
Else
CheckEvent "OnPlayerAppear", "name=" & Get_PeopleName(Mid(inData, 3, 4)) & Chr(0) & "job=" & People(UBound(People)).Class & Chr(0) & "posX=" & People(UBound(People)).pos.Y & Chr(0) & "posY=" & People(UBound(People)).pos.X & Chr(0) & "distance=" & EvalNorm(People(UBound(People)).pos, curPos)
End If
Winsock_SendPacket IntToChr(&H94) & Mid(inData, 3, 4), True
ReDim Preserve People(UBound(People) + 1)
'If frmPeople.Visible = True Then
frmMain.UpdatePeople
'End If
GoTo end78
End If
Dim found As Boolean
Dim found2 As Boolean
mons:
found = False
islist = False
IsPet = False
If Asc(Mid(inData, 17, 1)) > 0 Then IsPet = True
For X = 0 To UBound(Attack)
If MakePort(Mid(inData, 15, 2)) = Attack(X).ID Then
found = True
Exit For
End If
Next
Dim tmpname As String
For X = 0 To UBound(Monsters)
If MakePort(Mid(inData, 15, 2)) = Monsters(X).ID Then
islist = True
tmpname = Monsters(X).Name
Exit For
End If
Next
If Mid(inData, 3, 4) = MyPet.ID And MyPet.Type = "" Then MyPet.Type = tmpname
'If islist Then
found2 = False
If UBound(MonsterList) > 0 Then
For X = 0 To UBound(MonsterList) - 1
If Mid(inData, 3, 4) = MonsterList(X).ID Then
found2 = True
If Not found Then MonsterList(X).NoAttack = True
If IsPet Then MonsterList(X).IsPet = True
Clear_Dot MonsterList(X).pos
MonsterList(X).pos = MakeCoords(Mid(inData, 47, 3))
MonsterList(X).StatusA = MakePort(Mid(inData, 9, 2))
MonsterList(X).StatusB = MakePort(Mid(inData, 11, 2))
If (MonsterList(X).StatusA > 0 And MonsterList(X).StatusA < 5) Or MonsterList(X).StatusB > 0 Then MonsterList(X).IsTrap = True
If CanGO(curPos, MonsterList(X).pos) Then MonsterList(X).CantGo = True
UpdateMonsterList
If MyPet.ID = MonsterList(X).ID Then
Plot_Dot MonsterList(X).pos, 16711935
ElseIf CurAtkMonster.ID <> MonsterList(X).ID Then
Plot_Dot MonsterList(X).pos, vbRed
Else
Plot_Dot MonsterList(X).pos, CurAtkColor
End If
CheckEvent "OnMonsterAppear", "name=" & MonsterList(X).Name & Chr(0) & "posX=" & MonsterList(X).pos.Y & Chr(0) & "posY=" & MonsterList(X).pos.X & Chr(0) & "distance=" & EvalNorm(curPos, MonsterList(X).pos)
Exit For
End If
Next
End If
If (Not Sitting) And (Not Pickup) And (Not InFight) And (CurAtkMonster.NameID > 0) Then SendAction = True
If Mid(inData, 3, 4) = CurAtkMonster.ID Then
If IsPet Then
Stat "This's a pet!, abort target..." & vbCrLf
Clear_This_Mons 0
GoTo endifcur
End If
CurAtkMonster.pos = MakeCoords(Mid(inData, 47, 3))
endifcur:
Update_CurrentMonster
End If
If Not found2 Then
If Not found Then MonsterList(UBound(MonsterList)).NoAttack = True
If IsPet Then MonsterList(UBound(MonsterList)).IsPet = True
MonsterList(UBound(MonsterList)).ID = Mid(inData, 3, 4)
MonsterList(UBound(MonsterList)).pos = MakeCoords(Mid(inData, 47, 3))
If MyPet.ID = MonsterList(UBound(MonsterList)).ID Then
Plot_Dot MonsterList(UBound(MonsterList)).pos, 16711935
Else
Plot_Dot MonsterList(UBound(MonsterList)).pos, vbRed
End If
MonsterList(UBound(MonsterList)).StatusA = MakePort(Mid(inData, 9, 2))
MonsterList(UBound(MonsterList)).StatusB = MakePort(Mid(inData, 11, 2))
If (MakePort(Mid(inData, 9, 2)) > 0 And MakePort(Mid(inData, 9, 2)) < 5) Or MakePort(Mid(inData, 11, 2)) > 0 Then MonsterList(UBound(MonsterList)).IsTrap = True
MonsterList(UBound(MonsterList)).NameID = MakePort(Mid(inData, 15, 2))
MonsterList(UBound(MonsterList)).IsAttack = False
If islist Then MonsterList(UBound(MonsterList)).Name = tmpname
CheckEvent "OnMonsterAppear", "name=" & MonsterList(UBound(MonsterList)).Name & Chr(0) & "posX=" & MonsterList(UBound(MonsterList)).pos.Y & Chr(0) & "posY=" & MonsterList(UBound(MonsterList)).pos.X & Chr(0) & "distance=" & EvalNorm(MonsterList(UBound(MonsterList)).pos, curPos)
If IsPet Then Winsock_SendPacket IntToChr(&H94) & Mid(inData, 3, 4), True
ReDim Preserve MonsterList(UBound(MonsterList) + 1)
UpdateMonsterList
End If
If CurAtkMonster.NameID > 0 Then
If EvalNorm(CurAtkMonster.pos, curPos) > 2 Then SendAction = True
End If
'End If
If Not islist And NameID > 20 And Not IsPet Then
Stat "Unknow Monster " & MakeHexName(Mid(inData, 15, 2)) & vbCrLf
Winsock_SendPacket IntToChr(&H94) & Mid(inData, 3, 4), True
End If