MoveEvent Jump over gaps

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,168
Best answers
9
Reaction score
1,011
Location
Germany :O
Hello Guys.

•¤•Description:•¤•
With this scripts you can make players just over special gaps in mountains.
Only if the player uses speed editing items or utani gran hur.
Script like : Troll Sabotage Quest/Spoiler - TibiaWiki - Quests, Items, Spells, and more

•¤•The Code:•¤•

Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local actionid = {first=110,second=111}
	if isPlayer(cid) == TRUE then
		local constants = {getPlayerLevel(cid),getCreatureSpeed(cid)} -- don't change (actually no constants lol xD)
		local config = {from={x=1035,y=1042,z=8,id=actionid.first},to={x=1035,y=1046,z=8,id=actionid.second}} --enter the position where to jump(to) and back(from)
		local formula = 220+(2*(tonumber(constants[1])-1)) --don't change
		if formula < constants[2] then
			if (config.from.x == config.to.x or config.from.y == config.to.y) and config.from.z == config.to.z then
				if item.actionid == config.from.id then
					doTeleportThing(cid,config.to)
				else
					doTeleportThing(cid,config.from)					
				end
				doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You jumped over the gap.")
				doSendMagicEffect({x=config.from.x, y=config.from.y, z=config.from.z}, CONST_ME_POFF)
				if config.from.x == config.to.x then
					for a = config.from.x,config.to.x do
						for b = config.from.y+1,config.to.y-1 do
							doSendMagicEffect({x=a,y=b,z=config.to.z}, CONST_ME_POFF)
						end
					end
				else
					for a = config.from.x+1,config.to.x-1 do
						for b = config.from.y,config.to.y do
							doSendMagicEffect({x=a,y=b,z=config.to.z}, CONST_ME_POFF)
						end
					end
				end
			else
				doPlayerSay(cid,"Something is wrong with the positions.They must be on the same floor and the need to be on 1 line.",1)
			end
		else
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You didn't dare to jump.")
			doTeleportThing(cid, fromPosition, false)
			doSendMagicEffect(fromPosition, CONST_ME_POFF)
		end
	end
	return true
end
•¤•Setting up:•¤•


The picture shows how the gap must be organized. The point you want to jump from may not be diagonal to the other point.

Place a item 460 ([red sqaures]) next to the two positions yellow and blue squares. The item 460 which is more north or more west in the map you add the actionid which you set in "actionid.first" and the item 460 which is more south or more east you add the actionid which you set to "actionid.second".

•¤•Example:•¤•
Code:
[/SIZE]
local actionid = {first=110,second=111}
So you need to add actionid 110 to the grey-circled one and actionid 111 to the green-circled one.

•¤•Configuration:•¤•

local config = {from={x=1035,y=1042,z=8,id=actionid.first},to=x=1035,y=1046,z=8,id=actionid.second}}

The position next to "actionid.first", you set in "config.from" and the position next to the item, which you added "actionid.second" to, you set as "config.to".

•¤•Look(Effect):•¤•

Effects look similar to this.
Effects appear automatically if everything is set up right.

•¤•Modifications:•¤•
If you don't want it to be necessary to the player to have speed up items or spells use this part:

Replace:
Code:
if formula < constants[2] then
with:
Code:
if formula < (formula+1) then
Of course this is not the best way to solve this problem, you could just leave this condition out, but for beginners it's easier this way.

•¤•Credits:•¤•
~Me
~Real Tibia as always xD
~TibiaWiki - Quests, Items, Spells, and more regarding the picture of the jump

•¤•Rep+ if you like it or use it.•¤•
 
Last edited:

frankfarmer

who'r ninja now
Joined
Aug 5, 2008
Messages
1,472
Best answers
0
Reaction score
30
Location
swe?
You did not do this?

Balanar on OT*ans did it
 
OP
Summ

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,168
Best answers
9
Reaction score
1,011
Location
Germany :O
@frankfarmer
Ye, I would agree to you if Balanar wasn't me.. But I am Balanar.
If you don't trust me go to the post of Balanar at ot*ans and read the last line of the code there.
It will be:
Code:
end --RhuX
to prove that I am him.
 

Nacke

New Member
Joined
Feb 13, 2008
Messages
79
Best answers
0
Reaction score
0
movement

movement type please?

PHP:
<movevent type="StepIn" actionid="110" event="script" value="troll_sabotage.lua"/>
<movevent type="StepIn" actionid="111" event="script" value="troll_sabotage.lua"/>
give error in console[error - movemeents::executestep] call stack overlow

Debug Why?please reply

using tfs 0.3.6
 
Last edited:

Qbee

Open Tibia Fan
Joined
Mar 9, 2009
Messages
174
Best answers
0
Reaction score
4
It doesn't look like in this pic! It look's like this:



To make it look like :


you need to add

