lotrointerface.com
Search Downloads

LoTROInterface SVN KragenBars

[/] [branches/] [3.02/] [KragenBars/] [ChampionBars.lua] - Rev 16

Compare with Previous | Blame | View Log

import "Turbine.UI";
import "Turbine.UI.Lotro";
import "Turbine.Gameplay";
import "KragenPlugs.Utils";
import "KragenPlugs.KragenBars";

ChampionBars = class( KragenPlugs.KragenBars.ClassBar );

function ChampionBars:Constructor()

    KragenPlugs.KragenBars.ClassBar.Constructor( self );

    -- class settings arent saved then load the default settings
    if (not settings.class) then
        settings.class = vars.playerclass;
        self:DefaultSettings();
        self:ShowSetup();
    else
        self.settings = settings.classinfo;
        if (settings.vers ~= vars.vers) then
                self:UpdateSettings();
        end
    end
    
    self.fear = 0;
    self.controlledburnflag = false;
    
    -- ALL X, Y, WIDTH, HEIGHT values are in quickslot (ie: 1 width = the width of one quickslot: 35 px);
    
    -- Build Windows        SkillWindow( name:String, defaultx:int, defaulty:int, width:int, height:int, settings:table);
    self.windows["SelfBuffs"]   = SkillWindow("Self Buffs",                             1, 1, 9, 1,     self.settings["SelfBuffs"]      );
    self.windows["Defeat"]              = SkillWindow("Defeat Response",                10, 1, 3, 2,    self.settings["Defeat"]         );
    self.windows["Fervor:Util"] = SkillWindow("Fervor:Utility",                 1, 2, 3, 1,     self.settings["Fervor:Util"]  );
    self.windows["Conditional"] = SkillWindow("Conditional",                    4, 2, 2, 1,     self.settings["Conditional"]  );
    self.windows["Fervor:AOE"]  = SkillWindow("Fervor:AOE",                     1, 3, 4, 1,     self.settings["Fervor:AOE"]  );
    self.windows["Threat"]              = SkillWindow("Threat",                                 5, 3, 3, 1,     self.settings["Threat"] );
        self.windows["Stunned"]         = SkillWindow("Stunned",                                11, 3, 2, 1,    self.settings["Stunned"]        );
        self.windows["Ranged"]          = SkillWindow("Ranged",                                 10, 3, 1, 1,    self.settings["Ranged"] );
        self.windows["Melee"]           = SkillWindow("Melee",                                  1, 4, 3, 1,     self.settings["Melee"]          );
    self.windows["Fervor:ST"]   = SkillWindow("Fervor:Single Target",   4, 4, 4, 1,     self.settings["Fervor:ST"]              );
    self.windows["Buffs"]               = SkillWindow("Buffs",                                  8, 4, 2, 1,     self.settings["Buffs"]          );
    self.windows["Stances"]             = SkillWindow("Stances",                                12, 4, 1, 1,    self.settings["Stances"]        );

    --self.windows["Utility"]           = SkillWindow("Utility",                                10, 1, 3, 1,    self.settings["Utility"]        );
    
    -- Build Bars           SkillBar( parent:SkillWindow, x:int, y:int, width:int, height:int, active:Boolean);
    self.bars["Melee"]                                  = SkillBar(self.windows["Melee"],               1, 1, 3, 1, true, false);
    self.bars["Fervor:ST"]                              = SkillBar(self.windows["Fervor:ST"],   1, 1, 4, 1, true, false);
    self.bars["Fervor:AOE"]                             = SkillBar(self.windows["Fervor:AOE"],  1, 1, 4, 1, true, false);
    self.bars["Fervor:Util"]                    = SkillBar(self.windows["Fervor:Util"], 1, 1, 3, 1, true, false);
    self.bars["Conditional"]            = SkillBar(self.windows["Conditional"], 1, 1, 2, 1, true, false);
    self.bars["Defeat"]                                 = SkillBar(self.windows["Defeat"],              1, 1, 3, 2, true, true);
    self.bars["Buffs"]                                  = SkillBar(self.windows["Buffs"],               1, 1, 2, 1, true, false);
    self.bars["SelfBuffs"]                              = SkillBar(self.windows["SelfBuffs"],   1, 1, 9, 1, true, false);
    self.bars["Threat"]                                 = SkillBar(self.windows["Threat"],              1, 1, 3, 1, true, false);
    self.bars["Stances"]                                = SkillBar(self.windows["Stances"],     1, 1, 1, 1, true, true);
    self.bars["Stunned"]                = SkillBar(self.windows["Stunned"],     1, 1, 2, 1, true, false);
    self.bars["Ranged"]                = SkillBar(self.windows["Ranged"],       1, 1, 1, 1, true, false);
    

        -- Build Skills         SkillSlot( parent:SkillBar, x:int, y:int, active:Boolean, level:int, hexcode:String );
        --                      For skills that need to be replaced with a new version you can enter level as a table
        --                                              ie.  {["start"] = 1, ["end"] = 34]}
        --                                              then set the new skill level to 34 and it will replace the old at that level
    self.skills["WildAttack"]                   = SkillSlot(self.bars["Melee"],                 1, 1, true, 1, "0x70003DFC");
    self.skills["BladeWall"]                    = SkillSlot(self.bars["Melee"],                 2, 1, true, 1, "0x70003DFD");
        self.skills["SwiftStrike"]                      = SkillSlot(self.bars["Melee"],                 3, 1, true, 1, "0x7000300F");
    
    self.skills["SavageStrikes"]                = SkillSlot(self.bars["Fervor:ST"],     1, 1, true, { 2, 52 }, { "0x70003DFE", "0x7000F661" } );
    self.skills["BrutalStrikes"]                        = SkillSlot(self.bars["Fervor:ST"],     2, 1, true, 6, "0x70003E01");
    self.skills["RelentlessStrike"]             = SkillSlot(self.bars["Fervor:ST"],     3, 1, true, { 20, 62 }, { "0x70003E07", "0x7001F4B3" } );
    self.skills["FerociousStrikes"]             = SkillSlot(self.bars["Fervor:ST"],     4, 1, self.settings["Features"].ferocious, 41, "0x70002D8D");
        
    self.skills["BladeStorm"]                   = SkillSlot(self.bars["Fervor:AOE"],    1, 1, true, 10, "0x70003E03");
    self.skills["Cleave"]                               = SkillSlot(self.bars["Fervor:AOE"],    2, 1, true, { 16, 54 }, { "0x70003E05", "0x7000F660" } );
    self.skills["SoundTheAttack"]               = SkillSlot(self.bars["Fervor:AOE"],    3, 1, true, 34, "0x70003E0D");
    self.skills["RagingBlades"]                 = SkillSlot(self.bars["Fervor:AOE"],    4, 1, self.settings["Features"].raging, 41, "0x70002DA9");
    
    self.skills["BracingAttack"]                = SkillSlot(self.bars["Fervor:Util"],   3, 1, true, 1, "0x70003E04");
        self.skills["Clobber"]                          = SkillSlot(self.bars["Fervor:Util"],   1, 1, true, 2, "0x70003E0C");
    self.skills["Hamstring"]                    = SkillSlot(self.bars["Fervor:Util"],   2, 1, true, 3, "0x70003E0E" );
    
    self.skills["MercifulStrike"]               = SkillSlot(self.bars["Conditional"],   1, 1, true, 24, "0x70003E09");
    self.skills["FightingDirty"]                = SkillSlot(self.bars["Conditional"],   2, 1, true, 26, "0x70003E0A" );

    self.skills["SecondWind"]                   = SkillSlot(self.bars["Defeat"],                1, 1, false, 14, "0x7000D47A");
        self.skills["Heroics"]                          = SkillSlot(self.bars["Defeat"],                2, 1, false, { 40, 64 }, { "0x70009678", "0x70020DF3" } );
        self.skills["RedHaze"]                          = SkillSlot(self.bars["Defeat"],                3, 1, false, 50, "0x7000967D");
        
        self.skills["ArdentFlurry"]                     = SkillSlot(self.bars["Defeat"],                1, 2, false, 10, "0x7000D606");
        self.skills["GloriousExchange"]         = SkillSlot(self.bars["Defeat"],                2, 2, false, 30, "0x7000D626");
        self.skills["BlockingBlades"]           = SkillSlot(self.bars["Defeat"],                3, 2, false, 48, "0x70009679");
    
    self.skills["Flurry"]                               = SkillSlot(self.bars["Buffs"],                 1, 1, true, 4, "0x70003E00");
    self.skills["ExchangeOfBlows"]              = SkillSlot(self.bars["Buffs"],                 2, 1, true, 8, "0x70003E02");
        
    self.skills["BattleFrenzy"]                 = SkillSlot(self.bars["SelfBuffs"],     1, 1, true, 8, "0x70003043");
        self.skills["SuddenDefence"]            = SkillSlot(self.bars["SelfBuffs"],     2, 1, true, 18, "0x70003E06");
        self.skills["Sprint"]                           = SkillSlot(self.bars["SelfBuffs"],     3, 1, true, 28, "0x70003E0B");
        self.skills["DireNeed"]                         = SkillSlot(self.bars["SelfBuffs"],     4, 1, true, 30, "0x70003047");
    self.skills["FightOn"]                              = SkillSlot(self.bars["SelfBuffs"],     5, 1, self.settings["Features"].fighton, 41, "0x70002D9D");
        self.skills["FearNothing"]                      = SkillSlot(self.bars["SelfBuffs"],     6, 1, true, 46, "0x70021D27");
    self.skills["Adamant"]                              = SkillSlot(self.bars["SelfBuffs"],     7, 1, true, 56, "0x7000F70B");
    self.skills["GreatCleave"]                  = SkillSlot(self.bars["SelfBuffs"],     8, 1, true, 58, "0x7000F70C");
    self.skills["CBR"]                                  = SkillSlot(self.bars["SelfBuffs"],     9, 1, self.settings["Features"].cbr, 60, "0x7000F70A");
            
    self.skills["Challenge"]                    = SkillSlot(self.bars["Threat"],                1, 1, true, 22, "0x70003E08");
    self.skills["RisingIre"]                    = SkillSlot(self.bars["Threat"],                2, 1, true, 42, "0x70009E5C");
        self.skills["EbbingIre"]                        = SkillSlot(self.bars["Threat"],                3, 1, true, 44, "0x70009E5B");
        
    self.skills["Hedge"]                                = SkillSlot(self.bars["Stunned"],               1, 1, false, 38, "0x70003E0F");
    self.skills["BloodRage"]                    = SkillSlot(self.bars["Stunned"],               2, 1, false, 60, "0x7000F70E");
    
    self.skills["LetFly"]                               = SkillSlot(self.bars["Ranged"],                1, 1, true, 30, "0x70003E14");

    
        -- Build Stance Slot (Multi)        SkillMultiSlot(parent:SkillBar, x:int, y:int, active:Boolean);
    -- AddShortcut to Multi Slot        SkillMultiSlot:AddShortcut(skillname:String, level:int, hex:String);
    --                                  After Declaring Shortcuts you need to call LevelCheck to validate the levels
        --                                  LevelCheck should also be called on refresh;
        self.multi["StanceSlot"]           = SkillMultiSlot(self.bars["Stances"], 1, 1, true);
        self.multi["StanceSlot"]:AddShortCut("Fervour",                          4, "0x70003DFF");
    self.multi["StanceSlot"]:AddShortCut("Ardour",                              10, "0x7000D46C");
    self.multi["StanceSlot"]:AddShortCut("Glory",                               30, "0x7000967C");
    if (self.settings["Features"].controlled) then self.multi["StanceSlot"]:AddShortCut("ControlledBurn",       45, "0x70002DB5"); end
    self.multi["StanceSlot"]:LevelCheck();
        
        -- Combat States
        self.skills["Hamstring"]:SetCombat(true, false);
        self.skills["SuddenDefence"]:SetCombat(true, false);
        
        -- Stance Change Event
        AddCallback(vars.classattr, "StanceChanged", function(sender, args)
                KragenBars:StanceChange(vars.classattr:GetStance());
        end);
        
        -- Fervor Change Event
        AddCallback(vars.classattr, "FervorChanged", function(sender, args)
                KragenBars:FervorChange(vars.classattr:GetFervor());
        end);
        
        -- initial setup
        self:InitBars();
        self:FervorChange(vars.classattr:GetFervor());
        self:CombatChange(vars.player:IsInCombat());
        
        for i = 1, vars.effects:GetCount() do
                if(vars.effects:Get(i):GetName() == "Champion's Fervour") then
                        self:StanceChange(1);
                elseif(vars.effects:Get(i):GetName() == "Ardour") then
                        self:StanceChange(2);
                elseif(vars.effects:Get(i):GetName() == "Glory") then
                        self:StanceChange(3);
                else
                        self:StanceChange(0);
                end
        end
