Guest User

Untitled

a guest
Apr 8th, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.42 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using Singular.Dynamics;
  4. using Singular.Helpers;
  5. using Singular.Managers;
  6. using Singular.Settings;
  7.  
  8. using Styx;
  9. using Styx.Combat.CombatRoutine;
  10. using Styx.Logic.Combat;
  11. using TreeSharp;
  12. using CommonBehaviors.Actions;
  13.  
  14. namespace Singular.ClassSpecific.Rogue
  15. {
  16. public class Combat
  17. {
  18. #region Normal Rotation
  19.  
  20. [Class(WoWClass.Rogue)]
  21. [Spec(TalentSpec.CombatRogue)]
  22. [Behavior(BehaviorType.Pull)]
  23. [Context(WoWContext.Normal)]
  24. public static Composite CreateCombatRogueNormalPull()
  25. {
  26. return new PrioritySelector(
  27. Safers.EnsureTarget(),
  28. Movement.CreateMoveToLosBehavior(),
  29. Movement.CreateFaceTargetBehavior(),
  30. Spell.BuffSelf("Recuperate", ret => StyxWoW.Me.HealthPercent < 80),
  31. Spell.BuffSelf("Sprint", ret => StyxWoW.Me.IsMoving && StyxWoW.Me.HasAura("Stealth")),
  32. Spell.BuffSelf("Stealth"),
  33. // Garrote if we can, SS is kinda meh as an opener.
  34. Spell.Cast("Garrote", ret => StyxWoW.Me.CurrentTarget.MeIsBehind),
  35. Spell.Cast("Cheap Shot", ret => !SpellManager.HasSpell("Garrote") || !StyxWoW.Me.CurrentTarget.MeIsBehind),
  36. Spell.Cast("Ambush", ret => !SpellManager.HasSpell("Cheap Shot") && StyxWoW.Me.CurrentTarget.MeIsBehind),
  37. Spell.Cast("Sinister Strike", ret => !SpellManager.HasSpell("Cheap Shot") && !StyxWoW.Me.CurrentTarget.MeIsBehind),
  38.  
  39. new Decorator(
  40. ret => StyxWoW.Me.CurrentTarget.IsFlying || StyxWoW.Me.CurrentTarget.Distance2DSqr < 5 * 5 && Math.Abs(StyxWoW.Me.Z - StyxWoW.Me.CurrentTarget.Z) >= 5,
  41. new PrioritySelector(
  42. Spell.Cast("Throw", ret => Item.RangedIsType(WoWItemWeaponClass.Thrown))
  43. //Spell.Cast("Shoot", ret => Item.RangedIsType(WoWItemWeaponClass.Bow) || Item.RangedIsType(WoWItemWeaponClass.Gun)),
  44. //Spell.Cast("Stealth", ret => StyxWoW.Me.HasAura("Stealth"))
  45. )),
  46.  
  47. Movement.CreateMoveToMeleeBehavior(true)
  48. );
  49. }
  50.  
  51. [Class(WoWClass.Rogue)]
  52. [Spec(TalentSpec.CombatRogue)]
  53. [Behavior(BehaviorType.Combat)]
  54. [Context(WoWContext.Normal)]
  55. public static Composite CreateCombatRogueNormalCombat()
  56. {
  57. return new PrioritySelector(
  58. Safers.EnsureTarget(),
  59. Movement.CreateMoveToLosBehavior(),
  60. Movement.CreateFaceTargetBehavior(),
  61. new Decorator(
  62. ret => !StyxWoW.Me.HasAura("Vanish"),
  63. Helpers.Common.CreateAutoAttack(true)),
  64. Helpers.Common.CreateInterruptSpellCast(ret => StyxWoW.Me.CurrentTarget),
  65.  
  66. // Don't do anything if we casted vanish
  67. new Decorator(
  68. ret => StyxWoW.Me.HasAura("Vanish"),
  69. new ActionAlwaysSucceed()),
  70.  
  71. // Defensive
  72. Spell.BuffSelf("Evasion",
  73. ret => Unit.NearbyUnfriendlyUnits.Count(u => u.DistanceSqr < 6 * 6 && u.IsTargetingMeOrPet) >= 2),
  74.  
  75. Spell.BuffSelf("Cloak of Shadows",
  76. ret => Unit.NearbyUnfriendlyUnits.Count(u => u.IsTargetingMeOrPet && u.IsCasting) >= 1),
  77.  
  78. Spell.BuffSelf("Smoke Bomb", ret => StyxWoW.Me.HealthPercent < 15),
  79. Spell.BuffSelf("Recuperate", ret => StyxWoW.Me.HealthPercent < 80),
  80.  
  81. Common.CreateRogueBlindOnAddBehavior(),
  82.  
  83. // Redirect if we have CP left
  84. Spell.Cast("Redirect", ret => StyxWoW.Me.RawComboPoints > 0 && StyxWoW.Me.ComboPoints < 1),
  85.  
  86. Spell.BuffSelf("Vanish",
  87. ret => StyxWoW.Me.HealthPercent < 20),
  88.  
  89. Spell.BuffSelf("Adrenaline Rush",
  90. ret => StyxWoW.Me.CurrentEnergy < 20 && !StyxWoW.Me.HasAura("Killing Spree")),
  91.  
  92. // Killing Spree if we are at highest level of Bandit's Guise ( Shallow Insight / Moderate Insight / Deep Insight )
  93. //Spell.Cast("Killing Spree",
  94. // ret => StyxWoW.Me.CurrentEnergy < 30 && StyxWoW.Me.HasAura("Deep Insight") && !StyxWoW.Me.HasAura("Adrenaline Rush")),
  95.  
  96. // Spell.BuffSelf("Blade Flurry",
  97. // ret => Unit.NearbyUnfriendlyUnits.Count(u => u.DistanceSqr < 8 * 8) > 1 &&
  98. // !Unit.NearbyUnfriendlyUnits.Any(u => u.HasMyAura("Blind"))),
  99.  
  100. Spell.Cast("Revealing Strike", ret => StyxWoW.Me.ComboPoints == 4),
  101. Spell.Buff("Rupture", true,
  102. ret => SingularSettings.Instance.Rogue.CombatUseRuptureFinisher && StyxWoW.Me.ComboPoints >= 4 &&
  103. StyxWoW.Me.CurrentTarget.Elite && !StyxWoW.Me.HasAura("Blade Flurry") && StyxWoW.Me.CurrentTarget.HasBleedDebuff()),
  104. Spell.BuffSelf("Slice and Dice",
  105. ret => StyxWoW.Me.RawComboPoints > 0 && StyxWoW.Me.GetAuraTimeLeft("Slice and Dice", true).TotalSeconds < 3),
  106. Spell.Cast("Eviscerate",
  107. ret => StyxWoW.Me.CurrentTarget.HealthPercent < 40 && StyxWoW.Me.ComboPoints >= 2),
  108. Spell.Cast("Eviscerate",
  109. ret => StyxWoW.Me.ComboPoints == 5),
  110. Spell.Cast("Sinister Strike",
  111. ret => StyxWoW.Me.ComboPoints < 4 || !SpellManager.HasSpell("Revealing Strike")),
  112.  
  113. Movement.CreateMoveToMeleeBehavior(true)
  114. );
  115. }
  116.  
  117. #endregion
  118.  
  119. #region Battleground Rotation
  120.  
  121. [Class(WoWClass.Rogue)]
  122. [Spec(TalentSpec.CombatRogue)]
  123. [Behavior(BehaviorType.Pull)]
  124. [Context(WoWContext.Battlegrounds)]
  125. public static Composite CreateCombatRoguePvPPull()
  126. {
  127. return new PrioritySelector(
  128. Safers.EnsureTarget(),
  129. Movement.CreateMoveToLosBehavior(),
  130. Movement.CreateFaceTargetBehavior(),
  131. Spell.BuffSelf("Sprint", ret => StyxWoW.Me.IsMoving && StyxWoW.Me.HasAura("Stealth")),
  132. Spell.BuffSelf("Stealth"),
  133. // Garrote if we can, SS is kinda meh as an opener.
  134. Spell.Cast("Garrote",
  135. ret => StyxWoW.Me.CurrentTarget.MeIsBehind && StyxWoW.Me.CurrentTarget.PowerType == WoWPowerType.Mana),
  136. Spell.Cast("Cheap Shot",
  137. ret => !SpellManager.HasSpell("Garrote") || !StyxWoW.Me.CurrentTarget.MeIsBehind),
  138. Spell.Cast("Ambush", ret => !SpellManager.HasSpell("Cheap Shot") && StyxWoW.Me.CurrentTarget.MeIsBehind),
  139. Spell.Cast("Sinister Strike", ret => !SpellManager.HasSpell("Cheap Shot") && !StyxWoW.Me.CurrentTarget.MeIsBehind),
  140.  
  141. new Decorator(
  142. ret => StyxWoW.Me.CurrentTarget.IsFlying || StyxWoW.Me.CurrentTarget.Distance2DSqr < 5 * 5 && Math.Abs(StyxWoW.Me.Z - StyxWoW.Me.CurrentTarget.Z) >= 5,
  143. new PrioritySelector(
  144. Spell.Cast("Throw", ret => Item.RangedIsType(WoWItemWeaponClass.Thrown)),
  145. Spell.Cast("Shoot", ret => Item.RangedIsType(WoWItemWeaponClass.Bow) || Item.RangedIsType(WoWItemWeaponClass.Gun))
  146. //Spell.Cast("Stealth", ret => StyxWoW.Me.HasAura("Stealth"))
  147. )),
  148.  
  149. Movement.CreateMoveToMeleeBehavior(true)
  150. );
  151. }
  152.  
  153. [Class(WoWClass.Rogue)]
  154. [Spec(TalentSpec.CombatRogue)]
  155. [Behavior(BehaviorType.Combat)]
  156. [Context(WoWContext.Battlegrounds)]
  157. public static Composite CreateCombatRoguePvPCombat()
  158. {
  159. return new PrioritySelector(
  160. Safers.EnsureTarget(),
  161. Movement.CreateMoveToLosBehavior(),
  162. Movement.CreateFaceTargetBehavior(),
  163. new Decorator(
  164. ret => !StyxWoW.Me.HasAura("Vanish"),
  165. Helpers.Common.CreateAutoAttack(true)),
  166. Helpers.Common.CreateInterruptSpellCast(ret => StyxWoW.Me.CurrentTarget),
  167.  
  168. // Defensive
  169. Spell.BuffSelf("Evasion",
  170. ret => Unit.NearbyUnfriendlyUnits.Count(u => u.DistanceSqr < 6 * 6 && u.IsTargetingMeOrPet) >= 1),
  171.  
  172. Spell.BuffSelf("Cloak of Shadows",
  173. ret => Unit.NearbyUnfriendlyUnits.Count(u => u.IsTargetingMeOrPet && u.IsCasting) >= 1),
  174.  
  175. Spell.BuffSelf("Smoke Bomb", ret => StyxWoW.Me.HealthPercent < 15),
  176.  
  177. // Redirect if we have CP left
  178. Spell.Cast("Redirect", ret => StyxWoW.Me.RawComboPoints > 0 && StyxWoW.Me.ComboPoints < 1),
  179.  
  180. Spell.BuffSelf("Adrenaline Rush",
  181. ret => StyxWoW.Me.CurrentEnergy < 20 && !StyxWoW.Me.HasAura("Killing Spree")),
  182.  
  183. // Killing Spree if we are at highest level of Bandit's Guise ( Shallow Insight / Moderate Insight / Deep Insight )
  184. Spell.Cast("Killing Spree",
  185. ret => StyxWoW.Me.CurrentEnergy < 30 && StyxWoW.Me.HasAura("Deep Insight") && !StyxWoW.Me.HasAura("Adrenaline Rush")),
  186.  
  187. // Spell.BuffSelf("Blade Flurry",
  188. // ret => Unit.NearbyUnfriendlyUnits.Count(u => u.DistanceSqr < 8 * 8) > 1),
  189.  
  190. Spell.Cast("Revealing Strike", ret => StyxWoW.Me.ComboPoints == 4),
  191. Spell.Buff("Rupture", true,
  192. ret => SingularSettings.Instance.Rogue.CombatUseRuptureFinisher && StyxWoW.Me.ComboPoints >= 4 &&
  193. !StyxWoW.Me.HasAura("Blade Flurry") && StyxWoW.Me.CurrentTarget.HasBleedDebuff()),
  194. Spell.BuffSelf("Slice and Dice",
  195. ret => StyxWoW.Me.RawComboPoints > 0 && StyxWoW.Me.GetAuraTimeLeft("Slice and Dice", true).TotalSeconds < 3),
  196. Spell.Cast("Eviscerate",
  197. ret => StyxWoW.Me.CurrentTarget.HealthPercent <= 30 && StyxWoW.Me.ComboPoints >= 3),
  198. Spell.Cast("Kidney Shot",
  199. ret => StyxWoW.Me.ComboPoints == 5 && !StyxWoW.Me.CurrentTarget.IsStunned()),
  200. Spell.Cast("Eviscerate",
  201. ret => StyxWoW.Me.ComboPoints == 5),
  202. Spell.Cast("Sinister Strike",
  203. ret => StyxWoW.Me.ComboPoints < 4 || !SpellManager.HasSpell("Revealing Strike")),
  204.  
  205. Movement.CreateMoveToMeleeBehavior(true)
  206. );
  207. }
  208.  
  209. #endregion
  210.  
  211. #region Instance Rotation
  212.  
  213. [Class(WoWClass.Rogue)]
  214. [Spec(TalentSpec.CombatRogue)]
  215. [Behavior(BehaviorType.Pull)]
  216. [Context(WoWContext.Instances)]
  217. public static Composite CreateCombatRogueInstancePull()
  218. {
  219. return new PrioritySelector(
  220.  
  221. Spell.Cast("Throw", ret => Item.RangedIsType(WoWItemWeaponClass.Thrown)),
  222. Spell.Cast("Shoot", ret => Item.RangedIsType(WoWItemWeaponClass.Bow) || Item.RangedIsType(WoWItemWeaponClass.Gun))
  223.  
  224. );
  225. }
  226.  
  227. [Class(WoWClass.Rogue)]
  228. [Spec(TalentSpec.CombatRogue)]
  229. [Behavior(BehaviorType.Combat)]
  230. [Context(WoWContext.Instances)]
  231. public static Composite CreateCombatRogueInstanceCombat()
  232. {
  233. return new PrioritySelector(
  234. //Safers.EnsureTarget(),
  235. //Movement.CreateMoveToLosBehavior(),
  236. //Movement.CreateFaceTargetBehavior(),
  237. new Decorator(
  238. ret => !StyxWoW.Me.HasAura("Vanish"),
  239. Helpers.Common.CreateAutoAttack(true)),
  240. Helpers.Common.CreateInterruptSpellCast(ret => StyxWoW.Me.CurrentTarget),
  241.  
  242. // Defensive
  243. Spell.BuffSelf("Evasion",
  244. ret => Unit.NearbyUnfriendlyUnits.Count(u => u.DistanceSqr < 6 * 6 && u.IsTargetingMeOrPet) >= 1),
  245.  
  246. Spell.BuffSelf("Cloak of Shadows",
  247. ret => Unit.NearbyUnfriendlyUnits.Count(u => u.IsTargetingMeOrPet && u.IsCasting) >= 1),
  248.  
  249. // Redirect if we have CP left
  250. Spell.Cast("Redirect", ret => StyxWoW.Me.RawComboPoints > 0 && StyxWoW.Me.ComboPoints < 1),
  251.  
  252. // Agro management
  253. Spell.Cast(
  254. "Tricks of the Trade",
  255. ret => Common.BestTricksTarget,
  256. ret => SingularSettings.Instance.Rogue.UseTricksOfTheTrade),
  257.  
  258. Spell.Cast("Feint", ret => StyxWoW.Me.CurrentTarget.ThreatInfo.RawPercent > 80),
  259.  
  260. Movement.CreateMoveBehindTargetBehavior(),
  261.  
  262. new Decorator(
  263. ret => Unit.NearbyUnfriendlyUnits.Count(u => u.DistanceSqr < 8 * 8) >= 3,
  264. Spell.BuffSelf("Fan of Knives", ret => Item.RangedIsType(WoWItemWeaponClass.Thrown))),
  265.  
  266. Spell.BuffSelf("Adrenaline Rush",
  267. ret => StyxWoW.Me.CurrentEnergy < 20 && !StyxWoW.Me.HasAura("Killing Spree")),
  268.  
  269. // Killing Spree if we are at highest level of Bandit's Guise ( Shallow Insight / Moderate Insight / Deep Insight )
  270. //Spell.Cast("Killing Spree",
  271. // ret => StyxWoW.Me.CurrentEnergy < 30 && StyxWoW.Me.HasAura("Deep Insight") && !StyxWoW.Me.HasAura("Adrenaline Rush")),
  272.  
  273. // Spell.BuffSelf("Blade Flurry",
  274. // ret => Unit.NearbyUnfriendlyUnits.Count(u => u.DistanceSqr < 8*8) > 1),
  275.  
  276. Spell.Cast("Revealing Strike", ret => StyxWoW.Me.ComboPoints == 4),
  277. Spell.Buff("Rupture", true,
  278. ret => SingularSettings.Instance.Rogue.CombatUseRuptureFinisher && StyxWoW.Me.ComboPoints >= 4 &&
  279. !StyxWoW.Me.HasAura("Blade Flurry") && StyxWoW.Me.CurrentTarget.HasBleedDebuff()),
  280. Spell.BuffSelf("Slice and Dice",
  281. ret => StyxWoW.Me.RawComboPoints > 0 && StyxWoW.Me.GetAuraTimeLeft("Slice and Dice", true).TotalSeconds < 3),
  282. Spell.Cast("Eviscerate",
  283. ret => StyxWoW.Me.ComboPoints == 5),
  284. Spell.Cast("Sinister Strike",
  285. ret => StyxWoW.Me.ComboPoints < 4 || !SpellManager.HasSpell("Revealing Strike")),
  286.  
  287. Movement.CreateMoveToMeleeBehavior(true)
  288. );
  289. }
  290.  
  291. #endregion
  292. }
  293. }
Advertisement
Add Comment
Please, Sign In to add comment