eh o seguinte!
abra um arquivo XML
e coloque o seguinte:
<?xml version="1.0"?><npc name="Fargum" script="data/npc/scripts/boat_city.lua" access="3" lookdir="2"> <mana now="800" max="800"/> <health now="200" max="200"/> <look type="129" head="114" body="119" legs="114" feet="114"/></npc>
Explicação:
npc name="Fargum" --> Local que você coloca o nome do NPC entre os ""
<look type="129" --> onde ta esse 129, você pode por qualquer número...exemplo, se você colocar 35, o NPC vai ficar com formato de Demon, se não me engano!
script="data/npc/scripts/nome.lua" --> local em que o script está
Agora crie um arquivo lua e coloque dentro da pasta NPC -> Scripts
abra o arquivo lua e coloque:
focus = 0talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello ' .. creatureGetName(cid) .. '! I can take you to Dragon Land (50gps). Where do you want to go?')
focus = cid
talk_start = os.clock()
end
if string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')
end
if msgcontains(msg, 'dragon land') and focus == cid then
if pay(cid,50) then
selfSay('Let\'s go!')
selfSay('/send ' .. creatureGetName(cid) .. ', 122 119 7')
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
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('Good bye then.')
focus = 0
end
end
end
Onde está em Laranja eh a palavra em que o player tem que falar para pode viajar entre ''
no caso do exemplo ele tem que falar 'dragon land'
onde ta em Verde eh o preço da passagem... ou seja o 50 eh o preço da passagem..50 gps, mude para quanto voce quiser! sempre deixando o preço em gps! exemplo, se voce quiser colocar o preço em 1k...coloque 1000 gps
onde está em Azul eh para onde o player vai ser enviado!
selfSay('/send ' .. creatureGetName(cid) .. ', 122 119 7')
o 122 119 7 sao as cordenadas...você muda a seu gosto!
Espero ter ajudado
GM Rotciv