Ir para conteúdo

Npc Que Vende


Posts Recomendados

CREDITOS: god_roxinhu

*** 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- fexa, e salva

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:

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 di novo seu server e pronto..

EH GRANDINHO MAIS VALE A PENA.. DUVIDAS DEIXE SEU RECADO!

Link para o comentário
Compartilhar em outros sites

@foox

não é o primeiro!

@Tópico

Aprenda olhar na seção se já não ah um tópico sobre isto, e esses créditos são realmente seus?

certeza?

esta me parecendo cópia, mas não vou acusar pois não tenho como provar e mesmo assim é flood pois ja é existente e também é melhor explicado.

fuiz

Atenciosamente,

Sir Picaralhos.

Link para o comentário
Compartilhar em outros sites

@god_roxinhu

Realmente já existe um tópico igual ao seu..

De NPC's que vendem Runas..

http://www.xtibia.com/forum/index.php?showtopic=12199

Solicitamos ou explicação, ou que altere os créditos do post!!!!

E pedimos que preste mais atenção para não postar tutoriais já existentes no fórum. =)

Atenciosamente,

Chakaritas Jr

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...

Ae, os codigos estao configurados para 7.5 mas da pra entender vlw ae

ta manero...

mas tenho uma duvida..

sera q eu usar esse tipo de cod

mas nas actions

doPlayerAddItem, na hr de quest os itens vaum parecer dentro da bag ou da BP?

ou iraum aparecer fora...

to em duvida c alguem puder me ajuda tah...

Vlwwwww

Link para o comentário
Compartilhar em outros sites

@Tópico

Sim, existe outros post de um npc como este!

Acontece, que algumas pessoas pegam posts dos outros!

Como comigo! Pegaram meu MapEditor que eu fiz e apenas colocaram que fizeram... Moderador do post, mude os créditos!

Link para o comentário
Compartilhar em outros sites

  • 4 months later...
  • 2 weeks later...
  • 2 weeks later...
×
×
  • Criar Novo...