http://www.xtibia.com/forum/index.php?show...mp;#entry350484
Tae mano um tuto sobre isso. =D
Por alysonmendes, 12 de mar. de 2008 em NPCs, monsters e raids
info
Grupo: Conde
Registrado: 06/08/06
Posts: 554
Reputação: +223
Char no Tibia: Balacky

info
Grupo: Campones
Registrado: 03/02/08
Posts: 18
Reputação: +1
Char no Tibia: Ysuldur

<?xml version="1.0"?>
<npc name="Pug, O Reparador" script="data/npc/scripts/soft.lua" access="3" lookdir="1" autowalk="25">
<health now="1" max="1"/>
<look type="57" head="20" body="30" legs="40" feet="50" corpse="3128"/>
</npc>
local focus = 0local talk_start = 0
local target = 0
local following = false
local 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 (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Ola ' .. getCreatureName(cid) .. '! Eu posso reparar Soft Boots por 10k.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'soft boots') then
selfSay('Eu não vendo as botas apenas reparo, se você quiser repará-las diga: Repair.')
elseif msgcontains(msg, 'yes') then
selfSay('Se quiser reparar suas Soft Boots diga: Repair.')
elseif msgcontains(msg, 'repair') then
if doPlayerRemoveItem(cid,6530,1) == 0 or doPlayerRemoveMoney(cid,10000) == 0 then
selfSay('Desculpe, você não tem uma soft boots usada ou 10k.')
else
doPlayerAddItem(cid,6132,1)
selfSay('Pronto! Aqui estao suas botas reparadas.')
end
elseif msgcontains(msg, 'bye') and focus == cid and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 20 then
if focus > 0 then
selfSay('...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('...')
focus = 0
end
end
end
tenta ae ja ta pronto tirei algumas flas entao talvez de error ;p
creditos thyranic
Cya
info
Grupo: Campones
Registrado: 11/12/07
Posts: 31
Reputação: 0
Char no Tibia: Alyson Da Tropa De Elite
Algem pode mim dizer onde tem npc de soft boolts
q naum to encontrando plz