local Teste = false local LOAD_PARTICIPE_PLAYER = nil local condition = Condition(CONDITION_OUTFIT) local function getAllPlayerInAccount(id) local resultId = db.storeQuery("SELECT `level`, `name` FROM `players` WHERE `account_id` = " .. id .. " ORDER BY `level` DESC") if resultId ~= false then local guid = result.getDataString(resultId, "name") result.free(resultId) return guid end return 0 end function onSay(player, words, param) local split = param:splitTrimmed(" ") -- Se reproduce el sonido para toda interacción playSoundPlayer(player, "depot.ogg") if split[01] == nil then return false end --[[ USADO PARA TESTES ]]-- if split[01] == "26" then local cid = player:getId() if split[02] then if _BONUS_EXTRA[tonumber(split[02])] then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[BONUS] " .._BONUS_EXTRA_TABLE[cid][tonumber(split[02])].. "" .._BONUS_EXTRA[tonumber(split[02])].TEXT) else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "B�nus no encontrado") end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Falta parametros") end return false end if split[01] == "50" then local cid = player:getId() if _UNOFFICIAL_CLIENT[cid] then stopEvent(_UNOFFICIAL_CLIENT[cid]) _UNOFFICIAL_CLIENT[cid] = nil end return false end if _DEBUG_MODE then local _TYPE = { ["00"] = 'Removendo item equipado', ["21"] = 'Carregando Aparencia da Backpack', ["24"] = 'Finalizando Conversa com o NPC', ["25"] = 'Carregando todas as Quest em Aberto', ["26"] = 'Usado para Testes', ["27"] = 'Mensagem Quest marcada em seu mapa', ["28"] = 'Carregando Gold e Online Coins', ["29"] = 'Adicionando Skill Arma ou Equipamento', ["30"] = 'Teleport Nexus', ["31"] = 'Mensagem de Alerta', ["32"] = 'Carregando Status', ["33"] = 'Equipando Aparancia da Backpack', ["34"] = 'Atualizando Bag Tempo Real', ["37"] = 'Criptomoedas', ["38"] = 'Carregando PIX', ["39"] = 'Participar Warzone', ["40"] = 'Carregando Eventos Mensais', ["41"] = 'Botoes de Menu Eventos', ["43"] = 'Destruindo um Equipamento', ["44"] = 'Carregando Coliseu', ["45"] = 'Trocando Criptomoedas por Vip Coins', ["46"] = 'Abrindo Central Box Remoto', ["47"] = 'Upgrade Passiva', ["48"] = 'Equipando uma Passiva', ["49"] = 'Pular Cena Automatica', } if _TYPE[split[01]] then if split[01] == "24" then print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | " ..split[02]) elseif split[01] == "29" then if tonumber(split[02]) == 04 then print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | " .._SPELLS[tonumber(split[06])].NAME) else print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | " .._ATRIBUTOS[tonumber(split[06])].NAME) end elseif split[01] == "30" then print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | " .._SYSTEM.NEXUS[tonumber(split[02])].NAME) elseif split[01] == "33" then print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | " .._ITEMS[tonumber(split[02])].NAME) elseif split[01] == "34" then if tonumber(split[02]) == 01 then print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " (Atualizando Bag)") elseif tonumber(split[02]) == 02 then print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " (Atualizando Dinheiro)") elseif tonumber(split[02]) == 03 then print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " (Atualizando Maestria)") elseif tonumber(split[02]) == 04 then print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " (Checando vers�o do cliente)") end elseif split[01] == "47" then print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | [" .._PASSIVES[tonumber(split[02])].DESC.. "]") elseif split[01] == "48" then print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]].. " | [" .._PASSIVES[tonumber(split[03])].DESC.. "]") else print("[TALK - INVENTARIO] " ..player:getName().. " - " .._TYPE[split[01]]) end else print("[TALK - INVENTARIO] " ..player:getName().. " - " ..split[01].. " (Equipando um Item do Invent�rio)") end end --[[ REMOVENDO UM ITEM EQUIPADO ]]-- if split[01] == "00" then local ext = tonumber(split[02]) local slot = tonumber(split[03]) local bag = tonumber(split[04]) if slot == 04 then if player:getStorageValue(_SYSTEM.WARZONE) > 00 then return false end end if doBackpack(player, 00, slot, ext, 01) then -- Organizo | Capacidade doInventario(player, 02, slot, ext, bag) -- Removo do Invent�rio doInventario(player, 00, slot, ext) -- Organizo Invent�rio doBackpack(player, 00, slot, ext, 01) -- Organizo Backpack player:sendCancelMessage("@LoadAmmo " ..player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_10)) player:sendCancelMessage("@RemoveItemInventario " ..slot) else playSoundPlayer(player, "depot.ogg") player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sua Backpack esta cheia.") return false end return false end --[[ ORGANIZAR DEPOT ]]-- if split[01] == "52" then local ORDER_TYPE = tonumber(split[02]) if ORDER_TYPE == 01 then -- RARIDADE onDepot(player, 05) elseif ORDER_TYPE == 02 then -- LEVEL onDepot(player, 06) elseif ORDER_TYPE == 03 then -- PRE�O onDepot(player, 07) end return false end --[[ ORGANIZAR BACKPACK ]]-- if split[01] == "51" then -- reproducir sonido al cambiar de bolsa playSoundPlayer(player, "depot.ogg") local SLOT = tonumber(split[02]) local ORDER_TYPE = tonumber(split[03]) doBackpack(player, 13, SLOT, ORDER_TYPE) player:sendCancelMessage("@ReloadBackpack " ..SLOT) return false end --[[ SKIP UMA CENA AUTOM�TICA ]]-- if split[01] == "49" then player:setStorageValue(_SYSTEM.SCENE_STORAGE, nil) return false end --[[ EQUIPANDO UMA PASSIVA ]]-- if split[01] == "48" then local PASSIVE_SLOT = tonumber(split[02]) local PASSIVE_ID = tonumber(split[03]) local PASSIVE_LV = tonumber(split[04]) if split[02] then if PASSIVE_SLOT > 00 and PASSIVE_SLOT < 07 then local checkPerm = 00 for X = 01, 06 do if player:getStorageValue(_SYSTEM.POINTS_ATR[X]) == tonumber(split[03]) then checkPerm = 01 break end end if checkPerm == 00 then player:setStorageValue(_SYSTEM.POINTS_ATR[PASSIVE_SLOT], tonumber(split[03])) player:setStorageValue(_SYSTEM.POINTS_ATR[PASSIVE_SLOT + 7], PASSIVE_LV) PlayerPassives(player, 02) player:getPosition():sendMagicEffect(14) player:sendCancelMessage("@PassiveBoxClose") if player:getStorageValue(_QUESTLOG[206].UID_01) == 02 then player:setStorageValue(_QUESTLOG[206].UID_01, 100) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") end return false else player:popupFYI("Esta passiva ya est� equipada.") end end end return false end --[[ UPGRADE EM PASSIVA ]]-- if split[01] == "47" then local PASSIVE_ID = tonumber(split[02]) local PASSIVE_POINT = tonumber(split[03]) local PLAYER_POINT = player:getStorageValue(_SYSTEM.POINTS_ATR[07]) or 0 if split[02] then if PLAYER_POINT >= PASSIVE_POINT then player:setStorageValue(_SYSTEM.POINTS_ATR[07], (PLAYER_POINT - PASSIVE_POINT)) if player:getStorageValue(_SYSTEM.POINTS_ATR[01]) == PASSIVE_ID then player:setStorageValue(_SYSTEM.POINTS_ATR[08], (player:getStorageValue(_SYSTEM.POINTS_ATR[08]) + 01)) elseif player:getStorageValue(_SYSTEM.POINTS_ATR[02]) == PASSIVE_ID then player:setStorageValue(_SYSTEM.POINTS_ATR[09], (player:getStorageValue(_SYSTEM.POINTS_ATR[09]) + 01)) elseif player:getStorageValue(_SYSTEM.POINTS_ATR[03]) == PASSIVE_ID then player:setStorageValue(_SYSTEM.POINTS_ATR[10], (player:getStorageValue(_SYSTEM.POINTS_ATR[10]) + 01)) elseif player:getStorageValue(_SYSTEM.POINTS_ATR[04]) == PASSIVE_ID then player:setStorageValue(_SYSTEM.POINTS_ATR[11], (player:getStorageValue(_SYSTEM.POINTS_ATR[11]) + 01)) elseif player:getStorageValue(_SYSTEM.POINTS_ATR[05]) == PASSIVE_ID then player:setStorageValue(_SYSTEM.POINTS_ATR[12], (player:getStorageValue(_SYSTEM.POINTS_ATR[12]) + 01)) elseif player:getStorageValue(_SYSTEM.POINTS_ATR[06]) == PASSIVE_ID then player:setStorageValue(_SYSTEM.POINTS_ATR[13], (player:getStorageValue(_SYSTEM.POINTS_ATR[13]) + 01)) end PlayerPassives(player, 01, tonumber(split[02])) PlayerPassives(player, 02) else player:popupFYI("Pontos de Passiva insuficiente.") end end return false end --[[ ABRINDO CENTRAL BOX ]]-- if split[01] == "46" then local G = PlayerGoldCoins(player, 00) local tutor = 0 if player:getStorageValue(_QUESTLOG[06].UID_01) > 0 and player:getStorageValue(_QUESTLOG[06].UID_01) < 100 then tutor = 1 end local slot = 03 local ext = 00 local totalDesconto = 00 if Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE) == 04 then local players = Game.getPlayers() for _, targetPlayer in ipairs(players) do totalDesconto = totalDesconto + 01 end end doBackpack(player, 00, slot, ext, 01) player:sendCancelMessage("@OpenSellComboBox") player:sendCancelMessage("@CentralBox " ..G.. " " ..tutor.. " " .. 0 .. " " ..math.floor(totalDesconto / 2)) player:sendCancelMessage("@closedBackpack") return false end --[[ TROCANDO CRIPTOMOEDAS POR VIP COINS ]]-- if split[01] == "45" then local VipConsPayment = 00 local realDin = tonumber(split[02]) repeat realDin = realDin - 0.30 VipConsPayment = VipConsPayment + 01 until realDin < 00 if VipConsPayment > 01 then VipConsPayment = VipConsPayment - 01 end if player:getStorageValue(_SYSTEM.CRIPTOMOEDA) > 00 then player:setStorageValue(_SYSTEM.CRIPTOMOEDA, 00) PlayerVipCoins(player, 02, VipConsPayment) player:sendCancelMessage("@LootMSG 3218 3 0 " ..VipConsPayment) doBackpack(player, 11) player:getPosition():sendMagicEffect(14) if _DEBUG_MODE then print("[TALK - INVENTARIO] " ..player:getName().. " - Cripto > Vip (" ..VipConsPayment.. ")") end else player:getPosition():sendMagicEffect(03) end return false end --[[ CARREGANDO COLISEU ]]-- if split[01] == "44" then local ACTION = tonumber(split[02]) local KEYS, HARD, QUEST = player:getStorageValue(_SYSTEM.COLISEU[09]), player:getStorageValue(_SYSTEM.COLISEU[01]), player:getStorageValue(_QUESTLOG[201].UID_01) if KEYS < 00 then KEYS = 00 end if HARD < 02 then HARD = 01 end if QUEST == 101 then QUEST = 01 else QUEST = 00 end if ACTION == 01 then player:sendCancelMessage("@ColiseuLoad " ..KEYS.. " " ..HARD.. " " ..QUEST.. " 00") return false else local ITEMID = tonumber(split[03]) local ATR_KEYS_PRICE = tonumber(split[04]) if _ITEMS[ITEMID] then if _ITEMS[ITEMID].SLOT_EQUIP == 11 then if KEYS >= ATR_KEYS_PRICE then if doBackpack(player, 00, 03, 00, 01) then if doBackpack(player, 01, 03, 00, 0, ITEMID, 00, 00, 01, false) then player:setStorageValue(_SYSTEM.COLISEU[09], (player:getStorageValue(_SYSTEM.COLISEU[09]) - ATR_KEYS_PRICE)) player:getPosition():sendMagicEffect(14) KEYS = player:getStorageValue(_SYSTEM.COLISEU[09]) player:sendCancelMessage("@ColiseuLoad " ..KEYS.. " " ..HARD.. " " ..QUEST.. " 01") end else playSoundPlayer(player, "depot.ogg") player:getPosition():sendMagicEffect(03) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sua Backpack est� cheia.") return false end else player:getPosition():sendMagicEffect(03) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted no tem chaves suficientes.") return false end end end end return false end --[[ DESTRUINDO UM EQUIPAMENTO ]]-- if split[01] == "43" then local ext = tonumber(split[02]) local bag = tonumber(split[03]) local slot = tonumber(split[04]) doBackpack(player, 02, slot, ext, bag) doBackpack(player, 00, slot, ext, 01) playSoundPlayer(player, "depot.ogg") player:sendCancelMessage("@ReloadBackpack " ..slot.. " 01 01") return false end --[[ BOT�ES DO MENU EVENTOS ]]-- if split[01] == "41" then local ACTION = tonumber(split[02]) if ACTION == 01 then local GOLD_TOKEN = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[01].GOLD_TOKEN) if GOLD_TOKEN < 0 then GOLD_TOKEN = 0 end if GOLD_TOKEN >= 50 then if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[10].STORAGE) > 00 then player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted ya Tiene este buff ativo en su personaje.") return false else player:setStorageValue(_GLOBAL_RANDOM.BUFFS[10].STORAGE, 10) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve [ BENEFICIO LOS DIOSES ].") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Buff Ativado: [ BENEFICIO LOS DIOSES ].") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[01].GOLD_TOKEN, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[01].GOLD_TOKEN) - 50)) player:sendCancelMessage("@ReloadEvents 01 " ..player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[01].GOLD_TOKEN)) doInventario(player, 05) end end end if ACTION == 02 then local DESCONTO = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1) local FIXO_PRICE = 50000 local FINAL_PRICE = FIXO_PRICE - DESCONTO local GOLD_SALDO = PlayerGoldCoins(player, 00) if GOLD_SALDO >= FINAL_PRICE then PlayerGoldCoins(player, 01, FINAL_PRICE) if player:getStorageValue(_SYSTEM.CRIPTOMOEDA) < 00 then player:setStorageValue(_SYSTEM.CRIPTOMOEDA, ((player:getStorageValue(_SYSTEM.CRIPTOMOEDA) + 01) + 01)) else player:setStorageValue(_SYSTEM.CRIPTOMOEDA, (player:getStorageValue(_SYSTEM.CRIPTOMOEDA) + 01)) end player:sendCancelMessage("@LootMSG 3297 4 3 1") player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Compra realizada com sucesso!\n1x Criptomoeda por $ " ..FINAL_PRICE.. ".") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) doBackpack(player, 11) else player:popupFYI("O valor atual da Criptomoeda � de [ " ..FINAL_PRICE.. " ].\nUsted no tem dinheiro suficiente.") end end if ACTION == 04 then local BUFF_ID = tonumber(split[03]) local ITEMID = 0 if BUFF_ID == 01 then ITEMID = 3164 elseif BUFF_ID == 02 then ITEMID = 3163 elseif BUFF_ID == 03 then ITEMID = 3162 elseif BUFF_ID == 04 then ITEMID = 3161 else return false end doBackpack(player, 03, 03, 00, 01, ITEMID) local QT_P = doBackpack(player, 04) if QT_P >= 25 then if player:getStorageValue(_GLOBAL_RANDOM.BUFFS[11].STORAGE) > 00 then player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted ya Tiene este buff ativo em seu personagem.") return false else local PosBag = doBackpack(player, 05) local ExtBag = doBackpack(player, 06) if QT_P > 25 then player:setStorageValue(_BACKPACK[03][ExtBag][PosBag].UID_04, (QT_P - 25)) else doBackpack(player, 02, 03, ExtBag, PosBag) end player:setStorageValue(_GLOBAL_RANDOM.BUFFS[11].STORAGE, 3600) player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[04].BUFF_ELE, BUFF_ID) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve [ BUFF ELEMENTAL ].") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Buff Ativado: [ BUFF ELEMENTAL ].") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendCancelMessage("@closedBackpack") doInventario(player, 05) end else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "O custo para ativar esse buff � de x25 [ " .._ITEMS[ITEMID].NAME.. " ].") return false end end if ACTION == 05 then local ITEM_1 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_4) local ITEM_2 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_5) local ITEM_3 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_6) local ITEM_4 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_7) local ITEM_5 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_8) local ITEM_6 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_9) local ITEM_7 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_10) local ITEM_8 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_11) local ITEM_9 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_12) local QNT_ITEM_1 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1) local QNT_ITEM_2 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_2) local QNT_ITEM_3 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_3) local TASK_ID = tonumber(split[03]) if TASK_ID == 01 then doBackpack(player, 03, 03, 00, 01, ITEM_1) local ATUAL_ITEM_1 = doBackpack(player, 04) local POS_BAG_1 = doBackpack(player, 05) local POS_EXT_1 = doBackpack(player, 06) doBackpack(player, 03, 03, 00, 01, ITEM_2) local ATUAL_ITEM_2 = doBackpack(player, 04) local POS_BAG_2 = doBackpack(player, 05) local POS_EXT_2 = doBackpack(player, 06) doBackpack(player, 03, 03, 00, 01, ITEM_3) local ATUAL_ITEM_3 = doBackpack(player, 04) local POS_BAG_3 = doBackpack(player, 05) local POS_EXT_3 = doBackpack(player, 06) if ATUAL_ITEM_1 >= QNT_ITEM_1 and ATUAL_ITEM_2 >= QNT_ITEM_1 and ATUAL_ITEM_3 >= QNT_ITEM_1 then if ATUAL_ITEM_1 > QNT_ITEM_1 then player:setStorageValue(_BACKPACK[03][POS_EXT_1][POS_BAG_1].UID_04, (ATUAL_ITEM_1 - QNT_ITEM_1)) else doBackpack(player, 02, 03, POS_EXT_1, POS_BAG_1) end if ATUAL_ITEM_2 > QNT_ITEM_1 then player:setStorageValue(_BACKPACK[03][POS_EXT_2][POS_BAG_2].UID_04, (ATUAL_ITEM_2 - QNT_ITEM_1)) else doBackpack(player, 02, 03, POS_EXT_2, POS_BAG_2) end if ATUAL_ITEM_3 > QNT_ITEM_1 then player:setStorageValue(_BACKPACK[03][POS_EXT_3][POS_BAG_3].UID_04, (ATUAL_ITEM_3 - QNT_ITEM_1)) else doBackpack(player, 02, 03, POS_EXT_3, POS_BAG_3) end PlayerTokenCoins(player, 01, 20, 01) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve x20 Pontos de Task.") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendCancelMessage("@closedBackpack") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted no Tiene todos os itens necess�rios.") return false end end if TASK_ID == 02 then doBackpack(player, 03, 03, 00, 01, ITEM_4) local ATUAL_ITEM_1 = doBackpack(player, 04) local POS_BAG_1 = doBackpack(player, 05) local POS_EXT_1 = doBackpack(player, 06) doBackpack(player, 03, 03, 00, 01, ITEM_5) local ATUAL_ITEM_2 = doBackpack(player, 04) local POS_BAG_2 = doBackpack(player, 05) local POS_EXT_2 = doBackpack(player, 06) doBackpack(player, 03, 03, 00, 01, ITEM_6) local ATUAL_ITEM_3 = doBackpack(player, 04) local POS_BAG_3 = doBackpack(player, 05) local POS_EXT_3 = doBackpack(player, 06) if ATUAL_ITEM_1 >= QNT_ITEM_2 and ATUAL_ITEM_2 >= QNT_ITEM_2 and ATUAL_ITEM_3 >= QNT_ITEM_2 then if ATUAL_ITEM_1 > QNT_ITEM_2 then player:setStorageValue(_BACKPACK[03][POS_EXT_1][POS_BAG_1].UID_04, (ATUAL_ITEM_1 - QNT_ITEM_2)) else doBackpack(player, 02, 03, POS_EXT_1, POS_BAG_1) end if ATUAL_ITEM_2 > QNT_ITEM_2 then player:setStorageValue(_BACKPACK[03][POS_EXT_2][POS_BAG_2].UID_04, (ATUAL_ITEM_2 - QNT_ITEM_2)) else doBackpack(player, 02, 03, POS_EXT_2, POS_BAG_2) end if ATUAL_ITEM_3 > QNT_ITEM_2 then player:setStorageValue(_BACKPACK[03][POS_EXT_3][POS_BAG_3].UID_04, (ATUAL_ITEM_3 - QNT_ITEM_2)) else doBackpack(player, 02, 03, POS_EXT_3, POS_BAG_3) end PlayerTokenCoins(player, 02, 20, 01) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve x20 Pontos de Task.") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendCancelMessage("@closedBackpack") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted no Tiene todos os itens necess�rios.") return false end end if TASK_ID == 03 then doBackpack(player, 03, 03, 00, 01, ITEM_7) local ATUAL_ITEM_1 = doBackpack(player, 04) local POS_BAG_1 = doBackpack(player, 05) local POS_EXT_1 = doBackpack(player, 06) doBackpack(player, 03, 03, 00, 01, ITEM_8) local ATUAL_ITEM_2 = doBackpack(player, 04) local POS_BAG_2 = doBackpack(player, 05) local POS_EXT_2 = doBackpack(player, 06) doBackpack(player, 03, 03, 00, 01, ITEM_9) local ATUAL_ITEM_3 = doBackpack(player, 04) local POS_BAG_3 = doBackpack(player, 05) local POS_EXT_3 = doBackpack(player, 06) if ATUAL_ITEM_1 >= QNT_ITEM_3 and ATUAL_ITEM_2 >= QNT_ITEM_3 and ATUAL_ITEM_3 >= QNT_ITEM_3 then if ATUAL_ITEM_1 > QNT_ITEM_3 then player:setStorageValue(_BACKPACK[03][POS_EXT_1][POS_BAG_1].UID_04, (ATUAL_ITEM_1 - QNT_ITEM_3)) else doBackpack(player, 02, 03, POS_EXT_1, POS_BAG_1) end if ATUAL_ITEM_2 > QNT_ITEM_3 then player:setStorageValue(_BACKPACK[03][POS_EXT_2][POS_BAG_2].UID_04, (ATUAL_ITEM_2 - QNT_ITEM_3)) else doBackpack(player, 02, 03, POS_EXT_2, POS_BAG_2) end if ATUAL_ITEM_3 > QNT_ITEM_3 then player:setStorageValue(_BACKPACK[03][POS_EXT_3][POS_BAG_3].UID_04, (ATUAL_ITEM_3 - QNT_ITEM_3)) else doBackpack(player, 02, 03, POS_EXT_3, POS_BAG_3) end PlayerTokenCoins(player, 03, 20, 01) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve x20 Pontos de Task.") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendCancelMessage("@closedBackpack") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted no Tiene todos os itens necess�rios.") return false end end return false end if ACTION == 06 then local PONTOS_EVENTO = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[06].POINTS) if PONTOS_EVENTO < 0 then PONTOS_EVENTO = 0 end if PONTOS_EVENTO >= 10 then local presentSelect = math.random(00, 15) if presentSelect < 05 then player:addExperience((1000 * player:getLevel()), true, true) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve da Present Box:\n[ " ..(1000 * player:getLevel()).. " de EXP ].") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) elseif presentSelect == 05 then if player:getStorageValue(_SYSTEM.TOOLS[01]) > 00 then player:setStorageValue(_SYSTEM.TOOLS[01], (player:getStorageValue(_SYSTEM.TOOLS[01]) + 1800)) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve [ LOJA REMOTA (TEMPOR�RIA) ]\nSua Loja Remota atualmente ativa ganhou +30 minutos de dura��o.") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve [ LOJA REMOTA (TEMPOR�RIA) ]\nEste benef�cio durar� 30 minutos.") player:setStorageValue(_SYSTEM.TOOLS[01], 1800) end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve da Present Box:\n[ LOJA REMOTA (30 minutos) ].") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendCancelMessage("@TutorShow 42") local DESCONTRUIR_EVENT = 00 if Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID) == 08 then DESCONTRUIR_EVENT = 01 end player:sendCancelMessage("@ToolsLoad " ..player:getStorageValue(_SYSTEM.TOOLS[01]).. " " ..player:getStorageValue(_SYSTEM.TOOLS[02]).. " " ..DESCONTRUIR_EVENT) elseif presentSelect == 10 then if player:getStorageValue(_SYSTEM.TOOLS[02]) > 00 then player:setStorageValue(_SYSTEM.TOOLS[02], (player:getStorageValue(_SYSTEM.TOOLS[02]) + 1800)) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve [ NEXUS REMOTO (TEMPOR�RIA) ]\nSeu Nexus Remoto atualmente ativo ganhou +30 minutos de dura��o.") else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve [ NEXUS REMOTO (TEMPOR�RIA) ]\nEste benef�cio durar� 30 minutos.") player:setStorageValue(_SYSTEM.TOOLS[02], 1800) end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve da Present Box:\n[ NEXUS REMOTO (30 minutos) ].") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendCancelMessage("@TutorShow 43") local DESCONTRUIR_EVENT = 00 if Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID) == 08 then DESCONTRUIR_EVENT = 01 end player:sendCancelMessage("@ToolsLoad " ..player:getStorageValue(_SYSTEM.TOOLS[01]).. " " ..player:getStorageValue(_SYSTEM.TOOLS[02]).. " " ..DESCONTRUIR_EVENT) else PlayerGoldCoins(player, 02, (100 * player:getLevel())) doBackpack(player, 11) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Usted obteve da Present Box:\n[ " ..(100 * player:getLevel()).. " de Gold Coin ].") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) end player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[06].POINTS, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[06].POINTS) - 10)) player:sendCancelMessage("@ReloadEvents 06 " ..player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[06].POINTS)) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "x10 Pontos s�o necess�rios para abrir o presente.") end return false end if ACTION == 08 then local POS = tonumber(split[03]) local SLOT = tonumber(split[04]) local EXT = tonumber(split[05]) local ITEMID = tonumber(split[06]) local RAREID = tonumber(split[07]) for X = 01, 04 do local itemUpgrade = _ITEMS[ITEMID].UPGRADE[X][01] local itemQnt = math.floor(_ITEMS[ITEMID].UPGRADE[X][02] / (06 - RAREID)) if itemUpgrade > 00 then local itemRare = _ITEMS[itemUpgrade].RARE if itemQnt <= 00 then itemQnt = 01 end if doBackpack(player, 00, 03, 00, 01) then doBackpack(player, 00, 03, 00, 01) doBackpack(player, 03, 03, 00, 01, itemUpgrade) doBackpack(player, 01, 03, 00, 0, itemUpgrade, itemRare, 00, itemQnt) else playSoundPlayer(player, "depot.ogg") player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sua Backpack esta cheia.") break end end end -- DESAFIO SHOP if player:getStorageValue(_DESAFIOS[00].DESAFIO_TYPE) == 02 then if player:getStorageValue(_DESAFIOS[00].DESAFIO_SHOP) > 00 then if player:getStorageValue(_DESAFIOS[00].DESAFIO_SHOP) == 01 then player:setStorageValue(_DESAFIOS[00].DESAFIO_TYPE, nil) player:setStorageValue(_DESAFIOS[00].DESAFIO_SHOP, nil) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "[DESCONSTRUIR]: FINALIZADO!") player:sendCancelMessage("@ToolsLoad " ..player:getStorageValue(_SYSTEM.TOOLS[01]).. " " ..player:getStorageValue(_SYSTEM.TOOLS[02]).. " 0") else player:setStorageValue(_DESAFIOS[00].DESAFIO_SHOP, (player:getStorageValue(_DESAFIOS[00].DESAFIO_SHOP) - 01)) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[DESCONSTRUIR]: Ainda resta " ..player:getStorageValue(_DESAFIOS[00].DESAFIO_SHOP).. ".") end end end doBackpack(player, 02, SLOT, EXT, POS) doBackpack(player, 00, SLOT, EXT, POS) player:sendCancelMessage("@OpenBackpack") end if ACTION == 10 then local MY_KEYS = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT) if MY_KEYS >= 01 then local chance = math.random(01, 05) local CriticalChance = math.random(01, 50) if chance == 01 then -- ONLINE POINTS local GAIN_COINS = math.random(03, 07) if CriticalChance == 07 then GAIN_COINS = 20 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "SORTE CR�TICA!") player:getPosition():sendMagicEffect(50) end player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT) - 01)) player:sendCancelMessage("@LootMSG 3160 0 0 " ..GAIN_COINS) if player:getStorageValue(_SYSTEM.ONLINE_COIN) < 00 then player:setStorageValue(_SYSTEM.ONLINE_COIN, GAIN_COINS) else player:setStorageValue(_SYSTEM.ONLINE_COIN, (player:getStorageValue(_SYSTEM.ONLINE_COIN) + GAIN_COINS)) end doBackpack(player, 11) 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).. " ].") end if chance == 02 then -- VIP COINS local GAIN_COINS = math.random(02, 05) if CriticalChance == 07 then GAIN_COINS = 15 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "SORTE CR�TICA!") player:getPosition():sendMagicEffect(50) end player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT) - 01)) PlayerVipCoins(player, 02, GAIN_COINS) doBackpack(player, 11) player:sendCancelMessage("@LootMSG 3218 3 0 " ..GAIN_COINS) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Usted obteve x" ..GAIN_COINS.. " Vip Coins no Ba� do Drag�o.") end if chance == 03 then -- CRIPTOMOEDAS local GAIN_COINS = math.random(10, 30) if CriticalChance == 07 then GAIN_COINS = 100 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "SORTE CR�TICA!") player:getPosition():sendMagicEffect(50) end player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT) - 01)) if player:getStorageValue(_SYSTEM.CRIPTOMOEDA) < 00 then player:setStorageValue(_SYSTEM.CRIPTOMOEDA, ((player:getStorageValue(_SYSTEM.CRIPTOMOEDA) + GAIN_COINS) + 01)) else player:setStorageValue(_SYSTEM.CRIPTOMOEDA, (player:getStorageValue(_SYSTEM.CRIPTOMOEDA) + GAIN_COINS)) end player:sendCancelMessage("@LootMSG 3297 4 3 " ..GAIN_COINS) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Usted obteve x" ..GAIN_COINS.. " Criptomoedas no Ba� do Drag�o.") end if chance == 04 then -- AMULETS local IDDD = math.random(1000, 1021) local SLOT = 01 local RARE = math.random(01, 03) local STAR = 00 if CriticalChance == 07 then RARE = math.random(03, 04) STAR = math.random(01, 03) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "SORTE CR�TICA!") player:getPosition():sendMagicEffect(50) end if doBackpack(player, 00, SLOT, 00, 01) then if doBackpack(player, 01, SLOT, 00, 0, IDDD, RARE, STAR) then player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT) - 01)) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Usted recebeu o item [ ".._RARIDADES[RARE].Name.. " " .._ITEMS[IDDD].NAME.. " ] no Ba� do Drag�o.") player:getPosition():sendMagicEffect(14) end else playSoundPlayer(player, "depot.ogg") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sua Backpack esta cheia.") player:getPosition():sendMagicEffect(03) return false end end if chance == 05 then -- RINGS local IDDD = math.random(7000, 7014) local SLOT = 07 local RARE = math.random(01, 03) local STAR = 00 if CriticalChance == 07 then RARE = math.random(03, 04) STAR = math.random(01, 03) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "SORTE CR�TICA!") player:getPosition():sendMagicEffect(50) end if doBackpack(player, 00, SLOT, 00, 01) then if doBackpack(player, 01, SLOT, 00, 0, IDDD, RARE, STAR) then player:setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT, (player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT) - 01)) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Usted recebeu o item [ ".._RARIDADES[RARE].Name.. " " .._ITEMS[IDDD].NAME.. " ] no Ba� do Drag�o.") player:getPosition():sendMagicEffect(14) end else playSoundPlayer(player, "depot.ogg") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Sua Backpack esta cheia.") player:getPosition():sendMagicEffect(03) return false end end player:sendCancelMessage("@ReloadEvents 10 " ..player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT)) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "S�o necess�rio x01 Chave de Evento para abrir o ba�.") end end if ACTION == 11 then if Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID) == 11 then local STEP_EVENT = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[11].PILLAR_STEP) or 0 if STEP_EVENT > 00 and STEP_EVENT < 06 then player:sendCancelMessage("@ReloadEvents 11") player:getPosition():sendMagicEffect(13) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Os Pilares foram marcados em seu mapa.") else if STEP_EVENT == 00 then player:sendTextMessage(MESSAGE_STATUS_WARNING, "O servidor falhou em eliminar os pilares dentro do tempo.\nAguarde at� o pr�ximo ServerSave para tentar novamente.") else 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.") end end end end return false end --[[ CARREGANDO EVENTOS MENSAIS ]]-- if split[01] == "40" then local EVENTO_ID = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID) if EVENTO_ID == 01 then local GOLD_TOKEN = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[EVENTO_ID].GOLD_TOKEN) if GOLD_TOKEN < 0 then GOLD_TOKEN = 0 end local MONSTER_01 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1) local MONSTER_02 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_2) local MONSTER_03 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_3) local MONSTER_04 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_4) local MONSTER_05 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_5) local MONSTER_06 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_6) local MONSTER_07 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_7) local MONSTER_08 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_8) local MONSTER_09 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_9) 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) return false end if EVENTO_ID == 02 then local COUNT_MONSTER = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1) if COUNT_MONSTER < 0 then COUNT_MONSTER = 0 end player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..COUNT_MONSTER) return false end if EVENTO_ID == 03 then local CRYPTBLOOD = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1) if CRYPTBLOOD < 0 then CRYPTBLOOD = 0 end player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..CRYPTBLOOD) return false end if EVENTO_ID == 04 then player:sendCancelMessage("@EventosLoad " ..EVENTO_ID) return false end if EVENTO_ID == 05 then local ITEM_1 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_4) local ITEM_2 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_5) local ITEM_3 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_6) local ITEM_4 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_7) local ITEM_5 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_8) local ITEM_6 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_9) local ITEM_7 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_10) local ITEM_8 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_11) local ITEM_9 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_12) local QNT_ITEM_1 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1) local QNT_ITEM_2 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_2) local QNT_ITEM_3 = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_3) 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) return false end if EVENTO_ID == 06 then local PONTOS_EVENTO = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[06].POINTS) if PONTOS_EVENTO < 0 then PONTOS_EVENTO = 0 end player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..PONTOS_EVENTO) return false end if EVENTO_ID == 07 then local EXP_BON = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[07].EXP_BONUS) if EXP_BON < 0 then EXP_BON = 0 end player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..EXP_BON) return false end if EVENTO_ID == 08 then player:sendCancelMessage("@EventosLoad " ..EVENTO_ID) return false end if EVENTO_ID == 09 then player:sendCancelMessage("@EventosLoad " ..EVENTO_ID) return false end if EVENTO_ID == 10 then local KEYS_EVENT = player:getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[10].KEYS_EVENT) if KEYS_EVENT < 0 then KEYS_EVENT = 0 end player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..KEYS_EVENT) return false end if EVENTO_ID == 11 then local STAGE_EVENT = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[11].PILLAR_STEP) or 0 player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..STAGE_EVENT) return false end if EVENTO_ID == 12 then local CM_UM = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1) local CM_DO = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_2) local CM_TR = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_3) local METAS = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_4) local BUFFS = Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_5) if METAS < 00 then METAS = 00 end player:sendCancelMessage("@EventosLoad " ..EVENTO_ID.. " " ..CM_UM.. " " ..CM_DO.. " " ..CM_TR.. " " ..METAS.. " " ..BUFFS) return false end local Mes = tonumber(os.date("%m", os.time())) local Dia = tonumber(os.date("%d", os.time())) player:sendCancelMessage("@EventosLoad 00 " ..Mes.. " " ..Dia) return false end --[[ PARTICIPAR DA WAR ZONE ]]-- if split[01] == "39" then local checkDG = 0 if Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then for X = 01, #_SYSTEM.DANGEROUS do for Z = 01, #_SYSTEM.DANGEROUS[X] do if player:getStorageValue(_SYSTEM.DANGEROUS[X][Z].STORAGE) > 0 then checkDG = 01 break end end end if checkDG == 0 then if player:getStorageValue(_SYSTEM.WARZONE) > 00 then checkDG = 01 end end if checkDG == 0 then if player:getLevel() >= _GLOBAL_RANDOM.WARZONE.LEVEL then if Game.getStorageValue(_GLOBAL_RANDOM.WARZONE.STORAGE_START_WARZONE) == 01 then doBackpack(player, 00, 04, 00, 01) -- Organizo Backpack local EmptySlot = doBackpack(player, 07, 04) if EmptySlot < 01 then player:popupFYI("Abra espa�o em sua Backpack de armas para poder entrar.") player:sendCancelMessage("@WarzoneStart 00") return false end if player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_01) > 0 then if doBackpack(player, 00, 04, 00, 01) then -- Removendo o item equipado doInventario(player, 02, 04, 00) -- Removo do Invent�rio doInventario(player, 00, 04, 00) -- Organizo Invent�rio doBackpack(player, 00, 04, 00, 01) -- Organizo Backpack player:sendCancelMessage("@RemoveItemInventario 04") player:sendCancelMessage("@StarCliente") player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sua arma principal foi devolvida a sua backpack.\nPoder� equip�-la novamente ao sair da Warzone.") else player:popupFYI("Libere espa�o em sua Backpack de armas para poder continuar.") player:sendCancelMessage("@WarzoneStart 00") return false end end if WAR_PLAYER == nil or WAR_PLAYER < 00 then WAR_PLAYER = 00 end if WAR_PLAYER >= _GLOBAL_RANDOM.WARZONE.MAX_PLAYER then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "M�ximo de jogadores na Warzone atingido [ " .._GLOBAL_RANDOM.WARZONE.MAX_PLAYER.. " ]\nAguarde alguma desist�ncia para poder entrar.") return false end if LOAD_PARTICIPE_PLAYER ~= nil then stopEvent(LOAD_PARTICIPE_PLAYER) end local WAR_PLAYER = Game.getStorageValue(_GLOBAL_RANDOM.WARZONE.STORAGE_COUNT_PLAYER) Game.setStorageValue(_GLOBAL_RANDOM.WARZONE.STORAGE_COUNT_PLAYER, (WAR_PLAYER + 01)) player:setTown(Town(15)) player:setMaxHealth(_GLOBAL_RANDOM.WARZONE.MAX_HEALTH) player:addHealth(player:getMaxHealth()) player:teleportTo(_GLOBAL_RANDOM.WARZONE.LOB_WARZONE) player:getPosition():sendMagicEffect(11) player:setStorageValue(_SYSTEM.WARZONE, 01) player:sendCancelMessage("@NoTeleport 01") LOAD_PARTICIPE_PLAYER = addEvent(function() local players = Game.getPlayers() for _, targetPlayer in ipairs(players) do if targetPlayer:getLevel() >= _GLOBAL_RANDOM.WARZONE.LEVEL then if targetPlayer:getStorageValue(_SYSTEM.WARZONE) < 01 then targetPlayer:sendCancelMessage("@WarzoneStart " ..Game.getStorageValue(_GLOBAL_RANDOM.WARZONE.STORAGE_COUNT_PLAYER)) end end end end, 2000) end else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Somente jogadores de level " .._GLOBAL_RANDOM.WARZONE.LEVEL.. " ou superior podem participar.") player:sendCancelMessage("@WarzoneStart 00") end else player:popupFYI("Usted no pode fazer isso nesse momento.") player:sendCancelMessage("@WarzoneStart 00") end else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "� preciso estar em Protection Zone para poder entrar.") player:sendCancelMessage("@WarzoneStart 00") end return false end --[[ CARREGANDO PIX DA CONTA ]]-- if split[01] == "38" then local playerAccountId = player:getAccountId() local NOME = "" local EMAIL = "" local BANK = "" local PIX = db.storeQuery("SELECT rlname, vote, location FROM accounts WHERE id = " ..playerAccountId.. ";") if PIX then local i = 1 repeat NOME = result.getDataString(PIX, "rlname") EMAIL = result.getDataString(PIX, "vote") BANK = result.getDataString(PIX, "location") i = i + 1 until not result.next(PIX) result.free() end player:sendCancelMessage("@LoadPix-" ..NOME.. "-" ..EMAIL.. "-" ..BANK) return false end --[[ CRIPTOMOEDAS ]]-- if split[01] == "37" then local playerAccountId = player:getAccountId() local CRIPTO = player:getStorageValue(_SYSTEM.CRIPTOMOEDA) local BLACKMARKET = '' local REQUEST = db.storeQuery("SELECT * FROM links WHERE account_id = " ..playerAccountId.. " ORDER BY `id` DESC LIMIT 10;") if REQUEST then local i = 1 repeat local A = result.getDataInt(REQUEST, "id") local B = result.getDataInt(REQUEST, "account_id") local C = result.getDataString(REQUEST, "name") local D = result.getDataString(REQUEST, "email") local E = result.getDataString(REQUEST, "banco") local F = result.getDataInt(REQUEST, "criptomoeda") local G = result.getDataString(REQUEST, "price") local H = result.getDataString(REQUEST, "valor") local I = result.getDataInt(REQUEST, "status") local J = result.getDataString(REQUEST, "obs") player:sendCancelMessage("@CriptLoad-01-" ..i.. "-" ..A.. "-" ..B.. "-" ..C.. "-" ..D.. "-" ..E.. "-" ..F.. "-" ..G.. "-" ..H.. "-" ..I.. "-" ..J) i = i + 1 until not result.next(REQUEST) result.free() end if CRIPTO < 00 then CRIPTO = 00 end local SALDO_BLACK = db.storeQuery("SELECT gender FROM accounts WHERE id = 1;") if SALDO_BLACK then repeat BLACKMARKET = result.getDataString(SALDO_BLACK, "gender") until not result.next(SALDO_BLACK) result.free() end player:sendCancelMessage("@CriptLoad-02-" ..CRIPTO.. "-" ..BLACKMARKET.. "-" ..getAllPlayerInAccount(player:getAccountId())) return false end --[[ ATUALIZA BAG INVENTARIO EM TEMPO REAL ]]-- if split[01] == "34" then local reloadType = tonumber(split[02]) local slot = tonumber(split[03]) if reloadType == 01 then player:sendCancelMessage("@ReloadBackpack " ..slot.. " 01") return false elseif reloadType == 03 then local IDD_1 = player:getStorageValue(_SYSTEM.MAESTRIA[01]) local IDD_2 = player:getStorageValue(_SYSTEM.ESPECIALISTA[01]) local IDD_3 = player:getStorageValue(_SYSTEM.MAESTRIA[02]) local IDD_4 = player:getStorageValue(_SYSTEM.ESPECIALISTA[02]) player:sendCancelMessage("@MaestriaEsp " ..IDD_1.. " " ..IDD_2.. " " ..IDD_3.. " " ..IDD_4) player:sendCancelMessage("@StarCliente") return false elseif reloadType == 04 then if split[03] then if tonumber(split[03]) == _APP_VERSION then for X = 01, #_QUESTLOG do if _QUESTLOG[X].Type == "NORMAL" then player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01)) elseif _QUESTLOG[X].Type == "HUNT" then player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01).. " " ..player:getStorageValue(_QUESTLOG[X].Value[01]).. " " .._QUESTLOG[X].Value[02]) else player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01).. " " ..onGetBackpackItem(player, _QUESTLOG[X].Value[01]).. " " .._QUESTLOG[X].Value[02]) end end doInventario(player, 03) doBackpack(player, 11) local DAILY_EVENT = Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE) or 0 local DAILY_PASSIVE = Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.PASSIVE) or 0 if DAILY_EVENT > 00 and DAILY_PASSIVE > 00 then player:sendCancelMessage("@DailyEvent " ..DAILY_EVENT.. " " ..DAILY_PASSIVE) end return false else print("[" ..player:getName().. "] OLD VERSION (" ..split[03].. ") < (" .._APP_VERSION.. ")") player:setTown(Town(01)) player:teleportTo(player:getTown():getTemplePosition()) player:popupFYI("Cliente desatualizado.\nAtualize seu cliente para continuar jogando.") addEvent(function() player:sendCancelMessage("@ClientSystem 01") -- Fechando o cliente --doRemoveCreature(player:getId()) end, 5000) return false end end return false else doBackpack(player, 11) return false end return false end --[[ EQUIPA UMA APAR�NCIA DE BACKPACK ]]-- if split[01] == "33" then -- reproducir sonido al iniciar la acción playSoundPlayer(player, "depot.ogg") local backid = tonumber(split[02]) local index = tonumber(split[03]) if index == 00 then player:setStorageValue(_SYSTEM.INVENTARIO[03].UID_01, 10000) player:setStorageValue(_SYSTEM.INVENTARIO[03].UID_02, nil) player:sendCancelMessage("@EquipBackpack 10000") doInventario(player, 00) else if player:getStorageValue(_SYSTEM.BACKPACKS[index]) > 0 then player:setStorageValue(_SYSTEM.INVENTARIO[03].UID_01, player:getStorageValue(_SYSTEM.BACKPACKS[index])) player:setStorageValue(_SYSTEM.INVENTARIO[03].UID_02, _ITEMS[backid].RARE) player:sendCancelMessage("@EquipBackpack " ..player:getStorageValue(_SYSTEM.INVENTARIO[03].UID_01)) doInventario(player, 00) end end return false end --[[ LOAD STATUS ]]-- if split[01] == "32" then doInventario(player, 04) return false end --[[ APENAS UMA MENSAGEM DE ALERTA ]]-- if split[01] == "31" then player:popupFYI("Usted no pode fazer isso nesse momento.") return false end --[[ TELEPORT DO NEXUS PELO MINIMAPA ]]-- if split[01] == "30" then local Nexus_ID = tonumber(split[02]) if not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then local checkDG = 0 for X = 01, #_SYSTEM.DANGEROUS do for Z = 01, #_SYSTEM.DANGEROUS[X] do if player:getStorageValue(_SYSTEM.DANGEROUS[X][Z].STORAGE) > 0 then checkDG = 01 break end end end if checkDG == 0 then if player:getStorageValue(_SYSTEM.WARZONE) > 00 then checkDG = 01 end if player:getStorageValue(_SYSTEM.FENDAS_DIMENSIONAL[01]) > 00 then checkDG = 01 end if player:getStorageValue(_PVP_ROOM[00].PVP_SALA_ID) > 00 then checkDG = 01 end end if checkDG == 0 then if _SYSTEM.NEXUS[Nexus_ID].PREMIUM then if player:isPremium() then player:setTown(Town(_SYSTEM.NEXUS[Nexus_ID].TOWN)) player:teleportTo(_SYSTEM.NEXUS[Nexus_ID].POS) player:getPosition():sendMagicEffect(11) else player:popupFYI("Somente jogadores Premium Account podem usar o teleport.") end else player:setTown(Town(_SYSTEM.NEXUS[Nexus_ID].TOWN)) player:teleportTo(_SYSTEM.NEXUS[Nexus_ID].POS) player:getPosition():sendMagicEffect(11) end else player:popupFYI("Usted no pode fazer isso nesse momento.") end else player:popupFYI("Aguarde sair do combate para poder se teleportar.") end return false end --[[ ADICIONA SKILL EM UM EQUIPAMENTO OU ARMA ]]-- if split[01] == "29" then local slot = tonumber(split[02]) local id = tonumber(split[03]) local ext = tonumber(split[04]) local bag = tonumber(split[05]) local skillid = tonumber(split[06]) local spellpos = tonumber(split[07]) local qnt = player:getStorageValue(_BACKPACK[03][ext][bag].UID_04) if slot == 4 then if spellpos == 1 then if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_05) == skillid or player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_06) == skillid then player:popupFYI("Usted no pode adicionar skills iguais em uma mesma arma.") player:sendCancelMessage("@SkillFailUpgrade") return false else player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_04, skillid) end elseif spellpos == 2 then if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_04) == skillid or player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_06) == skillid then player:popupFYI("Usted no pode adicionar skills iguais em uma mesma arma.") player:sendCancelMessage("@SkillFailUpgrade") return false else player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_05, skillid) end elseif spellpos == 3 then if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_04) == skillid or player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_05) == skillid then player:popupFYI("Usted no pode adicionar skills iguais em uma mesma arma.") player:sendCancelMessage("@SkillFailUpgrade") return false else player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_06, skillid) end end -- DESAFIO if player:getStorageValue(_DESAFIOS[00].DESAFIO_ID) > 00 then onPlayerDesafios(player, 92, 01) end player:sendCancelMessage("@StarCliente") if player:getStorageValue(_QUESTLOG[06].UID_01) == 2 then player:setStorageValue(_QUESTLOG[06].UID_01, 100) player:getPosition():sendMagicEffect(14) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") doBackpack(player, 12) end else if spellpos == 1 then player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_06, skillid) else player:setStorageValue(_SYSTEM.INVENTARIO[slot].UID_07, skillid) end -- DESAFIO if player:getStorageValue(_DESAFIOS[00].DESAFIO_ID) > 00 then onPlayerDesafios(player, 91, 01) end if player:getStorageValue(_QUESTLOG[87].UID_01) == 02 then player:setStorageValue(_QUESTLOG[87].UID_01, 100) player:addExperience(2500, true, true) player:getPosition():sendMagicEffect(14) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") doBackpack(player, 12) end if player:getStorageValue(_QUESTLOG[91].UID_01) == 01 then if player:getStorageValue(_SYSTEM.INVENTARIO[slot].UID_06) > 0 then player:setStorageValue(_QUESTLOG[91].UID_01, 100) player:addExperience(20000, true, true) player:getPosition():sendMagicEffect(14) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") doBackpack(player, 12) end end end doInventario(player, 00, slot, ext) doBackpack(player, 02, 03, ext, bag, qnt) doBackpack(player, 00, 03, ext, 01) player:sendCancelMessage("@ReloadBackpack 03 01") player:sendCancelMessage("@LoadTooltipInv") player:popupFYI("UPGRADE realizado com sucesso!") player:sendCancelMessage("@SkillUpgradeSucess") return false end --[[ CARREGA INFORMA��ES SOBRE GOLD COINS E ONLINE COINS ]]-- if split[01] == "28" then doBackpack(player, 11) return false end --[[ UMA SIMPLES MENSAGEM INDICANDO QUE A QUEST ESTA SENDO RASTREADA PELO MINIMAPA ]]-- if split[01] == "27" then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "O objetivo desta quest foi agora\nmarcado em seu mapa.") player:getPosition():sendMagicEffect(14) return false end --[[ CARREGANDO TODAS AS QUEST EM ABERTO ]]-- if split[01] == "25" then for X = 01, #_QUESTLOG do if _QUESTLOG[X].Type == "NORMAL" then player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01)) elseif _QUESTLOG[X].Type == "HUNT" then player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01).. " " ..player:getStorageValue(_QUESTLOG[X].Value[01]).. " " .._QUESTLOG[X].Value[02]) else player:sendCancelMessage("@QuestAbertas " .._QUESTLOG[X].Type.. " " ..X.. " " ..player:getStorageValue(_QUESTLOG[X].UID_01).. " " ..onGetBackpackItem(player, _QUESTLOG[X].Value[01]).. " " .._QUESTLOG[X].Value[02]) end end return false end --[[ FINALIZAR CONVERSA COM NPC ]]-- if split[01] == "24" then -- reproducir sonido antes de finalizar la conversación playSoundPlayer(player, "depot.ogg") local NPC = split[02] --local player = player(NPC) player:say("bye", TALKTYPE_PRIVATE_FROM, false, NPC) return false end --[[ ABRINDO JANELA DE SUMMONS ]]-- if split[01] == "22" then player:sendCancelMessage("@ShowSummonWind") return false end --[[ CARREGANDO APAR�NCIA DAS BACKPACK ]]-- if split[01] == "21" then player:sendCancelMessage("@LoadBackpack 00 00") for Back = 01, #_SYSTEM.BACKPACKS do if player:getStorageValue(_SYSTEM.BACKPACKS[Back]) < 00 then break end player:sendCancelMessage("@LoadBackpack " ..Back.. " " ..player:getStorageValue(_SYSTEM.BACKPACKS[Back])) end return false end --[[ EQUIPANDO UM ITEM DA BACKPACK ]]-- if tonumber(split[01]) >= 01 then -- reproducir sonido al cambiar de slot playSoundPlayer(player, "depot.ogg") local ext = tonumber(split[03]) or nil local bag = tonumber(split[01]) or nil local slot = _ITEMS[tonumber(split[02])].SLOT_EQUIP or nil local itemid = player:getStorageValue(_BACKPACK[slot][ext][bag].UID_01) or nil local itemRecLevel = 0 if ext == nil or bag == nil or slot == nil or itemid == nil then return false end if _DEBUG_MODE then print("[TALK - INVENTARIO] " ..player:getName().. " - " .._ITEMS[itemid].NAME) end if slot == 04 then if player:getStorageValue(_SYSTEM.WARZONE) > 00 then return false end end if slot == 2 or slot == 5 or slot == 6 or slot == 8 or slot == 9 then lvl = player:getStorageValue(_BACKPACK[slot][ext][bag].UID_05) sta = player:getStorageValue(_BACKPACK[slot][ext][bag].UID_03) def = 10000 if lvl < 0 then lvl = 0 end if sta < 0 then sta = 0 end if itemid then if _ITEMS[itemid].DEF ~= nil then def = _ITEMS[itemid].DEF end end itemRecLevel = (def + lvl + (sta * 10)) * 2 elseif slot == 4 then lvl = player:getStorageValue(_BACKPACK[slot][ext][bag].UID_07) sta = player:getStorageValue(_BACKPACK[slot][ext][bag].UID_03) if lvl < 0 then lvl = 0 end if sta < 0 then sta = 0 end itemRecLevel = math.floor((_ITEMS[itemid].MIN + lvl + (sta * 10)) / 3) if id ~= nil and id > 0 then if id >= 4031 and id <= 4049 then itemRecLevel = _ITEMS[itemid].MIN + lvl + (sta * 10) * 2 end end end if player:getLevel() >= itemRecLevel then doInventario(player, 01, slot, ext, bag) -- Adiciono doBackpack(player, 00, slot, ext, 01) -- Organizo | Capacidade if player:getStorageValue(_QUESTLOG[01].UID_01) == 02 then player:setStorageValue(_QUESTLOG[01].UID_01, 3) doBackpack(player, 12) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") player:sendCancelMessage("@TutorShow 03") end if slot == 04 then if player:getStorageValue(_QUESTLOG[80].UID_01) == 02 then if player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_04) > 00 then if player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_05) > 00 then player:setStorageValue(_QUESTLOG[80].UID_01, 100) player:setStorageValue(_QUESTLOG[85].UID_01, 01) player:addExperience(3000, true, true) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") doBackpack(player, 12) end end end if player:getStorageValue(_QUESTLOG[85].UID_01) == 02 then if player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_04) > 00 then if player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_05) > 00 then if player:getStorageValue(_SYSTEM.INVENTARIO[04].UID_06) > 00 then player:setStorageValue(_QUESTLOG[85].UID_01, 100) player:addExperience(5000, true, true) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.") doBackpack(player, 12) end end end end local slotItem = player:getSlotItem(CONST_SLOT_LEFT) if slotItem == nil then player:addItem(7366) end end end end return false end