end

function ChampionBars:AddEffect( effectIndex )
        local addedeffect = vars.player:GetEffects():Get( effectIndex );

    -- SetState can be called on both bars and skills
        -- it will store the incoming effect id and flag the state as well as trigger visibility
        -- SetState(effectstate:Boolean,  visibility:Boolean,  effectid:int);
        
        -- Defeat Response
        if (addedeffect:GetName() == "Enemy Defeat Response") then
        self.bars["Defeat"]:SetState(true, addedeffect:GetID());
                
                self.skills["SecondWind"]:SetActive( true );
                self.skills["Heroics"]:SetActive( true );
                self.skills["RedHaze"]:SetActive( true );
            self.skills["ArdentFlurry"]:SetActive( (self.stance == 2 or self.controlledburnflag) and not self.skills["ArdentFlurry"].state);
            self.skills["GloriousExchange"]:SetActive( (self.stance == 3 or self.controlledburnflag) and not self.skills["GloriousExchange"].state);
            self.skills["BlockingBlades"]:SetActive( (self.stance ~= 1) and not self.skills["BlockingBlades"].state);
        
        -- Blocking Blades
        elseif (addedeffect:GetName() == "Blocking Blades") then
        self.skills["BlockingBlades"]:SetState(true, false, addedeffect:GetID());

        -- Ardent Flurry
        elseif (addedeffect:GetName() == "Ardent Flurry") then
                self.skills["ArdentFlurry"]:SetState(true, false, addedeffect:GetID());

    -- Glorious Exchange
        elseif (addedeffect:GetName() == "Glorious Exchange") then
        self.skills["GloriousExchange"]:SetState(true, false, addedeffect:GetID());
        
    -- Flurry
        elseif (addedeffect:GetName() == "Flurry" or addedeffect:GetName() == "Improved Flurry") then
                self.skills["Flurry"]:SetState(true, false, addedeffect:GetID());
            if (self.settings["Features"].buffwarning) then
                        self.skills["Flurry"]:StartTimer( addedeffect:GetDuration() * .70, true );
                end
                
    -- Exchange
        elseif (addedeffect:GetName() == "Exchange of Blows" or addedeffect:GetName() == "Improved Exchange of Blows") then
            self.skills["ExchangeOfBlows"]:SetState(true, false, addedeffect:GetID());
            if (self.settings["Features"].buffwarning) then
                        self.skills["ExchangeOfBlows"]:StartTimer( addedeffect:GetDuration() * .80, true );
                end
            
        -- Stunned, Dazed, Knocked Down
        elseif (addedeffect:GetName() == "Stunned" or addedeffect:GetName() == "Dazed" or addedeffect:GetName() == "Knocked Down") then
                self.skills["BloodRage"]:SetState(true, true, addedeffect:GetID());

        -- Disarmed
        elseif (addedeffect:GetName() == "Primary Weapon: Disarmed") then
                self.skills["Hedge"]:SetState(true, true, addedeffect:GetID());
                
        -- Silenced
        elseif (addedeffect:GetName() == "Silenced") then
                self.skills["Challenge"]:SetActive(false);

   -- Controlled Burn
        elseif (addedeffect:GetName() == "Controlled Burn") then
                self.controlledburnflag = true;
                self.skills["ArdentFlurry"]:SetActive(not self.skills["ArdentFlurry"].state);
                self.skills["GloriousExchange"]:SetActive(not self.skills["GloriousExchange"].state);
                self.skills["BlockingBlades"]:SetActive(not self.skills["BlockingBlades"].state);
                self.skills["Flurry"]:SetActive(false);
                self.skills["ExchangeOfBlows"]:SetActive(false);
                self.skills["Flurry"].timer:Stop();
                self.skills["ExchangeOfBlows"].timer:Stop();
                self.bars["Defeat"]:SetState(self.bars["Defeat"].state, self.bars["Defeat"].state, self.bars["Defeat"].id);
                self.multi["StanceSlot"]:SetActive( false );
                
        -- Great Cleave
        elseif (addedeffect:GetName() == "Great Cleave") then
                self.skills["GreatCleave"]:SetState(true, true, addedeffect:GetID());
                self:FervorChange(vars.classattr:GetFervor());
        
        -- Deathstorm
        elseif (addedeffect:GetName() == "Death Storm") then
            self.bars["Fervor:AOE"]:SetState(true, addedeffect:GetID());
                self:FervorChange(vars.classattr:GetFervor());
                
        -- Fear
        elseif (addedeffect:GetCategory() == Turbine.Gameplay.EffectCategory.Fear ) then
                self.fear = self.fear + 1;
                if (self.settings["Features"].fearindicator) then
                        self.skills["FearNothing"]:SetColor("purple");
                end
        
    end
        
