What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Check for a buff based on its spellID?

ski

Well-Known Member
Joined
Feb 12, 2010
Messages
3,720
I'm having an issue with this code:

Code:
        if (Me.Buffs.ContainsKey("Backlash")) {
            slog("Destruction: Backlash, casting Incinerate");
            Incinerate();
        }

Unfortunately, this always returns true, even if I do or don't have the temporary backlash buff. I'm wondering if its picking up the passive Backlash buff from the talent (its not shown in the buffs, but I assume there is a hidden one).

Is there a way to do that buff check on the temporary version's spellID instead?
 
Some talents put an invisible buff or aura on you. So checking for a buff name will always return true. In cases like that I use the following. It uses LUA and it works like a charm!

Code:
publicbool IsBuffOnMeLUA(string BuffName)
{
Lua.DoString("buffName,_,_,stackCount,_,_,_,_,_=UnitBuff(\"player\",\"" + BuffName + "\")");
string buffName = Lua.GetLocalizedText("buffName", Me.BaseAddress);
 
if (buffName == BuffName)
{
returntrue;
}
else
returnfalse;
}
 
Excuse the copy and paste. I'm in a rush but I'm sure you can sort it out :)
 
Excuse the copy and paste. I'm in a rush but I'm sure you can sort it out :)

Lol, that will do the trick. Thanks. Do you use that for every buff instead of Buffs.ContainsKey("SpellName");? Or just for ones with invisible auras?
 
By default I use Me.Buffs.ContainsKey("buff name here") and if I have problems with it I use the LUA code. But I'll always use the LUA buff check when I'm working with talent procs as I've found these to use invisible buffs / auras more frequently.
 
Why are you guys all using the buffsname? we can get the spellid in lua nowadays which clearly seperates buffs with the same name but different levels /effects from each other. This would also make sure that you can use non.english clients as well.
 
No need as the Lua.GetLocalizedText is called upon. It should return the Local String in the current game language (correct me if I'm wrong here).

I'm using similar code in my demonlock CC project.
This is coming from Bobby's Shaman CC (Credit to him for the code).

Only difference I'm on the Public Void instead of Public Bool department.
 
Last edited:
Why are you guys all using the buffsname? we can get the spellid in lua nowadays which clearly seperates buffs with the same name but different levels /effects from each other. This would also make sure that you can use non.english clients as well.

You're welcome to rewrite all my buffchecks for me ;)
 
Back
Top