Thread Tools Display Modes
02/27/23, 09:33 AM   #1
mgsnakes
AddOn Author - Click to view addons
Join Date: Mar 2022
Posts: 5
How to track "CinderShot" debuff with Dreadsail Reef Helper?

Hello, I would like to have help to integrate an alert in Qcell's Dreadsail Reef Helper to track the CinderShot debuff in DSR trash, Qcell not playing the game anymore redirected me to Esoui forum.

I tried to make some changes to the addon but it doesn't work, so I don't know what I have to do to get the alert to appear when I have the debuff on me.

In the data file, I added this line in the trash part of the file:
Lua Code:
  1. cinderShot = 170392,

in the Trash file, I added these lines here:

Lua Code:
  1. if result == ACTION_RESULT_EFFECT_GAINED and abilityId == QDRH.data.cinderShot and targetType == COMBAT_UNIT_TYPE_PLAYER then
  2.     CombatAlerts.Alert("DO NOT MOVE", GetAbilityName(QDRH.data.cinderShot), 0xFF3333FF, SOUNDS.CHAMPION_POINTS_COMMITTED, hitValue)
  3.   end

Since Code Combat Alert puts an sound alert when we have the debuff, I was inspired by its code to try to have the alert I want.

Lua Code:
  1. elseif (result == ACTION_RESULT_EFFECT_GAINED and targetType == COMBAT_UNIT_TYPE_PLAYER and abilityId == CombatAlertsData.dsr.cinderShot) then

I made several attempts, but I never manage to get the debuff displayed. I tried to integrate the 4 debuff IDs I found on EsoLogs :
Lua Code:
  1. cinderShot = {170401, 170399, 170396, 170392},

I also tried by noting the cast ID:
Lua Code:
  1. cinderShot = 170389,

Hoping someone will be able to help me to integrate the alert of this debuff.

Thanks in advance,
MGSnakes
  Reply With Quote
02/27/23, 10:13 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
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:
  1. function ShowPlayerBuffs(unitTag)
  2.     unitTag = unitTag or "player"
  3.     local entries = {}
  4.     table.insert(entries, "================ START OF PLAYER BUFFs ===============")
  5.     table.insert(entries, zo_strformat("\"<<1>>\" Buffs:", unitTag))
  6.     local buffName, abilityId, _
  7.     local numBuffs = GetNumBuffs(unitTag)
  8.     if numBuffs > 0 then
  9.         for i = 1, numBuffs do
  10.             buffName, _, _, _, _, _, _, _, _, _, abilityId = GetUnitBuffInfo(unitTag, i)
  11.             table.insert(entries, zo_strformat("<<1>>. [<<2>>] <<C:3>>", i, abilityId, ZO_SELECTED_TEXT:Colorize(buffName)))
  12.         end
  13.     else
  14.         table.insert(entries, "<NO buffs active!")
  15.     end
  16.     table.insert(entries, "================ END OF PLAYER BUFFs ===============")
  17.  
  18.     if #entries > 0 then
  19.         for _, entryText in ipairs(entries) do
  20.             d(entryText)
  21.         end
  22.     end
  23. end
  24.  
  25. 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:
  1. local function OnCinderShotEffectChanged(eventId, changeType, effectSlot, effectName, unitTag, beginTime, endTime, stackCount, iconName, buffType, effectType, abilityType, statusEffectType, unitName, unitId, abilityId, sourceType)
  2.  if changeType == EFFECT_RESULT_GAINED or changeType == EFFECT_RESULT_UPDATED then --buff was gained or it updated
  3.    d(">CinderShot effect GAINED as player buff!")
  4.  elseif changeType == EFFECT_RESULT_FADED then
  5.    d("<CinderShot effect LOST AGAIN as player buff!")
  6.  end
  7. end
  8.  
  9. local abilityIdOfTheCinderShotBuff =  ????? --enter the number of the abilityId here which is shown as player buff as you got it
  10.  
  11. EVENT_MANAGER:RegisterForEvent("MyAddonTest1", EVENT_EFFECT_CHANGED, OnCinderShotEffectChanged)
  12. EVENT_MANAGER:AddFilterForEvent("MyAddonTest1", EVENT_EFFECT_CHANGED, REGISTER_FILTER_ABILITY_ID, abilityIdOfTheCinderShotBuff) --will only filter for the cinderShot buffId and ignre others!
  13. 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

