Detecting if I am the caster of a debuff

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Screedcom
Custom Builder
Custom Builder
Posts: 9
Joined: Sat Aug 13, 2005 11:19 am

Detecting if I am the caster of a debuff

Post by Screedcom » Sun Oct 17, 2021 7:16 pm

Is there a fairly simple way to detect if a debuff on a mob belongs to my character? I typically use the simple line below to determine when to recast DoT's. However it obviously doesn't work well in a raiding situation because other people may cast the same DoT.

/if (${Target.PctHPs}>=25 && !${Target.Buff[Sunshock].ID} && ${Cast.Ready[10]}) /call MQ2Cast "Sunshock" gem10

Any better ways to handle this?

dewey2461
Contributing Member
Contributing Member
Posts: 1759
Joined: Sun Apr 17, 2005 1:53 am

Re: Detecting if I am the caster of a debuff

Post by dewey2461 » Sun Oct 17, 2021 10:04 pm

Great question.

https://www.macroquest2.com/wiki/index. ... CachedBuff

This has a member CasterName

caj
a hill giant
a hill giant
Posts: 244
Joined: Tue Sep 12, 2006 9:35 am

Re: Detecting if I am the caster of a debuff

Post by caj » Thu Oct 21, 2021 9:24 am

you may have to insert a /delay 3 after you target the NPC or PC in order for the macro to read any of the debuff/dots landed on the target. Buffs/dots/debuffs do not show up instantly like it once did.

dewey2461
Contributing Member
Contributing Member
Posts: 1759
Joined: Sun Apr 17, 2005 1:53 am

Re: Detecting if I am the caster of a debuff

Post by dewey2461 » Thu Oct 21, 2021 10:03 pm

I ended up just creating timers for the debuffs based on the spell ID and Target ID

caj
a hill giant
a hill giant
Posts: 244
Joined: Tue Sep 12, 2006 9:35 am

Re: Detecting if I am the caster of a debuff

Post by caj » Fri Oct 22, 2021 12:51 pm

Here is how I would write the above line;

Code: Select all

/if (${Target.PctHPs}>=25 && !${Bool[${Target.Buff[Sunshock].ID}]} && ${Cast.Ready[10]}) /cast 10
I think the issue with the original line is;

Code: Select all

!${Target.Buff[Sunshock].ID}
Because I cannot /echo this line with the "!" and get the desired output, without the "!" the line comes up "NULL" and should be changed to;

Code: Select all

!${Bool[{${Target.Buff[Sunshock].ID}]} 
... or depending if your looking for a TRUE argument drop the "!" from the line.

I also changed "/call MQ2Cast "Sunshock" gem10" to "/cast 10" because its a shorter line and Everquest does the same exact thing and one less thing the macro has to do. Hope this helps.

Screedcom
Custom Builder
Custom Builder
Posts: 9
Joined: Sat Aug 13, 2005 11:19 am

Re: Detecting if I am the caster of a debuff

Post by Screedcom » Fri Oct 22, 2021 8:44 pm

Maybe for additional clarity on the question. This is specifically for casting dots that stack on a mob in a raid scenario with multiple druids casting.

I want the macro to cast the dot if the same dot cast by 'me' is not already on the mob.

@Dewey2461, I played around with Cached Buff but couldn't get the result I wanted, but perhaps what I tried was wrong. Maye this is why you mentioned timers based on Spell ID and Target ID.

@Caj, no issue on the delay the macro line works fine for casting and no issue with the check in a single Druid scenario also specifying the spell will force it to be memorized if it isn't already.

caj
a hill giant
a hill giant
Posts: 244
Joined: Tue Sep 12, 2006 9:35 am

Re: Detecting if I am the caster of a debuff

Post by caj » Fri Oct 22, 2021 8:57 pm

Im pretty sure thats how I wrote the line the way you wanted.

Code: Select all

/if (${Target.PctHPs}>=25 && !${Bool[${Target.Buff[Sunshock].ID}]} && ${Cast.Ready[10]}) /cast 10
if target has more than 25% hp and the target does not have Sunshock and gem 10 is ready then /cast 10

fyi, you can do that with any spell that shows up in the target "Effects" spell window.

checking if a spell is memorized can be done a couple of ways by presaving groups of spell lists and then recall the list by "/memspellset name-of-spell-list" the second way is to use the "/memorize" option, something like: /if (!${Me.Gem[Sunshock]}) /memorize "Sunshock" 10