Remove syncing when it's not important. Will only use syncing for important combat related events and not optional combat start/roleplay timers. Should reduce addon traffic and simplify mods slightly, as well as fix any bugs with different functions needing diff args in the sync function.
@@ -46,6 +46,7 @@
local timerChilledtotheBone = mod:NewBuffActiveTimer(8, 70106)
local timerMysticBuffet = mod:NewBuffActiveTimer(8, 70128)
local timerNextMysticBuffet = mod:NewNextTimer(6, 70128)
+local timerMysticAchieve = mod:NewAchievementTimer(24, 4620, "achievementMystic")--May need tweaks, will also need modifying for 3.3.3 nerf to achievement
local berserkTimer = mod:NewBerserkTimer(600)
@@ -165,9 +166,12 @@
if (args.amount or 1) >= 4 then
specWarnMysticBuffet:Show(args.amount)
end
+ if (args.amount or 1) < 2 then
+ timerMysticAchieve:Start()
end
end
end
+end
mod.SPELL_AURA_APPLIED_DOSE = mod.SPELL_AURA_APPLIED
@@ -186,8 +190,12 @@
if self.Options.SetIconOnUnchainedMagic then
self:SetIcon(args.destName, 0)
end
+ elseif args:IsSpellID(70127, 72528, 72529, 72530) then
+ if args:IsPlayer() then
+ timerMysticAchieve:Cancel()
end
end
+end
function mod:UNIT_HEALTH(uId)
if not warned_P2 and self:GetUnitCreatureId(uId) == 36853 and UnitHealth(uId) / UnitHealthMax(uId) <= 0.38 then
@@ -313,9 +313,9 @@
function mod:CHAT_MSG_MONSTER_YELL(msg)
if msg == L.LKPull or msg:find(L.LKPull) then
- self:SendSync("LKPull")
+ timerCombatStart:Start()
elseif msg == L.LKRoleplay or msg:find(L.LKRoleplay) then
- self:SendSync("LKRoleplay")
+ timerRoleplay:Start()
end
end
@@ -326,11 +326,7 @@
end
function mod:OnSync(msg, target)
- if msg == "LKPull" then
- timerCombatStart:Start()
- elseif msg == "LKRoleplay" then
- timerRoleplay:Start()
- elseif msg == "PlagueOn" then
+ if msg == "PlagueOn" then
if time() - lastPlagueCast > 2 then --Dirty hack to prevent function from doing anything for lich kings direct casts of necrotic plague.
warnNecroticPlagueJump:Show(target) --We only want this function to work when it jumps from target to target.
timerNecroticPlagueCleanse:Start()
@@ -178,16 +178,8 @@
function mod:CHAT_MSG_MONSTER_YELL(msg)
if msg == L.PullAlliance or msg:find(L.PullAlliance, 1, true) then
- self:SendSync("PullAlliance")
- elseif msg == L.PullHorde or msg:find(L.PullHorde, 1, true) then
- self:SendSync("PullHorde")
- end
-end
-
-function mod:OnSync(msg, arg)
- if msg == "PullAlliance" then
timerCombatStart:Start()
- elseif msg == "PullHorde" then
+ elseif msg == L.PullHorde or msg:find(L.PullHorde, 1, true) then
timerCombatStart:Start(99)
end
end
\ No newline at end of file
@@ -397,7 +397,8 @@
L:SetTimerLocalization{
TimerNextAirphase = "Next air phase",
- TimerNextGroundphase = "Next ground phase"
+ TimerNextGroundphase = "Next ground phase",
+ achievementMystic = "Time to clear Mystic stacks"
}
L:SetWarningLocalization{