Last edited by Baertram : 02/27/23 at 10:32 AM.
  Reply With Quote
02/27/23, 10:38 AM   #3
mgsnakes
AddOn Author - Click to view addons
Join Date: Mar 2022
Posts: 5
Originally Posted by Baertram View Post
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:
  1. function ShowPlayerBuffs(unitTag)
  2.     unitTag = unitTag or "player"
  3.     local entries = {}
  4.     table.insert(entries, "================ START OF PLAYER BUFFs ===============")
  5.     table.insert(entries, zo_strformat("\"<<1>>\" Buffs:", unitTag))
  6.     local buffName, abilityId, _
  7.     local numBuffs = GetNumBuffs(unitTag)
  8.     if numBuffs > 0 then
  9.         for i = 1, numBuffs do
  10.             buffName, _, _, _, _, _, _, _, _, _, abilityId = GetUnitBuffInfo(unitTag, i)
  11.             table.insert(entries, zo_strformat("<<1>>. [<<2>>] <<C:3>>", i, abilityId, ZO_SELECTED_TEXT:Colorize(buffName)))
  12.         end
  13.     else
  14.         table.insert(entries, "<NO buffs active!")
  15.     end
  16.     table.insert(entries, "================ END OF PLAYER BUFFs ===============")
  17.  
  18.     if #entries > 0 then
  19.         for _, entryText in ipairs(entries) do
  20.             d(entryText)
  21.         end
  22.     end
  23. end
  24.  
  25. 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:
  1. local function OnCinderShotEffectChanged(eventId, changeType, effectSlot, effectName, unitTag, beginTime, endTime, stackCount, iconName, buffType, effectType, abilityType, statusEffectType, unitName, unitId, abilityId, sourceType)
  2.  if changeType == EFFECT_RESULT_GAINED or changeType == EFFECT_RESULT_UPDATED then --buff was gained or it updated
  3.    d(">CinderShot effect GAINED as player buff!")
  4.  elseif changeType == EFFECT_RESULT_FADED then
  5.    d("<CinderShot effect LOST AGAIN as player buff!")
  6.  end
  7. end
  8.  
  9. local abilityIdOfTheCinderShotBuff =  ????? --enter the number of the abilityId here which is shown as player buff as you got it
  10.  
  11. EVENT_MANAGER:RegisterForEvent("MyAddonTest1", EVENT_EFFECT_CHANGED, OnCinderShotEffectChanged)
  12. EVENT_MANAGER:AddFilterForEvent("MyAddonTest1", EVENT_EFFECT_CHANGED, REGISTER_FILTER_ABILITY_ID, abilityIdOfTheCinderShotBuff) --will only filter for the cinderShot buffid!
  13. EVENT_MANAGER:AddFilterForEvent("MyAddonTest1", EVENT_EFFECT_CHANGED, REGISTER_FILTER_UNIT_TAG, "player") --will only find it on yourself, the player!




Edit:
I'm not sure where you got that
ACTION_RESULT_EFFECT_GAINED
constant from but in teh current API 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
Hello, yes I already did a test with Srandarr & CMX to get the debuff ID : 170392.
When I'm alone in the instance, I only have this debuff that appears but when we are a complete group, and 4 players can have the debuff simultaneously, there are these 4 IDs: 170401, 170399, 170396, 170392.

For ACTION_RESULT_EFFECT_GAINED, this is what is used in Code Combat Alert for the sound alert https://prnt.sc/wSdnl20zhiN7 I just copied a functional code to adapt it to what I wanted in the Qcell addon

