Ola gente nao sou fera como Muitos que tem aqui. mas me alegro de ter consigo isso com pesquisa e muitos erros.
nao sei se ja existe algo igual mas isso eu fiz apos buscar soluções para meu ot, das quais nao vou citar, mas duas delas era, ao add uma vocação/outfit pela database o skill sword ou strangth bugavam. e queria uma solução para arrumar sem ter que trocar a vocação de um por um. mas sem detalhes de meus problemas
explicando o que fiz. Lendo introdução a programação lua achei algo bastante util.
isso é ">" É usado para dizer que algo é “maior que” outro
e isso "~=" “~=” = Este operador faz a comparação de diferença
Explicando: devido a players nao bugados ficarem upando no desbug, coloquei para. apenas players acima de level 631 utilizar, e tambem fiz para ele adicionar uma vocação, este para concertar o problema da vocação que ficava com problemas , alterando o promete, que tinha nele.
se alguem puder arrumar para ele trocar vocação e outfit, ficaria melhor ainda. pois ele so troca a vocação nao a outfit.
em data>npc>scripts crie um arquivo chamado desbug.lua e jogue isto dentro
local focus = 0
local talk_start = 0
local target = 0
local days = 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 (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello ' .. getCreatureName(cid) .. '! i sell desbug for 10 gold.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'promotion') or msgcontains(msg, 'promote') then
if getPlayerVocation(cid) ~= 536 then
selfSay('Sorry, you are already promoted.')
talk_state = 0
elseif not isPremium(cid) then
selfSay('Sorry, you must be premium to buy promotion.')
talk_state = 0
else
selfSay('Do you want to buy promotion for 20k?')
talk_state = 1
end
elseif msgcontains(msg, 'desbug') or msgcontains(msg, 'premmy') then
selfSay('you like got one lvl for 10 gold??')
talk_state = 2
elseif talk_state == 1 then
if msgcontains(msg, 'yes') then
if pay(cid,10) then
doPlayerSetVocation(cid, 548)
selfSay('You are now promoted!')
else
selfSay('Sorry, you do not have enough money.')
end
end
talk_state = 0
elseif talk_state == 2 then
if msgcontains(msg, 'yes') then
if getPlayerLevel(cid) > 631 then
if pay(cid,100000) then
addLevel(cid,1)
selfSay('you can got more level now')
else
selfSay('Sorry, you do not have enough money or level.')
end
else
selfSay('Sorry, voce nao tem level suficiente para desbugar.')
end
end
talk_state = 0
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 45 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
agora em data>npc crie um arquivo desbug.xml e coloque isto
lembrando que o npc deve estar no map editor, caso nao saiba fazer, abra pasta do map editor, procure creatures, dando CTRL+F procure NPC, e adicione um novo npc no programa feche e salve, abra o programa e adicione o npc desbug no mapa.
OBS: esta configurado para apenas jogadores Premmy utulizarem esta função
Elevando vocação
if msgcontains(msg, 'promotion') or msgcontains(msg, 'promote') then
o que sera dito para trocar vocação
if getPlayerVocation(cid) ~= 536 then <<< ID da vocação nescessaria
altere para a vocação desejada
caso queira que qualquer vocação faça alteração, troque isso "~=" por isto "<"
abaixo é a vocação desejada
doPlayerSetVocation(cid, 548) <<< ID da vocação adicionada
Apenas jogadores com level acima de 631 irao desbugar.
if getPlayerLevel(cid) > 631 then
if pay(cid,100000) then
if pay
quanto vai custar para desbugar.
como citei antes, se alguem puder para que na parte da vocação tambem adicionar uma outfit ajudaria bastante
info
Grupo: Visconde
Registrado: 15/02/11
Posts: 259
Reputação: +25
Char no Tibia: Aias Laf Du
Ot Wodbo
Versao 8.00 ou 8.50 nao lembro
Ola gente nao sou fera como Muitos que tem aqui. mas me alegro de ter consigo isso com pesquisa e muitos erros.
nao sei se ja existe algo igual mas isso eu fiz apos buscar soluções para meu ot, das quais nao vou citar, mas duas delas era, ao add uma vocação/outfit pela database o skill sword ou strangth bugavam. e queria uma solução para arrumar sem ter que trocar a vocação de um por um. mas sem detalhes de meus problemas
explicando o que fiz. Lendo introdução a programação lua achei algo bastante util.
Explicando: devido a players nao bugados ficarem upando no desbug, coloquei para. apenas players acima de level 631 utilizar, e tambem fiz para ele adicionar uma vocação, este para concertar o problema da vocação que ficava com problemas , alterando o promete, que tinha nele.
se alguem puder arrumar para ele trocar vocação e outfit, ficaria melhor ainda. pois ele so troca a vocação nao a outfit.
em data>npc>scripts crie um arquivo chamado desbug.lua e jogue isto dentro
local focus = 0 local talk_start = 0 local target = 0 local days = 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 (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Hello ' .. getCreatureName(cid) .. '! i sell desbug for 10 gold.') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'promotion') or msgcontains(msg, 'promote') then if getPlayerVocation(cid) ~= 536 then selfSay('Sorry, you are already promoted.') talk_state = 0 elseif not isPremium(cid) then selfSay('Sorry, you must be premium to buy promotion.') talk_state = 0 else selfSay('Do you want to buy promotion for 20k?') talk_state = 1 end elseif msgcontains(msg, 'desbug') or msgcontains(msg, 'premmy') then selfSay('you like got one lvl for 10 gold??') talk_state = 2 elseif talk_state == 1 then if msgcontains(msg, 'yes') then if pay(cid,10) then doPlayerSetVocation(cid, 548) selfSay('You are now promoted!') else selfSay('Sorry, you do not have enough money.') end end talk_state = 0 elseif talk_state == 2 then if msgcontains(msg, 'yes') then if getPlayerLevel(cid) > 631 then if pay(cid,100000) then addLevel(cid,1) selfSay('you can got more level now') else selfSay('Sorry, you do not have enough money or level.') end else selfSay('Sorry, voce nao tem level suficiente para desbugar.') end end talk_state = 0 elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye, ' .. getCreatureName(cid) .. '!') focus = 0 talk_start = 0 end end end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 45 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 endagora em data>npc crie um arquivo desbug.xml e coloque isto
troque a outfit para a que vc kiser
lembrando que o npc deve estar no map editor, caso nao saiba fazer, abra pasta do map editor, procure creatures, dando CTRL+F procure NPC, e adicione um novo npc no programa feche e salve, abra o programa e adicione o npc desbug no mapa.
OBS: esta configurado para apenas jogadores Premmy utulizarem esta função
Elevando vocação
o que sera dito para trocar vocação
altere para a vocação desejada
caso queira que qualquer vocação faça alteração, troque isso "~=" por isto "<"
abaixo é a vocação desejada
Apenas jogadores com level acima de 631 irao desbugar.
quanto vai custar para desbugar.
como citei antes, se alguem puder para que na parte da vocação tambem adicionar uma outfit ajudaria bastante
Editado Abril 25 por CoyoteStark