• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Simple (70+) Ret PvP CC.

    Discussion in 'Archives' started by exemplar, Nov 9, 2010.

    1. exemplar

      exemplar New Member

      Joined:
      Mar 16, 2010
      Messages:
      167
      Likes Received:
      32
      Trophy Points:
      0
      Hi friends,

      Started to use HB again recently and found the other CC didn't work very well.
      This isn't really flexible and you'll have to change code to 'configure it', as I made it for myself and not for general sharing, but what the hey.

      You pretty much must be specced into runspeed talent (Pursuit of Justice), and Judgement +range or else it will fail catastrophically. Other things, not so much.

      I've only been using it a few hours so there may be some yet unfound bugs :). My Paladin is level 71 at the moment so I don't know how it works on 80s.

      Oh, another thing. I generally only queue for AB and WSG and do not know how it works in the others :).

      Code:
      
      using System;
      using System.Linq;
      using System.Collections.Generic;
      using System.Diagnostics;
      using System.Threading;
      using Styx;
      using Styx.Combat.CombatRoutine;
      using Styx.Helpers;
      using Styx.Logic;
      using Styx.Logic.Combat;
      using Styx.Logic.Pathing;
      using Styx.WoWInternals;
      using Styx.WoWInternals.WoWObjects;
      using TreeSharp;
      
      using Action = TreeSharp.Action;
      
      namespace RetPally
      {
          class Paladin : CombatRoutine
          {
      
              public override void Combat()
              {
                  WoWUnit tar = Me.CurrentTarget;
                  if (!Me.IsFacing(tar))
                  {
                      tar.Face();
                      Logging.Write("Facing target");
                  }
                  else if (SpellManager.CanCast("Avenging Wrath", Me))
                  {
                      SpellManager.Cast("Avenging Wrath");
                      Logging.Write("Avenging Wrath");
                  }
                  else if ((tar.HealthPercent <= 20 || isAuraActive("Avenging Wrath")) && SpellManager.CanCast("Hammer of Wrath", tar))
                  {
                      if (SpellManager.CanCast("Hammer of Wrath", tar))
                      {
                          SpellManager.Cast("Hammer of Wrath", tar);
                          Logging.Write("HoW");
                      }
                  }
                  else if (isAuraActive("The Art of War"))
                  {
                      if (SpellManager.CanCast("Exorcism", tar))
                      {
                          SpellManager.Cast("Exorcism", tar);
                          Logging.Write("AoW proc");
                      }
                  }
                  else if (tar.Distance > 5 && tar.Distance <= 30)
                  {
                      String s = "Judgement";
                      if (s != null && SpellManager.CanCast(s, tar))
                      {
                          SpellManager.Cast(s, tar);
                          Logging.Write(s);
                      }
                      else
                      {
                          Navigator.MoveTo(tar.Location);
                      }
                  }
                  else if (tar.Distance <= 5)
                  {
                      String s = "Judgement";
                      if (tar.IsCasting)
                      {
                          if (SpellManager.CanCast("Rebuke", tar))
                          {
                              s = "Rebuke";
                          }
                          else if (SpellManager.CanCast("Repentance", tar))
                          {
                              s = "Repentance";
                          }
                          else if (SpellManager.CanCast("Hammer of Justice", tar))
                          {
                              s = "Hammer of Justice";
                          }
                      }
                      else if (Me.CurrentHolyPower == 3)
                      {
                          if (SpellManager.CanCast("Zealotry"))
                          {
                              s = "Zealotry";
                          }
                          else
                          {
                              s = "Templar's Verdict";
                          }
                      }
                      else if (SpellManager.CanCast("Crusader Strike", tar))
                      {
                          s = "Crusader Strike";
                      }
                      if (SpellManager.CanCast(s, tar))
                      {
                          Logging.Write(s);
                          SpellManager.Cast(s, tar);
                      }
                  }
                  else if (tar.Distance > 30)
                  {
                      Logging.Write("Changing targets");
                      Me.ClearTarget();
                  }
              }
      
              public override void Pull()
              {
                  if (Me.GotTarget)
                  {
                      WoWUnit tar = Me.CurrentTarget;
                      if (tar.Distance > PULL_DISTANCE || !tar.InLineOfSight)
                      {
                          Logging.Write("Moving to " + tar);
                          Navigator.MoveTo(tar.Location);
                      }
                      else
                      {
                          Combat();
                      }
                  }
                  else
                  {
                      var target = (from player in ObjectManager.GetObjectsOfType<WoWPlayer>(false, false)
                                    where player.IsAlliance != Me.IsAlliance
                                    where player.Dead == false && player.IsGhost == false
                                    orderby player.Distance ascending
                                    select player).FirstOrDefault();
      
                      if (target != null)
                      {
                          Logging.Write("Targeting " + target);
                          target.Target();
                      }
                  }
              }
      
              public override void Heal()
              {
                  string s = null;
                  if (Me.MovementInfo.RunSpeed < HOF_THRESHOLD && SpellManager.CanCast("Hand of Freedom", Me))
                  {
                      s = "Hand of Freedom";
                  }
                  else if ((Me.Stunned || Me.Fleeing))
                  {
                      if (SpellManager.CanCast("Blessing of Protection", Me))
                      {
                          s = "Blessing of Protection";
                      }
                      else if (SpellManager.CanCast("Divine Shield", Me))
                      {
                          s = "Divine Shield";
                      }
                  }
                  else if (Me.CurrentHolyPower > 0)
                  {
                      s = "Word of Glory";
                  }
                  else if (Me.HealthPercent <= HEAL_THRESHOLD / 2 && SpellManager.CanCast("Lay on Hands"))
                  {
                      s = "Lay on Hands";
                  }
                  else if (Me.IsMoving)
                  {
                      WoWMovement.MoveStop();
                  }
                  else
                  {
                      s = "Flash of Light";
                  }
                  if (s != null && SpellManager.CanCast(s))
                  {
                      Logging.Write("Heal " + s);
                      SpellManager.Cast(s);
                  }
              }
      
              public override void PreCombatBuff()
              {
                  if (!isAuraActive("Seal of Righteousness"))
                  {
                      SpellManager.Cast("Seal of Righteousness", Me);
                      Logging.Write("SoR");
                  }
                  else if (isAuraActive("Mark of the Wild") && !isAuraActive("Blessing of Might"))
                  {
                      SpellManager.Cast("Blessing of Might", Me);
                      Logging.Write("might");
                  }
                  else if (isAuraActive("Blessing of Kings") && !isAuraActive("Blessing of Might"))
                  {
                      if (Me.ActiveAuras["Blessing of Kings"].CreatorGuid != Me.Guid)
                      {
                          SpellManager.Cast("Blessing of Might", Me);
                          Logging.Write("might");
                      }
                  }
                  else if (!isAuraActive("Blessing of Kings") && !isAuraActive("Mark of the Wild"))
                  {
                      SpellManager.Cast("Blessing of Kings", Me);
                      Logging.Write("kings");
                  }
              }
      
      
              public override bool NeedPreCombatBuffs
              {
                  get
                  {
                      return (!isAuraActive("Blessing of Kings") && !isAuraActive("Mark of the Wild"))
                          || (!isAuraActive("Blessing of Might") && isAuraActive("Mark of the Wild")) ||
                          !isAuraActive("Seal of Righteousness");
                  }
              }
      
              public override bool NeedHeal 
              { 
                  get
                  {
                      return Me.HealthPercent <= HEAL_THRESHOLD ||
                          (Me.MovementInfo.RunSpeed < HOF_THRESHOLD && SpellManager.CanCast("Hand of Freedom"));
                  } 
              }
      
              private bool isAuraActive(string name)
              {
                  return Me.ActiveAuras.ContainsKey(name);
              }
      
              public override sealed string Name { get { return "RetPally"; } }
      
              public override WoWClass Class { get { return WoWClass.Paladin; } }
      
              private static LocalPlayer Me { get { return ObjectManager.Me; } }
      
              public override bool NeedRest { get { return false; } }
      
              public override bool NeedPullBuffs { get { return false; } }
      
              public override bool NeedCombatBuffs { get { return false; } }
      
              private static int HEAL_THRESHOLD = 50;
              private static int PULL_DISTANCE = 30;
              private static float HOF_THRESHOLD = 8.05f;
          }
      }
      
       
      Last edited: Nov 9, 2010
    2. d3adam

      d3adam Member

      Joined:
      Apr 1, 2010
      Messages:
      31
      Likes Received:
      2
      Trophy Points:
      8
      Would you mind if I used this as a base/reference for a pve/pvp protection CC? Most likely for personal use only, but if I released it publicly I would give you credit of course =]
      I'm new to C# so this is just what I was looking for ^^
       
    3. exemplar

      exemplar New Member

      Joined:
      Mar 16, 2010
      Messages:
      167
      Likes Received:
      32
      Trophy Points:
      0
      Go ahead, that's more or less why I posted it
       
    4. d3adam

      d3adam Member

      Joined:
      Apr 1, 2010
      Messages:
      31
      Likes Received:
      2
      Trophy Points:
      8
      Thanks mate =]
       
    5. hi1674

      hi1674 New Member

      Joined:
      Jan 15, 2010
      Messages:
      1,637
      Likes Received:
      5
      Trophy Points:
      0
      How is this working ?
       
    6. Gunmetal

      Gunmetal New Member

      Joined:
      Nov 10, 2010
      Messages:
      151
      Likes Received:
      2
      Trophy Points:
      0
      holy crap...this CC is amazing in BGs
       
    7. aleix

      aleix New Member

      Joined:
      Jul 19, 2010
      Messages:
      20
      Likes Received:
      1
      Trophy Points:
      0
      awesome....
       
    8. Gully

      Gully New Member

      Joined:
      Jan 27, 2011
      Messages:
      154
      Likes Received:
      3
      Trophy Points:
      0
      Code:
      using System;
      using System.Linq;
      using System.Collections.Generic;
      using System.Diagnostics;
      using System.Threading;
      using Styx;
      using Styx.Combat.CombatRoutine;
      using Styx.Helpers;
      using Styx.Logic;
      using Styx.Logic.Combat;
      using Styx.Logic.Pathing;
      using Styx.WoWInternals;
      using Styx.WoWInternals.WoWObjects;
      using TreeSharp;
      
      using Action = TreeSharp.Action;
      
      namespace RetPally
      {
          class Paladin : CombatRoutine
          {
      
              public override void Combat()
              {
                  WoWUnit tar = Me.CurrentTarget;
                  if (!Me.IsFacing(tar))
                  {
                      tar.Face();
                      Logging.Write("Facing target");
                  }
                  else if (SpellManager.CanCast("Avenging Wrath", Me))
                  {
                      SpellManager.Cast("Avenging Wrath");
                      Logging.Write("Avenging Wrath");
                  }
                  else if (SpellManager.CanCast("Guardian of Ancient Kings", Me))
                  {
                      SpellManager.Cast("Guardian of Ancient Kings");
                      Logging.Write("Guardian of Ancient Kings");
                  }
                  else if ((tar.HealthPercent <= 20 || isAuraActive("Avenging Wrath")) && SpellManager.CanCast("Hammer of Wrath", tar))
                  {
                      if (SpellManager.CanCast("Hammer of Wrath", tar))
                      {
                          SpellManager.Cast("Hammer of Wrath", tar);
                          Logging.Write("HoW");
                      }
                  }
                  else if (isAuraActive("The Art of War"))
                  {
                      if (SpellManager.CanCast("Exorcism", tar))
                      {
                          SpellManager.Cast("Exorcism", tar);
                          Logging.Write("AoW proc");
                      }
                  }
                  else if (tar.Distance > 5 && tar.Distance <= 30)
                  {
                      String s = "Judgement";
                      if (s != null && SpellManager.CanCast(s, tar))
                      {
                          SpellManager.Cast(s, tar);
                          Logging.Write(s);
                      }
                      else
                      {
                          Navigator.MoveTo(tar.Location);
                      }
                  }
                  else if (tar.Distance <= 5)
                  {
                      String s = "Judgement";
                      if (tar.IsCasting)
                      {
                          if (SpellManager.CanCast("Rebuke", tar))
                          {
                              s = "Rebuke";
                          }
                          else if (SpellManager.CanCast("Repentance", tar))
                          {
                              s = "Repentance";
                          }
                          else if (SpellManager.CanCast("Hammer of Justice", tar))
                          {
                              s = "Hammer of Justice";
                          }
                      }
                      else if (Me.CurrentHolyPower == 3)
                      {
                          if (SpellManager.CanCast("Zealotry"))
                          {
                              s = "Zealotry";
                          }
                          else
                          {
                              s = "Templar's Verdict";
                          }
                      }
                      else if (SpellManager.CanCast("Crusader Strike", tar))
                      {
                          s = "Crusader Strike";
                      }
                      if (SpellManager.CanCast(s, tar))
                      {
                          Logging.Write(s);
                          SpellManager.Cast(s, tar);
                      }
                  }
                  else if (tar.Distance > 30)
                  {
                      Logging.Write("Changing targets");
                      Me.ClearTarget();
                  }
              }
      
              public override void Pull()
              {
                  if (Me.GotTarget)
                  {
                      WoWUnit tar = Me.CurrentTarget;
                      if (tar.Distance > PULL_DISTANCE || !tar.InLineOfSight)
                      {
                          Logging.Write("Moving to " + tar);
                          Navigator.MoveTo(tar.Location);
                      }
                      else
                      {
                          Combat();
                      }
                  }
                  else
                  {
                      var target = (from player in ObjectManager.GetObjectsOfType<WoWPlayer>(false, false)
                                    where player.IsAlliance != Me.IsAlliance
                                    where player.Dead == false && player.IsGhost == false
                                    orderby player.Distance ascending
                                    select player).FirstOrDefault();
      
                      if (target != null)
                      {
                          Logging.Write("Targeting " + target);
                          target.Target();
                      }
                  }
              }
      
              public override void Heal()
              {
                  string s = null;
                  if (Me.MovementInfo.RunSpeed < HOF_THRESHOLD && SpellManager.CanCast("Hand of Freedom", Me))
                  {
                      s = "Hand of Freedom";
                  }
                  else if ((Me.Stunned || Me.Fleeing))
                  {
                      if (SpellManager.CanCast("Blessing of Protection", Me))
                      {
                          s = "Blessing of Protection";
                      }
                      else if (SpellManager.CanCast("Divine Shield", Me))
                      {
                          s = "Divine Shield";
                      }
                  }
                  else if (Me.CurrentHolyPower > 0)
                  {
                      s = "Word of Glory";
                  }
                  else if (Me.HealthPercent <= HEAL_THRESHOLD / 2 && SpellManager.CanCast("Lay on Hands"))
                  {
                      s = "Lay on Hands";
                  }
                  else if (Me.IsMoving)
                  {
                      WoWMovement.MoveStop();
                  }
                  else
                  {
                      s = "Flash of Light";
                  }
                  if (s != null && SpellManager.CanCast(s))
                  {
                      Logging.Write("Heal " + s);
                      SpellManager.Cast(s);
                  }
              }
      
              public override void PreCombatBuff()
              {
                  if (!isAuraActive("Seal of Truth"))
                  {
                      SpellManager.Cast("Seal of Truth", Me);
                      Logging.Write("SoR");
                  }
                  else if (isAuraActive("Mark of the Wild") && !isAuraActive("Blessing of Might"))
                  {
                      SpellManager.Cast("Blessing of Might", Me);
                      Logging.Write("might");
                  }
                  else if (isAuraActive("Blessing of Kings") && !isAuraActive("Blessing of Might"))
                  {
                      if (Me.ActiveAuras["Blessing of Kings"].CreatorGuid != Me.Guid)
                      {
                          SpellManager.Cast("Blessing of Might", Me);
                          Logging.Write("might");
                      }
                  }
                  else if (!isAuraActive("Blessing of Kings") && !isAuraActive("Mark of the Wild"))
                  {
                      SpellManager.Cast("Blessing of Kings", Me);
                      Logging.Write("kings");
                  }
              }
      
      
              public override bool NeedPreCombatBuffs
              {
                  get
                  {
                      return (!isAuraActive("Blessing of Kings") && !isAuraActive("Mark of the Wild"))
                          || (!isAuraActive("Blessing of Might") && isAuraActive("Mark of the Wild")) ||
                          !isAuraActive("Seal of Truth");
                  }
              }
      
              public override bool NeedHeal 
              { 
                  get
                  {
                      return Me.HealthPercent <= HEAL_THRESHOLD ||
                          (Me.MovementInfo.RunSpeed < HOF_THRESHOLD && SpellManager.CanCast("Hand of Freedom"));
                  } 
              }
      
              private bool isAuraActive(string name)
              {
                  return Me.ActiveAuras.ContainsKey(name);
              }
      
              public override sealed string Name { get { return "RetPally"; } }
      
              public override WoWClass Class { get { return WoWClass.Paladin; } }
      
              private static LocalPlayer Me { get { return ObjectManager.Me; } }
      
              public override bool NeedRest { get { return false; } }
      
              public override bool NeedPullBuffs { get { return false; } }
      
              public override bool NeedCombatBuffs { get { return false; } }
      
              private static int HEAL_THRESHOLD = 50;
              private static int PULL_DISTANCE = 30;
              private static float HOF_THRESHOLD = 8.05f;
          }
      }
       
      Last edited: Feb 25, 2011
    9. Gully

      Gully New Member

      Joined:
      Jan 27, 2011
      Messages:
      154
      Likes Received:
      3
      Trophy Points:
      0
      just change seal of righteousnes for seal of truth all credit goes to exemplar

      Edit: how can i change the healing to use the heals at specific health levels ?

      Edit: for some reason im not moving in bg bot any idea why? [Solved]
       
      Last edited: Feb 22, 2011
    10. Undeadlol1

      Undeadlol1 New Member

      Joined:
      Dec 5, 2010
      Messages:
      5
      Likes Received:
      0
      Trophy Points:
      0
      2exemplar, your cc's are freaking amazing, keep it up.
      Can any1 make this cc use hammer of justice in anyway? On a every cooldown maybe?
       
    11. dirk

      dirk New Member

      Joined:
      Jan 3, 2011
      Messages:
      30
      Likes Received:
      0
      Trophy Points:
      0
      This one is pretty nice indeed :)
      Something like Undeadlol1 suggested would be a nice addition, and is there anyway to avoid targeting the pets? I've found my pally sometimes to be nuking the warlocks pet while the lock was /laughing and watching me die ;-)
      This CC is pretty much the only one working in PVP right now and not bad at all, thanks for that!
       
    12. justjames

      justjames Member

      Joined:
      Mar 13, 2010
      Messages:
      115
      Likes Received:
      2
      Trophy Points:
      18
      Is the healing level set at the end at 50? so all heals will only be used then? thats the only level i see all the way at the bottom
       
    13. dirk

      dirk New Member

      Joined:
      Jan 3, 2011
      Messages:
      30
      Likes Received:
      0
      Trophy Points:
      0
      Any way to include a couple lines of coding so its possible to run mixed with Arch? Now it doesn't do anything at all when attacked while surveying :)
      Oh, and another thing I found: when my pal is in BG and the current target is killed/dead, it won't switch to other targets until it's out of combat again.. maybe this is an issue only I have, but perhaps not.
       
    14. justjames

      justjames Member

      Joined:
      Mar 13, 2010
      Messages:
      115
      Likes Received:
      2
      Trophy Points:
      18
      ^^^^
      this, although it is funny watching my pally kill a hunters pet while he is attacking me and then turn around and kill him too
       
    15. Suxxyduck

      Suxxyduck New Member

      Joined:
      Jan 15, 2010
      Messages:
      96
      Likes Received:
      0
      Trophy Points:
      0
      Is it good to use in pve? Im tired of the standard noobish built CC. Spamming exorscismen ? Rly So would be really thankful to know if this works for pve. If not, could you take your time to make one? Would be REALLY appreciated!
       
    16. Gully

      Gully New Member

      Joined:
      Jan 27, 2011
      Messages:
      154
      Likes Received:
      3
      Trophy Points:
      0
      Try singular its good in pvp and in pve
       
    17. ulsterbrit

      ulsterbrit New Member

      Joined:
      Mar 17, 2010
      Messages:
      3
      Likes Received:
      0
      Trophy Points:
      0
      how do i use this ? do i just ad it at the bottom of my conalesce in default paladin folder?
       
    18. intr3pid

      intr3pid New Member

      Joined:
      Nov 11, 2010
      Messages:
      47
      Likes Received:
      0
      Trophy Points:
      0
      Anyway you can add inquisition and hammer of justice to this? This CC is sick!
       
    19. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,330
      Likes Received:
      378
      Trophy Points:
      83
      I'm working on making it select only players, and to make it pick lowest health along with closest target.
       
    20. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,330
      Likes Received:
      378
      Trophy Points:
      83
      Code:
      using System;
      using System.Linq;
      using System.Collections.Generic;
      using System.Diagnostics;
      using System.Threading;
      using Styx;
      using Styx.Combat.CombatRoutine;
      using Styx.Helpers;
      using Styx.Logic;
      using Styx.Logic.Combat;
      using Styx.Logic.Pathing;
      using Styx.WoWInternals;
      using Styx.WoWInternals.WoWObjects;
      using TreeSharp;
      
      using Action = TreeSharp.Action;
      
      namespace RetPally
      {
          class Paladin : CombatRoutine
          {
      
              public override void Combat()
              {
                  WoWUnit tar = Me.CurrentTarget;
                  if (!Me.IsFacing(tar))
                  {
                      tar.Face();
                      Logging.Write("Facing target");
                  }
                  else if (SpellManager.CanCast("Avenging Wrath", Me))
                  {
                      SpellManager.Cast("Avenging Wrath");
                      Logging.Write("Avenging Wrath");
                  }
                  else if (SpellManager.CanCast("Guardian of Ancient Kings", Me))
                  {
                      SpellManager.Cast("Guardian of Ancient Kings");
                      Logging.Write("Guardian of Ancient Kings");
                  }
                  else if ((tar.HealthPercent <= 20 || isAuraActive("Avenging Wrath")) && SpellManager.CanCast("Hammer of Wrath", tar))
                  {
                      if (SpellManager.CanCast("Hammer of Wrath", tar))
                      {
                          SpellManager.Cast("Hammer of Wrath", tar);
                          Logging.Write("HoW");
                      }
                  }
                  else if (isAuraActive("The Art of War"))
                  {
                      if (SpellManager.CanCast("Exorcism", tar))
                      {
                          SpellManager.Cast("Exorcism", tar);
                          Logging.Write("AoW proc");
                      }
                  }
                  else if (tar.Distance > 5 && tar.Distance <= 30)
                  {
                      String s = "Judgement";
                      if (s != null && SpellManager.CanCast(s, tar))
                      {
                          SpellManager.Cast(s, tar);
                          Logging.Write(s);
                      }
                      else
                      {
                          Navigator.MoveTo(tar.Location);
                      }
                  }
                  else if (tar.Distance <= 5)
                  {
                      String s = "Judgement";
                      if (tar.IsCasting)
                      {
                          if (SpellManager.CanCast("Rebuke", tar))
                          {
                              s = "Rebuke";
                          }
                          else if (SpellManager.CanCast("Repentance", tar))
                          {
                              s = "Repentance";
                          }
                          
                      }
                      else if (Me.CurrentHolyPower == 3)
                      {
                          if (SpellManager.CanCast("Zealotry"))
                          {
                              s = "Zealotry";
                          }
                          else
                          {
                              s = "Templar's Verdict";
                          }
                      }
      				else if (SpellManager.CanCast("Hammer of Justice", tar))
                      {
                              s = "Hammer of Justice";
                      }
                      else if (SpellManager.CanCast("Crusader Strike", tar))
                      {
                          s = "Crusader Strike";
                      }
                      if (SpellManager.CanCast(s, tar))
                      {
                          Logging.Write(s);
                          SpellManager.Cast(s, tar);
                      }
                  }
                  else if (tar.Distance > 30)
                  {
                      Logging.Write("Changing targets");
                      Me.ClearTarget();
                  }
              }
      
              public override void Pull()
              {
                  if (Me.GotTarget && !Me.CurrentTarget.IsPet && Me.CurrentTarget.IsAlive)
                  {
                      WoWUnit tar = Me.CurrentTarget;
                      if (tar.Distance > PULL_DISTANCE || !tar.InLineOfSight)
                      {
                          Logging.Write("Moving to " + tar);
                          Navigator.MoveTo(tar.Location);
                      }
                      else
                      {
                          Combat();
                      }
                  }
                  else
                  {
                      /*var target = (from player in ObjectManager.GetObjectsOfType<WoWPlayer>(false, false)
                                    where player.IsAlliance != Me.IsAlliance
                                    where player.Dead == false && player.IsGhost == false
      							  where player.IsPet == false
                                    orderby player.HealthPercent ascending,player.Distance descending
                                    select player).FirstOrDefault();*/
      							  
      				
      				WoWPlayer target = ObjectManager.GetObjectsOfType<WoWPlayer>().
      				Where(p => p.IsHostile && !p.IsPet && !p.IsOnTransport && !p.Dead && p.DistanceSqr <= 70 * 70).
      				OrderByDescending(p => p.DistanceSqr).FirstOrDefault();
      				
      				
      			
      
                      if (target != null)
                      {
                          Logging.Write("Targeting " + target);
                          target.Target();
                      }
                  }
              }
      
              public override void Heal()
              {
                  string s = null;
                  if (Me.MovementInfo.RunSpeed < HOF_THRESHOLD && SpellManager.CanCast("Hand of Freedom", Me))
                  {
                      s = "Hand of Freedom";
                  }
                  else if ((Me.Stunned || Me.Fleeing))
                  {
                      if (SpellManager.CanCast("Blessing of Protection", Me))
                      {
                          s = "Blessing of Protection";
                      }
                      else if (SpellManager.CanCast("Divine Shield", Me))
                      {
                          s = "Divine Shield";
                      }
                  }
                  else if (Me.CurrentHolyPower > 0)
                  {
                      s = "Word of Glory";
                  }
                  else if (Me.HealthPercent <= HEAL_THRESHOLD / 2 && SpellManager.CanCast("Lay on Hands"))
                  {
                      s = "Lay on Hands";
                  }
                  else if (Me.IsMoving)
                  {
                      WoWMovement.MoveStop();
                  }
                  else
                  {
                      s = "Flash of Light";
                  }
                  if (s != null && SpellManager.CanCast(s))
                  {
                      Logging.Write("Heal " + s);
                      SpellManager.Cast(s);
                  }
              }
      
              public override void PreCombatBuff()
              {
                  if (!isAuraActive("Seal of Truth"))
                  {
                      SpellManager.Cast("Seal of Truth", Me);
                      Logging.Write("SoR");
                  }
                  else if (isAuraActive("Mark of the Wild") && !isAuraActive("Blessing of Might"))
                  {
                      SpellManager.Cast("Blessing of Might", Me);
                      Logging.Write("might");
                  }
                  else if (isAuraActive("Blessing of Kings") && !isAuraActive("Blessing of Might"))
                  {
                      if (Me.ActiveAuras["Blessing of Kings"].CreatorGuid != Me.Guid)
                      {
                          SpellManager.Cast("Blessing of Might", Me);
                          Logging.Write("might");
                      }
                  }
                  else if (!isAuraActive("Blessing of Kings") && !isAuraActive("Mark of the Wild"))
                  {
                      SpellManager.Cast("Blessing of Kings", Me);
                      Logging.Write("kings");
                  }
              }
      
      
              public override bool NeedPreCombatBuffs
              {
                  get
                  {
                      return (!isAuraActive("Blessing of Kings") && !isAuraActive("Mark of the Wild"))
                          || (!isAuraActive("Blessing of Might") && isAuraActive("Mark of the Wild")) ||
                          !isAuraActive("Seal of Truth");
                  }
              }
      
              public override bool NeedHeal 
              { 
                  get
                  {
                      return Me.HealthPercent <= HEAL_THRESHOLD ||
                          (Me.MovementInfo.RunSpeed < HOF_THRESHOLD && SpellManager.CanCast("Hand of Freedom"));
                  } 
              }
      
              private bool isAuraActive(string name)
              {
                  return Me.ActiveAuras.ContainsKey(name);
              }
      
              public override sealed string Name { get { return "RetPally"; } }
      
              public override WoWClass Class { get { return WoWClass.Paladin; } }
      
              private static LocalPlayer Me { get { return ObjectManager.Me; } }
      
              public override bool NeedRest { get { return false; } }
      
              public override bool NeedPullBuffs { get { return false; } }
      
              public override bool NeedCombatBuffs { get { return false; } }
      
              private static int HEAL_THRESHOLD = 30;
              private static int PULL_DISTANCE = 30;
              private static float HOF_THRESHOLD = 8.05f;
          }
      }
      
      Tweaked targeting code, didnt notice it targeting pets anymore, might still do it.
      Also will HoJ off cooldown.
       

    Share This Page