end

function ChampionBars:RemoveEffect( effect )

    if (effect:GetName() == "Enemy Defeat Response") then
        self.bars["Defeat"]:SetState(false, effect:GetID());

                if (not self.bars["Defeat"].state) then
                    self.skills["SecondWind"]:SetActive( false );
                        self.skills["Heroics"]:SetActive( false );
                        self.skills["RedHaze"]:SetActive( false );
                        self.skills["ArdentFlurry"]:SetActive( false );
                    self.skills["GloriousExchange"]:SetActive( false );
                    self.skills["BlockingBlades"]:SetActive( false );
                end
            
        -- Blocking Blades
        elseif (effect:GetName() == "Blocking Blades") then
        self.skills["BlockingBlades"]:SetState(false, self.bars["Defeat"].state, effect:GetID());
        
    -- Ardent Flurry
    elseif (effect:GetName() == "Ardent Flurry") then
        self.skills["ArdentFlurry"]:SetState(false, self.bars["Defeat"].state, effect:GetID());

        -- Glorious Exchange
    elseif (effect:GetName() == "Glorious Exchange") then
        self.skills["GloriousExchange"]:SetState(false, self.bars["Defeat"].state, effect:GetID());
        
    -- Flurry
        elseif (effect:GetName() == "Flurry" or effect:GetName() == "Improved Flurry") then
        self.skills["Flurry"]:SetState(false, true, effect:GetID());
        if (self.stance == 2 or self.controlledburnflag) then
                self.skills["Flurry"]:SetActive( false );
                end

        -- Exchange
        elseif (effect:GetName() == "Exchange of Blows" or effect:GetName() == "Improved Exchange of Blows") then
        self.skills["ExchangeOfBlows"]:SetState(false, true, effect:GetID());
        if (self.stance == 3 or self.controlledburnflag) then
                self.skills["ExchangeOfBlows"]:SetActive( false );
                end
        
    -- Stunned, Dazed or Knocked Down
        elseif (effect:GetName() == "Stunned" or effect:GetName() == "Dazed" or effect:GetName() == "Knocked Down") then
                self.skills["BloodRage"]:SetState(false, false, effect:GetID());

        -- Disarmed
        elseif (effect:GetName() == "Primary Weapon: Disarmed") then
        self.skills["Hedge"]:SetState(false, false, effect:GetID());
        
    -- Silenced
        elseif (effect:GetName() == "Silenced") then
                self.skills["Challenge"]:SetActive(true);
        
    -- Controlled Burn
        elseif (effect:GetName() == "Controlled Burn") then
                self.controlledburnflag = false;
                self:StanceChange(vars.classattr:GetStance());
                
        -- Great Cleave
        elseif (effect:GetName() == "Great Cleave") then
        self.skills["GreatCleave"]:SetState(false, true, effect:GetID());
        self:FervorChange(vars.classattr:GetFervor());
        
    -- Disarmed
        elseif (effect:GetName() == "Death Storm") then
        self.bars["Fervor:AOE"]:SetState(false, effect:GetID());
        self:FervorChange(vars.classattr:GetFervor());
                
        -- Fear
        elseif (effect:GetCategory() == Turbine.Gameplay.EffectCategory.Fear ) then
                self.fear = self.fear - 1;
                if (self.fear == 0) then
                        self.skills["FearNothing"]:SetColor();
                end
        
        end

end

function ChampionBars:FervorChange(fervor)

        if (fervor == 0) then
                self.skills["SavageStrikes"]:SetActive(false);
                self.skills["BrutalStrikes"]:SetActive(false);
                self.skills["RelentlessStrike"]:SetActive(false);
                self.skills["FerociousStrikes"]:SetActive(false);
                
                self.skills["Cleave"]:SetActive(self.bars["Fervor:AOE"].state);
                self.skills["BladeStorm"]:SetActive(self.bars["Fervor:AOE"].state);
                self.skills["RagingBlades"]:SetActive(self.bars["Fervor:AOE"].state and self.settings["Features"].raging);
                self.skills["SoundTheAttack"]:SetActive(self.bars["Fervor:AOE"].state);
                
                self.skills["Clobber"]:SetActive(false);
                self.skills["Hamstring"]:SetActive(false);
                self.skills["BracingAttack"]:SetActive(false);
                
                self.skills["SuddenDefence"]:SetActive(false);
                
                self.skills["RisingIre"]:SetActive(false);
                self.skills["EbbingIre"]:SetActive(false);
                
                self.skills["GreatCleave"]:SetActive(false);
        elseif (fervor == 1) then
                self.skills["SavageStrikes"]:SetActive(false);
                self.skills["BrutalStrikes"]:SetActive(false);
                self.skills["RelentlessStrike"]:SetActive(false);
                self.skills["FerociousStrikes"]:SetActive(false);
                
                self.skills["Cleave"]:SetActive(self.bars["Fervor:AOE"].state or self.skills["GreatCleave"].state);
                self.skills["BladeStorm"]:SetActive(self.bars["Fervor:AOE"].state);
                self.skills["RagingBlades"]:SetActive(self.bars["Fervor:AOE"].state and self.settings["Features"].raging);
                self.skills["SoundTheAttack"]:SetActive(self.bars["Fervor:AOE"].state);
                
                self.skills["Clobber"]:SetActive(true);
                self.skills["Hamstring"]:SetActive(true);
                self.skills["BracingAttack"]:SetActive(false);
                
                self.skills["SuddenDefence"]:SetActive(true);
                
                self.skills["RisingIre"]:SetActive(false);
                self.skills["EbbingIre"]:SetActive(false);
                
                self.skills["GreatCleave"]:SetActive(false);
        elseif (fervor == 2) then
                self.skills["SavageStrikes"]:SetActive(true);
                self.skills["BrutalStrikes"]:SetActive(false);
                self.skills["RelentlessStrike"]:SetActive(false);
                self.skills["FerociousStrikes"]:SetActive(false);
                
                self.skills["Cleave"]:SetActive(true);
                self.skills["BladeStorm"]:SetActive(self.bars["Fervor:AOE"].state or (self.skills["GreatCleave"].state and self.settings["Features"].eyeofthestorm));
                self.skills["RagingBlades"]:SetActive(self.bars["Fervor:AOE"].state and self.settings["Features"].raging);
                self.skills["SoundTheAttack"]:SetActive(self.bars["Fervor:AOE"].state);
                
                self.skills["Clobber"]:SetActive(true);
                self.skills["Hamstring"]:SetActive(true);
                self.skills["BracingAttack"]:SetActive(false);
                
                self.skills["SuddenDefence"]:SetActive(true);
                
                self.skills["RisingIre"]:SetActive(true);
                self.skills["EbbingIre"]:SetActive(false);
                
                self.skills["GreatCleave"]:SetActive(false);
        elseif (fervor == 3) then
                self.skills["SavageStrikes"]:SetActive(true);
                self.skills["BrutalStrikes"]:SetActive(true);
                self.skills["RelentlessStrike"]:SetActive(false);
                self.skills["FerociousStrikes"]:SetActive(false);
                
                self.skills["Cleave"]:SetActive(true);
                self.skills["BladeStorm"]:SetActive(self.settings["Features"].eyeofthestorm or self.bars["Fervor:AOE"].state or self.skills["GreatCleave"].state);
                self.skills["RagingBlades"]:SetActive(self.bars["Fervor:AOE"].state and self.settings["Features"].raging);
                self.skills["SoundTheAttack"]:SetActive(self.bars["Fervor:AOE"].state);
                
                self.skills["Clobber"]:SetActive(true);
                self.skills["Hamstring"]:SetActive(true);
                self.skills["BracingAttack"]:SetActive(true);
                
                self.skills["SuddenDefence"]:SetActive(true);
                
                self.skills["RisingIre"]:SetActive(true);
                self.skills["EbbingIre"]:SetActive(false);
                
                self.skills["GreatCleave"]:SetActive(false);
        elseif (fervor == 4) then
                self.skills["SavageStrikes"]:SetActive(true);
                self.skills["BrutalStrikes"]:SetActive(true);
                self.skills["RelentlessStrike"]:SetActive(true);
                self.skills["FerociousStrikes"]:SetActive(false);
                
                self.skills["Cleave"]:SetActive(true);
                self.skills["BladeStorm"]:SetActive(true);
                self.skills["RagingBlades"]:SetActive((self.bars["Fervor:AOE"].state or self.skills["GreatCleave"].state) and self.settings["Features"].raging);
                self.skills["SoundTheAttack"]:SetActive(self.bars["Fervor:AOE"].state or self.skills["GreatCleave"].state);
                
                self.skills["Clobber"]:SetActive(true);
                self.skills["Hamstring"]:SetActive(true);
                self.skills["BracingAttack"]:SetActive(true);
                
                self.skills["SuddenDefence"]:SetActive(true);
                
                self.skills["RisingIre"]:SetActive(true);
                self.skills["EbbingIre"]:SetActive(true);
                
                self.skills["GreatCleave"]:SetActive(false);
        elseif (fervor == 5) then
                self.skills["SavageStrikes"]:SetActive(true);
                self.skills["BrutalStrikes"]:SetActive(true);
                self.skills["RelentlessStrike"]:SetActive(true);
                self.skills["FerociousStrikes"]:SetActive(self.settings["Features"].ferocious);
                
                self.skills["Cleave"]:SetActive(true);
                self.skills["BladeStorm"]:SetActive(true);
                self.skills["RagingBlades"]:SetActive(self.settings["Features"].raging);
                self.skills["SoundTheAttack"]:SetActive(true);
                
                self.skills["Clobber"]:SetActive(true);
                self.skills["Hamstring"]:SetActive(true);
                self.skills["BracingAttack"]:SetActive(true);
                
                self.skills["SuddenDefence"]:SetActive(true);
                
                self.skills["RisingIre"]:SetActive(true);
                self.skills["EbbingIre"]:SetActive(true);
                
                self.skills["GreatCleave"]:SetActive(true);
        end

