Skip to content

Commit

Permalink
The War Within and Cataclysm Classic support
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisSpomer committed Jun 9, 2024
1 parent 9db97b4 commit 6ad0703
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 16 deletions.
85 changes: 78 additions & 7 deletions HearKitty.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ local KittyDefaultSoundPack =

-- Called when an event that Hear Kitty cares about is fired.
function KittyOnEvent(self, Event, arg1, arg2)
local PetHasInterestingBuffs
if VgerCore.IsCataclysm then
local _, Class = UnitClass("player")
if Class == "DEATHKNIGHT" then PetHasInterestingBuffs = true end
end

if Event == "UNIT_POWER_UPDATE" and (arg1 == "player" or arg1 == "vehicle") and arg2 == "COMBO_POINTS" then
KittyOnComboPointsChange(arg1)
elseif Event == "UNIT_POWER_UPDATE" and arg1 == "player" then
Expand All @@ -105,7 +111,7 @@ function KittyOnEvent(self, Event, arg1, arg2)
elseif arg2 == "ESSENCE" then
KittyOnEssenceChange()
end
elseif Event == "UNIT_AURA" and arg1 == "player" then
elseif Event == "UNIT_AURA" and (arg1 == "player" or (PetHasInterestingBuffs and arg1 == "pet")) then
KittyOnBuffsChange()
elseif Event == "PLAYER_SPECIALIZATION_CHANGED" then
KittyOnSpecChange()
Expand Down Expand Up @@ -161,7 +167,7 @@ function KittyOnBuffsChange()
BuffCharges = nil -- otherwise we'll skip checks for the real buffs

