Ficou Massa. ![]()
Valew ai !
info
Grupo: Campones
Registrado: 06/12/06
Posts: 1
Reputação: 0
Ficou Massa. ![]()
Valew ai !
Kra... vc postou ai para os ots q n possuem o comando "sellcontainer".
masi ai vai para os q tem ( bem + facil
):
elseif msgcontains(msg, 'bp hmm') and focus == cid then sellcontainer(cid,id-da-bp,id-da-hmm,charges,custo)
Agora bp d mf:
elseif msgcontains(msg, 'bp mfs') and focus == cid thensellcontainer(cid,id-da-bp,2006,7,custo)
cya
Funciona em ot 7.9?
Editado Janeiro 3 por vini_xxe
Eh bom vo add aki no meu ot a galera vai gosta ctz
info
Grupo: Lenda
Registrado: 10/10/05
Posts: 2.2k
Reputação: +63
Char no Tibia: Master Chequer

Isto é praticamente um NPC.
Portanto, movido.
aew
kara eu tentei fazer esse npc no meu ot mas n deu certo =( mas fora isso o tuto tah muito bom ...
da pra passar o script inteiro dele ?
se puder, vlw =D
info
Grupo: Visconde
Registrado: 19/06/07
Posts: 267
Reputação: +1
Gênero: Masculino
Char no Tibia: Rambocop Infernus

@capeta7
Coloca isso aqui:
-- Npc by Zorzin =)
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)
msg = string.lower(msg)
-- greeting phrase
if string.find(msg, '(%a*)hi(%a*)') and focus == 0 and string.len(msg) == 2 and getDistanceToCreature(cid) < 4 then
selfSay('Hi ' .. creatureGetName(cid) .. '! I sell runes.')
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()
-- Mensages:
buy_error = 'Sorry, you dont have enough money.'
buy_ok = 'Here you are.'
buy_no = 'Ok. Maybe another time.'
--
sell_error = 'Sorry, you dont have that item.'
sell_ok = 'Thanks for this item.'
sell_no = 'Ok. Maybe another time.'
--
preco_hmm = getConfigNumber("price_hmm")
cargas_hmm = getConfigNumber("charges_hmm")
preco_uh = getConfigNumber("price_uh")
cargas_uh = getConfigNumber("charges_uh")
preco_gfb = getConfigNumber("price_gfb")
cargas_gfb = getConfigNumber("charges_gfb")
preco_explo = getConfigNumber("price_explo")
cargas_explo = getConfigNumber("charges_explo")
preco_gfb = getConfigNumber("price_gfb")
cargas_gfb = getConfigNumber("charges_gfb")
preco_sd = getConfigNumber("price_sd")
cargas_sd = getConfigNumber("charges_sd")
if msgcontains(msg, 'rune') or msgcontains(msg, 'runes') then
selfSay('I sell hmms ('.. preco_hmm ..'gps), uhs ('.. preco_uh ..'gps), gfbs ('.. preco_gfb ..'gps), explosions ('.. preco_explo ..'gps), sds '.. preco_sd ..'gps) and blank runes (5gps).')
elseif msgcontains(msg, 'hmm') or msgcontains(msg, 'hmms') or msgcontains(msg, 'heavy magic missile') then
bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',2311,getCountNumber(msg),cargas_hmm,preco_hmm,0,'a','heavy magic missile rune','heavy magic missile runes'
sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs)
talk_state = 392
elseif msgcontains(msg, 'uh') or msgcontains(msg, 'uhs') or msgcontains(msg, 'ultimate healing') then
bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',2273,getCountNumber(msg),cargas_uh,preco_uh,0,'an','ultimate healing rune','ultimate healing runes'
sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs)
talk_state = 392
elseif msgcontains(msg, 'gfb') or msgcontains(msg, 'gfbs') or msgcontains(msg, 'great fireball') then
bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',2304,getCountNumber(msg),cargas_gfb,preco_gfb,0,'a','great fireball rune','great fireball runes'
sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs)
talk_state = 392
elseif msgcontains(msg, 'explo') or msgcontains(msg, 'explosion') then
bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',2313,getCountNumber(msg),cargas_explo,preco_explo,0,'an','explosion rune','explosion runes'
sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs)
talk_state = 392
elseif msgcontains(msg, 'sd') or msgcontains(msg, 'sds') or msgcontains(msg, 'sudden death') then
bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',2268,getCountNumber(msg),cargas_sd,preco_sd,0,'a','sudden death rune','sudden death runes'
sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs)
talk_state = 392
elseif msgcontains(msg, 'blank') then
bs,itemid,count,subtype,price,iscountable,article,name,plural = 'buy',2260,getCountNumber(msg),0,5,0,'a','blank rune','blank runes'
sendMsgBuySell(cid,itemid,count,price,article,name,plural,bs)
talk_state = 392
elseif talk_state == 392 then
if msgcontains(msg, 'yes') or msgcontains(msg, 'no') then
if bs == 'buy' then
buyItem(cid,itemid,count,subtype,price,iscountable,name,plural,buy_error,buy_ok,
buy_no,msg)
else
sellItem(cid,itemid,count,subtype,price,iscountable,sell_error,sell_ok,sell_no,m
sg)
end
talk_state = 0
end
elseif msgcontains(msg, 'bye') 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 focus > 0 then
x, y, z = creatureGetPosition(focus)
myx, myy, myz = selfGetPosition()
if ((myy-y==0) and (myx-x<=0 and myx-x>=-4)) then
selfTurn(1)
end
if ((myy-y==0) and (myx-x>=0 and myx-x<=4)) then
selfTurn(3)
end
if ((myx-x==0) and (myy-y<=0 and myy-y>=-4)) then
selfTurn(2)
end
if ((myx-x==0) and (myy-y>=0 and myy-y<=4)) then
selfTurn(0)
end
if ((myy-y==-2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(2)
end
if ((myy-y==2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(0)
end
if ((myx-x==2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(3)
end
if ((myx-x==-2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(1)
end
if ((myy-y==-3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(2)
end
if ((myy-y==3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(0)
end
if ((myx-x==3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(3)
end
if ((myx-x==-3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(1)
end
if ((myy-y==-4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(2)
end
if ((myy-y==4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(0)
end
if ((myx-x==4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(3)
end
if ((myx-x==-4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(1)
end
end
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!
Vê se da certo porque a minha versão é 7.92
@Topic
Parabens, bom tuto!
Continue assim...
info
Grupo: Campones
Registrado: 27/01/07
Posts: 2
Reputação: 0
Desculpa o Incomodo é Pq Sou Meio Newba Em assunto de OT
No Meu Runes Ta Isso ...
Kual Lugar Devo Colocar Pa Vender Bp de Mf ...??
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
-- OTServ event handling functions end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addBuyableItem({'light wand', 'lightwand'}, 2163, 500, 'magic light wand')
shopModule:addBuyableItem({'mana fluid', 'manafluid'}, 2006, 100, 7, 'mana fluid')
shopModule:addBuyableItem({'life fluid', 'lifefluid'}, 2006, 80, 10, 'life fluid')
shopModule:addBuyableItem({'heavy magic missile', 'hmm'}, 2311, 7000, 100, 'heavy magic missile rune')
shopModule:addBuyableItem({'great fireball', 'gfb'}, 2304, 7000, 100, 'great fireball rune')
shopModule:addBuyableItem({'explo', 'xpl'}, 2313, 9000, 100, 'explosion rune')
shopModule:addBuyableItem({'ultimate healing', 'uh'}, 2273, 9000, 100, 'ultimate healing rune')
shopModule:addBuyableItem({'sudden death', 'sd'}, 2268, 10000, 100, 'sudden death rune')
shopModule:addBuyableItem({'blank', 'rune'}, 2260, 10, 'blank rune')
shopModule:addBuyableItem({'wand of inferno', 'inferno'}, 2187, 15000, 'wand of inferno')
shopModule:addBuyableItem({'wand of plague', 'plague'}, 2188, 5000, 'wand of plague')
shopModule:addBuyableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 10000, 'explosion rune')
shopModule:addBuyableItem({'wand of vortex', 'vortex'}, 2190, 500, 'wand of cosmic energy')
shopModule:addBuyableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 1000, 'wand of dragonbreath')
shopModule:addBuyableItem({'quagmire rod', 'quagmire'}, 2181, 10000, 'quagmire rod')
shopModule:addBuyableItem({'snakebite rod', 'snakebite'}, 2182, 500, 'snakebite rod')
shopModule:addBuyableItem({'tempest rod', 'tempest'}, 2183, 15000, 'tempest rod')
shopModule:addBuyableItem({'volcanic rod', 'volcanic'}, 2185, 5000, 'volcanic rod')
shopModule:addBuyableItem({'moonlight rod', 'moonlight'}, 2186, 1000, 'moonlight rod')
npcHandler:addModule(FocusModule:new())
Detalhes do Meu ServEvolutions 0.7.8
Versão 8.0
Editado Julho 30 por solock-loko
info
Grupo: Campones
Registrado: 24/07/07
Posts: 9
Reputação: 0

Alguem pode botar inteiro como fica?
da pra usa esse npc em 8.0 ???
info
Grupo: Campones
Registrado: 25/11/07
Posts: 29
Reputação: 0
Char no Tibia: PsyKina

preciso saber se esse npc da pra usar em ot 8.0 tb por favor responda
info
Grupo: Barão
Registrado: 11/09/06
Posts: 202
Reputação: 0

Em Devland ñ funciona.
até +
info
Grupo: Artesão
Registrado: 21/02/07
Posts: 137
Reputação: +1
Char no Tibia: GOD Grimrath

Não funciono em yurots 8.0
info
Grupo: Campones
Registrado: 13/10/05
Posts: 51
Reputação: +2
;D koeh guruzada! sentiru minha falta? to di volta aos Ots e aos meus tutoriais.
Mas antes kero lembrar-lhes de que quando vc for comprá-la tera que deixar o espaço de cima (onde a bp/bag ficam).
vamos lá:
1º Passo - Olhe no seu server o nome do seu Npc que vende runas, geralmente é o Dark Rodo né, mais tem gente que muda porque axa que fica mais legal. Intaum vá na pasta Data e a seguir entre na pasta Npcs e procure pelo seu Npc que vende runas e clique nele com o botão direito e vá em propriedades.
2º Passo -agora então localize isto: script="data/npc/scripts/x.lua"
OBS: o "x" é variávem nos Ots, mas provalmente tem nome de "runes"
2º Passo -entao pegue o nome "x" que terá ai e vá na pasta scripts que há na pasta Npcs, então localize o arquivo "x" e clike nele com o botão direito e clike em editar então abria o arquivo num bloco de notas.
3º Passo - adicione isto no seus script (no meio de onde estao as outras runas)
agora é só salvar e ser feliz xD
EDITED: credits by Dud por \/
Editado Dezembro 18 por joia