Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local config = {
- requiredLevel = 100,
- daily = false,
- timekill = 20, -- Tempo que o Jogador Terá Para Matar o bossy
- centerDemonRoomPosition = Position(32912, 31599, 14),
- rangeX = 20,
- rangeY = 20,
- playerPositions = {
- Position(32902, 31623, 14),
- Position(32902, 31624, 14),
- Position(32902, 31625, 14),
- Position(32902, 31626, 14),
- Position(32902, 31627, 14),
- },
- newPositions = {
- Position(32912, 31591, 14),
- Position(32912, 31591, 14),
- Position(32912, 31591, 14),
- Position(32912, 31591, 14),
- Position(32912, 31591, 14),
- },
- demonPositions = {
- Position(32912, 31599, 14)
- }
- }
- local function roomIsOccupied(bossposition, rangeX, rangeY)
- local spectators = Game.getSpectators(bossposition, false, false, rangeX, rangeX, rangeY, rangeY)
- if #spectators ~= 0 then
- return true
- end
- return false
- end
- function onUse(player, item, fromPosition, target, toPosition, isHotkey)
- if item.itemid == 9826 then
- local storePlayers, playerTile = {}
- local tmpConfig = config
- if not tmpConfig then
- return true
- end
- for i = 1, #config.playerPositions do
- playerTile = Tile(config.playerPositions[i]):getTopCreature()
- if playerTile and 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
- if roomIsOccupied(tmpConfig.centerDemonRoomPosition, tmpConfig.rangeX, tmpConfig.rangeY) then
- player:sendTextMessage(TALKTYPE_MONSTER_SAY, 'Uma equipe ja esta dentro da sala de quest,aguarde..')
- return true
- end
- local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 3, 3, 2, 2)
- for i = 1, #specs do
- spec = specs[i]
- if spec:isPlayer() then
- player:sendTextMessage(MESSAGE_STATUS_SMALL, "Uma equipe ja esta dentro da sala de quest,aguarde..")
- return true
- end
- spec:remove()
- end
- for i = 1, #config.demonPositions do
- addEvent(doRemoveCreature, 1000 * 60 * 20,'Lady Tenebris')
- local boss = Game.createMonster("Lady Tenebris", config.demonPositions[i])
- boss:setReward(true)
- end
- local players
- for i = 1, #storePlayers do
- players = storePlayers[i]
- config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF)
- players:teleportTo(config.newPositions[i])
- player:sendTextMessage(MESSAGE_STATUS_WARNING, 'You have ' .. config.timekill .. ' minute(s) to kill Lady Tenebris.')
- config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA)
- players:setDirection(DIRECTION_EAST)
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement