vc tem que verificar se seu data/XML/vocations.xml as vocs promovidas estão como fromVoc das vocações que as precedem. Do contrário, toda vez que relogar vai voltar como knight ao invés de elite knight, por ex.
info
Grupo: Herói
Registrado: 14/02/14
Posts: 341
Reputação: +285
Gênero: Masculino
Char no Tibia: Night Wolf

info
Grupo: Barão
Registrado: 13/07/15
Posts: 242
Reputação: +56
Char no Tibia: Sekk

vc tem que verificar se seu data/XML/vocations.xml as vocs promovidas estão como fromVoc das vocações que as precedem. Do contrário, toda vez que relogar vai voltar como knight ao invés de elite knight, por ex.
Teria que ficar ssim olha? :
<vocation id="8" name="Hero Knight" description="an hero knight" needpremium="1" gaincap="25" gainhp="140" gainmana="120" gainhpticks="1" gainhpamount="200" gainmanaticks="2" gainmanaamount="300" manamultiplier="3.0" attackspeed="130" soulmax="200" gainsoulticks="60" fromvoc="4" lessloss="30">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/><skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/></vocation>
Se esse for o correto, ja está tudo assim...
info
Grupo: Conde
Registrado: 14/04/15
Posts: 956
Reputação: +333
Gênero: Masculino

A promotion é definitiva certo? Então não deixe o fromvoc com o valor da voc antes da promotion, se for definitivo, sempre deixe a fromvoc igual ao vocation id
<vocation id="8" name="Hero Knight" description="an hero knight" needpremium="1" gaincap="25" gainhp="140" gainmana="120" gainhpticks="1" gainhpamount="200" gainmanaticks="2" gainmanaamount="300" manamultiplier="3.0" attackspeed="130" soulmax="200" gainsoulticks="60" fromvoc="8" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation>
info
Grupo: Barão
Registrado: 13/07/15
Posts: 242
Reputação: +56
Char no Tibia: Sekk

A promotion é definitiva certo? Então não deixe o fromvoc com o valor da voc antes da promotion, se for definitivo, sempre deixe a fromvoc igual ao vocation id
<vocation id="8" name="Hero Knight" description="an hero knight" needpremium="1" gaincap="25" gainhp="140" gainmana="120" gainhpticks="1" gainhpamount="200" gainmanaticks="2" gainmanaamount="300" manamultiplier="3.0" attackspeed="130" soulmax="200" gainsoulticks="60" fromvoc="8" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation>
OPAAAAAA, vou testar aqui cara! Se funcionar, eu edito aqui... MUITO OBRIGADO DESDE JÁ!!!
Edit1:
Se eu colocar o fromvoc igual o id da voc, no account managar, o player pode escolher se ele quer ser promotion ja..
Editado Dezembro 12 por Sekk
info
Grupo: Conde
Registrado: 14/04/15
Posts: 956
Reputação: +333
Gênero: Masculino

hmm... tendi mas tem como fazer tipo uma gambiarra kk manda ai o seu script de promotion...
info
Grupo: Barão
Registrado: 13/07/15
Posts: 242
Reputação: +56
Char no Tibia: Sekk

Ta ai:
Ta ai:
function onSay(cid, words, param)local vocs = { [1] = 5, -- master sorcerer[2] = 6, -- elder druid[3] = 7, -- royal paladin[4] = 8, -- elite knight}local newvoc = vocs[getPlayerVocation(cid)]local price = 20000if getPlayerPremiumDays(cid) > 0 thenif getPlayerMoney(cid) >= price thenif vocs[getPlayerVocation(cid)] thendoPlayerSetVocation(cid,newvoc)doPlayerRemoveMoney(cid, price)doPlayerSendCancel(cid, "Parabens voce foi promovido.")elsedoPlayerSendCancel(cid, "Voce nao pode ser promovido.")doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)endelsedoPlayerSendCancel(cid, "Voce nao tem dinheiro suficiente.")doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)endelsedoPlayerSendCancel(cid, "Voce precisa ser premium para usar esse comando.")doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)endreturn trueendO vocations.xml eu deixo com a from voc igual o id ou deixo igual as 4 primeiras vocs msm?
Add skype ai pfv!!! Se conseguir me ajudar, eu posto aqui!
info
Grupo: Conde
Registrado: 14/04/15
Posts: 956
Reputação: +333
Gênero: Masculino

