Ir para conteúdo

Npc Que Vende Bp De Itens


Guiniudes

Posts Recomendados

Bom estou postando aqui um npc feito por mim e ele vende bp de potions (TODAS) bp de assassin star 100x e bps de runes 100x(QUASE todas)

Para coloca-lo no seu server fassa o seguinte:Va na pasta NPC que fica dentro da pasta data do seu ot copia qualquer arquivo de la (menos a pasta script-.-) apaga tudo que tem renomeia para toony e poe isso dentro

<?xml version="1.0"?>

 

<npc name="Toony" script="data/npc/scripts/bp itens.lua" access="3" lookdir="2" autowalk="25">

<mana now="800" max="800"/>

<health now="200" max="200"/>

<look type="134" head="1" body="19" legs="19" feet="80" addons="2"/>

</npc>

Feito isso abra a pasta script que esta dentro da pasta NPC copie um arquivo qualquer renomeie ele para bp itens e apague tudo o que a dentro e ponha isso

local focus = 0

local 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('Adeus.')

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)

local msg = string.lower(msg)

 

if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) < 4 then

selfSay('Ola ' .. creatureGetName(cid) .. '! Eu vendo bp de runes, bp de assassin star (300k diga somentete bp star OBS:para paladins somente level 80 mais!) e de potions (para comprar diga bp uh (exemplo) bp ghp (exemplo).')

focus = cid

talk_start = os.clock()

 

elseif msgcontains(msg, 'hi') and focus ~= cid and getDistanceToCreature(cid) < 4 then

selfSay('Desculpe, ' .. creatureGetName(cid) .. '!Falo com você num minuto.')

 

elseif focus == cid then

talk_start = os.clock()

 

if msgcontains(msg, '90') then

 

selfSay('eu vendos bps de hmm (15k), bp uh (20k), bp gfb (20k), bp explosion (30kgp) e bp sd (50k).')

elseif msgcontains(msg, 'bp de runes') then

selfSay('Eu vendo bp mp (1k), bp hp (1k), bp smp (2k), bp shp (2k) bp gmp (3k) e bp ghp (3k).')

elseif msgcontains(msg, 'bp potions') then

 

 

 

elseif msgcontains(msg, 'bp sd') then

buyContainer(cid,2003,2268,100,40000)

 

elseif msgcontains(msg, 'bp mf') then

buyContainer(cid,2003,2006,7,10000)

 

elseif msgcontains(msg, 'bp explosion') then

buyContainer(cid,2000,2313,100,20000)

 

elseif msgcontains(msg, 'bp uh') then

buyContainer(cid,2002,2273,100,30000)

 

elseif msgcontains(msg, 'bp hmm') then

buyContainer(cid,2002,2311,100,15000)

 

elseif msgcontains(msg, 'bp gfb') then

buyContainer(cid,2000,2304,100,10000)

 

 

elseif msgcontains(msg, 'bp mp') then

buyContainer(cid,2002,7620,1,1000)

 

elseif msgcontains(msg, 'bp hp') then

buyContainer(cid,2000,7618,1,1000)

 

elseif msgcontains(msg, 'bp smp') then

buyContainer(cid,2002,7589,1,2000)

 

elseif msgcontains(msg, 'bp shp') then

buyContainer(cid,2000,7588,1,2000)

 

elseif msgcontains(msg, 'bp gmp') then

buyContainer(cid,2002,7590,1,3000)

 

elseif msgcontains(msg, 'bp ghp') then

buyContainer(cid,2000,7591,1,3000)

 

elseif msgcontains(msg, 'bp star') then

buyContainer(cid,2000,7368,100,300000)

 

 

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

selfSay('Good bye, ' .. creatureGetName(cid) .. '!')

focus = 0

talk_start = 0

end

end

end

 

function onCreatureChangeOutfit(creature)

 

end

 

 

function onThink()

if (os.clock() - talk_start) > 30 then

if focus > 0 then

selfSay('Proximo por favor...')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Adeus.')

focus = 0

end

end

end

 

Depois disso basta adicionalo em seu map(se voce nao souber como fazer isso va tutoriais de mapping aqui no xtibia mesmo que vao lhe ensinar la)

Aqui vai uma ss do npc pra vcs verem ele xD

http://img99.imageshack.us/my.php?image=onpcqn2.png

 

OBS:No thyrania a assassin star so funfa pra paladin level 80+ mas se seu server for diferente fassa isso:

Abra o arquivo bp itens e procure a frase:

if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) < 4 then

selfSay('Ola ' .. creatureGetName(cid) .. '! Eu vendo bp de runes, bp de assassin star (300k diga somentete bp star OBS:para paladins somente level 80 mais!) e de potions (para comprar diga bp uh (exemplo) bp ghp (exemplo).')

focus = cid

Se no seu ot assassin star não tiver level para usar deixe a frase assim:

if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) < 4 then

selfSay('Ola ' .. creatureGetName(cid) .. '! Eu vendo bp de runes, bp de assassin star (300k diga somentete bp star) e de potions (para comprar diga bp uh (exemplo) bp ghp (exemplo).')

focus = cid

Se no seu ot a assassin star for para level 60 por exmplo, mude apenas isso:

(300k diga somentete bp star OBS:para paladins somente level 60 mais!)

Acho que ja entenderam =p

 

 

SE ENCONTRAREM ALGUM BUG NESTE NPC FALE COMIGO URGENTE POR FAVOR!!!!!!!!!

Comentem por favor e meu primeiro npc :yipi:

 

Cya

 

 

 

-----------------------------------------------------------EDITED----------------------------------------------------

 

Po ninguem fala nada -.-

comentem ae pls

Editado por Guiniudes
Link para o comentário
Compartilhar em outros sites

Bom, eu tinha visto uma alavanca que vende bps de potions,

+ ai ficou nada a ver,

assim com o NPC vendendo é bem melhor, muito bom,

ainda num testei espero que funcione.

flw

Link para o comentário
Compartilhar em outros sites

  • 1 year later...
×
×
  • Criar Novo...