local TABLE_SKILLS = { 01, 02, 03, 04, 05, 06, 07, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 29, 30, 32, 33, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 58, 59, 60, 61, 63, 65, 66, 68, 70, } function onModalWindow(player, modalWindowId, buttonId, choiceId) local RANDOM_POS_WARZONE = { [01] = {x=3944, y=1192, z=07}; [02] = {x=3948, y=1196, z=07}; [03] = {x=3941, y=1199, z=07}; [04] = {x=3935, y=1201, z=07}; [05] = {x=3953, y=1199, z=07}; [06] = {x=3960, y=1200, z=07}; [07] = {x=3945, y=1209, z=07}; [08] = {x=3938, y=1212, z=07}; [09] = {x=3932, y=1219, z=07}; [10] = {x=3934, y=1213, z=07}; [11] = {x=3956, y=1218, z=07}; [12] = {x=3946, y=1221, z=07}; [13] = {x=3944, y=1214, z=07}; [14] = {x=3938, y=1225, z=07}; [15] = {x=3932, y=1234, z=07}; [16] = {x=3941, y=1237, z=07}; [17] = {x=3948, y=1234, z=07}; [18] = {x=3960, y=1220, z=07}; } if modalWindowId == 1000 then if buttonId == 100 then 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.") return false end end player:setStorageValue(_SYSTEM.WARZONE, 01) player:setTown(Town(15)) player:teleportTo({x=4024, y=1193, z=07}) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:setMaxHealth(3000) player:addHealth(player:getMaxHealth()) player:sendCancelMessage("@NoTeleport 01") end elseif modalWindowId == 1001 then if buttonId == 100 then player:setStorageValue(_SYSTEM.WARZONE, nil) player:setTown(Town(01)) player:teleportTo({x=3999, y=991, z=07}) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) local lvl = player:getLevel() player:setMaxHealth((lvl * 10) + 140) player:addHealth(player:getMaxHealth()) player:sendCancelMessage("@NoTeleport 00") end elseif modalWindowId == 1002 then local GUN_CATEGORY = { [01] = {4024, 4030}; -- PISTOLAS [02] = {4010, 4014}; -- RIFLES [03] = {4040, 4049}; -- METRALHADORA [04] = {4002, 4004}; -- ESPINGARDA } if buttonId == 100 then local WEAPON_ID = math.random(GUN_CATEGORY[choiceId][01], GUN_CATEGORY[choiceId][02]) local WEAPON_RARE = math.random(03, 04) local WEAPON_STAR = math.random(00, 03) local SKILL_01 = 01 local SKILL_02 = 02 local SKILL_03 = 03 local TEMP_SKILLS = {} if #TEMP_SKILLS > 0 then for k in pairs (TEMP_SKILLS) do TEMP_SKILLS [k] = nil end end for S = 01, #TABLE_SKILLS do table.insert(TEMP_SKILLS, TABLE_SKILLS[S]) end local SkillSort1 = math.random(01, #TEMP_SKILLS) SKILL_01 = TEMP_SKILLS[SkillSort1] table.remove(TEMP_SKILLS, SkillSort1) SkillSort2 = math.random(01, #TEMP_SKILLS) SKILL_02 = TEMP_SKILLS[SkillSort2] table.remove(TEMP_SKILLS, SkillSort2) SkillSort3 = math.random(01, #TEMP_SKILLS) SKILL_03 = TEMP_SKILLS[SkillSort3] table.remove(TEMP_SKILLS, SkillSort3) player:setStorageValue(_SYSTEM.INVENTARIO[04].UID_01, WEAPON_ID) -- ID player:setStorageValue(_SYSTEM.INVENTARIO[04].UID_02, WEAPON_RARE) -- RARIDADE player:setStorageValue(_SYSTEM.INVENTARIO[04].UID_03, WEAPON_STAR) -- STAR player:setStorageValue(_SYSTEM.INVENTARIO[04].UID_04, SKILL_01) -- SKILL 01 player:setStorageValue(_SYSTEM.INVENTARIO[04].UID_05, SKILL_02) -- SKILL 02 player:setStorageValue(_SYSTEM.INVENTARIO[04].UID_06, SKILL_03) -- SKILL 03 player:setStorageValue(_SYSTEM.INVENTARIO[04].UID_07, math.random(00, 10)) -- LEVEL player:setStorageValue(_SYSTEM.INVENTARIO[04].UID_08, 00) player:setStorageValue(_SYSTEM.INVENTARIO[04].UID_09, 01) -- UNIQUE ITEM player:setStorageValue(_SYSTEM.INVENTARIO[04].UID_10, 9999) -- AMMO player:setStorageValue(_GLOBAL_RANDOM.WARZONE.LOBBY_TIMER, nil) player:sendCancelMessage("@LootMSG " ..WEAPON_ID.. " " ..WEAPON_RARE.. " " ..WEAPON_STAR.. " 01") doInventario(player, 00, 04, 00) -- Organizo Inventário player:setTown(Town(15)) player:teleportTo(RANDOM_POS_WARZONE[math.random(01, #RANDOM_POS_WARZONE)]) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:sendCancelMessage("@StarCliente") end elseif modalWindowId == 1003 then if buttonId == 100 then player:teleportTo({x=3896, y=1769, z=06}) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:sendCancelMessage("@NoTeleport 00") player:sendTextMessage(MESSAGE_STATUS_WARNING, "[ COLISEU ]\nVocê não concluiu o desafio do Coliseu") player:setStorageValue(_SYSTEM.DANGEROUS[01][01].STORAGE, nil) player:setStorageValue(_SYSTEM.FIRST_DEAD_TUTOR, nil) player:setStorageValue(_SYSTEM.COLISEU[05], nil) player:setStorageValue(_SYSTEM.COLISEU[06], nil) player:setStorageValue(_SYSTEM.COLISEU[07], nil) player:setStorageValue(_SYSTEM.COLISEU[08], nil) local from = _GLOBAL_RANDOM.COLISEUM.ORDER[00][01].ARENA_X_POS local to = _GLOBAL_RANDOM.COLISEUM.ORDER[00][01].ARENA_Y_POS for A = from.x, to.x do for B = from.y, to.y do for C = from.z, to.z do local tile = Tile(A, B, C) local creature = tile:getTopCreature() if creature and creature:isMonster() then doRemoveCreature(creature:getId()) end end end end end end end