• Visit Rebornbuddy
  • [Arms] Armed - Quick, dirty, simple, fast

    Discussion in 'Warrior' started by Apoc, Oct 22, 2012.

    1. Apoc

      Apoc Moderator Staff Member Moderator

      Joined:
      Jan 16, 2010
      Messages:
      2,790
      Likes Received:
      94
      Trophy Points:
      48
      To prove a point I made a while ago, CC's don't need to be over complicated to work really well.

      The following is purely a rotation CC (no movement, no targeting, with the optional exclusion of Heroic Leap as a DPS cooldown [buggy!])

      This is meant for use with RaidBot (or LazyRaider in RaidBot mode). Do not expect this to work unattended. It's meant to show that not everything is broken, and people tend to overthink things. Simplicity is key!

      Code:
      using System;using System.Collections.Generic;
      using System.Linq;
      
      
      using Styx;
      using Styx.CommonBot;
      using Styx.CommonBot.Routines;
      using Styx.Helpers;
      using Styx.TreeSharp;
      using Styx.WoWInternals;
      using Styx.WoWInternals.WoWObjects;
      
      
      using Action = Styx.TreeSharp.Action;
      
      
      namespace Armed
      {
          public class Routine : CombatRoutine
          {
              /// <summary>
              /// The name of this CombatRoutine
              /// </summary>
              /// <value>
              /// The name.
              /// </value>
              public override string Name { get { return "Armed"; } }
      
      
              /// <summary>
              /// The <see cref="T:Styx.WoWClass"/> to be used with this routine
              /// </summary>
              /// <value>
              /// The class.
              /// </value>
              public override WoWClass Class { get { return WoWClass.Warrior; } }
      
      
              private Composite _combat, _buffs;
      
      
              public override Composite CombatBehavior { get { return _combat; } }
              public override Composite PreCombatBuffBehavior { get { return _buffs; } }
              public override Composite CombatBuffBehavior { get { return _buffs; } }
      
      
              public override void Initialize()
              {
                  _combat = CreateCombat();
                  _buffs = CreateBuffs();
              }
      
      
              Composite CreateBuffs()
              {
                  return Cast("Battle Shout", ret => !StyxWoW.Me.HasAura("Battle Shout"));
              }
      
      
              Composite CreateCombat()
              {
                  return new PrioritySelector(
      
      
                      // Interrupt please.
                      //Cast("Pummel", ret => StyxWoW.Me.CurrentTarget.IsCasting && StyxWoW.Me.CurrentTarget.CanInterruptCurrentSpellCast),
                      Cast("Impending Victory", ret => StyxWoW.Me.HealthPercent <= 90 && StyxWoW.Me.HasAura("Victorious")),
      
      
                      // Kee SS up if we've got more than 2 mobs to get to killing.
                      new Decorator(ret => UnfriendlyUnits.Count() >= 2,
                          CreateAoe()),
      
      
                      new Decorator(ret => StyxWoW.Me.CurrentTarget.HealthPercent <= 20,
                          CreateExecuteRange()),
                      new Decorator(ret => StyxWoW.Me.CurrentTarget.HealthPercent > 20,
                          new PrioritySelector(
                              Cast("Recklessness", ret => StyxWoW.Me.CurrentTarget.IsBoss),
                              Cast("Avatar", ret => StyxWoW.Me.CurrentTarget.IsBoss),
                              Cast("Skull Banner", ret => StyxWoW.Me.CurrentTarget.IsBoss),
      
      
                              // Only drop DC if we need to use HS for TFB. This lets us avoid breaking HS as a rage dump, when we don't want it to be one.
                              Cast("Deadly Calm", ret => NeedTasteForBloodDump),
                              Cast("Heroic Strike", ret => NeedHeroicStrikeDump),
      
      
                              Cast("Bloodbath", ret => StyxWoW.Me.CurrentTarget.IsBoss),
      
      
                              Cast("Berserker Rage", ret => GetSpellCooldown("Colossus Smash").TotalSeconds < 1),
                              Cast("Colossus Smash", ret => !StyxWoW.Me.CurrentTarget.HasAura("Colossus Smash")),
                              Cast("Execute"),
                              Cast("Mortal Strike"),
      
      
                              //HeroicLeap(),
      
      
                              Cast("Storm Bolt"),
                              Cast("Dragon Roar"),
                              Cast("Overpower"),
      
      
                              // Rage dump!
                              Cast("Slam", ret => (StyxWoW.Me.RagePercent >= 60 || StyxWoW.Me.CurrentTarget.HasAura("Colossus Smash")) && StyxWoW.Me.CurrentTarget.HealthPercent > 20),
      
      
                              Cast("Battle Shout", ret => StyxWoW.Me.RagePercent < 30),
                              Cast("Heroic Throw"),
      
      
                              // Don't use this in execute range, unless we need the heal. Thanks!
                              Cast("Impending Victory", ret => StyxWoW.Me.CurrentTarget.HealthPercent > 20 || StyxWoW.Me.HealthPercent < 50))
                          )
                      );
              }
              Composite CreateAoe()
              {
                  return new PrioritySelector(
                      Cast("Dragon Roar"),
                      Cast("Shockwave"),
                      Cast("Bladestorm", ret=>UnfriendlyUnits.Count() >= 4),
                      Cast("Sweeping Strikes"),
                      Cast("Thunder Clap")
                      
                      );
              }
              Composite CreateExecuteRange()
              {
                  return new PrioritySelector(
      
      
                      // Pop all our CDs. Get ready to truck the mob.
                      Cast("Recklessness", ret => StyxWoW.Me.CurrentTarget.IsBoss),
                      Cast("Skull Banner", ret => StyxWoW.Me.CurrentTarget.IsBoss),
                      Cast("Avatar", ret => StyxWoW.Me.CurrentTarget.IsBoss),
                      Cast("Bloodbath", ret => StyxWoW.Me.CurrentTarget.IsBoss),
                      Cast("Berserker Rage"),
                      new Action(ret => { UseTrinkets(); return RunStatus.Failure; }),
      
      
                      Cast("Colossus Smash"),
                      Cast("Execute"),
                      Cast("Mortal Strike"),
                      Cast("Overpower"),
                      Cast("Storm Bolt"),
                      Cast("Dragon Roar"),
                      Cast("Slam"),
                      Cast("Battle Shout")
      
      
                      
                      );
              }
      
      
              Composite HeroicLeap()
              {
                  return new Decorator(ret=> StyxWoW.Me.CurrentTarget.HasAura("Colossus Smash") && SpellManager.CanCast("Heroic Leap"),
                      new Action(ret=>
                          {
                              var tpos = StyxWoW.Me.CurrentTarget.Location;
                              var trot = StyxWoW.Me.CurrentTarget.Rotation;
                              var leapRight = WoWMathHelper.CalculatePointAtSide(tpos, trot, 5, true);
                              var leapLeft = WoWMathHelper.CalculatePointAtSide(tpos, trot, 5, true);
      
      
                              var myPos = StyxWoW.Me.Location;
      
      
                              var leftDist = leapLeft.Distance(myPos);
                              var rightDist = leapRight.Distance(myPos);
      
      
                              var leapPos = WoWMathHelper.CalculatePointBehind(tpos, trot, 8);
      
      
                              if (leftDist > rightDist && leftDist <= 40 && leftDist >= 8)
                                  leapPos = leapLeft;
                              else if (rightDist > leftDist && rightDist <= 40 && rightDist >= 8)
                                  leapPos = leapLeft;
      
      
                              SpellManager.Cast("Heroic Leap");
                              SpellManager.ClickRemoteLocation(leapPos);
                              StyxWoW.Me.CurrentTarget.Face();
                          }));
              }
      
      
              void UseTrinkets()
              {
                  var firstTrinket = StyxWoW.Me.Inventory.Equipped.Trinket1;
                  var secondTrinket = StyxWoW.Me.Inventory.Equipped.Trinket2;
      
      
                  if(firstTrinket != null && CanUseEquippedItem(firstTrinket))
                      firstTrinket.Use();
      
      
                  if(secondTrinket != null && CanUseEquippedItem(secondTrinket))
                      secondTrinket.Use();
      
      
              }
              private static bool CanUseEquippedItem(WoWItem item)
              {
                  // Check for engineering tinkers!
                  string itemSpell = Lua.GetReturnVal<string>("return GetItemSpell(" + item.Entry + ")", 0);
                  if (string.IsNullOrEmpty(itemSpell))
                      return false;
      
      
                  return item.Usable && item.Cooldown <= 0;
              }
      
      
              IEnumerable<WoWUnit> UnfriendlyUnits
              {
                  get { return ObjectManager.GetObjectsOfType<WoWUnit>(true, false).Where(u => !u.IsDead && u.CanSelect && u.Attackable && !u.IsFriendly && u.IsWithinMeleeRange); }
              }
      
      
              bool NeedTasteForBloodDump
              {
                  get
                  {
                      var tfb = StyxWoW.Me.GetAuraByName("Taste for Blood");
                      if (tfb != null)
                      {
                          // If we have more than 3 stacks, pop HS
                          if (tfb.StackCount >= 3)
                              return true;
      
      
                          // If it's about to drop, and we have at least 2 stacks, then pop HS.
                          // If we have 1 stack, then a slam is better used here.
                          if (tfb.TimeLeft.TotalSeconds < 1 && tfb.StackCount >= 2)
                              return true;
                      }
                      return false;
                  }
              }
      
      
              bool NeedHeroicStrikeDump
              {
                  get
                  {
                      // Flat out, drop HS if we need to.
                      if (StyxWoW.Me.RagePercent >= 90)
                          return true;
      
      
                      return NeedTasteForBloodDump;
                  }
              }
      
      
              private delegate T Selection<out T>(object context);
              Composite Cast(string spell, Selection<bool> reqs = null)
              {
                  return
                      new Decorator(
                          ret => ((reqs != null && reqs(ret)) || (reqs == null)) && SpellManager.CanCast(spell),
                          new Action(ret => SpellManager.Cast(spell)));
              }
      
      
              public static TimeSpan GetSpellCooldown(string spell)
              {
                  SpellFindResults results;
                  if (SpellManager.FindSpell(spell, out results))
                  {
                      if (results.Override != null)
                          return results.Override.CooldownTimeLeft;
                      return results.Original.CooldownTimeLeft;
                  }
      
      
                  return TimeSpan.MaxValue;
              }
          }
      }
      
       
    2. wownerds

      wownerds New Member

      Joined:
      Feb 15, 2011
      Messages:
      1,385
      Likes Received:
      30
      Trophy Points:
      0
      Sweet demo of how simple CCs can be.
       
      Last edited: Oct 22, 2012
    3. ElectroNick

      ElectroNick New Member

      Joined:
      Mar 14, 2012
      Messages:
      30
      Likes Received:
      0
      Trophy Points:
      0
      Mother of Programming :O
       
    4. BIRDIE13

      BIRDIE13 Member

      Joined:
      Sep 10, 2011
      Messages:
      42
      Likes Received:
      0
      Trophy Points:
      6
      Can you please explain how to install this? :)
       
    5. setemotion

      setemotion New Member

      Joined:
      Jan 31, 2012
      Messages:
      26
      Likes Received:
      0
      Trophy Points:
      0
      open notepad -> paste code -> save it as "Armed By Apoc.CS". Make a folder in HB > Combat Routines > Named "Armed By Apoc" > pun the notepad file("Armed By Apoc.CS") in this folder and ur done.
       
    6. BIRDIE13

      BIRDIE13 Member

      Joined:
      Sep 10, 2011
      Messages:
      42
      Likes Received:
      0
      Trophy Points:
      6
      Cant get it to work. I made a new folder in the HB folder called Combat Routines. Inside that i made a new folder called Armed by Apoc, and inside that i put the .cs file Armed By Apoc.cs

      Still not working. Is it supposed to come up with the other CC's like Singular and such for me to choose?
       
    7. setemotion

      setemotion New Member

      Joined:
      Jan 31, 2012
      Messages:
      26
      Likes Received:
      0
      Trophy Points:
      0
      you should already have a folder called "Routines", sorry for my mistake.
       
    8. dturner

      dturner Member

      Joined:
      Oct 4, 2012
      Messages:
      82
      Likes Received:
      0
      Trophy Points:
      6
      went from 40k dps using another CC to using this with raidbot and i jumped to 49k-52k dps. pretty insane...
       
    9. HceTiG0L

      HceTiG0L Community Developer

      Joined:
      Feb 10, 2012
      Messages:
      435
      Likes Received:
      8
      Trophy Points:
      18
      Indeed, this cc is the best to give the most dps on my arms warrior, great job!
       
    10. boogs

      boogs New Member

      Joined:
      Dec 24, 2011
      Messages:
      5
      Likes Received:
      0
      Trophy Points:
      0
      best CC for Arms
      --------------------------------
      wowscrnshot111912133103.jpg

      [​IMG]

      [​IMG]

      tested on orc warrior ilvl 480
       

      Attached Files:

      Last edited: Nov 19, 2012
    11. gixxer200hp

      gixxer200hp New Member

      Joined:
      Feb 11, 2011
      Messages:
      97
      Likes Received:
      1
      Trophy Points:
      0
      Could you make a quick cc like this for fury? would be prepared to buy you lunch for the effort :)
       
    12. najcik

      najcik New Member

      Joined:
      Oct 29, 2011
      Messages:
      7
      Likes Received:
      0
      Trophy Points:
      0
      Does any1 know how to make it use whirlwind as rage dump when more than 3 targets + last tier skills like bloodbath and stormbolt on cd?
       
    13. worklifebalance

      worklifebalance New Member

      Joined:
      Oct 26, 2012
      Messages:
      140
      Likes Received:
      2
      Trophy Points:
      0
      Thanks for this! With a little tweaking + Ultimate PVP Suite Plugin I have everything I want for PVP.
       
    14. X-Ploit

      X-Ploit Member

      Joined:
      Feb 24, 2012
      Messages:
      109
      Likes Received:
      0
      Trophy Points:
      16
      great job. pulling more dps then the other CC's
       
    15. FeedMe

      FeedMe New Member

      Joined:
      Oct 22, 2012
      Messages:
      30
      Likes Received:
      0
      Trophy Points:
      0
      any way to make this profile to charge? i wanna use it with the grindbot but he doesnt charge so cant initiate a fight
       
      Last edited: Nov 15, 2012
    16. nomnomnom

      nomnomnom Well-Known Member

      Joined:
      Feb 18, 2011
      Messages:
      1,506
      Likes Received:
      73
      Trophy Points:
      48
      It has no movement so implementing charge only will not be sufficient.
       
    17. Al3xwh1t3

      Al3xwh1t3 New Member

      Joined:
      Dec 16, 2011
      Messages:
      115
      Likes Received:
      0
      Trophy Points:
      0
      Didnt get how to use this..
       
    18. magra

      magra New Member

      Joined:
      Nov 23, 2012
      Messages:
      21
      Likes Received:
      0
      Trophy Points:
      0
      Highest dps CC I have tried, good job.
       
    19. jfvibe

      jfvibe New Member

      Joined:
      Sep 8, 2011
      Messages:
      67
      Likes Received:
      0
      Trophy Points:
      0
      Quick question to Apoc, is it possible to call a specific Composite or set a next spell in a routine from within the game?
       
    20. Apoc

      Apoc Moderator Staff Member Moderator

      Joined:
      Jan 16, 2010
      Messages:
      2,790
      Likes Received:
      94
      Trophy Points:
      48
      Technically, yes. Why?
       

    Share This Page