function(event, msg, target, spellID, _, _, _, _, _, _, _, _, guid)
if event == "CHAT_MSG_PARTY" or event == "CHAT_MSG_PARTY_LEADER" then
if msg then
local msg = string.lower(msg)
local unit = UnitTokenFromGUID(guid)
local spellInfo = C_Spell.GetSpellInfo(33206)
local spellCD = C_Spell.GetSpellCooldown(33206)
local spellCharges = C_Spell.GetSpellCharges(33206)
local role = UnitGroupRolesAssigned(unit)
if aura_env.psPhrases[msg] then
if spellCharges.currentCharges == 0 then
local cdLeft = math.floor(spellCD.startTime + spellCD.duration - GetTime()) / 60
if cdLeft < 1 then
SendChatMessage("No PS available - next PS ready in " .. string.format("%.0f", cdLeft * 60) .. " seconds", "PARTY")
else
SendChatMessage("No PS available - next PS ready in " .. string.format("%.1f", cdLeft) .. " minutes", "PARTY")
end
else
aura_env.usePS = true
return true
end
end
end
elseif event == "CHAT_MSG_WHISPER" or event == "CHAT_MSG_WHISPER_INFORM" then
if msg then
local msg = string.lower(msg)
local unit = UnitTokenFromGUID(guid)
local spellInfo = C_Spell.GetSpellInfo(33206)
local spellCD = C_Spell.GetSpellCooldown(33206)
local spellCharges = C_Spell.GetSpellCharges(33206)
local role = UnitGroupRolesAssigned(unit)
if aura_env.psPhrases[msg] then
if spellCharges.currentCharges == 0 then
local cdLeft = math.floor(spellCD.startTime + spellCD.duration - GetTime()) / 60
if cdLeft < 1 then
SendChatMessage("No PS available - next PS ready in " .. string.format("%.0f", cdLeft * 60) .. " seconds", "WHISPER", nil, target)
else
SendChatMessage("No PS available - next PS ready in " .. string.format("%.1f", cdLeft) .. " minutes", "WHISPER", nil, target)
end
else
aura_env.usePS = true
return true
end
end
end
elseif event == "UNIT_SPELLCAST_SUCCEEDED" then
if spellID == 33206 and aura_env.usePS then
SendChatMessage("Pain Suppression applied.", "PARTY")
aura_env.usePS = false
return false
end
end
end```