import "Turbine.UI";
import "Turbine.UI.Lotro";
import "Turbine.Gameplay";
import "KragenPlugs.Utils";
import "KragenPlugs.KragenBars";
CaptainBars = class( KragenPlugs.KragenBars.ClassBar );
function CaptainBars:Constructor()
KragenPlugs.KragenBars.ClassBar.Constructor( self );
-- CLASS SPECIFIC VARIABLES
self.fear = 0;
self.effectlist = {};
self.effectlist['EnemyDefeatResponse'] = Effect();
self.effectlist['FellowDefeatResponse'] = Effect();
self.effectlist['BattleReadied'] = Effect();
self.effectlist['BattleHardened'] = Effect();
self.effectlist['Motivated'] = Effect();
self.effectlist['InDefenceOfMiddleEarth'] = Effect();
self.effectlist['OnGuard'] = Effect();
self.effectlist['RelentlessAttack'] = Effect();
self.effectlist['Focus'] = Effect();
self.effectlist['BannerOfWar'] = Effect();
self.effectlist['ImprovedBannerOfWar'] = Effect();
self.effectlist['BannerOfHope'] = Effect();
self.effectlist['ImprovedBannerOfHope'] = Effect();
self.effectlist['BannerOfVictory'] = Effect();
self.effectlist['ImprovedBannerOfVictory'] = 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['FellowDefeatResponse'] :SetName('Fellow Defeat Response');
self.effectlist['BattleReadied'] :SetName('Battle-readied');
self.effectlist['BattleHardened'] :SetName('Battle-hardened');
self.effectlist['Motivated'] :SetName('Motivated');
self.effectlist['InDefenceOfMiddleEarth'] :SetName('In Defence of Middle-earth');
self.effectlist['OnGuard'] :SetName('On Guard');
self.effectlist['RelentlessAttack'] :SetName('Relentless Attack');
self.effectlist['Focus'] :SetName('Focus');
self.effectlist['BannerOfWar'] :SetName('Banner of War');
self.effectlist['ImprovedBannerOfWar'] :SetName('Improved Banner of War');
self.effectlist['BannerOfHope'] :SetName('Banner of Hope');
self.effectlist['ImprovedBannerOfHope'] :SetName('Improved Banner of Hope');
self.effectlist['BannerOfVictory'] :SetName('Banner of Victory');
self.effectlist['ImprovedBannerOfVictory'] :SetName('Improved Banner of Victory');
-- FRENCH CLIENT
elseif (settings.language == 2) then
self.effectlist['EnemyDefeatResponse'] :SetName('Ev�nement de d�faite (ennemi)');
self.effectlist['FellowDefeatResponse'] :SetName('Evénement de défaite (allié)');
self.effectlist['BattleReadied'] :SetName('Battle-readied');
self.effectlist['BattleHardened'] :SetName('Battle-hardened');
self.effectlist['Motivated'] :SetName('Motivation');
self.effectlist['InDefenceOfMiddleEarth'] :SetName('Défense de la Terre du Milieu');
self.effectlist['OnGuard'] :SetName('En garde');
self.effectlist['RelentlessAttack'] :SetName('Attaque retenue');
self.effectlist['Focus'] :SetName('Concentration');
self.effectlist['BannerOfWar'] :SetName('Bannière de Guerre');
self.effectlist['ImprovedBannerOfWar'] :SetName('Bannière de Guerre améliorée');
self.effectlist['BannerOfHope'] :SetName("Bannière d'Espoir");
self.effectlist['ImprovedBannerOfHope'] :SetName("Bannière d'Espoir améliorée");
self.effectlist['BannerOfVictory'] :SetName('Bannière de Victoire');
self.effectlist['ImprovedBannerOfVictory'] :SetName('Bannière de Victoire améliorée');
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");
-- GERMAN CLIENT
elseif (settings.language == 3) then
self.effectlist['EnemyDefeatResponse'] :SetName('Erwiderung "Vernichtung des Gegners"');
self.effectlist['FellowDefeatResponse'] :SetName('Erwiderung "Vernichtung eines Gefährten"');
self.effectlist['BattleReadied'] :SetName('Battle-readied');
self.effectlist['BattleHardened'] :SetName('Battle-hardened');
self.effectlist['Motivated'] :SetName('Motiviert');
self.effectlist['InDefenceOfMiddleEarth'] :SetName('Verteidigung von Mittelerde');
self.effectlist['OnGuard'] :SetName('In Bereitschaft');
self.effectlist['RelentlessAttack'] :SetName('Gnadenloser Angriff');
self.effectlist['Focus'] :SetName('Fokus');
self.effectlist['BannerOfWar'] :SetName('Kriegsbanner');
self.effectlist['ImprovedBannerOfWar'] :SetName('Verbesserung: Kriegsbanner');
self.effectlist['BannerOfHope'] :SetName('Banner der Hoffnung');
self.effectlist['ImprovedBannerOfHope'] :SetName('Verbesserung: Banner der Hoffnung');
self.effectlist['BannerOfVictory'] :SetName('Banner des Sieges');
self.effectlist['ImprovedBannerOfVictory'] :SetName('Verbesserung: Banner des Sieges');
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 Windows
self.bars["Marks"] = SkillBar(self.windows["Marks"], 1, 1, 3, 1, true, true);
self.bars["MultiMark"] = SkillBar(self.windows["Marks"], 1, 1, 1, 1, true, true);
-- Build Skills
self.skills["DefensiveStrike"] = SkillSlot(self.bars["Attack"], 1, 1, true, { 1, 54 }, { "0x70002F73", "0x7000FF86" } );
self.skills["SureStrike"] = SkillSlot(self.bars["Attack"], 2, 1, true, { 1, 66 }, { "0x700215CF", "0x70028DB4" } );
self.skills["BattleShout"] = SkillSlot(self.bars["Attack"], 3, 1, true, 1, "0x70002F67");
self.skills["CuttingAttack"] = SkillSlot(self.bars["Attack"], 4, 1, true, { 4, 72 }, { "0x70003E4C", "0x70028FA5" } );
self.skills["DevastatingBlow"] = SkillSlot(self.bars["Gated"], 1, 1, not self.settings.features["GateSkills"], 2, "0x70002FCF");
self.skills["PressingAttack"] = SkillSlot(self.bars["Gated"], 2, 1, not self.settings.features["GateSkills"], 10, "0x70003E50");
self.skills["BladeOfElendil"] = SkillSlot(self.bars["Gated"], 3, 1, not self.settings.features["GateSkills"], { 30, 52 }, { "0x7000AD9A", "0x70017D31" } );
self.skills["NobleMark"] = SkillSlot(self.bars["Marks"], 1, 1, not self.settings.features["MultiMarks"].active, 12, "0x70003E4F");
self.skills["TellingMark"] = SkillSlot(self.bars["Marks"], 2, 1, not self.settings.features["MultiMarks"].active, 18, "0x70003E4D");
self.skills["RevealingMark"] = SkillSlot(self.bars["Marks"], 3, 1, not self.settings.features["MultiMarks"].active, 30, "0x70003E56");
self.skills["Inspire"] = SkillSlot(self.bars["ShieldBro"], 2, 1, true, 22, "0x7000A1D7");
self.skills["ToArms"] = SkillSlot(self.bars["ShieldBro"], 3, 1, true, 40, "0x7000AA0D");
self.skills["StrengthOfWill"] = SkillSlot(self.bars["ShieldBro"], 4, 1, true, 48, "0x7000B058");
self.skills["RallyingCry"] = SkillSlot(self.bars["Defeat"], 1, 1, false, 2, "0x70002F4F");
self.skills["WarCry"] = SkillSlot(self.bars["Defeat"], 2, 1, false, 4, "0x70002F58");
self.skills["RoutingCry"] = SkillSlot(self.bars["Defeat"], 3, 1, self.settings.traits["LeaderofMen"].active, 8, "0x70002F61");
self.skills["ShadowsLament"] = SkillSlot(self.bars["Defeat"], 4, 1, self.settings.traits["MasterOfWar"].active, 60, "0x7000FF8B");
self.skills["WordsOfCourage"] = SkillSlot(self.bars["Healing"], 1, 1, true, 14, "0x70003E51");
self.skills["MusterCourage"] = SkillSlot(self.bars["Healing"], 2, 1, true, 16, "0x70002F99");
self.skills["ValiantStrike"] = SkillSlot(self.bars["Healing"], 3, 1, true, 58, "0x7000FF6D");
self.skills["ShieldOfTheDunadain"] = SkillSlot(self.bars["Healing"], 4, 1, self.settings.traits["ShieldOfTheDunadain"].active, 41, "0x700012F9");
self.skills["MotivatingSpeech"] = SkillSlot(self.bars["Buffs"], 1, 1, true, 16, "0x70003E52");
self.skills["IDOME"] = SkillSlot(self.bars["Buffs"], 2, 1, self.settings.traits["IDOME"].active, 41, "0x7000130D");
self.skills["LastStand"] = SkillSlot(self.bars["Emergency"], 2, 1, true, 22, "0x70003E54");
self.skills["InHarmsWay"] = SkillSlot(self.bars["Emergency"], 1, 1, true, 36, "0x70003E58");
self.skills["EscapeFromDarkness"] = SkillSlot(self.bars["Rez"], 1, 1, true, 20, "0x70002F45");
self.skills["CryOfVengence"] = SkillSlot(self.bars["Rez"], 2, 1, false, 32, "0x70003E57");
self.skills["Kick"] = SkillSlot(self.bars["Utility"], 1, 1, true, 44, "0x7000AA0E");
self.skills["ThreateningShout"] = SkillSlot(self.bars["Threat"], 1, 1, true, 26, "0x70002FD5");
self.skills["GraveWound"] = SkillSlot(self.bars["Threat"], 2, 1, true, { 42, 68 }, { "0x7000AA0F", "0x70028E4B" } );
self.skills["Withdraw"] = SkillSlot(self.bars["Threat"], 3, 1, true, { 46, 62 }, { "0x7000AA10", "0x7001F4C9" } );
self.skills["OathbreakersShame"] = SkillSlot(self.bars["Debuff"], 1, 1, self.settings.traits["OathbreakersShame"].active, 41, "0x70001306");
self.skills["MakeHaste"] = SkillSlot(self.bars["BattleBuffs"], 1, 1, true, 8, "0x70003E4E");
self.skills["TimeOfNeed"] = SkillSlot(self.bars["BattleBuffs"], 2, 1, true, 50, "0x7000AA12");
self.skills["SummoningHorn"] = ItemSlot(self.bars["ClassItems"], 1, 1, true, self.settings.quickslots["SummoningHorn"]);
self.skills["BattleTonic"] = ItemSlot(self.bars["ClassItems"], 2, 1, true, self.settings.quickslots["BattleTonic"]);
self.skills["BlazonedCrest"] = ItemSlot(self.bars["ClassItems"], 3, 1, true, self.settings.quickslots["BlazonedCrest"]);
-- Build Brother Slot
self.multi["Brothers"] = SkillMultiSlot(self.bars["ShieldBro"], 1, 1, true);
if (vars.playerlevel >= 64) then
self.multi["Brothers"]:AddShortCut("ShieldBro", 64, "0x70020DF6");
else
self.multi["Brothers"]:AddShortCut("ShieldBro", 22, "0x7000A1D8");
end
self.multi["Brothers"]:AddShortCut("SongBro", 70, "0x70028EFB");
self.multi["Brothers"]:AddShortCut("BladeBro", 74, "0x70028EFF");
self.multi["Brothers"]:LevelCheck();
-- Build MultiMark Slot
self.multi["Marks"] = SkillMultiSlot(self.bars["MultiMark"], 1, 1, true);
self.multi["Marks"]:AddShortCut("NobleMark", 12, "0x70003E4F");
self.multi["Marks"]:AddShortCut("TellingMark", 18, "0x70003E4D");
self.multi["Marks"]:AddShortCut("RevealingMark", 30, "0x70003E56");
self.multi["Marks"]:LevelCheck();
self.multi["Marks"]:SetSwap(false);
-- Build Tactic Slot
self.multi["Tactic"] = SkillMultiSlot(self.bars["Buffs"], 3, 1, true);
self.multi["Tactic"]:AddShortCut("OnGuard", 6, "0x70003E53");
self.multi["Tactic"]:AddShortCut("Relentless", 28, "0x70003E55");
self.multi["Tactic"]:AddShortCut("Focus", 38, "0x70003E59");
self.multi["Tactic"]:LevelCheck();
-- Build Herald Slot
self.multi["Heralds"] = SkillMultiSlot(self.bars["Banners"], 1, 1, true);
self.multi["Heralds"]:AddShortCut("War", 10, "0x70002F7A");
self.multi["Heralds"]:AddShortCut("Hope", 24, "0x70002FAF");
self.multi["Heralds"]:AddShortCut("Victory", 34, "0x70002F1A");
self.multi["Heralds"]:AddShortCut("Archer", 56, "0x7000FC78");
self.multi["Heralds"]:LevelCheck();
-- Build Banner Slot
self.multi["Banners"] = ItemMultiSlot(self.bars["Banners"], 2, 1, true);
self.multi["Banners"]:AddShortCut("Banner1", self.settings.quickslots["Banner1"]);
self.multi["Banners"]:AddShortCut("Banner2", self.settings.quickslots["Banner2"]);
self.multi["Banners"]:AddShortCut("Banner3", self.settings.quickslots["Banner3"]);
self.multi["Banners"]:AddShortCut("Armament", self.settings.quickslots["Armament"]);
self.multi["Banners"]:Refresh(true);
-- SET COMBAT STATES
--self.multi["Heralds"]:SetCombat( false, true );
--self.skills["SummoningHorn"]:SetCombat( false, true );
-- ITEM MANAGER
--self.itemmanager = ItemManager();
--self.itemmanager:RegisterItem("Carved Rallying Horn", { "Finely" }, { }, self.skills["SummoningHorn"]);
--self.itemmanager:RegisterItem("Battle Tonic", { "Expert","Artisan","Master","Supreme" }, {"Recipe"}, self.skills["BattleTonic"]);
--self.itemmanager:RegisterItem("Blazoned Crest", { "Expert","Artisan","Master","Supreme" }, {"Recipe"}, self.skills["BlazonedCrest"]);
--self.itemmanager:ParseItems();
-- CLASS SPECIFIC SETUP/DEFAULT CODE
-- Default Marks (seperate or multi)
if (not self.settings.features["MultiMarks"].active) then
if (self.windows["Marks"].rotate == false) then
self.windows["Marks"]:SetSize(35*3, 35);
self.windows["Marks"].width = 3;
self.windows["Marks"].height = 1;
self.multi["Marks"]:SetActive(false);
self.skills["NobleMark"]:SetActive(true);
self.skills["TellingMark"]:SetActive(true);
self.skills["RevealingMark"]:SetActive(true);
self.bars["MultiMark"]:SetZOrder(-10);
self.bars["Marks"]:SetZOrder(0);
else
self.windows["Marks"]:SetSize(35, 35 * 3);
self.windows["Marks"].width = 1;
self.windows["Marks"].height = 3;
self.multi["Marks"]:SetActive(false);
self.skills["NobleMark"]:SetActive(true);
self.skills["TellingMark"]:SetActive(true);
self.skills["RevealingMark"]:SetActive(true);
self.bars["MultiMark"]:SetZOrder(-10);
self.bars["Marks"]:SetZOrder(0);
end
else
self.windows["Marks"]:SetSize(35, 35);
self.multi["Marks"]:SetPosition(0, 0);
self.windows["Marks"].width = 1;
self.windows["Marks"].height = 1;
self.multi["Marks"]:SetActive(true);
self.skills["NobleMark"]:SetActive(false);
self.skills["TellingMark"]:SetActive(false);
self.skills["RevealingMark"]:SetActive(false);
self.bars["MultiMark"]:SetZOrder(0);
self.bars["Marks"]:SetZOrder(-10);
end
-- CLASS SPECIFIC EVENTS
-- INITIALIZE BARS
self:InitBars();
self:CombatChange(vars.player:IsInCombat());
end
-- ADD EFFECT EVENT
function CaptainBars:AddEffect( effectIndex )
local effect = vars.player:GetEffects():Get( effectIndex );
local effectname = effect:GetName();
local effectid = effect:GetID();
if (effectname == self.effectlist["EnemyDefeatResponse"]:GetName()) then
if (self.effectlist["EnemyDefeatResponse"]:SetState( true, effectid )) then
self.skills["RallyingCry"]:SetActive( true );
self.skills["WarCry"]:SetActive( true );
self.skills["RoutingCry"]:SetActive( true );
self.skills["ShadowsLament"]:SetActive( true );
end
elseif (effectname == self.effectlist["BattleReadied"]:GetName()) then
if (self.effectlist["BattleReadied"]:SetState( true, effectid) ) then
self.skills["DevastatingBlow"]:SetActive( true );
self.skills["PressingAttack"]:SetActive( true );
end
elseif (effectname == self.effectlist["BattleHardened"]:GetName()) then
if (self.effectlist["BattleHardened"]:SetState( true, effectid )) then
self.skills["BladeOfElendil"]:SetActive( true );
end
elseif (effectname == self.effectlist["FellowDefeatResponse"]:GetName()) then
if (self.effectlist["FellowDefeatResponse"]:SetState( true, effectid )) then
self.skills["CryOfVengence"]:SetActive( true );
end
elseif (effectname == self.effectlist["Motivated"]:GetName()) then
if (self.effectlist["Motivated"]:SetState( true, effectid )) then
self.skills["MotivatingSpeech"]:SetActive( true );
if (self.settings.defaults["BuffActive"].selected == 2) then
self.skills["MotivatingSpeech"]:SetHover( true );
elseif (self.settings.defaults["BuffActive"].selected >= 3) then
self.skills["MotivatingSpeech"]:SetActive( false );
end
if (self.settings.defaults["BuffActive"].selected == 4) then
self.skills["MotivatingSpeech"]:StartTimer(effect:GetDuration() * .82, true);
end
end
elseif (effectname == self.effectlist["OnGuard"]:GetName() or effectname == self.effectlist["RelentlessAttack"]:GetName() or effectname == self.effectlist["Focus"]:GetName() ) then
if (self.effectlist["OnGuard"]:SetState( true, effectid )) then
self.multi["Tactic"]:SetActive( true );
if (self.settings.defaults["TacticActive"].selected == 2) then
self.multi["Tactic"]:SetHover( true );
elseif (self.settings.defaults["TacticActive"].selected >= 3) then
self.multi["Tactic"]:SetActive(false);
end
if (self.settings.defaults["TacticActive"].selected == 4) then
self.multi["Tactic"]:StartTimer(effect:GetDuration() * .82, true);
end
end
elseif (effectname == self.effectlist["InDefenceOfMiddleEarth"]:GetName()) then
if (self.effectlist["InDefenceOfMiddleEarth"]:SetState( true, effectid )) then
self.skills["IDOME"]:SetActive( self.settings.traits["IDOME"].active );
if (self.settings.defaults["IDoMEActive"].selected == 2) then
self.skills["IDOME"]:SetHover( true );
elseif (self.settings.defaults["IDoMEActive"].selected == 3) then
self.skills["IDOME"]:SetActive( false );
end
end
elseif (effectname == self.effectlist["BannerOfWar"]:GetName() or effectname == self.effectlist["BannerOfVictory"]:GetName() or effectname == self.effectlist["BannerOfHope"]:GetName() or effectname == self.effectlist["ImprovedBannerOfWar"]:GetName() or effectname == self.effectlist["ImprovedBannerOfVictory"]:GetName() or effectname == self.effectlist["ImprovedBannerOfHope"]:GetName() ) then
if (self.effectlist["BannerOfWar"]:SetState( true, effectid )) then
self.multi["Heralds"]:SetHover(true);
self.multi["Banners"]:SetHover(true);
end
-- Fear
elseif (effect:GetCategory() == Turbine.Gameplay.EffectCategory.Fear ) then
self.fear = self.fear + 1;
if (settings.skilldata["MusterCourage"].parent ~= nil and vars.playerlevel >= self.skills["MusterCourage"].level[1] and self.settings.features["FearIndicator"].active) then
if (self.settings.userconf[settings.skilldata["MusterCourage"].parent].active) then
self.skills["MusterCourage"]:SetColor("purple");
end
end
end
end
-- REMOVE EFFECT EVENT
function CaptainBars: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["RallyingCry"]:SetActive( false );
self.skills["WarCry"]:SetActive( false );
self.skills["RoutingCry"]:SetActive( self.settings.traits["LeaderofMen"].active );
self.skills["ShadowsLament"]:SetActive( self.settings.traits["MasterOfWar"].active );
end
elseif (effectname == self.effectlist["BattleReadied"]:GetName()) then
if (not self.effectlist["BattleReadied"]:SetState( false, effectid )) then
self.skills["DevastatingBlow"]:SetActive( not self.settings.features["GateSkills"].active );
self.skills["PressingAttack"]:SetActive( not self.settings.features["GateSkills"].active );
end
elseif (effectname == self.effectlist["BattleHardened"]:GetName()) then
if (not self.effectlist["BattleHardened"]:SetState( false, effectid )) then
self.skills["BladeOfElendil"]:SetActive( not self.settings.features["GateSkills"].active );
end
elseif (effectname == self.effectlist["FellowDefeatResponse"]:GetName()) then
if (not self.effectlist["FellowDefeatResponse"]:SetState( false, effectid )) then
self.skills["CryOfVengence"]:SetActive( false );
end
elseif (effectname == self.effectlist["Motivated"]:GetName()) then
if (not self.effectlist["Motivated"]:SetState( false, effectid )) then
self.skills["MotivatingSpeech"]:SetActive( true );
self.skills["MotivatingSpeech"]:SetHover( false );
end
elseif (effectname == self.effectlist["OnGuard"]:GetName() or effectname == self.effectlist["RelentlessAttack"]:GetName() or effectname == self.effectlist["Focus"]:GetName()) then
if (not self.effectlist["OnGuard"]:SetState( false, effectid )) then
self.multi["Tactic"]:SetActive( true );
self.multi["Tactic"]:SetHover( false );
end
elseif (effectname == self.effectlist["InDefenceOfMiddleEarth"]:GetName()) then
if (not self.effectlist["InDefenceOfMiddleEarth"]:SetState( false, effectid )) then
self.skills["IDOME"]:SetActive( self.settings.traits["IDOME"].active );
self.skills["IDOME"]:SetHover( false );
end
elseif (effectname == self.effectlist["BannerOfWar"]:GetName() or effectname == self.effectlist["BannerOfVictory"]:GetName() or effectname == self.effectlist["BannerOfHope"]:GetName() or effectname == self.effectlist["ImprovedBannerOfWar"]:GetName() or effectname == self.effectlist["ImprovedBannerOfVictory"]:GetName() or effectname == self.effectlist["ImprovedBannerOfHope"]:GetName() ) then
if (not self.effectlist["BannerOfWar"]:SetState( false, effectid )) then
self.multi["Heralds"]:SetHover(false);
self.multi["Banners"]:SetHover(false);
end
-- Fear
elseif (effect:GetCategory() == Turbine.Gameplay.EffectCategory.Fear ) then
self.fear = self.fear - 1;
if (self.fear == 0) then
self.skills["MusterCourage"]:SetColor();
end
end
end
-- DEFAULT SETTINGS
function CaptainBars:DefaultSettings()
self.settings = { preconf = { }, userconf = { }, traits = { }, features = { }, defaults = { }, quickslots = { } };
self.settings.preconf["Marks"] = { id = 1, name = "Marks", defpos = {1,2}, size={3,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["Attack"] = { id = 2, name = "Attack Skills", defpos = {1,4}, size={4,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["Gated"] = { id = 3, name = "Gated Skills", defpos = {5,4}, size={3,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["Defeat"] = { id = 4, name = "Defeat Responses", defpos = {1,3}, size={4,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["Healing"] = { id = 5, name = "Healing", defpos = {1,1}, size={4,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["Buffs"] = { id = 6, name = "Buffs", defpos = {5,1}, size={3,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["Threat"] = { id = 7, name = "Threat", defpos = {9,4}, size={3,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["Emergency"] = { id = 8, name = "Emergency", defpos = {5,3}, size={2,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["Rez"] = { id = 9, name = "Rez", defpos = {7,3}, size={2,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["ShieldBro"] = { id = 10, name = "Shield Brother", defpos = {4,2}, size={4,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["BattleBuffs"] = { id = 11, name = "Battle Buffs", defpos = {9,2}, size={2,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["Debuff"] = { id = 12, name = "Debuff", defpos = {9,3}, size={1,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["Banners"] = { id = 13, name = "Banners", defpos = {10,3}, size={2,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["Utility"] = { id = 14, name = "Utility", defpos = {8,4}, size={1,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.userconf["ClassItems"] = { id = 15, name = "Class Items", defpos = {9,1}, size={3,1}, pos = {0,0}, combat = {true,true}, active = true };
self.settings.traits["IDOME"] = { id = 1, name = 'IDoME', active = false };
self.settings.traits["OathbreakersShame"] = { id = 2, name = 'Oathbreakers Shame', active = false };
self.settings.traits["ShieldOfTheDunadain"] = { id = 3, name = 'Shield of the Dunadain', active = false };
self.settings.traits["MasterOfWar"] = { id = 4, name = 'Master of War', active = false };
self.settings.traits["LeaderofMen"] = { id = 5, name = 'Leader of Men', active = false };
self.settings.features["GateSkills"] = { id = 1, name = 'Gate Skills', active = true };
self.settings.features["MultiMarks"] = { id = 2, name = 'Combine Marks', active = false };
self.settings.features["FearIndicator"] = { id = 3, name = 'Fear Indicator', active = true };
self.settings.defaults["BuffActive"] = { id = 1, name = 'Motivated Active', selected = 4, list = { "None", "Dim", "Hide", "Early Warning" } };
self.settings.defaults["TacticActive"] = { id = 2, name = 'Tactic Active', selected = 2, list = { "None", "Dim", "Hide", "Early Warning" } };
self.settings.defaults["IDoMEActive"] = { id = 3, name = 'IDoME Active', selected = 2, list = { "None", "Dim", "Hide" } };
self.settings.quickslots["Banner1"] = {id = 1, name = "Banner 1", active = false, type = 0, data = ""};
self.settings.quickslots["Banner2"] = {id = 2, name = "Banner 2", active = false, type = 0, data = ""};
self.settings.quickslots["Banner3"] = {id = 3, name = "Banner 3", active = false, type = 0, data = ""};
self.settings.quickslots["Armament"] = {id = 4, name = "Armaments", active = false, type = 0, data = ""};
self.settings.quickslots["SummoningHorn"] = {id = 5, name = "Summoning Horn", active = false, type = 0, data = ""};
self.settings.quickslots["BattleTonic"] = {id = 6, name = "Battle Tonic", active = false, type = 0, data = ""};
self.settings.quickslots["BlazonedCrest"] = {id = 7, name = "Blazoned Crest", active = false, type = 0, data = ""};
end
-- UPDATE SETTINGS
function CaptainBars:UpdateSettings()
if (settings.vers < 3.01) then
if (self.settings["Features"].buffdisappear) then self.settings["Features"].buffactive = 4; else self.settings["Features"].buffactive = 2; end
if (self.settings["Features"].tactichover) then self.settings["Features"].tacticactive = 2; else self.settings["Features"].tacticactive = 4; end
self.settings["Features"].buffdisappear = nil;
self.settings["Features"].tactichover = nil;
end
if (settings.vers < 3.20) then
self.settings["ClassItems"] = { active = true, x = 0, y = 0, rotate = 0 };
self.settings["Quickslots"].horn = { active = true, type = Turbine.UI.Lotro.ShortcutType.Undefined, data = ""};
self.settings["Quickslots"].tonic = { active = true, type = Turbine.UI.Lotro.ShortcutType.Undefined, data = ""};
self.settings["Quickslots"].crest = { active = true, type = Turbine.UI.Lotro.ShortcutType.Undefined, data = ""};
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 == 'idome') then
self.settings.traits["IDOME"].active = value;
elseif (key == 'oathbreakers') then
self.settings.traits["OathbreakersShame"].active = value;
elseif (key == 'shield') then
self.settings.traits["ShieldOfTheDunadain"].active = value;
elseif (key == 'lament') then
self.settings.traits["MasterOfWar"].active = value;
elseif (key == 'fearindicator') then
self.settings.features["FearIndicator"].active = value;
elseif (key == 'multimarks') then
self.settings.features["MultiMarks"].active = value;
elseif (key == 'gated') then
self.settings.features["GateSkills"].active = value;
elseif (key == 'buffactive') then
self.settings.defaults["BuffActive"].selected = value;
elseif (key == 'tacticactive') then
self.settings.defaults["TacticActive"].selected = value;
end
end
elseif (k == "Quickslots") then
for key, value in pairs(v) do
if (key == 'banner1') then
self.settings.quickslots["Banner1"].active = value.active;
self.settings.quickslots["Banner1"].type = value.type;
self.settings.quickslots["Banner1"].data = value.data;
elseif (key == 'banner2') then
self.settings.quickslots["Banner2"].active = value.active;
self.settings.quickslots["Banner2"].type = value.type;
self.settings.quickslots["Banner2"].data = value.data;
elseif (key == 'banner3') then
self.settings.quickslots["Banner3"].active = value.active;
self.settings.quickslots["Banner3"].type = value.type;
self.settings.quickslots["Banner3"].data = value.data;
elseif (key == 'armament') then
self.settings.quickslots["Armament"].active = value.active;
self.settings.quickslots["Armament"].type = value.type;
self.settings.quickslots["Armament"].data = value.data;
end
end
end
end
end
if (settings.vers < 5.00) then
self.settings.traits["LeaderofMen"] = { id = 5, name = 'Leader of Men', active = false };
self.settings.defaults["IDoMEActive"] = { id = 3, name = 'IDoME Active', selected = 2, list = { "None", "Dim", "Hide" } };
self.settings.defaults["BuffActive"].name = "Motivated Active";
settings.multidata["Brothers"] = { current = { 1 }, lock = false, parent = settings.skilldata["ShieldBrother"].parent, layer = 1, pos = settings.skilldata["ShieldBrother"].pos };
settings.skilldata["ShieldBrother"] = nil;
end
settings.vers = vars.vers;
end
-- REFRESH SKILLS AND BARS
function CaptainBars:Refresh()
-- GENERIC REFRESH (Required for all classes)
self:RefreshBars();
-- REDEFINE EFFECTLIST IN CASE OF LANGUAGE CHANGE
self.DefineEffectList();
-- CLASS SPECIFIC REFRESH
-- Setup Marks (Seperate or Multi)
if (not self.settings.features["MultiMarks"].active) then
if (self.windows["Marks"].rotate == false) then
self.windows["Marks"]:SetSize(35*3, 35);
self.windows["Marks"].width = 3;
self.windows["Marks"].height = 1;
self.multi["Marks"]:SetActive(false);
self.skills["NobleMark"]:SetActive(true);
self.skills["TellingMark"]:SetActive(true);
self.skills["RevealingMark"]:SetActive(true);
self.bars["MultiMark"]:SetZOrder(-10);
self.bars["Marks"]:SetZOrder(0);
else
self.windows["Marks"]:SetSize(35, 35 * 3);
self.windows["Marks"].width = 1;
self.windows["Marks"].height = 3;
self.multi["Marks"]:SetActive(false);
self.skills["NobleMark"]:SetActive(true);
self.skills["TellingMark"]:SetActive(true);
self.skills["RevealingMark"]:SetActive(true);
self.bars["MultiMark"]:SetZOrder(-10);
self.bars["Marks"]:SetZOrder(0);
end
else
self.windows["Marks"]:SetSize(35, 35);
self.multi["Marks"]:SetPosition(0, 0);
self.windows["Marks"].width = 1;
self.windows["Marks"].height = 1;
self.multi["Marks"]:SetActive(true);
self.skills["NobleMark"]:SetActive(false);
self.skills["TellingMark"]:SetActive(false);
self.skills["RevealingMark"]:SetActive(false);
self.bars["MultiMark"]:SetZOrder(0);
self.bars["Marks"]:SetZOrder(-10);
end
-- Setup Features
self.skills["ShieldOfTheDunadain"]:SetActive(self.settings.traits["ShieldOfTheDunadain"].active);
self.skills["OathbreakersShame"]:SetActive(self.settings.traits["OathbreakersShame"].active);
self.skills["DevastatingBlow"]:SetActive(not self.settings.features["GateSkills"].active or self.effectlist["BattleReadied"]:GetState());
self.skills["PressingAttack"]:SetActive(not self.settings.features["GateSkills"].active or self.effectlist["BattleReadied"]:GetState());
self.skills["BladeOfElendil"]:SetActive(not self.settings.features["GateSkills"].active or self.effectlist["BattleHardened"]:GetState());
self.skills["RoutingCry"]:SetActive(self.settings.traits["LeaderofMen"].active or self.effectlist["EnemyDefeatResponse"]:GetState());
self.skills["ShadowsLament"]:SetActive(self.settings.traits["MasterOfWar"].active or self.effectlist["EnemyDefeatResponse"]:GetState());
-- Level Check Multis
self.multi["Brothers"]:LevelCheck();
self.multi["Tactic"]:LevelCheck();
self.multi["Marks"]:LevelCheck();
self.multi["Heralds"]:LevelCheck();
-- Set Quickslots
self.skills["SummoningHorn"]:SetQuickslot(self.settings.quickslots["SummoningHorn"]);
self.skills["BattleTonic"]:SetQuickslot(self.settings.quickslots["BattleTonic"]);
self.skills["BlazonedCrest"]:SetQuickslot(self.settings.quickslots["BlazonedCrest"]);
-- Rebuild Banner Multi
self.multi["Banners"]:Clear();
self.multi["Banners"]:AddShortCut("Banner 1", self.settings.quickslots["Banner1"]);
self.multi["Banners"]:AddShortCut("Banner 2", self.settings.quickslots["Banner2"]);
self.multi["Banners"]:AddShortCut("Banner 3", self.settings.quickslots["Banner3"]);
self.multi["Banners"]:AddShortCut("Armament", self.settings.quickslots["Armament"]);
self.multi["Banners"]:Refresh(true);
-- Set Buff Visibility/Hover based on BuffActive settings
self.skills["MotivatingSpeech"]:SetActive( true );
self.skills["MotivatingSpeech"]:SetHover( false );
self.skills["IDOME"]:SetActive( self.settings.traits["IDOME"].active );
self.skills["IDOME"]:SetHover( false );
if (self.settings.defaults["BuffActive"].selected == 2) then
self.skills["MotivatingSpeech"]:SetHover( self.effectlist["Motivated"]:GetState() );
elseif (self.settings.defaults["BuffActive"].selected >= 3) then
self.skills["MotivatingSpeech"]:SetActive( not self.effectlist["Motivated"]:GetState() );
end
if (self.settings.defaults["IDoMEActive"].selected == 2) then
self.skills["IDOME"]:SetHover( self.effectlist["InDefenceOfMiddleEarth"]:GetState() );
elseif (self.settings.defaults["IDoMEActive"].selected == 3) then
self.skills["IDOME"]:SetActive( not self.effectlist["InDefenceOfMiddleEarth"]:GetState() and self.settings.traits["IDOME"].active );
end
self.multi["Tactic"]:SetActive( true );
self.multi["Tactic"]:SetHover( false );
if (self.settings.defaults["TacticActive"].selected == 2) then
self.multi["Tactic"]:SetHover( self.effectlist["OnGuard"]:GetState() );
elseif (self.settings.defaults["TacticActive"].selected >= 3) then
self.multi["Tactic"]:SetActive( not self.effectlist["OnGuard"]:GetState() );
end
-- Set Fear Indicator
if (settings.skilldata["MusterCourage"].parent ~= nil and vars.playerlevel >= self.skills["MusterCourage"].level[1] and self.settings.features["FearIndicator"].active and self.fear > 0) then
if (self.settings.userconf[settings.skilldata["MusterCourage"].parent].active) then
self.skills["MusterCourage"]:SetColor("purple");
end
else
self.skills["MusterCourage"]:SetColor();
end
-- Refresh States
self:CombatChange(vars.player:IsInCombat());
end