Primeiro va na pasta do seu ot e va em data/npc/scripts
Copie e cole o seller como bloco de notas na mesma pasta so mudar o nome se vc quiser que o nome seja Vendedor se poe vendedor...ai vai estar assim:
focus = 0
talk_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 sell ropes (50gps), shovels (20gps), backpacks (10gps), manafluids (100gps), lifefluids (60gps) and fishing rods (100gps). I buy vials (10gps).')
focus = cid
talk_start = os.clock()
elseif 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.')
elseif msgcontains(msg, 'rope') and focus == cid then
buy(cid,2941,1,50)
talk_start = os.clock()
elseif msgcontains(msg, 'shovel') and focus == cid then
buy(cid,3395,1,20)
talk_start = os.clock()
elseif msgcontains(msg, 'backpack') and focus == cid then
buy(cid,2792,1,10)
talk_start = os.clock()
elseif msgcontains(msg, 'manafluid') or msgcontains(msg, 'mana fluid') and focus == cid then
buy(cid,2812,7,100)
talk_start = os.clock()
elseif msgcontains(msg, 'lifefluid') or msgcontains(msg, 'life fluid') and focus == cid then
buy(cid,2812,10,60)
talk_start = os.clock()
elseif msgcontains(msg, 'fishing rod') and focus == cid then
buy(cid,3421,1,100)
talk_start = os.clock()
elseif (msgcontains(msg, 'vial') or msgcontains(msg, 'flask')) and focus == cid then
sell(cid,2812,1,10)
talk_start = os.clock()
elseif 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
Agora faca assim:
elseif msgcontains(msg, 'rope') and focus == cid then
buy(cid,2941,1,50)
talk_start = os.clock()
Ai vc quer vende crown armor vc vai la em rope e muda por crown armor e aonde ta buy(cid,<span style='color:red'>2941</span>,1,50) vc poe o ID da crown armor
para funcionar procure a frase
I sell ropes (50gps), shovels (20gps), backpacks (10gps), manafluids (100gps), lifefluids (60gps) and fishing rods (100gps). I buy vials (10gps).')
E mude por
I sell crown armor (10k), shovels (20gps), backpacks (10gps), manafluids (100gps), lifefluids (60gps) and fishing rods (100gps). I buy vials (10gps).')
E assim vai =D
ai se vai mudando todos
Para por ele no mapa vc vai em
World/npc.xml
Abra-o como bloco de notas
Vai estar por exemplo assim:
Voce adiciona o seu tipo
Creditos: GM Rotciv, eu
otimo tuto mas veio meu n tem o world/npc n tem qq eu faço??????
info
Group: Campones
Joined: 28/05/07
Posts: 14
Reputation: 0
otimo tuto mas veio meu n tem o world/npc n tem qq eu faço??????