Windfury!: log player casts and buffs, fire on Windfury Attack casts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
dd43fd8cad
commit
75cff180cb
2 changed files with 59 additions and 0 deletions
|
|
@ -215,6 +215,47 @@ events:SetScript("OnEvent", function(self, event, arg1)
|
|||
play()
|
||||
end)
|
||||
|
||||
-- Debug log (temporary) -----------------------------------------------------
|
||||
-- COMBAT_TEXT_UPDATE never saw a proc in game. Log the player's own casts and
|
||||
-- buffs gained, by readable name, to find another event that carries it.
|
||||
-- A cast named "Windfury Attack" fires the show right away.
|
||||
|
||||
local function count(t, key) t[key] = (t[key] or 0) + 1 end
|
||||
local function readable(v) return v ~= nil and not secret(v) end
|
||||
|
||||
local debug = CreateFrame("Frame")
|
||||
debug:RegisterEvent("PLAYER_LOGIN")
|
||||
debug:SetScript("OnEvent", function(self, event, unit, a2, a3)
|
||||
if event == "PLAYER_LOGIN" then
|
||||
db.debug = { fct = C_CVar.GetCVarBool("enableFloatingCombatText"), casts = {}, auras = {} }
|
||||
self:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", "player")
|
||||
self:RegisterUnitEvent("UNIT_AURA", "player")
|
||||
return
|
||||
end
|
||||
if event == "UNIT_SPELLCAST_SUCCEEDED" then
|
||||
local id = a3
|
||||
if not readable(id) then count(db.debug.casts, "secret"); return end
|
||||
local name = C_Spell.GetSpellName(id)
|
||||
if not readable(name) then name = "?" end
|
||||
count(db.debug.casts, id .. " " .. name)
|
||||
if db.enabled and name == "Windfury Attack" then
|
||||
db.procs = db.procs + 1
|
||||
play()
|
||||
end
|
||||
elseif event == "UNIT_AURA" then
|
||||
local info = a2
|
||||
if not readable(info) or not info.addedAuras then return end
|
||||
for _, aura in ipairs(info.addedAuras) do
|
||||
local id, name = aura.spellId, aura.name
|
||||
if readable(id) and readable(name) then
|
||||
count(db.debug.auras, id .. " " .. name)
|
||||
else
|
||||
count(db.debug.auras, "secret")
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- Slash command -------------------------------------------------------------
|
||||
|
||||
local function say(msg) print("|cff66ccffWindfury!|r " .. msg) end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue