public override async Task Rest() { SpellManager.SpellInformation restAbility = Routine.Rest.ToValidAbilityList(GameManager.LocalPlayer).FirstOrDefault(); if (restAbility != null) { await SpellCastBehaviors.CastSimple(restAbility); } }
public override async Task Pull(object target) { var pullTarget = (target as Actor); if (pullTarget == null) { return; } Targeting.PullTarget = pullTarget; if (pullTarget.Distance > Routine.PullRange) { Logger.Debug(string.Format("[MoveWithin] {0} -> {1} (Distance {2})", GameManager.ControlledUnit.Position, pullTarget.Position, pullTarget.Distance)); // Stop within pull range, also stop early if we happen to body pull something. if (await CommonBehaviors.MoveWithin(pullTarget.Position, Routine.PullRange, true, true) == CommonBehaviors.BehaviorResult.CombatStop) { // Return only if we body pulled. Chances are, we pulled something we don't actually want. return; } // NOTE: Do not "return" after moving within range. //return; } SpellManager.SpellInformation pullAbility = Routine.Pull.ToValidAbilityList(pullTarget).FirstOrDefault(); if (pullAbility == null) { throw new Exception("Could not find a usable pull ability. Is pull not implemented for this class?"); } Logger.Debug(string.Format("[PULL] FaceCast [Name {0}, SpellBarIndex {1}]", pullAbility.Name, pullAbility.SpellBarIndex)); if (WindowSettings.EnableMovement) { pullTarget.Face(); } await SpellCastBehaviors.CastSimple(pullAbility, () => pullTarget, true); }
public override AbilityPriority CreateHeal() { var result = new AbilityPriority(); // High Priority / Buff Management result.Add("Phantasmal Armor", r => (InstanceManager.Tank != null ? InstanceManager.Tank.HealthPercent : GameManager.LocalPlayer.HealthPercent) < Settings.PhantasmalArmorHP); result.Add("Catharsis", r => GameManager.LocalPlayer.HealthPercent <Settings.CatharsisHP && InstanceManager.CleanseTarget.Buffs.Count> Settings.CatharsisBuff, async cast => { var Target = InstanceManager.CleanseTarget; if (Omnibus.WindowSettings.EnableMovement) { Target.Face(); } return(await SpellCastBehaviors.CastSimple("Catharsis", () => Target, awaitCastFinished: true)); }); // Medium Priority / Psi Point Specific result.Add("Mental Boon", r => GameManager.LocalPlayer.InnateResource == 5 && GameManager.LocalPlayer.HealthPercent < Settings.MentalBoonHP); result.Add("Reverie", r => InstanceManager.AveragePartyHealth < Settings.ReverieHP && GameManager.LocalPlayer.InnateResource == 5); result.Add("Mending Banner", r => InstanceManager.AveragePartyHealth < Settings.MendingBannerHP && GameManager.LocalPlayer.InnateResource == 5); // Medium Low Priority / Health Percentage result.Add("Projected Spirit", r => InstanceManager.AveragePartyHealth > Settings.ProjectedSpiritHP); // Low Priority / Psi Point Builders result.Add("Meditate", r => GameManager.LocalPlayer.InnateResource < 5 && GameManager.LocalPlayer.HealthPercent <= Settings.MeditateHP); result.Add("Pyrokinetic Flame", r => InstanceManager.AveragePartyHealth < Settings.PyrokineticFlameHP && GameManager.LocalPlayer.InnateResource < 5); result.Add("Warden", r => GameManager.LocalPlayer.InnateResource < 5 && (GameManager.LocalPlayer.HealthPercent < Settings.WardenHP || InstanceManager.AveragePartyHealth < Settings.WardenAllyHP)); result.Add("Mirage", r => GameManager.LocalPlayer.InnateResource < 5 && GameManager.LocalPlayer.HealthPercent < Settings.MirageHP); result.Add("Soothe", r => GameManager.LocalPlayer.InnateResource < 5 && GameManager.LocalPlayer.HealthPercent < Settings.SootheHP); result.Add("Bolster", r => GameManager.LocalPlayer.InnateResource < 5 && GameManager.LocalPlayer.HealthPercent < Settings.BolsterHP); result.Add("Mind Over Body", r => GameManager.LocalPlayer.InnateResource < 5 && GameManager.LocalPlayer.HealthPercent < Settings.MindOverBodyHP); return(result); }
public void Add(string spellName, CastCondition condition) { Add(spellName, condition, async cast => await SpellCastBehaviors.CastSimple(spellName, awaitCastFinished: true)); }
public override AbilityPriority CreateCombat() { var result = new AbilityPriority(); // Spell interrupting result.Add("Gate", r => r.IsCasting && GameManager.LocalPlayer.InnateResource <= 1); result.Add("Flash Freeze", r => r.IsCasting); result.Add("Chill", r => r.IsCasting); result.Add("Arcane Shock", r => r.IsCasting); #region Spatial Shift result.Add("Spatial Shift", r => { if (r != null) { Actor Target = r; return(Target.IsCasting && (GameManager.LocalPlayer.InnateResource == 1 || GameManager.LocalPlayer.InnateResource >= 2 && (CanCast("Gate") || CanCast("Arcane Shock")))); } return(false); }); #endregion // Cleansing result.Add("Void Slip", r => GameManager.LocalPlayer.HasCleansableCC()); result.Add("Purify", r => GameManager.LocalPlayer.Mana >= 15 && GameManager.LocalPlayer.HealthPercent < Settings.PurifyHPPercent && GameManager.LocalPlayer.Buffs.Count(s => s.IsHarmful) >= 1); // Buff application result.Add("Void Pact", r => !GameManager.LocalPlayer.HasBuff("Empower")); result.Add("Phase Shift", r => !GameManager.LocalPlayer.HasBuff("Defense")); // Special result.Add("Gather Focus", r => GameManager.LocalPlayer.Mana < 100); result.Add("Affinity", r => InstanceManager.LowestHealth.HealthPercent < Settings.AffinityHPPercent); // Builder & spenders #region Spell surge // Build reliant Spell Surge result.Add("Ignite", r => { if (r != null) { Actor Target = r; var Ignite = GetSpell("Ignite"); return(Ignite != null && Ignite.CanCast && (Ignite.Ability.TierIndex <= 8 && !Target.HasBuff("Ignite") || Ignite.Ability.TierIndex == 8)); } return(false); }, async cast => { await SpellCastBehaviors.CastSimple("Spell Surge"); await SpellCastBehaviors.CastSimple("Ignite"); return(await SpellCastBehaviors.CastSimple("Spell Surge")); }); result.Add("Quick Draw", r => { if (r != null) { Actor Target = r; var QuickDraw = GetSpell("Quick Draw"); return(QuickDraw != null && QuickDraw.CanCast && Target.HealthPercent < 30 && GameManager.LocalPlayer.Mana >= 50); } return(false); }, async cast => { await SpellCastBehaviors.CastSimple("Spell Surge"); await SpellCastBehaviors.CastSimple("Quick Draw"); return(await SpellCastBehaviors.CastSimple("Spell Surge")); }); result.Add("Flame Burst", r => { if (r != null) { Actor Target = r; var FlameBurst = GetSpell("Flame Burst"); return(FlameBurst != null && FlameBurst.CanCast && (FlameBurst.Ability.TierIndex == 8 && Target.HasBuff("Ignite") || FlameBurst.Ability.TierIndex < 8)); } return(false); }, async cast => { await SpellCastBehaviors.CastSimple("Spell Surge"); await SpellCastBehaviors.CastSimple("Flame Burst"); return(await SpellCastBehaviors.CastSimple("Spell Surge")); }); result.Add("Assassinate", r => { if (r != null) { Actor Target = r; var Assassinate = GetSpell("Assassinate"); return(Assassinate != null && Assassinate.CanCast && (Target.HealthPercent >= 30 && GameManager.LocalPlayer.Mana > 25 || Target.HealthPercent < 30)); } return(false); }, async cast => { await SpellCastBehaviors.CastSimple("Spell Surge"); await SpellCastBehaviors.CastSimple("Assassinate"); return(await SpellCastBehaviors.CastSimple("Spell Surge")); }); // "Spam" Spell Surge result.Add("Wild Barrage", r => true, async cast => { await SpellCastBehaviors.CastSimple("Spell Surge"); await SpellCastBehaviors.CastSimple("Wild Barrage"); return(await SpellCastBehaviors.CastSimple("Spell Surge")); }); result.Add("Rapid Fire", r => true, async cast => { await SpellCastBehaviors.CastSimple("Spell Surge"); await SpellCastBehaviors.CastSimple("Rapid Fire"); return(await SpellCastBehaviors.CastSimple("Spell Surge")); }); result.Add("True Shot", r => true, async cast => { await SpellCastBehaviors.CastSimple("Spell Surge"); await SpellCastBehaviors.CastSimple("True Shot"); return(await SpellCastBehaviors.CastSimple("Spell Surge")); }); result.Add("Arcane Missiles", r => !r.HasBuff("Expose"), async cast => { await SpellCastBehaviors.CastSimple("Spell Surge"); await SpellCastBehaviors.CastSimple("Arcane Missiles"); return(await SpellCastBehaviors.CastSimple("Spell Surge")); }); result.Add("Charged Shot", r => true, async cast => { await SpellCastBehaviors.CastSimple("Spell Surge"); await SpellCastBehaviors.CastSimple("Charged Shot"); return(await SpellCastBehaviors.CastSimple("Spell Surge")); }); #endregion return(result); }