Implement spectraler sighter

This commit is contained in:
2025-05-01 14:11:51 +02:00
parent 054568b2e6
commit 7a5d868694

View File

@@ -0,0 +1,43 @@
-- PLAYER_TARGET_CHANGED
function(e)
local hasEyes = UnitBuff("player", "Spectral Sight") -- Spectral Sight
if not hasEyes then
--print("Player has no Spectral Sight")
return
end
local unitUuid = UnitGUID("target")
if not unitUuid then
--print(string.format("Target has no UUID: %s", tostring(unitUuid)))
return
end
--print(string.format("Target UUID: %s", tostring(unitUuid)))
if not string.find(unitUuid, "Player") then
--print(string.format("Target %s is not a player", tostring(unitUuid)))
return
end
local targetStealth = UnitBuff("target", "Stealth")
if not targetStealth then
--print("Target has no Stealth")
return
end
--print(string.format("Target Stealth: %s", tostring(targetStealth)))
local targetName = UnitName("target")
if not targetName then
--print("Target has no name")
return
end
--print(string.format("Target Name: %s", tostring(targetName)))
local pvp = UnitIsPVP("target")
local pvpState = pvp == true and "ON" or "OFF"
local low, high = WeakAuras.GetRange("target")
local message = string.format("I see %s in stealth with pvp %s between %d and %d yards away", targetName, pvpState, low, high)
--print(string.format("Sending message: %s", tostring(message)))
SendChatMessage(message, "RAID")
end