forked from mochja/l2.net-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
L2UNIT_MC.l2s
248 lines (223 loc) · 5.42 KB
/
L2UNIT_MC.l2s
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
240
241
242
243
244
245
246
247
248
// Kratky popis
// Server:
// Autor: mochitto
// Date:
// Special thanks for L2.NET contributors
// rev.: 0
PRINT_TEXT "SCRIPT STARTED!]"
INCLUDE "DLIB\Packets\Classes\SystemMessage.l2c"
INCLUDE "StdLib\Player.l2c"
SET_EVENT "<&SCRIPTEVENT_SERVERPACKET&>" "<&SYSTEM_CURRENTFILE&>" SYSTEMMESSAGE 98
SET_EVENT "<&SCRIPTEVENT_SERVERPACKET&>" "<&SYSTEM_CURRENTFILE&>" NPCHTMLWINDOW 25
SET_EVENT "<&SCRIPTEVENT_SELFDIE&>" "<&SYSTEM_CURRENTFILE&>" SELFDIE
DEFINE_GLOBAL INT COMM 0
DEFINE_GLOBAL INT IN_PROCESS 0
// Main section
// ===============================
THREAD MP
SLEEP 100
THREAD PLAYERS
WHILE ONE == ONE
SLEEP 1278
WEND
PRINT_TEXT "SCRIPT STOPED!]"
END_SCRIPT
FUNCTION SELFDIE
BOTSET ACTIVE_TARGET_ON "<&FALSE&>"
BOTSET ACTIVE_ATTACK_ON "<&FALSE&>"
PLAYWAV "targeting.wav"
DEFINE INT RAND
GET_RAND RAND 3000 6000
SLEEP "<&RAND&>"
TAP_TO TOWN
SLEEP "<&RAND&>"
GO_TO VOID 3 -84144 244571 -3731
SLEEP "<&RAND&>"
COMMAND "/TARGET ROXXY"
COMM = #i1
SLEEP 1000
TALK_TARGET
RETURN VOID
FUNCTION NPCHTMLWINDOW
DEFINE STRING _html
DEFINE INT N1
DEFINE INT N2
DEFINE INT N3
PACKET.READ_BYTE NULL
PACKET.READ_INT32 NULL
PACKET.READ_STRING _html
SLEEP 800
DEFINE STRING LINK1 "bypass -h npc_<&TARGET_ID&>_Chat 1"
DEFINE STRING LINK2 "bypass -h npc_<&TARGET_ID&>_goto 25"
DEFINE STRING LINK3 "bypass -h Quest 555_NPCBuffer cast 1142 x x"
DEFINE STRING LINK4 "bypass -h npc_<&TARGET_ID&>_Chat 4"
DEFINE STRING LINK5 "bypass -h npc_<&TARGET_ID&>_goto 200948"
SWITCH COMM
CASE #i1
IF "_html.CONTAINS LINK1" == TRUE
COMM = #i2
NPC_DIALOG "<&LINK1&>"
PRINT_TEXT "Click <&LINK1&>"
ENDIF
BREAK 1
CASE #i2
IF "_html.CONTAINS LINK2" == TRUE
COMM = #i10
NPC_DIALOG "<&LINK2&>"
PRINT_TEXT "Click <&LINK2&>"
SLEEP 5000
COMMAND "/TARGET Cruma Border"
SLEEP 1000
TALK_TARGET
COMM = #i3
ENDIF
BREAK 1
//buff
CASE #i3
IF "_html.CONTAINS LINK3" == TRUE
COMM = #i10
NPC_DIALOG "<&LINK3&>"
PRINT_TEXT "Click <&LINK3&>"
/*
SLEEP 1000
COMMAND "/TARGET Leikar"
SLEEP 1000
TALK_TARGET
SLEEP 1000
ITEM_COUNT N1 728
ITEM_COUNT N2 3952
ITEM_COUNT N3 1467
IF N1 < 500
N1 = 1
//MANA
INJECT "B0 A9 23 00 00 E0 FD 1C 00 <&N1.GET_HEX32&>00 00 00 00 00 00 00 00 00 00 00 00 00 00 FE FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00"
ENDIF
SLEEP 1000
IF N2 < 1000
N2 = 1
//SBPS
INJECT "B0 A9 23 00 00 40 77 1B 00 <&N2.GET_HEX32&>00 00 00 00 00 00 00 00 00 00 00 00 00 00 FE FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00"
ENDIF
SLEEP 1000
IF N3 < 15000
N3 = 15000 - N3
N3 = N3 / 1000
//SS
INJECT "B0 A9 23 00 00 C0 27 09 00 <&N3.GET_HEX32&>00 00 00 00 00 00 00 00 00 00 00 00 00 00 FE FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00"
ENDIF
*/
SLEEP 1000
COMMAND "/TARGET Trisha"
COMM = #i4
SLEEP 1000
TALK_TARGET
ENDIF
BREAK 1
CASE #i4
IF "_html.CONTAINS LINK4" == TRUE
COMM = #i5
NPC_DIALOG "<&LINK4&>"
PRINT_TEXT "Click <&LINK4&>"
ENDIF
BREAK 1
CASE #i5
IF "_html.CONTAINS LINK5" == TRUE
COMM = #i10
NPC_DIALOG "<&LINK5&>"
PRINT_TEXT "Click <&LINK5&>"
SLEEP 5000
GO_TO VOID 3 -79448 -174904 -10728
SLEEP 1000
BOTSET ACTIVE_TARGET_ON "<&TRUE&>"
BOTSET ACTIVE_ATTACK_ON "<&TRUE&>"
USE_SKILL 312 // VISIOU STANCE
ENDIF
BREAK 1
ENDSWITCH
RETURN VOID
FUNCTION GO_TO 3 X Y Z
DEFINE INT TDIST 0
DISTANCE TDIST X Y 0 CHAR_X CHAR_Y 0
WHILE TDIST > #i50
MOVE_TO "<&X&>" "<&Y&>" "<&Z&>"
SLEEP 1000
DISTANCE TDIST X Y 0 CHAR_X CHAR_Y 0
SLEEP 25
WEND
RETURN VOID
FUNCTION SYSTEMMESSAGE
IF IN_PROCESS == 1
RETURN VOID
ENDIF
DEFINE INT TMP_ID
DEFINE INT THP
DEFINE INT DMG
DEFINE INT SLEEPT
PACKET.READ_BYTE NULL
PACKET.READ_INT32 TMP_ID
IF TMP_ID == 2261
PACKET.READ_INT32 NULL
PACKET.READ_INT32 NULL
PACKET.READ_STRING NULL
PACKET.READ_INT32 NULL
PACKET.READ_STRING NULL
PACKET.READ_INT32 DMG
THP = TARGET_MAX_HP / 2
IF (DMG < 700) && (TARGET_CUR_HP > THP)
IN_PROCESS = 1
SLEEP 300
SKILL_GET_REUSE SLEEPT 122
SLEEP "<&SLEEPT&>"
USE_SKILL 122
SLEEP 5000
IN_PROCESS = 0
ENDIF
ENDIF
RETURN VOID
FUNCTION MP
print_text "MP thread started.."
DEFINE INT ASD 0
DEFINE INT ASD2 0
DEFINE INT MPPOTS 0
WHILE ZERO == ZERO
ITEM_COUNT MPPOTS 728
IF MPPOTS > #i1
ASD = CHAR_MAX_MP * 11
ASD = ASD / 100
IF (CHAR_CUR_MP < ASD)
ASD2 = CHAR_MAX_MP - 200
WHILE (CHAR_CUR_MP < ASD2)
ITEM_COUNT MPPOTS 728
IF MPPOTS > #i1
USE_ITEM 728 // Mana Potion
ELSE
BREAK 2
ENDIF
SLEEP 600
WEND
ENDIF
ELSE
SLEEP 10000
ENDIF
SLEEP 25
WEND
RETURN VOID
FUNCTION PLAYERS
DEFINE INT DIST
DEFINE ARRAYLIST PLAYERS
print_text "PLAYERS thread started.."
WHILE ZERO == ZERO
IF CHAR_CUR_HP != 0
GET_PLAYERS PLAYERS
FOREACH I PLAYER PLAYERS
DISTANCE DIST CHAR_X CHAR_Y 0 PLAYERS.I.DEST_X PLAYERS.I.DEST_Y 0
IF DIST < 600
//NMESSAGE_BOX "WARNING" "Player near you....."
PLAYWAV "targeting.wav"
SLEEP 10000
ENDIF
NEXTEACH
ENDIF
SLEEP 1000
WEND
RETURN VOID