gempir icon

WeakAura

gempir | PRO | 01/13/25 07:49:04 PM UTC (Edited) | 0 ⭐ | 460 👁️ | Never ⏰ | []
text |

910 B

|

None

|

0 👍

/

0 👎

function(event, ...)
    if event == "COMBAT_LOG_EVENT_UNFILTERED" then
        local timestamp, eventType, _, _, sourceName, _, _, _, destName, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, amount = CombatLogGetCurrentEventInfo()
         if eventType == "UNIT_DIED" and UnitLevel(destName) >= 1 then
            -- Check if the death was from falling
            local lastDamageEvent = select(2, CombatLogGetCurrentEventInfo(-1))
            if lastDamageEvent == "ENVIRONMENTAL_DAMAGE" and select(12, CombatLogGetCurrentEventInfo(-1)) == "FALLING" then
                -- Play sound
                PlaySoundFile("Interface\\AddOns\\WeakAuras\\Media\\Sounds\\Goofy.mp3", "Master")
                 -- Print death message
                print(destName .. " died from fall damage!")
            end
        end
    end
end
 -- Trigger: Event(s)
-- Events: COMBAT_LOG_EVENT_UNFILTERED

Comments