Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using System.Linq;
- using Newtonsoft.Json;
- using Newtonsoft.Json.Converters;
- using DickButt.API;
- using RogueCommon;
- namespace DickButt
- {
- [Rotation("Rogue Combat PvE by Jezza (A.K.A error)", "DickButt", WoWClass.Rogue, Specialization.RogueCombat, 5, 25)]
- public class RogueCombatJezzaPvE : CombatRotation
- {
- //TODO: make Instant Poison work
- [JsonProperty("Use Kick")]
- public bool UseKick = true;
- [JsonProperty("Use Gouge")]
- public bool UseGouge = true;
- [JsonProperty("Use Blind")]
- public bool UseBlind = true;
- [JsonProperty("Use Shadowstep")]
- public bool UseShadowstep = true;
- [JsonProperty("Vanish whenever possible")]
- public bool VanishWheneverPossible = true;
- [JsonProperty("Use Kidney Shot")]
- public bool UseKidneyShot = true;
- [JsonProperty("Use Recouperate")]
- public bool UseRecouperate = true;
- [JsonProperty("Use Cloak of Shadows")]
- public bool UseCloak = true;
- //[JsonProperty("Poison1"), JsonConverter(typeof(StringEnumConverter))]
- //public Poison Poison1 = Poison.DeadlyPoison;
- //public Poison Poison1 = Poison.InstantPoison;
- [JsonProperty("Poison2"), JsonConverter(typeof(StringEnumConverter))]
- public Poison Poison2 = Poison.CripplingPoison;
- bool needToStartAttack = false;
- public RogueCombatJezzaPvE()
- {
- if (HasAura("Stealth"))
- PullSpells = new string[]
- {
- "Cheap Shot",
- };
- else
- PullSpells = new string[]
- {
- "Sinister Strike",
- //"Throw",
- };
- }
- public override bool OutOfCombat()
- {
- if (CastSelf("Recuperate", () => UseRecouperate && Me.HealthFraction < 0.8 && Me.GetPower(WoWPowerType.Energy) >= 30 && Me.ComboPoints > 0 && Me.ComboPoints * 6 > AuraTimeRemaining("Recuperate"))) return true;
- if (CastSelf("Slice and Dice", () => Me.GetPower(WoWPowerType.Energy) >= 25 && Me.ComboPoints > 0 && Me.ComboPoints * 6 + 6 > AuraTimeRemaining("Slice and Dice"))) return true;
- //dispell
- CastSelf("Cloak of Shadows", () => UseCloak && Me.Auras.Any(x => x.IsDebuff && x.DebuffType.Contains("magic")));
- // Poisons
- if (HasSpell("Instant Poison"))
- {
- if (CastSelfPreventDouble("Instant Poison", () => !HasAura("Instant Poison")))
- {
- return true;
- }
- }
- else if (HasSpell("Deadly Poison"))
- {
- if (CastSelfPreventDouble("Deadly Poison", () => !HasAura("Deadly Poison")))
- {
- return true;
- }
- }
- if (this.CastPoison(Poison2)) return true;
- //stealth if possible
- if (this.CastSelf("Stealth")){
- Me.PreventMounting = true;
- return true;
- }
- return false;
- }
- public override void Combat()
- {
- if (needToStartAttack)
- {
- needToStartAttack = false;
- Me.StartAttack();
- }
- List<UnitObject> addsInRange = Adds.Where(x => x.IsInCombatRangeAndLoS).ToList();
- // in stealth
- if (HasAura("Stealth"))
- {
- if (HasSpell("Sap") && Me.GetPower(WoWPowerType.Energy) >= 35)
- {
- UnitObject add = addsInRange.FirstOrDefault(x => !x.InCombat && x.GetUnitCreatureType() == WoWUnitCreatureType.Humanoid);
- if (add != null)
- if (CastPreventDouble("Sap", null, add, 10 * 1000)) return;
- }
- if(HasSpell("Premeditation"))
- {
- Cast("Premeditation", () => Me.ComboPoints <= 2);
- }
- if (Target.IsInCombatRangeAndLoS)
- {
- if (Cast("Ambush", () => Me.GetPower(WoWPowerType.Energy) >= 60)) return;
- if (Cast("Garrote")) return;
- if (Cast("Cheap Shot")) return;
- // if we can't use one from above
- if (Cast("Sinister Strike", () => Me.GetPower(WoWPowerType.Energy) >= 60)) return;
- }
- else
- {
- if (CastSelf("Sprint", () => !HasAura("Sprint"))) return;
- if (UseShadowstep)
- {
- if (Cast("Shadowstep", () => !HasAura("Sprint"))) return;
- }
- if (CastSelfPreventDouble("Shadow Walk")) return;
- }
- }
- else
- {
- if (UseGouge && HasSpell("Gouge") && Me.GetPower(WoWPowerType.Energy) >= 45)
- {
- UnitObject fistAdd = addsInRange.FirstOrDefault();
- if (fistAdd != null)
- if (CastPreventDouble("Gouge", null, fistAdd, 5000))
- {
- needToStartAttack = true;
- return;
- }
- }
- if (UseBlind && HasSpell("Blind") && Me.HealthFraction < 0.5 && Me.GetPower(WoWPowerType.Energy) >= 15)
- {
- UnitObject blindAdd = Adds.FirstOrDefault(x => x.DistanceSquared <= 15 * 15 && !x.IsInCombatRangeAndLoS);
- if (blindAdd != null)
- Cast("Blind", null, blindAdd);
- }
- if (Target.IsInCombatRangeAndLoS)
- {
- CastSelf("Combat Readiness", () => Me.HpLessThanOrElite(0.85) && !Target.HasPower(WoWPowerType.Mana));
- CastSelf("Cloak of Shadows", () => UseCloak && Me.HealthFraction <= 0.75 && Target.IsCasting);
- CastSelf("Evasion", () => Me.HpLessThanOrElite(0.6));
- CastSelf("Smoke Bomb", () => Me.HealthFraction <= 0.5);
- if(CastSelf("Vanish", () => Me.HealthFraction <= 0.15))
- {
- //DisableCombat = true;
- return;
- }
- Cast("Kick", () => Target.IsCastingAndInterruptible() && UseKick);
- if(VanishWheneverPossible)
- {
- if(CastSelf("Vanish")) return;
- }
- CastSelf("Preparation", () => HasSpell("Evasion") && SpellCooldown("Evasion") > 0 && !HasAura("Evasion") && Me.HealthFraction < 0.5);
- if (addsInRange.Count > 0)
- {
- if (Cast("Blade Flurry", () => !HasAura("Blade Flurry"))) return;
- }
- else
- {
- //disable bladeflurry
- if (Cast("Blade Flurry", () => HasAura("Blade Flurry"))) return;
- }
- if (CastSelf("Recuperate", () => Me.HealthFraction < 0.75 && Me.ComboPoints > 3 && Me.GetPower(WoWPowerType.Energy) >= 30 && !HasAura("Recuperate"))) return;
- if (Cast("Shadow Reflection")) return;
- if (Cast("Killing Spree")) return;
- if (Cast("Adrenaline Rush", () => !HasAura("Killing Spree"))) return;
- //if (CastSelf("Slice and Dice", () => (Me.ComboPoints >= 2) && (Me.GetPower(WoWPowerType.Energy) >= 25 && !HasAura("Slice and Dice")))) return;
- if (CastSelf("Slice and Dice", () => Me.ComboPoints >= 2 && Me.GetPower(WoWPowerType.Energy) >= 25 && AuraTimeRemaining("Slice and Dice") < 10)) return;
- if (HasSpell("Crimson Tempest") && addsInRange.Count > 3)
- {
- if (CastSelf("Crimson Tempest", () => Me.ComboPoints >= 2 && AuraTimeRemaining("Crimson Tempest") < 4 && Me.GetPower(WoWPowerType.Energy) >= 25)) return;
- }
- else if (HasSpell("Crimson Tempest") && addsInRange.Count > 4)
- {
- if (CastSelf("Crimson Tempest", () => Me.ComboPoints >= 4 && Me.GetPower(WoWPowerType.Energy) >= 25)) return;
- }
- else
- {
- if (Cast("Eviscerate", () => Me.GetPower(WoWPowerType.Energy) >= 35 &&
- (Me.ComboPoints > 4))) return;
- }
- if (Cast("Revealing Strike", () => Me.GetPower(WoWPowerType.Energy) >= 40 && !Target.HasAura("Revealing Strike", true))) return;
- if(UseKidneyShot)
- {
- if (Cast("Kidney Shot", () => Me.GetPower(WoWPowerType.Energy) >= 25 && (Me.ComboPoints > 4) && !Target.HasAura("Kidney Shot"))) return;
- }
- if (HasAura("Instant Poison") && Cast("Shiv", () => Me.HealthFraction < 0.75 && Me.GetPower(WoWPowerType.Energy) >= 20 && SpellCooldown("Shiv") == 0)) return;
- Cast("Sinister Strike", () => Me.GetPower(WoWPowerType.Energy) >= 40);
- }
- else
- {
- if (CastSelf("Sprint", () => !HasAura("Sprint"))) return;
- if (CastSelfPreventDouble("Stealth", () => !Me.InCombat && Target.CombatRange <= RotationInfo.DismountRange && !HasAura("Stealth"))) return;
- if (Cast("Shadowstep", () => UseShadowstep && !HasAura("Sprint"))) return;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement