I would have expected
GetSpellInfo() to return the school of a spell but I was wrong
You can still get it from listening to
CLEU
(this example does not take channeling spells into account)
Lua Code:
local playerGUID = UnitGUID("player")
local f = CreateFrame("Frame")
f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
f:SetScript("OnEvent", function(self, event)
self:OnEvent(event, CombatLogGetCurrentEventInfo())
end)
function f:OnEvent(event, ...)
local timestamp, subevent, _, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags = ...
if subevent == "SPELL_CAST_START" and sourceGUID == playerGUID then
local spellId, spellName, spellSchool = select(12, ...)
print(format("Casting %s (%s)", GetSpellLink(spellId), GetSchoolString(spellSchool)))
end
end