public override void Combat()
{
WoWUnit tar = Me.CurrentTarget;
if (!Me.IsFacing(tar))
{
tar.Face();
Logging.Write("Facing target");
}
else if ((tar.HealthPercent <=20 && SpellManager.CanCast("Hammer of Wrath", tar))
{
if (SpellManager.CanCast ("Hammer of Wrath", tar);
{
SpellManager.Cast ("Hammer of Wrath", tar);
}
}
else if (Me.CurrentHolyPower == 3)
{
if (SpellManager.CanCast("Zealotry")
{
SpellManager.Cast ("Zealotry")
}
}
else if ((Me.CurrentHolyPower == 3 || isAuraActive("Zealotry")) && SpellManager.CanCast("Templar's Verdict", tar))
{
if (SpellManager.CanCast("Templar's Verdict")
{
SpellManager.Cast ("Templar's Verdict")
}
}
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 ((tar.Distance <= 5 && SpellManager.CanCast("Rebuke", tar))
{
s = "Rebuke";
}
else if ((tar.Distance > 5 && SpellManager.CanCast("Repentance", tar))
{
s = "Repentance";
}
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();
}
}
else if ((Me.CurrentHolyPower == 3 || isAuraActive("Zealotry")) && SpellManager.CanCast("Templar's Verdict", tar))
{
SpellManager.Cast ("Templar's Verdict")
}
else if ((Me.CurrentHolyPower == 3 || isAuraActive("Zealotry")) && SpellManager.CanCast("Templar's Verdict", tar))
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 RetPVP
{
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)) //////////////Needs changing to no aura active//////
{
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"; ////////change so only if tar.distance is <5/////////////////
}
else if (SpellManager.CanCast("Repentance", tar))
{
s = "Repentance"; ////////change so only if tar.distance is >5 <=30////////////
}
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 "RetPVP"; } }
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;
}
}
GetObjectsOfType(false, false)
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 RetPVP
{
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 ((Me.CurrentHolyPower == 3 || isAuraActive("Zealotry")) && SpellManager.CanCast("Templar's Verdict", tar))
{
SpellManager.Cast ("Templar's Verdict")
}
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)) //////////////Needs changing to no aura active//////
{
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"; ////////change so only if tar.distance is <5/////////////////
}
else if (SpellManager.CanCast("Repentance", tar))
{
s = "Repentance"; ////////change so only if tar.distance is >5 <=30////////////
}
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(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 "RetPVP"; } }
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;
}
}