lotrointerface.com
Search Downloads

LoTROInterface SVN KragenBars

[/] [trunk/] [KragenPlugs/] [KragenBars/] [ChampionBars.lua] - Rev 127

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 SPECIFIC VARIABLES
    self.fear = 0;
        self.stance = 0;
        
        self.effectlist = {};
        self.effectlist['EnemyDefeatResponse'] = Effect();
        self.effectlist['ArdentFlurry'] = Effect();
        self.effectlist['GloriousExchange'] = Effect();
        self.effectlist['Flurry'] = Effect();
        self.effectlist['ImprovedFlurry'] = Effect();
        self.effectlist['ExchangeOfBlows'] = Effect();
        self.effectlist['ImprovedExchange'] = Effect();
        self.effectlist['Stunned'] = Effect();
        self.effectlist['Dazed'] = Effect();
        self.effectlist['KnockedDown'] = Effect();
        self.effectlist['KnockedOut'] = Effect();
        self.effectlist['Rooted'] = Effect();
        self.effectlist['Silenced'] = Effect();
        self.effectlist['Disarmed'] = Effect();
        self.effectlist['ControlledBurn'] = Effect();
        self.effectlist['GreatCleave'] = Effect();
        self.effectlist['DeathStorm'] = Effect();
        self.effectlist['Fervor'] = Effect();
        self.effectlist['Ardor'] = Effect();
        self.effectlist['Glory'] = Effect();
        
        -- DEFINE THE EFFECT LIST BASED ON CLIENT LANGUAGE
        self.DefineEffectList = function()
                -- ENGLISH CLIENT
                if (settings.language == 1) then
                        self.effectlist['EnemyDefeatResponse']          :SetName('Enemy Defeat Response');
                        self.effectlist['Flurry']                                       :SetName('Flurry');
                        self.effectlist['ImprovedFlurry']                       :SetName('Improved Flurry');
                        self.effectlist['ExchangeOfBlows']                      :SetName('Exchange of Blows');
                        self.effectlist['GloriousExchange']                     :SetName('Glorious Exchange');
                        self.effectlist['ImprovedExchange']                     :SetName('Improved Exchange of Blows');
                        self.effectlist['Stunned']                                      :SetName('Stunned');
                        self.effectlist['Dazed']                                        :SetName('Dazed');      
                        self.effectlist['KnockedDown']                          :SetName('Knocked Down');
                        self.effectlist['KnockedOut']                           :SetName('Knocked Out');
                        self.effectlist['Rooted']                                       :SetName('Rooted');
                        self.effectlist['Silenced']                             :SetName('Silenced');
                        self.effectlist['Disarmed']                             :SetName('Primary Weapon: Disarmed');
                        self.effectlist['ControlledBurn']                       :SetName('Controlled Burn');
                        self.effectlist['GreatCleave']                          :SetName('Great Cleave');
                        self.effectlist['DeathStorm']                           :SetName('Death Storm');
                        self.effectlist['Fervor']                                       :SetName("Champion's Fervour");
                        self.effectlist['Ardor']                                        :SetName("Ardour");
                        self.effectlist['Glory']                                        :SetName("Glory");
                        
                -- FRENCH CLIENT
                elseif (settings.language == 2) then
                        self.effectlist['EnemyDefeatResponse']          :SetName('Evènement de défaite (ennemi)');
                        self.effectlist['Flurry']                                       :SetName('Rafale');
                        self.effectlist['ImprovedFlurry']                       :SetName('Rafale améliorée');
                        self.effectlist['ExchangeOfBlows']                      :SetName('Echange de coups');
                        self.effectlist['GloriousExchange']                     :SetName('Echange glorieux');
                        self.effectlist['ImprovedExchange']                     :SetName('Echange de coups am�lior�');
                        self.effectlist['Stunned']                                      :SetName('Etourdissement');
                        self.effectlist['Dazed']                                        :SetName('Hébété');  
                        self.effectlist['KnockedDown']                          :SetName('Renversé');
                        self.effectlist['KnockedOut']                           :SetName('Knocked Out');
                        self.effectlist['Rooted']                                       :SetName('Rooted');
                        self.effectlist['Silenced']                             :SetName('Silenced');
                        self.effectlist['Disarmed']                             :SetName('Arme primaire : Désarmée');
                        self.effectlist['ControlledBurn']                       :SetName('Brûlure Contrôlée');
                        self.effectlist['GreatCleave']                          :SetName('Great Cleave');
                        self.effectlist['DeathStorm']                           :SetName('Death Storm');
                        self.effectlist['Fervor']                                       :SetName("Ferveur du Champion (Ferveur tout court)");
                        self.effectlist['Ardor']                                        :SetName("Ardeur");
                        self.effectlist['Glory']                                        :SetName("Gloire");
                        
                -- GERMAN CLIENT
                elseif (settings.language == 3) then
                        self.effectlist['EnemyDefeatResponse']          :SetName('Erwiderung "Vernichtung des Gegners"');
                        self.effectlist['Flurry']                                       :SetName('Wirbel');
                        self.effectlist['ImprovedFlurry']                       :SetName('Verbesserung: Wirbel');
                        self.effectlist['ExchangeOfBlows']                      :SetName('Schlagabtausch');
                        self.effectlist['GloriousExchange']                     :SetName('Glorreicher Schlagabtausch');
                        self.effectlist['ImprovedExchange']                     :SetName('Verbesserung: Schlagabtausch');
                        self.effectlist['Stunned']                                      :SetName('Bewusstlos geschlagen');
                        self.effectlist['Dazed']                                        :SetName('Benommenheit');       
                        self.effectlist['KnockedDown']                          :SetName('Zu Boden geschlagen');
                        self.effectlist['KnockedOut']                           :SetName('Knocked Out');
                        self.effectlist['Rooted']                                       :SetName('Angewurzelt');
                        self.effectlist['Silenced']                             :SetName('Silenced');
                        self.effectlist['Disarmed']                             :SetName('Primärwaffe: Entwaffnet');
                        self.effectlist['ControlledBurn']                       :SetName('Kontrolliertes Verbrennen');
                        self.effectlist['GreatCleave']                          :SetName('Great Cleave');
                        self.effectlist['DeathStorm']                           :SetName('Death Storm');
                        self.effectlist['Fervor']                                       :SetName("Leidenschaft des Waffenmeisters");
                        self.effectlist['Ardor']                                        :SetName("Eifer");
                        self.effectlist['Glory']                                        :SetName("Ruhm");
                end
        end
        
        -- BUILD WINDOWS BARS SKILLS AND MULTIS --

        -- Build Skills
    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["BattleAcuity"]                 = SkillSlot(self.bars["Melee"],                 4, 1, true, { 44, 74 }, { "0x70003E0A", "0x7002A77B" });
    
    self.skills["SavageStrikes"]                = SkillSlot(self.bars["Fervor:ST"],     1, 1, true, { 2, 52, 68 }, { "0x70003DFE", "0x7000F661", "0x7002907D" } );
    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.traits["FerociousStrikes"].active, 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, { 18, 54 }, { "0x70003E05", "0x7000F660" } );
    self.skills["HornofGondor"]                 = SkillSlot(self.bars["Fervor:AOE"],    3, 1, true, 34, "0x70003E0D");
    self.skills["RagingBlades"]                 = SkillSlot(self.bars["Fervor:AOE"],    4, 1, self.settings.traits["RagingBlades"].active, 41, "0x70002DA9");
    
    self.skills["BracingAttack"]                = SkillSlot(self.bars["Fervor:Util"],   3, 1, true, 14, "0x70003E04");
        self.skills["Clobber"]                          = SkillSlot(self.bars["Fervor:Util"],   1, 1, true, 32, "0x70003E0C");
    self.skills["Hamstring"]                    = SkillSlot(self.bars["Fervor:Util"],   2, 1, true, 36, "0x70003E0E" );
    
    self.skills["MercifulStrike"]               = SkillSlot(self.bars["Conditional"],   1, 1, true, 24, "0x70003E09");

    self.skills["SecondWind"]                   = SkillSlot(self.bars["Defeat"],                1, 1, true, 16, "0x7000D47A");
        self.skills["Heroics"]                          = SkillSlot(self.bars["Defeat"],                2, 1, true, { 40, 64 }, { "0x70009678", "0x70020DF3" } );
        self.skills["RedHaze"]                          = SkillSlot(self.bars["Defeat"],                3, 1, false, 50, "0x7000967D");
        
    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, 12, "0x70003043");
        self.skills["SuddenDefence"]            = SkillSlot(self.bars["SelfBuffs"],     2, 1, true, 20, "0x70003E06");
        self.skills["Sprint"]                           = SkillSlot(self.bars["SelfBuffs"],     3, 1, true, 26, "0x70003E0B");
        self.skills["DireNeed"]                         = SkillSlot(self.bars["SelfBuffs"],     4, 1, true, { 28, 70 }, { "0x70003047", "0x7002A5E2" });
    self.skills["FightOn"]                              = SkillSlot(self.bars["SelfBuffs"],     5, 1, self.settings.traits["FightOn"].active, 41, "0x70002D9D");
        self.skills["FearNothing"]                      = SkillSlot(self.bars["SelfBuffs"],     6, 1, true, 46, "0x70021D27");
        self.skills["SeekingBlade"]                     = SkillSlot(self.bars["SelfBuffs"],     7, 1, true, { 48, 66 }, { "0x70009679", "0x70028FC6" });
    self.skills["Adamant"]                              = SkillSlot(self.bars["SelfBuffs"],     8, 1, true, 56, "0x7000F70B");
    self.skills["GreatCleave"]                  = SkillSlot(self.bars["SelfBuffs"],     9, 1, true, 58, "0x7000F70C");
    self.skills["CBR"]                                  = SkillSlot(self.bars["SelfBuffs"],     10, 1, self.settings.traits["CBR"].active, 60, "0x7000F70A");
            
    self.skills["Challenge"]                    = SkillSlot(self.bars["Threat"],                1, 1, true, 22, "0x70003E08");
        self.skills["EbbingIre"]                        = SkillSlot(self.bars["Threat"],                2, 1, true, 42, "0x70009E5B");
        
    self.skills["Hedge"]                                = SkillSlot(self.bars["Stunned"],               1, 1, false, { 30, 72 }, { "0x70003E0F", "0x7002A774" });
    self.skills["BloodRage"]                    = SkillSlot(self.bars["Stunned"],               2, 1, false, 60, "0x7000F70E");
    
    self.skills["LetFly"]                               = SkillSlot(self.bars["Ranged"],                1, 1, true, 18, "0x70003E14");
        
        self.skills["CraftedHorn"]                      = ItemSlot(self.bars["ClassItems"],     1, 1, true, self.settings.quickslots["CraftedHorn"]);
        self.skills["FervorPotions"]            = ItemSlot(self.bars["ClassItems"],     2, 1, true, self.settings.quickslots["FervorPotions"]);
    
        -- Build Stance Slot
        self.multi["StanceSlot"]           = SkillMultiSlot(self.bars["Stances"], 1, 1, true);
        self.multi["StanceSlot"]:AddShortCut("Fervour",                          4, "0x70003DFF");
    self.multi["StanceSlot"]:AddShortCut("Glory",                               20, "0x7000967C");
    self.multi["StanceSlot"]:AddShortCut("Ardour",                              30, "0x7000D46C");
    if (self.settings.traits["ControlledBurn"].active) then self.multi["StanceSlot"]:AddShortCut("ControlledBurn",      45, "0x70002DB5"); end
    self.multi["StanceSlot"]:LevelCheck();
        
        -- SET COMBAT STATES
        self.skills["Hamstring"]:SetCombat(true, false);
        self.skills["SuddenDefence"]:SetCombat(true, false);
        self.skills["SecondWind"]:SetCombat(true, false);
        
        -- ITEM MANAGER
        --self.itemmanager = ItemManager();
        --self.itemmanager:RegisterItem("Horn", { "Simple","Exquisite Simple","Carved","Exquisite Carved","Battle","Exquisite Battle","Combat","Exquisite Combat","War","Exquisite War","Campaign","Exquisite Campaign" }, {"Recipe", "Dwarrowdelf"}, self.skills["CraftedHorn"]);
        --self.itemmanager:RegisterItem("Potion of Fervour", { "Journeyman","Expert","Artisan","Master","Supreme" }, {"Recipe"}, self.skills["FervorPotions"]);
        --self.itemmanager:ParseItems();
        
        -- CLASS SPECIFIC SETUP/DEFAULT CODE
        
        
        -- CLASS SPECIFIC EVENTS
        
        -- Fervor Changed Event
        AddCallback(vars.classattr, "FervorChanged", function(sender, args)
                KragenBars:FervorChange(vars.classattr:GetFervor());
        end);
        
        
        -- INITIALIZE BARS
        self:InitBars();
        self:StanceChange(self.stance);
        self:FervorChange(vars.classattr:GetFervor());
        self:CombatChange(vars.player:IsInCombat());
        