end

function ChampionBars:StanceChange(stance)
        if (stance == 1) then
                self.skills["Flurry"]:SetActive(not self.skills["Flurry"].state);
                self.skills["ExchangeOfBlows"]:SetActive(not self.skills["ExchangeOfBlows"].state);
        elseif (stance == 2) then
                self.skills["ArdentFlurry"]:SetActive(not self.skills["ArdentFlurry"].state and self.bars["Defeat"].state);
                self.skills["GloriousExchange"]:SetActive(false);
                self.skills["BlockingBlades"]:SetActive(not self.skills["BlockingBlades"].state and self.bars["Defeat"].state);
                self.skills["Flurry"]:SetActive(false);
                self.skills["ExchangeOfBlows"]:SetActive(not self.skills["ExchangeOfBlows"].state);
                self.skills["Flurry"].timer:Stop();
        elseif (stance == 3) then
                self.skills["ArdentFlurry"]:SetActive(false);
                self.skills["GloriousExchange"]:SetActive(not self.skills["GloriousExchange"].state and self.bars["Defeat"].state);
                self.skills["BlockingBlades"]:SetActive(not self.skills["BlockingBlades"].state and self.bars["Defeat"].state);
                self.skills["Flurry"]:SetActive(not self.skills["Flurry"].state);
                self.skills["ExchangeOfBlows"]:SetActive(false);
                self.skills["ExchangeOfBlows"].timer:Stop();
        elseif (stance == 0) then
                self.skills["ArdentFlurry"]:SetActive(self.controlledburnflag and self.bars["Defeat"].state and not self.skills["ArdentFlurry"].state);
                self.skills["GloriousExchange"]:SetActive(self.controlledburnflag and self.bars["Defeat"].state and not self.skills["GloriousExchange"].state);
                self.skills["BlockingBlades"]:SetActive(not self.skills["BlockingBlades"].state and self.bars["Defeat"].state);
                self.skills["Flurry"]:SetActive(not self.controlledburnflag and not self.skills["Flurry"].state);
                self.skills["ExchangeOfBlows"]:SetActive(not self.controlledburnflag and not self.skills["ExchangeOfBlows"].state);
        end
        
        -- PRIMARY STANCE SWITCHING
        if ( self.settings["Features"].stancepriority ) then

                if (stance == self.settings["Features"].primarystance) then
                        self.multi["StanceSlot"]:SetIndex(self.settings["Features"].secondarystance);
                else
                    self.multi["StanceSlot"]:SetIndex(self.settings["Features"].primarystance);
                end
        end
        
        -- HOVER/DISAPPEAR SWITCHING
        if (stance == 0) then
                if (not self.controlledburnflag) then
                        self.multi["StanceSlot"]:SetHover( false );
                        self.multi["StanceSlot"]:SetActive( true );
                end
        else
        self.multi["StanceSlot"]:SetActive(self.settings["Features"].stanceactive ~= 3);
        self.multi["StanceSlot"]:SetHover(self.settings["Features"].stanceactive == 2);
        end
        
        self.stance = stance;
