inventario.lua

main 1442 lines · 58.3 KB Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1local Teste = false
2local LOAD_PARTICIPE_PLAYER = nil
3local condition = Condition(CONDITION_OUTFIT)
4local function getAllPlayerInAccount(id)
5 local resultId = db.storeQuery("SELECT `level`, `name` FROM `players` WHERE `account_id` = " .. id .. " ORDER BY `level` DESC")
6 if resultId ~= false then
7 local guid = result.getDataString(resultId, "name")
8 result.free(resultId)
9 return guid
10 end
11 return 0
12end
13function onSay(player, words, param)
14 local split = param:splitTrimmed(" ")
15 -- Se reproduce el sonido para toda interacción
16 playSoundPlayer(player, "depot.ogg")
17
18 if split[01] == nil then
19 return false
20 end
21 --[[ USADO PARA TESTES ]]--
22 if split[01] == "26" then
23 local cid = player:getId()
24 if split[02] then
25 if _BONUS_EXTRA[tonumber(split[02])] then
26 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[BONUS] " .._BONUS_EXTRA_TABLE[cid][tonumber(split[02])].. "" .._BONUS_EXTRA[tonumber(split[02])].TEXT)
27 else
28 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "B�nus no encontrado")
29 end
30 else
31 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Falta parametros")
32 end
33 return false
34 end
35 if split[01] == "50" then
36 local cid = player:getId()
37 if _UNOFFICIAL_CLIENT[cid] then
38 stopEvent(_UNOFFICIAL_CLIENT[cid])
39 _UNOFFICIAL_CLIENT[cid] = nil
40 end
41 return false
42 end
43
44 if _DEBUG_MODE then
45 local _TYPE = {
46 ["00"] = 'Removendo item equipado',
47 ["21"] = 'Carregando Aparencia da Backpack',
48 ["24"] = 'Finalizando Conversa com o NPC',
49 ["25"] = 'Carregando todas as Quest em Aberto',
50 ["26"] = 'Usado para Testes',
51 ["27"] = 'Mensagem Quest marcada em seu mapa',
52 ["28"] = 'Carregando Gold e Online Coins',
53 ["29"] = 'Adicionando Skill Arma ou Equipamento',
54 ["30"] = 'Teleport Nexus',
55 ["31"] = 'Mensagem de Alerta',
56 ["32"] = 'Carregando Status',
57 ["33"] = 'Equipando Aparancia da Backpack',
58 ["34"] = 'Atualizando Bag Tempo Real',
59 ["37"] = 'Criptomoedas',
60 ["38"] = 'Carregando PIX',
61 ["39"] = 'Participar Warzone',
62 ["40"] = 'Carregando Eventos Mensais',
63 ["41"] = 'Botoes de Menu Eventos',
64 ["43"] = 'Destruindo um Equipamento',
65 ["44"] = 'Carregando Coliseu',
66 ["45"] = 'Trocando Criptomoedas por Vip Coins',
67 ["46"] = 'Abrindo Central Box Remoto',
68 ["47"] = 'Upgrade Passiva',
69 ["48"] = 'Equipando uma Passiva',
70 ["49"] = 'Pular Cena Automatica',
71 }
72 if _TYPE[split[01]] then
73 if split[01] == "24" then
74 print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | " ..split[02])
75 elseif split[01] == "29" then
76 if tonumber(split[02]) == 04 then
77 print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | " .._SPELLS[tonumber(split[06])].NAME)
78 else
79 print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | " .._ATRIBUTOS[tonumber(split[06])].NAME)
80 end
81 elseif split[01] == "30" then
82 print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | " .._SYSTEM.NEXUS[tonumber(split[02])].NAME)
83 elseif split[01] == "33" then
84 print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | " .._ITEMS[tonumber(split[02])].NAME)
85 elseif split[01] == "34" then
86 if tonumber(split[02]) == 01 then
87 print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " (Atualizando Bag)")
88 elseif tonumber(split[02]) == 02 then
89 print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " (Atualizando Dinheiro)")
90 elseif tonumber(split[02]) == 03 then
91 print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " (Atualizando Maestria)")
92 elseif tonumber(split[02]) == 04 then
93 print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " (Checando vers�o do cliente)")
94 end
95 elseif split[01] == "47" then
96 print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | [" .._PASSIVES[tonumber(split[02])].DESC.. "]")
97 elseif split[01] == "48" then
98 print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | [" .._PASSIVES[tonumber(split[03])].DESC.. "]")
99 else
100 print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]])
101 end
102 else
103 print("[TALK - INVENTARIO] " ..player:getName().. " - " ..split[01].. " (Equipando um Item do Invent�rio)")
104 end
105 end
106 --[[ REMOVENDO UM ITEM EQUIPADO ]]--
107 if split[01] == "00" then
108 local ext = tonumber(split[02])
109 local slot = tonumber(split[03])
110 local bag = tonumber(split[04])
111
112 if slot == 04 then
113 if player:getStorageValue(_SYSTEM.WARZONE) > 00 then
114 return false
115 end
116 end
117 if doBackpack(player, 00, slot, ext, 01) then -- Organizo | Capacidade
118 doInventario(player, 02, slot, ext, bag) -- Removo do Invent�rio
119 doInventario(player, 00, slot, ext) -- Organizo Invent�rio
120 doBackpack(player, 00, slot, ext, 01) -- Organizo Backpack
121
122 player:sendCancelMessage("@LoadAmmo " ..player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_10))
123 player:sendCancelMessage("@RemoveItemInventario " ..slot)
124 else
125 playSoundPlayer(player, "depot.ogg")
126 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sua Backpack esta cheia.")
127 return false
128 end
129
130 return false
131 end
132 --[[ ORGANIZAR DEPOT ]]--
133 if split[01] == "52" then
134 local ORDER_TYPE = tonumber(split[02])
135 if ORDER_TYPE == 01 then -- RARIDADE
136 onDepot(player, 05)
137 elseif ORDER_TYPE == 02 then -- LEVEL
138 onDepot(player, 06)
139 elseif ORDER_TYPE == 03 then -- PRE�O
140 onDepot(player, 07)
141 end
142 return false
143 end
144 --[[ ORGANIZAR BACKPACK ]]--
145 if split[01] == "51" then
146 -- reproducir sonido al cambiar de bolsa
147 playSoundPlayer(player, "depot.ogg")
148 local SLOT = tonumber(split[02])
149 local ORDER_TYPE = tonumber(split[03])
150
151 doBackpack(player, 13, SLOT, ORDER_TYPE)
152 player:sendCancelMessage("@ReloadBackpack " ..SLOT)
153 return false
154 end
155 --[[ SKIP UMA CENA AUTOM�TICA ]]--
156 if split[01] == "49" then
157 player:setStorageValue(_SYSTEM.SCENE_STORAGE, nil)
158 return false
159 end
160 --[[ EQUIPANDO UMA PASSIVA ]]--
161 if split[01] == "48" then
162 local PASSIVE_SLOT = tonumber(split[02])
163 local PASSIVE_ID = tonumber(split[03])
164 local PASSIVE_LV = tonumber(split[04])
165
166 if split[02] then
167 if PASSIVE_SLOT > 00 and PASSIVE_SLOT < 07 then
168 local checkPerm = 00
169 for X = 01, 06 do
170 if player:getStorageValue(_SYSTEM.POINTS_ATR[X]) == tonumber(split[03]) then
171 checkPerm = 01
172 break
173 end
174 end
175 if checkPerm == 00 then
176 player:setStorageValue(_SYSTEM.POINTS_ATR[PASSIVE_SLOT], tonumber(split[03]))
177 player:setStorageValue(_SYSTEM.POINTS_ATR[PASSIVE_SLOT + 7], PASSIVE_LV)
178 PlayerPassives(player, 02)
179 player:getPosition():sendMagicEffect(14)
180 player:sendCancelMessage("@PassiveBoxClose")
181
182 if player:getStorageValue(_QUESTLOG[206].UID_01) == 02 then
183 player:setStorageValue(_QUESTLOG[206].UID_01, 100)
184 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
185 end
186 return false
187 else
188 player:popupFYI("Esta passiva ya est� equipada.")
189 end
190 end
191 end
192 return false
193 end
194 --[[ UPGRADE EM PASSIVA ]]--
195 if split[01] == "47" then
196 local PASSIVE_ID = tonumber(split[02])
197 local PASSIVE_POINT = tonumber(split[03])
198 local PLAYER_POINT = player:getStorageValue(_SYSTEM.POINTS_ATR[07]) or 0
199 if split[02] then
200 if PLAYER_POINT >= PASSIVE_POINT then
201 player:setStorageValue(_SYSTEM.POINTS_ATR[07], (PLAYER_POINT - PASSIVE_POINT))
202 if player:getStorageValue(_SYSTEM.POINTS_ATR[01]) == PASSIVE_ID then
203 player:setStorageValue(_SYSTEM.POINTS_ATR[08], (player:getStorageValue(_SYSTEM.POINTS_ATR[08]) + 01))
204 elseif player:getStorageValue(_SYSTEM.POINTS_ATR[02]) == PASSIVE_ID then
205 player:setStorageValue(_SYSTEM.POINTS_ATR[09], (player:getStorageValue(_SYSTEM.POINTS_ATR[09]) + 01))
206 elseif player:getStorageValue(_SYSTEM.POINTS_ATR[03]) == PASSIVE_ID then
207 player:setStorageValue(_SYSTEM.POINTS_ATR[10], (player:getStorageValue(_SYSTEM.POINTS_ATR[10]) + 01))
208 elseif player:getStorageValue(_SYSTEM.POINTS_ATR[04]) == PASSIVE_ID then
209 player:setStorageValue(_SYSTEM.POINTS_ATR[11], (player:getStorageValue(_SYSTEM.POINTS_ATR[11]) + 01))
210 elseif player:getStorageValue(_SYSTEM.POINTS_ATR[05]) == PASSIVE_ID then
211 player:setStorageValue(_SYSTEM.POINTS_ATR[12], (player:getStorageValue(_SYSTEM.POINTS_ATR[12]) + 01))
212 elseif player:getStorageValue(_SYSTEM.POINTS_ATR[06]) == PASSIVE_ID then
213 player:setStorageValue(_SYSTEM.POINTS_ATR[13], (player:getStorageValue(_SYSTEM.POINTS_ATR[13]) + 01))
214 end
215
216 PlayerPassives(player, 01, tonumber(split[02]))
217 PlayerPassives(player, 02)
218 else
219 player:popupFYI("Pontos de Passiva insuficiente.")
220 end
221 end
222 return false
223 end
224 --[[ ABRINDO CENTRAL BOX ]]--
225 if split[01] == "46" then
226 local G = PlayerGoldCoins(player, 00)
227 local tutor = 0
228 if player:getStorageValue(_QUESTLOG[06].UID_01) > 0 and player:getStorageValue(_QUESTLOG[06].UID_01) < 100 then
229 tutor = 1
230 end
231
232
233 local slot = 03
234 local ext = 00
235 local totalDesconto = 00
236 if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE) == 04 then
237 local players = Game.getPlayers()
238 for _, targetPlayer in ipairs(players) do
239 totalDesconto = totalDesconto + 01
240 end
241 end
242
243 doBackpack(player, 00, slot, ext, 01)
244 player:sendCancelMessage("@OpenSellComboBox")
245 player:sendCancelMessage("@CentralBox " ..G.. " " ..tutor.. " " .. 0 .. " " ..math.floor(totalDesconto / 2))
246 player:sendCancelMessage("@closedBackpack")
247 return false
248 end
249 --[[ TROCANDO CRIPTOMOEDAS POR VIP COINS ]]--
250 if split[01] == "45" then
251 local VipConsPayment = 00
252 local realDin = tonumber(split[02])
253 repeat
254 realDin = realDin - 0.30
255 VipConsPayment = VipConsPayment + 01
256 until realDin < 00
257 if VipConsPayment > 01 then
258 VipConsPayment = VipConsPayment - 01
259 end
260
261 if player:getStorageValue(_SYSTEM.CRIPTOMOEDA) > 00 then
262 player:setStorageValue(_SYSTEM.CRIPTOMOEDA, 00)
263 PlayerVipCoins(player, 02, VipConsPayment)
264 player:sendCancelMessage("@LootMSG 3218 3 0 " ..VipConsPayment)
265 doBackpack(player, 11)
266 player:getPosition():sendMagicEffect(14)
267 if _DEBUG_MODE then
268 print("[TALK - INVENTARIO] " ..player:getName().. " - Cripto > Vip (" ..VipConsPayment.. ")")
269 end
270 else
271 player:getPosition():sendMagicEffect(03)
272 end
273 return false
274 end
275 --[[ CARREGANDO COLISEU ]]--
276 if split[01] == "44" then
277 local ACTION = tonumber(split[02])
278 local KEYS, HARD, QUEST = player:getStorageValue(_SYSTEM.COLISEU[09]), player:getStorageValue(_SYSTEM.COLISEU[01]), player:getStorageValue(_QUESTLOG[201].UID_01)
279 if KEYS < 00 then KEYS = 00 end
280 if HARD < 02 then HARD = 01 end
281 if QUEST == 101 then
282 QUEST = 01
283 else
284 QUEST = 00
285 end
286 if ACTION == 01 then
287 player:sendCancelMessage("@ColiseuLoad " ..KEYS.. " " ..HARD.. " " ..QUEST.. " 00")
288 return false
289 else
290 local ITEMID = tonumber(split[03])
291 local ATR_KEYS_PRICE = tonumber(split[04])
292 if _ITEMS[ITEMID] then
293 if _ITEMS[ITEMID].SLOT_EQUIP == 11 then
294 if KEYS >= ATR_KEYS_PRICE then
295 if doBackpack(player, 00, 03, 00, 01) then
296 if doBackpack(player, 01, 03, 00, 0, ITEMID, 00, 00, 01, false) then
297 player:setStorageValue(_SYSTEM.COLISEU[09], (player:getStorageValue(_SYSTEM.COLISEU[09]) - ATR_KEYS_PRICE))
298 player:getPosition():sendMagicEffect(14)
299
300 KEYS = player:getStorageValue(_SYSTEM.COLISEU[09])
301 player:sendCancelMessage("@ColiseuLoad " ..KEYS.. " " ..HARD.. " " ..QUEST.. " 01")
302 end
303 else
304 playSoundPlayer(player, "depot.ogg")
305 player:getPosition():sendMagicEffect(03)
306 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sua Backpack est� cheia.")
307 return false
308 end
309 else
310 player:getPosition():sendMagicEffect(03)
311 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted no tem chaves suficientes.")
312 return false
313 end
314 end
315 end
316 end
317 return false
318 end
319 --[[ DESTRUINDO UM EQUIPAMENTO ]]--
320 if split[01] == "43" then
321 local ext = tonumber(split[02])
322 local bag = tonumber(split[03])
323 local slot = tonumber(split[04])
324
325 doBackpack(player, 02, slot, ext, bag)
326 doBackpack(player, 00, slot, ext, 01)
327 playSoundPlayer(player, "depot.ogg")
328 player:sendCancelMessage("@ReloadBackpack " ..slot.. " 01 01")
329 return false
330 end
331 --[[ BOT�ES DO MENU EVENTOS ]]--
332 if split[01] == "41" then
333 local ACTION = tonumber(split[02])
334 if ACTION == 01 then
335 local GOLD_TOKEN = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[01].GOLD_TOKEN)
336 if GOLD_TOKEN < 0 then
337 GOLD_TOKEN = 0
338 end
339
340 if GOLD_TOKEN >= 50 then
341 if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[10].STORAGE) > 00 then
342 player:getPosition():sendMagicEffect(CONST_ME_POFF)
343 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted ya Tiene este buff ativo en su personaje.")
344 return false
345 else
346 player:setStorageValue(_GLOBAL_RANDOM.BUFFS[10].STORAGE, 10)
347 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve [ BENEFICIO LOS DIOSES ].")
348 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Buff Ativado: [ BENEFICIO LOS DIOSES ].")
349 player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
350
351 player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[01].GOLD_TOKEN, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[01].GOLD_TOKEN) - 50))
352 player:sendCancelMessage("@ReloadEvents 01 " ..player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[01].GOLD_TOKEN))
353 doInventario(player, 05)
354 end
355 end
356 end
357 if ACTION == 02 then
358 local DESCONTO = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1)
359 local FIXO_PRICE = 50000
360 local FINAL_PRICE = FIXO_PRICE - DESCONTO
361 local GOLD_SALDO = PlayerGoldCoins(player, 00)
362
363 if GOLD_SALDO >= FINAL_PRICE then
364 PlayerGoldCoins(player, 01, FINAL_PRICE)
365 if player:getStorageValue(_SYSTEM.CRIPTOMOEDA) < 00 then
366 player:setStorageValue(_SYSTEM.CRIPTOMOEDA, ((player:getStorageValue(_SYSTEM.CRIPTOMOEDA) + 01) + 01))
367 else
368 player:setStorageValue(_SYSTEM.CRIPTOMOEDA, (player:getStorageValue(_SYSTEM.CRIPTOMOEDA) + 01))
369 end
370
371 player:sendCancelMessage("@LootMSG 3297 4 3 1")
372 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Compra realizada com sucesso!\n1x Criptomoeda por $ " ..FINAL_PRICE.. ".")
373 player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
374 doBackpack(player, 11)
375 else
376 player:popupFYI("O valor atual da Criptomoeda � de [ " ..FINAL_PRICE.. " ].\nUsted no tem dinheiro suficiente.")
377 end
378 end
379 if ACTION == 04 then
380 local BUFF_ID = tonumber(split[03])
381 local ITEMID = 0
382 if BUFF_ID == 01 then
383 ITEMID = 3164
384 elseif BUFF_ID == 02 then
385 ITEMID = 3163
386 elseif BUFF_ID == 03 then
387 ITEMID = 3162
388 elseif BUFF_ID == 04 then
389 ITEMID = 3161
390 else
391 return false
392 end
393
394 doBackpack(player, 03, 03, 00, 01, ITEMID)
395 local QT_P = doBackpack(player, 04)
396 if QT_P >= 25 then
397 if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[11].STORAGE) > 00 then
398 player:getPosition():sendMagicEffect(CONST_ME_POFF)
399 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted ya Tiene este buff ativo em seu personagem.")
400 return false
401 else
402 local PosBag = doBackpack(player, 05)
403 local ExtBag = doBackpack(player, 06)
404 if QT_P > 25 then
405 player:setStorageValue(_BACKPACK[03][ExtBag][PosBag].UID_04, (QT_P - 25))
406 else
407 doBackpack(player, 02, 03, ExtBag, PosBag)
408 end
409
410 player:setStorageValue(_GLOBAL_RANDOM.BUFFS[11].STORAGE, 3600)
411 player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[04].BUFF_ELE, BUFF_ID)
412 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve [ BUFF ELEMENTAL ].")
413 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Buff Ativado: [ BUFF ELEMENTAL ].")
414 player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
415
416 player:sendCancelMessage("@closedBackpack")
417 doInventario(player, 05)
418 end
419 else
420 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "O custo para ativar esse buff � de x25 [ " .._ITEMS[ITEMID].NAME.. " ].")
421 return false
422 end
423 end
424 if ACTION == 05 then
425 local ITEM_1 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_4)
426 local ITEM_2 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_5)
427 local ITEM_3 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_6)
428 local ITEM_4 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_7)
429 local ITEM_5 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_8)
430 local ITEM_6 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_9)
431 local ITEM_7 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_10)
432 local ITEM_8 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_11)
433 local ITEM_9 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_12)
434
435 local QNT_ITEM_1 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1)
436 local QNT_ITEM_2 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_2)
437 local QNT_ITEM_3 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_3)
438
439 local TASK_ID = tonumber(split[03])
440 if TASK_ID == 01 then
441 doBackpack(player, 03, 03, 00, 01, ITEM_1)
442 local ATUAL_ITEM_1 = doBackpack(player, 04)
443 local POS_BAG_1 = doBackpack(player, 05)
444 local POS_EXT_1 = doBackpack(player, 06)
445
446 doBackpack(player, 03, 03, 00, 01, ITEM_2)
447 local ATUAL_ITEM_2 = doBackpack(player, 04)
448 local POS_BAG_2 = doBackpack(player, 05)
449 local POS_EXT_2 = doBackpack(player, 06)
450
451 doBackpack(player, 03, 03, 00, 01, ITEM_3)
452 local ATUAL_ITEM_3 = doBackpack(player, 04)
453 local POS_BAG_3 = doBackpack(player, 05)
454 local POS_EXT_3 = doBackpack(player, 06)
455
456 if ATUAL_ITEM_1 >= QNT_ITEM_1 and ATUAL_ITEM_2 >= QNT_ITEM_1 and ATUAL_ITEM_3 >= QNT_ITEM_1 then
457 if ATUAL_ITEM_1 > QNT_ITEM_1 then
458 player:setStorageValue(_BACKPACK[03][POS_EXT_1][POS_BAG_1].UID_04, (ATUAL_ITEM_1 - QNT_ITEM_1))
459 else
460 doBackpack(player, 02, 03, POS_EXT_1, POS_BAG_1)
461 end
462 if ATUAL_ITEM_2 > QNT_ITEM_1 then
463 player:setStorageValue(_BACKPACK[03][POS_EXT_2][POS_BAG_2].UID_04, (ATUAL_ITEM_2 - QNT_ITEM_1))
464 else
465 doBackpack(player, 02, 03, POS_EXT_2, POS_BAG_2)
466 end
467 if ATUAL_ITEM_3 > QNT_ITEM_1 then
468 player:setStorageValue(_BACKPACK[03][POS_EXT_3][POS_BAG_3].UID_04, (ATUAL_ITEM_3 - QNT_ITEM_1))
469 else
470 doBackpack(player, 02, 03, POS_EXT_3, POS_BAG_3)
471 end
472
473 PlayerTokenCoins(player, 01, 20, 01)
474 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve x20 Pontos de Task.")
475 player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
476 player:sendCancelMessage("@closedBackpack")
477 else
478 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted no Tiene todos os itens necess�rios.")
479 return false
480 end
481 end
482 if TASK_ID == 02 then
483 doBackpack(player, 03, 03, 00, 01, ITEM_4)
484 local ATUAL_ITEM_1 = doBackpack(player, 04)
485 local POS_BAG_1 = doBackpack(player, 05)
486 local POS_EXT_1 = doBackpack(player, 06)
487
488 doBackpack(player, 03, 03, 00, 01, ITEM_5)
489 local ATUAL_ITEM_2 = doBackpack(player, 04)
490 local POS_BAG_2 = doBackpack(player, 05)
491 local POS_EXT_2 = doBackpack(player, 06)
492
493 doBackpack(player, 03, 03, 00, 01, ITEM_6)
494 local ATUAL_ITEM_3 = doBackpack(player, 04)
495 local POS_BAG_3 = doBackpack(player, 05)
496 local POS_EXT_3 = doBackpack(player, 06)
497
498 if ATUAL_ITEM_1 >= QNT_ITEM_2 and ATUAL_ITEM_2 >= QNT_ITEM_2 and ATUAL_ITEM_3 >= QNT_ITEM_2 then
499 if ATUAL_ITEM_1 > QNT_ITEM_2 then
500 player:setStorageValue(_BACKPACK[03][POS_EXT_1][POS_BAG_1].UID_04, (ATUAL_ITEM_1 - QNT_ITEM_2))
501 else
502 doBackpack(player, 02, 03, POS_EXT_1, POS_BAG_1)
503 end
504 if ATUAL_ITEM_2 > QNT_ITEM_2 then
505 player:setStorageValue(_BACKPACK[03][POS_EXT_2][POS_BAG_2].UID_04, (ATUAL_ITEM_2 - QNT_ITEM_2))
506 else
507 doBackpack(player, 02, 03, POS_EXT_2, POS_BAG_2)
508 end
509 if ATUAL_ITEM_3 > QNT_ITEM_2 then
510 player:setStorageValue(_BACKPACK[03][POS_EXT_3][POS_BAG_3].UID_04, (ATUAL_ITEM_3 - QNT_ITEM_2))
511 else
512 doBackpack(player, 02, 03, POS_EXT_3, POS_BAG_3)
513 end
514
515 PlayerTokenCoins(player, 02, 20, 01)
516 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve x20 Pontos de Task.")
517 player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
518 player:sendCancelMessage("@closedBackpack")
519 else
520 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted no Tiene todos os itens necess�rios.")
521 return false
522 end
523 end
524 if TASK_ID == 03 then
525 doBackpack(player, 03, 03, 00, 01, ITEM_7)
526 local ATUAL_ITEM_1 = doBackpack(player, 04)
527 local POS_BAG_1 = doBackpack(player, 05)
528 local POS_EXT_1 = doBackpack(player, 06)
529
530 doBackpack(player, 03, 03, 00, 01, ITEM_8)
531 local ATUAL_ITEM_2 = doBackpack(player, 04)
532 local POS_BAG_2 = doBackpack(player, 05)
533 local POS_EXT_2 = doBackpack(player, 06)
534
535 doBackpack(player, 03, 03, 00, 01, ITEM_9)
536 local ATUAL_ITEM_3 = doBackpack(player, 04)
537 local POS_BAG_3 = doBackpack(player, 05)
538 local POS_EXT_3 = doBackpack(player, 06)
539
540 if ATUAL_ITEM_1 >= QNT_ITEM_3 and ATUAL_ITEM_2 >= QNT_ITEM_3 and ATUAL_ITEM_3 >= QNT_ITEM_3 then
541 if ATUAL_ITEM_1 > QNT_ITEM_3 then
542 player:setStorageValue(_BACKPACK[03][POS_EXT_1][POS_BAG_1].UID_04, (ATUAL_ITEM_1 - QNT_ITEM_3))
543 else
544 doBackpack(player, 02, 03, POS_EXT_1, POS_BAG_1)
545 end
546 if ATUAL_ITEM_2 > QNT_ITEM_3 then
547 player:setStorageValue(_BACKPACK[03][POS_EXT_2][POS_BAG_2].UID_04, (ATUAL_ITEM_2 - QNT_ITEM_3))
548 else
549 doBackpack(player, 02, 03, POS_EXT_2, POS_BAG_2)
550 end
551 if ATUAL_ITEM_3 > QNT_ITEM_3 then
552 player:setStorageValue(_BACKPACK[03][POS_EXT_3][POS_BAG_3].UID_04, (ATUAL_ITEM_3 - QNT_ITEM_3))
553 else
554 doBackpack(player, 02, 03, POS_EXT_3, POS_BAG_3)
555 end
556
557 PlayerTokenCoins(player, 03, 20, 01)
558 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve x20 Pontos de Task.")
559 player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
560 player:sendCancelMessage("@closedBackpack")
561 else
562 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted no Tiene todos os itens necess�rios.")
563 return false
564 end
565 end
566
567 return false
568 end
569 if ACTION == 06 then
570 local PONTOS_EVENTO = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[06].POINTS)
571 if PONTOS_EVENTO < 0 then
572 PONTOS_EVENTO = 0
573 end
574
575 if PONTOS_EVENTO >= 10 then
576 local presentSelect = math.random(00, 15)
577 if presentSelect < 05 then
578 player:addExperience((1000 * player:getLevel()), true, true)
579
580 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve da Present Box:\n[ " ..(1000 * player:getLevel()).. " de EXP ].")
581 player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
582 elseif presentSelect == 05 then
583 if player:getStorageValue(_SYSTEM.TOOLS[01]) > 00 then
584 player:setStorageValue(_SYSTEM.TOOLS[01], (player:getStorageValue(_SYSTEM.TOOLS[01]) + 1800))
585 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve [ LOJA REMOTA (TEMPOR�RIA) ]\nSua Loja Remota atualmente ativa ganhou +30 minutos de dura��o.")
586 else
587 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve [ LOJA REMOTA (TEMPOR�RIA) ]\nEste benef�cio durar� 30 minutos.")
588 player:setStorageValue(_SYSTEM.TOOLS[01], 1800)
589 end
590
591 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve da Present Box:\n[ LOJA REMOTA (30 minutos) ].")
592 player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
593 player:sendCancelMessage("@TutorShow 42")
594 local DESCONTRUIR_EVENT = 00
595 if Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID) == 08 then
596 DESCONTRUIR_EVENT = 01
597 end
598 player:sendCancelMessage("@ToolsLoad " ..player:getStorageValue(_SYSTEM.TOOLS[01]).. " " ..player:getStorageValue(_SYSTEM.TOOLS[02]).. " " ..DESCONTRUIR_EVENT)
599 elseif presentSelect == 10 then
600 if player:getStorageValue(_SYSTEM.TOOLS[02]) > 00 then
601 player:setStorageValue(_SYSTEM.TOOLS[02], (player:getStorageValue(_SYSTEM.TOOLS[02]) + 1800))
602 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve [ NEXUS REMOTO (TEMPOR�RIA) ]\nSeu Nexus Remoto atualmente ativo ganhou +30 minutos de dura��o.")
603 else
604 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve [ NEXUS REMOTO (TEMPOR�RIA) ]\nEste benef�cio durar� 30 minutos.")
605 player:setStorageValue(_SYSTEM.TOOLS[02], 1800)
606 end
607
608 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve da Present Box:\n[ NEXUS REMOTO (30 minutos) ].")
609 player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
610 player:sendCancelMessage("@TutorShow 43")
611 local DESCONTRUIR_EVENT = 00
612 if Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID) == 08 then
613 DESCONTRUIR_EVENT = 01
614 end
615 player:sendCancelMessage("@ToolsLoad " ..player:getStorageValue(_SYSTEM.TOOLS[01]).. " " ..player:getStorageValue(_SYSTEM.TOOLS[02]).. " " ..DESCONTRUIR_EVENT)
616 else
617 PlayerGoldCoins(player, 02, (100 * player:getLevel()))
618 doBackpack(player, 11)
619
620 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve da Present Box:\n[ " ..(100 * player:getLevel()).. " de Gold Coin ].")
621 player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
622 end
623
624 player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[06].POINTS, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[06].POINTS) - 10))
625 player:sendCancelMessage("@ReloadEvents 06 " ..player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[06].POINTS))
626 else
627 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "x10 Pontos s�o necess�rios para abrir o presente.")
628 end
629
630 return false
631 end
632 if ACTION == 08 then
633 local POS = tonumber(split[03])
634 local SLOT = tonumber(split[04])
635 local EXT = tonumber(split[05])
636 local ITEMID = tonumber(split[06])
637 local RAREID = tonumber(split[07])
638
639 for X = 01, 04 do
640 local itemUpgrade = _ITEMS[ITEMID].UPGRADE[X][01]
641 local itemQnt = math.floor(_ITEMS[ITEMID].UPGRADE[X][02] / (06 - RAREID))
642 if itemUpgrade > 00 then
643 local itemRare = _ITEMS[itemUpgrade].RARE
644
645 if itemQnt <= 00 then
646 itemQnt = 01
647 end
648
649 if doBackpack(player, 00, 03, 00, 01) then
650 doBackpack(player, 00, 03, 00, 01)
651 doBackpack(player, 03, 03, 00, 01, itemUpgrade)
652 doBackpack(player, 01, 03, 00, 0, itemUpgrade, itemRare, 00, itemQnt)
653 else
654 playSoundPlayer(player, "depot.ogg")
655 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sua Backpack esta cheia.")
656 break
657 end
658 end
659 end
660
661 -- DESAFIO SHOP
662 if player:getStorageValue(_DESAFIOS[00].DESAFIO_TYPE) == 02 then
663 if player:getStorageValue(_DESAFIOS[00].DESAFIO_SHOP) > 00 then
664 if player:getStorageValue(_DESAFIOS[00].DESAFIO_SHOP) == 01 then
665 player:setStorageValue(_DESAFIOS[00].DESAFIO_TYPE, nil)
666 player:setStorageValue(_DESAFIOS[00].DESAFIO_SHOP, nil)
667 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "[DESCONSTRUIR]: FINALIZADO!")
668 player:sendCancelMessage("@ToolsLoad " ..player:getStorageValue(_SYSTEM.TOOLS[01]).. " " ..player:getStorageValue(_SYSTEM.TOOLS[02]).. " 0")
669 else
670 player:setStorageValue(_DESAFIOS[00].DESAFIO_SHOP, (player:getStorageValue(_DESAFIOS[00].DESAFIO_SHOP) - 01))
671 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[DESCONSTRUIR]: Ainda resta " ..player:getStorageValue(_DESAFIOS[00].DESAFIO_SHOP).. ".")
672 end
673 end
674 end
675 doBackpack(player, 02, SLOT, EXT, POS)
676 doBackpack(player, 00, SLOT, EXT, POS)
677 player:sendCancelMessage("@OpenBackpack")
678 end
679 if ACTION == 10 then
680 local MY_KEYS = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT)
681 if MY_KEYS >= 01 then
682 local chance = math.random(01, 05)
683 local CriticalChance = math.random(01, 50)
684 if chance == 01 then -- ONLINE POINTS
685 local GAIN_COINS = math.random(03, 07)
686 if CriticalChance == 07 then
687 GAIN_COINS = 20
688
689 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "SORTE CR�TICA!")
690 player:getPosition():sendMagicEffect(50)
691 end
692 player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT) - 01))
693 player:sendCancelMessage("@LootMSG 3160 0 0 " ..GAIN_COINS)
694 if player:getStorageValue(_SYSTEM.ONLINE_COIN) < 00 then
695 player:setStorageValue(_SYSTEM.ONLINE_COIN, GAIN_COINS)
696 else
697 player:setStorageValue(_SYSTEM.ONLINE_COIN, (player:getStorageValue(_SYSTEM.ONLINE_COIN) + GAIN_COINS))
698 end
699
700 doBackpack(player, 11)
701 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Usted obteve x" ..GAIN_COINS.. " Online Points do Ba� do Drag�o. Seu saldo atual �: [ " ..player:getStorageValue(_SYSTEM.ONLINE_COIN).. " ].")
702 end
703 if chance == 02 then -- VIP COINS
704 local GAIN_COINS = math.random(02, 05)
705 if CriticalChance == 07 then
706 GAIN_COINS = 15
707
708 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "SORTE CR�TICA!")
709 player:getPosition():sendMagicEffect(50)
710 end
711 player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT) - 01))
712 PlayerVipCoins(player, 02, GAIN_COINS)
713 doBackpack(player, 11)
714 player:sendCancelMessage("@LootMSG 3218 3 0 " ..GAIN_COINS)
715 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Usted obteve x" ..GAIN_COINS.. " Vip Coins no Ba� do Drag�o.")
716 end
717 if chance == 03 then -- CRIPTOMOEDAS
718 local GAIN_COINS = math.random(10, 30)
719 if CriticalChance == 07 then
720 GAIN_COINS = 100
721
722 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "SORTE CR�TICA!")
723 player:getPosition():sendMagicEffect(50)
724 end
725 player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT) - 01))
726 if player:getStorageValue(_SYSTEM.CRIPTOMOEDA) < 00 then
727 player:setStorageValue(_SYSTEM.CRIPTOMOEDA, ((player:getStorageValue(_SYSTEM.CRIPTOMOEDA) + GAIN_COINS) + 01))
728 else
729 player:setStorageValue(_SYSTEM.CRIPTOMOEDA, (player:getStorageValue(_SYSTEM.CRIPTOMOEDA) + GAIN_COINS))
730 end
731
732 player:sendCancelMessage("@LootMSG 3297 4 3 " ..GAIN_COINS)
733 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Usted obteve x" ..GAIN_COINS.. " Criptomoedas no Ba� do Drag�o.")
734 end
735 if chance == 04 then -- AMULETS
736 local IDDD = math.random(1000, 1021)
737 local SLOT = 01
738 local RARE = math.random(01, 03)
739 local STAR = 00
740 if CriticalChance == 07 then
741 RARE = math.random(03, 04)
742 STAR = math.random(01, 03)
743
744 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "SORTE CR�TICA!")
745 player:getPosition():sendMagicEffect(50)
746 end
747 if doBackpack(player, 00, SLOT, 00, 01) then
748 if doBackpack(player, 01, SLOT, 00, 0, IDDD, RARE, STAR) then
749 player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT) - 01))
750 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Usted recebeu o item [ ".._RARIDADES[RARE].Name.. " " .._ITEMS[IDDD].NAME.. " ] no Ba� do Drag�o.")
751 player:getPosition():sendMagicEffect(14)
752 end
753 else
754 playSoundPlayer(player, "depot.ogg")
755 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sua Backpack esta cheia.")
756 player:getPosition():sendMagicEffect(03)
757 return false
758 end
759 end
760 if chance == 05 then -- RINGS
761 local IDDD = math.random(7000, 7014)
762 local SLOT = 07
763 local RARE = math.random(01, 03)
764 local STAR = 00
765 if CriticalChance == 07 then
766 RARE = math.random(03, 04)
767 STAR = math.random(01, 03)
768
769 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "SORTE CR�TICA!")
770 player:getPosition():sendMagicEffect(50)
771 end
772 if doBackpack(player, 00, SLOT, 00, 01) then
773 if doBackpack(player, 01, SLOT, 00, 0, IDDD, RARE, STAR) then
774 player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT) - 01))
775 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Usted recebeu o item [ ".._RARIDADES[RARE].Name.. " " .._ITEMS[IDDD].NAME.. " ] no Ba� do Drag�o.")
776 player:getPosition():sendMagicEffect(14)
777 end
778 else
779 playSoundPlayer(player, "depot.ogg")
780 player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sua Backpack esta cheia.")
781 player:getPosition():sendMagicEffect(03)
782 return false
783 end
784 end
785
786 player:sendCancelMessage("@ReloadEvents 10 " ..player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT))
787 else
788 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "S�o necess�rio x01 Chave de Evento para abrir o ba�.")
789 end
790 end
791 if ACTION == 11 then
792 if Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID) == 11 then
793 local STEP_EVENT = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[11].PILLAR_STEP) or 0
794 if STEP_EVENT > 00 and STEP_EVENT < 06 then
795
796 player:sendCancelMessage("@ReloadEvents 11")
797 player:getPosition():sendMagicEffect(13)
798 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Os Pilares foram marcados em seu mapa.")
799 else
800 if STEP_EVENT == 00 then
801 player:sendTextMessage(MESSAGE_STATUS_WARNING, "O servidor falhou em eliminar os pilares dentro do tempo.\nAguarde at� o pr�ximo ServerSave para tentar novamente.")
802 else
803 player:sendTextMessage(MESSAGE_INFO_DESCR, "O servidor obteve sucesso em eliminar os pilares dentro do tempo.\nO b�nus est� ativo no servidor at� o pr�ximo ServerSave.")
804 end
805 end
806 end
807 end
808 return false
809 end
810 --[[ CARREGANDO EVENTOS MENSAIS ]]--
811 if split[01] == "40" then
812 local EVENTO_ID = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID)
813 if EVENTO_ID == 01 then
814 local GOLD_TOKEN = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[EVENTO_ID].GOLD_TOKEN)
815 if GOLD_TOKEN < 0 then
816 GOLD_TOKEN = 0
817 end
818
819 local MONSTER_01 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1)
820 local MONSTER_02 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_2)
821 local MONSTER_03 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_3)
822 local MONSTER_04 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_4)
823 local MONSTER_05 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_5)
824 local MONSTER_06 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_6)
825 local MONSTER_07 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_7)
826 local MONSTER_08 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_8)
827 local MONSTER_09 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_9)
828 player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..MONSTER_01.. " " ..MONSTER_02.. " " ..MONSTER_03.. " " ..MONSTER_04.. " " ..MONSTER_05.. " " ..MONSTER_06.. " " ..MONSTER_07.. " " ..MONSTER_08.. " " ..MONSTER_09.. " " ..GOLD_TOKEN)
829 return false
830 end
831 if EVENTO_ID == 02 then
832 local COUNT_MONSTER = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1)
833 if COUNT_MONSTER < 0 then
834 COUNT_MONSTER = 0
835 end
836
837 player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..COUNT_MONSTER)
838 return false
839 end
840 if EVENTO_ID == 03 then
841 local CRYPTBLOOD = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1)
842 if CRYPTBLOOD < 0 then
843 CRYPTBLOOD = 0
844 end
845
846 player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..CRYPTBLOOD)
847 return false
848 end
849 if EVENTO_ID == 04 then
850 player:sendCancelMessage("@EventosLoad " ..EVENTO_ID)
851 return false
852 end
853 if EVENTO_ID == 05 then
854 local ITEM_1 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_4)
855 local ITEM_2 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_5)
856 local ITEM_3 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_6)
857 local ITEM_4 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_7)
858 local ITEM_5 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_8)
859 local ITEM_6 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_9)
860 local ITEM_7 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_10)
861 local ITEM_8 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_11)
862 local ITEM_9 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_12)
863
864 local QNT_ITEM_1 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1)
865 local QNT_ITEM_2 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_2)
866 local QNT_ITEM_3 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_3)
867
868 player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..ITEM_1.. " " ..ITEM_2.. " " ..ITEM_3.. " " ..ITEM_4.. " " ..ITEM_5.. " " ..ITEM_6.. " " ..ITEM_7.. " " ..ITEM_8.. " " ..ITEM_9.. " " ..QNT_ITEM_1.. " " ..QNT_ITEM_2.. " " ..QNT_ITEM_3)
869 return false
870 end
871 if EVENTO_ID == 06 then
872 local PONTOS_EVENTO = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[06].POINTS)
873 if PONTOS_EVENTO < 0 then
874 PONTOS_EVENTO = 0
875 end
876
877 player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..PONTOS_EVENTO)
878 return false
879 end
880 if EVENTO_ID == 07 then
881 local EXP_BON = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[07].EXP_BONUS)
882 if EXP_BON < 0 then
883 EXP_BON = 0
884 end
885
886 player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..EXP_BON)
887 return false
888 end
889 if EVENTO_ID == 08 then
890 player:sendCancelMessage("@EventosLoad " ..EVENTO_ID)
891 return false
892 end
893 if EVENTO_ID == 09 then
894 player:sendCancelMessage("@EventosLoad " ..EVENTO_ID)
895 return false
896 end
897 if EVENTO_ID == 10 then
898 local KEYS_EVENT = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT)
899 if KEYS_EVENT < 0 then
900 KEYS_EVENT = 0
901 end
902 player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..KEYS_EVENT)
903 return false
904 end
905 if EVENTO_ID == 11 then
906 local STAGE_EVENT = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[11].PILLAR_STEP) or 0
907
908 player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..STAGE_EVENT)
909 return false
910 end
911 if EVENTO_ID == 12 then
912 local CM_UM = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1)
913 local CM_DO = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_2)
914 local CM_TR = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_3)
915 local METAS = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_4)
916 local BUFFS = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_5)
917 if METAS < 00 then
918 METAS = 00
919 end
920
921 player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..CM_UM.. " " ..CM_DO.. " " ..CM_TR.. " " ..METAS.. " " ..BUFFS)
922 return false
923 end
924
925 local Mes = tonumber(os.date("%m", os.time()))
926 local Dia = tonumber(os.date("%d", os.time()))
927 player:sendCancelMessage("@EventosLoad 00 " ..Mes.. " " ..Dia)
928 return false
929 end
930 --[[ PARTICIPAR DA WAR ZONE ]]--
931 if split[01] == "39" then
932 local checkDG = 0
933 if Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
934 for X = 01, #_SYSTEM.DANGEROUS do
935 for Z = 01, #_SYSTEM.DANGEROUS[X] do
936 if player:getStorageValue(_SYSTEM.DANGEROUS[X][Z].STORAGE) > 0 then
937 checkDG = 01
938 break
939 end
940 end
941 end
942 if checkDG == 0 then
943 if player:getStorageValue(_SYSTEM.WARZONE) > 00 then
944 checkDG = 01
945 end
946 end
947 if checkDG == 0 then
948 if player:getLevel() >= _GLOBAL_RANDOM.WARZONE.LEVEL then
949 if Game.getStorageValue(_GLOBAL_RANDOM.WARZONE.STORAGE_START_WARZONE) == 01 then
950 doBackpack(player, 00, 04, 00, 01) -- Organizo Backpack
951 local EmptySlot = doBackpack(player, 07, 04)
952 if EmptySlot < 01 then
953 player:popupFYI("Abra espa�o em sua Backpack de armas para poder entrar.")
954 player:sendCancelMessage("@WarzoneStart 00")
955 return false
956 end
957 if player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_01) > 0 then
958 if doBackpack(player, 00, 04, 00, 01) then
959 -- Removendo o item equipado
960 doInventario(player, 02, 04, 00) -- Removo do Invent�rio
961 doInventario(player, 00, 04, 00) -- Organizo Invent�rio
962 doBackpack(player, 00, 04, 00, 01) -- Organizo Backpack
963
964 player:sendCancelMessage("@RemoveItemInventario 04")
965 player:sendCancelMessage("@StarCliente")
966 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sua arma principal foi devolvida a sua backpack.\nPoder� equip�-la novamente ao sair da Warzone.")
967 else
968 player:popupFYI("Libere espa�o em sua Backpack de armas para poder continuar.")
969 player:sendCancelMessage("@WarzoneStart 00")
970 return false
971 end
972 end
973 if WAR_PLAYER == nil or WAR_PLAYER < 00 then
974 WAR_PLAYER = 00
975 end
976 if WAR_PLAYER >= _GLOBAL_RANDOM.WARZONE.MAX_PLAYER then
977 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "M�ximo de jogadores na Warzone atingido [ " .._GLOBAL_RANDOM.WARZONE.MAX_PLAYER.. " ]\nAguarde alguma desist�ncia para poder entrar.")
978 return false
979 end
980 if LOAD_PARTICIPE_PLAYER ~= nil then
981 stopEvent(LOAD_PARTICIPE_PLAYER)
982 end
983 local WAR_PLAYER = Game.getStorageValue(_GLOBAL_RANDOM.WARZONE.STORAGE_COUNT_PLAYER)
984 Game.setStorageValue(_GLOBAL_RANDOM.WARZONE.STORAGE_COUNT_PLAYER, (WAR_PLAYER + 01))
985 player:setTown(Town(15))
986 player:setMaxHealth(_GLOBAL_RANDOM.WARZONE.MAX_HEALTH)
987 player:addHealth(player:getMaxHealth())
988 player:teleportTo(_GLOBAL_RANDOM.WARZONE.LOB_WARZONE)
989 player:getPosition():sendMagicEffect(11)
990 player:setStorageValue(_SYSTEM.WARZONE, 01)
991 player:sendCancelMessage("@NoTeleport 01")
992 LOAD_PARTICIPE_PLAYER = addEvent(function()
993 local players = Game.getPlayers()
994 for _, targetPlayer in ipairs(players) do
995 if targetPlayer:getLevel() >= _GLOBAL_RANDOM.WARZONE.LEVEL then
996 if targetPlayer:getStorageValue(_SYSTEM.WARZONE) < 01 then
997 targetPlayer:sendCancelMessage("@WarzoneStart " ..Game.getStorageValue(_GLOBAL_RANDOM.WARZONE.STORAGE_COUNT_PLAYER))
998 end
999 end
1000 end
1001 end, 2000)
1002 end
1003 else
1004 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Somente jogadores de level " .._GLOBAL_RANDOM.WARZONE.LEVEL.. " ou superior podem participar.")
1005 player:sendCancelMessage("@WarzoneStart 00")
1006 end
1007 else
1008 player:popupFYI("Usted no pode fazer isso nesse momento.")
1009 player:sendCancelMessage("@WarzoneStart 00")
1010 end
1011 else
1012 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "� preciso estar em Protection Zone para poder entrar.")
1013 player:sendCancelMessage("@WarzoneStart 00")
1014 end
1015 return false
1016 end
1017 --[[ CARREGANDO PIX DA CONTA ]]--
1018 if split[01] == "38" then
1019 local playerAccountId = player:getAccountId()
1020 local NOME = ""
1021 local EMAIL = ""
1022 local BANK = ""
1023 local PIX = db.storeQuery("SELECT rlname, vote, location FROM accounts WHERE id = " ..playerAccountId.. ";")
1024 if PIX then
1025 local i = 1
1026 repeat
1027 NOME = result.getDataString(PIX, "rlname")
1028 EMAIL = result.getDataString(PIX, "vote")
1029 BANK = result.getDataString(PIX, "location")
1030 i = i + 1
1031 until not result.next(PIX)
1032 result.free()
1033 end
1034
1035 player:sendCancelMessage("@LoadPix-" ..NOME.. "-" ..EMAIL.. "-" ..BANK)
1036 return false
1037 end
1038 --[[ CRIPTOMOEDAS ]]--
1039 if split[01] == "37" then
1040 local playerAccountId = player:getAccountId()
1041 local CRIPTO = player:getStorageValue(_SYSTEM.CRIPTOMOEDA)
1042 local BLACKMARKET = ''
1043 local REQUEST = db.storeQuery("SELECT * FROM links WHERE account_id = " ..playerAccountId.. " ORDER BY `id` DESC LIMIT 10;")
1044 if REQUEST then
1045 local i = 1
1046 repeat
1047 local A = result.getDataInt(REQUEST, "id")
1048 local B = result.getDataInt(REQUEST, "account_id")
1049 local C = result.getDataString(REQUEST, "name")
1050 local D = result.getDataString(REQUEST, "email")
1051 local E = result.getDataString(REQUEST, "banco")
1052 local F = result.getDataInt(REQUEST, "criptomoeda")
1053 local G = result.getDataString(REQUEST, "price")
1054 local H = result.getDataString(REQUEST, "valor")
1055 local I = result.getDataInt(REQUEST, "status")
1056 local J = result.getDataString(REQUEST, "obs")
1057
1058 player:sendCancelMessage("@CriptLoad-01-" ..i.. "-" ..A.. "-" ..B.. "-" ..C.. "-" ..D.. "-" ..E.. "-" ..F.. "-" ..G.. "-" ..H.. "-" ..I.. "-" ..J)
1059 i = i + 1
1060 until not result.next(REQUEST)
1061 result.free()
1062 end
1063 if CRIPTO < 00 then CRIPTO = 00 end
1064 local SALDO_BLACK = db.storeQuery("SELECT gender FROM accounts WHERE id = 1;")
1065 if SALDO_BLACK then
1066 repeat
1067 BLACKMARKET = result.getDataString(SALDO_BLACK, "gender")
1068 until not result.next(SALDO_BLACK)
1069 result.free()
1070 end
1071
1072 player:sendCancelMessage("@CriptLoad-02-" ..CRIPTO.. "-" ..BLACKMARKET.. "-" ..getAllPlayerInAccount(player:getAccountId()))
1073 return false
1074 end
1075 --[[ ATUALIZA BAG INVENTARIO EM TEMPO REAL ]]--
1076 if split[01] == "34" then
1077 local reloadType = tonumber(split[02])
1078 local slot = tonumber(split[03])
1079
1080 if reloadType == 01 then
1081 player:sendCancelMessage("@ReloadBackpack " ..slot.. " 01")
1082 return false
1083 elseif reloadType == 03 then
1084 local IDD_1 = player:getStorageValue(_SYSTEM.MAESTRIA[01])
1085 local IDD_2 = player:getStorageValue(_SYSTEM.ESPECIALISTA[01])
1086 local IDD_3 = player:getStorageValue(_SYSTEM.MAESTRIA[02])
1087 local IDD_4 = player:getStorageValue(_SYSTEM.ESPECIALISTA[02])
1088 player:sendCancelMessage("@MaestriaEsp " ..IDD_1.. " " ..IDD_2.. " " ..IDD_3.. " " ..IDD_4)
1089 player:sendCancelMessage("@StarCliente")
1090 return false
1091 elseif reloadType == 04 then
1092 if split[03] then
1093 if tonumber(split[03]) == _APP_VERSION then
1094 for X = 01, #_QUESTLOG do
1095 if _QUESTLOG[X].Type == "NORMAL" then
1096 player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01))
1097 elseif _QUESTLOG[X].Type == "HUNT" then
1098 player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01).. " " ..player:getStorageValue(_QUESTLOG[X].Value[01]).. " " .._QUESTLOG[X].Value[02])
1099 else
1100 player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01).. " " ..onGetBackpackItem(player, _QUESTLOG[X].Value[01]).. " " .._QUESTLOG[X].Value[02])
1101 end
1102 end
1103 doInventario(player, 03)
1104 doBackpack(player, 11)
1105
1106 local DAILY_EVENT = Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE) or 0
1107 local DAILY_PASSIVE = Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.PASSIVE) or 0
1108 if DAILY_EVENT > 00 and DAILY_PASSIVE > 00 then
1109 player:sendCancelMessage("@DailyEvent " ..DAILY_EVENT.. " " ..DAILY_PASSIVE)
1110 end
1111 return false
1112 else
1113 print("[" ..player:getName().. "] OLD VERSION (" ..split[03].. ") < (" .._APP_VERSION.. ")")
1114 player:setTown(Town(01))
1115 player:teleportTo(player:getTown():getTemplePosition())
1116 player:popupFYI("Cliente desatualizado.\nAtualize seu cliente para continuar jogando.")
1117 addEvent(function()
1118 player:sendCancelMessage("@ClientSystem 01") -- Fechando o cliente
1119 --doRemoveCreature(player:getId())
1120 end, 5000)
1121 return false
1122 end
1123 end
1124 return false
1125 else
1126 doBackpack(player, 11)
1127 return false
1128 end
1129 return false
1130 end
1131 --[[ EQUIPA UMA APAR�NCIA DE BACKPACK ]]--
1132 if split[01] == "33" then
1133 -- reproducir sonido al iniciar la acción
1134 playSoundPlayer(player, "depot.ogg")
1135 local backid = tonumber(split[02])
1136 local index = tonumber(split[03])
1137
1138 if index == 00 then
1139 player:setStorageValue(_SYSTEM.INVENTARIO[03].UID_01, 10000)
1140 player:setStorageValue(_SYSTEM.INVENTARIO[03].UID_02, nil)
1141 player:sendCancelMessage("@EquipBackpack 10000")
1142 doInventario(player, 00)
1143 else
1144 if player:getStorageValue(_SYSTEM.BACKPACKS[index]) > 0 then
1145 player:setStorageValue(_SYSTEM.INVENTARIO[03].UID_01, player:getStorageValue(_SYSTEM.BACKPACKS[index]))
1146 player:setStorageValue(_SYSTEM.INVENTARIO[03].UID_02, _ITEMS[backid].RARE)
1147 player:sendCancelMessage("@EquipBackpack " ..player:getStorageValue(_SYSTEM.INVENTARIO[03].UID_01))
1148 doInventario(player, 00)
1149 end
1150 end
1151 return false
1152 end
1153 --[[ LOAD STATUS ]]--
1154 if split[01] == "32" then
1155 doInventario(player, 04)
1156 return false
1157 end
1158 --[[ APENAS UMA MENSAGEM DE ALERTA ]]--
1159 if split[01] == "31" then
1160 player:popupFYI("Usted no pode fazer isso nesse momento.")
1161 return false
1162 end
1163 --[[ TELEPORT DO NEXUS PELO MINIMAPA ]]--
1164 if split[01] == "30" then
1165 local Nexus_ID = tonumber(split[02])
1166 if not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
1167 local checkDG = 0
1168 for X = 01, #_SYSTEM.DANGEROUS do
1169 for Z = 01, #_SYSTEM.DANGEROUS[X] do
1170 if player:getStorageValue(_SYSTEM.DANGEROUS[X][Z].STORAGE) > 0 then
1171 checkDG = 01
1172 break
1173 end
1174 end
1175 end
1176 if checkDG == 0 then
1177 if player:getStorageValue(_SYSTEM.WARZONE) > 00 then
1178 checkDG = 01
1179 end
1180 if player:getStorageValue(_SYSTEM.FENDAS_DIMENSIONAL[01]) > 00 then
1181 checkDG = 01
1182 end
1183 if player:getStorageValue(_PVP_ROOM[00].PVP_SALA_ID) > 00 then
1184 checkDG = 01
1185 end
1186 end
1187 if checkDG == 0 then
1188 if _SYSTEM.NEXUS[Nexus_ID].PREMIUM then
1189 if player:isPremium() then
1190 player:setTown(Town(_SYSTEM.NEXUS[Nexus_ID].TOWN))
1191 player:teleportTo(_SYSTEM.NEXUS[Nexus_ID].POS)
1192 player:getPosition():sendMagicEffect(11)
1193 else
1194 player:popupFYI("Somente jogadores Premium Account podem usar o teleport.")
1195 end
1196 else
1197 player:setTown(Town(_SYSTEM.NEXUS[Nexus_ID].TOWN))
1198 player:teleportTo(_SYSTEM.NEXUS[Nexus_ID].POS)
1199 player:getPosition():sendMagicEffect(11)
1200 end
1201 else
1202 player:popupFYI("Usted no pode fazer isso nesse momento.")
1203 end
1204 else
1205 player:popupFYI("Aguarde sair do combate para poder se teleportar.")
1206 end
1207 return false
1208 end
1209 --[[ ADICIONA SKILL EM UM EQUIPAMENTO OU ARMA ]]--
1210 if split[01] == "29" then
1211 local slot = tonumber(split[02])
1212 local id = tonumber(split[03])
1213 local ext = tonumber(split[04])
1214 local bag = tonumber(split[05])
1215 local skillid = tonumber(split[06])
1216 local spellpos = tonumber(split[07])
1217 local qnt = player:getStorageValue(_BACKPACK[03][ext][bag].UID_04)
1218
1219 if slot == 4 then
1220 if spellpos == 1 then
1221 if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_05) == skillid or player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_06) == skillid then
1222 player:popupFYI("Usted no pode adicionar skills iguais em uma mesma arma.")
1223 player:sendCancelMessage("@SkillFailUpgrade")
1224 return false
1225 else
1226 player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_04, skillid)
1227 end
1228 elseif spellpos == 2 then
1229 if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_04) == skillid or player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_06) == skillid then
1230 player:popupFYI("Usted no pode adicionar skills iguais em uma mesma arma.")
1231 player:sendCancelMessage("@SkillFailUpgrade")
1232 return false
1233 else
1234 player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_05, skillid)
1235 end
1236 elseif spellpos == 3 then
1237 if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_04) == skillid or player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_05) == skillid then
1238 player:popupFYI("Usted no pode adicionar skills iguais em uma mesma arma.")
1239 player:sendCancelMessage("@SkillFailUpgrade")
1240 return false
1241 else
1242 player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_06, skillid)
1243 end
1244 end
1245
1246 -- DESAFIO
1247 if player:getStorageValue(_DESAFIOS[00].DESAFIO_ID) > 00 then
1248 onPlayerDesafios(player, 92, 01)
1249 end
1250 player:sendCancelMessage("@StarCliente")
1251 if player:getStorageValue(_QUESTLOG[06].UID_01) == 2 then
1252 player:setStorageValue(_QUESTLOG[06].UID_01, 100)
1253
1254 player:getPosition():sendMagicEffect(14)
1255 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
1256 doBackpack(player, 12)
1257 end
1258 else
1259 if spellpos == 1 then
1260 player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_06, skillid)
1261 else
1262 player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_07, skillid)
1263 end
1264
1265 -- DESAFIO
1266 if player:getStorageValue(_DESAFIOS[00].DESAFIO_ID) > 00 then
1267 onPlayerDesafios(player, 91, 01)
1268 end
1269 if player:getStorageValue(_QUESTLOG[87].UID_01) == 02 then
1270 player:setStorageValue(_QUESTLOG[87].UID_01, 100)
1271
1272 player:addExperience(2500, true, true)
1273 player:getPosition():sendMagicEffect(14)
1274 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
1275 doBackpack(player, 12)
1276 end
1277 if player:getStorageValue(_QUESTLOG[91].UID_01) == 01 then
1278 if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_06) > 0 then
1279 player:setStorageValue(_QUESTLOG[91].UID_01, 100)
1280
1281 player:addExperience(20000, true, true)
1282 player:getPosition():sendMagicEffect(14)
1283 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
1284 doBackpack(player, 12)
1285 end
1286 end
1287 end
1288
1289 doInventario(player, 00, slot, ext)
1290 doBackpack(player, 02, 03, ext, bag, qnt)
1291 doBackpack(player, 00, 03, ext, 01)
1292 player:sendCancelMessage("@ReloadBackpack 03 01")
1293 player:sendCancelMessage("@LoadTooltipInv")
1294 player:popupFYI("UPGRADE realizado com sucesso!")
1295 player:sendCancelMessage("@SkillUpgradeSucess")
1296 return false
1297 end
1298 --[[ CARREGA INFORMA��ES SOBRE GOLD COINS E ONLINE COINS ]]--
1299 if split[01] == "28" then
1300 doBackpack(player, 11)
1301 return false
1302 end
1303 --[[ UMA SIMPLES MENSAGEM INDICANDO QUE A QUEST ESTA SENDO RASTREADA PELO MINIMAPA ]]--
1304 if split[01] == "27" then
1305 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "O objetivo desta quest foi agora\nmarcado em seu mapa.")
1306 player:getPosition():sendMagicEffect(14)
1307 return false
1308 end
1309 --[[ CARREGANDO TODAS AS QUEST EM ABERTO ]]--
1310 if split[01] == "25" then
1311 for X = 01, #_QUESTLOG do
1312 if _QUESTLOG[X].Type == "NORMAL" then
1313 player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01))
1314 elseif _QUESTLOG[X].Type == "HUNT" then
1315 player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01).. " " ..player:getStorageValue(_QUESTLOG[X].Value[01]).. " " .._QUESTLOG[X].Value[02])
1316 else
1317 player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01).. " " ..onGetBackpackItem(player, _QUESTLOG[X].Value[01]).. " " .._QUESTLOG[X].Value[02])
1318 end
1319 end
1320 return false
1321 end
1322 --[[ FINALIZAR CONVERSA COM NPC ]]--
1323 if split[01] == "24" then
1324 -- reproducir sonido antes de finalizar la conversación
1325 playSoundPlayer(player, "depot.ogg")
1326 local NPC = split[02]
1327 --local player = player(NPC)
1328 player:say("bye", TALKTYPE_PRIVATE_FROM, false, NPC)
1329 return false
1330 end
1331 --[[ ABRINDO JANELA DE SUMMONS ]]--
1332 if split[01] == "22" then
1333 player:sendCancelMessage("@ShowSummonWind")
1334 return false
1335 end
1336 --[[ CARREGANDO APAR�NCIA DAS BACKPACK ]]--
1337 if split[01] == "21" then
1338 player:sendCancelMessage("@LoadBackpack 00 00")
1339 for Back = 01, #_SYSTEM.BACKPACKS do
1340 if player:getStorageValue(_SYSTEM.BACKPACKS[Back]) < 00 then
1341 break
1342 end
1343
1344 player:sendCancelMessage("@LoadBackpack " ..Back.. " " ..player:getStorageValue(_SYSTEM.BACKPACKS[Back]))
1345 end
1346 return false
1347 end
1348 --[[ EQUIPANDO UM ITEM DA BACKPACK ]]--
1349 if tonumber(split[01]) >= 01 then
1350 -- reproducir sonido al cambiar de slot
1351 playSoundPlayer(player, "depot.ogg")
1352 local ext = tonumber(split[03]) or nil
1353 local bag = tonumber(split[01]) or nil
1354 local slot = _ITEMS[tonumber(split[02])].SLOT_EQUIP or nil
1355 local itemid = player:getStorageValue(_BACKPACK[slot][ext][bag].UID_01) or nil
1356 local itemRecLevel = 0
1357
1358 if ext == nil or bag == nil or slot == nil or itemid == nil then
1359 return false
1360 end
1361 if _DEBUG_MODE then
1362 print("[TALK - INVENTARIO] " ..player:getName().. " - " .._ITEMS[itemid].NAME)
1363 end
1364 if slot == 04 then
1365 if player:getStorageValue(_SYSTEM.WARZONE) > 00 then
1366 return false
1367 end
1368 end
1369 if slot == 2 or slot == 5 or slot == 6 or slot == 8 or slot == 9 then
1370 lvl = player:getStorageValue(_BACKPACK[slot][ext][bag].UID_05)
1371 sta = player:getStorageValue(_BACKPACK[slot][ext][bag].UID_03)
1372 def = 10000
1373
1374 if lvl < 0 then lvl = 0 end
1375 if sta < 0 then sta = 0 end
1376 if itemid then
1377 if _ITEMS[itemid].DEF ~= nil then
1378 def = _ITEMS[itemid].DEF
1379 end
1380 end
1381 itemRecLevel = (def + lvl + (sta * 10)) * 2
1382 elseif slot == 4 then
1383 lvl = player:getStorageValue(_BACKPACK[slot][ext][bag].UID_07)
1384 sta = player:getStorageValue(_BACKPACK[slot][ext][bag].UID_03)
1385
1386 if lvl < 0 then lvl = 0 end
1387 if sta < 0 then sta = 0 end
1388 itemRecLevel = math.floor((_ITEMS[itemid].MIN + lvl + (sta * 10)) / 3)
1389 if id ~= nil and id > 0 then
1390 if id >= 4031 and id <= 4049 then
1391 itemRecLevel = _ITEMS[itemid].MIN + lvl + (sta * 10) * 2
1392 end
1393 end
1394 end
1395 if player:getLevel() >= itemRecLevel then
1396 doInventario(player, 01, slot, ext, bag) -- Adiciono
1397 doBackpack(player, 00, slot, ext, 01) -- Organizo | Capacidade
1398
1399 if player:getStorageValue(_QUESTLOG[01].UID_01) == 02 then
1400 player:setStorageValue(_QUESTLOG[01].UID_01, 3)
1401
1402 doBackpack(player, 12)
1403 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
1404 player:sendCancelMessage("@TutorShow 03")
1405 end
1406 if slot == 04 then
1407 if player:getStorageValue(_QUESTLOG[80].UID_01) == 02 then
1408 if player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_04) > 00 then
1409 if player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_05) > 00 then
1410 player:setStorageValue(_QUESTLOG[80].UID_01, 100)
1411 player:setStorageValue(_QUESTLOG[85].UID_01, 01)
1412
1413 player:addExperience(3000, true, true)
1414 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
1415 doBackpack(player, 12)
1416 end
1417 end
1418 end
1419 if player:getStorageValue(_QUESTLOG[85].UID_01) == 02 then
1420 if player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_04) > 00 then
1421 if player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_05) > 00 then
1422 if player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_06) > 00 then
1423 player:setStorageValue(_QUESTLOG[85].UID_01, 100)
1424
1425 player:addExperience(5000, true, true)
1426 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
1427 doBackpack(player, 12)
1428 end
1429 end
1430 end
1431 end
1432 local slotItem = player:getSlotItem(CONST_SLOT_LEFT)
1433 if slotItem == nil then
1434 player:addItem(7366)
1435 end
1436 end
1437 end
1438 end
1439
1440 return false
1441end
1442
Top