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

Paladin HasAura not reading correctly????

mopysworld

New Member
Joined
Jan 15, 2010
Messages
158
Reaction score
2
I hate having to ask this but having a issue getting "The Art of War" to be detected correctly. All the other Buff are working correctly using the HasAura(string name). I am still currently coding in the "Legacy style" due to me still trying to figure out how BT CC's work.

This code just constantly spams Exorcism even if I don't have the buff. In theory it should only fire when the buff is active.

No Errors in Debug Log :(

Code:
void Exo()
{
if (Me.HasAura("The Art of War"))
            {
                Core.Cast("Exorcism");
            }
}

So figured it wasn't reading the string right lets try setting it up by the ID listed on wowhead. While it does fire correctly when the buff is active and cast exorcism only when the buff is active. It will not continue on with the rest of the code. Probably not using the code correctly in this snippet but never had to search by ID before.

Debug log is spitting out everytime it get to the call.
"System.NullReferenceException: Object reference not set to an instance of an object."

Code:
void Exo()
{
// The Art of War - AuraById(59578) according to wowhead ????
if (Me.GetAuraById(59578).IsActive)
            {
                Core.Cast("Exorcism");
            }
}

Did some quick searches and see there are a couple of complaint in the current paladin releases having this issue yet with no resolution. Also didn't find anything on the bugtracker specifically tied to "The Art of War" detection. There were a couple of "System.NullReferenceException: Object reference not set to an instance of an object." hits but the only one verbatim was to a warrior issue.

Any suggestions?
 
Try out these ones:

me.Auras
me.GetAllAuras()

If broken, here's a quick hax:
Code:
--LUA:
name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, 
shouldConsolidate, spellId = UnitBuff("unit", index or ["name", "rank"][, "filter"]) 

--Particular case: If unit doesnt have the buff, name is nil.

=> C#
bool HasBuff = Lua.GetReturnVal<bool>("return select(1, UnitBuff('player', 'The Art of War')) ~= nil", 0);

You could also build a 'buff tracker' using the c# functions I suggested - then catch the real aura ID when you got the buff.
 
Thanks cowdude for the suggestions. I had same scenario using the 2 me. suggestions... And I could not figure out how to implement the function you suggested as the api tool tips are a little vague even when that have some info there though 80% of time its blank.

After digging around on a old backup of HB files stumbled upon ActiveAuras.... can't believe I forgot about that. Really wish I could figure out the difference between HasAura and ActiveAuras as there is no description to what they do... but to me the names suggest they are the same thing.

Either way its fixed now with the following code.
Code:
if (Me.ActiveAuras.ContainsKey("The Art of War"))
            {
                Core.Cast("Exorcism");
            }
 
Back
Top