Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.03 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using Newtonsoft.Json;
  4. using Newtonsoft.Json.Converters;
  5. using DickButt.API;
  6. using RogueCommon;
  7.  
  8. namespace DickButt
  9. {
  10. [Rotation("Rogue Combat PvE by Jezza (A.K.A error)", "DickButt", WoWClass.Rogue, Specialization.RogueCombat, 5, 25)]
  11.  
  12. public class RogueCombatJezzaPvE : CombatRotation
  13. {
  14. //TODO: make Instant Poison work
  15. [JsonProperty("Use Kick")]
  16. public bool UseKick = true;
  17. [JsonProperty("Use Gouge")]
  18. public bool UseGouge = true;
  19. [JsonProperty("Use Blind")]
  20. public bool UseBlind = true;
  21. [JsonProperty("Use Shadowstep")]
  22. public bool UseShadowstep = true;
  23. [JsonProperty("Vanish whenever possible")]
  24. public bool VanishWheneverPossible = true;
  25. [JsonProperty("Use Kidney Shot")]
  26. public bool UseKidneyShot = true;
  27. [JsonProperty("Use Recouperate")]
  28. public bool UseRecouperate = true;
  29. [JsonProperty("Use Cloak of Shadows")]
  30. public bool UseCloak = true;
  31.  
  32.  
  33. //[JsonProperty("Poison1"), JsonConverter(typeof(StringEnumConverter))]
  34. //public Poison Poison1 = Poison.DeadlyPoison;
  35. //public Poison Poison1 = Poison.InstantPoison;
  36. [JsonProperty("Poison2"), JsonConverter(typeof(StringEnumConverter))]
  37. public Poison Poison2 = Poison.CripplingPoison;
  38.  
  39. bool needToStartAttack = false;
  40.  
  41. public RogueCombatJezzaPvE()
  42. {
  43. if (HasAura("Stealth"))
  44. PullSpells = new string[]
  45. {
  46. "Cheap Shot",
  47. };
  48. else
  49. PullSpells = new string[]
  50. {
  51. "Sinister Strike",
  52. //"Throw",
  53. };
  54. }
  55.  
  56. public override bool OutOfCombat()
  57. {
  58. if (CastSelf("Recuperate", () => UseRecouperate && Me.HealthFraction < 0.8 && Me.GetPower(WoWPowerType.Energy) >= 30 && Me.ComboPoints > 0 && Me.ComboPoints * 6 > AuraTimeRemaining("Recuperate"))) return true;
  59. if (CastSelf("Slice and Dice", () => Me.GetPower(WoWPowerType.Energy) >= 25 && Me.ComboPoints > 0 && Me.ComboPoints * 6 + 6 > AuraTimeRemaining("Slice and Dice"))) return true;
  60.  
  61. //dispell
  62. CastSelf("Cloak of Shadows", () => UseCloak && Me.Auras.Any(x => x.IsDebuff && x.DebuffType.Contains("magic")));
  63.  
  64. // Poisons
  65. if (HasSpell("Instant Poison"))
  66. {
  67. if (CastSelfPreventDouble("Instant Poison", () => !HasAura("Instant Poison")))
  68. {
  69. return true;
  70. }
  71. }
  72. else if (HasSpell("Deadly Poison"))
  73. {
  74. if (CastSelfPreventDouble("Deadly Poison", () => !HasAura("Deadly Poison")))
  75. {
  76. return true;
  77. }
  78. }
  79. if (this.CastPoison(Poison2)) return true;
  80.  
  81. //stealth if possible
  82. if (this.CastSelf("Stealth")){
  83. Me.PreventMounting = true;
  84. return true;
  85. }
  86.  
  87.  
  88. return false;
  89. }
  90.  
  91. public override void Combat()
  92. {
  93. if (needToStartAttack)
  94. {
  95. needToStartAttack = false;
  96. Me.StartAttack();
  97. }
  98.  
  99. List<UnitObject> addsInRange = Adds.Where(x => x.IsInCombatRangeAndLoS).ToList();
  100.  
  101. // in stealth
  102. if (HasAura("Stealth"))
  103. {
  104. if (HasSpell("Sap") && Me.GetPower(WoWPowerType.Energy) >= 35)
  105. {
  106. UnitObject add = addsInRange.FirstOrDefault(x => !x.InCombat && x.GetUnitCreatureType() == WoWUnitCreatureType.Humanoid);
  107. if (add != null)
  108. if (CastPreventDouble("Sap", null, add, 10 * 1000)) return;
  109. }
  110.  
  111. if(HasSpell("Premeditation"))
  112. {
  113. Cast("Premeditation", () => Me.ComboPoints <= 2);
  114. }
  115.  
  116. if (Target.IsInCombatRangeAndLoS)
  117. {
  118. if (Cast("Ambush", () => Me.GetPower(WoWPowerType.Energy) >= 60)) return;
  119. if (Cast("Garrote")) return;
  120. if (Cast("Cheap Shot")) return;
  121.  
  122. // if we can't use one from above
  123. if (Cast("Sinister Strike", () => Me.GetPower(WoWPowerType.Energy) >= 60)) return;
  124. }
  125. else
  126. {
  127. if (CastSelf("Sprint", () => !HasAura("Sprint"))) return;
  128. if (UseShadowstep)
  129. {
  130. if (Cast("Shadowstep", () => !HasAura("Sprint"))) return;
  131. }
  132. if (CastSelfPreventDouble("Shadow Walk")) return;
  133. }
  134. }
  135. else
  136. {
  137. if (UseGouge && HasSpell("Gouge") && Me.GetPower(WoWPowerType.Energy) >= 45)
  138. {
  139. UnitObject fistAdd = addsInRange.FirstOrDefault();
  140. if (fistAdd != null)
  141. if (CastPreventDouble("Gouge", null, fistAdd, 5000))
  142. {
  143. needToStartAttack = true;
  144. return;
  145. }
  146. }
  147. if (UseBlind && HasSpell("Blind") && Me.HealthFraction < 0.5 && Me.GetPower(WoWPowerType.Energy) >= 15)
  148. {
  149. UnitObject blindAdd = Adds.FirstOrDefault(x => x.DistanceSquared <= 15 * 15 && !x.IsInCombatRangeAndLoS);
  150. if (blindAdd != null)
  151. Cast("Blind", null, blindAdd);
  152. }
  153.  
  154. if (Target.IsInCombatRangeAndLoS)
  155. {
  156. CastSelf("Combat Readiness", () => Me.HpLessThanOrElite(0.85) && !Target.HasPower(WoWPowerType.Mana));
  157. CastSelf("Cloak of Shadows", () => UseCloak && Me.HealthFraction <= 0.75 && Target.IsCasting);
  158. CastSelf("Evasion", () => Me.HpLessThanOrElite(0.6));
  159. CastSelf("Smoke Bomb", () => Me.HealthFraction <= 0.5);
  160. if(CastSelf("Vanish", () => Me.HealthFraction <= 0.15))
  161. {
  162. //DisableCombat = true;
  163. return;
  164. }
  165. Cast("Kick", () => Target.IsCastingAndInterruptible() && UseKick);
  166. if(VanishWheneverPossible)
  167. {
  168. if(CastSelf("Vanish")) return;
  169. }
  170. CastSelf("Preparation", () => HasSpell("Evasion") && SpellCooldown("Evasion") > 0 && !HasAura("Evasion") && Me.HealthFraction < 0.5);
  171.  
  172. if (addsInRange.Count > 0)
  173. {
  174. if (Cast("Blade Flurry", () => !HasAura("Blade Flurry"))) return;
  175. }
  176. else
  177. {
  178. //disable bladeflurry
  179. if (Cast("Blade Flurry", () => HasAura("Blade Flurry"))) return;
  180. }
  181.  
  182. if (CastSelf("Recuperate", () => Me.HealthFraction < 0.75 && Me.ComboPoints > 3 && Me.GetPower(WoWPowerType.Energy) >= 30 && !HasAura("Recuperate"))) return;
  183.  
  184. if (Cast("Shadow Reflection")) return;
  185. if (Cast("Killing Spree")) return;
  186.  
  187. if (Cast("Adrenaline Rush", () => !HasAura("Killing Spree"))) return;
  188.  
  189. //if (CastSelf("Slice and Dice", () => (Me.ComboPoints >= 2) && (Me.GetPower(WoWPowerType.Energy) >= 25 && !HasAura("Slice and Dice")))) return;
  190.  
  191. if (CastSelf("Slice and Dice", () => Me.ComboPoints >= 2 && Me.GetPower(WoWPowerType.Energy) >= 25 && AuraTimeRemaining("Slice and Dice") < 10)) return;
  192.  
  193. if (HasSpell("Crimson Tempest") && addsInRange.Count > 3)
  194. {
  195. if (CastSelf("Crimson Tempest", () => Me.ComboPoints >= 2 && AuraTimeRemaining("Crimson Tempest") < 4 && Me.GetPower(WoWPowerType.Energy) >= 25)) return;
  196. }
  197. else if (HasSpell("Crimson Tempest") && addsInRange.Count > 4)
  198. {
  199. if (CastSelf("Crimson Tempest", () => Me.ComboPoints >= 4 && Me.GetPower(WoWPowerType.Energy) >= 25)) return;
  200. }
  201. else
  202. {
  203. if (Cast("Eviscerate", () => Me.GetPower(WoWPowerType.Energy) >= 35 &&
  204. (Me.ComboPoints > 4))) return;
  205. }
  206.  
  207. if (Cast("Revealing Strike", () => Me.GetPower(WoWPowerType.Energy) >= 40 && !Target.HasAura("Revealing Strike", true))) return;
  208.  
  209. if(UseKidneyShot)
  210. {
  211. if (Cast("Kidney Shot", () => Me.GetPower(WoWPowerType.Energy) >= 25 && (Me.ComboPoints > 4) && !Target.HasAura("Kidney Shot"))) return;
  212. }
  213.  
  214. if (HasAura("Instant Poison") && Cast("Shiv", () => Me.HealthFraction < 0.75 && Me.GetPower(WoWPowerType.Energy) >= 20 && SpellCooldown("Shiv") == 0)) return;
  215.  
  216. Cast("Sinister Strike", () => Me.GetPower(WoWPowerType.Energy) >= 40);
  217. }
  218. else
  219. {
  220. if (CastSelf("Sprint", () => !HasAura("Sprint"))) return;
  221. if (CastSelfPreventDouble("Stealth", () => !Me.InCombat && Target.CombatRange <= RotationInfo.DismountRange && !HasAura("Stealth"))) return;
  222.  
  223. if (Cast("Shadowstep", () => UseShadowstep && !HasAura("Sprint"))) return;
  224. }
  225. }
  226. }
  227.  
  228. }
  229. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement