*Fazer os treiner aparecer quando alguem vai treinar e sumir depois que sair ....
1-Vai em ....\data\movements\scripts
2-Crie um arquivo chamado train.lua com isso dentro
local Actionid = 20000 local MonsterName = "Training Monk" local Trash = {x = 969, y = 47, z = 7} function onStepIn(cid, item, pos) local delta = {} if (item.actionid == Actionid) then delta[1] = {x = -1, y = -1} delta[2] = {x = 1, y = -1} elseif (item.actionid == Actionid + 1) then delta[1] = {x = 1, y = -1} delta[2] = {x = 1, y = 1} elseif (item.actionid == Actionid + 2) then delta[1] = {x = 1, y = 1} delta[2] = {x = -1, y = 1} elseif (item.actionid == Actionid + 3) then delta[1] = {x = -1, y = 1} delta[2] = {x = -1, y = -1} end if (isPlayer(cid) == TRUE) then doSummonCreature(MonsterName, {x = pos.x + delta[1].x, y = pos.y + delta[1].y, z = pos.z}) doSummonCreature(MonsterName, {x = pos.x + delta[2].x, y = pos.y + delta[2].y, z = pos.z}) end return TRUE end function onStepOut(cid, item, pos) local delta = {} if (item.actionid == Actionid) then delta[1] = {x = -1, y = -1} delta[2] = {x = 1, y = -1} elseif (item.actionid == Actionid + 1) then delta[1] = {x = 1, y = -1} delta[2] = {x = 1, y = 1} elseif (item.actionid == Actionid + 2) then delta[1] = {x = 1, y = 1} delta[2] = {x = -1, y = 1} elseif (item.actionid == Actionid + 3) then delta[1] = {x = -1, y = 1} delta[2] = {x = -1, y = -1} end if (isPlayer(cid) == TRUE) then local monster1 = getThingfromPos({x = pos.x + delta[1].x, y = pos.y + delta[1].y, z = pos.z, stackpos = 253}) local monster2 = getThingfromPos({x = pos.x + delta[2].x, y = pos.y + delta[2].y, z = pos.z, stackpos = 253}) if ((isCreature(monster1.uid) == TRUE) and (isPlayer(monster1.uid) == FALSE)) then if (doRemoveCreature ~= nil) then doRemoveCreature(monster1.uid) else doTeleportThing(monster1.uid, Trash) end end if ((isCreature(monster2.uid) == TRUE) and (isPlayer(monster2.uid) == FALSE)) then if (doRemoveCreature ~= nil) then doRemoveCreature(monster2.uid) else doTeleportThing(monster2.uid, Trash) end end end return TRUE end
3-Vai em ....\data\movements\movements.xml
4-Coloque essa linhas..
<movevent event="StepIn" actionid="20000" script="train.lua" /> <movevent event="StepIn" actionid="20001" script="train.lua" /> <movevent event="StepIn" actionid="20002" script="train.lua" /> <movevent event="StepIn" actionid="20003" script="train.lua" /> <movevent event="StepOut" actionid="20000" script="train.lua" /> <movevent event="StepOut" actionid="20001" script="train.lua" /> <movevent event="StepOut" actionid="20002" script="train.lua" /> <movevent event="StepOut" actionid="20003" script="train.lua" />
Pronto..
5-Agora vai no Mapa Editor coloque os Action no pisos
Exemplo:
X = Treiner
A = Char
W = Divisa (pedra/poste)
.... = Espaço vazio
X w w
w A...
X w w
Action tem que ficar no piso que o char vai para treiner (A)
O numero Action é:
------------------------------------------------------------------
20000 =
X w X
w A w
w....w
20001 =
w w X
...A w
w w X
20002 =
w....w
w A w
X w X
20003 =
X w w
w A...
X w w
--------------------------------------------------------------------
6-LIXÃO = É uma area onde os treiner é teleportado depois que vc para de treinar , tem que ser longe de tudo os players nao pode ter acesso a essa area ok..
7-Coloque as coordenada dessa area que vc ja criou no script ....\data\movements\scripts\train.lua
Nesse caso ai é a area
---------------------------------------------------------------------
local Trash = {x = 969, y = 47, z = 7}
---------------------------------------------------------------------
8-Substitua pela coordenada do seu LIXÃO ...
Flw galera ....:icon1: