• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Corpse that teleports you down one floor

henkas

Well-Known Member
Joined
Jul 8, 2015
Messages
1,067
Solutions
5
Reaction score
63
Hello,
i have a quest and basically that quest is floor based like level you start from highest and going down each time you kill monster, so how can i make corpse that push you down one floor down once you step in it so basically like portal appears once you kill monster so i just need correct way to make corpse.

TFS 1.2
 
Solution
If you just want it to function like a hole, then the item attribute is fine. Keep in mind that any time the corpse is created, it will act as a hole though.

With a movement script, you could use the same corpse in other areas of the server and check the position of the corpse, if it's within the range of your dungeon, then you teleport down 1 floor. This would also allow you to find a nearby tile that is walkable in the event that the "hole" were to drop a player onto a wall for example. This could also be achieved by assigning an actionid to the corpse which would allow you to teleport players to specific positions based on the actionid.

Last but not least, you can define the corpse as a teleport and then set a specific position on...
Do a movement event.
LUA:
function onStepIn(creature, item, position, fromPosition)

    local player = creature:getPlayer()
    if not player then
        return true
    end
  
        player:teleportTo(Position(XXX,YYY,ZZZ))
        local pos = player:getPosition()
        pos:sendMagicEffect(CONST_ME_TELEPORT)

    return true
    end
 
Do a movement event.
LUA:
function onStepIn(creature, item, position, fromPosition)

    local player = creature:getPlayer()
    if not player then
        return true
    end

        player:teleportTo(Position(XXX,YYY,ZZZ))
        local pos = player:getPosition()
        pos:sendMagicEffect(CONST_ME_TELEPORT)

    return true
    end
so its x,y,z i would need to create different corpses to apply on a different monsters, i wouldnt be able to use same corpse on a different floor since it would have just one x,y,z and it would require a lot of time, isnt it possible to make it teleport on floor down or there is no function like this
 
LUA:
function onStepIn(creature, item, position, fromPosition)

    local player = creature:getPlayer()
    if not player then
        return true
    end
        local pos = player:getPosition()
        player:teleportTo(Position(pos.x,pos.y,pos.z - 1))
        local pos = player:getPosition()
        pos:sendMagicEffect(CONST_ME_TELEPORT)

    return true
    end
 
LUA:
function onStepIn(creature, item, position, fromPosition)

    local player = creature:getPlayer()
    if not player then
        return true
    end
        local pos = player:getPosition()
        player:teleportTo(Position(pos.x,pos.y,pos.z - 1))
        local pos = player:getPosition()
        pos:sendMagicEffect(CONST_ME_TELEPORT)

    return true
    end
So just items attribute wont work right?
<attribute key="floorchange" value="down" />
 
is not easier to test it, instead of asking here?
open items.xml
paste <attribute key="floorchange" value="down" />
save items.xml
/reload items ingame
 
is not easier to test it, instead of asking here?
open items.xml
paste <attribute key="floorchange" value="down" />
save items.xml
/reload items ingame
Thats why i asked in support section people suppose to answer if i have a question. If you dont feel like answering i dont need to see your useless comments. Even if i could test it first there is difference in code and code usage, you just could answer like a professional saying "yes floorchange should work, i forgot that it even exist, do not use my previous code".
 
The fact that theres a Support board on the forum doesn't justify you for being lazy or dumb.
 
Thats why i asked in support section people suppose to answer if i have a question. If you dont feel like answering i dont need to see your useless comments. Even if i could test it first there is difference in code and code usage, you just could answer like a professional saying "yes floorchange should work, i forgot that it even exist, do not use my previous code".
Man... It takes literally 30 sec to test that on your server. Im 100% sure it took more to write the post here.
 
Man... It takes literally 30 sec to test that on your server. Im 100% sure it took more to write the post here.
Like i said there is difference in code, why should i use your code or why should i use item attribute, every line of code can decrease performance of your serve.
 
If you just want it to function like a hole, then the item attribute is fine. Keep in mind that any time the corpse is created, it will act as a hole though.

With a movement script, you could use the same corpse in other areas of the server and check the position of the corpse, if it's within the range of your dungeon, then you teleport down 1 floor. This would also allow you to find a nearby tile that is walkable in the event that the "hole" were to drop a player onto a wall for example. This could also be achieved by assigning an actionid to the corpse which would allow you to teleport players to specific positions based on the actionid.

Last but not least, you can define the corpse as a teleport and then set a specific position on it via
 
Solution
If you just want it to function like a hole, then the item attribute is fine. Keep in mind that any time the corpse is created, it will act as a hole though.

With a movement script, you could use the same corpse in other areas of the server and check the position of the corpse, if it's within the range of your dungeon, then you teleport down 1 floor. This would also allow you to find a nearby tile that is walkable in the event that the "hole" were to drop a player onto a wall for example. This could also be achieved by assigning an actionid to the corpse which would allow you to teleport players to specific positions based on the actionid.

Last but not least, you can define the corpse as a teleport and then set a specific position on it via
Really nice and professional answer (y)
 
Back
Top