end

-- ADD EFFECT EVENT
function ChampionBars:AddEffect( effectIndex )
        local effect = vars.player:GetEffects():Get( effectIndex );
        local effectname = effect:GetName();
        local effectid = effect:GetID();
        
        -- Defeat Response
        if (effectname == self.effectlist["EnemyDefeatResponse"]:GetName()) then
        if (self.effectlist["EnemyDefeatResponse"]:SetState( true, effectid )) then
                        self.skills["RedHaze"]:SetActive( not (self.settings.traits["SwifttoAnger"].active and self.stance == 3) );
                end
        
    -- Flurry
        elseif (effectname == self.effectlist["Flurry"]:GetName()) then
                if (self.effectlist["Flurry"]:SetState( true, effectid )) then
                        if (not (self.settings.traits["FlurryofBlows"].active and self.stance == 1)) then
                                self.skills["Flurry"]:SetActive(self.settings.defaults["BuffActive"].selected < 3);
                                if (self.settings.defaults["BuffActive"].selected == 2) then
                                        self.skills["Flurry"]:SetHover( true );
                                elseif (self.settings.defaults["BuffActive"].selected == 4) then
                                        self.skills["Flurry"]:StartTimer( effect:GetDuration() * .80, true );
                                end
                        end
                end
                
    -- Exchange
        elseif (effectname == self.effectlist["ExchangeOfBlows"]:GetName() or effectname == self.effectlist["GloriousExchange"]:GetName() or effectname == self.effectlist["ImprovedExchange"]:GetName()) then
            if (self.effectlist["ExchangeOfBlows"]:SetState( true, effectid )) then
                        if (not (self.settings.traits["Reprisal"].active and self.stance == 2)) then
                                self.skills["ExchangeOfBlows"]:SetActive(self.settings.defaults["BuffActive"].selected < 3);
                                if (self.settings.defaults["BuffActive"].selected == 2) then
                                        self.skills["ExchangeOfBlows"]:SetHover( true );
                                elseif (self.settings.defaults["BuffActive"].selected == 4) then
                                        self.skills["ExchangeOfBlows"]:StartTimer( effect:GetDuration() * .80, true );
                                end
                        end
                end
                
        -- Stances
        elseif (effectname == self.effectlist["Fervor"]:GetName()) then
                if (self.effectlist["Fervor"]:SetState( true, effectid )) then
                        self:StanceChange(1);
                end
                
        elseif (effectname == self.effectlist["Glory"]:GetName()) then
                if (self.effectlist["Glory"]:SetState( true, effectid )) then
                        self:StanceChange(2);
                end
            
        elseif (effectname == self.effectlist["Ardor"]:GetName()) then
                if (self.effectlist["Ardor"]:SetState( true, effectid )) then
                        self:StanceChange(3);
                end
                
   -- Controlled Burn
        elseif (effectname == self.effectlist["ControlledBurn"]:GetName()) then
                if (self.effectlist["ControlledBurn"]:SetState( true, effectid )) then
                        self:StanceChange(4);
                end
                
        -- Stunned, Dazed, Knocked Down
        elseif (effectname == self.effectlist["Stunned"]:GetName() or effectname == self.effectlist["Dazed"]:GetName() or effectname == self.effectlist["KnockedDown"]:GetName() or effectname == self.effectlist["KnockedOut"]:GetName() or effectname == self.effectlist["Rooted"]:GetName()) then
                if (self.effectlist["Stunned"]:SetState( true, effectid )) then
                        self.skills["BloodRage"]:SetActive( true );
                end

        -- Disarmed
        elseif (effectname == self.effectlist["Disarmed"]:GetName() or string.find(effectname, "Disarm") ~= nil) then
                if (self.effectlist["Disarmed"]:SetState( true, effectid )) then
                        self.skills["Hedge"]:SetActive( true );
                end
                
        -- Silenced
        elseif (effectname == self.effectlist["Silenced"]:GetName()) then
                if (self.effectlist["Silenced"]:SetState( true, effectid )) then
                        self.skills["Challenge"]:SetActive(false);
                end

        -- Great Cleave
        elseif (effectname == self.effectlist["GreatCleave"]:GetName()) then
                if (self.effectlist["GreatCleave"]:SetState( true, effectid )) then
                        self:FervorChange(vars.classattr:GetFervor());
                end
        
        -- Deathstorm
        elseif (effectname == self.effectlist["DeathStorm"]:GetName()) then
            if (self.effectlist["DeathStorm"]:SetState( true, effectid )) then
                        self:FervorChange(vars.classattr:GetFervor());
                end
                
        -- Fear
        elseif (effect:GetCategory() == Turbine.Gameplay.EffectCategory.Fear ) then
                self.fear = self.fear + 1;
                if (settings.skilldata["FearNothing"].parent ~= nil and vars.playerlevel >= self.skills["FearNothing"].level[1] and self.settings.features["FearIndicator"].active) then
                        if (self.settings.userconf[settings.skilldata["FearNothing"].parent].active) then
                                self.skills["FearNothing"]:SetColor("purple");
                        end
                end
        
    end
