using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using ReBot.API; using RogueCommon; namespace geReBot { [Rotation("Rogue Combat223", "asd", WoWClass.Rogue, Specialization.RogueCombat, 5, 25)] public class RogueCombat : CombatRotation { [JsonProperty("Poison1"), JsonConverter(typeof(StringEnumConverter))] public Poison Poison1 = Poison.DeadlyPoison; [JsonProperty("Poison2"), JsonConverter(typeof(StringEnumConverter))] public Poison Poison2 = Poison.CripplingPoison; bool needToStartAttack = false; public RogueCombat() { } public override bool OutOfCombat() { if (CastSelf("Recuperate", () => Me.HealthFraction < 0.8 && Me.GetPower(WoWPowerType.Energy) >= 30 && Me.ComboPoints > 0 && Me.ComboPoints * 6 > AuraTimeRemaining("Recuperate"))) return true; if (CastSelf("Slice and Dice", () => !HasAura("Slice and Dice"))) return true; //dispell CastSelf("Cloak of Shadows", () => Me.Auras.Any(x => x.IsDebuff && x.DebuffType.Contains("magic"))); // Poisons if (this.CastPoison(Poison1)) return true; if (this.CastPoison(Poison2)) return true; return false; } public override void Combat() { if (needToStartAttack) { needToStartAttack = false; Me.StartAttack(); } //if (Cast("Redirect", () => Me.ComboPoints > 0 && Target.HealthFraction == 1)) return; List 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; } 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") && !HasAura("Burst of Speed"))) return; if (CastSelf("Burst of Speed", () => !HasAura("Sprint") && !HasAura("Burst of Speed"))) return; if (Cast("Shadowstep", () => !HasAura("Sprint"))) return; if (CastSelfPreventDouble("Shadow Walk")) return; } } else { if (HasSpell("Gouge") && Me.GetPower(WoWPowerType.Energy) >= 45) { UnitObject fistAdd = addsInRange.FirstOrDefault(); if (fistAdd != null) if (CastPreventDouble("Gouge", null, fistAdd, 5000)) { needToStartAttack = true; return; } } if (HasSpell("Kick")) { UnitObject castingAddInRange = addsInRange.FirstOrDefault(x => x.IsCasting); if (castingAddInRange != null) Cast("Kick", null, castingAddInRange); } if (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("Shadow Blades"); CastSelf("Combat Readiness", () => Me.HpLessThanOrElite(0.85) && !Target.HasPower(WoWPowerType.Mana)); CastSelf("Cloak of Shadows", () => Me.HealthFraction <= 0.75 && Target.IsCasting); CastSelf("Evasion", () => Me.HpLessThanOrElite(0.6)); CastSelf("Smoke Bomb", () => Me.HealthFraction <= 0.5); Cast("Kick", () => Target.IsCastingAndInterruptible()); CastSelf("Preparation", () => HasSpell("Evasion") && SpellCooldown("Evasion") > 0 && !HasAura("Evasion") && Me.HealthFraction < 0.5); if (Cast("Dismantle", () => Target.IsPlayer && ((PlayerObject) Target).IsMelee)) return; if (addsInRange.Count > 0 && addsInRange.Count <= 4) { 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 > 2 && Me.GetPower(WoWPowerType.Energy) >= 30 && !HasAura("Recuperate"))) return; if (CastSelf("Slice and Dice", () => Me.ComboPoints >= 2 && Me.GetPower(WoWPowerType.Energy) >= 25 && !HasAura("Slice and Dice"))) return; if (HasSpell("Crimson Tempest") && addsInRange.Count > 4) { if (CastSelf("Crimson Tempest", () => Me.ComboPoints >= 2 && Me.GetPower(WoWPowerType.Energy) >= 25)) return; } else { if (Cast("Eviscerate", () => Me.GetPower(WoWPowerType.Energy) >= 35 && (Me.ComboPoints > 2 || Me.ComboPoints == 2 && Target.HealthFraction <= 0.4))) return; } if (Cast("Revealing Strike", () => Me.GetPower(WoWPowerType.Energy) >= 40 && !Target.HasAura("Revealing Strike"))) return; if (addsInRange.Count > 0) { if (Cast("Fan of Knives", () => Me.GetPower(WoWPowerType.Energy) >= 35)) return; } Cast("Sinister Strike", () => Me.GetPower(WoWPowerType.Energy) >= 40); } else { if (CastSelf("Sprint", () => !HasAura("Sprint") && !HasAura("Burst of Speed"))) return; if (CastSelf("Burst of Speed", () => !HasAura("Sprint") && !HasAura("Burst of Speed"))) return; if (CastSelfPreventDouble("Stealth", () => !Me.InCombat && Target.CombatRange <= RotationInfo.DismountRange && !HasAura("Stealth"))) return; if (Cast("Shadowstep", () => !HasAura("Sprint"))) return; } } } public override bool AfterCombat() { //if (CastSelf("Recuperate", () => Me.HealthFraction < 0.9 && Me.GetPower(WoWPowerType.Energy) >= 30 && Me.ComboPoints > 0)) return true; //if (CastSelf("Slice and Dice", () => Me.ComboPoints > 0 && Me.GetPower(WoWPowerType.Energy) >= 25)) return true; return false; } } }