public static Composite CreateWarriorCombatPullMore() { return(new Throttle( 2, new Decorator( req => SingularRoutine.CurrentWoWContext == WoWContext.Normal && Me.GotTarget() && !Me.CurrentTarget.IsPlayer && !Me.CurrentTarget.IsTagged && !Me.HasAura("Charge") && !Me.CurrentTarget.HasAnyOfMyAuras("Charge Stun", "Warbringer") && !Me.CurrentTarget.IsWithinMeleeRange, new PrioritySelector( Common.CreateChargeBehavior(), Spell.Cast("Heroic Throw", req => Me.IsSafelyFacing(Me.CurrentTarget) && !Me.CurrentTarget.IsWithinMeleeRange), Spell.Cast("Taunt", req => SingularSettings.Instance.EnableTaunting), new Decorator( req => SpellManager.HasSpell("Throw") && Me.CurrentTarget.SpellDistance().Between(6, 27), new Sequence( new Action(r => StopMoving.Now()), new Wait(1, until => !Me.IsMoving, new ActionAlwaysSucceed()), Spell.Cast(s => "Throw", mov => true, on => Me.CurrentTarget, req => true, cancel => false), new WaitContinue(1, until => !Me.IsCasting, new ActionAlwaysSucceed()) ) ) ) ) )); }
public static Composite CreateDeathGripBehavior() { return(new Sequence( Spell.Cast("Death Grip", req => !MovementManager.IsMovementDisabled && (SingularRoutine.CurrentWoWContext != WoWContext.Instances || !Me.GroupInfo.IsInParty || Me.IsTank) && Me.CurrentTarget.DistanceSqr > 10 * 10 && (((Me.CurrentTarget.IsPlayer || Me.CurrentTarget.TaggedByMe) && !Me.CurrentTarget.IsMovingTowards()) || (!Me.CurrentTarget.TaggedByOther && Dynamics.CompositeBuilder.CurrentBehaviorType == BehaviorType.Pull)) ), new DecoratorContinue(req => Me.IsMoving, new Action(req => StopMoving.Now())), new WaitContinue(1, until => !Me.GotTarget() || Me.CurrentTarget.IsWithinMeleeRange, new ActionAlwaysSucceed()) )); }
private static bool MovementToggle() { _MovementEnabled = _MovementEnabled ? false : true; if (!_MovementEnabled) { StopMoving.Now(); } #if !REACT_TO_HOTKEYS_IN_PULSE MovementKeyHandler(); #endif return(_MovementEnabled); }
private static Composite HealthFunnel(int petMinHealth, int petMaxHealth = 99) { return(new Decorator( ret => GetCurrentPet() != WarlockPet.None && Me.Pet.HealthPercent < petMinHealth && !Spell.IsSpellOnCooldown("Health Funnel") && Me.Pet.Distance < 45 && Me.Pet.InLineOfSpellSight && !TalentManager.IsSelected((int)WarlockTalents.SoulLink), new Sequence( new PrioritySelector( // glyph of health funnel prevents Soulburn: Health Funnel from being used new Decorator(ret => TalentManager.HasGlyph("Health Funnel"), new ActionAlwaysSucceed()), CastSoulburn(ret => { if (Me.Specialization == WoWSpec.WarlockAffliction) { if (Me.CurrentSoulShards > 0 && Spell.CanCastHack("Soulburn", Me)) { Logging.WriteDiagnostic("Soulburn should follow to make instant health funnel"); return true; } Logging.WriteDiagnostic("soulburn not available, shards={0}", Me.CurrentSoulShards); } return false; }), // neither of instant funnels available, so stop moving new Sequence( new Action(ctx => StopMoving.Now()), new Wait(1, until => !Me.IsMoving, new ActionAlwaysSucceed()))), new Decorator(ret => Spell.CanCastHack("Health Funnel", Me.Pet), new ActionAlwaysSucceed()), new Action(ret => Logging.WriteDiagnostic("Casting Health Funnel on Pet @ {0:F1}%", Me.Pet.HealthPercent)), new PrioritySelector( Spell.Cast(ret => "Health Funnel", mov => false, on => Me.Pet, req => Me.HasAura("Soulburn") || TalentManager.HasGlyph("Health Funnel")), Spell.Cast(ret => "Health Funnel", mov => true, on => Me.Pet, req => true, cancel => !Me.GotAlivePet || Me.Pet.HealthPercent >= petMaxHealth)), Common.CreateWaitForLagDuration()))); }
/// <summary> /// invoke on CurrentTarget if not tagged. use ranged instant casts if possible. this /// is a blend of abilities across all specializations /// </summary> /// <returns></returns> public static Composite CreateDeathKnightPullMore() { if (SingularRoutine.CurrentWoWContext != WoWContext.Normal) { return(new ActionAlwaysFail()); } return(new Throttle( 2, new Decorator( req => Me.GotTarget() && !Me.CurrentTarget.IsPlayer && !Me.CurrentTarget.IsTagged && !Me.CurrentTarget.IsWithinMeleeRange, new PrioritySelector( new Sequence( ctx => Me.CurrentTarget, Spell.Cast("Death Grip", on => (on as WoWUnit)), new DecoratorContinue(req => Me.IsMoving, new Action(req => StopMoving.Now())), new WaitContinue(TimeSpan.FromMilliseconds(500), until => !Me.IsMoving, new ActionAlwaysSucceed()), new WaitContinue(1, until => (until as WoWUnit).IsWithinMeleeRange, new ActionAlwaysSucceed()) ), Spell.Cast("Dark Command", req => Me.Specialization == WoWSpec.DeathKnightBlood) ) ) )); }
public static Composite CreateThunderLordGrappleBehavior() { const int FROSTFIRE_RIDGE_ZONEID = 6720; const int THUNDERLORD_GRAPPLE_ITEM = 101677; if (!SingularSettings.Instance.ToysAllowUse) { return(new ActionAlwaysFail()); } if (SingularRoutine.CurrentWoWContext != WoWContext.Normal) { return(new ActionAlwaysFail()); } if (!Me.IsMelee()) { return(new ActionAlwaysFail()); } return(new Throttle( 15, new Decorator( req => Me.ZoneId == FROSTFIRE_RIDGE_ZONEID, new Decorator( req => MovementManager.IsClassMovementAllowed && // checks Movement and GapCloser capability flags CanUseCarriedItem(THUNDERLORD_GRAPPLE_ITEM) && Me.GotTarget() && Me.CurrentTarget.SpellDistance() >= 20 && Me.CurrentTarget.InLineOfSight && Me.IsSafelyFacing(Me.CurrentTarget) && (DateTime.UtcNow - Utilities.EventHandlers.LastNoPathFailure) > TimeSpan.FromSeconds(15), new Sequence( new Action(r => { const int THUNDERLORD_GRAPPLE_SPELL = 150258; WoWSpell grapple = WoWSpell.FromId(THUNDERLORD_GRAPPLE_SPELL); if (grapple != null && Me.CurrentTarget.SpellDistance() < grapple.MaxRange) { return RunStatus.Success; } return RunStatus.Failure; }), new Action(r => StopMoving.Now()), new Wait( TimeSpan.FromMilliseconds(500), until => !Me.IsMoving, new ActionAlwaysSucceed() ), new Action(r => { WoWItem item = FindItem(THUNDERLORD_GRAPPLE_ITEM); UseItem(item, Me.CurrentTarget); }), new Wait( 1, until => Spell.IsCastingOrChannelling(), new ActionAlwaysSucceed() ), new Action(r => Logger.WriteDebug("ThunderlordGrapple: start @ {0:F1} yds", Me.CurrentTarget.Distance)), new Wait( 3, until => !Spell.IsCastingOrChannelling(), new ActionAlwaysSucceed() ), new PrioritySelector( new Sequence( new Wait( 1, until => !Me.IsMoving || Me.CurrentTarget.IsWithinMeleeRange, new ActionAlwaysSucceed() ), new Action(r => Logger.WriteDebug("ThunderlordGrapple: ended @ {0:F1} yds", Me.CurrentTarget.Distance)) ), // allow following to Succeed so we Throttle the behavior even on failure at this point new Action(r => Logger.WriteDebug("ThunderlordGrapple: failed unexpectedly @ {0:F1} yds", Me.CurrentTarget.Distance)) ) ) ) ) )); }