Code:
doSendMagicEffect({x=config.from.x,y=config.from.y,z=config.from.z,},2)
after :
Code:
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You jumped over the gap.")
 
Last edited:
OP
Summ

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,168
Best answers
9
Reaction score
1,011
Location
Germany :O
Just checked my old posts :D
Thanks for small tweak.
 

muphet

New Member
Joined
Apr 27, 2008
Messages
233
Best answers
0
Reaction score
2
you can also place invicible ground and make it teleport you anywhere + onStep function that shows puffs anywhere you want. Simpler, faster and you don't need to run into it.
 
OP
Summ

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,168
Best answers
9
Reaction score
1,011
Location
Germany :O
As you may notice there is invisible ground, also it is like 2 years old and certainly I was kind of begginer at that time.
 

soul4soul

Active Member
Joined
Aug 13, 2007
Messages
1,787
Best answers
0
Reaction score
43
Location
USA
even if its an old script that can be updated its still cool. I know its not a hard script but this is the first time iv seen it coded for an OT
 
OP
Summ

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,168
Best answers
9
Reaction score
1,011
Location
Germany :O
It is even cool if it is not updated ;>
 

Athenuz

Owlz!
Joined
Oct 1, 2015
Messages
234
Best answers
0
Reaction score
26
Location
México
Hello Guys.

•¤•Description:•¤•
With this scripts you can make players just over special gaps in mountains.
Only if the player uses speed editing items or utani gran hur.
Script like : Troll Sabotage Quest/Spoiler - TibiaWiki - Quests, Items, Spells, and more

•¤•The Code:•¤•

Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local actionid = {first=110,second=111}
    if isPlayer(cid) == TRUE then
        local constants = {getPlayerLevel(cid),getCreatureSpeed(cid)} -- don't change (actually no constants lol xD)
        local config = {from={x=1035,y=1042,z=8,id=actionid.first},to={x=1035,y=1046,z=8,id=actionid.second}} --enter the position where to jump(to) and back(from)
        local formula = 220+(2*(tonumber(constants[1])-1)) --don't change
        if formula < constants[2] then
            if (config.from.x == config.to.x or config.from.y == config.to.y) and config.from.z == config.to.z then
                if item.actionid == config.from.id then
                    doTeleportThing(cid,config.to)
                else
                    doTeleportThing(cid,config.from)                   
                end
                doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You jumped over the gap.")
                doSendMagicEffect({x=config.from.x, y=config.from.y, z=config.from.z}, CONST_ME_POFF)
                if config.from.x == config.to.x then
                    for a = config.from.x,config.to.x do
                        for b = config.from.y+1,config.to.y-1 do
                            doSendMagicEffect({x=a,y=b,z=config.to.z}, CONST_ME_POFF)
                        end
                    end
                else
                    for a = config.from.x+1,config.to.x-1 do
                        for b = config.from.y,config.to.y do
                            doSendMagicEffect({x=a,y=b,z=config.to.z}, CONST_ME_POFF)
                        end
                    end
                end
            else
                doPlayerSay(cid,"Something is wrong with the positions.They must be on the same floor and the need to be on 1 line.",1)
            end
        else
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You didn't dare to jump.")
            doTeleportThing(cid, fromPosition, false)
            doSendMagicEffect(fromPosition, CONST_ME_POFF)
        end
    end
    return true
end
•¤•Setting up:•¤•


The picture shows how the gap must be organized. The point you want to jump from may not be diagonal to the other point.

Place a item 460 ([red sqaures]) next to the two positions yellow and blue squares. The item 460 which is more north or more west in the map you add the actionid which you set in "actionid.first" and the item 460 which is more south or more east you add the actionid which you set to "actionid.second".

•¤•Example:•¤•
Code:
[/SIZE]
local actionid = {first=110,second=111}
So you need to add actionid 110 to the grey-circled one and actionid 111 to the green-circled one.

•¤•Configuration:•¤•

local config = {from={x=1035,y=1042,z=8,id=actionid.first},to=x=1035,y=1046,z=8,id=actionid.second}}

The position next to "actionid.first", you set in "config.from" and the position next to the item, which you added "actionid.second" to, you set as "config.to".

•¤•Look(Effect):•¤•

Effects look similar to this.
Effects appear automatically if everything is set up right.

•¤•Modifications:•¤•
If you don't want it to be necessary to the player to have speed up items or spells use this part:

Replace:
Code:
if formula < constants[2] then
with:
Code:
if formula < (formula+1) then
Of course this is not the best way to solve this problem, you could just leave this condition out, but for beginners it's easier this way.

•¤•Credits:•¤•
~Me
~Real Tibia as always xD
~TibiaWiki - Quests, Items, Spells, and more regarding the picture of the jump

•¤•Rep+ if you like it or use it.•¤•
Awesome script!
Please can you upgrade it to 1.x tfs?
 
Top