end

-- REMOVE EFFECT EVENT
function ChampionBars:RemoveEffect( effect )
        local effectname = effect:GetName();
        local effectid = effect:GetID();
        
    if (effectname == self.effectlist["EnemyDefeatResponse"]:GetName()) then
                if (not self.effectlist["EnemyDefeatResponse"]:SetState( false, effectid )) then
                        self.skills["RedHaze"]:SetActive( false );
                end
            
    -- Flurry
        elseif (effectname == self.effectlist["Flurry"]:GetName()) then
        if (not self.effectlist["Flurry"]:SetState( false, effectid )) then
                        self.skills["Flurry"]:SetActive( true );
                        self.skills["Flurry"]:SetHover(false);
                end

        -- Exchange
        elseif (effectname == self.effectlist["ExchangeOfBlows"]:GetName() or effectname == self.effectlist["GloriousExchange"]:GetName() or effectname == self.effectlist["ImprovedExchange"]:GetName()) then
        if (not self.effectlist["ExchangeOfBlows"]:SetState( false, effectid )) then
                        self.skills["ExchangeOfBlows"]:SetActive( true );
                        self.skills["ExchangeOfBlows"]:SetHover(false);
                end
                
        -- Stances
        elseif (effectname == self.effectlist["Fervor"]:GetName()) then
                if (not self.effectlist["Fervor"]:SetState( false, effectid )) then
                        self:StanceChange();
                end
                
        elseif (effectname == self.effectlist["Glory"]:GetName()) then
                if (not self.effectlist["Glory"]:SetState( false, effectid )) then
                        self:StanceChange();
                end
                
        elseif (effectname == self.effectlist["Ardor"]:GetName()) then
                if (not self.effectlist["Ardor"]:SetState( false, effectid )) then
                        self:StanceChange();
                end
                
    -- Controlled Burn
        elseif (effectname == self.effectlist["ControlledBurn"]:GetName()) then
                if (not self.effectlist["ControlledBurn"]:SetState( false, effectid )) then
                        self.multi["StanceSlot"]:SetActive( true );
                        self:StanceChange();
                end
                
    -- Stunned, Dazed or Knocked Down
        elseif (effectname == self.effectlist["Stunned"]:GetName() or effectname == self.effectlist["Dazed"]:GetName() or effectname == self.effectlist["KnockedDown"]:GetName() or effectname == self.effectlist["KnockedOut"]:GetName() or effectname == self.effectlist["Rooted"]:GetName()) then
                if (not self.effectlist["Stunned"]:SetState( false, effectid )) then
                        self.skills["BloodRage"]:SetActive( false );
                end

        -- Disarmed
        elseif (effectname == self.effectlist["Disarmed"]:GetName() or string.find(effectname, "Disarm") ~= nil) then
        if (not self.effectlist["Disarmed"]:SetState( false, effectid )) then
                        self.skills["Hedge"]:SetActive( false );
                end
        
    -- Silenced
        elseif (effectname == self.effectlist["Silenced"]:GetName()) then
                if (not self.effectlist["Silenced"]:SetState( false, effectid )) then
                        self.skills["Challenge"]:SetActive(true);
                end
        
        -- Great Cleave
        elseif (effectname == self.effectlist["GreatCleave"]:GetName()) then
        if (not self.effectlist["GreatCleave"]:SetState( false, effectid )) then
                        self:FervorChange(vars.classattr:GetFervor());
                end
        
    -- DeathStorm
        elseif (effectname == self.effectlist["DeathStorm"]:GetName()) then
        if (not self.effectlist["DeathStorm"]:SetState( false, effectid )) then
                        self:FervorChange(vars.classattr:GetFervor());
                end
                
        -- 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

