This repository has been archived by the owner on Nov 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathManor.l2s
235 lines (194 loc) · 5.52 KB
/
Manor.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
// Manor 1.6 by AdiFenix
//////////////////////////////////////////////////////////////////
DEFINE_GLOBAL Arraylist SED_ID 0
DEFINE_GLOBAL Arraylist ILO 0
DEFINE_GLOBAL Arraylist MAN 0
DEFINE_GLOBAL Arraylist u_id 0
/////////////////////////////////////////////////////////////////////
///////////////////// Manor /////////////////////////////////////////
// 1 - gludio ///2 - dion // 3 - giran // 4 - oren // 5 -aden
// 6 - innadril // 7 - goddard // 8 - rune // 9 - schuttgard
///////////////////////////////////////////////////////////////////////
SED_ID.add #I6544
ILO.add #I270
MAN.add #I8
//bluecoba - rune
SED_ID.add #I6541
ILO.add #I1080
MAN.add #I8
// - godard
SED_ID.add #I6541
ILO.add #I300
MAN.add #I7
//gold coba -rune
SED_ID.add #I6543
ILO.add #I300
MAN.add #I8
// - godard
SED_ID.add #I6543
ILO.add #I319
MAN.add #I7
// red coba
SED_ID.add #I6542
ILO.add #I1002
MAN.add #I8
// - goddard
SED_ID.add #I6542
ILO.add #I1002
MAN.add #I7
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
/////////////// Dont change anything below /////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
DEFINE_GLOBAL int zaeve 0
DEFINE_GLOBAL int ok 0
DEFINE_GLOBAL int check_last 0
DEFINE_GLOBAL int Gmsg 0
Define int temp_spr1 0
Define string Man_name "Manor Manager"
Define int dyst_man 0
///////////////////////
if SED_ID.count != ILO.count
PRINT_TEXT " Data corrupt ! - Script Stopped"
Jump_to_label koni
else
if SED_ID.count != MAN.count
PRINT_TEXT " Data corrupt ! - Script Stopped "
Jump_to_label koni
endif
ENDIF
for a 0 "<&ILO.count&>" 1
ITEM_COUNT temp_spr1 "<&SED_ID.a&>"
sleep 250
if temp_spr1 < ILO.a
PRINT_TEXT "You typed too much crops to sell = <&ILO.a&> in inv u have = <&temp_spr1&> - Script Stopped"
Jump_to_label koni
ENDIF
next
for a 0 "<&man.count&>" 1
if man.a < 1
PRINT_TEXT " manor nr ---??? - check data ! - Script Stopped"
jump_to_label koni
ENDIF
if man.a > 9
PRINT_TEXT " manor nr +++??? - check data ! - Script Stopped"
jump_to_label koni
ENDIF
next
IF target_name != Man_name
COMMAND "/Target <&Man_name&>"
ENDIF
sleep 500
IF target_name == Man_name
DISTANCE dyst_man CHAR_X CHAR_Y CHAR_Z TARGET_X TARGET_Y TARGET_Z
if dyst_man > 150
PRINT_TEXT " You need to be closer to Manor manager !! - Script Stopped"
jump_to_label koni
endif
ELSE
PRINT_TEXT " I dont see - Manor manager - Script Stopped"
jump_to_label koni
ENDIF
/////////////////////////////////////////////
define int temmm 0
for a o "<&SED_ID.count&>" 1
INVEN_GET_UID temmm "<&SED_ID.a&>"
u_id.add temmm.clone
next
PRINT_TEXT "-------------------------------------------------------------------"
PRINT_TEXT "AUTO Sell crops v1.6 EPILOGUE by AdiFenix"
PRINT_TEXT "-------------------------------------------------------------------"
SET_EVENT "<&SCRIPTEVENT_SERVERPACKETEX&>" "<&SYSTEM_CURRENTFILE&>" Buy_fun 120
SET_EVENT "<&SCRIPTEVENT_SERVERPACKET&>" "<&SYSTEM_CURRENTFILE&>" sysmas 98
sleep 500
Call prepare_1
do
sleep 1000
loop zaeve < SED_ID.count
Label koni
END_SCRIPT
FUNCTION prepare_1
define int zm1 0
ok = 1
do
Gmsg = 0
NPC_DIALOG "bypass -h manor_menu_select?ask=9&state=<&SED_ID.0&>&time=0"
do
sleep 5
loop Gmsg == 0
if ok == 1
sleep 600
endif
loop ok != 0
if SED_ID.count > 1
sleep 600
for i 1 "<&SED_ID.count&>" 1
check_last = 1
NPC_DIALOG "bypass -h manor_menu_select?ask=9&state=<&SED_ID.i&>&time=0"
do
sleep 2
loop check_last == 1
sleep 600
NEXT
endif
RETURN VOID
FUNCTION Buy_fun
ok = 0
Gmsg = 1
Define int Man_ok 0
Define int temp_seed 0
Define int ile_man 0
Define int temp_manor 0
Define int ilo_sed 0
Define int price 0
Define int temp_uid 0
packet.READ_BYTE null
packet.READ_INT16 null
packet.READ_INT32 temp_seed
FOR b 0 "<&SED_ID.count&>" 1
if temp_seed == SED_ID.b
packet.READ_INT32 ile_man
IF ile_man == 0
PRINT_TEXT "Manor with this type of croops (<&temp_seed&>) = 0 "
endif
for a 0 "<&ile_man&>" 1
packet.READ_INT32 temp_manor
if temp_manor == man.b
packet.READ_INT64 ilo_sed
packet.READ_INT64 price
packet.READ_BYTE null
PRINT_TEXT " Slots available = <&ilo_sed&> Price <&price&> ID = <&temp_seed&>"
IF ilo_sed < ILO.b
inject "D0 02 00 01 00 00 00 <&u_id.b.GET_HEX32&> <&temp_seed.GET_HEX32&> <&temp_manor.GET_HEX32&> <&ilo_sed.GET_HEX32&> 00 00 00 00"
ELSE
inject "D0 02 00 01 00 00 00 <&u_id.b.GET_HEX32&> <&temp_seed.GET_HEX32&> <&temp_manor.GET_HEX32&> <&ilo.b.GET_HEX32&> 00 00 00 00"
ENDIF
ELSE
packet.READ_INT64 null
packet.READ_INT64 null
packet.READ_BYTE null
PRINT_TEXT "Diferent man.: <&temp_manor&> for <&temp_seed&> "
ENDIF
NEXT
endif
next
if check_last == 1
check_last = 0
endif
zaeve = zaeve + 1
RETURN VOID
FUNCTION sysmas
define int man_mani 879
define int temp_id 0
packet.read_byte null
packet.read_int32 temp_id
if temp_id == man_mani
Gmsg = 1
endif
RETURN VOID