handle new args

This commit is contained in:
avitasia
2026-02-20 16:03:14 -08:00
parent 02c793a5de
commit e933131ad4
+18 -6
View File
@@ -372,20 +372,32 @@ local spellTypeNames = {
[2] = "Autorepeating", [2] = "Autorepeating",
} }
local function onSpellStart(itemId, spellId, casterGuid, targetGuid, castFlags, castTime, duration, spellType) local function onSpellStart(itemId, spellId, casterGuid, targetGuid, castFlags, castTime, duration, spellType, corpseOwnerGuid)
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") or spellId local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") or spellId
local spellTypeName = spellTypeNames[spellType] or "Unknown" local spellTypeName = spellTypeNames[spellType] or "Unknown"
local caster = UnitName(casterGuid) or tostring(casterGuid)
local target = UnitName(targetGuid) or tostring(targetGuid)
local corpse = nil
if corpseOwnerGuid then
corpse = UnitName(corpseOwnerGuid) or tostring(corpseOwnerGuid)
end
print(string.format( print(string.format(
"SPELL_START: %s (id:%d) | Caster: %s -> Target: %s | ItemId: %d | Flags: %d | CastTime: %dms | Duration: %dms | Type: %s", "SPELL_START: %s (id:%d) | Caster: %s -> Target: %s | ItemId: %d | Flags: %d | CastTime: %dms | Duration: %dms | Type: %s | CorpseOwner: %s",
tostring(spellName), spellId, casterGuid, targetGuid, itemId, castFlags, castTime, duration, spellTypeName tostring(spellName), spellId, caster, target, itemId, castFlags, castTime, duration, spellTypeName, tostring(corpse)
)) ))
end end
local function onSpellGo(itemId, spellId, casterGuid, targetGuid, castFlags, numTargetsHit, numTargetsMissed) local function onSpellGo(itemId, spellId, casterGuid, targetGuid, castFlags, numTargetsHit, numTargetsMissed, corpseOwnerGuid)
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") or spellId local spellName = GetSpellRecField and GetSpellRecField(spellId, "name") or spellId
local caster = UnitName(casterGuid) or tostring(casterGuid)
local target = UnitName(targetGuid) or tostring(targetGuid)
local corpse = nil
if corpseOwnerGuid then
corpse = UnitName(corpseOwnerGuid) or tostring(corpseOwnerGuid)
end
print(string.format( print(string.format(
"SPELL_GO: %s (id:%d) | Caster: %s -> Target: %s | ItemId: %d | Flags: %d | Hit: %d | Missed: %d", "SPELL_GO: %s (id:%d) | Caster: %s -> Target: %s | ItemId: %d | Flags: %d | Hit: %d | Missed: %d | CorpseOwner: %s",
tostring(spellName), spellId, casterGuid, targetGuid, itemId, castFlags, numTargetsHit, numTargetsMissed tostring(spellName), spellId, caster, target, itemId, castFlags, numTargetsHit, numTargetsMissed, tostring(corpse)
)) ))
end end