end

function ChampionBars:DefaultSettings()
        self.settings = { };

    self.settings["Melee"] =            {["active"] = true, ["x"] = 0, ["y"] = 0, ["rotate"] = 0 };
    self.settings["Fervor:ST"] =        {["active"] = true, ["x"] = 0, ["y"] = 0, ["rotate"] = 0 };
    self.settings["Fervor:AOE"] =       {["active"] = true, ["x"] = 0, ["y"] = 0, ["rotate"] = 0 };
    self.settings["Fervor:Util"] =      {["active"] = true, ["x"] = 0, ["y"] = 0, ["rotate"] = 0 };
    self.settings["Conditional"] =      {["active"] = true, ["x"] = 0, ["y"] = 0, ["rotate"] = 0 };
    self.settings["Defeat"] =           {["active"] = true, ["x"] = 0, ["y"] = 0, ["rotate"] = 0 };
    self.settings["Buffs"] =            {["active"] = true, ["x"] = 0, ["y"] = 0, ["rotate"] = 0 };
    self.settings["SelfBuffs"] =        {["active"] = true, ["x"] = 0, ["y"] = 0, ["rotate"] = 0 };
    self.settings["Threat"] =           {["active"] = true, ["x"] = 0, ["y"] = 0, ["rotate"] = 0 };
    self.settings["Stances"] =          {["active"] = true, ["x"] = 0, ["y"] = 0, ["rotate"] = 0 };
    self.settings["Stunned"] =          {["active"] = true, ["x"] = 0, ["y"] = 0, ["rotate"] = 0 };
    self.settings["Utility"] =          {["active"] = true, ["x"] = 0, ["y"] = 0, ["rotate"] = 0 };
    self.settings["Ranged"] =           {["active"] = true, ["x"] = 0, ["y"] = 0, ["rotate"] = 0 };

        self.settings["Features"] = { };
        self.settings["Features"].controlledburn = false;
        self.settings["Features"].ferocious = false;
        self.settings["Features"].raging = false;
        self.settings["Features"].fighton = false;
        self.settings["Features"].cbr = false;
        self.settings["Features"].eyeofthestorm = false;
        self.settings["Features"].buffwarning = true;
        self.settings["Features"].stanceactive = 2;
        self.settings["Features"].stancepriority = true;
        self.settings["Features"].fearindicator = true;
        self.settings["Features"].primarystance = 1;
        self.settings["Features"].secondarystance = 3;

