Bom primeiro eu gostaria de falar que to parado faz um tempo, ou seja, nao tenho certeza se tá 100%! Pra todas as versões e pá, se não estiver 100%, gostaria que me corrigissem! Obg!
Beem vamos lá!
1° passo: vá na pasta OT/data/npc
ai, você copia uma .xml dali e cola. renomeie para Healer e fexa!
dentro dele coloque:
<?xml version="1.0"?>
<npc name="Healer" script="data/npc/scripts/heal.lua" access="3" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="128" head="67" body="48" legs="1" feet="91"/>
</npc>
feito isso,fexa e salva.
2° passo: vá para OT/data/npc/scripts
ai, você novamente deve copiar um .xml e colar. renomeando-o para heal e coolocando isso dentro :
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
end
function onCreatureTurn(creature)
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 5 then
selfSay('Olá ' .. creatureGetName(cid) .. '!')
focus = cid
talk_start = os.clock()
elseif (string.find(msg, '(%a*)bye(%a*)') and focus ~= 0) then
selfSay('Tchau,Tchau ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
elseif (string.find(msg, '(%a*)heal(%a*)') and focus ~= 0) then
if getPlayerHealth(cid) <= 149 then
heal(cid, 150)
else
selfSay('I cannot heal you.')
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Tchau!.')
focus = 0
end
end
end
explicando:
vermelho: é o que o cara vai falar depois do hi para ser healado!
verde: ele tem menos que esta quantia de hp para poder ser healado. exemplo: se ali estiver 260 e o cara falar heal com 261 de hp ele não vai ser healado!
rosa: é a vida que o cara vai ficar depois de ser healado.
3° passo:
bem, o terceiro passo depende do seu OT, alguns OT's não precisa mas alguns sim.
vá para: OT/data/world
e procure ou test-spawn.xml ou npc.xml
dê ctrl + f e procure "Mad" e abaixo dele coloque o que está em negrito:
</spawn><spawn centerx="121" centery="57" centerz="5" radius="5">
<npc name="Mad" x="1" y="0"/>
</spawn>
<spawn centerx="154" centery="95" centerz="7" radius="5">
<npc name="Healer" x="1" y="0"/>
bem: no centerx, centery e centerz coloque as cordenadas de onde você quer que seu healer fique.
e é isso.
agradeço estarem lendo e gostaria de ler muitos comentários com criticas,sugestões e correções.
espero ter lhes ajudado!