Example #1
0
 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))))));
 }
Example #2
0
        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;
            }))
                       ));
        }
Example #3
0
 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)))));
 }