• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

LEVER BOSS DONT VERIFY SO HAVE PLAYER

seriousots

New Member
Joined
Mar 5, 2021
Messages
8
Reaction score
2
Lua:
local config = {
    requiredLevel = 100,
    daily = true,
    roomCenterPosition = Position(32997, 32212, 15),
    playerPositions = {
        Position(32997, 32228, 15),
        Position(32997, 32229,15),
        Position(32997, 32230, 15),
        Position(32997, 32231, 15),
        Position(32997, 32232,15)
    },
    teleportPosition = Position(32997, 32212, 15),
    bossPosition = Position(32997, 32209, 15)
}

local leverboss = Action()

function leverboss.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 9825 then
        -- Check if the player that pulled the lever is on the correct position
        if player:getPosition() ~= config.playerPositions[1] then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can\'t start the battle.")
            return true
        end
        
        local team, participant = {}

        for i = 1, #config.playerPositions do
            participant = Tile(config.playerPositions[i]):getTopCreature()
            
            -- Check there is a participant player
            if participant and participant:isPlayer() then
                -- Check participant level
                if participant:getLevel() < config.requiredLevel then
                    player:sendTextMessage(MESSAGE_EVENT_ADVANCE,
                        "Todos precisam ser level ".. config.requiredLevel .." ou mais.")
                    return true
                end

                -- Check participant boss timer
                if config.daily and participant:getStorageValue(Storage.Kilmaresh.fr02) > os.time() then
                    player:getPosition():sendMagicEffect(CONST_ME_POFF)
                    player:sendCancelMessage("Um ou mais jogadores, ainda nao esperou o cooldown do boss!")
                    return true
                end

                team[#team + 1] = participant
            end
        end

        -- Check if a team currently inside the boss room
        local specs, spec = Game.getSpectators(config.roomCenterPosition, false, false, 6, 6, 6, 6)
        for i = 1, #specs do
            spec = specs[i]
            if spec:isPlayer() then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Ja tem um time na sala")
                return true
            end

            spec:remove()
        end

        -- Spawn boss
        Game.createMonster("Razzagorn", config.bossPosition)

        -- Teleport team participants
        for i = 1, #team do
            team[i]:getPosition():sendMagicEffect(CONST_ME_POFF)
            team[i]:teleportTo(config.teleportPosition)
            -- Assign boss timer
            team[i]:setStorageValue(Storage.Kilmaresh.fr02, os.time() + 4*60*60) -- 20 hours
        end
        
        config.teleportPosition:sendMagicEffect(CONST_ME_ENERGYAREA)
    end

    item:transform(9825)
    return true
end

leverboss:uid(42432)
leverboss:register()
HELLO OT LAND
I HAVE ONE QUEST PLEASE HELP ME
I USE TFS1.3 REVSCRIPTS, AN AMEK ONE SYSTEM WITH BOSS...
THIS SYSTEM IS FOR 5 PLAYERS GO TO ROOM AND KILL BOSS
SO HAVE OTHER TEAM MAKE BOSS, AND OTHER PLAYER PUSH LEVER ... BOSS IS ROOM LEAVE
REVISE MY SCRIPT AND ADD TIME IN ROOM AND VERIFY SO HAVE OTHER PLAYERS DONT REMOVE BOSS INS ROOM
Post automatically merged:

bump
 
Last edited:
Use this one and change to your needed

Lua:
local setting = {
    centerRoom = {x = 747, y = 1229, z = 8},
    storage = Storage.TheSecretLibrary.TheOrderOfTheFalcon.OberonTimer,
    Pillar1pos = {x = 744, y = 1229, z = 8},
    bossPosition = {x = 747, y = 1229, z = 8},
    kickPosition = {x = 742, y = 1224, z = 7},
    playerTeleport = {x = 747, y = 1229, z = 8}
}


local oberonLever = Action()


-- Start Script
function oberonLever.onUse(creature, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 1945 and item.actionid == 57605 then
    local clearOberonRoom = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)       
    for index, spectatorcheckface in ipairs(clearOberonRoom) do
        if spectatorcheckface:isPlayer() then
            creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting against the boss! You need wait awhile.")
            return false
        end
    end   
    for index, removeOberon in ipairs(clearOberonRoom) do
        if (removeOberon:isMonster()) then
            removeOberon:remove()
        end
    end
        Game.createMonster("Grand Master Oberon", setting.bossPosition, false, true)
        Game.createMonster("Oberon's Bile", Position({x = setting.Pillar1pos.x, y = setting.Pillar1pos.y, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Oberon's Hate", Position({x = setting.Pillar1pos.x + 6, y = setting.Pillar1pos.y, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Oberon's Spite", Position({x = setting.Pillar1pos.x, y = setting.Pillar1pos.y + 4, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Oberon's Ire", Position({x = setting.Pillar1pos.x + 6, y = setting.Pillar1pos.y + 4, z = setting.Pillar1pos.z}), false, true)
    local players = {}
    for i = 0, 4 do
        local player1 = Tile({x = (Position(item:getPosition()).x - 2) + i, y = Position(item:getPosition()).y + 1, z = Position(item:getPosition()).z}):getTopCreature()
        players[#players+1] = player1
    end
        for i, player in ipairs(players) do
            player:getPosition():sendMagicEffect(CONST_ME_POFF)
            player:teleportTo(Position(setting.playerTeleport), false)
            doSendMagicEffect(player:getPosition(), CONST_ME_TELEPORT)
            setPlayerStorageValue(player,setting.storage, os.time() + 20 * 60 * 60)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have 20 minute(s) to defeat the boss.')
                addEvent(function()
                    local spectatorsOberon = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)
                        for u = 1, #spectatorsOberon, 1 do
                            if spectatorsOberon[u]:isPlayer() and (spectatorsOberon[u]:getName() == player:getName()) then
                                player:teleportTo(Position(setting.kickPosition))
                                player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
                                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Time is over.')
                            end
                        end
                end, 20 * 60 * 1000)
        end
    end
    return true
end


oberonLever:aid(57605)
oberonLever:register()
 
Back
Top