Ir para conteúdo

Npc Que Vende Bp's De Runas


Guuh23

Posts Recomendados

Ai galera venho aqui encinar como fazer um npc que vende runas...

 

*** BOM VAMOS LAH ***

 

1- vai ateh sua pasta de ot.. depois data e npc.. copia e cola um arquivo .xml

2- renomeie ele para Vendo bp de runas

3- abra ele, apague tudo que esta lah.. e copie isso:

 

 

<?xml version="1.0"?>

<npc name="Vendo bp de runas" script="data/npc/scripts/bp_runes.lua" access="3">

<look type="19" head="78" body="71" legs="82" feet="114"/>

</npc>

 

 

4- fexe, e salve

5- agora va na pasta Script (dentro da NPC)

6- Copie e cole um arquivo .lua

7- renomeie para bp_runes

8- abra.. apague tudo que tem dentro e coloque:

QUOTE

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) < 3 then

selfSay('Olá ' .. creatureGetName(cid) .. '! Eu vendo bps de runas e runas separadas.')

focus = cid

talk_start = os.clock()

 

elseif string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 3 then

selfSay('Desculpe, ' .. creatureGetName(cid) .. '! Eu falo com você em um minuto.')

 

elseif msgcontains(msg, 'bps') and focus == cid then

selfSay('Eu vendo bps de 10, 50 e de 100 cargas! Diga ( "bp" e a quantidade ) para ver o preço, ex: "bp 10".')

talk_start = os.clock()

 

elseif msgcontains(msg, 'runas') and focus == cid then

selfSay('Eu vendo runas de 10, 50 e de 100 cargas! Diga ( "runa" e a quantidade) para ver o preço, ex: "runa 10".')

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp 10') and focus == cid then

selfSay('Eu vendo bps de hmm 10x (100gps), gfb 10x (200gps), explosion 10x (400gps), uh 10x (600gps), sd 10x (800gps).')

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp 50') and focus == cid then

selfSay('Eu vendo bps de hmm 50x (500gps), gfb 50x (1k), explosion 50x (2k), uh 50x (3k), sd 50x (4k).')

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp 100') and focus == cid then

selfSay('Eu vendo bps de hmm 100x (1k), gfb 100x (2k), explosion 100x (4k), uh 100x (6k), sd 100x (8k).')

talk_start = os.clock()

 

elseif msgcontains(msg, 'runa 10') and focus == cid then

selfSay('Eu vendo runas de hmm 10x (5gps), gfb 10x (10gps), explosion 10x (20gps), uh 10x (30gps), sd 10x (40gps).')

talk_start = os.clock()

 

elseif msgcontains(msg, 'runa 50') and focus == cid then

selfSay('Eu vendo runas de hmm 50x (25gps), gfb 50x (50gps), explosion 50x (100gps), uh 50x (150gps), sd 50x (200gps).')

talk_start = os.clock()

 

elseif msgcontains(msg, 'runa 100') and focus == cid then

selfSay('Eu vendo bps de hmm 100x (50gps), gfb 100x (100gps), explosion 100x (200gps), uh 100x (300), sd 100x (400).')

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp hmm 10') and focus == cid then

buy(cid,2805,1,100)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

buy(cid,3136,10,0)

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp hmm 50') and focus == cid then

buy(cid,2805,1,500)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

buy(cid,3136,50,0)

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp hmm 100') and focus == cid then

buy(cid,2805,1,1000)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

buy(cid,3136,100,0)

talk_start = os.clock()

 

elseif msgcontains(msg, '10 hmm') and focus == cid then

buy(cid,3136,10,5)

talk_start = os.clock()

elseif msgcontains(msg, '50 hmm') and focus == cid then

buy(cid,3136,50,25)

talk_start = os.clock()

 

elseif msgcontains(msg, '100 hmm') and focus == cid then

buy(cid,3136,100,50)

talk_start = os.clock()

 

 

elseif msgcontains(msg, 'bp gfb 10') and focus == cid then

buy(cid,2805,1,200)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

buy(cid,3129,10,0)

talk_start = os.clock()

 

 

elseif msgcontains(msg, 'bp gfb 50') and focus == cid then

buy(cid,2805,1,1000)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

buy(cid,3129,50,0)

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp gfb 100') and focus == cid then

buy(cid,2805,1,2000)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

buy(cid,3129,100,0)

talk_start = os.clock()

 

elseif msgcontains(msg, '10 gfb') and focus == cid then

buy(cid,3129,10,10)

talk_start = os.clock()

elseif msgcontains(msg, '50 gfb') and focus == cid then

buy(cid,3129,50,50)

talk_start = os.clock()

 

elseif msgcontains(msg, '100 gfb') and focus == cid then

buy(cid,3129,100,100)

talk_start = os.clock()

 

 

elseif msgcontains(msg, 'bp explosion 10') and focus == cid then

buy(cid,2805,1,400)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

buy(cid,3138,10,0)

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp explosion 50') and focus == cid then

buy(cid,2805,1,2000)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

buy(cid,3138,50,0)

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp explosion 100') and focus == cid then

 

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

buy(cid,3138,100,0)

talk_start = os.clock()

 

elseif msgcontains(msg, '10 explosion') and focus == cid then

buy(cid,3138,10,20)

talk_start = os.clock()

elseif msgcontains(msg, '50 explosion') and focus == cid then

buy(cid,3138,50,100)

talk_start = os.clock()

 

elseif msgcontains(msg, '100 explosion') and focus == cid then

buy(cid,3138,100,200)

talk_start = os.clock()

 

 

elseif msgcontains(msg, 'bp uh 10') and focus == cid then

buy(cid,2805,1,600)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

buy(cid,3098,10,0)

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp uh 50') and focus == cid then

buy(cid,2805,1,3000)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

buy(cid,3098,50,0)

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp uh 100') and focus == cid then

buy(cid,2805,1,6000)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

buy(cid,3098,100,0)

talk_start = os.clock()

 

elseif msgcontains(msg, '10 uh') and focus == cid then

buy(cid,3098,10,30)

talk_start = os.clock()

elseif msgcontains(msg, '50 uh') and focus == cid then

buy(cid,3098,50,150)

talk_start = os.clock()

 

elseif msgcontains(msg, '100 uh') and focus == cid then

buy(cid,3098,100,300)

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp sd 10') and focus == cid then

buy(cid,2805,1,800)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

buy(cid,3093,10,0)

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp sd 50') and focus == cid then

buy(cid,2805,1,4000)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

buy(cid,3093,50,0)

talk_start = os.clock()

 

elseif msgcontains(msg, 'bp sd 100') and focus == cid then

buy(cid,2805,1,8000)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

buy(cid,3093,100,0)

talk_start = os.clock()

 

elseif msgcontains(msg, '10 sd') and focus == cid then

buy(cid,3093,10,40)

talk_start = os.clock()

elseif msgcontains(msg, '50 sd') and focus == cid then

buy(cid,3093,50,200)

talk_start = os.clock()

 

elseif msgcontains(msg, '100 sd') and focus == cid then

buy(cid,3093,100,400)

talk_start = os.clock()

 

 

elseif msgcontains(msg, 'blank') and focus == cid then

buy(cid,3085,1,5)

talk_start = os.clock()

 

elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 3 then

selfSay('Até logo, ' .. 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('Próximo por favor...')

end

focus = 0

end

end

 

 

9- fexe e salve..

10- agora abre de novo seu server e pronto..

 

Bom galerinha e isso ai e grande mas vale a pena...

FUI...

Link para o comentário
Compartilhar em outros sites

  • 2 years later...
×
×
  • Criar Novo...