\`

Vendendo A 1ª Wand/rod

Por \`o´/ Byakugan \`o´/, 05 de nov. de 2006 em NPCs, monsters e raids

script
11
2.2k
05 de novembro de 2006 às 19:03

Bom galera, eu tenhu uma equipe de ot server, demorei um pouco para criar esse script, estava pensando em deixar como exclusividade da furios, mais percebi que se a furio for reconhecida por seus npc's, não será apenas por um script simples como esse...´

Então vamos ao script

bom, esse script basicamente faz com que o player compre a 1ª wand e rod de graça, porem pague 500 gps caso queira comprar novamente...

bom, como eu sou muito bonzinho, vou postar o script todo, pois se você tentar colocor apenas a parte que vende a wand e rod em um script proprio, provavelmente tera alguns erros...

focus = 0

talk_start = 0

target = 0

following = false

attacking= false

cont = 0

controle = 0

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

selfSay('Hi ' .. creatureGetName(cid) .. '! What you want ?')

focus = cid

controle = 1

rune = 1

talk_start = os.clock()

end

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

selfSay('Sorry, ' .. creatureGetName(cid) .. '! Wait a minute please.')

end

if msgcontains(msg, 'buy wand of dragonbreath') and controle == 1 then

item = 2191

cont = 1

price = 1000

selfSay('Do you want buy a wand of dragonbreath for '..price..' golds ?')

controle = 2

end

if msgcontains(msg, 'buy moonlight rod') and controle == 1 then

item = 2186

cont = 1

price = 1000

selfSay('Do you want buy a moonlight rod for '..price..' golds ?')

controle = 2

end

if msgcontains(msg, 'buy wand of plague') and controle == 1 then

item = 2188

cont = 1

price = 5000

selfSay('Do you want buy a wand of plague for '..price..' golds ?')

controle = 2

end

if msgcontains(msg, 'buy volcanic rod') and controle == 1 then

item = 2185

cont = 1

price = 5000

selfSay('Do you want buy a volcanic rod for '..price..' golds ?')

controle = 2

end

if msgcontains(msg, 'buy wand of cosmic energy') and controle == 1 then

item = 2189

cont = 1

price = 10000

selfSay('Do you want buy a wand of cosmic energy for '..price..' golds ?')

controle = 2

end

if msgcontains(msg, 'buy quagmire rod') and controle == 1 then

item = 2181

cont = 1

price = 10000

selfSay('Do you want buy a quagmire rod for '..price..' golds ?')

controle = 2

end

if msgcontains(msg, 'buy wand of inferno') and controle == 1 then

item = 2187

cont = 1

price = 15000

selfSay('Do you want buy a wand of inferno for '..price..' golds ?')

controle = 2

end

if msgcontains(msg, 'buy tempest rod') and controle == 1 then

item = 2183

cont = 1

price = 15000

selfSay('Do you want buy a tempest rod for '..price..' golds ?')

controle = 2

end

if controle == 2 then

if msgcontains(msg, 'yes') then

buy(cid,item,cont,price)

controle = 1

elseif msgcontains(msg, 'no') then

selfSay('Ok Do you need something more?')

controle = 1

end

end

if msgcontains(msg, 'buy wand of vortex') and rune == 1 then

queststatus = getPlayerStorageValue(cid,7018)

item = 2190

cont = 1

price = 500

selfSay('Do you want buy a vortex wand ? Only the first is a present. ')

controle = 4

end

if controle == 4 then

if msgcontains(msg, 'yes') then

buy(cid,item,cont,price)

controle = 1

if queststatus == -1 then

buy(cid,item,cont,0)

setPlayerStorageValue(cid,7018,1)

controle = 1

end

end

end

if msgcontains(msg, 'buy snakebite rod') and rune == 1 then

queststatus = getPlayerStorageValue(cid,7019)

item = 2182

cont = 1

price = 500

selfSay('Do you want buy a snakebite rod ? Only the first is a present. ')

controle = 4

end

if controle == 4 then

if msgcontains(msg, 'yes') then

buy(cid,item,cont,price)

controle = 1

if queststatus == -1 then

buy(cid,item,cont,0)

setPlayerStorageValue(cid,7019,1)

controle = 1

end

end

end

if controle == 4 then

if msgcontains(msg, 'no') then

selfSay('Ok Do you need something more?')

controle = 1

end

end

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

selfSay('Bye, ' .. creatureGetName(cid) .. '!')

focus = 0

talk_start = 0

controle = 0

end

end

function onCreatureChangeOutfit(creature)

end

function onThink()

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

if focus > 0 then

selfSay('Neeeext...')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

> Bom, se alguem ja tiver postado um topico com a mesma finalidade me fale, que eu boto os creditos a ele etc.. mais acho que não tem não..=p

> Esse npc esta configurado para perguntar se o player deseja comprar realmente o item solicitado, se alguem quiser sem isso posta aew que eu com prazer faço um post, com a venda direta...

> gostarão disso ?!?!, esperem só o lançamento da furios ot server... isso não e nem 10% das funções que eu preparei para o ot...

Sem mais

Rafael GomesR
07 de novembro de 2006 às 15:25

É realmente está otimo.

Parabens ;]

RocksodyR
09 de novembro de 2006 às 19:57

a scrip e simples mesmo, eu ja tinha feito um npc assim baseado nas scrips de otros npcs tipo "silvio santos", so tive que mudar as falas e comandos.

Mas vlw por ter postado, muito bom.

abco,

Aizen

tibiaa4eT
10 de novembro de 2006 às 19:04

parabens

esse script é akeles simples + fodas

mto bom cara

manda + ae

xD

FaiscaF
12 de novembro de 2006 às 12:25

Velho Nao Eh Inedito, no meu ot tinha ;(: malz acaba com a sua alegria

GotckyG
14 de novembro de 2006 às 15:15

è Npc legalzinho, não e uma coisa que se diga 'que npc f***' mais e legal =p

continue assim

14 de novembro de 2006 às 19:45

Muito bom, mas não é inéito muitos ots tinham, como no JV

pauloestoreP
17 de novembro de 2006 às 13:38

Roxxx

Abraços!

1 mês depois...
MaluketeM
05 de dezembro de 2006 às 21:08

boa

:D

UrsO[ot]U
07 de dezembro de 2006 às 00:41

rox pq ele pergunta se vc quer comprar e informa o preço a pagar. vc nao tem um desse de food nao ?

5 meses depois...
skynagerloasS
25 de maio de 2007 às 14:02

Tópico contendo somente 1 NpC,

essa seção é para DataPacks com 3 ou mais Npcs,

~o{Tópico Movido}o~,

Abraços.