public static Composite HandleTotemRecall() { return(new Decorator( ret => Totems.NeedToRecallTotems, new Sequence( new Action(ret => CLULogger.Log(" [Totems] Recalling Totems")), new Action(ret => Totems.RecallTotems())))); }
public static Composite CreateTotemsNormalBehavior() { // create Fire Totems behavior first, then wrap if needed Composite fireTotemBehavior = new PrioritySelector( // Spell.CastSelfSpell("Fire Elemental", // ret => ((bool)ret) // || (Unit.EnemyUnits.Count() >= StressMobCount && !SpellManager.CanBuff(WoWTotem.EarthElemental.ToSpellId(), false)), "Fire Elemental"), // Magma - handle within AoE DPS logic only Spell.CastSpell("Magma Totem", ret => Unit.CountEnnemiesInRange(Me.CurrentTarget.Location, 20) >= 5 && !Exist(WoWTotemType.Fire) && !Totems.Exist(WoWTotem.FireElemental), "Magma Totem"), Spell.CastSpell("Searing Totem", ret => !Totems.Exist(WoWTotemType.Fire), "Searing Totem") ); if (Me.Specialization == WoWSpec.ShamanRestoration) { fireTotemBehavior = new Decorator(ret => StyxWoW.Me.Combat && StyxWoW.Me.GotTarget && !Me.GroupInfo.IsInParty, fireTotemBehavior); } // now return(new PrioritySelector( // check for stress - enemy player or elite within 8 levels nearby // .. dont use NearbyUnitsInCombatWithMe since it checks .Tagged and we only care if we are being attacked ctx => Unit.EnemyMeleeUnits.Count() >= StressMobCount, // earth totems // Spell.CastSelfSpell(WoWTotem.EarthElemental.ToSpellId(), // ret => (bool)ret && !Exist(WoWTotem.StoneBulwark),"Earth Elemental"), Spell.CastSelfSpell(WoWTotem.StoneBulwark.ToSpellId(), ret => Me.HealthPercent < 50 && !Exist(WoWTotem.EarthElemental), "Stone Bulwark"), new PrioritySelector( ctx => Unit.EnemyRangedUnits.Any(u => u.IsTargetingMeOrPet && u.IsPlayer && u.Combat), Spell.CastSelfSpell(WoWTotem.Earthgrab.ToSpellId(), ret => (bool)ret && !Exist(WoWTotem.StoneBulwark, WoWTotem.EarthElemental, WoWTotem.Earthbind), "Earth Grab"), Spell.CastSelfSpell(WoWTotem.Earthbind.ToSpellId(), ret => (bool)ret && !Exist(WoWTotem.StoneBulwark, WoWTotem.EarthElemental, WoWTotem.Earthgrab), "Earth Bind") ), Spell.CastSelfSpell(WoWTotem.Tremor.ToSpellId(), ret => Me.Fleeing && !Exist(WoWTotem.StoneBulwark, WoWTotem.EarthElemental), "Tremor"), // fire totems fireTotemBehavior, // water totems Spell.CastSpell("Mana Tide Totem", ret => ((bool)ret) && StyxWoW.Me.ManaPercent < 80 && !Exist(WoWTotem.HealingTide), "Mana Tide Totem"), /* Healing...: handle within Helaing logic * Spell.Cast("Healing Tide Totem", ret => ((bool)ret) && StyxWoW.Me.HealthPercent < 50 * && !Exist(WoWTotem.ManaTide)), * * Spell.Cast("Healing Stream Totem", ret => ((bool)ret) && StyxWoW.Me.HealthPercent < 80 * && !Exist( WoWTotemType.Water)), */ // air totems Spell.CastSpell("Grounding Totem", ret => ((bool)ret) && Unit.EnemyRangedUnits.Any(u => u.IsCasting) && !Exist(WoWTotemType.Air), "Grounding Totem"), Spell.CastSpell("Capacitor Totem", ret => ((bool)ret) && Unit.EnemyRangedUnits.Any(u => u.DistanceSqr < GetTotemRange(WoWTotem.Capacitor) * GetTotemRange(WoWTotem.Capacitor)) && !Exist(WoWTotemType.Air), "Capacitor Totem"), Spell.CastSpell("Stormlash Totem", ret => ((bool)ret) && ((CLUSettings.Instance.Shaman.UseStormlashTotem == StormlashTotem.OnHaste && Me.HasAnyAura(Me.IsHorde ? "Bloodlust" : "Heroism", "Timewarp", "Ancient Hysteria") || CLUSettings.Instance.Shaman.UseStormlashTotem == StormlashTotem.OnCooldown) && !Exist(WoWTotemType.Air)), "Stormlash Totem") )); }