Fixes #4 - missing totems
Added formatter file, removed whitespaces, fixed issue with tremor totem missing.
This commit is contained in:
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"[lua]": {
|
||||||
|
"editor.defaultFormatter": "Koihik.vscode-lua-format"
|
||||||
|
}
|
||||||
|
}
|
||||||
+114
-82
@@ -8,25 +8,21 @@
|
|||||||
|
|
||||||
Totem Module Data
|
Totem Module Data
|
||||||
|
|
||||||
]]
|
]] --[[ ----------------------------------------------------------------
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
|
||||||
COE.TotemData contains a list of totem classes that are
|
COE.TotemData contains a list of totem classes that are
|
||||||
returned by COE:CreateTotem
|
returned by COE:CreateTotem
|
||||||
For every available totem the player has, one object is
|
For every available totem the player has, one object is
|
||||||
added to this list
|
added to this list
|
||||||
-------------------------------------------------------------------]]
|
-------------------------------------------------------------------]] COE["TotemData"] =
|
||||||
COE["TotemData"] = {};
|
{};
|
||||||
COE["TotemCount"] = 0;
|
COE["TotemCount"] = 0;
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
COE.MaxTotems stores the maximum number of totems per element
|
COE.MaxTotems stores the maximum number of totems per element
|
||||||
This is taken right from the current game content
|
This is taken right from the current game content
|
||||||
-------------------------------------------------------------------]]
|
-------------------------------------------------------------------]]
|
||||||
COE["MaxTotems"] = {Earth = 5, Fire = 5, Water = 7, Air = 7};
|
COE["MaxTotems"] = {Earth = 5, Fire = 5, Water = 7, Air = 7};
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
COE.TotemsAvailable contains the number of totems available
|
COE.TotemsAvailable contains the number of totems available
|
||||||
of each element
|
of each element
|
||||||
@@ -37,7 +33,6 @@ COE.TotemsAvailable["Fire"] = 0;
|
|||||||
COE.TotemsAvailable["Water"] = 0;
|
COE.TotemsAvailable["Water"] = 0;
|
||||||
COE.TotemsAvailable["Air"] = 0;
|
COE.TotemsAvailable["Air"] = 0;
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
COE.ActiveTotems contains a pointer to the active totem of
|
COE.ActiveTotems contains a pointer to the active totem of
|
||||||
each element
|
each element
|
||||||
@@ -53,7 +48,6 @@ COE.TotemsAvailable["Air"] = 0;
|
|||||||
COE["ActiveTotems"] = {Earth = nil, Fire = nil, Water = nil, Air = nil};
|
COE["ActiveTotems"] = {Earth = nil, Fire = nil, Water = nil, Air = nil};
|
||||||
COE["TotemPending"] = {Totem = nil, UseRank = 0, Timeout = 0.75};
|
COE["TotemPending"] = {Totem = nil, UseRank = 0, Timeout = 0.75};
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
COE.CleansingTotems stores pointers to the buttons and totems
|
COE.CleansingTotems stores pointers to the buttons and totems
|
||||||
that are able to cleanse poisons, diseases and sleep, charm
|
that are able to cleanse poisons, diseases and sleep, charm
|
||||||
@@ -62,8 +56,8 @@ COE["TotemPending"] = { Totem = nil, UseRank = 0, Timeout = 0.75 };
|
|||||||
COE["CleansingTotems"] = {
|
COE["CleansingTotems"] = {
|
||||||
Poison = {Totem = nil, Button = nil, Warn = false},
|
Poison = {Totem = nil, Button = nil, Warn = false},
|
||||||
Disease = {Totem = nil, Button = nil, Warn = false},
|
Disease = {Totem = nil, Button = nil, Warn = false},
|
||||||
Tremor = { Totem = nil, Button = nil, Warn = false } };
|
Tremor = {Totem = nil, Button = nil, Warn = false}
|
||||||
|
};
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
COE.TotemSets contains the totem pointers for each set and
|
COE.TotemSets contains the totem pointers for each set and
|
||||||
@@ -72,21 +66,27 @@ Tremor = { Totem = nil, Button = nil, Warn = false } };
|
|||||||
COE["TotemSetCount"] = 0;
|
COE["TotemSetCount"] = 0;
|
||||||
COE["TotemSets"] = {}
|
COE["TotemSets"] = {}
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
COE.SetCycle stores which totem of the active set have
|
COE.SetCycle stores which totem of the active set have
|
||||||
already been thrown
|
already been thrown
|
||||||
-------------------------------------------------------------------]]
|
-------------------------------------------------------------------]]
|
||||||
COE["SetCycle"] = {Earth = false, Fire = false, Water = false, Air = false};
|
COE["SetCycle"] = {Earth = false, Fire = false, Water = false, Air = false};
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
COE.NoTotem is a placeholder for an empty anchor button
|
COE.NoTotem is a placeholder for an empty anchor button
|
||||||
-------------------------------------------------------------------]]
|
-------------------------------------------------------------------]]
|
||||||
COE["NoTotem"] = { SpellName = "", Element = "", Texture = "Interface\\Icons\\INV_Misc_Idol_03.blp",
|
COE["NoTotem"] = {
|
||||||
ToolPresent = false, Ranks = { SpellID = 0, Mana = 0, Duration = 0, Health = 0, Cooldown = 0 },
|
SpellName = "",
|
||||||
MaxRank = 1, isActive = false, CurDuration = 0, CurHealth = 0, CurCooldown = 0 };
|
Element = "",
|
||||||
|
Texture = "Interface\\Icons\\INV_Misc_Idol_03.blp",
|
||||||
|
ToolPresent = false,
|
||||||
|
Ranks = {SpellID = 0, Mana = 0, Duration = 0, Health = 0, Cooldown = 0},
|
||||||
|
MaxRank = 1,
|
||||||
|
isActive = false,
|
||||||
|
CurDuration = 0,
|
||||||
|
CurHealth = 0,
|
||||||
|
CurCooldown = 0
|
||||||
|
};
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:CreateTotem
|
METHOD: COE:CreateTotem
|
||||||
@@ -94,13 +94,22 @@ COE["NoTotem"] = { SpellName = "", Element = "", Texture = "Interface\\Icons\\IN
|
|||||||
PURPOSE: Returns the totem class for a new totem
|
PURPOSE: Returns the totem class for a new totem
|
||||||
-------------------------------------------------------------------]]
|
-------------------------------------------------------------------]]
|
||||||
function COE:CreateTotem()
|
function COE:CreateTotem()
|
||||||
return { SpellName = "", Element = "", Texture = "",
|
return {
|
||||||
ToolPresent = false, Ranks = {}, MaxRank = 0, isActive = false,
|
SpellName = "",
|
||||||
CurDuration = 0, CurHealth = 0, CurCooldown = 0,
|
Element = "",
|
||||||
isTrinket = false, TrinketSlot = nil };
|
Texture = "",
|
||||||
|
ToolPresent = false,
|
||||||
|
Ranks = {},
|
||||||
|
MaxRank = 0,
|
||||||
|
isActive = false,
|
||||||
|
CurDuration = 0,
|
||||||
|
CurHealth = 0,
|
||||||
|
CurCooldown = 0,
|
||||||
|
isTrinket = false,
|
||||||
|
TrinketSlot = nil
|
||||||
|
};
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:CreateTotemRank
|
METHOD: COE:CreateTotemRank
|
||||||
|
|
||||||
@@ -110,7 +119,6 @@ function COE:CreateTotemRank()
|
|||||||
return {SpellID = 0, Mana = 0, Duration = 0, Health = 0, Cooldown = 0};
|
return {SpellID = 0, Mana = 0, Duration = 0, Health = 0, Cooldown = 0};
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:ElementFromTool
|
METHOD: COE:ElementFromTool
|
||||||
|
|
||||||
@@ -132,7 +140,6 @@ function COE:ElementFromTool( element )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:LocalizedElement
|
METHOD: COE:LocalizedElement
|
||||||
|
|
||||||
@@ -152,7 +159,6 @@ function COE:LocalizedElement( element )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:ScanTotems
|
METHOD: COE:ScanTotems
|
||||||
|
|
||||||
@@ -174,17 +180,16 @@ function COE:ScanTotems()
|
|||||||
|
|
||||||
-- iterate over all spells in the spellbook
|
-- iterate over all spells in the spellbook
|
||||||
-- -----------------------------------------
|
-- -----------------------------------------
|
||||||
local i, k = 1;
|
local i = 1;
|
||||||
while true do
|
while true do
|
||||||
|
|
||||||
local SpellName, SpellRank = GetSpellName(i, BOOKTYPE_SPELL);
|
local SpellName, SpellRank = GetSpellName(i, BOOKTYPE_SPELL);
|
||||||
if not SpellName or SpellName == "Totemic Recall" then
|
if not SpellName then do break end end
|
||||||
do break end;
|
|
||||||
end
|
|
||||||
|
|
||||||
-- is this a totem?
|
-- is this a totem?
|
||||||
-- -----------------
|
-- -----------------
|
||||||
if( string.find( SpellName, COESTR_SCANTOTEMS ) ~= nil ) then
|
if (SpellName ~= "Totemic Recall" and
|
||||||
|
string.find(SpellName, COESTR_SCANTOTEMS) ~= nil) then
|
||||||
|
|
||||||
local newtotem = true;
|
local newtotem = true;
|
||||||
local totem = nil;
|
local totem = nil;
|
||||||
@@ -207,7 +212,7 @@ function COE:ScanTotems()
|
|||||||
-- --------------------------
|
-- --------------------------
|
||||||
totem = COE.TotemData[k];
|
totem = COE.TotemData[k];
|
||||||
newtotem = false;
|
newtotem = false;
|
||||||
break;
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -228,7 +233,8 @@ function COE:ScanTotems()
|
|||||||
local text = COETotemTTTextLeft4;
|
local text = COETotemTTTextLeft4;
|
||||||
if (text and text:GetText()) then
|
if (text and text:GetText()) then
|
||||||
|
|
||||||
local _,_, element = string.find( text:GetText(), COESTR_TOTEMTOOLS );
|
local _, _, element =
|
||||||
|
string.find(text:GetText(), COESTR_TOTEMTOOLS);
|
||||||
if (element) then
|
if (element) then
|
||||||
|
|
||||||
-- if element starts with a |, the player does
|
-- if element starts with a |, the player does
|
||||||
@@ -250,7 +256,8 @@ function COE:ScanTotems()
|
|||||||
-- ---------------
|
-- ---------------
|
||||||
if (COE.TotemsAvailable[element] ~= nil) then
|
if (COE.TotemsAvailable[element] ~= nil) then
|
||||||
totem.Element = element;
|
totem.Element = element;
|
||||||
COE.TotemsAvailable[element] = COE.TotemsAvailable[element] + 1;
|
COE.TotemsAvailable[element] =
|
||||||
|
COE.TotemsAvailable[element] + 1;
|
||||||
else
|
else
|
||||||
COE:Message(COESTR_INVALIDELEMENT .. SpellName);
|
COE:Message(COESTR_INVALIDELEMENT .. SpellName);
|
||||||
end
|
end
|
||||||
@@ -281,21 +288,18 @@ function COE:ScanTotems()
|
|||||||
if (text and text:GetText()) then
|
if (text and text:GetText()) then
|
||||||
|
|
||||||
local _, _, mana = string.find(text:GetText(), COESTR_TOTEMMANA);
|
local _, _, mana = string.find(text:GetText(), COESTR_TOTEMMANA);
|
||||||
if( mana ) then
|
if (mana) then totemrank.Mana = tonumber(mana); end
|
||||||
totemrank.Mana = tonumber( mana );
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- get totem duration and health
|
-- get totem duration and health
|
||||||
-- ------------------------------
|
-- ------------------------------
|
||||||
totemrank.Duration, totemrank.Health, totemrank.Cooldown = COE:GetTotemDurationAndHealth( i );
|
totemrank.Duration, totemrank.Health, totemrank.Cooldown =
|
||||||
|
COE:GetTotemDurationAndHealth(i);
|
||||||
|
|
||||||
-- store rank in totem
|
-- store rank in totem
|
||||||
-- --------------------
|
-- --------------------
|
||||||
totem.Ranks[rank] = totemrank;
|
totem.Ranks[rank] = totemrank;
|
||||||
if( rank > totem.MaxRank ) then
|
if (rank > totem.MaxRank) then totem.MaxRank = rank; end
|
||||||
totem.MaxRank = rank;
|
|
||||||
end
|
|
||||||
|
|
||||||
-- is this a new totem?
|
-- is this a new totem?
|
||||||
-- ---------------------
|
-- ---------------------
|
||||||
@@ -305,7 +309,6 @@ function COE:ScanTotems()
|
|||||||
COE.TotemCount = COE.TotemCount + 1;
|
COE.TotemCount = COE.TotemCount + 1;
|
||||||
COE.TotemData[COE.TotemCount] = totem;
|
COE.TotemData[COE.TotemCount] = totem;
|
||||||
|
|
||||||
|
|
||||||
-- check if it's a cleansing totem
|
-- check if it's a cleansing totem
|
||||||
-- --------------------------------
|
-- --------------------------------
|
||||||
if (SpellName == COESTR_TOTEMPOISON) then
|
if (SpellName == COESTR_TOTEMPOISON) then
|
||||||
@@ -327,7 +330,11 @@ function COE:ScanTotems()
|
|||||||
-- perhaps a new totem. set it to default visible
|
-- perhaps a new totem. set it to default visible
|
||||||
-- and reorder it when the element count is known
|
-- and reorder it when the element count is known
|
||||||
-- -----------------------------------------------
|
-- -----------------------------------------------
|
||||||
COE_DisplayedTotems[SpellName] = { Order = 0, Element = totem.Element, Visible = true };
|
COE_DisplayedTotems[SpellName] = {
|
||||||
|
Order = 0,
|
||||||
|
Element = totem.Element,
|
||||||
|
Visible = true
|
||||||
|
};
|
||||||
else
|
else
|
||||||
-- update old saved variables versions by adding the element
|
-- update old saved variables versions by adding the element
|
||||||
-- ----------------------------------------------------------
|
-- ----------------------------------------------------------
|
||||||
@@ -377,9 +384,10 @@ function COE:ScanTotems()
|
|||||||
-- Finish
|
-- Finish
|
||||||
-- ===================================
|
-- ===================================
|
||||||
|
|
||||||
COE:DebugMessage( "Found " .. COE.TotemCount .. " totems in spellbook" ..
|
COE:DebugMessage(
|
||||||
"(" .. COE.TotemsAvailable.Earth .. " Earth, " ..
|
"Found " .. COE.TotemCount .. " totems in spellbook" .. "(" ..
|
||||||
COE.TotemsAvailable.Fire .. " Fire, " .. COE.TotemsAvailable.Water .. " Water, " ..
|
COE.TotemsAvailable.Earth .. " Earth, " .. COE.TotemsAvailable.Fire ..
|
||||||
|
" Fire, " .. COE.TotemsAvailable.Water .. " Water, " ..
|
||||||
COE.TotemsAvailable.Air .. " Air)");
|
COE.TotemsAvailable.Air .. " Air)");
|
||||||
|
|
||||||
-- reorder new totems
|
-- reorder new totems
|
||||||
@@ -388,7 +396,6 @@ function COE:ScanTotems()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:GetTotemDurationAndHealth
|
METHOD: COE:GetTotemDurationAndHealth
|
||||||
|
|
||||||
@@ -441,7 +448,8 @@ function COE:GetTotemDurationAndHealth( spellid )
|
|||||||
-- look if there are two second specifications
|
-- look if there are two second specifications
|
||||||
-- if so, take the greate one
|
-- if so, take the greate one
|
||||||
-- --------------------------------------------
|
-- --------------------------------------------
|
||||||
local _,_,sectext2 = string.find( string.sub( text, b ), COESTR_SECDURATION );
|
local _, _, sectext2 = string.find(string.sub(text, b),
|
||||||
|
COESTR_SECDURATION);
|
||||||
|
|
||||||
if (sectext2) then
|
if (sectext2) then
|
||||||
duration = math.max(tonumber(sectext1), tonumber(sectext2));
|
duration = math.max(tonumber(sectext1), tonumber(sectext2));
|
||||||
@@ -461,7 +469,7 @@ function COE:GetTotemDurationAndHealth( spellid )
|
|||||||
if (table.getn(match) >= 1) then
|
if (table.getn(match) >= 1) then
|
||||||
|
|
||||||
health = tonumber(match[1]);
|
health = tonumber(match[1]);
|
||||||
break;
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -491,7 +499,6 @@ function COE:GetTotemDurationAndHealth( spellid )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:IsToolPresent
|
METHOD: COE:IsToolPresent
|
||||||
|
|
||||||
@@ -518,16 +525,13 @@ function COE:IsToolPresent( spellid )
|
|||||||
-- if element doesn't start with a |, the player
|
-- if element doesn't start with a |, the player
|
||||||
-- possesses the needed totem for this spell
|
-- possesses the needed totem for this spell
|
||||||
-- ------------------------------------------------
|
-- ------------------------------------------------
|
||||||
if( string.sub( element, 1, 1 ) ~= "|" ) then
|
if (string.sub(element, 1, 1) ~= "|") then return true; end
|
||||||
return true;
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:IsTrinketPresent
|
METHOD: COE:IsTrinketPresent
|
||||||
|
|
||||||
@@ -556,7 +560,6 @@ function COE:IsTrinketPresent()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:ReorderNewTotems
|
METHOD: COE:ReorderNewTotems
|
||||||
|
|
||||||
@@ -565,32 +568,50 @@ end
|
|||||||
totems in this element
|
totems in this element
|
||||||
-------------------------------------------------------------------]]
|
-------------------------------------------------------------------]]
|
||||||
function COE:ReorderNewTotems()
|
function COE:ReorderNewTotems()
|
||||||
|
COE:DebugMessage("Executing ReorderNewTotems");
|
||||||
|
|
||||||
local nextslot = { Earth = COE.TotemsAvailable.Earth, Fire = COE.TotemsAvailable.Fire,
|
local nextslot = {
|
||||||
Water = COE.TotemsAvailable.Water, Air = COE.TotemsAvailable.Air };
|
Earth = COE.TotemsAvailable.Earth,
|
||||||
|
Fire = COE.TotemsAvailable.Fire,
|
||||||
|
Water = COE.TotemsAvailable.Water,
|
||||||
|
Air = COE.TotemsAvailable.Air
|
||||||
|
};
|
||||||
|
|
||||||
local used = {Earth = {}, Fire = {}, Water = {}, Air = {}};
|
local used = {Earth = {}, Fire = {}, Water = {}, Air = {}};
|
||||||
local bError = false;
|
local bError = false;
|
||||||
|
|
||||||
local k;
|
COE:DebugMessage("ReorderNewTotems COE.TotemCount: " .. COE.TotemCount);
|
||||||
|
|
||||||
for k = 1, COE.TotemCount do
|
for k = 1, COE.TotemCount do
|
||||||
|
|
||||||
local totem = COE.TotemData[k];
|
local totem = COE.TotemData[k];
|
||||||
|
COE:DebugMessage(
|
||||||
|
"ReorderNewTotems processing totem: " .. totem.Element .. " " ..
|
||||||
|
totem.SpellName);
|
||||||
|
|
||||||
if (COE_DisplayedTotems[totem.SpellName] ~= nil) then
|
if (COE_DisplayedTotems[totem.SpellName] ~= nil) then
|
||||||
if (COE_DisplayedTotems[totem.SpellName].Order == 0) then
|
if (COE_DisplayedTotems[totem.SpellName].Order == 0) then
|
||||||
|
|
||||||
-- this totem has just been added
|
-- this totem has just been added
|
||||||
-- assign the currently free slot
|
-- assign the currently free slot
|
||||||
-- -------------------------------
|
-- -------------------------------
|
||||||
COE_DisplayedTotems[totem.SpellName].Order = nextslot[totem.Element];
|
if (not nextslot[totem.Element]) then
|
||||||
|
COE:DebugMessage(
|
||||||
|
"ReorderNewTotems nextslot[totem.Element] is nil");
|
||||||
|
end
|
||||||
|
|
||||||
|
COE_DisplayedTotems[totem.SpellName].Order =
|
||||||
|
nextslot[totem.Element];
|
||||||
nextslot[totem.Element] = nextslot[totem.Element] - 1;
|
nextslot[totem.Element] = nextslot[totem.Element] - 1;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- register that this slot of the element is now in use
|
-- register that this slot of the element is now in use
|
||||||
-- mark as error if already in use
|
-- mark as error if already in use
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
if( used[totem.Element][COE_DisplayedTotems[totem.SpellName].Order] == nil ) then
|
if (used[totem.Element][COE_DisplayedTotems[totem.SpellName].Order] ==
|
||||||
used[totem.Element][COE_DisplayedTotems[totem.SpellName].Order] = true;
|
nil) then
|
||||||
|
used[totem.Element][COE_DisplayedTotems[totem.SpellName].Order] =
|
||||||
|
true;
|
||||||
else
|
else
|
||||||
bError = true;
|
bError = true;
|
||||||
end
|
end
|
||||||
@@ -617,7 +638,6 @@ function COE:ReorderNewTotems()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:InitTotemSets
|
METHOD: COE:InitTotemSets
|
||||||
|
|
||||||
@@ -632,15 +652,18 @@ function COE:InitTotemSets()
|
|||||||
|
|
||||||
-- for each standard set
|
-- for each standard set
|
||||||
-- ----------------------
|
-- ----------------------
|
||||||
local set;
|
|
||||||
for set = 1, table.getn(COE_SavedTotemSets) do
|
for set = 1, table.getn(COE_SavedTotemSets) do
|
||||||
|
|
||||||
COE.TotemSets[set] = { Earth = nil, Fire = nil, Water = nil, Air = nil,
|
COE.TotemSets[set] = {
|
||||||
CastOrder = COE_SavedTotemSets[set].CastOrder };
|
Earth = nil,
|
||||||
|
Fire = nil,
|
||||||
|
Water = nil,
|
||||||
|
Air = nil,
|
||||||
|
CastOrder = COE_SavedTotemSets[set].CastOrder
|
||||||
|
};
|
||||||
|
|
||||||
-- for each element
|
-- for each element
|
||||||
-- -----------------
|
-- -----------------
|
||||||
local k, totem;
|
|
||||||
for k = 1, 4 do
|
for k = 1, 4 do
|
||||||
|
|
||||||
if (COE_SavedTotemSets[set][indices[k]] ~= "") then
|
if (COE_SavedTotemSets[set][indices[k]] ~= "") then
|
||||||
@@ -649,7 +672,8 @@ function COE:InitTotemSets()
|
|||||||
-- ------------------------
|
-- ------------------------
|
||||||
for totem in COE.TotemData do
|
for totem in COE.TotemData do
|
||||||
|
|
||||||
if( COE.TotemData[totem].SpellName == COE_SavedTotemSets[set][indices[k]] ) then
|
if (COE.TotemData[totem].SpellName ==
|
||||||
|
COE_SavedTotemSets[set][indices[k]]) then
|
||||||
COE.TotemSets[set][indices[k]] = COE.TotemData[totem];
|
COE.TotemSets[set][indices[k]] = COE.TotemData[totem];
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -661,8 +685,13 @@ function COE:InitTotemSets()
|
|||||||
-- --------------------
|
-- --------------------
|
||||||
for set = 1, table.getn(COE_CustomTotemSets) do
|
for set = 1, table.getn(COE_CustomTotemSets) do
|
||||||
|
|
||||||
COE.TotemSets[COESET_DEFAULT + set] = { Earth = nil, Fire = nil, Water = nil, Air = nil,
|
COE.TotemSets[COESET_DEFAULT + set] = {
|
||||||
CastOrder = COE_CustomTotemSets[set].CastOrder };
|
Earth = nil,
|
||||||
|
Fire = nil,
|
||||||
|
Water = nil,
|
||||||
|
Air = nil,
|
||||||
|
CastOrder = COE_CustomTotemSets[set].CastOrder
|
||||||
|
};
|
||||||
|
|
||||||
-- for each element
|
-- for each element
|
||||||
-- -----------------
|
-- -----------------
|
||||||
@@ -675,8 +704,10 @@ function COE:InitTotemSets()
|
|||||||
-- ------------------------
|
-- ------------------------
|
||||||
for totem in COE.TotemData do
|
for totem in COE.TotemData do
|
||||||
|
|
||||||
if( COE.TotemData[totem].SpellName == COE_CustomTotemSets[set][indices[k]] ) then
|
if (COE.TotemData[totem].SpellName ==
|
||||||
COE.TotemSets[COESET_DEFAULT + set][indices[k]] = COE.TotemData[totem];
|
COE_CustomTotemSets[set][indices[k]]) then
|
||||||
|
COE.TotemSets[COESET_DEFAULT + set][indices[k]] =
|
||||||
|
COE.TotemData[totem];
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -687,7 +718,6 @@ function COE:InitTotemSets()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ =============================================================================================
|
--[[ =============================================================================================
|
||||||
|
|
||||||
F I X E S
|
F I X E S
|
||||||
@@ -729,7 +759,6 @@ function COE:Fix_CastOrderLocalization()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:Fix_DisplayedTotems
|
METHOD: COE:Fix_DisplayedTotems
|
||||||
|
|
||||||
@@ -767,13 +796,10 @@ function COE:Fix_DisplayedTotems()
|
|||||||
|
|
||||||
-- notify user
|
-- notify user
|
||||||
-- ------------
|
-- ------------
|
||||||
if( fixed ) then
|
if (fixed) then COE:Message(COESTR_FIXEDDISPLAY); end
|
||||||
COE:Message( COESTR_FIXEDDISPLAY );
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:Fix_CastOrderLocalization2
|
METHOD: COE:Fix_CastOrderLocalization2
|
||||||
|
|
||||||
@@ -791,13 +817,16 @@ function COE:Fix_CastOrderLocalization2()
|
|||||||
if (COE_SavedTotemSets[set].CastOrder[k] == COESTR_TOTEMTOOLS_EARTH) then
|
if (COE_SavedTotemSets[set].CastOrder[k] == COESTR_TOTEMTOOLS_EARTH) then
|
||||||
COE_SavedTotemSets[set].CastOrder[k] = COESTR_ELEMENT_EARTH;
|
COE_SavedTotemSets[set].CastOrder[k] = COESTR_ELEMENT_EARTH;
|
||||||
|
|
||||||
elseif( COE_SavedTotemSets[set].CastOrder[k] == COESTR_TOTEMTOOLS_FIRE ) then
|
elseif (COE_SavedTotemSets[set].CastOrder[k] ==
|
||||||
|
COESTR_TOTEMTOOLS_FIRE) then
|
||||||
COE_SavedTotemSets[set].CastOrder[k] = COESTR_ELEMENT_FIRE;
|
COE_SavedTotemSets[set].CastOrder[k] = COESTR_ELEMENT_FIRE;
|
||||||
|
|
||||||
elseif( COE_SavedTotemSets[set].CastOrder[k] == COESTR_TOTEMTOOLS_WATER ) then
|
elseif (COE_SavedTotemSets[set].CastOrder[k] ==
|
||||||
|
COESTR_TOTEMTOOLS_WATER) then
|
||||||
COE_SavedTotemSets[set].CastOrder[k] = COESTR_ELEMENT_WATER;
|
COE_SavedTotemSets[set].CastOrder[k] = COESTR_ELEMENT_WATER;
|
||||||
|
|
||||||
elseif( COE_SavedTotemSets[set].CastOrder[k] == COESTR_TOTEMTOOLS_AIR ) then
|
elseif (COE_SavedTotemSets[set].CastOrder[k] ==
|
||||||
|
COESTR_TOTEMTOOLS_AIR) then
|
||||||
COE_SavedTotemSets[set].CastOrder[k] = COESTR_ELEMENT_AIR;
|
COE_SavedTotemSets[set].CastOrder[k] = COESTR_ELEMENT_AIR;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -811,13 +840,16 @@ function COE:Fix_CastOrderLocalization2()
|
|||||||
if (COE_CustomTotemSets[set].CastOrder[k] == COESTR_TOTEMTOOLS_EARTH) then
|
if (COE_CustomTotemSets[set].CastOrder[k] == COESTR_TOTEMTOOLS_EARTH) then
|
||||||
COE_CustomTotemSets[set].CastOrder[k] = COESTR_ELEMENT_EARTH;
|
COE_CustomTotemSets[set].CastOrder[k] = COESTR_ELEMENT_EARTH;
|
||||||
|
|
||||||
elseif( COE_CustomTotemSets[set].CastOrder[k] == COESTR_TOTEMTOOLS_FIRE ) then
|
elseif (COE_CustomTotemSets[set].CastOrder[k] ==
|
||||||
|
COESTR_TOTEMTOOLS_FIRE) then
|
||||||
COE_CustomTotemSets[set].CastOrder[k] = COESTR_ELEMENT_FIRE;
|
COE_CustomTotemSets[set].CastOrder[k] = COESTR_ELEMENT_FIRE;
|
||||||
|
|
||||||
elseif( COE_CustomTotemSets[set].CastOrder[k] == COESTR_TOTEMTOOLS_WATER ) then
|
elseif (COE_CustomTotemSets[set].CastOrder[k] ==
|
||||||
|
COESTR_TOTEMTOOLS_WATER) then
|
||||||
COE_CustomTotemSets[set].CastOrder[k] = COESTR_ELEMENT_WATER;
|
COE_CustomTotemSets[set].CastOrder[k] = COESTR_ELEMENT_WATER;
|
||||||
|
|
||||||
elseif( COE_CustomTotemSets[set].CastOrder[k] == COESTR_TOTEMTOOLS_AIR ) then
|
elseif (COE_CustomTotemSets[set].CastOrder[k] ==
|
||||||
|
COESTR_TOTEMTOOLS_AIR) then
|
||||||
COE_CustomTotemSets[set].CastOrder[k] = COESTR_ELEMENT_AIR;
|
COE_CustomTotemSets[set].CastOrder[k] = COESTR_ELEMENT_AIR;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+5
-19
@@ -5,11 +5,7 @@
|
|||||||
|
|
||||||
by Wyverex (2006)
|
by Wyverex (2006)
|
||||||
|
|
||||||
]]
|
]] if (not COE) then COE = {}; end
|
||||||
|
|
||||||
if( not COE ) then
|
|
||||||
COE = {};
|
|
||||||
end
|
|
||||||
|
|
||||||
COE_VERSION = 2.6
|
COE_VERSION = 2.6
|
||||||
|
|
||||||
@@ -40,7 +36,6 @@ COE["EventPrintMode"] = false;
|
|||||||
COE["UpdateInterval"] = 0.1;
|
COE["UpdateInterval"] = 0.1;
|
||||||
COE["ForceUpdate"] = COE.UpdateInterval * 2;
|
COE["ForceUpdate"] = COE.UpdateInterval * 2;
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
The AdvisorInterval controls how often the party/raid is
|
The AdvisorInterval controls how often the party/raid is
|
||||||
scanned for debuffs that are curable by totems
|
scanned for debuffs that are curable by totems
|
||||||
@@ -50,7 +45,6 @@ COE["ForceUpdate"] = COE.UpdateInterval * 2;
|
|||||||
COE["AdvisorInterval"] = 1;
|
COE["AdvisorInterval"] = 1;
|
||||||
COE["AdvisorWarningInterval"] = 7;
|
COE["AdvisorWarningInterval"] = 7;
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:Init
|
METHOD: COE:Init
|
||||||
|
|
||||||
@@ -127,8 +121,7 @@ end
|
|||||||
-------------------------------------------------------------------]]
|
-------------------------------------------------------------------]]
|
||||||
function COE:Message(msg)
|
function COE:Message(msg)
|
||||||
DEFAULT_CHAT_FRAME:AddMessage("[COE] " .. msg, 0.93, 0.83, 0.45);
|
DEFAULT_CHAT_FRAME:AddMessage("[COE] " .. msg, 0.93, 0.83, 0.45);
|
||||||
end;
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:DebugMessage
|
METHOD: COE:DebugMessage
|
||||||
@@ -140,8 +133,7 @@ function COE:DebugMessage( msg )
|
|||||||
if (COE.DebugMode) then
|
if (COE.DebugMode) then
|
||||||
DEFAULT_CHAT_FRAME:AddMessage("[COE] " .. msg, 1, 0, 0);
|
DEFAULT_CHAT_FRAME:AddMessage("[COE] " .. msg, 1, 0, 0);
|
||||||
end
|
end
|
||||||
end;
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:Notification
|
METHOD: COE:Notification
|
||||||
@@ -169,8 +161,7 @@ function COE:Notification( msg, color )
|
|||||||
-- ------------
|
-- ------------
|
||||||
UIErrorsFrame:AddMessage(msg, col.r, col.g, col.b, 1.0, UIERRORS_HOLD_TIME);
|
UIErrorsFrame:AddMessage(msg, col.r, col.g, col.b, 1.0, UIERRORS_HOLD_TIME);
|
||||||
|
|
||||||
end;
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:ToggleConfigFrame
|
METHOD: COE:ToggleConfigFrame
|
||||||
@@ -189,7 +180,6 @@ function COE:ToggleConfigFrame()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COEProcessShellCommand
|
METHOD: COEProcessShellCommand
|
||||||
|
|
||||||
@@ -239,14 +229,11 @@ function COEProcessShellCommand( msg )
|
|||||||
|
|
||||||
else
|
else
|
||||||
local _, _, arg = string.find(msg, "set (.*)");
|
local _, _, arg = string.find(msg, "set (.*)");
|
||||||
if( arg ) then
|
if (arg) then COE_Totem:SwitchToSet(arg); end
|
||||||
COE_Totem:SwitchToSet( arg );
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:DisplayShellCommands
|
METHOD: COE:DisplayShellCommands
|
||||||
|
|
||||||
@@ -271,7 +258,6 @@ function COE:DisplayShellCommands()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:FixSavedVariables
|
METHOD: COE:FixSavedVariables
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user