Troca por este código:
function onSay(cid, words, param)
local vocs = { [1] = 5, -- master sorcerer
[2] = 6, -- elder druid
[3] = 7, -- royal paladin
[4] = 8, -- elite knight
}
local newvoc = vocs[getPlayerVocation(cid)]
local price = 20000
if getPlayerPremiumDays(cid) > 0 then
if getPlayerMoney(cid) >= price then
if vocs[getPlayerVocation(cid)] then
doPlayerSetVocation(cid,newvoc)
doPlayerRemoveMoney(cid, price)
doPlayerSendCancel(cid, "Parabens voce foi promovido.")
setPlayerStorageValue(cid, 21323, newvoc)
else
doPlayerSendCancel(cid, "Voce nao pode ser promovido.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "Voce nao tem dinheiro suficiente.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "Voce precisa ser premium para usar esse comando.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
return true
end
Agora em login.lua em baixo da linha que tem "function onLogin(cid)" Adicione isto:
local newsvoc = getPlayerStorageValue(cid, 21323) if newsvoc > 4 then doPlayerSetVocation(cid,newvoc) end
Pronto! Problema resolvido ![]()
info
Grupo: Barão
Registrado: 13/07/15
Posts: 242
Reputação: +56
Char no Tibia: Sekk

Troca por este código:
function onSay(cid, words, param) local vocs = { [1] = 5, -- master sorcerer [2] = 6, -- elder druid [3] = 7, -- royal paladin [4] = 8, -- elite knight } local newvoc = vocs[getPlayerVocation(cid)] local price = 20000 if getPlayerPremiumDays(cid) > 0 then if getPlayerMoney(cid) >= price then if vocs[getPlayerVocation(cid)] then doPlayerSetVocation(cid,newvoc) doPlayerRemoveMoney(cid, price) doPlayerSendCancel(cid, "Parabens voce foi promovido.") setPlayerStorageValue(cid, 21323, newvoc) else doPlayerSendCancel(cid, "Voce nao pode ser promovido.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "Voce nao tem dinheiro suficiente.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "Voce precisa ser premium para usar esse comando.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end return true end
Agora em login.lua em baixo da linha que tem "function onLogin(cid)" Adicione isto:
local newsvoc = getPlayerStorageValue(cid, 21323) if newsvoc > 4 then doPlayerSetVocation(cid,newvoc) endPronto! Problema resolvido
GAMBIARRA LOUCA KKKKKK, mas tipo, não deu certo pq quando o player reloga ou morre, ele fica sem vocation '-'-'
e eu nunca vi setar storage em promotion KKKKKKKKKK
info
Grupo: Conde
Registrado: 14/04/15
Posts: 956
Reputação: +333
Gênero: Masculino

Coloquei a storage para checar no login.lua '-'
Manda ai seu Login.lua '-'
info
Grupo: Barão
Registrado: 13/07/15
Posts: 242
Reputação: +56
Char no Tibia: Sekk

Coloquei a storage para checar no login.lua '-'
Manda ai seu Login.lua '-'
Eu só comentei kkkk
info
Grupo: Conde
Registrado: 14/04/15
Posts: 956
Reputação: +333
Gênero: Masculino

Tenta issu:
local config = {
loginMessage = getConfigValue('loginMessage')
}
function onLogin(cid)
local newsvoc = getPlayerStorageValue(cid, 21323)
if newsvoc >= 1 then
doPlayerSetVocation(cid,newvoc)
end
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to starts over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end
if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
-- Rush Event --
registerCreatureEvent(cid, "RushCombat")
registerCreatureEvent(cid, "RushAttack")
registerCreatureEvent(cid, "RushDead")
registerCreatureEvent(cid, "RushOutfit")
registerCreatureEvent(cid, "killer")
registerCreatureEvent(cid, "ZombieAttack")
registerCreatureEvent(cid, "saiu")
registerCreatureEvent(cid, "entrou")
registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "zombieevent")
registerCreatureEvent(cid, "attackguild")
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, VipReceive)
registerCreatureEvent(cid, "PlayerKill")
registerCreatureEvent(cid, "FragReward")
if (InitArenaScript ~= 0) then
InitArenaScript = 1
-- make arena rooms free
for i = 42300, 42309 do
setGlobalStorageValue(i, 0)
setGlobalStorageValue(i+100, 0)
end
end
-- if he did not make full arena 1 he must start from zero
if getPlayerStorageValue(cid, 42309) < 1 then
for i = 42300, 42309 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 2 he must start from zero
if getPlayerStorageValue(cid, 42319) < 1 then
for i = 42310, 42319 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 3 he must start from zero
if getPlayerStorageValue(cid, 42329) < 1 then
for i = 42320, 42329 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42355) == -1 then
setPlayerStorageValue(cid, 42355, 0) -- did not arena level
end
setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
setPlayerStorageValue(cid, 42352, 0) -- is not in arena
return true
end
info
Grupo: Barão
Registrado: 13/07/15
Posts: 242
Reputação: +56
Char no Tibia: Sekk

Tenta issu:
local config = { loginMessage = getConfigValue('loginMessage') } function onLogin(cid) local newsvoc = getPlayerStorageValue(cid, 21323) if newsvoc >= 1 then doPlayerSetVocation(cid,newvoc) end local loss = getConfigValue('deathLostPercent') if(loss ~= nil) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10) end local accountManager = getPlayerAccountManager(cid) if(accountManager == MANAGER_NONE) then local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if(lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." else str = str .. " Please choose your outfit." doPlayerSendOutfitWindow(cid) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) elseif(accountManager == MANAGER_NAMELOCK) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?") elseif(accountManager == MANAGER_ACCOUNT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to starts over then type 'cancel'.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.") end if(not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end registerCreatureEvent(cid, "Mail") registerCreatureEvent(cid, "GuildMotd") -- Rush Event -- registerCreatureEvent(cid, "RushCombat") registerCreatureEvent(cid, "RushAttack") registerCreatureEvent(cid, "RushDead") registerCreatureEvent(cid, "RushOutfit") registerCreatureEvent(cid, "killer") registerCreatureEvent(cid, "ZombieAttack") registerCreatureEvent(cid, "saiu") registerCreatureEvent(cid, "entrou") registerCreatureEvent(cid, "Idle") registerCreatureEvent(cid, "zombieevent") registerCreatureEvent(cid, "attackguild") registerCreatureEvent(cid, "onPrepareDeath") registerCreatureEvent(cid, "advance") registerCreatureEvent(cid, "FimVip") registerCreatureEvent(cid, "SkullCheck") registerCreatureEvent(cid, "ReportBug") registerCreatureEvent(cid, VipReceive) registerCreatureEvent(cid, "PlayerKill") registerCreatureEvent(cid, "FragReward") if (InitArenaScript ~= 0) then InitArenaScript = 1 -- make arena rooms free for i = 42300, 42309 do setGlobalStorageValue(i, 0) setGlobalStorageValue(i+100, 0) end end -- if he did not make full arena 1 he must start from zero if getPlayerStorageValue(cid, 42309) < 1 then for i = 42300, 42309 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 2 he must start from zero if getPlayerStorageValue(cid, 42319) < 1 then for i = 42310, 42319 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 3 he must start from zero if getPlayerStorageValue(cid, 42329) < 1 then for i = 42320, 42329 do setPlayerStorageValue(cid, i, 0) end end if getPlayerStorageValue(cid, 42355) == -1 then setPlayerStorageValue(cid, 42355, 0) -- did not arena level end setPlayerStorageValue(cid, 42350, 0) -- time to kick 0 setPlayerStorageValue(cid, 42352, 0) -- is not in arena return true end
Continua a mesma coisa.. Sem vocation ao logar ou morrer.
info
Grupo: Conde
Registrado: 14/04/15
Posts: 956
Reputação: +333
Gênero: Masculino

Você colocou para o player falar denovo com o npc lá de promotion???



info
Grupo: Barão
Registrado: 13/07/15
Posts: 242
Reputação: +56
Char no Tibia: Sekk
Bom galera, no meu server, tem a talkaction !promotion, que ao usar, o player é promovido, como exemplo: o paladin usa o comando, ai ele vira royal paladin entendeu?
Então, eu testei vários scripts de promotion, mas nenhum funciona devidamente no server, ele chegam a promover o player, mas se o mesmo deslogar ou ser morto, ele perde o promotion...
Ja teste vários scripts, e o meu atural script é:
function onSay(cid, words, param)
local vocs = { [1] = 5, -- master sorcerer
[2] = 6, -- elder druid
[3] = 7, -- royal paladin
[4] = 8, -- elite knight
}
local newvoc = vocs[getPlayerVocation(cid)]
local price = 20000
if getPlayerPremiumDays(cid) > 0 then
if getPlayerMoney(cid) >= price then
if vocs[getPlayerVocation(cid)] then
doPlayerSetVocation(cid,newvoc)
doPlayerRemoveMoney(cid, price)
doPlayerSendCancel(cid, "Parabens voce foi promovido.")
else
doPlayerSendCancel(cid, "Voce nao pode ser promovido.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "Voce nao tem dinheiro suficiente.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "Voce precisa ser premium para usar esse comando.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
return true
end
O que pode ocasionar o problema? Ele simplesmente não salva a vocation nova do player.. ME AJUDEM POR FAVOR!!
USO TFS 0.4