Jump to content

Perk Changes from 41.53


MoonSlime

Recommended Posts

BUG: Marking a custom skill as passive under the new perk system introduce in 41.53 does not make the skill show up.  Passive skills (Strength) and (Fitness) are specifically hardcoded to show up.

 

Under OptionsScreens/CharacterCreationProfession.lua

 

function CharacterCreationProfession:checkXPBoost()
    self.listboxXpBoost:clear()
    local levels = {}
    if self.listboxTraitSelected and self.listboxTraitSelected.items then
        for i,v in pairs(self.listboxTraitSelected.items) do
            if v.item:getXPBoostMap() then
                local table = transformIntoKahluaTable(v.item:getXPBoostMap())
                for perk,level in pairs(table) do
                    levels[perk] = (levels[perk] or 0) + level:intValue()
                end
            end
        end
    end
    if self.profession and self.profession:getXPBoostMap() then
        local table = transformIntoKahluaTable(self.profession:getXPBoostMap())
        for perk,level in pairs(table) do
            levels[perk] = (levels[perk] or 0) + level:intValue()
        end
    end
    levels[Perks.Fitness] = (levels[Perks.Fitness] or 0) + 5
    levels[Perks.Strength] = (levels[Perks.Strength] or 0) + 5
    for perk,level in pairs(levels) do
        if level < 0 then level = 0 end
        if level > 10 then level = 10 end
        self.listboxXpBoost:addItem(PerkFactory.getPerkName(perk), { perk = perk, level = level })
    end
    self.listboxXpBoost:sort()
end

and

 

function CharacterCreationProfession:drawXpBoostMap(y, item, alt)

    local dy = (self.itemheight - self.fontHgt) / 2
    self:drawText(item.text, 16, y + dy, 0, 1, 0, 1, UIFont.Small);

    local percentage = "+ 75%";
--    self:drawTexture(CharacterCreationProfession.instance.greenBlits, self.width - 80, (y) + 12, 1, 1, 1, 1);
    if item.item.level == 2 then
        percentage = "+ 100%";
--        self:drawTexture(CharacterCreationProfession.instance.greenBlits, self.width - 76, (y) + 12, 1, 1, 1, 1);
    elseif item.item.level >= 3 then
        percentage = "+ 125%";
--        self:drawTexture(CharacterCreationProfession.instance.greenBlits, self.width - 76, (y) + 12, 1, 1, 1, 1);
--        self:drawTexture(CharacterCreationProfession.instance.greenBlits, self.width - 72, (y) + 12, 1, 1, 1, 1);
    end

    local textWid = getTextManager():MeasureStringX(UIFont.Small, item.text)
    local greenBlitsX = self.width - (68 + 10 * 4)
    local yy = y
    if 16 + textWid > greenBlitsX - 4 then
        yy = y + self.fontHgt
    end

    for i = 1,item.item.level do
        self:drawTexture(CharacterCreationProfession.instance.greenBlits, self.width - (68 + 10 * 4) + (i * 4), (yy) + dy + 4, 1, 1, 1, 1);
    end
    if item.item.perk ~= Perks.Fitness and item.item.perk ~= Perks.Strength then
        self:drawTextRight(percentage, self.width - 16, yy + dy, 0, 1, 0, 1, UIFont.Small);
    end

    yy = yy + self.itemheight;

    self:drawRectBorder(0, (y), self:getWidth(), yy - y - 1, 0.5, self.borderColor.r, self.borderColor.g, self.borderColor.b);

    return yy;
end


Both search for two vanilla passive skills instead of just searching the perk-list for all passive skills. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...