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

Rewriting Stance Dance

Venus112

New Member
Joined
Jun 17, 2010
Messages
1,509
Reaction score
13
Hey folks.

So currently, i'm trying to rewrite the Stance Dance function in "Titan Arms" (probably the most annoying thing i'll ever get to do in my entire wow life)

I'm having some problems with the CC only changing stances for a limited amount of time, all of the sudden it will stop changing stances and just stay in berserker stance

Code:
                {
                    if (!IsMyAuraActive(Me.CurrentTarget, "Rend") || Me.ActiveAuras.ContainsKey("Taste for Blood"))
                    {
                        if (Me.CurrentTarget.HealthPercent > 20)
                        {
                            if (TitanSettings.Instance.StanceDance && !Me.HasAura("Battle Stance"))
                            {
                                Lua.DoString("RunMacroText('/cast [stance:3/3, nomodifier]Battle Stance');");
                                Logging.Write(Color.Aqua, ">> Battle Stance <<");
                            }
                        }
                    }
                }
                {
                    if (IsMyAuraActive(Me.CurrentTarget, "Rend") && !Me.ActiveAuras.ContainsKey("Taste for Blood") || Me.CurrentTarget.HealthPercent < 20)
                    {
                        if (TitanSettings.Instance.StanceDance && !Me.HasAura("Berserker Stance"))
                        {
                            Lua.DoString("RunMacroText('/cast [stance:1/3, nomodifier]Berserker Stance');");
                            Logging.Write(Color.Aqua, ">> Berserker Stance <<");
                        }
                    }
                }

That's the code that i am using, i was thinking it would've been the ActiveAuras.ContainsKey for "Taste for Blood" that was messing it up - but then i realized that it was the same code used for triggering Overpower.

The problem seems to be because "Taste for Blood" isn't always recognised as a buff.
I can get somewhere between 1-7 Overpowers out (stance dancing just fine) and then it'll camp it's ass in Berserker Stance and just stay there all cozy

Got any ideas on how to fix this?
I will be eternally greatfull
 
Ok, after some testing (disabling every addon in wow, clearing cache, removing keybindings, new HB install)
I'm getting to the conclusion that HB doesn't always detect "Taste for Blood"
If i righclick buff to remove it, it'll work SOMETIMES when it becomes available again?

How can this be right?

Should i try and track the buff by SpellId?
I'm getting a bit confused, as it worked fine for a 100 million test yesterday - but right now it's not working optimal for me
It's not been reported to do this by the users of Titan Arms
 
Last edited:
Code:
private static bool OverpowerReady { get { return StyxWoW.Me.GetAuraTimeLeft("Taste for Blood", true).TotalSeconds > 0; } }

Code:
        public static TimeSpan GetAuraTimeLeft(this WoWUnit onUnit, string auraName, bool fromMyAura)        {
            WoWAura wantedAura =
                onUnit.GetAllAuras().FirstOrDefault(a => a.Name == auraName && (!fromMyAura || a.CreatorGuid == StyxWoW.Me.Guid)/* && a.StackCount > 0*/);


            return wantedAura != null ? wantedAura.TimeLeft : TimeSpan.Zero;
        }


Also, stop using macros to cast stuff. SpellManager.Cast("Battle Stance"). I'm not sure what your obsession is with using Lua and macros to do all your casting stuff. It makes no sense.

Also not sure why you're bothering to check your health, Berserker/Battle has nothing to do with what your health is. (If you're doing it for Enraged Regen, you can use it in any stance. Just pop Berserker's Rage then Regen.)
 
Last edited:
Yep, Taste for Blood is not detected correctly, use the AuraID instead.
 
Code:
private static bool OverpowerReady { get { return StyxWoW.Me.GetAuraTimeLeft("Taste for Blood", true).TotalSeconds > 0; } }

Code:
        public static TimeSpan GetAuraTimeLeft(this WoWUnit onUnit, string auraName, bool fromMyAura)        {
            WoWAura wantedAura =
                onUnit.GetAllAuras().FirstOrDefault(a => a.Name == auraName && (!fromMyAura || a.CreatorGuid == StyxWoW.Me.Guid)/* && a.StackCount > 0*/);


            return wantedAura != null ? wantedAura.TimeLeft : TimeSpan.Zero;
        }


Also, stop using macros to cast stuff. SpellManager.Cast("Battle Stance"). I'm not sure what your obsession is with using Lua and macros to do all your casting stuff. It makes no sense.

