Novo Sistema De Treiner

kkk111
Por kkk111
em Actions e Talkactions

kkk111

LOL?
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/08/07Posts: 27

*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:

É por isso que eu gosto de ajudar (pelo menos tentar ajudar) este fórum, os caras sabe Agradecer né?

 

 

Att,

PẫulǾ

paulo.boc@hotmail.com

mekyz

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 08/09/07Posts: 113Char no Tibia: Brozy

Nss!.. Isso vai me ajudar!..

Vou testa-lo no meu OT!..

Otimo trabalhoo!..

 

Atenciosamente Mekyz!..

É meu Fan!? Então Use:


Eu sou Fan:




Meus Trabalhos:
PvP Enforced 8.1

My Sign:


Copyright © 2008 Mekyz, All rights reserved.

PauloHen

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 15/07/08Posts: 2

Eu ja testei aqui deu certinho

 

Tyyyyyyyyyyyy

Johnnn

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/10/07Posts: 70

Rox...testei e deu certo muito bom!!!

_______
Johnnn

wedneyyuri

·•·•Ẅ€ďn€¥ ¥µ®¡•·•·
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 04/06/08Posts: 95Char no Tibia: ~Nosbor Peck~

Very very Rox ^^

FelipeAugustoGuimaraesGome

Eu??
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 30/06/08Posts: 117Char no Tibia: Menor De Rook

Cara Muito criativo Very RoX!²

 

--------------------------------------------------------------------------------

Assinatura

 

fanbarlo0.png

 

Minha Fan Bar Te ajudei? Entao Use

furiavr

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 27/04/08Posts: 156Char no Tibia: Retired!

Poo ideia bem criativa...vo colokar no meu ot^^ flwxx vlww