undead mage
Active Member
Well, atm im using this script for a boss but can someone help me add a 20 hour waiting period?
Code:
local config = {
requiredLevel = 100,
daily = false,
centerZuraborRoomPosition = Position(175, 508, 11),
playerPositions = {
Position(165, 532, 11),
Position(165, 533, 11),
Position(165, 534, 11),
Position(165, 535, 11),
Position(165, 536, 11)
},
newPositions = {
Position(173, 513, 11),
Position(174, 513, 11),
Position(175, 513, 11),
Position(176, 513, 11),
Position(177, 513, 11)
},
ZuraborPositions = {
Position(175, 508, 11)
}
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 9826 then
local storePlayers, playerTile = {}
for i = 1, #config.playerPositions do
playerTile = Tile(config.playerPositions[i]):getTopCreature()
if not playerTile or not playerTile:isPlayer() then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need 5 players.")
return true
end
if playerTile:getLevel() < config.requiredLevel then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.")
return true
end
storePlayers[#storePlayers + 1] = playerTile
end
local specs, spec = Game.getSpectators(config.centerZuraborRoomPosition, false, false, 22, 22, 22, 22)
for i = 1, #specs do
spec = specs[i]
if spec:isPlayer() then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "A team is already inside the quest room.")
return true
end
spec:remove()
end
for i = 1, #config.ZuraborPositions do
Game.createMonster("Zurabor", config.ZuraborPositions[i])
end
local players
for i = 1, #storePlayers do
players = storePlayers[i]
config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF)
players:teleportTo(config.newPositions[i])
config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA)
players:setDirection(DIRECTION_NORTH)
end
elseif item.itemid == 9825 then
if config.daily then
player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
return true
end
end
item:transform(item.itemid == 9826 and 9825 or 9826)
return true
end