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)))))); }
protected Composite CreateAutoAttack(bool includePet) { const int SPELL_ID_AUTO_SHOT = 75; return(new PrioritySelector( new Decorator( ret => !Me.IsAutoAttacking && Me.AutoRepeatingSpellId != SPELL_ID_AUTO_SHOT, new Action(ret => Me.ToggleAttack())), new Decorator( ret => includePet && Me.GotAlivePet && (Me.Pet.CurrentTarget == null || Me.Pet.CurrentTarget != Me.CurrentTarget), new Action( delegate { PetManager.CastPetAction("Attack"); return RunStatus.Failure; })) )); }
protected Composite CreateCastPetActionOn(string action, UnitSelectionDelegate onUnit, SimpleBoolReturnDelegate extra) { return(new Decorator( ret => extra(ret) && PetManager.CanCastPetAction(action), new Action(ret => PetManager.CastPetAction(action, onUnit(ret))))); }