leandroluck
New Member
- Joined
- Dec 24, 2010
- Messages
- 104
- Reaction score
- 1
Code:
function onThink(interval, lastExecution)
if string.lower(rotateMaps) ~= "yes" then
return true
end
local players = Game.getPlayers()
local currentTemple = Game.getStorageValue(currentMap)
if #players == 0 then
return true
end
if currentTemple == numberOfMaps then
Game.setStorageValue(currentMap, 1)
else
Game.setStorageValue(currentMap, Game.getStorageValue(currentMap) + 1)
end
for i = 1, #players do
local newTemple = Game.getStorageValue(currentMap)
local pos, player = mapPositions[newTemple]
player = players[i]
player:teleportTo(pos)
player:addHealth(player:getMaxHealth())
player:addMana(player:getMaxMana())
local tmp = {CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_BLEEDING, CONDITION_PARALYZE, CONDITION_INVISIBLE, CONDITION_MANASHIELD, CONDITION_INFIGHT, CONDITION_DRUNK, CONDITION_DROWN, CONDITION_ATTRIBUTES, CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED, CONDITION_PACIFIED, CONDITION_SPELLCOOLDOWN, CONDITION_SPELLGROUPCOOLDOWN}
for i = 1, #tmp do
player:removeCondition(tmp[i])
end
player:sendTextMessage(MESSAGE_STATUS_WARNING, mapChangeText)
end
return true
end
Last edited: