function onAdvance(player, skill, oldLevel, newLevel)
if getPlayerSkill(SKILL_FIST) = 20 and (getPlayerStorageValue(cid, 8484) == EMPTY_STORAGE) then
doPlayerSetVocation(cid, vocation)
setPlayerStorageValue(cid, 8000, 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
doPlayerSendTextMessage(cid,22,"Congratulations, you obtained a promotion!")
doRemoveItem(item.uid, 1)
else
return true
end
end
1.3TFS version?
local config = {
fist = 20
}
function onAdvance(player, skill, oldLevel, newLevel)
local vocation = player:getVocation()
local promotion = vocation:getPromotion()
local vocName = player:getVocation():getName()
if player:getSkillLevel(SKILL_FIST) == config.fist then
player:setVocation(promotion)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Congratulations! You have been promoted!.')
return true
end
end