protected override Composite CreateBehavior() { return(_root ?? (_root = new PrioritySelector( new Decorator(ret => (me.QuestLog.GetQuestById(14243) != null && me.QuestLog.GetQuestById(14243).IsCompleted), new Sequence( new Action(ret => TreeRoot.StatusText = "Finished!"), new Action(ret => Lua.DoString("VehicleExit()")), new Action(ret => Thread.Sleep(15000)), new WaitContinue(120, new Action(delegate { _isDone = true; return RunStatus.Success; })) )), new Decorator(ret => mobList.Count > 0, new Sequence( new Action(ret => TreeRoot.StatusText = "Bombing - " + mobList[0].Name), new Action(ret => Lua.DoString("RunMacroText('/click VehicleMenuBarActionButton1','0')")), new Action(ret => LegacySpellManager.ClickRemoteLocation(mobList[0].Location)), new Action(ret => Thread.Sleep(2000)) ) ) ) )); }
public override void Pull() { int Toggle = Lua.GetReturnVal <int>("return Toggle and 0 or 1", 0); if (Toggle != 1) { return; } Target = Me.CurrentTarget; if (!Me.GotTarget || !Me.CurrentTarget.IsAlive) { SeekTarget(); } else { cctc(Target, "Attack"); if (Target.Distance > 8d && Target.Distance < 40) { if (CanCast("Charge")) { Cast("Charge"); //Thread.Sleep(150); } else if (CanCast("Heroic Leap") && Charge.CooldownTimeLeft.Seconds > 0 && Charge.CooldownTimeLeft.Seconds < 8) { SpellManager.Cast("Heroic Leap"); LegacySpellManager.ClickRemoteLocation(StyxWoW.Me.CurrentTarget.Location); } } cctc(Target, "Heroic Throw"); Move(Me.CurrentTarget.Location); } }
public static Composite CreateHunterTrapOnAddBehavior(string trapName) { return(new PrioritySelector( ctx => Unit.NearbyUnfriendlyUnits.OrderBy(u => u.DistanceSqr). FirstOrDefault( u => u.Combat && u != StyxWoW.Me.CurrentTarget && (!u.IsMoving || u.IsPlayer) && u.DistanceSqr < 40 * 40), new Decorator( ret => ret != null && SpellManager.HasSpell(trapName) && !SpellManager.Spells[trapName].Cooldown, new PrioritySelector( Spell.BuffSelf("Trap Launcher"), new Decorator( ret => StyxWoW.Me.HasAura("Trap Launcher"), new Sequence( new Switch <string>(ctx => trapName, new SwitchArgument <string>("Immolation Trap", new Action(ret => LegacySpellManager.CastSpellById(82945))), new SwitchArgument <string>("Freezing Trap", new Action(ret => LegacySpellManager.CastSpellById(60192))), new SwitchArgument <string>("Explosive Trap", new Action(ret => LegacySpellManager.CastSpellById(82939))), new SwitchArgument <string>("Ice Trap", new Action(ret => LegacySpellManager.CastSpellById(82941))), new SwitchArgument <string>("Snake Trap", new Action(ret => LegacySpellManager.CastSpellById(82948))) ), new ActionSleep(200), new Action(ret => LegacySpellManager.ClickRemoteLocation(((WoWUnit)ret).Location)))))))); }
public static Composite CreateHunterTrapBehavior(string trapName, bool useLauncher, UnitSelectionDelegate onUnit) { return(new PrioritySelector( new Decorator( ret => onUnit != null && onUnit(ret) != null && onUnit(ret).DistanceSqr < 40 * 40 && SpellManager.HasSpell(trapName) && !SpellManager.Spells[trapName].Cooldown, new PrioritySelector( Spell.BuffSelf(trapName, ret => !useLauncher), Spell.BuffSelf("Trap Launcher", ret => useLauncher), new Decorator( ret => StyxWoW.Me.HasAura("Trap Launcher"), new Sequence( new Switch <string>(ctx => trapName, new SwitchArgument <string>("Immolation Trap", new Action(ret => LegacySpellManager.CastSpellById(82945))), new SwitchArgument <string>("Freezing Trap", new Action(ret => LegacySpellManager.CastSpellById(60192))), new SwitchArgument <string>("Explosive Trap", new Action(ret => LegacySpellManager.CastSpellById(82939))), new SwitchArgument <string>("Ice Trap", new Action(ret => LegacySpellManager.CastSpellById(82941))), new SwitchArgument <string>("Snake Trap", new Action(ret => LegacySpellManager.CastSpellById(82948))) ), new ActionSleep(200), new Action(ret => LegacySpellManager.ClickRemoteLocation(onUnit(ret).Location)))))))); }
private Composite CreateArmsCloseGap() { return (new PrioritySelector( //Moves to target if you are too close(Fixes pull bug) new Decorator( ret => Me.CurrentTarget.Distance < 10 || Me.CurrentTarget.Distance > 25, new PrioritySelector( CreateMoveToAndFace(ret => Me.CurrentTarget) )), //Charge CreateSpellCast("Charge", ret => Me.CurrentTarget.Distance >= 9), //Heroic Leap new Decorator( ret => SpellManager.CanCast("Heroic Leap") && Me.CurrentTarget.Distance > 9 && !Me.CurrentTarget.HasAura("Charge Stun"), new Action( ret => { SpellManager.Cast("Heroic Leap"); LegacySpellManager.ClickRemoteLocation(Me.CurrentTarget.Location); })), //Heroic Throw if not already Intercepting CreateSpellCast("Heroic Throw", ret => !Me.CurrentTarget.HasAura("Charge Stun")), //Worgen Racial CreateSpellCast( "Darkflight", ret => Me.CurrentTarget.IsPlayer && Me.CurrentTarget.Distance > 15), //Move to mele and face CreateMoveToAndFace(ret => Me.CurrentTarget) )); }
private static bool HealingRain(WoWUnit healTarget) { if (!SpellManager.HasSpell("Healing Rain")) { return(false); } if (_me.ManaPercent < cfg.EmergencyManaPercent && !_me.Auras.ContainsKey("Clearcasting")) { return(false); } if (!WillHealingRainCover(healTarget, 4)) { return(false); } if (Safe_CastSpell("Healing Rain", SpellRange.Check, SpellWait.Complete)) { if (!LegacySpellManager.ClickRemoteLocation(healTarget.Location)) { Dlog("^Ranged AoE Click FAILED: cancelling Healing Rain"); SpellManager.StopCasting(); } else { Dlog("^Ranged AoE Click successful: LET IT RAIN!!!"); StyxWoW.SleepForLagDuration(); return(true); } } return(false); }
protected Composite CreateCastPetActionOnLocation(string action, LocationRetrievalDelegate location, SimpleBoolReturnDelegate extra) { return(new Decorator( ret => extra(ret) && PetManager.CanCastPetAction(action), new Sequence( new Action(ret => PetManager.CastPetAction(action)), new Action(ret => LegacySpellManager.ClickRemoteLocation(location(ret)))))); }
// Distract public void Distract() { WoWPoint distractPoint = WoWMovement.CalculatePointFrom(Me.CurrentTarget.Location, -4.0f); SpellManager.Cast("Distract"); LegacySpellManager.ClickRemoteLocation(distractPoint); slog("Skill: Distract"); }
public RunStatus AoE(string Spellnames, WoWPoint Location) { Log("Casting {0}", Spellnames.ToString()); SpellManager.Cast(Spellnames); LastCast = SpellManager.Spells[Spellnames].Id; Thread.Sleep(500); LegacySpellManager.ClickRemoteLocation(Location); return(RunStatus.Success); }
/// <summary> /// Creates a behavior to cast a pet action by name of the pet spell on specified location, if extra conditions are met /// (like Freeze of Water Elemental) /// </summary> /// <param name="action"> The name of the pet spell that will be casted. </param> /// <param name="location"> The point to click. </param> /// <param name="extra"> Extra conditions that will be checked. </param> /// <returns></returns> public static Composite CreateCastPetActionOnLocation(string action, LocationRetriever location, SimpleBooleanDelegate extra) { return(new Decorator( ret => extra(ret) && PetManager.CanCastPetAction(action), new Sequence( new Action(ret => PetManager.CastPetAction(action)), new ActionSleep(250), new Action(ret => LegacySpellManager.ClickRemoteLocation(location(ret)))))); }
private Composite CreateSpellCastOnLocation(string spellName, LocationRetrievalDelegate onLocation) { return(new Decorator( ret => CanCast(spellName, null, false), new Sequence( new Action(ret => CastWithLog(spellName, null)), new Action(ret => StyxWoW.SleepForLagDuration()), new Action(ret => LegacySpellManager.ClickRemoteLocation(onLocation(ret)))))); }
protected override Composite CreateBehavior() { return(_root ?? (_root = new PrioritySelector( new Decorator(ret => (!UtilIsProgressRequirementsMet(QuestId, QuestRequirementInLog, QuestRequirementComplete)), new Sequence( new Action(ret => TreeRoot.StatusText = "Finished!"), new Action(ret => Lua.DoString("RunMacroText('/click VehicleMenuBarActionButton3','0')")), new WaitContinue(120, new Action(delegate { _isDone = true; return RunStatus.Success; })) )), new Decorator(ret => (!InVehicle && flyList.Count == 0) || (!InVehicle && flyList[0].Location.Distance(me.Location) > 3), new Sequence( new Action(ret => TreeRoot.StatusText = "Moving To get a ride"), new Action(ret => Navigator.MoveTo(Location)), new Action(ret => Thread.Sleep(300)) ) ), new Decorator(ret => !InVehicle && flyList.Count > 0 && flyList[0].Location.Distance(me.Location) <= 3, new Sequence( new Action(ret => TreeRoot.StatusText = "Interracting with - " + flyList[0].Name + " to enter vehicle"), new Action(ret => WoWMovement.MoveStop()), new Action(ret => flyList[0].Interact()), new Action(ret => Thread.Sleep(300)), new Action(ret => Lua.DoString("SelectGossipOption(2)")) ) ), new Decorator(ret => InVehicle && !Obj2Done && mob1List.Count > 0 && mob1List[0].Location.Distance(me.Location) <= 99, new Sequence( new Action(ret => TreeRoot.StatusText = "Bombing - " + mob1List[0].Name), new Action(ret => mob1List[0].Target()), new Action(ret => Lua.DoString("RunMacroText('/click VehicleMenuBarActionButton1','0')")), new Action(ret => LegacySpellManager.ClickRemoteLocation(mob1List[0].Location)), new Action(ret => Thread.Sleep(2000)) ) ), new Decorator(ret => InVehicle && !Obj1Done && mob2List.Count > 0 && mob2List[0].Location.Distance(me.Location) <= 99, new Sequence( new Action(ret => TreeRoot.StatusText = "Bombing - " + mob2List[0].Name), new Action(ret => mob2List[0].Target()), new Action(ret => Lua.DoString("RunMacroText('/click VehicleMenuBarActionButton1','0')")), new Action(ret => LegacySpellManager.ClickRemoteLocation(mob2List[0].Location)), new Action(ret => Thread.Sleep(2000)) ) ) ) )); }
public RunStatus PetLogic() { Log("Freezing the Target"); Lua.DoString("CastPetAction(4)"); Thread.Sleep(600); LegacySpellManager.ClickRemoteLocation(Me.CurrentTarget.Location); FreezeTimer.Reset(); FreezeTimer.Start(); return(RunStatus.Success); }
public Composite Freeze() { return(new Decorator(ret => Me.CurrentTarget != null && Me.GotAlivePet && AmplifySettings.Instance.Freeze && Me.CurrentTarget.Distance > 10 && Me.CurrentTarget.HealthPercent >= 20 && PetActionReady && !Me.CurrentTarget.HasAura("Frost Nova") && !WillChain(0, Me.CurrentTarget.Location), new Sequence( new Action(ret => Log("Casting Freeze")), new Action(ret => Lua.DoString("CastPetAction(4)")), new Action(ret => FreezeTimer.Reset()), new Action(ret => FreezeTimer.Start()), new Action(ret => Thread.Sleep(300)), new Action(ret => LegacySpellManager.ClickRemoteLocation(Me.CurrentTarget.Location))) )); }
/// <summary> /// Cast a given spell using click-to-cast spells /// </summary> /// <param name="spellName">Spell name to cast</param> /// <param name="clickCastLocation">WoWPoint to cast the spell</param> /// <returns></returns> public static bool Cast(string spellName, WoWPoint clickCastLocation) { Debug.Log(String.Format("Click Cast {0}", spellName), 1); bool result = SpellManager.Cast(spellName); LegacySpellManager.ClickRemoteLocation(clickCastLocation); Debug.Log("... result " + result, 1); Utils.Log("-" + spellName, Utils.Colour("Blue")); return(result); }
protected override Composite CreateBehavior() { return(_root ?? (_root = new PrioritySelector( new Decorator(ret => me.QuestLog.GetQuestById(26076) != null && me.QuestLog.GetQuestById(26076).IsCompleted, new Sequence( new Action(ret => TreeRoot.StatusText = "Finished!"), new WaitContinue(120, new Action(delegate { _isDone = true; return RunStatus.Success; })) )), new Decorator(ret => !me.Dead && !me.Combat && MobList.Count == 0, new Action(ret => { Navigator.MoveTo(location); TreeRoot.StatusText = "Moving to Location"; })), new Decorator(ret => !me.Dead && !me.Combat && MobList.Count > 0, new Action(ret => { if (MobList[0].Location.Distance(me.Location) > 30 || !MobList[0].InLineOfSight) { Navigator.MoveTo(MobList[0].Location); TreeRoot.StatusText = "Moving to " + MobList[0].Name; } if (MobList[0].Location.Distance(me.Location) <= 30 && MobList[0].InLineOfSight) { if (MobList[0].Flags == 33587200) { WoWMovement.MoveStop(); Bomb.UseContainerItem(); LegacySpellManager.ClickRemoteLocation(MobList[0].Location); TreeRoot.StatusText = "bombing " + MobList[0].Name; Thread.Sleep(2000); } else { WoWMovement.MoveStop(); MobList[0].Target(); SpellManager.Cast(5116); } } } ) ) ) )); }
public Composite Blizzard() { return(new Decorator(ret => SpellManager.CanCast("Blizzard"), new Sequence( new Action(ret => Log("Casting Blizzard")), new Action(ret => SpellManager.Cast("Blizzard")), new Action(ret => Thread.Sleep(300)), new Action(ret => LegacySpellManager.ClickRemoteLocation(Me.CurrentTarget.Location))) //new WaitContinue(5, ret => Me.CurrentPendingCursorSpell.Name == "Blizzard", //new Action(ret => LegacySpellManager.ClickRemoteLocation(Me.CurrentTarget.Location))) )); }
protected override RunStatus Run(object context) { const string spellName = "Trap Launcher"; WoWPoint trapLocation = Movement.PointFromTarget(1); bool result = Spell.Cast(spellName); Utils.LagSleep(); Lua.DoString(String.Format("CastSpellByName(\"{0}\")", Settings.TrapLauncher)); LegacySpellManager.ClickRemoteLocation(trapLocation); Utils.Log(string.Format("Using {0} with Trap Launcher", Settings.TrapLauncher)); return(result ? RunStatus.Success : RunStatus.Failure); }
protected Composite CreateHunterTrapOnAddBehavior() { return(new PrioritySelector( ctx => NearbyUnfriendlyUnits.FirstOrDefault(u => u.IsTargetingMeOrPet && u != Me.CurrentTarget && !u.IsMoving), new Decorator( ret => ret != null && CanCast("Freezing Trap", (WoWUnit)ret, false), new PrioritySelector( CreateSpellBuffOnSelf("Trap Launcher"), new Sequence( new Action(ret => Lua.DoString("RunMacroText(\"/cast Freezing Trap\")")), new Action(ret => LegacySpellManager.ClickRemoteLocation(((WoWUnit)ret).Location))))))); }
protected override Composite CreateBehavior() { return(_root ?? (_root = new PrioritySelector( new Decorator(ret => (me.QuestLog.GetQuestById(25533) != null && me.QuestLog.GetQuestById(25533).IsCompleted), new Sequence( new Action(ret => TreeRoot.StatusText = "Finished!"), new Action(ret => Thread.Sleep(3000)), new Action(ret => Lua.DoString("ShowQuestComplete(GetQuestLogIndexByID('25533'))")), new Action(ret => Thread.Sleep(3000)), new Action(ret => Lua.DoString("RunMacroText('/click QuestFrameCompleteQuestButton')")), new Action(ret => Thread.Sleep(3000)), new Action(ret => Lua.DoString("RunMacroText('/click QuestFrameAcceptButton')")), new Action(ret => Thread.Sleep(3000)), new WaitContinue(120, new Action(delegate { _isDone = true; return RunStatus.Success; })) )), new Decorator(ret => (!InVehicle && flyList.Count == 0) || (!InVehicle && flyList[0].Location.Distance(me.Location) > 3), new Sequence( new Action(ret => TreeRoot.StatusText = "Moving To get a ride"), new Action(ret => Navigator.MoveTo(Location)), new Action(ret => Thread.Sleep(300)) ) ), new Decorator(ret => !InVehicle && flyList.Count > 0 && flyList[0].Location.Distance(me.Location) <= 3, new Sequence( new Action(ret => TreeRoot.StatusText = "Interracting with - " + flyList[0].Name + " to enter vehicle"), new Action(ret => WoWMovement.MoveStop()), new Action(ret => flyList[0].Interact()), new Action(ret => Thread.Sleep(300)), new Action(ret => Lua.DoString("SelectGossipOption(1)")) ) ), new Decorator(ret => InVehicle && mobList.Count > 0, new Sequence( new Action(ret => TreeRoot.StatusText = "Bombing - " + mobList[0].Name), new Action(ret => Lua.DoString("RunMacroText('/click VehicleMenuBarActionButton1','0')")), new Action(ret => LegacySpellManager.ClickRemoteLocation(mobList[0].Location)), new Action(ret => Thread.Sleep(2000)) ) ) ) )); }
protected override Composite CreateBehavior() { return(_root ?? (_root = new PrioritySelector( new Decorator(ret => !UtilIsProgressRequirementsMet(QuestId, questInLogRequirement, questCompleteRequirement), new Sequence( new Action(ret => TreeRoot.StatusText = "Finished!"), new Action(ret => Lua.DoString("RunMacroText('/click VehicleMenuBarActionButton3','0')")), new WaitContinue(120, new Action(delegate { IsBehaviorDone = true; return RunStatus.Success; })) )), new Decorator(ret => !InVehicle && Thraka.Count < 1 || !InVehicle && Thraka[0].Distance > 5, new Sequence( new Action(ret => Navigator.MoveTo(Location)), new Action(ret => Thread.Sleep(100)) )), new Decorator(ret => !InVehicle && Thraka.Count > 0 && Thraka[0].Distance < 6, new Sequence( new Action(ret => Navigator.PlayerMover.MoveStop()), new Action(ret => Thraka[0].Interact()), new Action(ret => Thread.Sleep(500)), new Action(ret => Lua.DoString("SelectGossipOption(2)")) )), new Decorator(ret => InVehicle && !SentinelsDone && Sentinels.Count > 0, new Sequence( new Action(ret => Sentinels[0].Target()), new Action(ret => Lua.DoString("RunMacroText('/click VehicleMenuBarActionButton1','0')")), new Action(ret => LegacySpellManager.ClickRemoteLocation(Sentinels[0].Location)), new Action(ret => Thread.Sleep(3000)) )), new Decorator(ret => InVehicle && !ThrowersDone && Throwers.Count > 0, new Sequence( new Action(ret => Throwers[0].Target()), new Action(ret => Lua.DoString("RunMacroText('/click VehicleMenuBarActionButton1','0')")), new Action(ret => LegacySpellManager.ClickRemoteLocation(Throwers[0].Location)), new Action(ret => Thread.Sleep(3000)) )) ))); }
protected override Composite CreateBehavior() { return(_root ?? (_root = new PrioritySelector( new Decorator(ret => (Me.QuestLog.GetQuestById((uint)QuestId) != null && Me.QuestLog.GetQuestById((uint)QuestId).IsCompleted), new Sequence( new Action(ret => TreeRoot.StatusText = "Finished!"), new WaitContinue(120, new Action(delegate { _isBehaviorDone = true; return RunStatus.Success; })) )), new Decorator(c => Location.Distance(Me.Location) > 3, new Action(c => { if (Location.Distance(Me.Location) <= 3) { _isBehaviorDone = true; return RunStatus.Success; } TreeRoot.StatusText = "Moving To Location: Using Item - " + wowItem.Name; WoWPoint[] pathtoDest1 = Styx.Logic.Pathing.Navigator.GeneratePath(Me.Location, Location); foreach (WoWPoint p in pathtoDest1) { while (!Me.Dead && p.Distance(Me.Location) > 2) { Thread.Sleep(100); WoWMovement.ClickToMove(p); wowItem.Interact(); Thread.Sleep(200); LegacySpellManager.ClickRemoteLocation(Me.Location); Thread.Sleep(500); } } return RunStatus.Running; })) ))); }
/// <summary> /// Creates a behavior to cast a spell by name, on the ground at the specified location. Returns RunStatus.Success if successful, RunStatus.Failure otherwise. /// </summary> /// <remarks> /// Created 5/2/2011. /// </remarks> /// <param name = "spell">The spell.</param> /// <param name = "onLocation">The on location.</param> /// <param name = "requirements">The requirements.</param> /// <returns>.</returns> public static Composite CastOnGround(string spell, LocationRetriever onLocation, SimpleBooleanDelegate requirements) { return(new Decorator( ret => requirements(ret) && onLocation != null && SpellManager.CanCast(spell) && (StyxWoW.Me.Location.Distance(onLocation(ret)) <= SpellManager.Spells[spell].MaxRange || SpellManager.Spells[spell].MaxRange == 0), new Sequence( new Action(ret => Logger.Write("Casting {0} at location {1}", spell, onLocation(ret))), new Action(ret => SpellManager.Cast(spell)), new WaitContinue( 1, ret => StyxWoW.Me.CurrentPendingCursorSpell != null && StyxWoW.Me.CurrentPendingCursorSpell.Name == spell, new ActionAlwaysSucceed()), new Action(ret => LegacySpellManager.ClickRemoteLocation(onLocation(ret)))) )); }
private Composite RootCompositeOverride() { return (new PrioritySelector( new Decorator( ret => !_isBehaviorDone && Me.IsAlive, new PrioritySelector( new Decorator(ret => (Counter >= NumOfTimes) || (Me.QuestLog.GetQuestById((uint)QuestId) != null && Me.QuestLog.GetQuestById((uint)QuestId).IsCompleted), new Sequence( new Action(ret => TreeRoot.StatusText = "Finished!"), new WaitContinue(120, new Action(delegate { _isBehaviorDone = true; return RunStatus.Success; })) )), new Decorator( ret => Me.CurrentTarget != null && Item != null && (!UseOnce || Me.CurrentTarget.Guid != _lastMobGuid), new PrioritySelector( new Sequence( new Decorator( ret => (CastingSpellId != 0 && Me.CurrentTarget.CastingSpellId == CastingSpellId) || (MobHasAuraId != 0 && Me.CurrentTarget.Auras.Values.Any(a => a.SpellId == MobHasAuraId)) || (MobHpPercentLeft != 0 && Me.CurrentTarget.HealthPercent <= MobHpPercentLeft) || (HasAuraId != 0 && Me.HasAura(WoWSpell.FromId(HasAuraId).Name)), new PrioritySelector( new Decorator( new Sequence( new Action(ret => StyxWoW.SleepForLagDuration()), new Action(ret => TreeRoot.StatusText = "Using item"), new Action(ret => _lastMobGuid = Me.CurrentTarget.Guid), new Action(ret => Item.UseContainerItem()), new Action(ret => Thread.Sleep(200)), new Action(ret => LegacySpellManager.ClickRemoteLocation(UseObject.Location)), new Action(ret => Thread.Sleep(WaitTime)), new DecoratorContinue( ret => QuestId == 0, new Action(ret => Counter++)))))))) ))))); }
public Composite CreateFrostDeathKnightCombat() { return(new PrioritySelector( CreateEnsureTarget(), CreateAutoAttack(true), CreateFaceUnit(), // Note: You should have this in 2 different methods. Hence the reason for WoWContext being a [Flags] enum. // In this case, since its only one spell being changed, we can live with it. CreateSpellCast("Death Grip", ret => Me.CurrentTarget.Distance > 15 && !Me.IsInInstance), //Make sure we're in range, and facing the damned target. (LOS check as well) CreateMoveToAndFace(5f, ret => Me.CurrentTarget), CreateSpellCast("Raise Dead", ret => !Me.GotAlivePet), CreateSpellCast("Rune Strike"), CreateSpellCast("Mind Freeze", ret => Me.CurrentTarget.IsCasting || Me.CurrentTarget.ChanneledCastingSpellId != 0), CreateSpellCast("Strangulate", ret => Me.CurrentTarget.IsCasting || Me.CurrentTarget.ChanneledCastingSpellId != 0), CreateSpellCast("Death Strike", ret => Me.HealthPercent < 80), CreateSpellCast("Pillar of Frost"), CreateSpellCast("Howling Blast", ret => Me.HasAura("Freezing Fog") || !Me.CurrentTarget.HasAura("Frost Fever")), CreateSpellCast( "Pestilence", ret => Me.CurrentTarget.HasAura("Blood Plague") && Me.CurrentTarget.HasAura("Frost Fever") && (from add in NearbyUnfriendlyUnits where !add.HasAura("Blood Plague") && !add.HasAura("Frost Fever") && add.Distance < 10 select add).Count() > 0), new Decorator( ret => SpellManager.CanCast("Death and Decay") && NearbyUnfriendlyUnits.Count(a => a.Distance < 8) > 1, new Action( ret => { SpellManager.Cast("Death and Decay"); LegacySpellManager.ClickRemoteLocation(Me.CurrentTarget.Location); })), CreateSpellCast("Outbreak", ret => Me.CurrentTarget.HasAura("Frost Fever") || Me.CurrentTarget.HasAura("Blood Plague")), CreateSpellCast("Plague Strike", ret => !Me.CurrentTarget.HasAura("Blood Plague")), CreateSpellCast( "Obliterate", ret => (Me.FrostRuneCount == 2 && Me.UnholyRuneCount == 2) || Me.DeathRuneCount == 2 || Me.HasAura("Killing Machine")), CreateSpellCast("Blood Strike", ret => Me.BloodRuneCount == 2), CreateSpellCast("Frost Strike", ret => Me.HasAura("Freezing Fog") || Me.CurrentRunicPower == Me.MaxRunicPower), CreateSpellCast("Blood Tap", ret => Me.BloodRuneCount < 2), CreateSpellCast("Obliterate"), CreateSpellCast("Blood Strike"), CreateSpellCast("Frost Strike"))); }
protected override Composite CreateBehavior() { return(_root ?? (_root = new PrioritySelector( new Decorator(ret => (!InVehicle), new Sequence( new Action(ret => TreeRoot.StatusText = "Finished!"), new Action(ret => Lua.DoString("RunMacroText('/click VehicleMenuBarActionButton2','0')")), new WaitContinue(120, new Action(delegate { _isDone = true; return RunStatus.Success; })) )), new Decorator(ret => InVehicle && mob1List[0].Location.Distance(me.Location) <= 30, new Sequence( new Action(ret => TreeRoot.StatusText = "Bombing - " + mob1List[0].Name), new Action(ret => mob1List[0].Target()), new Action(ret => Lua.DoString("RunMacroText('/click VehicleMenuBarActionButton1','0')")), new Action(ret => LegacySpellManager.ClickRemoteLocation(mob1List[0].Location)), new Action(ret => Thread.Sleep(2000)) ) ), new Decorator(ret => InVehicle && mob2List.Count > 0 && mob2List[0].Location.Distance(me.Location) <= 30, new Sequence( new Action(ret => TreeRoot.StatusText = "Bombing - " + mob2List[0].Name), new Action(ret => mob2List[0].Target()), new Action(ret => Lua.DoString("RunMacroText('/click VehicleMenuBarActionButton1','0')")), new Action(ret => LegacySpellManager.ClickRemoteLocation(mob2List[0].Location)), new Action(ret => Thread.Sleep(2000)) ) ) ) )); }
public RunStatus AoE() { switch (AmplifySettings.Instance.AoE) { case "Blizzard": Log("Casting Blizzard"); SpellManager.Cast("Blizzard");; break; case "Flamestrike": Log("Casting Flamestrike"); SpellManager.Cast("Flamestrike");; break; } Thread.Sleep(500); LegacySpellManager.ClickRemoteLocation(Me.CurrentTarget.Location); return(RunStatus.Success); }
public Composite CreateUnholyDeathKnightCombat() { return(new PrioritySelector( CreateEnsureTarget(), CreateAutoAttack(true), CreateFaceUnit(), // Note: You should have this in 2 different methods. Hence the reason for WoWContext being a [Flags] enum. // In this case, since its only one spell being changed, we can live with it. CreateSpellCast("Death Grip", ret => Me.CurrentTarget.Distance > 15 && !Me.IsInInstance), //Make sure we're in range, and facing the damned target. (LOS check as well) CreateMoveToAndFace(5f, ret => Me.CurrentTarget), CreateSpellCast("Raise Dead", ret => !Me.GotAlivePet), CreateSpellCast("Rune Strike"), CreateSpellCast("Mind Freeze", ret => Me.CurrentTarget.IsCasting || Me.CurrentTarget.ChanneledCastingSpellId != 0), CreateSpellCast("Strangulate", ret => Me.CurrentTarget.IsCasting || Me.CurrentTarget.ChanneledCastingSpellId != 0), CreateSpellCast("Unholy Frenzy", ret => Me.HealthPercent >= 80), CreateSpellCast("Death Strike", ret => Me.HealthPercent < 80), CreateSpellCast("Outbreak", ret => Me.CurrentTarget.HasAura("Frost Fever") || Me.CurrentTarget.HasAura("Blood Plague")), CreateSpellCast("Icy Touch"), CreateSpellCast("Plague Strike", ret => !Me.CurrentTarget.HasAura("Blood Plague")), CreateSpellCast( "Pestilence", ret => Me.CurrentTarget.HasAura("Blood Plague") && Me.CurrentTarget.HasAura("Frost Fever") && (NearbyUnfriendlyUnits.Where( add => !add.HasAura("Blood Plague") && !add.HasAura("Frost Fever") && add.Distance < 10)).Count() > 0), new Decorator( ret => SpellManager.CanCast("Death and Decay") && NearbyUnfriendlyUnits.Count(a => a.Distance < 8) > 1, new Action( ret => { SpellManager.Cast("Death and Decay"); LegacySpellManager.ClickRemoteLocation(Me.CurrentTarget.Location); })), CreateSpellCast("Summon Gargoyle"), CreateSpellCast("Dark Transformation", ret => Me.GotAlivePet && !Me.Pet.ActiveAuras.ContainsKey("Dark Transformation")), CreateSpellCast("Scourge Strike", ret => Me.BloodRuneCount == 2 && Me.FrostRuneCount == 2), CreateSpellCast("Festering Strike", ret => Me.BloodRuneCount == 2 && Me.FrostRuneCount == 2), CreateSpellCast("Death Coil", ret => Me.ActiveAuras.ContainsKey("Sudden Doom") || Me.CurrentRunicPower >= 80), CreateSpellCast("Scourge Strike"), CreateSpellCast("Festering Strike"), CreateSpellCast("Death Coil"))); }
public Composite CreateBloodDeathKnightCombat() { NeedTankTargeting = true; return(new PrioritySelector( CreateEnsureTarget(), CreateAutoAttack(true), CreateFaceUnit(), // Blood DKs are tanks. NOT DPS. If you're DPSing as blood, go respec right now, because you fail hard. // Death Grip is used at all times in this spec, so don't bother with an instance check, like the other 2 specs. CreateSpellCast("Death Grip", ret => Me.CurrentTarget.Distance > 15), //Make sure we're in range, and facing the damned target. (LOS check as well) CreateMoveToAndFace(5f, ret => Me.CurrentTarget), CreateSpellBuffOnSelf("Bone Shield"), CreateSpellCast("Rune Strike"), CreateSpellCast("Mind Freeze", ret => Me.CurrentTarget.IsCasting || Me.CurrentTarget.ChanneledCastingSpellId != 0), CreateSpellCast("Strangulate", ret => Me.CurrentTarget.IsCasting || Me.CurrentTarget.ChanneledCastingSpellId != 0), CreateSpellBuffOnSelf("Rune Tap", ret => Me.HealthPercent <= 60), CreateSpellCast( "Pestilence", ret => Me.CurrentTarget.HasAura("Blood Plague") && Me.CurrentTarget.HasAura("Frost Fever") && (from add in NearbyUnfriendlyUnits where !add.HasAura("Blood Plague") && !add.HasAura("Frost Fever") && add.Distance < 10 select add).Count() > 0), new Decorator( ret => SpellManager.CanCast("Death and Decay") && NearbyUnfriendlyUnits.Count(a => a.Distance < 8) > 1, new Action( ret => { SpellManager.Cast("Death and Decay"); LegacySpellManager.ClickRemoteLocation(Me.CurrentTarget.Location); })), CreateSpellCast("Icy Touch"), CreateSpellCast("Plague Strike", ret => !Me.CurrentTarget.HasAura("Blood Plague")), CreateSpellCast("Death Strike", ret => Me.HealthPercent < 80), CreateSpellCast("Blood Boil", ret => NearbyUnfriendlyUnits.Count(a => a.Distance < 8) > 1), CreateSpellCast("Heart Strike"), CreateSpellCast("Death Coil"))); }
public Composite CreateFireMagePVPCombat() { return (new PrioritySelector( new Decorator(ret => Me.HasAura("Ice Block") || Me.HasAura("Cyclone"), new Action(ret => { return RunStatus.Success; })), CreateCheckPlayerPvPState(), CreateEnsurePVPTargetRanged(), new Decorator(ret => Me.CurrentTarget == null, new Action(ret => { return RunStatus.Success; })), CreateCheckTargetPvPState(), // Make sure we're in range, and facing the damned target. (LOS check as well) CreateWaitForCast(true), CreateSpellCast("Escape Artist", ret => MeRooted), CreateSpellCast("Blink", ret => MeUnderStunLikeControl || MeRooted), new Decorator( ret => MeUnderStunLikeControl || MeUnderSheepLikeControl || MeUnderFearLikeControl, new PrioritySelector( CreateUseAntiPvPControl(), CreateSpellCast("Ice Block"), new Action(ret => { return RunStatus.Success; }))), CreateSpellCast("Counterspell", ret => Me.CurrentTarget.IsCasting || Me.CurrentTarget.ChanneledCastingSpellId != 0), new Action(ret => { // clear I"m moving away flag if (!Me.IsMoving && movingAway) { movingAway = false; } return RunStatus.Failure; }), new Decorator(ret => SpellManager.CanCast("Counterspell"), new Action(ret => { if (unitsAt40Range == null) { return RunStatus.Failure; } WoWPlayer player = unitsAt40Range.FirstOrDefault( p => p.DistanceSqr < 30 * 30 && (p.IsCasting || p.ChanneledCastingSpellId != 0) && p.IsTargetingMeOrPet); if (player != null) { if (Me.IsCasting) { SpellManager.StopCasting(); } SpellManager.Cast("Counterspell", player); return RunStatus.Success; } return RunStatus.Failure; })), new Decorator( ret => !movingAway, CreateMoveToAndFacePvP(40f, 70f, ret => Me.CurrentTarget, false, RunStatus.Success)), new Decorator(ret => unitsAt40Range != null && unitsAt40Range.Count(a => a.DistanceSqr < 15 * 15) > 1 && SpellManager.CanCast("Blast Wave"), new Action(ret => { SpellManager.Cast("Blast Wave"); LegacySpellManager.ClickRemoteLocation(unitsAt40Range.First(a => a.DistanceSqr < 15 * 15).Location); })), new Action(ret => { if (SpellManager.CanCast("Dragon's Breath") && unitsAt40Range != null) { WoWPlayer unit = unitsAt40Range.FirstOrDefault(u => u.DistanceSqr < 8 * 8); if (unit != null) { Navigator.PlayerMover.MoveStop(); unit.Face(); StyxWoW.SleepForLagDuration(); SpellManager.Cast("Dragon's Breath"); StyxWoW.SleepForLagDuration(); WoWPoint moveTo = WoWMathHelper.CalculatePointFrom(Me.Location, unit.Location, 10f); if (Navigator.CanNavigateFully(Me.Location, moveTo)) { movingAway = true; Navigator.MoveTo(moveTo); } return RunStatus.Success; } } return RunStatus.Failure; }), CreateSpellCast("Pyroblast", ret => Me.HasAura("Hot Streak") && Me.Auras["Hot Streak"].TimeLeft.TotalSeconds > 1 && !TargetState.ReflectMagic && !TargetState.Invulnerable, false), CreateSpellBuff("Living Bomb", ret => (!Me.CurrentTarget.HasAura("Living Bomb") || Me.CurrentTarget.Auras["Living Bomb"].CreatorGuid != Me.Guid) && !TargetState.Invulnerable && !TargetState.ResistsBinarySpells && !TargetState.ReflectMagic, false), CreateSpellCast("Fire Blast", ret => Me.HasAura("Impact") && !TargetState.ReflectMagic, false), CreateSpellCast("Scorch", ret => Me.IsMoving, false), new Decorator( ret => (TargetState.Rooted || TargetState.Stunned || TargetState.Feared | TargetState.Incapacitated) && Me.CurrentTarget.DistanceSqr < 10 * 10, new Action( ret => { Logger.Write("Getting away from frozen target"); WoWPoint moveTo = WoWMathHelper.CalculatePointFrom(Me.Location, Me.CurrentTarget.Location, 10f); if (Navigator.CanNavigateFully(Me.Location, moveTo)) { movingAway = true; Navigator.MoveTo(moveTo); } })), CreateSpellCast("Frost Nova", ret => unitsAt40Range.Count(p => p.DistanceSqr < 8 * 8) > 0), CreateSpellCast("Cone of Cold", ret => Me.CurrentTarget.DistanceSqr <= (8 * 8) && !TargetState.Freezed && !TargetState.Slowed && !TargetState.Stunned), new Action(ret => { // check if target is invulnerable, try to get new target if (!TargetState.Invulnerable) { return RunStatus.Failure; } if (unitsAt40Range != null) { WoWPlayer player = unitsAt40Range.OrderBy(p => p.DistanceSqr).FirstOrDefault(p => p != Me.CurrentTarget); if (player != null) { player.Target(); return RunStatus.Success; } } return RunStatus.Failure; }), CreateSpellCast("Evocation", ret => Me.ManaPercent < 40), CreateSpellCast("Fireball", ret => unitsAt40Range == null || unitsAt40Range.Count(a => a.DistanceSqr < 10 * 10) == 0 && Me.CurrentTarget.HasAura("Critical Mass") && !TargetState.ReflectMagic), CreateSpellCast("Scorch", false) )); }