assim q minha bola de cristal adivinhar o conteúdo do script do seu npc eu te posto uma resposta ok?
- Fórum
- xTibia - Notícias e Suporte
- Soluções
- Archived
- [npc] Second Promotion
Olá,
na hora que você for fazer o second promotion, ponha la o NUMERO que sera o second, e o NUMERO que sera o promotion anterior, arrume isto no vocations.xml e no script do npc.
Abraços
info
Grupo: Campones
Registrado: 11/04/08
Posts: 2
Reputação: 0
Char no Tibia: Skilo Ninja

olha,eu sou admin em um ot 8.1,tem second promotion,eu vou postar aqui o npc
abra um arquivo de npc e copie e cole isso dentro
<?xml version="1.0" ?>
- <npc name="Render" script="data/npc/scripts/second.lua" access="3" lookdir="2" autowalk="25">
<mana now="100" max="100" />
<health now="100" max="100" />
<look type="266" head="114" body="119" legs="132" feet="114" />
</npc>
depois abra um script .lua e renomeie para "second.lua"
cole isso 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 ' .. creatureGetName(cid) .. '! I can give you the second promotion if you made the tutorial fully.')
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, 'second promotion') or msgcontains(msg, 'second promote') then
if getPlayerVocation(cid) > 8 then
selfSay('Sorry, you are already promoted a second time.')
talk_state = 0
elseif getPlayerLevel(cid) < 100 then
selfSay('Sorry, you need level 100 to get the second promotion.')
talk_state = 0
elseif not isPremium(cid) then
selfSay('Sorry, you must be premium to get your second promotion.')
talk_state = 0
else
selfSay('Do you want to get your promotion?')
talk_state = 1
end
elseif talk_state == 1 then
if msgcontains(msg, 'yes') then
if pay(cid,0) then
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
selfSay('You are now promoted a second time!')
end
end
talk_state = 0
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()
doNpcSetCreatureFocus(focus)
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
tem só uma coisa,o ot é 8.1,vc precisa ter as second vocations e se precisar estou disposto a ajudar,
ah e mais uma coisa,a second vocation ta de graça,se você quiser mudar o preço,procure no script
if pay(cid,0) then
e mude o numero 0 para o preço que quiser,espero ter ajudado




info
Grupo: Campones
Registrado: 01/08/08
Posts: 6
Reputação: 0
Char no Tibia: Landstalker
eu jah utilizei varios scripts daqui do forum tentando fazer um npc de second promotion.. porém ainda sim ele soh faz a 1°(a promotion normal)
eu to mechendo com um server 8.4 .. acho q naum faz muita diferença issu... mas enfim..
o q acontece é ele vai indo tud blzinha.. aih na hora q vc fala "yes" pra aceitar a 2 prom. o npc naum faz mais nada... naum sei se falta algo ou o q...
se alguem puder postar um completo q funcione.. eu jah agradeceria muito :withstupidsmiley:
t+