So, I made this training system for a friend, you can see what it does in this video:
YouTube - New Training System! OTServ
So lets get started
data/movements/movements.xml
data/movements/scripts/Training System.lua
Set it up like this:
[/URL]
Its not a hard script, but since Im still kinda noob at LUA it wasnt easy for me
Special thanks to Jano and Cyko, that made me understand how to fix one thing.
Enjoy!
YouTube - New Training System! OTServ
So lets get started
data/movements/movements.xml
XML:
<movevent type="StepIn" uniqueid="5000-5003" event="script" value="Training System.lua"/>
<movevent type="StepOut" uniqueid="5000-5003" event="script" value="Training System.lua"/>
data/movements/scripts/Training System.lua
Lua:
function onStepIn(cid, item, pos, fromPos)
local t = {
[5000]={{x=pos.x-1, y=pos.y+1, z=pos.z},{x=pos.x-1, y=pos.y-1, z=pos.z}},
[5001]={{x=pos.x+1, y=pos.y+1, z=pos.z},{x=pos.x+1, y=pos.y-1, z=pos.z}},
[5002]={{x=pos.x+1, y=pos.y-1, z=pos.z},{x=pos.x-1, y=pos.y-1, z=pos.z}},
[5003]={{x=pos.x+1, y=pos.y+1, z=pos.z},{x=pos.x-1, y=pos.y+1, z=pos.z}}
}
local v = t[item.uid]
if v then
doSummonCreature('training monk', v[1])
doSummonCreature('training monk', v[2])
doSendMagicEffect(v[1],CONST_ME_TELEPORT)
doSendMagicEffect(v[2],CONST_ME_TELEPORT)
end
end
function onStepOut(cid, item, pos)
local t = {
[5000]={{x=pos.x-1, y=pos.y+1, z=pos.z, stackpos = 253},{x=pos.x-1, y=pos.y-1, z=pos.z, stackpos = 253}},
[5001]={{x=pos.x+1, y=pos.y+1, z=pos.z, stackpos = 253},{x=pos.x+1, y=pos.y-1, z=pos.z, stackpos = 253}},
[5002]={{x=pos.x+1, y=pos.y-1, z=pos.z, stackpos = 253},{x=pos.x-1, y=pos.y-1, z=pos.z, stackpos = 253}},
[5003]={{x=pos.x+1, y=pos.y+1, z=pos.z, stackpos = 253},{x=pos.x-1, y=pos.y+1, z=pos.z, stackpos = 253}}
}
local v = t[item.uid]
if v then
doRemoveCreature(getThingfromPos(v[1]).uid)
doRemoveCreature(getThingFromPos(v[2]).uid)
doSendMagicEffect(v[1],CONST_ME_POFF)
doSendMagicEffect(v[2],CONST_ME_POFF)
end
end
Set it up like this:
Its not a hard script, but since Im still kinda noob at LUA it wasnt easy for me
Special thanks to Jano and Cyko, that made me understand how to fix one thing.
Enjoy!
Last edited: