RO

Npc Bp Potions E Potions

Por RoD LoKo, 11 de jun. de 2008 em NPCs, monsters e raids

otserv
tibia
script
13
7.2k
RoD LoKoR
11 de junho de 2008 às 19:19

Olá,

 

Há alguns dias venho vendo a galera todo dia pedindo npc que venda potions e bps de potions. Então, resolvi fazer para vocês!

 

Vamos lá, comece copiando algum arquivo da sua pasta npc e renomeie ele para Ruan, apague tudo que está dentro, e coloque:

 

<?xml version="1.0"?>

 

<npc name="Ruan" script="data/npc/scripts/potions.lua" access="3" lookdir="2" autowalk="25">

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

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

<look type="140" head="79" body="17" legs="16" feet="0" addons="3"/>

</npc>

 

Ok, agora vá na sua pasta npc/scripts copie algum arquivo da pasta e renomeie para potions, apague tudo que está dentro e coloque:

 

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('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)

local msg = string.lower(msg)

 

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

selfSay('Hello ' .. creatureGetName(cid) .. '! I sell potions and bp potions.')

focus = cid

talk_start = os.clock()

 

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

selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

 

if msgcontains(msg, 'potions') then

selfSay('I sell Mana Potion (50gps), Health Potion (45gps), SHP (100gps), SMP (80gps), GHP (190gps) and GMP (120gps).')

elseif msgcontains(msg, 'bp potions') then

selfSay('I sell Bp Mana Potion (1k), Bp Health Potion (900gps), Bp SHP (2k), Bp SMP (1.6k), Bp GHP (3.8k) and Bp GMP (2.4k).')

 

elseif msgcontains(msg, 'mp') then

buy(cid,7620,1,50)

elseif msgcontains(msg, 'hp') then

buy(cid,7618,1,45)

elseif msgcontains(msg, 'shp') then

buy(cid,7588,1,100)

elseif msgcontains(msg, 'smp') then

buy(cid,7589,1,80)

elseif msgcontains(msg, 'ghp') then

buy(cid,7591,1,190)

elseif msgcontains(msg, 'gmp') then

buy(cid,7590,1,120)

 

elseif msgcontains(msg, 'bp mana potion') then

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

 

elseif msgcontains(msg, 'bp health potion') then

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

 

elseif msgcontains(msg, 'bp strong health') then

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

 

elseif msgcontains(msg, 'bp strong mana') then

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

 

elseif msgcontains(msg, 'bp great health') then

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

 

elseif msgcontains(msg, 'bp great mana') then

buyContainer(cid,2000,7590,1,2400)

 

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('Next Please...')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

Pronto, o npc está pronto! Boa Divesão! :smile_positivo:

 

Gente, quero lembrar que:



Não copiei esse npc de nenhum lugar, eu que fiz ele 100%! Se gostarem, poste. E se for postar em outro lugar, coloque os créditos por favor! Obrigado! :icon1:

 

Bugs: Caso encontre bugs no npc, podem postar que irei ajuda-los! :smile_positivo:

 

Abraços,

RoD LoKo

Editado Junho 11 por RoD LoKo

edercorreaE
11 de junho de 2008 às 19:52

mtu bom!!

 

:D

RoD LoKoR
11 de junho de 2008 às 22:15

Opa galera, agora que vi que tinha feito uma coisa errada. Já arrumei, o npc está certinho agora, podem usar!

 

Abraços,

RoD LoKo.

satan666S
14 de junho de 2008 às 14:04

aew manow vlw aki pegou bem

ficou bom pq so p.a pode comprar bps de potes e o antigo vendendor ainda continua vendendo do mesmo geito.XD

jululuJ
18 de junho de 2008 às 02:24

Po Veio vlw ai Mas o veio tenho uma pergunta pra oce

Cara como boto exausted nos potions???

No meo ot num tem exausted =/

CAra se sober me fala ai plx

FoxNoxF
23 de junho de 2008 às 18:10

@Tópic,

 

 

Sendo sincero com você, não gostei muito

 

 

*NPC Bugado

 

 

Tente concertar isto

1 mês depois...
zacariasZ
05 de julho de 2008 às 19:33

showww!!!

funcionou direitinho!! vlw msm kra

KawanK
06 de julho de 2008 às 20:50

Muito Bom :)

2 semanas depois...
haiguriH
14 de julho de 2008 às 22:24

bem,se desse uma note pra vc de 1 a 100, daria:

 

85 <Ótimo

 

Vlw pelo post pois ficou mto massa :icon1:

dudu2530D
15 de julho de 2008 às 11:07

show funciono direitinho da hora curti

 

vlw...

2 anos depois...
24 de julho de 2010 às 07:10

no meu nao funfou o npc ta certo mais os scripts deve ta errado ou no 8.54 8.57 nao funfa msm =(

giovaneroxG
24 de julho de 2010 às 09:15

@ Topic

 

Bom, um npc que só venda Potions? ta meio passado ja né.

Tenta revisar ele, coloca ele pra vender runas, weapons. etc...

 

Agora nesses ots novos, os npcs de potions nem são mais usados, agora é só com alavanda :D..

 

Att: Fox

7 meses depois...
curruwilliamC
06 de fevereiro de 2011 às 06:02

Tipo por que nao vem as potion dentro da bp ??

 

O meu server nao tem potion como coloco ?