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

Condition check and logging question

if (Me.ActiveAuras["Arcane Blast"].StackCount > 2)
{
CastSpell("Arcane Barrage");
Logging.Write(Color.Aqua, ">> Arcane Barrage <<");
}
Change to:

if ((Me.Auras.ContainsKey("Arcane Blast") && Me.ActiveAuras["Arcane Blast"].StackCount > 2))
{
CastSpell("Arcane Barrage");
Logging.Write(Color.Aqua, ">> Arcane Barrage <<");
}

We had this problem before, and it took even longer than this to find it lol. Basically it's checking for a stack count to a buff that doesn't exist yet, and HB gets super pissed and bitches at you until the buff appears.
 
Changed and it's starting to cast again after entering combat but ... Arcane Blast x 4 -> Arcane Barrage.

It seem we have to substract 1 from the stack count in the logic because HB isn't able to check the current stack _before_ it's trying to cast the next spell, right?
 
Last edited:
Try taking out the = I told you to put in on the second if statement.
Maybe CnG actually had it like that for a reason... :p
 
Would you agree with this logic?

Code:
            if (Me.CurrentTarget != null && Me.CurrentTarget.IsAlive == true && Me.Mounted == false)
            {
                if ((!Me.Auras.ContainsKey("Arcane Blast") || Me.ActiveAuras["Arcane Blast"].StackCount <= 2))
                {
                    CastSpell("Arcane Blast");
                    Logging.Write(Color.Aqua, ">> Arcane Blast << Stack Count {0}", Me.ActiveAuras["Arcane Blast"].StackCount);
                }
            }

It should cast Arcane Blast if it doesn't have the buff OR if the buff is there but has a stack count of 2 or less.

But even with this logic it will always cast AB until it has reached 4 stacks of the buff.

I'm clueless why this can happen...
 
Yes that logic makes perfect sense, but HB makes no sense sometimes, so try changing it to just "< 2" and see what happens.
 
with < 2 it casts 3 x AB (doesn't make sense, too). Don't know if the CastSpell method isn't "good" enough to see the first stack already on the player before it tries to fire the next AB but even if CastSpell is not that smart it should never cast it 3 times if the logic states: if it has already one stack, don't execute the if command...
 
No, I can't say that it's working correctly. Logic says, cast it until buff stack = 1 and it's casted 3 times (=> buffstack = 3).
 
The end result is correct... for you at least. Are you on a slow-average-fast-ultra computer?
 
Sorry, but I don't think that the end result is correct (and a math teacher would probably support my opinion) :)

If your mom tells you to not take more than one cookie and you take three... I guess you know what I mean.

Fast PC, quad core CPU (@3Ghz), 8 GB ram.
16 MBit DSL, 40ms latency.
 
log out the stack count, so you can see if its actually implementing the count properly.
 
The expected result from the coding is absolutely not what you wanted, but the actual result is what you wanted.
So the coding behind it, as long as it stays the same for others users (which is wont) is good.

And yes, when in doubt, send it to Log();
 
Back when I was working on taunt code for my paladin CC I encountered a very similar issue. A paladin has two taunts, hand of reckoning and righteous defence. Unfortunately in a "one-or-the-other" situation, my CC used both, because objectmanager wasn't updating auras fast enough, probably due to latency. I implemented StyxWoW.SleepForLagDuration() which resolved the issue. I suspect your problem is similar, in other words, even though you have three stacks, objectmanager still sees two because of latency.

Try this code, see if it works.

Code:
        public override void Combat()
        {

            if (Me.CurrentTarget != null && Me.CurrentTarget.IsAlive == true && Me.Mounted == false)
            {
                if ((!Me.Auras.ContainsKey("Arcane Blast") || Me.ActiveAuras["Arcane Blast"].StackCount <= 2) && Me.IsMoving == false)
                {
                    if (CastSpell("Arcane Blast") == true)
                    {
                        Logging.Write(Color.Aqua, ">> Arcane Blast <<");
                    }
                }
                else if ((Me.Auras.ContainsKey("Arcane Blast") && Me.ActiveAuras["Arcane Blast"].StackCount > 2) && Me.IsMoving == false)
                {
                    if (CastSpell("Arcane Barrage") == true)
                    {
                        Logging.Write(Color.Aqua, ">> Arcane Barrage <<");
                    }
                }

            StyxWoW.SleepForLagDuration();
            }
        }
 
Last edited:
Back
Top