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

Trap bomb - TFS 0.3.6

Carlitos Flow

Developer (lvl*1)
Joined
Mar 2, 2011
Messages
156
Solutions
4
Reaction score
10
Sup guys, im trying to create a spell for a monster than works like a mortal trap, and it need have a count left of 5 seconds, the monster can't move (because only works like a trap. Example. "5, 4, 3, 2, 1" and then the area of the attack. It could work with addEvent, anyone can help me please? (also the interval of the monster could be 5000 and chance 999 to the explode each 5 seconds with the timer)
Lua:
AREA_TRAP = {
    {0, 0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 1, 0, 0, 0},
    {1, 1, 1, 1, 3, 1, 1, 1},
    {0, 0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 1, 0, 0, 0}
}

Sorry for bad english, thanks!

Bump!

Bump, anyone can move this post to request please

Thanks for move! Bump
 
Last edited by a moderator:
You need to read the rules; Rules for the Support board
What is mortal trap?
The "count left" pretty much only work with 0.3 & 0.4? unless you do source edits (atleast with 1.x, not 100% on 0.2)

And FYI if you want quick help write as much as you can, server info, if you have done any mods etc etc
 
You need to read the rules; Rules for the Support board
What is mortal trap?
The "count left" pretty much only work with 0.3 & 0.4? unless you do source edits (atleast with 1.x, not 100% on 0.2)

And FYI if you want quick help write as much as you can, server info, if you have done any mods etc etc
Hello, thanks for answer.
Look minute 20:05, thats i need, if player step when create the spell are he will dead only 1 shoot.
 
Hello, thanks for answer.
Look minute 20:05, thats i need, if player step when create the spell are he will dead only 1 shoot.

So it should remove the monster? Or does it happen after 20:05?
To make the monster not movable you can use this; forgottenserver036pl1/luascript.cpp at master · peonso/forgottenserver036pl1 · GitHub
Then as you said use addEvent with an interval of 1 sec? when it has been executed 5 times use doCreatureSetNoMove again to make the monster movable again.
But we also have to loop the area since im guessing the "poff" effects is where monsters can get trapped?

Try to implement this into your spell or talkaction;
Lua:
local function showTimer(monster, times, position)
    doSendAnimatedText(position, times, TEXTCOLOR_BLUE)
    if times == 5 then
        doCreatureSetNoMove(monster, false)
        return true
    end

    addEvent(showTimer, 1000, times, position)
end

local monsters = -- use the area or getSpectators
for _, monster in pairs(monsters) do
    if isMonster(monster) then
        doCreatureSetNoMove(monster, true)
        showTimer(monster, 5, getCreaturePosition(monster))
    end
end

That code will loop monsters, check if it's a monster if it is then it will make the monster not movable, use an addEvent function to print the time left, once 5 sec has passed it will make the monster movable again.
 
So it should remove the monster? Or does it happen after 20:05?
To make the monster not movable you can use this; forgottenserver036pl1/luascript.cpp at master · peonso/forgottenserver036pl1 · GitHub
Then as you said use addEvent with an interval of 1 sec? when it has been executed 5 times use doCreatureSetNoMove again to make the monster movable again.
But we also have to loop the area since im guessing the "poff" effects is where monsters can get trapped?

Try to implement this into your spell or talkaction;
Lua:
local function showTimer(monster, times, position)
    doSendAnimatedText(position, times, TEXTCOLOR_BLUE)
    if times == 5 then
        doCreatureSetNoMove(monster, false)
        return true
    end

    addEvent(showTimer, 1000, times, position)
end

local monsters = -- use the area or getSpectators
for _, monster in pairs(monsters) do
    if isMonster(monster) then
        doCreatureSetNoMove(monster, true)
        showTimer(monster, 5, getCreaturePosition(monster))
    end
end

That code will loop monsters, check if it's a monster if it is then it will make the monster not movable, use an addEvent function to print the time left, once 5 sec has passed it will make the monster movable again.
But are you talking of the trap? The Gray cubes that creates a line of attack in the shape of a cross.
My idea is that the gray cube, could be any monster and from the xml of the monster would set that is a creature that does not move. So... The spell is what I need, the monster counts 5, 4, 3, 2, 1 and then "Boom" and at the same time create the attack of area in cross that kill of 1 hit if someone is in the position of the cross when activated.
 
But are you talking of the trap? The Gray cubes that creates a line of attack in the shape of a cross.
My idea is that the gray cube, could be any monster and from the xml of the monster would set that is a creature that does not move. So... The spell is what I need, the monster counts 5, 4, 3, 2, 1 and then "Boom" and at the same time create the attack of area in cross that kill of 1 hit if someone is in the position of the cross when activated.

Can you try to explain it abit better if this is wrong;
The player casts a spell, then the effects comes, if a monster is in that area the monster is one hitted?
Or does the player use the item in the middle of the cross?
Is it only one type of monster that can be killd with that spell?

But you talked about making the player not movable, but then you want the monster to be killd?
 
Can you try to explain it abit better if this is wrong;
The player casts a spell, then the effects comes, if a monster is in that area the monster is one hitted?
Or does the player use the item in the middle of the cross?
Is it only one type of monster that can be killd with that spell?

But you talked about making the player not movable, but then you want the monster to be killd?
[Google translator]
No, it is actually a monster that can not move, that is set from the xml of the monster by setting speed to 0. (Because this is only a trap). I am talking about the rock on the video that falls to the floor and makes an area effect in the form of a cross, if the player is in that position of the cross at the time the rock falls to the floor, the player will die one hit. Since tibia does not have this sprite of rock falling to the floor, I thought that it was any item, that will send magictext in a count of 5 to 1 and then "BOOOMB" and at the same time create the area of the cross that would kill To the player of a hit if he is in the position of the cross.
 
So the "cube" or w/e you wanna call it in the middle (center of the cross effect) is a monster, not an item?

You might have better luck here; Native Chatboards
Im kinda lost haha
 
So the "cube" or w/e you wanna call it in the middle (center of the cross effect) is a monster, not an item?

You might have better luck here; Native Chatboards
Im kinda lost haha
Yep the cube makes the area of cross effect. (Ofc its not a monster, its like a trap) But for my server it could works like a monster, do u understand now ? xD
 
Back
Top