Also not sure why you're bothering to check your health, Berserker/Battle has nothing to do with what stance you're in. (If you're doing it for Enraged Regen, you can use it in any stance. Just pop Berserker's Rage then Regen.)

It's not checking my health - it's checking my targets.
I agree on the lua part (except for the trinkets, as i find the code you suggest insanely large), which was the entire reason i started on rewriting CCs to go away from lua that originally implemented (this has pretty much been Shaddars work and i was just giving it a quick touch up - but i get your point)

Thank you, i'll take a look into this
 
It's not checking my health - it's checking my targets.
I agree on the lua part (except for the trinkets, as i find the code you suggest insanely large), which was the entire reason i started on rewriting CCs to go away from lua that originally implemented (this has pretty much been Shaddars work and i was just giving it a quick touch up - but i get your point)

Thank you, i'll take a look into this

Take a look at Singular (Helpers/Item.cs)

The code is there for using trinkets, whether it has a Use effect or not (also includes checks for engineering tinkers)

Edit; I just woke up, so excuse the health comment. However, even then, you shouldn't be checking the target's health.

Code:
        private static bool NeedBattleStance        {
            get
            {
                WoWUnit t = StyxWoW.Me.CurrentTarget;
                // If the target doesn't have Rend up, get it up.
                if (t.GetAuraTimeLeft("Rend", true).TotalSeconds <= 0)
                {
                    return true;
                }


                // So, the target has rend... are we in execute range, and if so is Execute going to do more than OP?
                // If so, we don't need to switch to Battle Stance.
                if (ExecuteIsBetter)
                {
                    return false;
                }


                // We don't have TFB. We don't need to dance!
                if (!OverpowerReady)
                {
                    return false;
                }


                // Make sure we're not rage dumping.
                // MS isn't about to be off CD.
                // And we're not waiting on CS.
                if (StyxWoW.Me.RagePercent < 85 &&
                    MortalStrikeCD >= 1 &&
                    // CS+2s >= TFB time left. This ensures we have time to pop CS, switch to battle, pop OP, before CS falls off.
                    // As long as we pop OP before TFB wears, its not a DPS loss.
                    (ColossusSmashCD + 2 >= StyxWoW.Me.GetAuraTimeLeft("Taste for Blood", false).TotalSeconds || StyxWoW.Me.CurrentTarget.HasAura("Colossus Smash", 1)))
                {
                    return true;
                }


                return false;
            }
        }

private static bool ExecutionerWillDrop
        {
            get
            {
                // May be worth it to reduce this to 2 seconds to increase DPS even further.
                // However, varying haste levels will determine how quickly you can hit it. So 3 is a safe range for all gear levels.
                return StyxWoW.Me.GetAuraTimeLeft("Executioner", true).TotalSeconds <= 3;
            }
        }


        private static bool ExecuteIsBetter
        {
            get
            {
                // This isn't always true. But more often than not, OP is more effective at < 30 rage.
                // Might want to reduce this to 25, but for now, 30 is fine.
                if (StyxWoW.Me.CurrentTarget.HealthPercent < 20)
                {
                    if (ExecutionerWillDrop)
                    {
                        return true;
                    }


                    return StyxWoW.Me.RagePercent >= 30;
                }
                return false;
            }
        }

        private static double MortalStrikeCD { get { return Spell.GetSpellCooldown("Mortal Strike").TotalSeconds; } }
        private static double ColossusSmashCD { get { return Spell.GetSpellCooldown("Colossus Smash").TotalSeconds; } }
        private static bool OverpowerReady { get { return StyxWoW.Me.GetAuraTimeLeft("Taste for Blood", true).TotalSeconds > 0; } }
 
Ouch!I can already feel a headache coming from that :DI've promised Shaddar to let him redo the Warrior CC, so i'll probably fix the Stance Dance i implemented and such and leave it at that untill he comes back (Getting all sweaty, just by thinking of all those CCs that still needs a complete redoing)Think i fixed the Stance Dance issue with

Code:
        private static WoWAura TasteForBlood
    {
        get
        {
            return StyxWoW.Me.GetAuraById(60503);
        }
        
    }
But i'll write some notes behind my ear, from what you posted in the Titan Arms thread and from all this.I just didn't expect to gain control over 10 CCs all of the sudden, for a while :D
 
Hey Venus, is there an update? Wanted to implement stance dance too but it seems like you already done it. Would like to have it :o
 
Back
Top