lotrointerface.com
Search Downloads

LoTROInterface SVN KragenBars

[/] [trunk/] [KragenPlugs/] [KragenBars/] [RuneBars.lua] - Rev 133

Go to most recent revision | Compare with Previous | Blame | View Log

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

RuneBars = class( KragenPlugs.KragenBars.ClassBar );

function RuneBars:Constructor()
        
        KragenPlugs.KragenBars.ClassBar.Constructor( self );
    
        -- CLASS SPECIFIC VARIABLES
        self.lightningbuffs = 0;
        self.effectlist = { };
        self.effectlist["CalmingVerse"] = Effect();
        self.effectlist["MasterofWrits"] = Effect();
        
        -- DEFINE THE EFFECT LIST BASED ON CLIENT LANGUAGE
        self.DefineEffectList = function()
                -- ENGLISH CLIENT
                if (settings.language == 1) then
                        self.effectlist["CalmingVerse"]         :SetName("Calming Verse");
                        self.effectlist["MasterofWrits"]        :SetName("Master of Writs");
                elseif (settings.language == 2) then
                        self.effectlist["CalmingVerse"]         :SetName("Calming Verse");
                        self.effectlist["MasterofWrits"]        :SetName("Master of Writs");
                        Turbine.Shell.WriteLine("Some features may not function with the French Client.  If you would like to help with French effect names goto http://www.lotrointerface.com/downloads/info384-KragenBars.html");
                elseif (settings.language == 3) then
                        self.effectlist["CalmingVerse"]         :SetName("Calming Verse");
                        self.effectlist["MasterofWrits"]        :SetName("Master of Writs");
                        Turbine.Shell.WriteLine("Some features may not function with the German Client.  If you would like to help with German effect names goto http://www.lotrointerface.com/downloads/info384-KragenBars.html");
                end
        end
        
        
    -- BUILD WINDOWS BARS SKILLS AND MULTIS --
    
    -- Build Bars           SkillBar( parent:SkillWindow, x:int, y:int, width:int, height:int, active:Boolean, exclusive:boolean);    
    self.bars["OffAttunement"]          = SkillBar(self.windows["OffAttunement"],       1, 1, 4, 1, true, true);
        self.bars["BattleStorm"]        = SkillBar(self.windows["Attunement"],          1, 1, 7, 1, true, true);
        self.bars["Healing"]                    = SkillBar(self.windows["Attunement"],          1, 1, 8, 1, true, true);
    
        -- Build Skills         SkillSlot( parent:SkillBar, x:int, y:int, active:Boolean, level:int, hexcode:String );
    self.skills["ShockingTouch"]                        = SkillSlot(self.bars["CenterControl"],         1, 1, true, 8, "0x7000F488");
    self.skills["FinalWord"]                            = SkillSlot(self.bars["CenterControl"],         2, 1, true, { 30, 52 }, { "0x70017EEB", "0x70018775" });
    
    self.skills["ArmourofStorm"]                        = SkillSlot(self.bars["CenterBuffs"],           1, 1, true, 10, "0x7000F33A");
    self.skills["WeaponofStorm"]                        = SkillSlot(self.bars["CenterBuffs"],           2, 1, true, { 34, 64 }, { "0x7000F33D", "0x70020DFC" });
    
    self.skills["CalmingVerse"]                         = SkillSlot(self.bars["CenterDethreat"],        1, 1, true, 26, "0x7000E996");
    self.skills["DistractingWinds"]                     = SkillSlot(self.bars["CenterDethreat"],        2, 1, true, 22, "0x7000EC5D");
 
        self.skills["TheBladewillnotWound"]             = SkillSlot(self.bars["CenterForetell"],        1, 1, true, 40, "0x7000F2A1");
    self.skills["TheFangwillnotPoison"]         = SkillSlot(self.bars["CenterForetell"],        2, 1, true, 44, "0x7000F2A0");
    self.skills["DoNotFalltoStorm"]                     = SkillSlot(self.bars["CenterForetell"],        3, 1, true, 46, "0x7000F343");
    self.skills["DoNotFallThisDay"]                     = SkillSlot(self.bars["CenterForetell"],        4, 1, true, { 50, 62 }, { "0x7000F25D", "0x7001F4A0" });
    
    self.skills["FalltoStorm"]                          = SkillSlot(self.bars["CenterVision"],          1, 1, true, 8, "0x7000F340");
    self.skills["FalltoOurWrath"]                       = SkillSlot(self.bars["CenterVision"],          2, 1, self.settings.traits["FallToOurWrath"].active, 41, "0x700180F3");
        
    self.skills["Selfmotivation"]                       = SkillSlot(self.bars["CenterSelf"],            1, 1, true, 14, "0x7000E037");
    self.skills["MasterofWrits"]                        = SkillSlot(self.bars["CenterSelf"],            2, 1, true, 40, "0x70024D37");
    self.skills["SteadyHands"]                          = SkillSlot(self.bars["CenterSelf"],            3, 1, self.settings.traits["SteadyHands"].active, 41, "0x700180F2");
        
    self.skills["ScribesSpark"]                         = SkillSlot(self.bars["BattleStorm"],           1, 1, true, 1, "0x7000EEAD");
    self.skills["ShockingWords"]                        = SkillSlot(self.bars["BattleStorm"],           2, 1, true, 2, "0x7000EEAE");
        self.skills["CeaselessArgument"]                = SkillSlot(self.bars["BattleStorm"],           3, 1, true, 4, "0x7000EEAC");
        self.skills["EssenceofStorm"]                   = SkillSlot(self.bars["BattleStorm"],           4, 1, true, 16, "0x7000EEAB");
    self.skills["EpicConclusion"]                       = SkillSlot(self.bars["BattleStorm"],           5, 1, true, 20, "0x7000EEAF");
    self.skills["SustainingBolt"]                       = SkillSlot(self.bars["BattleStorm"],           6, 1, true, { 30, 70 }, { "0x70024D3A", "0x70029CFC" });
        self.skills["VividImagery"]                             = SkillSlot(self.bars["BattleStorm"],           7, 1, true, 56, "0x700180F9");

    self.skills["ChillingRhetoric"]                     = SkillSlot(self.bars["BattleFrost"],           1, 1, true, 6, "0x7000EE02");
    self.skills["WritofCold"]                           = SkillSlot(self.bars["BattleFrost"],           2, 1, true, 12, "0x7000EE00");
        self.skills["EssenceofWinter"]                  = SkillSlot(self.bars["BattleFrost"],           3, 1, true, 24, "0x7000EE01");
    self.skills["FrozenEpilogue"]                       = SkillSlot(self.bars["BattleFrost"],           4, 1, true, 32, "0x7000EE03");
    self.skills["FlurryofWords"]                        = SkillSlot(self.bars["BattleFrost"],           5, 1, true, 38, "0x7000EDFF");

    self.skills["FieryRidicule"]                        = SkillSlot(self.bars["BattleFlame"],           1, 1, true, 1, "0x7000E96B");
    self.skills["WritofFire"]                           = SkillSlot(self.bars["BattleFlame"],           2, 1, true, 22, "0x7000EFF0");
    self.skills["ScathingMockery"]                      = SkillSlot(self.bars["BattleFlame"],           3, 1, true, { 28, 72 }, { "0x7000E969", "0x70029CF9" });
    self.skills["EssenceofFlame"]                       = SkillSlot(self.bars["BattleFlame"],           4, 1, true, 36, "0x7000EFEF");
    self.skills["SmoulderingWrath"]                     = SkillSlot(self.bars["BattleFlame"],           5, 1, true, 40, "0x7000E96D");
    self.skills["EssayofFire"]                          = SkillSlot(self.bars["BattleFlame"],           6, 1, true, { 50, 66 }, { "0x70024D39", "0x70029CF7" });
    self.skills["DistractingFlame"]                     = SkillSlot(self.bars["BattleFlame"],           7, 1, true, 60, "0x700180F5");
    
    self.skills["PreludetoHope"]                        = SkillSlot(self.bars["Healing"],                       1, 1, true, { 1, 68 }, { "0x7000EEAA", "0x70029CFB" });
    self.skills["RuneofRestoration"]            = SkillSlot(self.bars["Healing"],                       2, 1, true, 4, "0x7000EEA5");
    self.skills["MendingVerse"]                         = SkillSlot(self.bars["Healing"],                       3, 1, true, 10, "0x7000EEA8");
    self.skills["WritofHealth"]                         = SkillSlot(self.bars["Healing"],                       4, 1, true, 12, "0x7000EEA9");
        self.skills["RousingWords"]                             = SkillSlot(self.bars["Healing"],                       5, 1, true, { 14, 74}, { "0x7000EEA4", "0x70029CFA" });
        self.skills["EpicfortheAges"]                   = SkillSlot(self.bars["Healing"],                       6, 1, true, 18, "0x7000EEA6");
        self.skills["WordofExaltation"]                 = SkillSlot(self.bars["Healing"],                       7, 1, true, 28, "0x7000EEA7");
    self.skills["EssayofExaltation"]            = SkillSlot(self.bars["Healing"],                       8, 1, true, 42, "0x70018636");
        
        self.skills["NothingTrulyEnds"]                 = SkillSlot(self.bars["HealForetell"],          1, 1, true, 20, "0x7000EDA1");
    self.skills["OurFatesEntwined"]                     = SkillSlot(self.bars["HealForetell"],          2, 1, true, { 48, 54 }, { "0x7000EDA7", "0x70018776" });
    self.skills["GloriousForeshadowing"]        = SkillSlot(self.bars["HealForetell"],          3, 1, true, 58, "0x700180F7");
    self.skills["ThatWhichDoesNotKillUs"]       = SkillSlot(self.bars["HealForetell"],          4, 1, self.settings.traits["ThatWhichDoesNotKillUs"].active, 45, "0x700180F4");
    
        -- SET COMBAT STATES
        self.skills["DistractingWinds"]:SetCombat(true, false);
        self.skills["FinalWord"]:SetCombat(true, false);
        self.skills["WritofHealth"]:SetCombat(true, false);
        self.skills["RousingWords"]:SetCombat(true, false);
        self.skills["EpicfortheAges"]:SetCombat(true, false);
        self.skills["WordofExaltation"]:SetCombat(true, false);
        self.skills["EssayofExaltation"]:SetCombat(true, false);
        self.skills["NothingTrulyEnds"]:SetCombat(false, true);

        -- CLASS SPECIFIC SETUP/DEFAULT CODE
        
        
    -- CLASS SPECIFIC EVENTS

        -- Attunement Tracking Event
        AddCallback(vars.classattr, "AttunementChanged", function(sender, args)
                KragenBars:AttunementChanged();
        end);

        -- INITIALIZE BARS
        self:InitBars();
        self:CombatChange(vars.player:IsInCombat());
        self:AttunementChanged();
        
        if (not self.settings.features["DynamicAttunement"].active) then
                self.bars["OffAttunement"]:SetZOrder(-10);
                self.bars["BattleStorm"]:SetParent(self.windows["OffAttunement"]);
                self.bars["BattleStorm"].parent = self.windows["OffAttunement"];
                self.windows["OffAttunement"]:SetSize(self.bars["BattleStorm"]:GetWidth(), self.bars["Healing"]:GetHeight());
                self.windows["OffAttunement"].dragBar:Refresh();
        end
        
end


-- ADD EFFECT EVENT
function RuneBars:AddEffect( effectIndex )
        local effect = vars.player:GetEffects():Get( effectIndex );
        local effectname = effect:GetName();
        local effectid = effect:GetID();

        if (effectname == self.effectlist["CalmingVerse"]:GetName() and self.settings.features["HideCalmingVerse"].active) then
                if (self.effectlist["CalmingVerse"]:SetState( true, effectid )) then
                        self.skills["CalmingVerse"]:SetActive( false );
                end
                
        elseif (effectname == self.effectlist["MasterofWrits"]:GetName() and self.settings.features["DimMasterOfWrits"].active) then
                if (self.effectlist["MasterofWrits"]:SetState( true, effectid )) then
                        self.skills["WritofFire"]:SetActive( true );
                        self.skills["WritofCold"]:SetActive( true );
                        self.skills["WritofHealth"]:SetActive( vars.player:IsInCombat() );
                        self.skills["MasterofWrits"]:SetHover( true );
                end
                
    end
end

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

        elseif (effectname == self.effectlist["MasterofWrits"]:GetName()) then
                if (not self.effectlist["MasterofWrits"]:SetState( false, effectid )) then
                        self.skills["WritofFire"]:SetActive( vars.classattr:GetAttunement() <= 7 );
                        self.skills["WritofCold"]:SetActive( vars.classattr:GetAttunement() <= 7);
                        self.skills["WritofHealth"]:SetActive( vars.classattr:GetAttunement() >= 13 );
                        self.skills["MasterofWrits"]:SetHover( false );
                end
                
        end
end


-- ATTUNEMENT CHANGED EVENT
function RuneBars:AttunementChanged()
        local attune = vars.classattr:GetAttunement();
        if (attune < 10) then
                if (self.settings.features["DynamicAttunement"].active) then
                        self.skills["ScribesSpark"]:SetParent(self.bars["BattleStorm"]);
                        self.skills["ScribesSpark"]:SetPosition((self.skills["ScribesSpark"].x - 1) * 35, (self.skills["ScribesSpark"].y - 1) * 35);
                        self.skills["CeaselessArgument"]:SetParent(self.bars["BattleStorm"]);
                        self.skills["CeaselessArgument"]:SetPosition((self.skills["CeaselessArgument"].x - 1) * 35, (self.skills["CeaselessArgument"].y - 1) * 35);

                        self.skills["PreludetoHope"]:SetParent(self.bars["OffAttunement"]);
                        self.skills["PreludetoHope"]:SetPosition(0, 0);
                        self.skills["RuneofRestoration"]:SetParent(self.bars["OffAttunement"]);
                        self.skills["RuneofRestoration"]:SetPosition(35, 0);
                        self.skills["MendingVerse"]:SetParent(self.bars["OffAttunement"]);
                        self.skills["MendingVerse"]:SetPosition(70, 0);
                        self.skills["WritofHealth"]:SetParent(self.bars["OffAttunement"]);
                        self.skills["WritofHealth"]:SetPosition(105, 0);
                        
                        self.bars["BattleStorm"]:SetZOrder(0);
                        self.bars["Healing"]:SetZOrder(-5);
                end

                self.skills["ChillingRhetoric"]:SetActive(self.settings.traits["SolitaryThunderx2"].active);
                self.skills["FieryRidicule"]:SetActive(self.settings.traits["CleansingFiresx2"].active);
        
                self.skills["PreludetoHope"]:SetActive(true);
                self.skills["RuneofRestoration"]:SetActive(self.settings.traits["BenedictionsofPeacex2"].active);       
                self.skills["MendingVerse"]:SetActive(false);
                self.skills["WritofHealth"]:SetActive( self.effectlist["MasterofWrits"]:GetState() );
                self.skills["RousingWords"]:SetActive(false);
                self.skills["GloriousForeshadowing"]:SetActive(false);
                self.skills["EpicfortheAges"]:SetActive(false);
                self.skills["WordofExaltation"]:SetActive(false);
                self.skills["EssayofExaltation"]:SetActive(false);
                self.skills["OurFatesEntwined"]:SetActive(false);
                self.skills["ThatWhichDoesNotKillUs"]:SetActive(false);
        elseif (attune > 10 and attune < 13) then
                self.skills["ChillingRhetoric"]:SetActive(self.settings.traits["SolitaryThunderx2"].active);
                self.skills["FieryRidicule"]:SetActive(self.settings.traits["CleansingFiresx2"].active);

                self.skills["PreludetoHope"]:SetActive(true);
                self.skills["RuneofRestoration"]:SetActive(true);
                self.skills["MendingVerse"]:SetActive(true);
                self.skills["WritofHealth"]:SetActive( self.effectlist["MasterofWrits"]:GetState() );
                self.skills["RousingWords"]:SetActive(false);
                self.skills["GloriousForeshadowing"]:SetActive(false);
                self.skills["EpicfortheAges"]:SetActive(false);
                self.skills["WordofExaltation"]:SetActive(false);
                self.skills["EssayofExaltation"]:SetActive(false);
                self.skills["OurFatesEntwined"]:SetActive(false);
                self.skills["ThatWhichDoesNotKillUs"]:SetActive(false);
        elseif (attune >= 13 and attune < 16) then
                self.skills["ChillingRhetoric"]:SetActive(self.settings.traits["SolitaryThunderx2"].active);
                self.skills["FieryRidicule"]:SetActive(self.settings.traits["CleansingFiresx2"].active);

        self.skills["PreludetoHope"]:SetActive(true);
                self.skills["RuneofRestoration"]:SetActive(true);
                self.skills["MendingVerse"]:SetActive(true);
                self.skills["WritofHealth"]:SetActive(true);
                self.skills["RousingWords"]:SetActive(true);
                self.skills["GloriousForeshadowing"]:SetActive(false);
                self.skills["EpicfortheAges"]:SetActive(false);
                self.skills["WordofExaltation"]:SetActive(false);
                self.skills["EssayofExaltation"]:SetActive(false);
                self.skills["OurFatesEntwined"]:SetActive(false);
                self.skills["ThatWhichDoesNotKillUs"]:SetActive(false);
        elseif (attune >= 16 and attune < 19) then
                self.skills["ChillingRhetoric"]:SetActive(self.settings.traits["SolitaryThunderx2"].active);
                self.skills["FieryRidicule"]:SetActive(self.settings.traits["CleansingFiresx2"].active);

        self.skills["PreludetoHope"]:SetActive(true);
                self.skills["RuneofRestoration"]:SetActive(true);
                self.skills["MendingVerse"]:SetActive(true);
                self.skills["WritofHealth"]:SetActive(true);
                self.skills["RousingWords"]:SetActive(true);
                self.skills["GloriousForeshadowing"]:SetActive(true);
                self.skills["EpicfortheAges"]:SetActive(true);
                self.skills["WordofExaltation"]:SetActive(true);
                self.skills["EssayofExaltation"]:SetActive(false);
                self.skills["OurFatesEntwined"]:SetActive(false);
                self.skills["ThatWhichDoesNotKillUs"]:SetActive(false);
        elseif (attune >= 19) then
                self.skills["ChillingRhetoric"]:SetActive(self.settings.traits["SolitaryThunderx2"].active);
                self.skills["FieryRidicule"]:SetActive(self.settings.traits["CleansingFiresx2"].active);

        self.skills["PreludetoHope"]:SetActive(true);
                self.skills["RuneofRestoration"]:SetActive(true);
                self.skills["MendingVerse"]:SetActive(true);
                self.skills["WritofHealth"]:SetActive(true);
                self.skills["RousingWords"]:SetActive(true);
                self.skills["GloriousForeshadowing"]:SetActive(true);
                self.skills["EpicfortheAges"]:SetActive(true);
                self.skills["WordofExaltation"]:SetActive(true);
                self.skills["EssayofExaltation"]:SetActive(true);
                self.skills["OurFatesEntwined"]:SetActive(true);
                self.skills["ThatWhichDoesNotKillUs"]:SetActive(self.settings.traits["ThatWhichDoesNotKillUs"].active);
        end
        
        if (attune > 10) then
                if (self.settings.features["DynamicAttunement"].active) then
                        self.skills["ScribesSpark"]:SetParent(self.bars["OffAttunement"]);
                        self.skills["ScribesSpark"]:SetPosition(0, 0);
                        self.skills["CeaselessArgument"]:SetParent(self.bars["OffAttunement"]);
                        self.skills["CeaselessArgument"]:SetPosition(35, 0);

                        self.skills["PreludetoHope"]:SetParent(self.bars["Healing"]);
                        self.skills["PreludetoHope"]:SetPosition( (self.skills["PreludetoHope"].x - 1) * 35, (self.skills["PreludetoHope"].y - 1) * 35 );
                        self.skills["RuneofRestoration"]:SetParent(self.bars["Healing"]);
                        self.skills["RuneofRestoration"]:SetPosition( (self.skills["RuneofRestoration"].x - 1) * 35, (self.skills["RuneofRestoration"].y - 1) * 35 );
                        self.skills["MendingVerse"]:SetParent(self.bars["Healing"]);
                        self.skills["MendingVerse"]:SetPosition( (self.skills["MendingVerse"].x - 1) * 35, (self.skills["MendingVerse"].y - 1) * 35 );
                        self.skills["WritofHealth"]:SetParent(self.bars["Healing"]);
                        self.skills["WritofHealth"]:SetPosition( (self.skills["WritofHealth"].x - 1) * 35, (self.skills["WritofHealth"].y - 1) * 35 );
                        
                        self.bars["BattleStorm"]:SetZOrder(-5);
                        self.bars["Healing"]:SetZOrder(0);
                end

                self.skills["ScribesSpark"]:SetActive(true);
                self.skills["CeaselessArgument"]:SetActive(false);
                self.skills["ShockingWords"]:SetActive(false);
                self.skills["EssenceofStorm"]:SetActive(false);
                self.skills["SustainingBolt"]:SetActive(false);
                self.skills["VividImagery"]:SetActive(false);
                self.skills["EpicConclusion"]:SetActive(false);
                
                self.skills["FieryRidicule"]:SetActive(self.settings.traits["CleansingFiresx2"].active);
                self.skills["WritofFire"]:SetActive(self.effectlist["MasterofWrits"]:GetState());
                self.skills["ScathingMockery"]:SetActive(false);
                self.skills["EssenceofFlame"]:SetActive(false);
                self.skills["EssayofFire"]:SetActive(false);
                self.skills["SmoulderingWrath"]:SetActive(false);
                self.skills["DistractingFlame"]:SetActive(false);
                
                self.skills["ChillingRhetoric"]:SetActive(self.settings.traits["SolitaryThunderx2"].active);
                self.skills["WritofCold"]:SetActive(self.effectlist["MasterofWrits"]:GetState());
                self.skills["FlurryofWords"]:SetActive(false);
                self.skills["EssenceofWinter"]:SetActive(false);
                self.skills["FrozenEpilogue"]:SetActive(false);
        elseif (attune < 10 and attune > 7) then
                self.skills["RuneofRestoration"]:SetActive(self.settings.traits["BenedictionsofPeacex2"].active);       

                self.skills["ScribesSpark"]:SetActive(true);
                self.skills["CeaselessArgument"]:SetActive(true);
                self.skills["ShockingWords"]:SetActive(false);
                self.skills["EssenceofStorm"]:SetActive(false);
                self.skills["SustainingBolt"]:SetActive(false);
                self.skills["VividImagery"]:SetActive(false);
                self.skills["EpicConclusion"]:SetActive(false);
                
                self.skills["FieryRidicule"]:SetActive(true);
                self.skills["WritofFire"]:SetActive(self.effectlist["MasterofWrits"]:GetState());
                self.skills["ScathingMockery"]:SetActive(false);
                self.skills["EssenceofFlame"]:SetActive(false);
                self.skills["EssayofFire"]:SetActive(true);
                self.skills["SmoulderingWrath"]:SetActive(false);
                self.skills["DistractingFlame"]:SetActive(false);

                self.skills["ChillingRhetoric"]:SetActive(true);
                self.skills["WritofCold"]:SetActive(self.effectlist["MasterofWrits"]:GetState());
                self.skills["FlurryofWords"]:SetActive(false);
                self.skills["EssenceofWinter"]:SetActive(false);
                self.skills["FrozenEpilogue"]:SetActive(false);
        elseif (attune <= 7 and attune > 4) then
                self.skills["RuneofRestoration"]:SetActive(self.settings.traits["BenedictionsofPeacex2"].active);       

                self.skills["ScribesSpark"]:SetActive(true);
                self.skills["CeaselessArgument"]:SetActive(true);
                self.skills["ShockingWords"]:SetActive(true);
                self.skills["EssenceofStorm"]:SetActive(true);
                self.skills["SustainingBolt"]:SetActive(false);
                self.skills["VividImagery"]:SetActive(false);
                self.skills["EpicConclusion"]:SetActive(false);
                
                self.skills["FieryRidicule"]:SetActive(true);
                self.skills["WritofFire"]:SetActive(true);
                self.skills["DistractingFlame"]:SetActive(true);
                self.skills["ScathingMockery"]:SetActive(false);
                self.skills["EssenceofFlame"]:SetActive(false);
                self.skills["EssayofFire"]:SetActive(true);
                self.skills["SmoulderingWrath"]:SetActive(false);

                self.skills["ChillingRhetoric"]:SetActive(true);
                self.skills["WritofCold"]:SetActive(true);
                self.skills["FlurryofWords"]:SetActive(true);
                self.skills["EssenceofWinter"]:SetActive(false);
                self.skills["FrozenEpilogue"]:SetActive(false);
        elseif (attune <= 4 and attune > 1) then
                self.skills["RuneofRestoration"]:SetActive(self.settings.traits["BenedictionsofPeacex2"].active);       

                self.skills["ScribesSpark"]:SetActive(true);
                self.skills["CeaselessArgument"]:SetActive(true);
                self.skills["ShockingWords"]:SetActive(true);
                self.skills["EssenceofStorm"]:SetActive(true);
                self.skills["SustainingBolt"]:SetActive(true);
                self.skills["VividImagery"]:SetActive(true);
                self.skills["EpicConclusion"]:SetActive(false);
                
                self.skills["FieryRidicule"]:SetActive(true);
                self.skills["WritofFire"]:SetActive(true);
        self.skills["DistractingFlame"]:SetActive(true);
                self.skills["ScathingMockery"]:SetActive(true);
                self.skills["EssenceofFlame"]:SetActive(true);
                self.skills["EssayofFire"]:SetActive(true);
                self.skills["SmoulderingWrath"]:SetActive(false);


                self.skills["ChillingRhetoric"]:SetActive(true);
                self.skills["WritofCold"]:SetActive(true);
                self.skills["FlurryofWords"]:SetActive(true);
                self.skills["EssenceofWinter"]:SetActive(true);
                self.skills["FrozenEpilogue"]:SetActive(false);
        elseif (attune <= 1) then
                self.skills["RuneofRestoration"]:SetActive(self.settings.traits["BenedictionsofPeacex2"].active);       

                self.skills["ScribesSpark"]:SetActive(true);
                self.skills["CeaselessArgument"]:SetActive(true);
                self.skills["ShockingWords"]:SetActive(true);
                self.skills["EssenceofStorm"]:SetActive(true);
                self.skills["SustainingBolt"]:SetActive(true);
                self.skills["VividImagery"]:SetActive(true);
                self.skills["EpicConclusion"]:SetActive(true);
                
                self.skills["FieryRidicule"]:SetActive(true);
                self.skills["WritofFire"]:SetActive(true);
                self.skills["DistractingFlame"]:SetActive(true);
                self.skills["ScathingMockery"]:SetActive(true);
                self.skills["EssenceofFlame"]:SetActive(true);
                self.skills["EssayofFire"]:SetActive(true);
                self.skills["SmoulderingWrath"]:SetActive(true);


                self.skills["ChillingRhetoric"]:SetActive(true);
                self.skills["WritofCold"]:SetActive(true);
                self.skills["FlurryofWords"]:SetActive(true);
                self.skills["EssenceofWinter"]:SetActive(true);
                self.skills["FrozenEpilogue"]:SetActive(true);
        end
        
        if (attune == 10) then
                self.skills["PreludetoHope"]:SetActive(true);
                self.skills["RuneofRestoration"]:SetActive(true);
                self.skills["MendingVerse"]:SetActive(true);
                self.skills["WritofHealth"]:SetActive(self.effectlist["MasterofWrits"]:GetState());
                self.skills["RousingWords"]:SetActive(false);
                self.skills["GloriousForeshadowing"]:SetActive(false);
                self.skills["EpicfortheAges"]:SetActive(false);
                self.skills["WordofExaltation"]:SetActive(false);
                self.skills["EssayofExaltation"]:SetActive(false);
                self.skills["OurFatesEntwined"]:SetActive(false);
                self.skills["ThatWhichDoesNotKillUs"]:SetActive(false);
                
                self.skills["ScribesSpark"]:SetActive(true);
                self.skills["CeaselessArgument"]:SetActive(true);
                self.skills["ShockingWords"]:SetActive(false);
                self.skills["EssenceofStorm"]:SetActive(false);
                self.skills["SustainingBolt"]:SetActive(false);
                self.skills["VividImagery"]:SetActive(false);
                self.skills["EpicConclusion"]:SetActive(false);
                
                self.skills["FieryRidicule"]:SetActive(true);
                self.skills["WritofFire"]:SetActive(self.effectlist["MasterofWrits"]:GetState());
                self.skills["ScathingMockery"]:SetActive(false);
                self.skills["EssenceofFlame"]:SetActive(false);
                self.skills["EssayofFire"]:SetActive(true);
                self.skills["SmoulderingWrath"]:SetActive(false);
                self.skills["DistractingFlame"]:SetActive(false);

                self.skills["ChillingRhetoric"]:SetActive(true);
                self.skills["WritofCold"]:SetActive(self.effectlist["MasterofWrits"]:GetState());
                self.skills["FlurryofWords"]:SetActive(false);
                self.skills["EssenceofWinter"]:SetActive(false);
                self.skills["FrozenEpilogue"]:SetActive(false);
                
                if (self.settings.features["DynamicAttunement"].active) then
                        if (self.settings.defaults["DefaultAttune"].selected == 2) then
                                self.skills["ScribesSpark"]:SetParent(self.bars["OffAttunement"]);
                                self.skills["ScribesSpark"]:SetPosition(0, 0);
                                self.skills["CeaselessArgument"]:SetParent(self.bars["OffAttunement"]);
                                self.skills["CeaselessArgument"]:SetPosition(35, 0);

                                self.skills["PreludetoHope"]:SetParent(self.bars["Healing"]);
                                self.skills["PreludetoHope"]:SetPosition( (self.skills["PreludetoHope"].x - 1) * 35, (self.skills["PreludetoHope"].y - 1) * 35 );
                                self.skills["RuneofRestoration"]:SetParent(self.bars["Healing"]);
                                self.skills["RuneofRestoration"]:SetPosition( (self.skills["RuneofRestoration"].x - 1) * 35, (self.skills["RuneofRestoration"].y - 1) * 35 );
                                self.skills["MendingVerse"]:SetParent(self.bars["Healing"]);
                                self.skills["MendingVerse"]:SetPosition( (self.skills["MendingVerse"].x - 1) * 35, (self.skills["MendingVerse"].y - 1) * 35 );
                                self.skills["WritofHealth"]:SetParent(self.bars["Healing"]);
                                self.skills["WritofHealth"]:SetPosition( (self.skills["WritofHealth"].x - 1) * 35, (self.skills["WritofHealth"].y - 1) * 35 );
                                
                                self.bars["BattleStorm"]:SetZOrder(-5);
                                self.bars["Healing"]:SetZOrder(0);

                        else
                                self.skills["ScribesSpark"]:SetParent(self.bars["BattleStorm"]);
                                self.skills["ScribesSpark"]:SetPosition((self.skills["ScribesSpark"].x - 1) * 35, (self.skills["ScribesSpark"].y - 1) * 35);
                                self.skills["CeaselessArgument"]:SetParent(self.bars["BattleStorm"]);
                                self.skills["CeaselessArgument"]:SetPosition((self.skills["CeaselessArgument"].x - 1) * 35, (self.skills["CeaselessArgument"].y - 1) * 35);
                                
                                self.skills["PreludetoHope"]:SetParent(self.bars["OffAttunement"]);
                                self.skills["PreludetoHope"]:SetPosition(0, 0);
                                self.skills["RuneofRestoration"]:SetParent(self.bars["OffAttunement"]);
                                self.skills["RuneofRestoration"]:SetPosition(35, 0);
                                self.skills["MendingVerse"]:SetParent(self.bars["OffAttunement"]);
                                self.skills["MendingVerse"]:SetPosition(70, 0);
                                self.skills["WritofHealth"]:SetParent(self.bars["OffAttunement"]);
                                self.skills["WritofHealth"]:SetPosition(105, 0);
                                
                                self.bars["BattleStorm"]:SetZOrder(0);
                                self.bars["Healing"]:SetZOrder(-5);
                        end
                end
        end
        
end


-- DEFAULT SETTINGS
function RuneBars:DefaultSettings()
        self.settings = { preconf = { }, userconf = { }, traits = { }, features = { }, defaults = { }, quickslots = { } };
        
        self.settings.preconf["Attunement"]     = { id = 1,     name = "Attunement",                    defpos = {1,5},         size={8,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.preconf["OffAttunement"]  = { id = 2,     name = "Off Attunement",                defpos = {1,2},         size={4,1}, pos = {0,0}, combat = {true,true}, active = true };
        
        self.settings.userconf["CenterControl"]  = { id = 3,    name = "Center: Control",               defpos = {1,1},         size={2,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["CenterBuffs"]    = { id = 4,    name = "Center: Buffs",                 defpos = {3,1},         size={2,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["CenterDethreat"] = { id = 5,    name = "Center: Dethreat",              defpos = {5,1},         size={2,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["CenterForetell"] = { id = 6,    name = "Center: Fortellings",   defpos = {7,1},         size={4,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["CenterVision"]   = { id = 7,    name = "Center: Dmg Vision",    defpos = {11,1},        size={2,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["CenterSelf"]     = { id = 8,    name = "Center: Self",                  defpos = {8,2},         size={3,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["BattleFrost"]    = { id = 9,    name = "Battle: Frost",                 defpos = {1,3},         size={5,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["BattleFlame"]    = { id = 10,   name = "Battle: Flame",                 defpos = {1,4},         size={7,1}, pos = {0,0}, combat = {true,true}, active = true };
        self.settings.userconf["HealForetell"]   = { id = 11,   name = "Heal: Fortelling",              defpos = {9,5},         size={4,1}, pos = {0,0}, combat = {true,true}, active = true };
        
        self.settings.traits["FallToOurWrath"]                  = { id = 1, name = 'Fall to Our Wrath', active = false };
        self.settings.traits["SteadyHands"]                             = { id = 2, name = 'Steady Hands', active = false };
        self.settings.traits["ThatWhichDoesNotKillUs"]  = { id = 3, name = 'That Which...Kill Us', active = false };
        self.settings.traits["SolitaryThunderx2"]               = { id = 4, name = 'Solitary Thunder x2', active = false };
        self.settings.traits["CleansingFiresx2"]                = { id = 5, name = 'Cleansing Fires x2', active = false };
        self.settings.traits["BenedictionsofPeacex2"]   = { id = 6, name = 'Benedictions x2', active = false };
        
        self.settings.features["HideCalmingVerse"]              = { id = 1, name = 'Hide Calming Verse', active = true };
        self.settings.features["DimMasterOfWrits"]              = { id = 2, name = 'Dim Master of Writs', active = true };
        self.settings.features["DynamicAttunement"]             = { id = 3, name = 'Dynamic Att. Switching', active = true };
        
        self.settings.defaults["DefaultAttune"]                 = { id = 1, name = 'Show at 0 Attune', selected = 1, list = { "Storm", "Healing" } };

end

-- UPDATE SETTINGS
function RuneBars:UpdateSettings()
        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 == 'steady') then
                                                self.settings.traits["SteadyHands"].active = value;
                                        elseif (key == 'wrath') then
                                                self.settings.traits["FallToOurWrath"].active = value;
                                        elseif (key == 'killus') then
                                                self.settings.traits["ThatWhichDoesNotKillUs"].active = value;
                                        elseif (key == 'hidecalmingverse') then
                                                self.settings.features["HideCalmingVerse"].active = value;
                                        elseif (key == 'dimmaster') then
                                                self.settings.features["DimMasterOfWrits"].active = value;
                                        elseif (key == 'defaultattune') then
                                                self.settings.defaults["DefaultAttune"].selected = value;
                                        end
                                end
                        end
                end
        end
        
        if (settings.vers < 5.00) then
                self.settings.traits["SolitaryThunderx2"]               = { id = 4, name = 'Solitary Thunder x2', active = false };
                self.settings.traits["CleansingFiresx2"]                = { id = 5, name = 'Cleansing Fires x2', active = false };
                self.settings.traits["BenedictionsofPeacex2"]   = { id = 6, name = 'Benedictions x2', active = false };
                settings.skilldata["FinalWord"] = settings.skilldata["AbruptWords"];
                settings.skilldata["AbruptWords"] = nil;
        end
        
        settings.vers = vars.vers;

end

-- REFRESH SKILLS AND BARS
function RuneBars: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["FalltoOurWrath"]:SetActive(self.settings.traits["FallToOurWrath"].active);
        self.skills["SteadyHands"]:SetActive(self.settings.traits["SteadyHands"].active);
        self.skills["ThatWhichDoesNotKillUs"]:SetActive(self.settings.traits["ThatWhichDoesNotKillUs"].active);
        
        if (not self.settings.features["DynamicAttunement"].active) then
                self.bars["OffAttunement"]:SetZOrder(-10);
                self.bars["BattleStorm"]:SetParent(self.windows["OffAttunement"]);
                self.bars["BattleStorm"].parent = self.windows["OffAttunement"];
                self.windows["OffAttunement"]:SetSize(self.bars["BattleStorm"]:GetWidth(), self.bars["Healing"]:GetHeight());
                self.windows["OffAttunement"].dragBar:Refresh();
                
                self.skills["ScribesSpark"]:SetParent(self.bars["BattleStorm"]);
                self.skills["ScribesSpark"]:SetPosition((self.skills["ScribesSpark"].x - 1) * 35, (self.skills["ScribesSpark"].y - 1) * 35);
                self.skills["CeaselessArgument"]:SetParent(self.bars["BattleStorm"]);
                self.skills["CeaselessArgument"]:SetPosition((self.skills["CeaselessArgument"].x - 1) * 35, (self.skills["CeaselessArgument"].y - 1) * 35);
                
                self.skills["PreludetoHope"]:SetParent(self.bars["Healing"]);
                self.skills["PreludetoHope"]:SetPosition( (self.skills["PreludetoHope"].x - 1) * 35, (self.skills["PreludetoHope"].y - 1) * 35 );
                self.skills["RuneofRestoration"]:SetParent(self.bars["Healing"]);
                self.skills["RuneofRestoration"]:SetPosition( (self.skills["RuneofRestoration"].x - 1) * 35, (self.skills["RuneofRestoration"].y - 1) * 35 );
                self.skills["MendingVerse"]:SetParent(self.bars["Healing"]);
                self.skills["MendingVerse"]:SetPosition( (self.skills["MendingVerse"].x - 1) * 35, (self.skills["MendingVerse"].y - 1) * 35 );
                self.skills["WritofHealth"]:SetParent(self.bars["Healing"]);
                self.skills["WritofHealth"]:SetPosition( (self.skills["WritofHealth"].x - 1) * 35, (self.skills["WritofHealth"].y - 1) * 35 );
        else
                self.bars["OffAttunement"]:SetZOrder(0);
                self.bars["BattleStorm"]:SetParent(self.windows["Attunement"]);
                self.bars["BattleStorm"].parent = self.windows["Attunement"];
                self.windows["OffAttunement"]:SetSize(self.bars["OffAttunement"]:GetWidth(), self.bars["OffAttunement"]:GetHeight());
                self.windows["OffAttunement"].dragBar:Refresh();
        end
    
    -- Refresh States
    self:CombatChange(vars.player:IsInCombat());
        self:AttunementChanged();

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

end

Go to most recent revision | Compare with Previous | Blame


All times are GMT -5. The time now is 02:03 AM.


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