-- Frost mages' Icicles, only with Glacial Spike talent
if VgerCore.IsMainline and Class == "MAGE" and Spec == 3 then
if BuffCharges == nil and VgerCore.IsMainline and Class == "MAGE" and Spec == 3 then
local _, _, _, HasGlacialSpike = GetTalentInfo(7, 3, 1) -- Row 7, Column 3, Primary (1) spec (surprisingly, this still works in 10.0 where it's no longer in that position)
if HasGlacialSpike then
BuffCharges = KittyAuraStacks("player", "PLAYER HELPFUL", 205473)
Expand All @@ -173,7 +179,7 @@ function KittyOnBuffsChange()
end

-- Fire mages' Blessing of the Sun King talent
if VgerCore.IsMainline and Class == "MAGE" and Spec == 2 then
if BuffCharges == nil and VgerCore.IsMainline and Class == "MAGE" and Spec == 2 then
local Blessings = KittyAuraStacks("player", "PLAYER HELPFUL", 383883)
if Blessings then
-- The eighth and final stack is actually a separate buff.
Expand All @@ -190,30 +196,95 @@ function KittyOnBuffsChange()
end

-- Enhancement shamans' Maelstrom Weapon
if VgerCore.IsMainline and Class == "SHAMAN" and Spec == 2 then
if BuffCharges == nil and VgerCore.IsMainline and Class == "SHAMAN" and Spec == 2 then
BuffCharges = KittyAuraStacks("player", "PLAYER HELPFUL", 344179)
if BuffCharges then
KittyThisResourceDecays = false
KittyCurrentMaxStacks = 5
-- In 9.0.2, Maelstrom Weapon works similarly to Anticipation combo points: it stacks up to 10, but you only spend up to 5.
end
elseif VgerCore.IsWrath and Class == "SHAMAN" then
elseif BuffCharges == nil and (VgerCore.IsWrath or VgerCore.IsCataclysm) and Class == "SHAMAN" then
-- Maelstrom Weapon (enhancement)
BuffCharges = KittyAuraStacks("player", "PLAYER HELPFUL", 53817)
if BuffCharges then
KittyThisResourceDecays = false
KittyCurrentMaxStacks = 5
else
-- Lightning Shield (elemental)
BuffCharges = KittyAuraStacks("player", "PLAYER HELPFUL", 324)
if BuffCharges then
-- If we've never had more than 3 stacks of Lightning Shield due to the Rolling Thunder talent,
-- we should ignore all stacks of Lightning Shield less than 5.
if BuffCharges < 5 and not KittyEverHadRollingThunderCharges then
BuffCharges = nil
else
if BuffCharges < 5 then
BuffCharges = nil
else
BuffCharges = BuffCharges - 4
end
KittyThisResourceDecays = true -- when hit!
KittyCurrentMaxStacks = 5
KittyEverHadRollingThunderCharges = true
end
end
end
end

-- Mistweaver Monk: Teachings of the Monastery
if Class == "MONK" and Spec == 2 then
if BuffCharges == nil and Class == "MONK" and Spec == 2 then
BuffCharges = KittyAuraStacks("player", "PLAYER HELPFUL", 202090)
if BuffCharges then
KittyThisResourceDecays = false
KittyCurrentMaxStacks = 3
end
end

-- Unholy death knight: Shadow Infusion (Classic)
if BuffCharges == nil and VgerCore.IsCataclysm and Class == "DEATHKNIGHT" then
BuffCharges = KittyAuraStacks("pet", "PLAYER HELPFUL", 91342)
if BuffCharges then
KittyThisResourceDecays = false
KittyCurrentMaxStacks = 5
end
end

-- Discipline priest: Evangelism (Classic)
if BuffCharges == nil and VgerCore.IsCataclysm and Class == "PRIEST" then
-- Evangelism is 81661. Dark Evangelism is 87118 but is for shadow priests which
-- already have shadow orbs to track, so we ignore Dark Evangelism.
BuffCharges = KittyAuraStacks("player", "PLAYER HELPFUL", 81661)
if BuffCharges then
KittyThisResourceDecays = false
KittyCurrentMaxStacks = 5
end
end

-- Shadow priest: Shadow Orb (Classic)
if BuffCharges == nil and VgerCore.IsCataclysm and Class == "PRIEST" then
BuffCharges = KittyAuraStacks("player", "PLAYER HELPFUL", 77487)
if BuffCharges then
KittyThisResourceDecays = false
KittyCurrentMaxStacks = 3
end
end

-- Marksmanship hunter: Ready, Set, Aim and Fire! (Classic)
if BuffCharges == nil and VgerCore.IsCataclysm and Class == "HUNTER" then
BuffCharges = KittyAuraStacks("player", "PLAYER HELPFUL", 82926)
if BuffCharges then
-- Five stacks is a different buff, Fire!
BuffCharges = 5
else
-- One through four is Ready, Set, Aim.
BuffCharges = KittyAuraStacks("player", "PLAYER HELPFUL", 82925)
end
if BuffCharges then
KittyThisResourceDecays = false
KittyCurrentMaxStacks = 5
end
end

-- If we didn't find any buffs, it's possible that we've already had a buff before and it's worn off.
if BuffCharges == nil then BuffCharges = 0 end

Expand Down Expand Up @@ -720,7 +791,7 @@ function KittyAuraStacks(Unit, Filters, SpellID)
local AuraData = C_UnitAuras.GetAuraDataByIndex(Unit, i, Filters)
if not AuraData then break end -- We ran out of buffs
if AuraData.spellId == SpellID then return AuraData.applications end
--VgerCore.Message("#" .. i .. ": " .. AuraData.name .. " " .. tostring(AuraData.spellId) .. " x " .. tostring(AuraData.applications))
--VgerCore.Message(Unit .. " #" .. i .. ": " .. AuraData.name .. " " .. tostring(AuraData.spellId) .. " x " .. tostring(AuraData.applications))
end
end

Expand Down
22 changes: 13 additions & 9 deletions Readme.htm
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ <h1>Hear Kitty</h1>
<p>
These classes and specs work with Hear Kitty:</p>
<ul>
<li>Druids (in cat form): combo points <i>(including in Classic)</i></li>
<li>Unholy death knights: Shadow Infusion (Classic)</li>
<li>Balance druids: astral power</li>
<li>Rogues: combo points <i>(including in Classic)</i></li>
<li>Elemental and Enhancement shamans: maelstrom <i>(including enhancement in Wrath Classic)</i></li>
<li>Paladins: holy power</li>
<li>Shadow priests: insanity</li>
<li>Warlocks: soul shards</li>
<li>Monks: chi and Teachings of the Monastery</li>
<li>Feral druids: combo points</li>
<li>Evokers: essence</li>
<li>Marksmanship hunters: Ready, Set, Aim, and Fire! (Classic)</li>
<li>Arcane mages: arcane charges</li>
<li>Frost mages with Glacial Spike: icicles</li>
<li>Evokers: essence</li>
<li>Monks: chi and Teachings of the Monastery</li>
<li>Paladins: holy power</li>
<li>Discipline priests: evangelism (Classic)</li>
<li>Shadow priests: insanity and shadow orbs (Classic)</li>
<li>Rogues: combo points</li>
<li>Elemental and Enhancement shamans: maelstrom and Rolling Thunder (Classic)</li>
<li>Warlocks: soul shards</li>
<li>Vehicles with combo points (such as the drakes in Eye of Eternity)</li>
</ul>
<h2>
Expand Down Expand Up @@ -147,7 +150,8 @@ <h3>Disabling Hear Kitty sounds when you're in a raid</h3>
<h2>Release history</h2>
<h3>Version 1.11.0</h3>
<ul>
<li>The War Within and Cataclysm Classic: Hear Kitty now functions in these game versions. Let me know if you find a spec or class mechanic that Hear Kitty is supposed to support but doesn't seem to be working!</li>
<li>The War Within and Cataclysm Classic: Hear Kitty now functions in these game versions.</li>
<li>Cataclysm Classic: Added support for unholy death knights, balance druids, marksmanship hunters, paladins, discipline and shadow priests, and elemental and enhancement shamans.</li>
</ul>
<h3>Version 1.10.6</h3>
<ul>
Expand Down

0 comments on commit 6ad0703

Please sign in to comment.