-- FERVOR CHANGED EVENT
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.effectlist["DeathStorm"]:GetState());
                self.skills["BladeStorm"]:SetActive(self.effectlist["DeathStorm"]:GetState());
                self.skills["RagingBlades"]:SetActive(self.effectlist["DeathStorm"]:GetState() and self.settings.traits["RagingBlades"].active);
                self.skills["HornofGondor"]:SetActive(self.effectlist["DeathStorm"]:GetState());
                
                self.skills["Clobber"]:SetActive(false);
                self.skills["Hamstring"]:SetActive(false);
                self.skills["BracingAttack"]:SetActive(false);
                
                self.skills["SuddenDefence"]:SetActive(false);
                self.skills["Adamant"]: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.effectlist["DeathStorm"]:GetState() or self.effectlist["GreatCleave"]:GetState());
                self.skills["BladeStorm"]:SetActive(self.effectlist["DeathStorm"]:GetState());
                self.skills["RagingBlades"]:SetActive(self.effectlist["DeathStorm"]:GetState() and self.settings.traits["RagingBlades"].active);
                self.skills["HornofGondor"]:SetActive(self.effectlist["DeathStorm"]:GetState());
                
                self.skills["Clobber"]:SetActive(true);
                self.skills["Hamstring"]:SetActive(true);
                self.skills["BracingAttack"]:SetActive(false);
                
                self.skills["SuddenDefence"]:SetActive(true);
                self.skills["Adamant"]:SetActive(true);
                
                self.skills["EbbingIre"]:SetActive(false);
                
                self.skills["GreatCleave"]:SetActive(false);
        elseif (fervor == 2) then
                self.skills["SavageStrikes"]:SetActive(vars.playerlevel < 52);
                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.effectlist["DeathStorm"]:GetState() or (self.effectlist["GreatCleave"]:GetState() and self.settings.traits["EyeOfTheStorm"].active));
                self.skills["RagingBlades"]:SetActive(self.effectlist["DeathStorm"]:GetState() and self.settings.traits["RagingBlades"].active);
                self.skills["HornofGondor"]:SetActive(self.effectlist["DeathStorm"]:GetState());
                
                self.skills["Clobber"]:SetActive(true);
                self.skills["Hamstring"]:SetActive(true);
                self.skills["BracingAttack"]:SetActive(false);
                
                self.skills["SuddenDefence"]:SetActive(true);
                self.skills["Adamant"]: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.traits["EyeOfTheStorm"].active or self.effectlist["DeathStorm"]:GetState() or self.effectlist["GreatCleave"]:GetState());
                self.skills["RagingBlades"]:SetActive(self.effectlist["DeathStorm"]:GetState() and self.settings.traits["RagingBlades"].active);
                self.skills["HornofGondor"]:SetActive(self.effectlist["DeathStorm"]:GetState());
                
                self.skills["Clobber"]:SetActive(true);
                self.skills["Hamstring"]:SetActive(true);
                self.skills["BracingAttack"]:SetActive(true);
                
                self.skills["SuddenDefence"]:SetActive(true);
                self.skills["Adamant"]: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.effectlist["DeathStorm"]:GetState() or self.effectlist["GreatCleave"]:GetState()) and self.settings.traits["RagingBlades"].active);
                self.skills["HornofGondor"]:SetActive(self.effectlist["DeathStorm"]:GetState() or self.effectlist["GreatCleave"]:GetState());
                
                self.skills["Clobber"]:SetActive(true);
                self.skills["Hamstring"]:SetActive(true);
                self.skills["BracingAttack"]:SetActive(true);
                
                self.skills["SuddenDefence"]:SetActive(true);
                self.skills["Adamant"]: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.traits["FerociousStrikes"].active);
                
                self.skills["Cleave"]:SetActive(true);
                self.skills["BladeStorm"]:SetActive(true);
                self.skills["RagingBlades"]:SetActive(self.settings.traits["RagingBlades"].active);
                self.skills["HornofGondor"]:SetActive(true);
                
                self.skills["Clobber"]:SetActive(true);
                self.skills["Hamstring"]:SetActive(true);
                self.skills["BracingAttack"]:SetActive(true);
                
                self.skills["SuddenDefence"]:SetActive(true);
                self.skills["Adamant"]:SetActive(true);
                
                self.skills["EbbingIre"]:SetActive(true);
                
                self.skills["GreatCleave"]:SetActive(true);
        end

