SlayingWorld
Active Member
Is this code necessary? Its on my login.lua on creaturescripts, i am running latest TFS 1.2
What does it do? Because i added more promotions on my ot, but as soon as i logged in one of my chars they had automatically been promoted to promotion 2. Instead of staying as an elite knight they went to a reaper knight.
Then i went to my database and made his promotion back to elite knight, deleted that part of the code on the login.lua and when i logged in he stayed as an elite knight.
Code:
-- Promotion
local vocation = player:getVocation()
local promotion = vocation:getPromotion()
if player:isPremium() then
local value = player:getStorageValue(STORAGEVALUE_PROMOTION)
if not promotion and value ~= 1 then
player:setStorageValue(STORAGEVALUE_PROMOTION, 1)
elseif value == 1 then
player:setVocation(promotion)
end
elseif not promotion then
player:setVocation(vocation:getDemotion())
end
Then i went to my database and made his promotion back to elite knight, deleted that part of the code on the login.lua and when i logged in he stayed as an elite knight.