EDIT: I tried the test code you provided https://prnt.sc/NvUHjnTvnI_o

Last edited by mgsnakes : 02/27/23 at 10:54 AM.
  Reply With Quote
02/27/23, 12:16 PM   #4
ExoY
 
ExoY's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2020
Posts: 87
Originally Posted by mgsnakes View Post
Hello, yes I already did a test with Srandarr & CMX to get the debuff ID : 170392.
When I'm alone in the instance, I only have this debuff that appears but when we are a complete group, and 4 players can have the debuff simultaneously, there are these 4 IDs: 170401, 170399, 170396, 170392.

For ACTION_RESULT_EFFECT_GAINED, this is what is used in Code Combat Alert for the sound alert https://prnt.sc/wSdnl20zhiN7 I just copied a functional code to adapt it to what I wanted in the Qcell addon

EDIT: I tried the test code you provided https://prnt.sc/NvUHjnTvnI_o

If there is already a sound alert in CCA (and CCA needs to be active anyways as Qcells isnt working without it), it maybe makes sense to just add the text alert within CCA.
  Reply With Quote
03/01/23, 06:06 AM   #5
mgsnakes
AddOn Author - Click to view addons
Join Date: Mar 2022
Posts: 5
Originally Posted by ExoY View Post
If there is already a sound alert in CCA (and CCA needs to be active anyways as Qcells isnt working without it), it maybe makes sense to just add the text alert within CCA.
I also tried but could not get an alert.

The only alert I could get when I have the debuff on me is by using the test code given by Baertram and I have the alert in the chat. When I try to modify his test code to see if I can get an alert, the alert does not appear
  Reply With Quote
03/01/23, 08:29 AM   #6
ExoY
 
ExoY's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2020
Posts: 87
If you tried it withing CCA, can you send the code snipped for that specific ability?
  Reply With Quote
03/01/23, 10:43 AM   #7
mgsnakes
AddOn Author - Click to view addons
Join Date: Mar 2022
Posts: 5
Originally Posted by ExoY View Post
If you tried it withing CCA, can you send the code snipped for that specific ability?
Lua Code:
  1. elseif (result == ACTION_RESULT_EFFECT_GAINED and targetType == COMBAT_UNIT_TYPE_PLAYER and abilityId == CombatAlertsData.dsr.cinderShot) then
  2.         LCA.PlaySounds("FRIEND_INVITE_RECEIVED", 4, 125, "FRIEND_INVITE_RECEIVED", 3, 125, "FRIEND_INVITE_RECEIVED", 2)
  3.         CombatAlerts.Alert("DO NOT MOVE", GetAbilityName(CombatAlertsData.dsr.cinderShot), 0xFF3333FF)

As I am not a dev, I just added a line for the alert under the sound alert that already exists
  Reply With Quote
03/01/23, 11:20 AM   #8
ExoY
 
ExoY's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2020
Posts: 87
Mh, that is weird.
The line looks correct and it also worked for me if I just copied your code and tested it.

Can you test it with no other addon than CCA enabled.
(Also how exactly do you test it? )
  Reply With Quote
03/01/23, 11:47 AM   #9
mgsnakes
AddOn Author - Click to view addons
Join Date: Mar 2022
Posts: 5
Originally Posted by ExoY View Post
Mh, that is weird.
The line looks correct and it also worked for me if I just copied your code and tested it.

Can you test it with no other addon than CCA enabled.
(Also how exactly do you test it? )
To do the tests, I go alone in nDSR and wait to have the mechanics on the last trash before the twins. I just tried with only my trial addons enabled and the alert works on CCA, I tried on the DSR addon and it still doesn't work. So I don't know what the problem is with the Qcell addon, but if it works with CCA I will continue with it and if there are CCA updates I will add my line every time

  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » How to track "CinderShot" debuff with Dreadsail Reef Helper?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off