local FirstPlayer = 00 local PassiveCores = 00 local onlyGod = false local onlyStaff = false local eventMessage = '' function onGlobalRestore(player) -- NINHOS [RANDOM] if Game.getStorageValue(_GLOBAL_RANDOM.NINHOS["SYSTEM"].NINHO_1) == nil then Game.setStorageValue(_GLOBAL_RANDOM.NINHOS["SYSTEM"].NINHO_1, math.random(01, #_GLOBAL_RANDOM.NINHOS["FACIL"])) Game.setStorageValue(_GLOBAL_RANDOM.NINHOS["SYSTEM"].NINHO_2, math.random(01, #_GLOBAL_RANDOM.NINHOS["MEDIO"])) Game.setStorageValue(_GLOBAL_RANDOM.NINHOS["SYSTEM"].NINHO_3, math.random(01, #_GLOBAL_RANDOM.NINHOS["DIFICIL"])) Game.setStorageValue(_GLOBAL_RANDOM.NINHOS["SYSTEM"].NINHO_4, math.random(01, #_GLOBAL_RANDOM.NINHOS["IMPOSSIVEL"])) end -- BOOSTER CREATURE if Game.getStorageValue(_SYSTEM.TASK.MONSTER[01][00].BOOSTER) == nil then for X = 01, #_SYSTEM.TASK.MONSTER do local mathRandom = math.random(01, #_SYSTEM.TASK.MONSTER[X]) if X ~= 07 then Game.setStorageValue(_SYSTEM.TASK.MONSTER[X][00].BOOSTER, _SYSTEM.TASK.MONSTER[X][mathRandom].IMG_ID) end end end -- SAQUEADORES [RANDOM] for SAQUE_RANK = 01, 05 do local Saquear = {} if Game.getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][SAQUE_RANK][01]) == nil then for i = 01, #_GLOBAL_RANDOM.SAQUEADORES[SAQUE_RANK] do table.insert(Saquear, i) end local R_1 = math.random(01, #Saquear) Game.setStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][SAQUE_RANK][01], Saquear[R_1]) table.remove(Saquear, R_1) table.sort(Saquear) local R_2 = math.random(01, #Saquear) Game.setStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][SAQUE_RANK][02], Saquear[R_2]) table.remove(Saquear, R_2) table.sort(Saquear) local R_3 = math.random(01, #Saquear) Game.setStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][SAQUE_RANK][03], Saquear[R_3]) table.remove(Saquear, R_3) table.sort(Saquear) local R_4 = math.random(01, #Saquear) Game.setStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][SAQUE_RANK][04], Saquear[R_4]) table.remove(Saquear, R_4) table.sort(Saquear) local R_5 = math.random(01, #Saquear) Game.setStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][SAQUE_RANK][05], Saquear[R_5]) table.remove(Saquear, R_5) table.sort(Saquear) end end -- EVENTOS MENSAIS local Mes = tonumber(os.date("%m", os.time())) local Dia = tonumber(os.date("%d", os.time())) local WeekDay = os.date('%A') if Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID) == nil then if Dia >= _GLOBAL_RANDOM.EVENTOS_TABLE[Mes].DATA_INICIO and Dia <= _GLOBAL_RANDOM.EVENTOS_TABLE[Mes].DATA_FIM then Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID, Mes) eventMessage = 'O Evento [ ' .._GLOBAL_RANDOM.EVENTOS_TABLE[Mes].EVENT_NAME.. ' ] est� ativo no servidor. Para mais informa��es (MENU > ACTIVE > EVENTOS).' if Mes == 02 then -- MODO ONLINE Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1, 00) end if Mes == 03 then -- CRYPTBLOOD Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1, 00) end if Mes == 05 then -- ESTOQUE DE SUPRIMENTOS local TAB_ITEMS_1 = {} local TAB_ITEMS_2 = {} local TAB_ITEMS_3 = {} for X = 01, 20 do table.insert(TAB_ITEMS_1, _GLOBAL_RANDOM.EVENTOS_TABLE[Mes].ITEMS_TASK[01][X]) table.insert(TAB_ITEMS_2, _GLOBAL_RANDOM.EVENTOS_TABLE[Mes].ITEMS_TASK[02][X]) table.insert(TAB_ITEMS_3, _GLOBAL_RANDOM.EVENTOS_TABLE[Mes].ITEMS_TASK[03][X]) end Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1, math.random(40, 50)) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_2, math.random(30, 40)) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_3, math.random(20, 30)) -- WHITE POINTS local ID_1 = math.random(01, #TAB_ITEMS_1) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_4, TAB_ITEMS_1[ID_1]) table.remove(TAB_ITEMS_1, ID_1) local ID_2 = math.random(01, #TAB_ITEMS_1) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_5, TAB_ITEMS_1[ID_2]) table.remove(TAB_ITEMS_1, ID_2) local ID_3 = math.random(01, #TAB_ITEMS_1) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_6, TAB_ITEMS_1[ID_3]) table.remove(TAB_ITEMS_1, ID_3) -- YELLOW POINTS local IDD_1 = math.random(01, #TAB_ITEMS_2) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_7, TAB_ITEMS_2[IDD_1]) table.remove(TAB_ITEMS_2, IDD_1) local IDD_2 = math.random(01, #TAB_ITEMS_2) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_8, TAB_ITEMS_2[IDD_2]) table.remove(TAB_ITEMS_2, IDD_2) local IDD_3 = math.random(01, #TAB_ITEMS_2) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_9, TAB_ITEMS_2[IDD_3]) table.remove(TAB_ITEMS_2, IDD_3) -- BLUE POINTS local IDDD_1 = math.random(01, #TAB_ITEMS_3) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_10, TAB_ITEMS_3[IDDD_1]) table.remove(TAB_ITEMS_3, IDDD_1) local IDDD_2 = math.random(01, #TAB_ITEMS_3) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_11, TAB_ITEMS_3[IDDD_2]) table.remove(TAB_ITEMS_3, IDDD_2) local IDDD_3 = math.random(01, #TAB_ITEMS_3) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_12, TAB_ITEMS_3[IDDD_3]) table.remove(TAB_ITEMS_3, IDDD_3) end if Mes == 11 then -- PILARES DA FORTUNA for X = 01, 05 do local POS_PILLAR = Tile(_GLOBAL_RANDOM.EVENTOS_TABLE[11].PILLAR_POS[X].TILE[01], _GLOBAL_RANDOM.EVENTOS_TABLE[11].PILLAR_POS[X].TILE[02], _GLOBAL_RANDOM.EVENTOS_TABLE[11].PILLAR_POS[X].TILE[03]) local CHECK_PILLAR = POS_PILLAR:getTopCreature() if CHECK_PILLAR then doRemoveCreature(CHECK_PILLAR:getId()) end Game.createMonster('Pillar of Fortune', _GLOBAL_RANDOM.EVENTOS_TABLE[11].PILLAR_POS[X].POS[01]) end Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[11].PILLAR_STEP, 01) end if Mes == 12 then -- OS ESCOLHIDOS local ClassMonster = {01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11} local ClassUm = math.random(01, #ClassMonster) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1, ClassMonster[ClassUm]) table.remove(ClassMonster, ClassUm) local ClassDois = math.random(01, #ClassMonster) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_2, ClassMonster[ClassDois]) table.remove(ClassMonster, ClassDois) local ClassTres = math.random(01, #ClassMonster) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_3, ClassMonster[ClassTres]) table.remove(ClassMonster, ClassTres) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_4, 00) if Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_5) == 01 then Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_5, 02) else Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_5, 01) end end else Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID, 0) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_1, nil) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_2, nil) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_3, nil) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_4, nil) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_5, nil) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_6, nil) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_7, nil) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_8, nil) Game.setStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_UID_9, nil) end end -- EVENTOS DI�RIOS Game.setStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE, _GLOBAL_RANDOM.DAILY_EVENTS.WEEK[WeekDay].ID) if WeekDay == "Monday" then db.query("DELETE FROM `player_storage` WHERE `player_storage`.`key` = " .._GLOBAL_RANDOM.WARZONE.EXP_STORAGE.. ";") player:setStorageValue(_GLOBAL_RANDOM.WARZONE.EXP_STORAGE, nil) end if WeekDay == "Tuesday" then PassiveCores = math.random(01, 04) Game.setStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.PASSIVE, PassiveCores) end if WeekDay == "Saturday" then local shopProduct = {} local chooseQntPromo = math.random(05, 10) for _SHOP = 01, #_SHOP_PRODUCTS do for _SHOP_ITEM = 01, #_SHOP_PRODUCTS[_SHOP] do if _SHOP_PRODUCTS[_SHOP][_SHOP_ITEM].VISIBLE then local str = _SHOP.. "-" .._SHOP_ITEM table.insert(shopProduct, str) end end end for X = 01, chooseQntPromo do local chooseItem = math.random(01, #shopProduct) local choose_id = shopProduct[chooseItem] table.remove(shopProduct, chooseItem) local split = choose_id:splitTrimmed("-") local CATEGORIA = tonumber(split[01]) local INDEX = tonumber(split[02]) if _SHOP_PRODUCTS[CATEGORIA][INDEX].VIP.ORIGIN_PRICE >= 05 then local percentPromo = math.random(10, 50) * (_SHOP_PRODUCTS[CATEGORIA][INDEX].VIP.ORIGIN_PRICE / 100) _SHOP_PRODUCTS[CATEGORIA][INDEX].VIP.PROMO_PRICE = (_SHOP_PRODUCTS[CATEGORIA][INDEX].VIP.ORIGIN_PRICE - math.floor(percentPromo)) end if _SHOP_PRODUCTS[CATEGORIA][INDEX].ONLINE.ORIGIN_PRICE > 00 then if _SHOP_PRODUCTS[CATEGORIA][INDEX].ONLINE.ORIGIN_PRICE >= 05 then local percentPromo = math.random(10, 50) * (_SHOP_PRODUCTS[CATEGORIA][INDEX].ONLINE.ORIGIN_PRICE / 100) _SHOP_PRODUCTS[CATEGORIA][INDEX].ONLINE.PROMO_PRICE = (_SHOP_PRODUCTS[CATEGORIA][INDEX].ONLINE.ORIGIN_PRICE - math.floor(percentPromo)) end end end end -- DESAFIOS DI�RIOS local desafioDiario = {} for _TAB = 01, #_DESAFIOS do table.insert(desafioDiario, _TAB) end for _DES = 01, 10 do local chooseDesafio = math.random(01, #desafioDiario) local checkRepeat = 00 for REPEAT = 01, 10 do if _DAILYS[REPEAT].ID > 00 then if _DAILYS[REPEAT].ID == chooseDesafio then checkRepeat = 01 end end end if checkRepeat == 00 then _DAILYS[_DES].ID = chooseDesafio else _DES = _DES - 01 end end db.query("DELETE FROM `player_storage` WHERE `player_storage`.`key` = " .._SYSTEM.DOUBLE_EXP_ONE.. " OR `player_storage`.`key` = " .._DESAFIOS[00].DESAFIO_ID.. " OR `player_storage`.`key` = " .._DESAFIOS[00].DESAFIO_COUNT.. ";") player:setStorageValue(_SYSTEM.DOUBLE_EXP_ONE, nil) player:setStorageValue(_DESAFIOS[00].DESAFIO_ID, nil) player:setStorageValue(_DESAFIOS[00].DESAFIO_COUNT, nil) FirstPlayer = 01 end function onLogin(player) if onlyGod then local playerAccount = player:getAccountId() if playerAccount ~= 19 then return false end elseif onlyStaff then if player:getGroup():getId() < 2 then return false end end local diasSemana = { ["Sunday"] = "Domingo", ["Monday"] = "Lunes", ["Tuesday"] = "Martes", ["Wednesday"] = "Miercoles", ["Thursday"] = "Jueves", ["Friday"] = "Viernes", ["Saturday"] = "Sabado" } local mesesAno = { ["January"] = "Enero", ["February"] = "Febrero", ["March"] = "Marzo", ["April"] = "Abril", ["May"] = "Mayo", ["June"] = "Junio", ["July"] = "Julio", ["August"] = "Agosto", ["September"] = "Septiembre", ["October"] = "Octubre", ["November"] = "Noviembre", ["December"] = "Diciembre" } local lastLogin = player:getLastLoginSaved() if lastLogin and lastLogin > 0 then local diaCompleto = diasSemana[os.date("%A", lastLogin)] local mesCompleto = mesesAno[os.date("%B", lastLogin)] local hora24 = os.date("%H", lastLogin) -- Hora en formato de 24 horas local sufijoAMPM = tonumber(hora24) < 12 and "AM" or "PM" local hora = os.date("%I:%M", lastLogin) -- Hora en formato de 12 horas local fecha = string.format("%d de %s de %s a las %s %s", os.date("%d", lastLogin), mesCompleto, os.date("%Y", lastLogin), hora, sufijoAMPM) local loginStr = "Bienvenido a " .. configManager.getString(configKeys.SERVER_NAME) .. "!" loginStr = string.format(loginStr .. "\nSu ultima visita fue el %s, %s.", diaCompleto, fecha) player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr) else local loginStr = "Bienvenido a " .. configManager.getString(configKeys.SERVER_NAME) .. "!" player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr .. "\nEsta es su primera vez iniciando sesion!") end if player:getLastLoginSaved() <= 0 then player:setStorageValue(_QUESTLOG[01].UID_01, 01) --[[ PRIMEIROS PASSOS ]]-- addEvent(function() player:sendCancelMessage("@TutorShow 00") end, 3000) local playerName = player:getName() db.query("UPDATE `players` SET `level` = '1', `vocation` = '1', `town_id` = '1', `lastlogin` = '0', `health` = '100', `healthmax` = '100', `experience` = '0', `maglevel` = '0', `mana` = '0', `manamax` = '0', `manaspent` = '0', `cap` = '470', `skill_fist` = '10', `skill_fist_tries` = '0', `skill_club` = '10', `skill_club_tries` = '0', `skill_sword` = '10', `skill_sword_tries` = '0', `skill_axe` = '10', `skill_axe_tries` = '0', `skill_dist` = '10', `skill_dist_tries` = '0', `skill_shielding` = '10', `skill_shielding_tries` = '0', `skill_fishing` = '10', `skill_fishing_tries` = '0' WHERE `players`.`name` = '" ..playerName.. "';") player:setVocation(01) player:teleportTo({x=3999, y=991, z=07}) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:setStorageValue(_SYSTEM.INVENTARIO[03].UID_01, 10000) -- Backpack Inicial player:setStorageValue(_SYSTEM.SKILL_CURE[01], 01) -- Skill de Cura Inicial player:setStorageValue(_SYSTEM.SKILL_CURE[02], 100) -- Skill de Cura Quantidade else if loginStr ~= "" then player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr) end end player:setStorageValue(_PLAYER_INFO.DEF, nil) player:setStorageValue(_PLAYER_INFO.ESQ, nil) player:setStorageValue(_PLAYER_INFO.FIRE, nil) player:setStorageValue(_PLAYER_INFO.ICE, nil) player:setStorageValue(_PLAYER_INFO.ENERGY, nil) player:setStorageValue(_PLAYER_INFO.EARTH, nil) player:setStorageValue(_PLAYER_INFO.DEATH, nil) player:setStorageValue(_PLAYER_INFO.RES_PLAYER, nil) player:setStorageValue(_PLAYER_INFO.EXTRA_DEF, nil) player:setStorageValue(_PLAYER_INFO.EXTRA_ESQ, nil) player:setStorageValue(_PLAYER_INFO.EXTRA_MAG, nil) player:setStorageValue(_PLAYER_INFO.CURA_ESQ, nil) player:setStorageValue(_PLAYER_INFO.FEAR_PARA, nil) player:setStorageValue(_PLAYER_INFO.BOMB_FIRE, nil) player:setStorageValue(_PLAYER_INFO.BOMB_ENERGY, nil) player:setStorageValue(_PLAYER_INFO.BOMB_ICE, nil) player:setStorageValue(_PLAYER_INFO.BOMB_EARTH, nil) player:setStorageValue(_PLAYER_INFO.BOMB_DEATH, nil) player:setStorageValue(_PLAYER_INFO.BOMB_HOLY, nil) player:setStorageValue(_PLAYER_INFO.BOMB_PHYSICAL, nil) player:setStorageValue(_PLAYER_INFO.CANCEL_INV, nil) player:setStorageValue(_PLAYER_INFO.CAN_PARA, nil) player:setStorageValue(_PLAYER_INFO.DMG_HALF, nil) player:setStorageValue(_PLAYER_INFO.FREE_RUN, nil) player:setStorageValue(_SYSTEM.IDLE_COUNT, nil) doInventario(player, 07) player:setStorageValue(_PLAYER_INFO.LOGOUT_DELAY, _PLAYER_INFO.SECONDS_DELAY + 05) -- RESTAURANDO HP & RESET SPEED player:setMaxHealth((player:getLevel() * 10) + 140) player:changeSpeed(player:getBaseSpeed()) -- SISTEMA DE COMPENSA��O if player:getTown():getId() > 01 then -- DANGEROUS local OnlineInsert = 00 if player:getTown():getId() == 02 or player:getTown():getId() == 03 or player:getTown():getId() == 17 then OnlineInsert = 01 elseif player:getTown():getId() == 04 or player:getTown():getId() == 05 or player:getTown():getId() == 18 then OnlineInsert = 02 elseif player:getTown():getId() == 06 or player:getTown():getId() == 07 or player:getTown():getId() == 19 then OnlineInsert = 04 elseif player:getTown():getId() == 09 or player:getTown():getId() == 10 or player:getTown():getId() == 20 then OnlineInsert = 03 elseif player:getTown():getId() == 11 or player:getTown():getId() == 12 or player:getTown():getId() == 21 then OnlineInsert = 05 elseif player:getTown():getId() == 13 or player:getTown():getId() == 14 or player:getTown():getId() == 22 then OnlineInsert = 06 elseif player:getTown():getId() == 23 or player:getTown():getId() == 24 or player:getTown():getId() == 25 then OnlineInsert = 07 elseif player:getTown():getId() == 26 or player:getTown():getId() == 27 or player:getTown():getId() == 28 then OnlineInsert = 08 elseif player:getTown():getId() == 29 or player:getTown():getId() == 30 or player:getTown():getId() == 31 then OnlineInsert = 09 end player:sendCancelMessage("@DGTime 00 00 00") player:sendCancelMessage("@ResetDG") for X = 01, #_SYSTEM.DANGEROUS do for Z = 01, #_SYSTEM.DANGEROUS[X] do player:setStorageValue(_SYSTEM.DANGEROUS[X][Z].STORAGE, nil) player:setStorageValue(_SYSTEM.DANGEROUS[X][Z].RECOMPENSA, nil) end end player:setTown(Town(01)) player:teleportTo(player:getTown():getTemplePosition()) if OnlineInsert > 0 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Sistema de compensa��o: Online Coins devolvidos (x" ..OnlineInsert.. ").") player:sendCancelMessage("@LootMSG 3160 0 0 " ..OnlineInsert) player:setStorageValue(_SYSTEM.ONLINE_COIN, (player:getStorageValue(_SYSTEM.ONLINE_COIN) + OnlineInsert)) end end -- SALAS PVP if player:getStorageValue(_PVP_ROOM[00].PVP_SALA_ID) > 00 then player:setStorageValue(_PVP_ROOM[00].PVP_SALA_ID, nil) player:setStorageValue(_PVP_ROOM[00].TIME_ID, nil) player:sendCancelMessage("@NoTeleport 00") player:sendCancelMessage("@ResetDG") player:setTown(Town(01)) player:teleportTo(player:getTown():getTemplePosition()) end if player:getStorageValue(_SYSTEM.CURSED_TREE) > 00 then -- ARVORE AMALDI�OADA local OnlineInsert = 00 if player:getStorageValue(_SYSTEM.CURSED_TREE) == 01 then OnlineInsert = player:getStorageValue(_SYSTEM.CURSED_TREE) elseif player:getStorageValue(_SYSTEM.CURSED_TREE) == 02 then OnlineInsert = player:getStorageValue(_SYSTEM.CURSED_TREE) elseif player:getStorageValue(_SYSTEM.CURSED_TREE) == 03 then OnlineInsert = player:getStorageValue(_SYSTEM.CURSED_TREE) elseif player:getStorageValue(_SYSTEM.CURSED_TREE) == 04 then OnlineInsert = player:getStorageValue(_SYSTEM.CURSED_TREE) end player:setStorageValue(_SYSTEM.CURSED_TREE, nil) player:setTown(Town(01)) player:teleportTo(player:getTown():getTemplePosition()) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Sistema de compensa��o: Online Coins devolvidos (x" ..OnlineInsert.. ").") player:sendCancelMessage("@LootMSG 3160 0 0 " ..OnlineInsert) player:setStorageValue(_SYSTEM.ONLINE_COIN, (player:getStorageValue(_SYSTEM.ONLINE_COIN) + OnlineInsert)) end -- REMOVER STORAGE DE TRADE if player:getStorageValue(_SYSTEM.PLAYER_TRADE_ACT) > 00 then player:sendCancelMessage("@ClosedTrade") player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil) end -- RESTAURANDO BACKPACK if player:getStorageValue(_SYSTEM.INVENTARIO[03].UID_01) < 01 then player:setStorageValue(_SYSTEM.INVENTARIO[03].UID_01, 10000) -- Backpack Inicial end -- TUTORIAL DE PRIMEIRA MORTE if player:getStorageValue(_SYSTEM.FIRST_DEAD_TUTOR) > 00 then player:sendCancelMessage("@TutorShow 35") player:setStorageValue(_SYSTEM.FIRST_DEAD_TUTOR, nil) end -- NOTIFICA��O DO MARKET & EMAIL if player:getStorageValue(_SYSTEM.NOTIFY_MARKET_GOLD) > 00 then player:sendTextMessage(MESSAGE_INFO_DESCR, "Voc� vendeu produtos no Market.") PlayerGoldCoins(player, 02, player:getStorageValue(_SYSTEM.NOTIFY_MARKET_GOLD)) player:setStorageValue(_SYSTEM.NOTIFY_MARKET_GOLD, nil) end if player:getStorageValue(_SYSTEM.NOTIFY_MARKET_VIP) > 00 then player:sendCancelMessage("@LootMSG 3218 3 0 " ..player:getStorageValue(_SYSTEM.NOTIFY_MARKET_VIP)) player:sendTextMessage(MESSAGE_INFO_DESCR, "Voc� vendeu produtos no Market.") PlayerVipCoins(player, 02, player:getStorageValue(_SYSTEM.NOTIFY_MARKET_VIP)) player:setStorageValue(_SYSTEM.NOTIFY_MARKET_VIP, nil) end if player:getStorageValue(_SYSTEM.MESSAGE_ALERT) > 00 then player:sendTextMessage(MESSAGE_INFO_DESCR, "Voc� possui um novo email em sua Caixa de Mensagem.\nDigite Ctrl + Z para verificar.") player:setStorageValue(_SYSTEM.MESSAGE_ALERT, nil) end -- MORRER NA FENDA DIMENSIONAL if player:getStorageValue(_SYSTEM.FENDAS_DIMENSIONAL[01]) > 00 then player:setStorageValue(_SYSTEM.FENDAS_DIMENSIONAL[01], nil) if player:getStorageValue(_QUESTLOG[167].UID_01) == 03 then player:setStorageValue(_QUESTLOG[167].UID_01, 02) player:sendTextMessage(MESSAGE_STATUS_WARNING, "[ MISS�O FRACASSADA ]\nVoc� morreu em combate.") doBackpack(player, 12) player:sendCancelMessage("@LoadQuestWindows") else player:sendTextMessage(MESSAGE_STATUS_WARNING, "[ FENDA DIMENSIONAL ]\nVoc� falhou em selar a fenda Dimensional.") end end player:setStorageValue(_SYSTEM.PLAYER_EXHAUST, nil) -- CHECAR PENALIDADES player:sendCancelMessage("@Penalidade " ..player:getStorageValue(_SYSTEM.PENALIDADES[01])) -- CHECK PREMIUM if not player:isPremium() then if player:getStorageValue(_SYSTEM.PREMIUM_TIME) > 00 then player:setStorageValue(_SYSTEM.PREMIUM_TIME, nil) -- REMOVER SUMMON EQUIPADO player:setStorageValue(_SYSTEM.INVENTARIO[10].UID_01, nil) player:setStorageValue(_SYSTEM.INVENTARIO[10].UID_02, nil) player:setStorageValue(_SYSTEM.INVENTARIO[10].UID_03, nil) if player:getSex() == PLAYERSEX_FEMALE then local newOutfit = { lookType = 136 } player:setOutfit(newOutfit) else local newOutfit = { lookType = 128 } player:setOutfit(newOutfit) end player:setTown(Town(01)) player:teleportTo({x=3999, y=991, z=07}) player:sendOutfitWindow() end end -- STAMINA nextUseStaminaTime[player.uid] = 0 -- RESET MAESTRIA SPELLS player:setStorageValue(_SYSTEM.MAESTRIA[03], nil) player:setStorageValue(_SYSTEM.MAESTRIA[04], nil) -- RESET NINHOS (Player) player:setStorageValue(_SYSTEM.GLOBAL_INDEX[01], nil) player:setStorageValue(_SYSTEM.GLOBAL_INDEX[02], nil) player:setStorageValue(_SYSTEM.GLOBAL_INDEX[03], nil) player:setStorageValue(_SYSTEM.GLOBAL_INDEX[04], nil) -- RESET PONTOS ONLINE if player:getStorageValue(_SYSTEM.DEATH_COUNT) == 1 then player:setStorageValue(_SYSTEM.DEATH_COUNT, 0) else player:setStorageValue(_SYSTEM.COUNT_ONLINE_COIN, 3600) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Permane�a x1 hora online para ganhar Online Points.") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Pressione Ctrl + Z para abrir seu Painel de Mensagens.") end -- CHEATS ATIVADOS if _CHEATS.DANGEROUS_UNLOCK_LEVEL then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: Ignorar requisito de level para entrar nas Dangerous.") end if _CHEATS.DANGEROUS_UNLOCK_ONLINE then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: N�o precisa de Online Points para entrar nas Dangerous.") end if _CHEATS.UPGRADE_COIN_FREE then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: N�o precisa pagar para dar upgrade em um item.") end if _CHEATS.UPGRADE_ITEM_FREE then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: N�o precisa oferecer nenhum item para dar upgrade em um equipamento.") end if _CHEATS.IMORTAL_MODE then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: Voc� est� imortal a qualquer dano.") end if _CHEATS.FURIUS_SHOOTING then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: Qualquer dano causar� 10.000 de dano extra.") end if _CHEATS.FREE_BLACKLIST then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: N�o precisa mais de Tokens para enfrentar um boss na Blacklist.") end if _CHEATS.BROADCAST_ELITE then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: Todos os online ser�o notificados quando um monstro elite surgir no mapa.") end if _CHEATS.NINHO_ONLINE_FREE then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: N�o precisa de Online Points para entrar nos Ninhos.") end if _CHEATS.CURSED_ONLINE_FREE then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: N�o precisa de Online Points para enfrentar os desafios da �rvore Amaldi�oada.") end if _CHEATS.POWERBOX_GOLD_FREE then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: N�o precisa pagar gold coins para comprar uma Power Box.") end if _CHEATS.POWERBOX_TOKENS_FREE then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: N�o precisa pagar tokens para comprar uma Power Box.") end if _CHEATS.MACHINE_SORT_FREE then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: N�o precisa pagar para abrir uma Machine Sort.") end if _CHEATS.MAESTRIA_COIN_FREE then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: N�o precisa pagar gold coins para avan�ar em Maestria.") end if _CHEATS.MAESTRIA_LEVEL_UNLOCK then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: Ignorar requisito de level para avan�ar em Maestria.") end if _CHEATS.ESPECIALISTA_COIN_FREE then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: N�o precisa pagar para iniciar os desafios de Especialista.") end if _CHEATS.ESPECIALISTA_LEVEL_UNLOCK then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: Ignorar requisito de level para iniciar os desafios de Especialista.") end if _CHEATS.GOLD_MINER_UNLOCK then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "[ CHEATS ATIVADO ]: Multiplica o ganho de gold coins em drop de monstros e venda de itens.") end -- RESET TAXA | CRITICAL player:setStorageValue(_SYSTEM.CRITICAL_VALUES[01], nil) player:setStorageValue(_SYSTEM.CRITICAL_VALUES[02], nil) -- RESET BUFF RING player:setStorageValue(_SYSTEM.AMULET_VALUES[00][01], 0) player:setStorageValue(_SYSTEM.AMULET_VALUES[00][02], 0) player:setStorageValue(_SYSTEM.AMULET_VALUES[00][03], 0) -- RESET GLOBALEVENTS player:setStorageValue(_SYSTEM.GLOBAL_INDEX[01], nil) player:setStorageValue(_SYSTEM.GLOBAL_INDEX[02], nil) -- RESET EXP CREATURE BOOTS | BLACKLIST player:setStorageValue(_SYSTEM.TASK[00].TIMER, nil) -- FALHANDO MISS�ES if player:getStorageValue(_QUESTLOG[166].UID_01) == 02 then player:setStorageValue(_QUESTLOG[166].UID_01, 01) player:setStorageValue(10993, 00) player:sendTextMessage(MESSAGE_STATUS_WARNING, "[ MISS�O FRACASSADA ]\nVoc� morreu ou foi desconectado em combate.") doBackpack(player, 12) player:sendCancelMessage("@LoadQuestWindows") end if player:getStorageValue(_QUESTLOG[169].UID_01) > 01 and player:getStorageValue(_QUESTLOG[169].UID_01) < 100 then player:setStorageValue(_QUESTLOG[169].UID_01, 01) player:sendTextMessage(MESSAGE_STATUS_WARNING, "[ MISS�O FRACASSADA ]\nVoc� morreu ou foi desconectado em combate.") doBackpack(player, 12) player:sendCancelMessage("@LoadQuestWindows") end if player:getStorageValue(_QUESTLOG[188].UID_01) == 02 or player:getStorageValue(_QUESTLOG[188].UID_01) == 03 then player:setStorageValue(_QUESTLOG[188].UID_01, 01) player:sendTextMessage(MESSAGE_STATUS_WARNING, "[ MISS�O FRACASSADA ]\nVoc� foi desconectado durante o teste.") doBackpack(player, 12) player:sendCancelMessage("@LoadQuestWindows") end if player:getStorageValue(_QUESTLOG[197].UID_01) == 03 then player:setStorageValue(_QUESTLOG[197].UID_01, 02) player:sendTextMessage(MESSAGE_STATUS_WARNING, "[ MISS�O FRACASSADA ]\nVoc� foi desconectado durante o combate.") doBackpack(player, 12) player:sendCancelMessage("@LoadQuestWindows") end if player:getStorageValue(_QUESTLOG[198].UID_01) == 02 then player:setStorageValue(_QUESTLOG[198].UID_01, 01) player:sendTextMessage(MESSAGE_STATUS_WARNING, "[ MISS�O FRACASSADA ]\nVoc� foi desconectado durante o combate.") doBackpack(player, 12) player:sendCancelMessage("@LoadQuestWindows") end if FirstPlayer == 00 then onGlobalRestore(player) end local DAILY_EVENT = Game.getStorageValue(_GLOBAL_RANDOM.DAILY_EVENTS.STORAGE) or 0 player:sendCancelMessage("@DailyEvent " ..DAILY_EVENT.. " " ..PassiveCores) local EVENT_DAILY = { [01] = "A cada 1 hora, monstro Joker ser� invocado. Elimine-os e ganhe itens para upgrade de armas.", [03] = "A cada 1 hora, o boss Devovorga ser� invocado. Elimine-o e ganhe um buff aleat�rio do Shop.", [04] = "Durante todo o dia, todos ganham um b�nus de venda baseada no n�mero de jogadores online.", [05] = "Durante todo o dia, toda recompensa em PVP Points das Salas PVP � dobrada.", [06] = "Dia de promo��o no Shop.", [07] = "Atividades como Task, Boss ou Dangerous tem recompensas melhoradas quando feitas em grupo.", } local CORES = { [00] = "--", [01] = "Vermelho", [02] = "Azul", [03] = "Verde", [04] = "Amarelo", } if DAILY_EVENT == 02 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "[EVENTO DI�RIO] O Boost de Passiva est� aplicada na cor [ " ..CORES[PassiveCores].. " ].") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "[EVENTO DI�RIO] " ..EVENT_DAILY[DAILY_EVENT]) end if player:getStorageValue(_GLOBAL_RANDOM.WARZONE.EXP_STORAGE) > 00 then player:sendTextMessage(MESSAGE_STATUS_WARNING, "Seu b�nus de EXP total da Warzone �: [ " ..(player:getStorageValue(_GLOBAL_RANDOM.WARZONE.EXP_STORAGE) * 05).. "% ].") end if player:getStorageValue(_SYSTEM.WARZONE) > 00 then player:setTown(Town(01)) player:removeCondition(CONDITION_OUTFIT) player:setMaxHealth((player:getLevel() * 10) + 140) player:sendCancelMessage("@NoTeleport 00") player:setStorageValue(_SYSTEM.WARZONE, nil) player:teleportTo({x=3999, y=991, z=7}) end if Game.getStorageValue(_GLOBAL_RANDOM.WARZONE.STORAGE_START_WARZONE) == 01 then if _GLOBAL_RANDOM.WARZONE.LEFT_TIMER[01] > 20 then if player:getLevel() >= _GLOBAL_RANDOM.WARZONE.LEVEL then local players = Game.getPlayers() local totalPlayer = 00 for _, targetPlayer in ipairs(players) do if targetPlayer:getLevel() >= _GLOBAL_RANDOM.WARZONE.LEVEL then if targetPlayer:getStorageValue(_SYSTEM.WARZONE) > 00 then if _GLOBAL_RANDOM.WARZONE.LEFT_TIMER[01] >= 10 then totalPlayer = totalPlayer + 01 end end end end player:sendCancelMessage("@WarzoneStart " ..totalPlayer) end end end -- BUFF SHOP AND TOOLS SHOP onLoadShop(player) doInventario(player, 05) local DESCONTRUIR_EVENT = 00 if Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID) > 00 then if Game.getStorageValue(_GLOBAL_RANDOM.EVENTOS_TABLE[00].EVENT_ID) == 08 then DESCONTRUIR_EVENT = 01 end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, eventMessage) end if player:getStorageValue(_DESAFIOS[00].DESAFIO_TYPE) == 02 then DESCONTRUIR_EVENT = 01 end player:sendCancelMessage("@ToolsLoad " ..player:getStorageValue(_SYSTEM.TOOLS[01]).. " " ..player:getStorageValue(_SYSTEM.TOOLS[02]).. " " ..DESCONTRUIR_EVENT) player:sendCancelMessage("@RemoveMarkMap") -- ATUALIZANDO BAUS DOS SAQUEADORES for SAQ_RANK = 01, 05 do if player:getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][02][SAQ_RANK][01]) ~= Game.getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][SAQ_RANK][01]) then --print(player:getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][01]).. " ~= " ..Game.getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][00][01])) player:setStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][02][SAQ_RANK][01], nil) end if player:getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][02][SAQ_RANK][02]) ~= Game.getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][SAQ_RANK][02]) then --print(player:getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][02]).. " ~= " ..Game.getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][00][02])) player:setStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][02][SAQ_RANK][02], nil) end if player:getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][02][SAQ_RANK][03]) ~= Game.getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][SAQ_RANK][03]) then --print(player:getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][03]).. " ~= " ..Game.getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][00][03])) player:setStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][02][SAQ_RANK][03], nil) end if player:getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][02][SAQ_RANK][04]) ~= Game.getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][SAQ_RANK][04]) then --print(player:getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][04]).. " ~= " ..Game.getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][00][04])) player:setStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][02][SAQ_RANK][04], nil) end if player:getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][02][SAQ_RANK][05]) ~= Game.getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][SAQ_RANK][05]) then --print(player:getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][01][05]).. " ~= " ..Game.getStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][00][05])) player:setStorageValue(_GLOBAL_RANDOM.SAQUEADORES[00][02][SAQ_RANK][05], nil) end end -- PROMOTION local vocation = player:getVocation() local promotion = vocation:getPromotion() if player:isPremium() then local value = player:getStorageValue(PlayerStorageKeys.promotion) if not promotion and value ~= 1 then player:setStorageValue(PlayerStorageKeys.promotion, 1) elseif value == 1 then player:setVocation(promotion) end elseif not promotion then player:setVocation(vocation:getDemotion()) end -- EVENTS player:registerEvent("Sentinelas") player:registerEvent("ModalWindow_TGun") player:registerEvent("ExtendedOpcode") player:registerEvent("PlayerDeath") player:registerEvent("PVPZoneDeath") player:registerEvent("Defense") player:registerEvent("QuestLevel") player:registerEvent("Think") player:registerEvent("onLoot") player:registerEvent("onDGKill") player:registerEvent("SendTitlesOnLogin") player:registerEvent("PlayerLogout") return true end