From 9258ae0b84c08e23fd94744e612440bcd928fbe3 Mon Sep 17 00:00:00 2001 From: Taracque Date: Sun, 7 Apr 2013 11:39:07 +0200 Subject: [PATCH] Minor changes in Unholy priority, frames are hidden during pet battles. --- DKCrutch.lua | 30 ++++++++++++++++++++---------- DKCrutch.toc | 2 +- DKCrutch_GUI.lua | 18 ++++++++++++++++++ 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/DKCrutch.lua b/DKCrutch.lua index 4809f8a..55c92af 100755 --- a/DKCrutch.lua +++ b/DKCrutch.lua @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- DKCrutch 0.8.1 +-- DKCrutch 0.9.0 -- -- Death Knight rune tracker and ability advisor ------------------------------------------------------------------------------- @@ -8,7 +8,7 @@ DKCrutch = {Locals = {}} local L = DKCrutch.Locals -DKCrutch.versionNumber = '0.8.1' +DKCrutch.versionNumber = '0.9.0' DKCrutch.talent = "" DKCrutch.talentUnsure = true DKCrutch.DebugMode = false @@ -167,6 +167,14 @@ function DKCrutch.events.PLAYER_REGEN_ENABLED(...) DKCrutch:PurgePersonTable() end +function DKCrutch.events.PET_BATTLE_OPENING_START(...) + DKCrutch:ShowHideFrames( false ); +end + +function DKCrutch.events.PET_BATTLE_OVER(...) + DKCrutch:ShowHideFrames( true ); +end + function DKCrutch:OnLoad() local _,playerClass = UnitClass("player") if playerClass ~= "DEATHKNIGHT" then @@ -199,6 +207,8 @@ function DKCrutch:OnLoad() DKCrutch.eventFrame:RegisterEvent("RUNE_TYPE_UPDATE") DKCrutch.eventFrame:RegisterEvent("PLAYER_TARGET_CHANGED") DKCrutch.eventFrame:RegisterEvent("PLAYER_REGEN_ENABLED") + DKCrutch.eventFrame:RegisterEvent("PET_BATTLE_OPENING_START") + DKCrutch.eventFrame:RegisterEvent("PET_BATTLE_OVER") DKCrutch:CreateGUI() DKCrutch:ApplySettings() @@ -762,6 +772,14 @@ function DKCrutch:AdviseUnholyAbility() return "Outbreak" end end + + -- plague strike + cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Strike"]) + if (cd) and (cd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Plague Strike"],"target") == 1) then + if ( (bpExpiration - GetTime()) <3) or ( (ffExpiration - GetTime()) <3 ) then + return "Plague Strike" + end + end -- icy touch cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Icy Touch"]) @@ -771,14 +789,6 @@ function DKCrutch:AdviseUnholyAbility() end end - -- plague strike - cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Plague Strike"]) - if (cd) and (cd<=0) and ( IsSpellInRange(DKCrutch.SpellList["Plague Strike"],"target") == 1) then - if ( (bpExpiration - GetTime()) <3) then - return "Plague Strike" - end - end - -- Soul Reaper, if target health < 35% if (DKCrutch.SpellList["Soul Reaper"]) then cd, enabled = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Dark Transformation"]) diff --git a/DKCrutch.toc b/DKCrutch.toc index acfb56e..0ccc8b9 100755 --- a/DKCrutch.toc +++ b/DKCrutch.toc @@ -2,7 +2,7 @@ ## Title: DKCrutch ## Notes: Death Knight rune tracker and rotation helper ## Author: Taracque, Dšgrov‡s of Arathor -## Version: 0.8.1 +## Version: 0.9.0 ## SavedVariables: DKCrutchDB ## OptionalDeps: ## Dependencies: diff --git a/DKCrutch_GUI.lua b/DKCrutch_GUI.lua index b89cb5a..486a406 100755 --- a/DKCrutch_GUI.lua +++ b/DKCrutch_GUI.lua @@ -645,6 +645,24 @@ function DKCrutch:MakeDraggable(frame,store) end) end +function DKCrutch:ShowHideFrames( visible ) + if (visible) then + DKCrutch.displayFrame:Show(); + DKCrutch.advisorFrame:Show(); + DKCrutch.procFrame:Show(); + DKCrutch.weaponFrame:Show(); + DKCrutch.runicFrame:Show(); + DKCrutch.debuffFrame:Show(); + else + DKCrutch.displayFrame:Hide(); + DKCrutch.advisorFrame:Hide(); + DKCrutch.procFrame:Hide(); + DKCrutch.weaponFrame:Hide(); + DKCrutch.runicFrame:Hide(); + DKCrutch.debuffFrame:Hide(); + end +end + function DKCrutch:UnLockFrames() DKCrutch:MakeDraggable(DKCrutch.displayFrame,"runes") DKCrutch:MakeDraggable(DKCrutch.advisorFrame,"advisor") -- 1.7.9.5