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

TFS 1.X+ Wrath of the Emperor passage

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,492
Solutions
27
Reaction score
857
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
Hi! I'm trying to implement the Wrath of the Emperor passage in my server, I use TFS 1.X downgraded by nekiro. The code is the following, but there's parts I don't know how to configure.
Lua:
function catchPlayer(cid)
    local player = Player(cid)
    player:setStorageValue(PlayerStorageKeys.WrathoftheEmperor.GuardcaughtYou, 1)
    player:setStorageValue(PlayerStorageKeys.WrathoftheEmperor.CrateStatus, 0)
    player:teleportTo(Position(1155, 878, 12), false)
    player:say("The guards have spotted you. You were forcibly dragged into a small cell. It looks like you need to build another disguise.", TALKTYPE_MONSTER_SAY)
    return true
end

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    local playerId = player.uid
    if item.actionid == 8015 then
        player:say("You hear guards moving behind doors in the distance. If you have any sort of disguise with you, this is the moment to use it.", TALKTYPE_MONSTER_SAY)
    elseif item.actionid == 8016 then
        if Tile(Position(player:getPosition().y < 31094 and 33080 or 33385, player:getPosition().y, 8)):getItemById(12213) then
            catchPlayer(playerId)
        end
    elseif item.actionid == 8017 or item.actionid == 32362 or item.itemid == 11436 then
        catchPlayer(playerId)
    elseif item.actionid == 8018 then
        if Game.getStorageValue(GlobalStorageKeys.WrathOfTheEmperor.Light01) ~= 1 then
            catchPlayer(playerId)
        end
    elseif item.actionid == 8019 then
        if Game.getStorageValue(GlobalStorageKeys.WrathOfTheEmperor.Light02) ~= 1 then
            catchPlayer(playerId)
        end
    elseif item.actionid == 8020 then
        if Game.getStorageValue(GlobalStorageKeys.WrathOfTheEmperor.Light03) ~= 1 then
            catchPlayer(playerId)
        end
    elseif item.actionid == 8021 then
        player:say("Guards heavily patrol this area. Try to stay hidden and do not draw any attention to yourself by trying to attack.", TALKTYPE_MONSTER_SAY)
    elseif item.actionid == 8022 then
        if player:getStorageValue(PlayerStorageKeys.WrathoftheEmperor.CrateStatus) ~= 1 then
            catchPlayer(playerId)
        end
    elseif item.actionid == 8023 then
        -- player:setStorageValue(PlayerStorageKeys.WrathoftheEmperor.CrateStatus, 0)
        -- doSetCreatureOutfit(cid, {lookTypeEx = 12496}, 1)
    end
    return true
end

I'm curently on this line

Lua:
elseif item.actionid == 8016 then
        if Tile(Position(player:getPosition().y < 31094 and 33080 or 33385, player:getPosition().y, 8)):getItemById(12213) then
            catchPlayer(playerId)
        end

1640916265170.png
What does this do? and how it's supposed to work? The values 31094, 33080, 33385 got me confused because I don't know what does this coordinates are related to. This is the passage:

1640916021794.png

And here's a video of how the first mission works:


Regards!
 
I think you should configure the positions correctly, this error is due to the fact that the Tile does not exist, and it cannot access any method since Tile = nil
these are the positions:
1640917076982.png
 
@Sarah Wesker thanks a lot for responding :D about the positions does player:getPosition().y < reference only to coordinate Y? I changed the original location of the passage and I need to know which position I should match.

I have to replace y= 31094, y=33080 and y=33385 for the coordinates of my map??
I think this is weird because y=33080 is located very far from the quest, The only one that could match is y = 31094 that is here:
1640917961415.png
 
Back
Top