end

-- STANCE CHANGED EVENT
function ChampionBars:StanceChange(stance)
        
        if (stance == nil) then
                if (not self.effectlist["Fervor"]:GetState() and not self.effectlist["Ardor"]:GetState() and not self.effectlist["Glory"]:GetState() and not self.effectlist["ControlledBurn"]:GetState()) then
                        stance = 0;
                else
                        stance = self.stance;
                end
        end
        
        self.stance = stance;
        
        if (stance == 1) then
                self.skills["Flurry"]:SetActive(not self.effectlist["Flurry"]:GetState() and not self.settings.traits["FlurryofBlows"].active);
                self.skills["ExchangeOfBlows"]:SetActive(not self.effectlist["ExchangeOfBlows"]:GetState());
                self.skills["RedHaze"]:SetActive(self.effectlist["EnemyDefeatResponse"]:GetState());
        elseif (stance == 2) then
                self.skills["Flurry"]:SetActive(not self.effectlist["Flurry"]:GetState());
                self.skills["ExchangeOfBlows"]:SetActive(not self.effectlist["ExchangeOfBlows"]:GetState() and not self.settings.traits["Reprisal"].active);
                self.skills["RedHaze"]:SetActive(self.effectlist["EnemyDefeatResponse"]:GetState());
        elseif (stance == 3) then
                self.skills["Flurry"]:SetActive(not self.effectlist["Flurry"]:GetState());
                self.skills["ExchangeOfBlows"]:SetActive(not self.effectlist["ExchangeOfBlows"]:GetState());
                self.skills["RedHaze"]:SetActive(not self.settings.traits["SwifttoAnger"].active and self.effectlist["EnemyDefeatResponse"]:GetState());
        elseif (stance == 4) then
                self.skills["ExchangeOfBlows"]:SetActive(false);
                self.skills["ExchangeOfBlows"].timer:Stop();
                self.multi["StanceSlot"]:SetActive( false );
        elseif (stance == 0) then
                self.skills["Flurry"]:SetActive(not self.effectlist["Flurry"]:GetState());
                self.skills["ExchangeOfBlows"]:SetActive(not self.effectlist["ExchangeOfBlows"]:GetState());
        end
        
        -- PRIMARY STANCE SWITCHING
        if ( self.settings.features["StancePriority"].active ) then
                if (self.stance == self.settings.defaults["PrimaryStance"].selected) then
                        self.multi["StanceSlot"]:SetIndex(self.settings.defaults["SecondaryStance"].selected);
                else
                    self.multi["StanceSlot"]:SetIndex(self.settings.defaults["PrimaryStance"].selected);
                end
        end
        
        -- HOVER/DISAPPEAR SWITCHING
        if (self.stance == 0) then
                self.multi["StanceSlot"]:SetHover( false );
                self.multi["StanceSlot"]:SetActive( true );
        else
        self.multi["StanceSlot"]:SetActive(self.settings.defaults["StanceActive"].selected ~= 3);
        self.multi["StanceSlot"]:SetHover(self.settings.defaults["StanceActive"].selected == 2);
        end
        
        if (self.effectlist["ControlledBurn"]:GetState()) then
                self.multi["StanceSlot"]:SetActive( false );
        end
