Did you check on your player that this debuf is actually shown at the player as a buff?
if the buff is not there you cannot listen for it at the events.
If you click C to show the player buffs it shows you all the buffs you currently got, as names. The abilityIds of them are not shown.
You either need an addon like Srendar and enable the debug to show the current player buffs ids behind the name.
Or you can list them to chat via some code like this (by e.g. using a slash command /playerbuffs that runs this function "ShowPlayerBuffs"):
Lua Code:
function ShowPlayerBuffs(unitTag)
unitTag = unitTag or "player"
local entries = {}
table.insert(entries, "================ START OF PLAYER BUFFs ===============")
table.insert(entries, zo_strformat("\"<<1>>\" Buffs:", unitTag))
local buffName, abilityId, _
local numBuffs = GetNumBuffs(unitTag)
if numBuffs > 0 then
for i = 1, numBuffs do
buffName, _, _, _, _, _, _, _, _, _, abilityId = GetUnitBuffInfo(unitTag, i)
table.insert(entries, zo_strformat("<<1>>. [<<2>>] <<C:3>>", i, abilityId, ZO_SELECTED_TEXT:Colorize(buffName)))
end
else
table.insert(entries, "<NO buffs active!")
end
table.insert(entries, "================ END OF PLAYER BUFFs ===============")
if #entries > 0 then
for _, entryText in ipairs(entries) do
d(entryText)
end
end
end
SLASH_COMMANDS["/playerbuffs"] = function() ShowPlayerBuffs("player") end
If you have found the correct abilityId or buffId that is shown as the playerbuff you can then simply do a test via an event
EVENT_EFFECT_CHANGED using a filter like this, to react on it:
Lua Code:
local function OnCinderShotEffectChanged(eventId, changeType, effectSlot, effectName, unitTag, beginTime, endTime, stackCount, iconName, buffType, effectType, abilityType, statusEffectType, unitName, unitId, abilityId, sourceType)
if changeType == EFFECT_RESULT_GAINED or changeType == EFFECT_RESULT_UPDATED then --buff was gained or it updated
d(">CinderShot effect GAINED as player buff!")
elseif changeType == EFFECT_RESULT_FADED then
d("<CinderShot effect LOST AGAIN as player buff!")
end
end
local abilityIdOfTheCinderShotBuff = ????? --enter the number of the abilityId here which is shown as player buff as you got it
EVENT_MANAGER:RegisterForEvent("MyAddonTest1", EVENT_EFFECT_CHANGED, OnCinderShotEffectChanged)
EVENT_MANAGER:AddFilterForEvent("MyAddonTest1", EVENT_EFFECT_CHANGED, REGISTER_FILTER_ABILITY_ID, abilityIdOfTheCinderShotBuff) --will only filter for the cinderShot buffId and ignre others!
EVENT_MANAGER:AddFilterForEvent("MyAddonTest1", EVENT_EFFECT_CHANGED, REGISTER_FILTER_UNIT_TAG, "player") --will only find it on yourself, the player and ignore buffs on ther units (in group e.g.)!
-> See
https://wiki.esoui.com/AddFilterForEvent
Edit:
I'm not sure where you got that
ACTION_RESULT_EFFECT_GAINED
constant from but in the current API documentation the 2nd parameter of the EVET_EFFECT_CHANGED event is using the type EffectResult which can be one of these:
Code:
h5. EffectResult
* EFFECT_RESULT_FADED
* EFFECT_RESULT_FULL_REFRESH
* EFFECT_RESULT_GAINED
* EFFECT_RESULT_TRANSFER
* EFFECT_RESULT_UPDATED