Check for Beneficial Buffs

HardOne

Rawk On!
Joined
Sep 27, 2008
Messages
344
Reaction score
1
Points
0
Is there a way to check an NPC to see if it has a beneficial buff on it?

So instead of using
Code:
(${Target.Buff[insert buff name here].ID})
for each buff name, just check to see if any buff it has is a beneficial buff?
 
Doesnt exist as is, but it is easily written in. I had added a check for all the common spell lines but they didnt get included into the core compile and overwrite the cases for our compile, essentially removing them. For now you could cycle the first ~5 buffs on the NPC and see if any are beneficial.
 
Any idea how many total buffs an npc can have.

These mobs buff mid fight too!
 
NPCs have 55 debuff slots and 42 buff slots. If there are more than 55 debuffs on a mob (like a raid boss), the extra debuffs will spill over into buff slots.
 
So something like this should work:

Code:
Sub Debuff
	/declare TargetBuffNum int local
	/for TargetBuffNum 1 to 42 {
		/if $Target.Buff[TargetBuffNum].SpellType.NotEqual[Beneficial]} {
			/next TargetBuffNum
		} else {
			/echo Debuffing with [Debuff Spell]
			/casting "Debuff Spell"
		}
/return}

Or should it be 1 to 97?
 
Sort of.. the problem with that raw check is that it doesnt check stacking. If you are the only character casting spells, youll be ok, but once you get multiple slowers or similar debuff lines, youll run into issues.

also, you have some brace and parentheses errors in that example:

/if (${Target.Buff[TargetBuffNum].SpellType.NotEqual[Beneficial]}) {
 
I finished the code last night.

It is designed to be used with the Ranger Entropy of Nature dispell

Code:
Sub RangerDebuff2
	/declare TargetBuffNum int local
	/if (${Me.AltAbilityReady[Entropy of Nature]} && (${Target.Distance}<180) && ${Target.Type.Equal[NPC]}) {
		/for TargetBuffNum 1 to 42 {
			/if (${Target.Buff[${TargetBuffNum}].SpellType.NotEqual[Beneficial]} || (${Target.Buff[${TargetBuffNum}].ID}==NULL)) {
				/next TargetBuffNum
			} else {
				/bct ${bcchannel} Dispelling *${Target.Buff[${TargetBuffNum}].Name}* [${Target.Buff[${TargetBuffNum}].SpellType}] with Entropy of Nature
				/alt act 682
			}
		}
	}
/return

Basically it checks the mob for any beneficial spell, and will dispell if it finds one.
 
I will create a Target.Beneficial TLO member probably this week, though i make no promises about it getting included since i keep getting yelled at =P Cycle via c/c++ is better than using a macro. Well hell, i can just write it on the fly here:

Code:
    case Beneficial:
        if(!(((PCTARGETWND)pTargetWnd)->Type > 0))
            return false;
        for(i = 0; i < NUM_BUFF_SLOTS; i++)
        {
            if(((PCTARGETWND)pTargetWnd)->SpellType!=0)    
            {
                Dest.DWord = true;
                Dest.Type = pBoolType;
                return true;
            }
        }
        return false;

I'd imagine that works, can test it later. Or i can put it as an int and count the number of beneficial buffs.
 
Let's resurrect an old thread.

Anyone know if a TLO for this was created, and if so, what is it?

Also along the same lines, in the new expansion a lot of mobs will have reverse DS spells cast on them giving them a beefy DS. (Like Livio's Shield of Decay, or Mark of the Vicarum (NPC version) Is there any TLO or one that can be created to look or large DS buffs on the mob to trigger bandolier changes without having to code each buff.

Ideally there would be one to check the NPC, and one to check self for items buffs/debuffs that will cause damage to the player. If it's not worth it I understand.
 
Hmm, not that I know of, but it's actually a good one to put on the TODO list IMO. Unfortunately, I think it may have gotten lost in the noise, as things often do!


htw
 
Yeah it did get lost in the noise.
But I Added it to core today.
See Changes.txt for MQ2-20141112.zip
 
I created this and put it in my kill sub:


Code:
	/declare ii int local
	/if (!${entropytimer} && ${Me.AltAbilityReady[Entropy of Nature]} && ${Target.ID}) {
	/varset entropytimer 10s
	/for ii 1 to ${Target.BuffCount}
		/if (${Target.Buff[${ii}].SpellType.Equal[Beneficial]}) /varset needstrip TRUE
	/next ii
	/if (${needstrip}) {
		/call cast "Entropy of Nature" alt
		/varset needstrip FALSE
	}
    }



declares section:
/if (!${Defined[needstrip]}) /declare needstrip bool outer FALSE
/declare entropytimer timer outer 0
 
Last edited:
The one I wrote is similar

Code:
Sub RangerDebuff2
  /declare currentTargetID int local
  /declare TargetBuffNum int local


	/if (${Me.AltAbilityReady[Entropy of Nature]} && (${Target.Distance}<50) && ${Target.Type.Equal[NPC]} && (${Target.PctHPs}<100)) {
                /varset currentTargetID ${Target.ID}
		/for TargetBuffNum 1 to 42 {
                        | If we've somehow switched targets, abort checking the npc's buff list.
                        /if (${Target.ID} != ${currentTargetID}) /return
			/if (${Target.Buff[${TargetBuffNum}].SpellType.NotEqual[Beneficial]} || (${Target.Buff[${TargetBuffNum}].ID}==NULL)) {
				/next TargetBuffNum
			} else {
				/bct ${bcchannel} Dispelling *${Target.Buff[${TargetBuffNum}].Name}* [${Target.Buff[${TargetBuffNum}].SpellType}] with Entropy of Nature
				/alt act 682
				/delay 5
			}
		}
	}
/return

with the new TLO, the code would look like this (I think)

Code:
Sub RangerDebuff
	/if ((${Bool[${Target.Beneficial.ID}]}==TRUE) && ${Me.AltAbilityReady[Entropy of Nature]} && (${Target.Distance}<50) && ${Target.Type.Equal[NPC]} && (${Target.PctHPs}<99)) {
		/bct ${bcchannel} Dispelling *${Target.Beneficial}* with Entropy of Nature
		/alt act 682
		/delay 5
		}
/return

It's untested until MMO is updated, but it should work.
 
The bottom one you posted looks pretty spot on. I will probably change my macro soon.
I like to add in a timer delay just in case you encounter a mob with a beneficial that can't be stripped, I don't want my guy hitting it every time it's up, like on a named or something.
So I add in one more variable and only let it try the strip every 10 secs if need it.
 
Would be cool to have a followup post whether with the updated code all is well on this, so it can be considered done, and that the provided functions by people as examples are GTG for others. :)

Thanks guys (and thanks eqmule for adding to core).

htw
 
I tested the new TLO's via echo and they seem to work. I still need to test them in actual combat.

Once thing I noticed though, the new TLO for RevDSed is a target check, which is good for verifying that your reverse DS landed. Can this also be added to Me?

Code:
(${Bool[${[COLOR="Red"]Me[/COLOR].RevDSed.ID}]}==TRUE)

There are some named that cast an NPC version of the cleric Mark of the Vicarum, that is a 3k reverse DS cast on the player.

This is the code I'm working on:

Code:
Sub NoDSBandolier
      /if ((${Bool[${Target.DSed.ID}]}==TRUE) || (${Bool[${[COLOR="Red"]Target[/COLOR].RevDSed.ID}]}==TRUE) {
	    /varset nonDamage TRUE
        /bandolier Activate NonDamage
      } else /if ((${Bool[${Target.DSed.ID}]}==FALSE) && (${Bool[${[COLOR="red"]Target[/COLOR].RevDSed.ID}]}==FALSE) {
        /varset nonDamage FALSE
        /bandolier Activate Normal
      }
/return

So if the Mob has a DS, or if I have a reverse DS on me, switch Bandolier. As written right now it does not check Me for a buff.
 
Last edited:
I like that logic HardOne, and thanks EQMule.
I am going to change my macro to use the check then bandolier activate.

If the me.revds'd gets added, that would be very functional.

Edit: going to think about this and add in a piece to set back to main DPS properly and take into account some kinda delay so it doesn't spam change back to DPS (unless you already are thinking about that Hard?)

My logic would be:
(check for a DS on the mob and !${checkdelay}) {
switch bandolier nodamage
varset checkdelay 5s
} else if (bandolier not set to nodamage) {bandolier activate DPS}


Something like that
 
Last edited:
I like that logic HardOne, and thanks EQMule.
I am going to change my macro to use the check then bandolier activate.

If the me.revds'd gets added, that would be very functional.

Edit: going to think about this and add in a piece to set back to main DPS properly and take into account some kinda delay so it doesn't spam change back to DPS (unless you already are thinking about that Hard?)

My logic would be:
(check for a DS on the mob and !${checkdelay}) {
switch bandolier nodamage
varset checkdelay 5s
} else if (bandolier not set to nodamage) {bandolier activate DPS}


Something like that

Thanks, I did forget to add the ${NonDamage} check.

New, final code, once Me.RevDSed is added:

Code:
Sub NoDSBandolier
      /if (((${Bool[${Target.DSed.ID}]}==TRUE) || (${Bool[${Me.RevDSed.ID}]}==TRUE)) && !${nonDamage}) {
	/varset nonDamage TRUE
        /bandolier Activate NonDamage
      } else /if ((${Bool[${Target.DSed.ID}]}==FALSE) && (${Bool[${Me.RevDSed.ID}]}==FALSE) && ${nonDamage}) {
        /varset nonDamage FALSE
        /bandolier Activate Normal
      }
/return