gempir

WeakAura

Jan 13th, 2025 (edited)
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. function(event, ...)
  2. if event == "COMBAT_LOG_EVENT_UNFILTERED" then
  3. local timestamp, eventType, _, _, sourceName, _, _, _, destName, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, amount = CombatLogGetCurrentEventInfo()
  4.  
  5. if eventType == "UNIT_DIED" and UnitLevel(destName) >= 1 then
  6. -- Check if the death was from falling
  7. local lastDamageEvent = select(2, CombatLogGetCurrentEventInfo(-1))
  8. if lastDamageEvent == "ENVIRONMENTAL_DAMAGE" and select(12, CombatLogGetCurrentEventInfo(-1)) == "FALLING" then
  9. -- Play sound
  10. PlaySoundFile("Interface\\AddOns\\WeakAuras\\Media\\Sounds\\Goofy.mp3", "Master")
  11.  
  12. -- Print death message
  13. print(destName .. " died from fall damage!")
  14. end
  15. end
  16. end
  17. end
  18.  
  19. -- Trigger: Event(s)
  20. -- Events: COMBAT_LOG_EVENT_UNFILTERED
Advertisement
Add Comment
Please, Sign In to add comment