end

-- DEFAULT SETTINGS
function ChampionBars:DefaultSettings()
        self.settings = { preconf = { }, userconf = { }, traits = { }, features = { }, defaults = { }, quickslots = { } };
        
        self.settings.userconf["Melee"]                         = { id = 1,     name = "Melee",                         defpos = {1,4},         size={4,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["Fervor:ST"]             = { id = 2,     name = "Fervor: ST",            defpos = {5,4},         size={4,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["Fervor:AOE"]            = { id = 3,     name = "Fervor: AOE",           defpos = {1,3},         size={4,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["Fervor:Util"]           = { id = 4,     name = "Fervor: Utility",       defpos = {1,2},         size={3,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["Conditional"]           = { id = 5,     name = "Conditional",           defpos = {4,2},         size={1,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["Defeat"]                        = { id = 6,     name = "Defeat Responses",      defpos = {11,1},        size={3,2}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["Buffs"]                         = { id = 7,     name = "Buffs",                         defpos = {9,4},         size={2,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["SelfBuffs"]             = { id = 8,     name = "Self Buffs",            defpos = {1,1},         size={10,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["Threat"]                        = { id = 9,     name = "Threat",                        defpos = {5,3},         size={2,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["Stances"]                       = { id = 10,    name = "Stances",                       defpos = {12,4},        size={1,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["Stunned"]                       = { id = 11,    name = "Status Effect",         defpos = {11,3},        size={2,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["Ranged"]                        = { id = 12,    name = "Ranged",                        defpos = {10,3},        size={1,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["ClassItems"]            = { id = 13,    name = "ClassItems",            defpos = {8,3},         size={2,1}, pos = {0,0}, combat = {true,true}, active = true };
        
        self.settings.traits["ControlledBurn"]          = { id = 1, name = 'Controlled Burn', active = false };
        self.settings.traits["FerociousStrikes"]        = { id = 2, name = 'Ferocious Strikes', active = false };
        self.settings.traits["RagingBlades"]            = { id = 3, name = 'Raging Blades', active = false };
        self.settings.traits["FightOn"]                         = { id = 4, name = 'Fight On', active = false };
        self.settings.traits["CBR"]                                     = { id = 5, name = 'CBR', active = false };
        self.settings.traits["EyeOfTheStorm"]           = { id = 6, name = 'Eye of the Storm', active = false };
        self.settings.traits["SwifttoAnger"]            = { id = 7, name = 'Swift to Anger', active = false };
        self.settings.traits["FlurryofBlows"]           = { id = 8, name = 'Flurry of Blows', active = false };
        self.settings.traits["Reprisal"]                        = { id = 9, name = 'Reprisal', active = false };
        
        self.settings.features["StancePriority"]        = { id = 1, name = 'Stance Priority', active = true };
        self.settings.features["FearIndicator"]         = { id = 2, name = 'Fear Indicator', active = true };
        
        self.settings.defaults["PrimaryStance"]         = { id = 1, name = 'Primary Stance', selected = 1, list = { "Fervor", "Glory", "Ardor", "Controlled Burn" } };
        self.settings.defaults["SecondaryStance"]       = { id = 2, name = 'Secondary Stance', selected = 2, list = { "Fervor", "Glory", "Ardor", "Controlled Burn" } };
        self.settings.defaults["StanceActive"]          = { id = 3, name = 'Stance Active', selected = 2, list = { "None", "Dim", "Hide" } };
        self.settings.defaults["BuffActive"]            = { id = 4, name = 'Buff Active', selected = 4, list = { "None", "Dim", "Hide", "Early Warning" } };
        
        self.settings.quickslots["CraftedHorn"]         = {id = 1, name = "Crafted Horn", active = false, type = 0, data = ""};
        self.settings.quickslots["FervorPotions"]       = {id = 2, name = "Fervor Potions", active = false, type = 0, data = ""};

end

-- UPDATE SETTINGS
function ChampionBars:UpdateSettings()
        if (settings.vers < 3.01) then
                
                if (self.settings["Features"].stancehover) then self.settings.defaults["StanceActive"].selected = 2; else if (self.settings["Features"].stancedisappear) then self.settings.defaults["StanceActive"].selected = 3; else self.settings.defaults["StanceActive"].selected = 1; end end
                
                self.settings["Features"].stancehover = nil;
                self.settings["Features"].stancedisappear = nil;
        end
        if (settings.vers < 4.00) then
                local oldclassinfo = self.settings;
                self:DefaultSettings();
                for k,v in pairs(oldclassinfo) do
                        if (k ~= "Features" and k ~= "Quickslots") then
                                if (self.settings.preconf[k] == nil) then
                                        if (self.settings.userconf[k] ~= nil) then
                                                self.settings.userconf[k].pos = { v.x, v.y };
                                                self.settings.userconf[k].combat = { true, true };
                                                self.settings.userconf[k].active = v.active;
                                        end
                                else
                                        self.settings.preconf[k].pos = { v.x, v.y };
                                        self.settings.preconf[k].combat = { true, true };
                                        self.settings.preconf[k].active = v.active;
                                end
                        elseif (k == "Features") then
                                for key, value in pairs(v) do
                                        if (key == 'controlled') then
                                                self.settings.traits["ControlledBurn"].active = value;
                                        elseif (key == 'ferocious') then
                                                self.settings.traits["FerociousStrikes"].active = value;
                                        elseif (key == 'raging') then
                                                self.settings.traits["RagingBlades"].active = value;
                                        elseif (key == 'fighton') then
                                                self.settings.traits["FightOn"].active = value;
                                        elseif (key == 'cbr') then
                                                self.settings.traits["CBR"].active = value;
                                        elseif (key == 'eyeofthestorm') then
                                                self.settings.traits["EyeOfTheStorm"].active = value;
                                        elseif (key == 'fearindicator') then
                                                self.settings.features["FearIndicator"].active = value;
                                        elseif (key == 'stancepriority') then
                                                self.settings.features["StancePriority"].active = value;
                                        elseif (key == 'stanceactive') then
                                                self.settings.defaults["StanceActive"].selected = value;
                                        elseif (key == 'wardwarning') then
                                                if (value) then
                                                        self.settings.defaults["BuffActive"].selected = 4;
                                                else
                                                        self.settings.defaults["BuffActive"].selected = 3;
                                                end
                                        elseif (key == 'stanceactive') then
                                                self.settings.defaults["PrimaryStance"].selected = value;
                                        elseif (key == 'secondarystance') then
                                                self.settings.defaults["SecondaryStance"].selected = value;
                                        end
                                end
                        elseif (k == "Quickslots") then
                                for key, value in pairs(v) do
                                        if (key == 'horn') then
                                                self.settings.quickslots["CraftedHorn"].active = value.active;
                                                self.settings.quickslots["CraftedHorn"].type = value.type;
                                                self.settings.quickslots["CraftedHorn"].data = value.data;
                                        elseif (key == 'fervorpot') then
                                                self.settings.quickslots["FervorPotions"].active = value.active;
                                                self.settings.quickslots["FervorPotions"].type = value.type;
                                                self.settings.quickslots["FervorPotions"].data = value.data;
                                        end
                                end
                        end
                end
        end

        if (settings.vers < 5.00) then
                self.settings.traits["SwifttoAnger"]            = { id = 7, name = 'Swift to Anger', active = false };
                self.settings.traits["FlurryofBlows"]           = { id = 8, name = 'Flurry of Blows', active = false };
                self.settings.traits["Reprisal"]                        = { id = 9, name = 'Reprisal', active = false };
                self.settings.defaults["PrimaryStance"].list = { "Fervor", "Glory", "Ardor", "Controlled Burn" };
                self.settings.defaults["SecondaryStance"].list = { "Fervor", "Glory", "Ardor", "Controlled Burn" };
                if (self.settings.defaults["PrimaryStance"].selected == 2) then 
                        self.settings.defaults["PrimaryStance"].selected = 3;
                elseif (self.settings.defaults["PrimaryStance"].selected == 3) then
                        self.settings.defaults["PrimaryStance"].selected = 3;
                end
                if (self.settings.defaults["SecondaryStance"].selected == 2) then 
                        self.settings.defaults["SecondaryStance"].selected = 3;
                elseif (self.settings.defaults["SecondaryStance"].selected == 3) then
                        self.settings.defaults["SecondaryStance"].selected = 3;
                end
                settings.skilldata["HornofGondor"] = settings.skilldata["SoundtheAttack"];
                settings.skilldata["SoundtheAttack"] = nil;
                settings.skilldata["RisingIre"] = nil;
                settings.skilldata["BlockingBlades"] = nil;
                settings.skilldata["GloriousExchange"] = nil;
                settings.skilldata["FightingDirty"] = nil;
                settings.skilldata["ArdentFlurry"] = nil;
                if (self.settings.userconf["Melee"] ~= nil) then
                        if (self.settings.userconf["Melee"].size[1] < 12) then 
                                self.settings.userconf["Melee"].size[1] = self.settings.userconf["Melee"].size[1] + 1;
                                settings.skilldata["BattleAcuity"] = { parent = "Melee", pos = { self.settings.userconf["Melee"].size[1],1 } };
                        end
                end
                if (self.settings.userconf["SelfBuffs"] ~= nil) then
                        if (self.settings.userconf["SelfBuffs"].size[1] < 12) then 
                                self.settings.userconf["SelfBuffs"].size[1] = self.settings.userconf["SelfBuffs"].size[1] + 1;
                                settings.skilldata["SeekingBlade"] = { parent = "SelfBuffs", pos = { self.settings.userconf["SelfBuffs"].size[1],1 } };
                        end
                end
        end
        
        settings.vers = vars.vers;
end

-- REFRESH SKILLS AND BARS
function ChampionBars:Refresh()

        -- GENERIC REFRESH (Required for all classes)
        self:RefreshBars();
        
        -- REDEFINE EFFECTLIST IN CASE OF LANGUAGE CHANGE
        self.DefineEffectList();
        
        -- CLASS SPECIFIC REFRESH
        -- Setup Features
        self.skills["FerociousStrikes"]:SetActive(self.settings.traits["FerociousStrikes"].active);
        self.skills["RagingBlades"]:SetActive(self.settings.traits["RagingBlades"].active);
        self.skills["FightOn"]:SetActive(self.settings.traits["FightOn"].active);
        self.skills["CBR"]:SetActive(self.settings.traits["CBR"].active);
        
        self.skills["CraftedHorn"]:SetQuickslot(self.settings.quickslots["CraftedHorn"]);
        self.skills["FervorPotions"]:SetQuickslot(self.settings.quickslots["FervorPotions"]);

        -- Rebuild Stance Slot (Multi)
        self.multi["StanceSlot"]:Clear();
        self.multi["StanceSlot"]:AddShortCut("Fervour",                          4, "0x70003DFF");
    self.multi["StanceSlot"]:AddShortCut("Glory",                               20, "0x7000967C");
    self.multi["StanceSlot"]:AddShortCut("Ardour",                              30, "0x7000D46C");
    if (self.settings.traits["ControlledBurn"].active) then self.multi["StanceSlot"]:AddShortCut("ControlledBurn",      45, "0x70002DB5"); end
    self.multi["StanceSlot"]:LevelCheck();
    
        -- Set Fear Indicator
        if (settings.skilldata["FearNothing"].parent ~= nil and vars.playerlevel >= self.skills["FearNothing"].level[1] and self.settings.features["FearIndicator"].active and self.fear > 0) then
                if (self.settings.userconf[settings.skilldata["FearNothing"].parent].active) then
                        self.skills["FearNothing"]:SetColor("purple");
                end
        else
                self.skills["FearNothing"]:SetColor();
        end
    
        -- Refresh States
        self:StanceChange(self.stance);
    self:CombatChange(vars.player:IsInCombat());
    self:FervorChange(vars.classattr:GetFervor());

end

Compare with Previous | Blame


All times are GMT -5. The time now is 02:06 PM.


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