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

MoveEvent Tomb Scarab Coin Teleport.

QuaS

Cykotitan Pwned =/
Joined
Sep 11, 2008
Messages
838
Reaction score
28
Location
Poland/ Wroclaw
1124g7a.jpg


Code:
function onAddItem(moveitem, tileitem, pos, cid)
	local coins = {
			[13100] = {frompos = {x= 33276,y= 32553,z = 13}, topos = {x= 33271,y= 32553,z = 13}},
			[13101] = {frompos = {x= 33234,y= 32692,z = 13}, topos = {x= 33234,y= 32688,z = 13}},
			[13102] = {frompos = {x= 33293,y= 32742,z = 13}, topos = {x= 33299,y= 32742,z = 13}},
			[13103] = {frompos = {x= 33240,y= 32856,z = 13}, topos = {x= 33250,y= 32867,z = 13}},
			[13104] = {frompos = {x= 33163,y= 32831,z = 10}, topos = {x= 33156,y= 32832,z = 10}},
			[13105] = {frompos = {x= 33097,y= 32816,z = 13}, topos = {x= 33093,y= 32824,z = 13}},
			[13106] = {frompos = {x= 33135,y= 32683,z = 12}, topos = {x= 33130,y= 32683,z = 12}},
			[13107] = {frompos = {x= 33073,y= 32590,z = 13}, topos = {x= 33079,y= 32589,z = 13}}
			
			}
    if moveitem.itemid == 2159 then 
		doRemoveItem(moveitem.uid)
		doSendMagicEffect(pos, 15)
		doSendMagicEffect(coins[tileitem.actionid].frompos, CONST_ME_TELEPORT)
		doSendMagicEffect(coins[tileitem.actionid].topos, CONST_ME_TELEPORT)
        doRelocate(coins[tileitem.actionid].frompos,coins[tileitem.actionid].topos)
    end
    return TRUE
end 

function onStepIn(cid, item, position, fromPosition)
local back_n = {
		[13108] = {x=33292,y=32742,z=13},
		[13109] = {x=33234,y=32693,z=13},
		[13110] = {x=33136,y=32683,z=12},
		[13111] = {x=33072,y=32590,z=13},
		[13112] = {x=33097,y=32815,z=13},
		[13113] = {x=33239,y=32856,z=13},
		[13114] = {x=33161,y=32832,z=10},
		[13115] = {x=33277,y=32553,z=14}
		}
	doSendMagicEffect(position, 10)
	doRelocate(position,back_n[item.actionid])
	doSendMagicEffect(back_n[item.actionid], 10)
return true
end

PHP:
	<!-- Scarab Coin -->
  	<movevent type="AddItem" tileitem="1" fromaid="13100" toaid ="13107" event="script" value="coin.lua"/>  
	<movevent type="StepIn" fromaid="13108" toaid="13115" event="script" value="coin.lua"/>

Explaination:
Lua:
Teleport In:
	local coins = {--[CoalBasin AID] = {frompos = [mystic_flame_pos], topos = [Where teleport player(and items below him)]}
			[13100] = {frompos = {x= 33276,y= 32553,z = 13}, topos = {x= 33271,y= 32553,z = 13}},
			[13101] = {frompos = {x= 33234,y= 32692,z = 13}, topos = {x= 33234,y= 32688,z = 13}},
			[13102] = {frompos = {x= 33293,y= 32742,z = 13}, topos = {x= 33299,y= 32742,z = 13}},
			[13103] = {frompos = {x= 33240,y= 32856,z = 13}, topos = {x= 33250,y= 32867,z = 13}},
			[13104] = {frompos = {x= 33163,y= 32831,z = 10}, topos = {x= 33156,y= 32832,z = 10}},
			[13105] = {frompos = {x= 33097,y= 32816,z = 13}, topos = {x= 33093,y= 32824,z = 13}},
			[13106] = {frompos = {x= 33135,y= 32683,z = 12}, topos = {x= 33130,y= 32683,z = 12}},
			[13107] = {frompos = {x= 33073,y= 32590,z = 13}, topos = {x= 33079,y= 32589,z = 13}}
			
			}

Teleport Out:
local back_n = {--[AID_of_mystic_flame_to_back(right one on png)] = Pos_To_TP. (red arrow)
		[13108] = {x=33292,y=32742,z=13},
		[13109] = {x=33234,y=32693,z=13},
		[13110] = {x=33136,y=32683,z=12},
		[13111] = {x=33072,y=32590,z=13},
		[13112] = {x=33097,y=32815,z=13},
		[13113] = {x=33239,y=32856,z=13},
		[13114] = {x=33161,y=32832,z=10},
		[13115] = {x=33277,y=32553,z=14}
		}
 
Last edited:
use notepad++ and the tab button in ur keyboard next time plz
 
use notepad++ and the tab button in ur keyboard next time plz
Lua:
 tags break tabs -.- (convert to spaces)

#quas
In onStepIn, you should check if coin exists :p

[quote="Northnorial, post: 792557"]Could anyone explain how does it work?[/QUOTE]
ATM you would get teleported even without placing a coin on the coal basin.
 
@Cykotitan

<with this proud in eyes> You're Wrong! xD

onAddItem Teleports Player In. StepIn teleports players Out xD. Look:

1124g7a.jpg

yellow/green is AddItem and teleports in all from left mystic flame.
red teleports all from right mystic flame.

But ye i will explain this in 1st post
 
in real tibia you get teleported at same time you throw the coin, so why...

function onStepIn

if you have ...

onAddItem(moveitem, tileitem, pos, cid)

?_?
 
Back
Top