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 = 0talk_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