end


function ChampionBars:UpdateSettings()
        if (settings.vers < 3.01) then
                
                if (self.settings["Features"].stancehover) then self.settings["Features"].stanceactive = 2; else if (self.settings["Features"].stancedisappear) then self.settings["Features"].stanceactive = 3; else self.settings["Features"].stanceactive = 1; end end
                
                self.settings["Features"].stancehover = nil;
                self.settings["Features"].stancedisappear = nil;
        end
        
        settings.vers = vars.vers;
end


function ChampionBars:ShowSetup()
        self.setup:SetVisible(true);

        self.setupbb.opacityslider:SetValue(settings.opacity * 100);
        self.setupbb.checkboxlock:SetChecked(settings.lockslots);
        self.setupbb.checkboxgrid:SetChecked(settings.snaptogrid);

        self.setupbb.checkboxbb1:SetText("Melee Skills");
        self.setupbb.checkboxbb1:SetChecked (self.settings["Melee"].active);
        self.setupbb.checkboxbb1:SetVisible(true);
        self.setupbb.checkboxbb2:SetText("Fervor: Single Target");
        self.setupbb.checkboxbb2:SetChecked (self.settings["Fervor:ST"].active);
        self.setupbb.checkboxbb2:SetVisible(true);
        self.setupbb.checkboxbb3:SetText("Fervor: AOE");
        self.setupbb.checkboxbb3:SetChecked (self.settings["Fervor:AOE"].active);
        self.setupbb.checkboxbb3:SetVisible(true);
        self.setupbb.checkboxbb4:SetText("Fervor: Utility");
        self.setupbb.checkboxbb4:SetChecked (self.settings["Fervor:Util"].active);
        self.setupbb.checkboxbb4:SetVisible(true);
    self.setupbb.checkboxbb5:SetText("Conditional");
        self.setupbb.checkboxbb5:SetChecked (self.settings["Conditional"].active);
        self.setupbb.checkboxbb5:SetVisible(true);
        self.setupbb.checkboxbb6:SetText("Defeat Response");
        self.setupbb.checkboxbb6:SetChecked (self.settings["Defeat"].active);
        self.setupbb.checkboxbb6:SetVisible(true);
        self.setupbb.checkboxbb7:SetText("Buffs");
        self.setupbb.checkboxbb7:SetChecked (self.settings["Buffs"].active);
        self.setupbb.checkboxbb7:SetVisible(true);
        self.setupbb.checkboxbb8:SetText("Self Buffs");
        self.setupbb.checkboxbb8:SetChecked (self.settings["SelfBuffs"].active);
        self.setupbb.checkboxbb8:SetVisible(true);
        self.setupbb.checkboxbb9:SetText("Threat");
        self.setupbb.checkboxbb9:SetChecked (self.settings["Threat"].active);
        self.setupbb.checkboxbb9:SetVisible(true);
        self.setupbb.checkboxbb10:SetText("Stances");
        self.setupbb.checkboxbb10:SetChecked (self.settings["Stances"].active);
        self.setupbb.checkboxbb10:SetVisible(true);
        self.setupbb.checkboxbb11:SetText("Stunned/Disarmed");
        self.setupbb.checkboxbb11:SetChecked (self.settings["Stunned"].active);
        self.setupbb.checkboxbb11:SetVisible(true);
        self.setupbb.checkboxbb12:SetText("Ranged");
        self.setupbb.checkboxbb12:SetChecked (self.settings["Ranged"].active);
        self.setupbb.checkboxbb12:SetVisible(true);

        self.setupf.checkboxf1:SetText("Controlled Burn");
        self.setupf.checkboxf1:SetChecked (self.settings["Features"].controlled);
        self.setupf.checkboxf1:SetVisible(true);
        
        self.setupf.checkboxf2:SetText("Ferocious Strikes");
        self.setupf.checkboxf2:SetChecked (self.settings["Features"].ferocious);
        self.setupf.checkboxf2:SetVisible(true);
        
        self.setupf.checkboxf3:SetText("Raging Blades");
        self.setupf.checkboxf3:SetChecked (self.settings["Features"].raging);
        self.setupf.checkboxf3:SetVisible(true);
        
        self.setupf.checkboxf4:SetText("Fight On");
        self.setupf.checkboxf4:SetChecked (self.settings["Features"].fighton);
        self.setupf.checkboxf4:SetVisible(true);
        
        self.setupf.checkboxf5:SetText("CBR");
        self.setupf.checkboxf5:SetChecked (self.settings["Features"].cbr);
        self.setupf.checkboxf5:SetVisible(true);
        
        self.setupf.checkboxf6:SetText("Eye of the Storm");
        self.setupf.checkboxf6:SetChecked (self.settings["Features"].eyeofthestorm);
        self.setupf.checkboxf6:SetVisible(true);
        
        self.setupf.checkboxf10:SetText("Buff Early Warning");
        self.setupf.checkboxf10:SetChecked (self.settings["Features"].buffwarning);
        self.setupf.checkboxf10:SetVisible(true);
        
        self.setupf.checkboxf11:SetText("Stance Priority");
        self.setupf.checkboxf11:SetChecked (self.settings["Features"].stancepriority);
        self.setupf.checkboxf11:SetVisible(true);
        
        self.setupf.checkboxf12:SetText("Fear Indicator");
        self.setupf.checkboxf12:SetChecked (self.settings["Features"].fearindicator);
        self.setupf.checkboxf12:SetVisible(true);
        
        if (not self.setupf.combo1box:IsVisible()) then
                self.setupf.combo1Label:SetText("Primary Stance");
                self.setupf.combo1Label:SetVisible(true);
                local combolist = {"Fervour", "Ardour", "Glory", "Controlled Burn"}
                for k,v in pairs(combolist) do
                    self.setupf.combo1box:AddItem(v, k);
                end
                self.setupf.combo1box:SetVisible(true);
        end
        self.setupf.combo1box:SetSelection(self.settings["Features"].primarystance);
        
        
        if (not self.setupf.combo2box:IsVisible()) then
                self.setupf.combo2Label:SetText("Secondary Stance");
                self.setupf.combo2Label:SetVisible(true);
                local combolist = {"Fervour", "Ardour", "Glory", "Controlled Burn"}
                for k,v in pairs(combolist) do
                    self.setupf.combo2box:AddItem(v, k);
                end
                self.setupf.combo2box:SetVisible(true);
        end
    self.setupf.combo2box:SetSelection(self.settings["Features"].secondarystance);
    
    if (not self.setupf.combo3box:IsVisible()) then
                self.setupf.combo3Label:SetText("Stance Active");
                self.setupf.combo3Label:SetVisible(true);
                local combolist = {"None", "Dim", "Hide"}
                for k,v in pairs(combolist) do
                        self.setupf.combo3box:AddItem(v, k);
                end
                self.setupf.combo3box:SetVisible(true);
        end
        self.setupf.combo3box:SetSelection(self.settings["Features"].stanceactive);

