Hello everyone. I need some help with my ability.
Code:
local TargetHealth = 100 * UnitHealth("target") / UnitHealthMax("target")
local Agony, _, _, _, _, _, AgonyEndTime = UnitDebuffID("target", 980, "player")
if UnitLevel("target") == -1
and UnitPower("player", 7) > 0
and TargetHealth <= 20 then
return false
end
if not Agony
or AgonyEndTime - GetTime() <= PQI_AffliOffencive_Agony_value then
PQR_WriteToChat("Casting Agony")
return true
end
Ability works good but the problem is that i get spammed with "Casting Agony" all over my chat. Is it posible to make that write it only 1 time? Thx for your time guys