• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

AAC MyAAC logout vocation problem

Cebal

Member
Joined
Aug 28, 2009
Messages
18
Solutions
2
Reaction score
8
Hi! I recently installed MyAAC to test something and MyAAC is really awesome in many aspects but the problem is when I use transform on my character it changes vocation and outfit but when I log out outfit stays on the character but vocation changes to the one before transformation. When It looks like on logging in vocation goes back but outfit stays. Anyone has idea where to look for solution? Transform script is good, I used it for a long time. I tried Znote and Gesior AAC and they are working fine, outfit and vocation stays even after loging out but not in MyAAC so it has to be in the AAC scripts. Maybe @slaw ,can you help? Thanks in advance!
 
Solution
OK, looks like I found a solution to this. If anyone ever needs it here you are:

I was pretty sure that there's a problem on character log in because if I logged out I checked database the vocation and outfit was fine but vocation switched back when I logged in again. So I edited login.lua in data\creaturescripts\scripts and found this:

Lua:
    -- Promotion
    local vocation = player:getVocation()
    local promotion = vocation:getPromotion()
    if player:isPremium() then
        local value = player:getStorageValue(PlayerStorageKeys.promotion)
        if value == 1 then
            player:setVocation(promotion)
        end
    elseif not promotion then
        player:setVocation(vocation:getDemotion())
    end
...
OK, looks like I found a solution to this. If anyone ever needs it here you are:

I was pretty sure that there's a problem on character log in because if I logged out I checked database the vocation and outfit was fine but vocation switched back when I logged in again. So I edited login.lua in data\creaturescripts\scripts and found this:

Lua:
    -- Promotion
    local vocation = player:getVocation()
    local promotion = vocation:getPromotion()
    if player:isPremium() then
        local value = player:getStorageValue(PlayerStorageKeys.promotion)
        if value == 1 then
            player:setVocation(promotion)
        end
    elseif not promotion then
        player:setVocation(vocation:getDemotion())
    end

The important thing was here:
Code:
elseif not promotion then
        player:setVocation(vocation:getDemotion())
    end

I deleted this line because it looks like my vocation was getting demoted cause of this and my script looks like this now:
Code:
    -- Promotion
    local vocation = player:getVocation()
    local promotion = vocation:getPromotion()
    if player:isPremium() then
        local value = player:getStorageValue(PlayerStorageKeys.promotion)
        if value == 1 then
            player:setVocation(promotion)
        end
    end

Now whenever I log out and log in the outfit and vocation stays the same.
 
Last edited:
Solution
Back
Top