Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GATESEXP_config = {
- --// Apenas mexa aqui, CONFIGS -- // ]]
- warningexp_times = 1, -- Tempo até iniciar o evento, exemplo: (19:50 > 20:00 = 10);
- eventexp_duration = 60000, -- Duração do evento (Padrão 1 hora.);
- eventexp_closewin = 80000, -- Duração do evento (Padrão 1 hora.);
- removegatesexp_effect = 3, -- Effect ao remover os portões;
- creategatesexp_effect = 5, -- Effect ao criar os portões;
- timeexp_winnersopen = 1 * 1000, -- Tempo para abrir o portão dos vencedores;
- timeexp_winnersclose = 1 * 1000, -- Tempo pra fechar o portão dos perdedores;
- gatesexp_itemid = 1544, -- ItemID dos portões;
- gatesexp_itemidstone = 1561, -- ItemID da pedra do trono;
- datesexp_start = {"Sunday-07:18", "Tuesday-10:50", "Monday-10:50", "Wednesday-07:32", "Thursday-10:50", "Friday-10:50", "Saturday-23:50"}, -- Datas do evento;
- openexp_eventgates = { -- // Abaixo as posições dos portões do evento;
- {x = 9744, y = 10135, z = 4, stackpos = 1},
- {x = 9745, y = 10135, z = 4, stackpos = 1},
- {x = 9746, y = 10135, z = 4, stackpos = 1},
- {x = 9747, y = 10135, z = 4, stackpos = 1},
- {x = 9748, y = 10135, z = 4, stackpos = 1},
- {x = 9749, y = 10135, z = 4, stackpos = 1},
- {x = 9750, y = 10135, z = 4, stackpos = 1},
- {x = 9751, y = 10135, z = 4, stackpos = 1},
- {x = 9752, y = 10135, z = 4, stackpos = 1},
- {x = 9753, y = 10135, z = 4, stackpos = 1},
- {x = 9754, y = 10135, z = 4, stackpos = 1},
- {x = 9847, y = 10022, z = 4, stackpos = 1},
- },
- open_eventstone = { -- // Abaixo as posições dos portões que abre qdo o evento termina;
- {x = 9847, y = 10021, z = 4, stackpos = 1},
- {x = 9847, y = 10020, z = 4, stackpos = 1},
- },
- openexp_winnersgates = { -- Abaixo as posições dos portões dos vencedores;
- {x = 1095, y = 1023, z = 7, stackpos = 1},
- },
- --// Não mexa daqui para baixo em NADA! -- // ]]
- timesexp_storage = 120491,
- startedexp_storage = 120492,
- tileexp_storage = 120493,
- }
- function gatesCloseExp()
- for table, gates in ipairs(GATESEXP_config.openexp_eventgates) do
- doSendMagicEffect(gates, GATESEXP_config.creategatesexp_effect)
- doCreateItem(GATESEXP_config.gatesexp_itemid, 1, gates)
- end
- for cid, player in ipairs(getGateWinnersExp()) do
- doSendMagicEffect(getThingPos(player), 13)
- doTeleportThing(player, GATESEXP_config.positionexp_winners, true)
- end
- addEvent(gatesWinnersOpenExp, GATESEXP_config.timeexp_winnersopen)
- addEvent(gatesWinnersCloseEXP, GATESEXP_config.timeexp_winnersclose)
- addEvent(setGlobalStorageValue, 5 * 1000, GATESEXP_config.startedexp_storage, -1)
- addEvent(setGlobalStorageValue, 5 * 1000, GATESEXP_config.timesexp_storage, -1)
- doBroadcastMessage("[Desert Exp]: Os portões do desert foram trancados!", 21)
- return true
- end
- function gatesWinnersOpenExp()
- for table, gates in ipairs(GATESEXP_config.openexp_winnersgates) do
- doSendMagicEffect(gates, GATESEXP_config.removegatesexp_effect)
- doRemoveItem(getTileItemById(gates, GATESEXP_config.gatesexp_itemid).uid)
- end
- return true
- end
- function gatesWinnersCloseExp()
- for table, gates in ipairs(GATESEXP_config.openexp_winnersgates) do
- doSendMagicEffect(gates, GATESEXP_config.creategatesexp_effect)
- doCreateItem(GATESEXP_config.gatesexp_itemid, 1, gates)
- end
- return true
- end
- function getGateWinnersExp()
- local winners = {}
- for cid, player in ipairs(getPlayersOnline()) do
- if isPlayer(player) then
- if (getPlayerStorageValue(player, GATESEXP_config.tileexp_storage) ~= -1) then
- table.insert(winners, player)
- end
- end
- end
- return winners
- end
- function gatesCloseWinExp()
- for table, gates in ipairs(GATESEXP_config.openexp_eventstone) do
- doSendMagicEffect(gates, GATESEXP_config.creategatesexp_effect)
- doCreateItem(GATESEXP_config.gatesexp_itemidstone, 1, gates)
- end
- return true
- end
- function gatesStartWinExp()
- for table, gates in ipairs(GATESEXP_config.openexp_eventstone) do
- doSendMagicEffect(gates, GATESEXP_config.removegatesexp_effect)
- doRemoveItem(getTileItemById(gates, GATESEXP_config.gatesexp_itemidstone).uid)
- end
- return true
- end
- function gatesStartExp()
- if (getGlobalStorageValue(GATESEXP_config.startedexp_storage) ~= -1) then
- if (getGlobalStorageValue(GATESEXP_config.timesexp_storage) == GATESEXP_config.warningexp_times) then
- for table, gates in ipairs(GATESEXP_config.openexp_eventgates) do
- doSendMagicEffect(gates, GATESEXP_config.removegatesexp_effect)
- doRemoveItem(getTileItemById(gates, GATESEXP_config.gatesexp_itemid).uid)
- end
- doBroadcastMessage("[Desert Exp]: Os portões foram abertos!", 21)
- addEvent(gatesCloseExp, GATESEXP_config.eventexp_duration)
- addEvent(gatesStartWinExp, GATESEXP_config.eventexp_duration)
- addEvent(gatesCloseWinExp, GATESEXP_config.eventexp_closewin)
- end
- end
- return true
- end
- function warningStartExp()
- if (getGlobalStorageValue(GATESEXP_config.timesexp_storage) == GATESEXP_config.warningexp_times) then
- gatesStartExp()
- return true
- end
- doBroadcastMessage("[Desert Exp]: Os portões serão abertos em "..(GATESEXP_config.warningexp_times - getGlobalStorageValue(GATESEXP_config.timesexp_storage)).." minuto(s)!", 21)
- setGlobalStorageValue(GATESEXP_config.timesexp_storage, (getGlobalStorageValue(GATESEXP_config.timesexp_storage) + 1))
- return addEvent(warningStartExp, 1 * 30 * 1000)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement