Rewrote totemic recall trigger to a different event.
Rewrote the totemic recall trigger logic and removed resent message in method.
This commit is contained in:
@@ -958,8 +958,6 @@ function COE_Totem:ResetTimers()
|
|||||||
COE_Totem:DeactivateTimer( COE.ActiveTotems[COE_Element[k]] );
|
COE_Totem:DeactivateTimer( COE.ActiveTotems[COE_Element[k]] );
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
COE:Message( COESTR_RESET );
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+14
-49
@@ -23,6 +23,12 @@ COECOL_TOTEMCLEANSING = 3;
|
|||||||
-------------------------------------------------------------------]]
|
-------------------------------------------------------------------]]
|
||||||
COE["DebugMode"] = false;
|
COE["DebugMode"] = false;
|
||||||
|
|
||||||
|
--[[ ----------------------------------------------------------------
|
||||||
|
When EventPrintMode is set to true, all event calls not caught
|
||||||
|
will write to a debug message into the chat frame. Requires
|
||||||
|
DebugMode enabled
|
||||||
|
-------------------------------------------------------------------]]
|
||||||
|
COE["EventPrintMode"] = false;
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
These variables control frame updates
|
These variables control frame updates
|
||||||
@@ -63,16 +69,14 @@ function COE:Init()
|
|||||||
COE.Initialized = true;
|
COE.Initialized = true;
|
||||||
|
|
||||||
this:RegisterEvent( "VARIABLES_LOADED" );
|
this:RegisterEvent( "VARIABLES_LOADED" );
|
||||||
this:RegisterEvent("SPELLCAST_STOP");
|
this:RegisterEvent("CHAT_MSG_SPELL_SELF_BUFF");
|
||||||
|
|
||||||
-- register shell command
|
-- register shell command
|
||||||
-- -----------------------
|
-- -----------------------
|
||||||
SlashCmdList["COE"] = COEProcessShellCommand;
|
SlashCmdList["COE"] = COEProcessShellCommand;
|
||||||
SLASH_COE1="/coe";
|
SLASH_COE1="/coe";
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
@@ -104,57 +108,18 @@ function COE:OnEvent( event )
|
|||||||
-- ------------------------------------------------
|
-- ------------------------------------------------
|
||||||
COE:FixSavedVariables();
|
COE:FixSavedVariables();
|
||||||
|
|
||||||
elseif ( event == "SPELLCAST_STOP" ) then
|
elseif (event == "CHAT_MSG_SPELL_SELF_BUFF") then
|
||||||
COE_TotemicRecallTimerResetCount = 0;
|
if (string.find(arg1, "Mana from Totemic Recall")) then
|
||||||
|
|
||||||
TotemicRecallTimerReset();
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
|
||||||
Totemic Recall Reset Logic
|
|
||||||
|
|
||||||
This is very janky. The return values from GetSpellCooldown for
|
|
||||||
spell ID 35 (Totemic Recall) are very inconsistent. But if a
|
|
||||||
delay is introduced, then the next call seems valid. I suspect
|
|
||||||
this might break if something has a CD of 6 seconds.
|
|
||||||
-------------------------------------------------------------------]]
|
|
||||||
COE_TotemicRecallPreviousCDExpired = true;
|
|
||||||
-- Using counter to keep track of calls to reset
|
|
||||||
COE_TotemicRecallTimerResetCount = 0;
|
|
||||||
|
|
||||||
-- Local function to change variable with Chronos scheduler
|
|
||||||
function TotemicRecallEndCountdown()
|
|
||||||
COE_TotemicRecallPreviousCDExpired = true;
|
|
||||||
end
|
|
||||||
|
|
||||||
function TotemicRecallTimerReset()
|
|
||||||
|
|
||||||
-- Get totemic recall spell cooldown information
|
|
||||||
local TRstart, TRduration = GetSpellCooldown( COESTR_TOTEMICRECALLID, BOOKTYPE_SPELL );
|
|
||||||
COE:DebugMessage("Totemic Recall spell CD values: ".. TRstart ..", ".. TRduration);
|
|
||||||
|
|
||||||
-- The first GetSpellCooldown returns the wrong information and fires for any spell cast, regardless of spell ID
|
|
||||||
-- So this will set a quick timer to recall this method and get the right GetSpellCooldown info
|
|
||||||
if ( TRstart > 0 and COE_TotemicRecallPreviousCDExpired) then
|
|
||||||
|
|
||||||
-- No more than one call is necessary to check if the cooldown is actually Totemic Recall
|
|
||||||
if (TRduration < 6 and COE_TotemicRecallTimerResetCount < 2) then
|
|
||||||
Chronos.schedule(.25, TotemicRecallTimerReset);
|
|
||||||
COE_TotemicRecallTimerResetCount = COE_TotemicRecallTimerResetCount + 1;
|
|
||||||
|
|
||||||
elseif (TRduration == 6) then
|
|
||||||
COE_TotemicRecallPreviousCDExpired = false;
|
|
||||||
COE_TotemicRecallTimerResetCount = 0;
|
|
||||||
Chronos.schedule(6, TotemicRecallEndCountdown);
|
|
||||||
COE:DebugMessage("Totemic Recall initiating reset of timers.");
|
COE:DebugMessage("Totemic Recall initiating reset of timers.");
|
||||||
COE_Totem:ResetTimers();
|
COE_Totem:ResetTimers();
|
||||||
end
|
end
|
||||||
|
|
||||||
|
elseif (COE.EventPrintMode) then
|
||||||
|
COE:DebugMessage(event);
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ ----------------------------------------------------------------
|
--[[ ----------------------------------------------------------------
|
||||||
METHOD: COE:Message
|
METHOD: COE:Message
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user