• 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!

Lua Wrath of emperor mission 11 payback time

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,521
Solutions
27
Reaction score
870
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
Hi! I have this exact issue. TFS 1.5 nekiro downgrade.

Couldn't find more information about it. I use the following script for the lever:
Lua:
local config = {
    firstboss = "snake god essence",
    bossPosition = Position(33365, 31407, 10),

    trap = "plaguethrower",
    trapPositions = {
        Position(33355, 31403, 10),
        Position(33364, 31403, 10),
        Position(33355, 31410, 10),
        Position(33364, 31410, 10)
    },
    startAreaPosition = Position(33357, 31404, 9),
    arenaPosition = Position(33359, 31406, 10)
}


function onUse(player, item, fromPosition, target, toPosition, isHotkey)

    if Game.getStorageValue(PlayerStorageKeys.WrathoftheEmperor.Mission11) == 1 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'The arena is already in use.')
        return true
    end

    Game.setStorageValue(PlayerStorageKeys.WrathoftheEmperor.Mission11, 1)

    local monsters = Game.getSpectators(config.arenaPosition, false, false, 10, 10, 10, 10)
    local spectator
    for i = 1, #monsters do
        spectator = monsters[i]
        if spectator:isMonster() then
            spectator:remove()
        end
    end

    local spectators = Game.getSpectators(config.startAreaPosition, false, true, 0, 5, 0, 5)
    for i = 1, #spectators do
        spectator = spectators[i]
        spectator:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        spectator:teleportTo(config.arenaPosition)
        config.arenaPosition:sendMagicEffect(CONST_ME_TELEPORT)
    end

    for i = 1, #config.trapPositions do
        Game.createMonster(config.trap, config.trapPositions[i])
    end

    Game.createMonster(config.firstboss, config.bossPosition)
    item:transform(item.itemid == 1945 and 1946 or 1945)
    return true
end

1709092656128.png

1709092688336.png
1709092718800.png

Also if the player leaves the boss area I don't know how they can exit the lever room, they can be teleported again to the Awarness of the Emperor but it is and endless loop between the Awarness and lever room because there's no way to exit (and if lever can't be pulled again, theres practially no way to exit the quest). I don't know how it behaves on original Tibia. It is just this last mission the one that doesn't work properly. Any help at this will be really helpfull!

For the moment what I just thought as solution:
  • Remove the exit teleport from boss area, so it is an all-in for the team. Kill all the bosses or die inside, no scape.
  • Make the lever return after "x" time. If someone will to make this possible I will appreciate it a lot! I have to check inside the boss area if any of the 4 states of the boss is spawned inside (mutated zalamon, snake thing, lizard abomination and the other one I don't remember it), delete it and reset the lever so it can be pulled again.
I'm not quite sure if players who die inside the boss area should be settled with PlayerStorageKeys.WrathoftheEmperor.Mission11 == -1 or something like that, also if someone who plays rl can tell me how they're allowed to enter to the lever room again if they die (they have to kill the 4 dragons, wrath of the emperor, fury of the emperor, etc.?). Any help at this will be really helpfull!

Thanks in advance.
Post automatically merged:

Ok just found how to enter back!
  • You will be taken to the final combat room with two teleporters: the one on the left goes to Muggy Plains (don't worry, you can return via another teleporter there in the same place) and the other leads to the Emperor.
1709094038770.png
See minute 01:32

Now I know that boss exit teleport goes directly to Awarness of the Emperor, and that north teleports are exit teleports (supposed to go to muggy plains). So the enigma stills on the lever. It does reset after a time delay? I read you guys.
Post automatically merged:

I ended up creating this. Is there a chance that someone helps me with the syntaxis?
Lua:
local config = {
    firstboss = "Esencia Del Dios Serpiente",
    bossPosition = Position(1069, 633, 15),

    trap = "Tiraplaga",
    trapPositions = {
        Position(1059, 629, 15),
        Position(1068, 629, 15),
        Position(1059, 636, 15),
        Position(1068, 636, 15)
    },
    startAreaPosition = Position(1061, 630, 14),
    arenaPosition = Position(1063, 632, 15)
}

local arenaTimer

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    --- Check if there's players inside'
    local playersInside = Game.getSpectators(config.arenaPosition, true, false, 10, 10, 10, 10)
    if #playersInside > 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'The arena is occupied.')
        return true
    end

    --- Check if player has "inside storage"
    if Game.getStorageValue(PlayerStorageKeys.WrathoftheEmperor.Mission11) == 1 then
       player:sendTextMessage(MESSAGE_STATUS_SMALL, 'Zalamon is alive.')
       return true
    end

    --- Check if player already killed Zalamon, so he/she don't help killing it twice
    if Game.getStorageValue(PlayerStorageKeys.WrathoftheEmperor.Questline) == 32 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'A player who is trying to enter already killed Zalamon.')
        return true
    end

    --- Set storage of player "is inside"
    Game.setStorageValue(PlayerStorageKeys.WrathoftheEmperor.Mission11, 1)

    --- Check if there's monsters inside boss area and delete them all if the lever is being pulled
    local monsters = Game.getSpectators(config.arenaPosition, false, false, 10, 10, 10, 10)
    local spectator
    for i = 1, #monsters do
        spectator = monsters[i]
        if spectator:isMonster() then
            spectator:remove()
        end
    end

    --- Teleport players from starting position to arena position
    local spectators = Game.getSpectators(config.startAreaPosition, false, true, 0, 5, 0, 5)
    for i = 1, #spectators do
        spectator = spectators[i]
        spectator:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        spectator:teleportTo(config.arenaPosition)
        config.arenaPosition:sendMagicEffect(CONST_ME_TELEPORT)
    end

    for i = 1, #config.trapPositions do
        Game.createMonster(config.trap, config.trapPositions[i])
    end

    Game.createMonster(config.firstboss, config.bossPosition)
    item:transform(item.itemid == 1945 and 1946 or 1945)

   -- Set a time limit for the player inside the area
    player:setStorageValue(PlayerStorageKeys.WrathoftheEmperor.Mission11Timer, os.time() + 300) -- 300 seconds = 5 minutes
    arenaTimer = addEvent(function()
        local playersInsideArena = Game.getSpectators(config.arenaPosition, true, false, 10, 10, 10, 10)
        if not isInArray(playersInsideArena, player) then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You have left the arena. Timer stopped.')
            stopEvent(arenaTimer)
            player:setStorageValue(PlayerStorageKeys.WrathoftheEmperor.ArenaCooldown, os.time() + 600) -- 600 seconds = 10 minutes
        elseif not player:isAlive() then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You have died. Timer stopped.')
            stopEvent(arenaTimer)
            player:setStorageValue(PlayerStorageKeys.WrathoftheEmperor.ArenaCooldown, os.time() + 600) -- 600 seconds = 10 minutes
        else
            player:sendTextMessage(MESSAGE_STATUS_SMALL, 'Time is up! You have been kicked out of the arena.')
            player:teleportTo(config.startAreaPosition)
            -- You can add additional actions here like removing storage values if needed
            player:setStorageValue(PlayerStorageKeys.WrathoftheEmperor.ArenaCooldown, os.time() + 600) -- 600 seconds = 10 minutes
        end
    end, 300000) -- 300000 milliseconds = 5 minutes

    return true
end

I tried to add some checks to
  • Create a timer with cooldown that doesn't allow players to pull lever twice in a row.
  • Methods to stop timers if the player dies or leaves the arena.
  • Check if player already used the sceptre at Zalamon's corpse so he/she can't help killing the boss again.
and more, everything is commented.
Thanks in advance!
 
Last edited:
Back
Top