end


function ChampionBars:SetupClosing()
        settings.opacity = self.setupbb.opacityslider:GetValue() / 100;
        settings.lockslots = self.setupbb.checkboxlock:IsChecked();
        settings.snaptogrid = self.setupbb.checkboxgrid:IsChecked();
        
        self.settings["Melee"].active = self.setupbb.checkboxbb1:IsChecked();
    self.settings["Fervor:ST"].active = self.setupbb.checkboxbb2:IsChecked();
    self.settings["Fervor:AOE"].active = self.setupbb.checkboxbb3:IsChecked();
    self.settings["Fervor:Util"].active = self.setupbb.checkboxbb4:IsChecked();
    self.settings["Conditional"].active = self.setupbb.checkboxbb5:IsChecked();
    self.settings["Defeat"].active = self.setupbb.checkboxbb6:IsChecked();
    self.settings["Buffs"].active = self.setupbb.checkboxbb7:IsChecked();
    self.settings["SelfBuffs"].active = self.setupbb.checkboxbb8:IsChecked();
    self.settings["Threat"].active = self.setupbb.checkboxbb9:IsChecked();
    self.settings["Stances"].active = self.setupbb.checkboxbb10:IsChecked();
    self.settings["Stunned"].active = self.setupbb.checkboxbb11:IsChecked();
    self.settings["Ranged"].active = self.setupbb.checkboxbb12:IsChecked();

        self.settings["Features"].controlled = self.setupf.checkboxf1:IsChecked();
        self.settings["Features"].ferocious = self.setupf.checkboxf2:IsChecked();
        self.settings["Features"].raging = self.setupf.checkboxf3:IsChecked();
        self.settings["Features"].fighton = self.setupf.checkboxf4:IsChecked();
        self.settings["Features"].cbr = self.setupf.checkboxf5:IsChecked();
        self.settings["Features"].eyeofthestorm = self.setupf.checkboxf6:IsChecked();
    
        self.settings["Features"].buffwarning = self.setupf.checkboxf10:IsChecked();
    self.settings["Features"].stancepriority = self.setupf.checkboxf11:IsChecked();
    self.settings["Features"].fearindicator = self.setupf.checkboxf12:IsChecked();
    
        self.settings["Features"].primarystance = self.setupf.combo1box:GetSelection();
    self.settings["Features"].secondarystance = self.setupf.combo2box:GetSelection();
    self.settings["Features"].stanceactive = self.setupf.combo3box:GetSelection();

        self:SaveSettings();
        self:Refresh();

end


function ChampionBars:Refresh()

        self:RefreshBars();
        
        self.skills["FerociousStrikes"]:SetActive(self.settings["Features"].ferocious);
        self.skills["RagingBlades"]:SetActive(self.settings["Features"].raging);
        self.skills["FightOn"]:SetActive(self.settings["Features"].fighton);
        self.skills["CBR"]:SetActive(self.settings["Features"].cbr);

        -- Build Stance Slot (Multi)
        self.multi["StanceSlot"]:Clear();
        self.multi["StanceSlot"]:AddShortCut("Fervour",                          4, "0x70003DFF");
    self.multi["StanceSlot"]:AddShortCut("Ardour",                              10, "0x7000D46C");
    self.multi["StanceSlot"]:AddShortCut("Glory",                               30, "0x7000967C");
    if (self.settings["Features"].controlled) then self.multi["StanceSlot"]:AddShortCut("ControlledBurn",       45, "0x70002DB5"); end
    self.multi["StanceSlot"]:LevelCheck();
    
    if (self.settings["Features"].fearindicator and self.fear > 0) then
                self.skills["FearNothing"]:SetColor("purple");
        else
                self.skills["FearNothing"]:SetColor();
        end
    
    self:StanceChange(self.stance);
    self:CombatChange(vars.player:IsInCombat());
    self:FervorChange(vars.classattr:GetFervor());

        Turbine.Shell.WriteLine("KragenBars: Champion Bars refresh completed successfully.");

end

Compare with Previous | Blame


All times are GMT -5. The time now is 05:14 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui