ChestQuest.lua

main 779 lines · 29.8 KB Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1local TEMPLO_CORES = {
2 [00] = {
3 [01] = {LEVER = {23496, 23500}, POS = {3692, 1708, 05}},
4 [02] = {LEVER = {23497, 23501}, POS = {3693, 1708, 05}},
5 [03] = {LEVER = {23498, 23502}, POS = {3694, 1708, 05}},
6 [04] = {LEVER = {23499, 23503}, POS = {3695, 1708, 05}},
7 [05] = {LEVER = {09827, 09828}, POS = {3696, 1708, 05}},
8 };
9 [01] = {
10 [01] = {23500, 23497, 23498, 23499, 09828}, -- O X X X O
11 [02] = {23496, 23501, 23502, 23499, 09827}, -- X O O X X
12 [03] = {23496, 23501, 23498, 23503, 09827}, -- X O X O X
13 [04] = {23500, 23501, 23498, 23499, 09827}, -- O O X X X
14 [05] = {23496, 23497, 23502, 23503, 09827}, -- X X O O X
15 [06] = {23500, 23497, 23502, 23499, 09827}, -- O X O X X
16 [07] = {23496, 23501, 23498, 23499, 09828}, -- X O X X O
17 [08] = {23496, 23497, 23502, 23499, 09828}, -- X X O X O
18 [09] = {23500, 23497, 23498, 23503, 09827}, -- O X X O X
19 };
20 }
21local function onResetLever()
22 for X = 01, 05 do
23 local alaPos = Position(TEMPLO_CORES[00][X].POS[01], TEMPLO_CORES[00][X].POS[02], TEMPLO_CORES[00][X].POS[03])
24 local item = Tile(alaPos):getItemById(TEMPLO_CORES[00][X].LEVER[02]) or false
25
26 if item then
27 item:transform(TEMPLO_CORES[00][X].LEVER[01])
28 alaPos:sendMagicEffect(13)
29 end
30 end
31end
32function onUse(player, item, fromPosition, target, toPosition, isHotkey)
33 local QUEST_UNLOCK = {
34 [10155] = 10812; -- FIRST HERO QUEST
35 [10156] = 10813; -- DEAD TREE QUEST
36 [10157] = 10816; -- BEAR CAVE QUEST
37 [10158] = 10817; -- WASP CAVE QUEST
38 [10159] = 10818; -- SPIDER CAVE QUEST
39 [10160] = 10819; -- WINTER WOLF CAVE QUEST
40 [10161] = 10820; -- GIANT POWER QUEST
41 [10162] = 10821; -- MOSS SHIP QUEST
42 [10163] = 10822; -- TORTOISE QUEST
43 [10164] = 10823; -- JACK REAPER QUEST
44 [10165] = 10824; -- TERRAMITE QUEST
45 [10166] = 10825; -- UNDEAD SWAMP QUEST
46 [10167] = 10826; -- FROZEN FURY QUEST
47 [10168] = 10827; -- LEAF FORTRESS QUEST
48 [10169] = 10815; -- SEAGULL ISLAND QUEST
49
50 [10170] = _SYSTEM.RECYCLER_STORAGE; -- MEMORIAS
51 [10172] = _SYSTEM.RECYCLER_STORAGE; -- MEMORIAS
52 [10173] = _SYSTEM.RECYCLER_STORAGE; -- MEMORIAS
53 [10174] = _SYSTEM.RECYCLER_STORAGE; -- MEMORIAS
54 [10175] = _SYSTEM.RECYCLER_STORAGE; -- ARVORE DA MORTE
55 [10176] = _SYSTEM.RECYCLER_STORAGE; -- TEMPLO DAS CORES
56 [10177] = _SYSTEM.RECYCLER_STORAGE; -- TEMPLO DAS CORES
57 [10180] = _SYSTEM.RECYCLER_STORAGE; -- TEMPLO DAS CORES
58 [10181] = _SYSTEM.RECYCLER_STORAGE; -- TEMPLO DAS CORES
59 [10182] = _SYSTEM.RECYCLER_STORAGE; -- TEMPLO DAS CORES
60 [10183] = 10958; -- ENIGMA DA SERPENTE
61 [10184] = 10958; -- ENIGMA DA SERPENTE
62 [10185] = 10958; -- ENIGMA DA SERPENTE
63 }
64 if item.uid == 10186 then
65 if player:getStorageValue(_QUESTLOG[169].UID_01) == 05 then
66 player:setStorageValue(_QUESTLOG[169].UID_01, 06)
67
68 player:teleportTo({x=3651, y=1707, z=07})
69 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
70 doBackpack(player, 12)
71 addEvent(function() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.") end, 2 * 1000)
72
73 return false
74 end
75 end
76 if item.uid == 10187 then
77 if player:getStorageValue(_QUESTLOG[171].UID_01) == 02 then
78 player:setStorageValue(_QUESTLOG[171].UID_01, 03)
79
80 doBackpack(player, 12)
81 player:sendCancelMessage("@RemoveMarkMap")
82 player:getPosition():sendMagicEffect(13)
83 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
84 end
85 return false
86 end
87 if item.uid == 10188 then
88 if player:getStorageValue(_QUESTLOG[171].UID_01) == 03 then
89 player:setStorageValue(_QUESTLOG[171].UID_01, 04)
90
91 doBackpack(player, 12)
92 player:sendCancelMessage("@RemoveMarkMap")
93 player:getPosition():sendMagicEffect(13)
94 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
95 end
96 return false
97 end
98 if item.uid == 10189 then
99 if player:getStorageValue(_QUESTLOG[171].UID_01) == 04 then
100 player:setStorageValue(_QUESTLOG[171].UID_01, 05)
101
102 doBackpack(player, 12)
103 player:sendCancelMessage("@RemoveMarkMap")
104 player:getPosition():sendMagicEffect(13)
105 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
106 end
107 return false
108 end
109 if item.uid == 10190 then
110 if player:getStorageValue(_QUESTLOG[175].UID_01) == 02 then
111 player:setStorageValue(_QUESTLOG[175].UID_01, 03)
112
113 doBackpack(player, 12)
114 player:sendCancelMessage("@RemoveMarkMap")
115 player:getPosition():sendMagicEffect(13)
116 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
117 end
118 return false
119 end
120 if item.uid == 10191 then
121 if player:getStorageValue(_QUESTLOG[176].UID_01) == 02 then
122 player:setStorageValue(_QUESTLOG[176].UID_01, 03)
123
124 doBackpack(player, 12)
125 player:sendCancelMessage("@RemoveMarkMap")
126 player:getPosition():sendMagicEffect(13)
127 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
128 end
129 return false
130 end
131 if item.uid == 10192 then
132 if player:getStorageValue(_QUESTLOG[180].UID_01) == 02 then
133 player:setStorageValue(_QUESTLOG[180].UID_01, 03)
134
135 doBackpack(player, 12)
136 player:sendCancelMessage("@RemoveMarkMap")
137 player:getPosition():sendMagicEffect(13)
138 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
139 end
140 return false
141 end
142 if item.uid == 10193 then
143 if player:getStorageValue(_QUESTLOG[180].UID_01) == 03 then
144 player:setStorageValue(_QUESTLOG[180].UID_01, 04)
145
146 doBackpack(player, 12)
147 player:sendCancelMessage("@RemoveMarkMap")
148 player:getPosition():sendMagicEffect(13)
149 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
150 end
151 return false
152 end
153 if item.uid == 10194 then
154 if player:getStorageValue(_QUESTLOG[180].UID_01) == 04 then
155 player:setStorageValue(_QUESTLOG[180].UID_01, 05)
156
157 doBackpack(player, 12)
158 player:sendCancelMessage("@RemoveMarkMap")
159 player:getPosition():sendMagicEffect(13)
160 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
161 end
162 return false
163 end
164 if item.uid == 10195 then
165 if player:getStorageValue(_QUESTLOG[188].UID_01) == 02 then
166 player:setStorageValue(_QUESTLOG[188].UID_01, 03)
167
168 doBackpack(player, 12)
169 player:sendCancelMessage("@RemoveMarkMap")
170 player:getPosition():sendMagicEffect(13)
171 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
172 end
173 return false
174 end
175 if item.uid == 10196 then
176 if player:getStorageValue(_QUESTLOG[195].UID_01) == 02 then
177 player:setStorageValue(_QUESTLOG[195].UID_01, 03)
178
179 doBackpack(player, 12)
180 player:sendCancelMessage("@RemoveMarkMap")
181 player:getPosition():sendMagicEffect(13)
182 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
183 end
184 return false
185 end
186 if item.uid == 10199 then
187 if player:getStorageValue(_QUESTLOG[121].UID_01) == 04 then
188 player:teleportTo({x=3577, y=1673, z=08})
189 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
190 elseif player:getStorageValue(_QUESTLOG[121].UID_01) == 03 then
191 player:teleportTo({x=3577, y=1673, z=08})
192 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
193 elseif player:getStorageValue(_QUESTLOG[121].UID_01) == 02 then
194 player:setStorageValue(_QUESTLOG[121].UID_01, 03)
195 player:teleportTo({x=3577, y=1673, z=08})
196 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
197
198 doBackpack(player, 12)
199 player:sendCancelMessage("@RemoveMarkMap")
200 player:getPosition():sendMagicEffect(13)
201 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
202 end
203 return false
204 end
205 if item.uid == 10272 then
206 if player:getStorageValue(_QUESTLOG[186].UID_01) == 02 then
207 player:setStorageValue(_QUESTLOG[186].UID_01, 03)
208
209 doBackpack(player, 12)
210 player:sendCancelMessage("@RemoveMarkMap")
211 player:getPosition():sendMagicEffect(13)
212 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
213 return false
214 end
215 end
216 if item.uid == 10273 then
217 if player:getStorageValue(_QUESTLOG[197].UID_01) == 02 then
218 player:setStorageValue(_QUESTLOG[197].UID_01, 03)
219 player:setStorageValue(11034, 00)
220
221 player:getPosition():sendMagicEffect(13)
222 addEvent(function() player:say('Eso debe ser suerte.', TALKTYPE_SAY) end, 2000)
223 addEvent(function() player:say('Que desastre...', TALKTYPE_SAY) end, 6000)
224 addEvent(function() player:say('Deben haber sido los mercenarios. Necesito advertir a Towncryer.', TALKTYPE_SAY) end, 10000)
225 addEvent(function()
226 local from = {x=3876, y=1529, z=04}
227 local to = {x=3882, y=1531, z=04}
228 for A = from.x, to.x do
229 for B = from.y, to.y do
230 for C = from.z, to.z do
231 local tile = Tile(A, B, C)
232 local others = tile:getTopCreature()
233 if tile then
234 if others and others:isPlayer() and others ~= player then
235 others:teleportTo({x=3890, y=1533, z=05})
236 others:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
237 return false
238 end
239 end
240 end
241 end
242 end
243 end, 12000)
244
245 addEvent(function()
246 Game.createMonster("Mercenario", {x=3882, y=1529, z=04})
247 Game.createMonster("Mercenario", {x=3882, y=1531, z=04})
248 addEvent(function()
249 if player then
250 Game.createMonster("Mercenario", {x=3882, y=1529, z=04})
251 Game.createMonster("Mercenario", {x=3882, y=1531, z=04})
252 addEvent(function()
253 Game.createMonster("Mercenario", {x=3882, y=1529, z=04})
254 Game.createMonster("Mercenario", {x=3882, y=1531, z=04})
255 return false
256 end, 10000)
257 else
258 return false
259 end
260 end, 10000)
261 end, 13000)
262 return false
263 end
264 end
265
266 -- 10272 > 10299
267 if QUEST_UNLOCK[item.uid] then
268 if player:getStorageValue(QUEST_UNLOCK[item.uid]) == 01 then
269 player:setStorageValue(QUEST_UNLOCK[item.uid], 02)
270
271 doBackpack(player, 12)
272 player:sendCancelMessage("@RemoveMarkMap")
273 player:sendCancelMessage("@LoadQuestMap")
274 player:sendCancelMessage("@LoadQuestWindows")
275 player:getPosition():sendMagicEffect(13)
276
277 addEvent(function() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.") end, 5000)
278 end
279 end
280 if item.uid == 10160 then
281 local msg = [[
282 Carta Oculta:
283
284
285 Entonces, entre en su guarida y encontre este loco mecanismo en el suelo. En realidad encontre dos.
286
287 Del otro lado me di cuenta que esto paso cuando el lobo paso por encima del otro mecanismo.
288
289
290 Deje tu equipo alli. Creo que estara seguro hasta que regreses.
291 Cuando leas esta carta, rompela.
292 ]]
293 player:popupFYI(msg)
294
295 elseif item.uid == 10163 then
296 local msg = [[
297
298 Cenaremos huevos de tortuga. Repito, huevos de tortuga para cenar.
299
300 jajajaja
301
302 ]]
303 player:popupFYI(msg)
304
305 elseif item.uid == 10170 then
306 if player:getStorageValue(_QUESTLOG[121].UID_01) == 04 then
307 player:teleportTo({x=3567, y=1679, z=10})
308 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
309 else
310 if player:getStorageValue(_SYSTEM.RECYCLER_STORAGE) < 01 then
311 player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, 01)
312
313 player:getPosition():sendMagicEffect(13)
314 elseif player:getStorageValue(_QUESTLOG[121].UID_01) == 04 then
315 player:teleportTo({x=3567, y=1678, z=10})
316 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
317 end
318 end
319
320 elseif item.uid == 10171 then
321 if player:getStorageValue(_QUESTLOG[121].UID_01) == 01 then
322 player:setStorageValue(_QUESTLOG[121].UID_01, 02)
323
324 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
325 player:getPosition():sendMagicEffect(13)
326 doBackpack(player, 12)
327 player:sendCancelMessage("@RemoveMarkMap")
328 player:sendCancelMessage("@LoadQuestWindows")
329 return true
330 end
331
332 elseif item.uid == 10172 then
333 if player:getStorageValue(_SYSTEM.RECYCLER_STORAGE) < 01 then
334 player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, 01)
335
336 player:getPosition():sendMagicEffect(13)
337 else
338 player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, nil)
339 end
340
341 elseif item.uid == 10173 then
342 if player:getStorageValue(_SYSTEM.RECYCLER_STORAGE) == 01 then
343 player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, 02)
344
345 player:getPosition():sendMagicEffect(13)
346 else
347 player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, nil)
348 end
349
350 elseif item.uid == 10174 then
351 if player:getStorageValue(_SYSTEM.RECYCLER_STORAGE) == 02 then
352 player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, nil)
353 player:setStorageValue(_QUESTLOG[121].UID_01, 05)
354
355 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
356 player:getPosition():sendMagicEffect(13)
357 doBackpack(player, 12)
358 player:sendCancelMessage("@RemoveMarkMap")
359 player:sendCancelMessage("@LoadQuestWindows")
360 return true
361 else
362 player:setStorageValue(_SYSTEM.RECYCLER_STORAGE, nil)
363 end
364
365 --[[ ARVORE DA MORTE
366 elseif item.uid == 10175 then
367 if player:getStorageValue(QUEST_UNLOCK[item.uid]) < 01 then
368 player:setStorageValue(QUEST_UNLOCK[item.uid], 01)
369
370 player:getPosition():sendMagicEffect(13)
371 else
372 player:setStorageValue(QUEST_UNLOCK[item.uid], nil)
373 end]]
374
375 elseif item.uid == 10176 then
376 if player:getStorageValue(_QUESTLOG[122].UID_01) == 02 then
377 if player:getStorageValue(QUEST_UNLOCK[item.uid]) > 00 then
378 player:setStorageValue(QUEST_UNLOCK[item.uid], nil)
379
380 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ ERROR ]\nReinicio de arboles!")
381 player:getPosition():sendMagicEffect(03)
382 return true
383 else
384 local Sequencia = 02
385 local Position_1 = Position(TEMPLO_CORES[00][01].POS[01], TEMPLO_CORES[00][01].POS[02], TEMPLO_CORES[00][01].POS[03])
386 local Lamp_1 = Tile(Position_1):getItemById(TEMPLO_CORES[01][Sequencia][01])
387 local Position_2 = Position(TEMPLO_CORES[00][02].POS[01], TEMPLO_CORES[00][02].POS[02], TEMPLO_CORES[00][02].POS[03])
388 local Lamp_2 = Tile(Position_2):getItemById(TEMPLO_CORES[01][Sequencia][02])
389 local Position_3 = Position(TEMPLO_CORES[00][03].POS[01], TEMPLO_CORES[00][03].POS[02], TEMPLO_CORES[00][03].POS[03])
390 local Lamp_3 = Tile(Position_3):getItemById(TEMPLO_CORES[01][Sequencia][03])
391 local Position_4 = Position(TEMPLO_CORES[00][04].POS[01], TEMPLO_CORES[00][04].POS[02], TEMPLO_CORES[00][04].POS[03])
392 local Lamp_4 = Tile(Position_4):getItemById(TEMPLO_CORES[01][Sequencia][04])
393 local Position_5 = Position(TEMPLO_CORES[00][05].POS[01], TEMPLO_CORES[00][05].POS[02], TEMPLO_CORES[00][05].POS[03])
394 local Lamp_5 = Tile(Position_5):getItemById(TEMPLO_CORES[01][Sequencia][05])
395
396 if Lamp_1 and Lamp_2 and Lamp_3 and Lamp_4 and Lamp_5 then
397 player:setStorageValue(QUEST_UNLOCK[item.uid], 01)
398
399 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ 01 / 05 ]")
400 player:getPosition():sendMagicEffect(13)
401 onResetLever()
402 return true
403 else
404 player:setStorageValue(QUEST_UNLOCK[item.uid], nil)
405
406 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ ERROR ]\nReinicio de arboles!")
407 player:getPosition():sendMagicEffect(03)
408 onResetLever()
409 return true
410 end
411 end
412 end
413
414 elseif item.uid == 10177 then
415 if player:getStorageValue(_QUESTLOG[122].UID_01) == 02 then
416 if player:getStorageValue(QUEST_UNLOCK[item.uid]) == 01 then
417 local Sequencia = 03
418 local Position_1 = Position(TEMPLO_CORES[00][01].POS[01], TEMPLO_CORES[00][01].POS[02], TEMPLO_CORES[00][01].POS[03])
419 local Lamp_1 = Tile(Position_1):getItemById(TEMPLO_CORES[01][Sequencia][01])
420 local Position_2 = Position(TEMPLO_CORES[00][02].POS[01], TEMPLO_CORES[00][02].POS[02], TEMPLO_CORES[00][02].POS[03])
421 local Lamp_2 = Tile(Position_2):getItemById(TEMPLO_CORES[01][Sequencia][02])
422 local Position_3 = Position(TEMPLO_CORES[00][03].POS[01], TEMPLO_CORES[00][03].POS[02], TEMPLO_CORES[00][03].POS[03])
423 local Lamp_3 = Tile(Position_3):getItemById(TEMPLO_CORES[01][Sequencia][03])
424 local Position_4 = Position(TEMPLO_CORES[00][04].POS[01], TEMPLO_CORES[00][04].POS[02], TEMPLO_CORES[00][04].POS[03])
425 local Lamp_4 = Tile(Position_4):getItemById(TEMPLO_CORES[01][Sequencia][04])
426 local Position_5 = Position(TEMPLO_CORES[00][05].POS[01], TEMPLO_CORES[00][05].POS[02], TEMPLO_CORES[00][05].POS[03])
427 local Lamp_5 = Tile(Position_5):getItemById(TEMPLO_CORES[01][Sequencia][05])
428
429 if Lamp_1 and Lamp_2 and Lamp_3 and Lamp_4 and Lamp_5 then
430 player:setStorageValue(QUEST_UNLOCK[item.uid], 02)
431
432 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ 02 / 05 ]")
433 player:getPosition():sendMagicEffect(13)
434 onResetLever()
435 return true
436 else
437 player:setStorageValue(QUEST_UNLOCK[item.uid], nil)
438
439 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ ERROR ]\nReinicio de arboles!")
440 player:getPosition():sendMagicEffect(03)
441 onResetLever()
442 return true
443 end
444 else
445 player:setStorageValue(QUEST_UNLOCK[item.uid], nil)
446
447 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ ERROR ]\nReinicio de arboles!")
448 player:getPosition():sendMagicEffect(03)
449 onResetLever()
450 return true
451 end
452 end
453
454 elseif item.uid == 10180 then
455 if player:getStorageValue(_QUESTLOG[122].UID_01) == 02 then
456 if player:getStorageValue(QUEST_UNLOCK[item.uid]) == 02 then
457 local Sequencia = 06
458 local Position_1 = Position(TEMPLO_CORES[00][01].POS[01], TEMPLO_CORES[00][01].POS[02], TEMPLO_CORES[00][01].POS[03])
459 local Lamp_1 = Tile(Position_1):getItemById(TEMPLO_CORES[01][Sequencia][01])
460 local Position_2 = Position(TEMPLO_CORES[00][02].POS[01], TEMPLO_CORES[00][02].POS[02], TEMPLO_CORES[00][02].POS[03])
461 local Lamp_2 = Tile(Position_2):getItemById(TEMPLO_CORES[01][Sequencia][02])
462 local Position_3 = Position(TEMPLO_CORES[00][03].POS[01], TEMPLO_CORES[00][03].POS[02], TEMPLO_CORES[00][03].POS[03])
463 local Lamp_3 = Tile(Position_3):getItemById(TEMPLO_CORES[01][Sequencia][03])
464 local Position_4 = Position(TEMPLO_CORES[00][04].POS[01], TEMPLO_CORES[00][04].POS[02], TEMPLO_CORES[00][04].POS[03])
465 local Lamp_4 = Tile(Position_4):getItemById(TEMPLO_CORES[01][Sequencia][04])
466 local Position_5 = Position(TEMPLO_CORES[00][05].POS[01], TEMPLO_CORES[00][05].POS[02], TEMPLO_CORES[00][05].POS[03])
467 local Lamp_5 = Tile(Position_5):getItemById(TEMPLO_CORES[01][Sequencia][05])
468
469 if Lamp_1 and Lamp_2 and Lamp_3 and Lamp_4 and Lamp_5 then
470 player:setStorageValue(QUEST_UNLOCK[item.uid], 03)
471
472 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ 03 / 05 ]")
473 player:getPosition():sendMagicEffect(13)
474 onResetLever()
475 return true
476 else
477 player:setStorageValue(QUEST_UNLOCK[item.uid], nil)
478
479 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ ERROR ]\nReinicio de arboles!")
480 player:getPosition():sendMagicEffect(03)
481 onResetLever()
482 return true
483 end
484 else
485 player:setStorageValue(QUEST_UNLOCK[item.uid], nil)
486
487 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ ERROR ]\nReinicio de arboles!")
488 player:getPosition():sendMagicEffect(03)
489 onResetLever()
490 return true
491 end
492 end
493
494 elseif item.uid == 10181 then
495 if player:getStorageValue(_QUESTLOG[122].UID_01) == 02 then
496 if player:getStorageValue(QUEST_UNLOCK[item.uid]) == 03 then
497 local Sequencia = 07
498 local Position_1 = Position(TEMPLO_CORES[00][01].POS[01], TEMPLO_CORES[00][01].POS[02], TEMPLO_CORES[00][01].POS[03])
499 local Lamp_1 = Tile(Position_1):getItemById(TEMPLO_CORES[01][Sequencia][01])
500 local Position_2 = Position(TEMPLO_CORES[00][02].POS[01], TEMPLO_CORES[00][02].POS[02], TEMPLO_CORES[00][02].POS[03])
501 local Lamp_2 = Tile(Position_2):getItemById(TEMPLO_CORES[01][Sequencia][02])
502 local Position_3 = Position(TEMPLO_CORES[00][03].POS[01], TEMPLO_CORES[00][03].POS[02], TEMPLO_CORES[00][03].POS[03])
503 local Lamp_3 = Tile(Position_3):getItemById(TEMPLO_CORES[01][Sequencia][03])
504 local Position_4 = Position(TEMPLO_CORES[00][04].POS[01], TEMPLO_CORES[00][04].POS[02], TEMPLO_CORES[00][04].POS[03])
505 local Lamp_4 = Tile(Position_4):getItemById(TEMPLO_CORES[01][Sequencia][04])
506 local Position_5 = Position(TEMPLO_CORES[00][05].POS[01], TEMPLO_CORES[00][05].POS[02], TEMPLO_CORES[00][05].POS[03])
507 local Lamp_5 = Tile(Position_5):getItemById(TEMPLO_CORES[01][Sequencia][05])
508
509 if Lamp_1 and Lamp_2 and Lamp_3 and Lamp_4 and Lamp_5 then
510 player:setStorageValue(QUEST_UNLOCK[item.uid], 04)
511
512 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ 04 / 05 ]")
513 player:getPosition():sendMagicEffect(13)
514 onResetLever()
515 return true
516 else
517 player:setStorageValue(QUEST_UNLOCK[item.uid], nil)
518
519 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ ERROR ]\nReinicio de arboles!")
520 player:getPosition():sendMagicEffect(03)
521 onResetLever()
522 return true
523 end
524 else
525 player:setStorageValue(QUEST_UNLOCK[item.uid], nil)
526
527 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ ERROR ]\nReinicio de arboles!")
528 player:getPosition():sendMagicEffect(03)
529 onResetLever()
530 return true
531 end
532 end
533
534 elseif item.uid == 10182 then
535 if player:getStorageValue(_QUESTLOG[122].UID_01) == 02 then
536 if player:getStorageValue(QUEST_UNLOCK[item.uid]) == 04 then
537 local Sequencia = 08
538 local Position_1 = Position(TEMPLO_CORES[00][01].POS[01], TEMPLO_CORES[00][01].POS[02], TEMPLO_CORES[00][01].POS[03])
539 local Lamp_1 = Tile(Position_1):getItemById(TEMPLO_CORES[01][Sequencia][01])
540 local Position_2 = Position(TEMPLO_CORES[00][02].POS[01], TEMPLO_CORES[00][02].POS[02], TEMPLO_CORES[00][02].POS[03])
541 local Lamp_2 = Tile(Position_2):getItemById(TEMPLO_CORES[01][Sequencia][02])
542 local Position_3 = Position(TEMPLO_CORES[00][03].POS[01], TEMPLO_CORES[00][03].POS[02], TEMPLO_CORES[00][03].POS[03])
543 local Lamp_3 = Tile(Position_3):getItemById(TEMPLO_CORES[01][Sequencia][03])
544 local Position_4 = Position(TEMPLO_CORES[00][04].POS[01], TEMPLO_CORES[00][04].POS[02], TEMPLO_CORES[00][04].POS[03])
545 local Lamp_4 = Tile(Position_4):getItemById(TEMPLO_CORES[01][Sequencia][04])
546 local Position_5 = Position(TEMPLO_CORES[00][05].POS[01], TEMPLO_CORES[00][05].POS[02], TEMPLO_CORES[00][05].POS[03])
547 local Lamp_5 = Tile(Position_5):getItemById(TEMPLO_CORES[01][Sequencia][05])
548
549 if Lamp_1 and Lamp_2 and Lamp_3 and Lamp_4 and Lamp_5 then
550 player:setStorageValue(QUEST_UNLOCK[item.uid], nil)
551 player:teleportTo({x=3693, y=1713, z=03})
552 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
553
554 local from = {x=3691, y=1708, z=05}
555 local to = {x=3696, y=1717, z=05}
556 for A = from.x, to.x do
557 for B = from.y, to.y do
558 for C = from.z, to.z do
559 local tile = Tile(A, B, C)
560 if tile ~= nil then
561 local creature = tile:getTopCreature()
562 if creature and creature:isPlayer() then
563 creature:teleportTo({x=3693, y=1713, z=03})
564 creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
565 end
566 end
567 end
568 end
569 end
570
571 doBackpack(player, 12)
572 player:sendCancelMessage("@RemoveMarkMap")
573 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ 05 / 05 ]")
574 onResetLever()
575 return true
576 else
577 player:setStorageValue(QUEST_UNLOCK[item.uid], nil)
578
579 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ ERROR ]\nReinicio de arboles!")
580 player:getPosition():sendMagicEffect(03)
581 onResetLever()
582 return true
583 end
584 else
585 player:setStorageValue(QUEST_UNLOCK[item.uid], nil)
586
587 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[ ERROR ]\nReinicio de arboles!")
588 player:getPosition():sendMagicEffect(03)
589 onResetLever()
590 return true
591 end
592 end
593
594 elseif item.uid == 10183 then
595 if player:getStorageValue(QUEST_UNLOCK[item.uid]) == 01 then
596 player:setStorageValue(QUEST_UNLOCK[item.uid], 02)
597
598 player:getPosition():sendMagicEffect(13)
599 return true
600 end
601
602 elseif item.uid == 10184 then
603 if player:getStorageValue(QUEST_UNLOCK[item.uid]) >= 02 then
604 local ProcurarID_1 = 3032
605 local ProcurarID_2 = 3022
606 local ProcurarID_3 = 3213
607 local QntPlayer = 01
608 local POS_A = Tile(3556, 1895, 08)
609 local crea_a = POS_A:getTopCreature()
610 local POS_B = Tile(3556, 1896, 08)
611 local crea_b = POS_B:getTopCreature()
612 local QNT_PLA_1 = 0 local POS_PLA_1 = 0 local EXT_PLA_1 = 0
613 local QNT_PLA_2 = 0 local POS_PLA_2 = 0 local EXT_PLA_2 = 0
614 local QNT_PLA_3 = 0 local POS_PLA_3 = 0 local EXT_PLA_3 = 0
615
616 if crea_a and crea_a:isPlayer() then
617 if crea_a:getStorageValue(QUEST_UNLOCK[item.uid]) >= 02 then
618 QntPlayer = QntPlayer + 01
619 if crea_b and crea_b:isPlayer() then
620 if crea_b:getStorageValue(QUEST_UNLOCK[item.uid]) >= 02 then
621 QntPlayer = QntPlayer + 01
622 end
623 end
624 end
625 end
626
627 if QntPlayer == 03 then
628 doBackpack(player, 03, 03, 01, 01, ProcurarID_1) -- Procurar
629 QNT_PLA_1 = doBackpack(player, 04)
630 POS_PLA_1 = doBackpack(player, 05)
631 EXT_PLA_1 = doBackpack(player, 06)
632 if QNT_PLA_1 > 00 then
633 if crea_a and crea_a:isPlayer() then
634 doBackpack(crea_a, 03, 03, 01, 01, ProcurarID_2) -- Procurar
635 QNT_PLA_2 = doBackpack(crea_a, 04)
636 POS_PLA_2 = doBackpack(crea_a, 05)
637 EXT_PLA_2 = doBackpack(crea_a, 06)
638 if QNT_PLA_2 > 00 then
639 if crea_b and crea_b:isPlayer() then
640 doBackpack(crea_b, 03, 03, 01, 01, ProcurarID_3) -- Procurar
641 QNT_PLA_3 = doBackpack(crea_b, 04)
642 POS_PLA_3 = doBackpack(crea_b, 05)
643 EXT_PLA_3 = doBackpack(crea_b, 06)
644 if QNT_PLA_3 > 00 then
645 if QNT_PLA_1 > 01 then
646 player:setStorageValue(_BACKPACK[03][EXT_PLA_1][POS_PLA_1].UID_04, (QNT_PLA_1 - 01))
647 else
648 doBackpack(player, 02, 03, EXT_PLA_1, POS_PLA_1)
649 end
650 if player:getStorageValue(QUEST_UNLOCK[item.uid]) < 100 then
651 player:setStorageValue(QUEST_UNLOCK[item.uid], 03)
652 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
653 end
654 player:sendCancelMessage("@ReloadBackpack 03 01")
655 player:teleportTo({x=3543, y=1899, z=08})
656 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
657
658 if QNT_PLA_2 > 01 then
659 crea_a:setStorageValue(_BACKPACK[03][EXT_PLA_2][POS_PLA_2].UID_04, (QNT_PLA_2 - 01))
660 else
661 doBackpack(crea_a, 02, 03, EXT_PLA_2, POS_PLA_2)
662 end
663 if crea_a:getStorageValue(QUEST_UNLOCK[item.uid]) < 100 then
664 crea_a:setStorageValue(QUEST_UNLOCK[item.uid], 03)
665 crea_a:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
666 end
667 crea_a:sendCancelMessage("@ReloadBackpack 03 01")
668 crea_a:teleportTo({x=3543, y=1899, z=08})
669 crea_a:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
670
671 if QNT_PLA_3 > 01 then
672 crea_b:setStorageValue(_BACKPACK[03][EXT_PLA_3][POS_PLA_3].UID_04, (QNT_PLA_3 - 01))
673 else
674 doBackpack(crea_b, 02, 03, EXT_PLA_3, POS_PLA_3)
675 end
676 if crea_b:getStorageValue(QUEST_UNLOCK[item.uid]) < 100 then
677 crea_b:setStorageValue(QUEST_UNLOCK[item.uid], 03)
678 crea_b:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
679 end
680 crea_b:sendCancelMessage("@ReloadBackpack 03 01")
681 crea_b:teleportTo({x=3543, y=1899, z=08})
682 crea_b:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
683
684 return true
685 end
686 end
687 end
688 end
689 end
690 end
691
692 player:teleportTo({x=3554, y=1901, z=08})
693 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
694 if crea_a and crea_a:isPlayer() then
695 crea_a:teleportTo({x=3554, y=1901, z=08})
696 crea_a:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
697 end
698 if crea_b and crea_a:isPlayer() then
699 crea_b:teleportTo({x=3554, y=1901, z=08})
700 crea_b:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
701 end
702 return true
703 else
704 player:teleportTo({x=3554, y=1901, z=08})
705 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
706 if crea_a and crea_a:isPlayer() then
707 crea_a:teleportTo({x=3554, y=1901, z=08})
708 crea_a:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
709 end
710 if crea_b and crea_a:isPlayer() then
711 crea_b:teleportTo({x=3554, y=1901, z=08})
712 crea_b:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
713 end
714 end
715
716 if item.itemid == 1945 then
717 item:transform(item.itemid + 1)
718 else
719 item:transform(item.itemid - 1)
720 end
721
722 elseif item.uid == 10185 then
723 if player:getStorageValue(QUEST_UNLOCK[item.uid]) == 03 then
724 local ProcurarID_1 = 3243
725 local ProcurarID_2 = 3031
726 local QNT_PLA_1 = 0 local POS_PLA_1 = 0 local EXT_PLA_1 = 0
727 local QNT_PLA_2 = 0 local POS_PLA_2 = 0 local EXT_PLA_2 = 0
728
729 doBackpack(player, 03, 03, 01, 01, ProcurarID_1) -- Procurar
730 QNT_PLA_1 = doBackpack(player, 04)
731 POS_PLA_1 = doBackpack(player, 05)
732 EXT_PLA_1 = doBackpack(player, 06)
733 if QNT_PLA_1 > 00 then
734 doBackpack(player, 03, 03, 01, 01, ProcurarID_2) -- Procurar
735 QNT_PLA_2 = doBackpack(player, 04)
736 POS_PLA_2 = doBackpack(player, 05)
737 EXT_PLA_2 = doBackpack(player, 06)
738 if QNT_PLA_2 > 00 then
739 if QNT_PLA_1 > 01 then
740 player:setStorageValue(_BACKPACK[03][EXT_PLA_1][POS_PLA_1].UID_04, (QNT_PLA_1 - 01))
741 else
742 doBackpack(player, 02, 03, EXT_PLA_1, POS_PLA_1)
743 end
744 if QNT_PLA_2 > 01 then
745 player:setStorageValue(_BACKPACK[03][EXT_PLA_2][POS_PLA_2].UID_04, (QNT_PLA_2 - 01))
746 else
747 doBackpack(player, 02, 03, EXT_PLA_2, POS_PLA_2)
748 end
749
750 player:sendCancelMessage("@ReloadBackpack 03 01")
751 if player:getStorageValue(QUEST_UNLOCK[item.uid]) < 100 then
752 player:setStorageValue(QUEST_UNLOCK[item.uid], 04)
753
754 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Su diario de Missiones fue actualizado.")
755 player:getPosition():sendMagicEffect(13)
756 return true
757 end
758 else
759 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Se requiere oferta.")
760 player:getPosition():sendMagicEffect(03)
761 return true
762 end
763 else
764 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Se requiere oferta.")
765 player:getPosition():sendMagicEffect(03)
766 return true
767 end
768 end
769
770 if item.itemid == 1945 then
771 item:transform(item.itemid + 1)
772 else
773 item:transform(item.itemid - 1)
774 end
775 end
776
777 return false
778end
779
Top