Exemplo n.º 1
0
 /// <summary>
 ///     Switches the player to attack mode on the current unit
 /// </summary>
 public static void Engage(IMemoryAPI fface)
 {
     if (!fface.Player.Status.Equals(Status.Fighting))
     {
         fface.Windower.SendString(Constants.AttackTarget);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 ///     Makes the character stop resting
 /// </summary>
 public static void Stand(IMemoryAPI fface)
 {
     if (fface.Player.Status.Equals(Status.Healing))
     {
         fface.Windower.SendString(Constants.RestingOff);
         Thread.Sleep(50);
     }
 }
Exemplo n.º 3
0
        public UnitService(IMemoryAPI fface)
        {
            _fface = fface;

            // Create the UnitArray
            Units = Enumerable.Range(0, UnitArrayMax)
                .Select(x => new Unit(_fface, x)).ToList();
        }
Exemplo n.º 4
0
 public static void SetTarget(IMemoryAPI fface, Unit target)
 {
     if (!Config.Instance.EnableTabTargeting)
     {
         SetTargetUsingMemory(fface, target);
     }
     else
     {
         SetTargetByTabbing(fface, target);
     }
 }
Exemplo n.º 5
0
        public Unit(IMemoryAPI fface, int id)
        {
            // Set this unit's session data.
            _fface = fface;

            // Set the internal id.
            Id = id;

            // Set the NPC information.
            _npc = _fface.NPC;
        }
Exemplo n.º 6
0
        /// <summary>
        ///     Filters out unusable buffing abilities.
        /// </summary>
        /// <param name="fface"></param>
        /// <param name="action"></param>
        /// <returns></returns>
        public static bool BuffingFilter(IMemoryAPI fface, BattleAbility action)
        {
            var actionContext = new ActionContext
            {
                MemoryAPI = fface,
                BattleAbility = action
            };

            var actionRules = new BuffingActionRules();
            return actionRules.IsValid(actionContext);
        }
Exemplo n.º 7
0
        public static void SetSession(IMemoryAPI fface)
        {
            if (fface == null) return;

            // Save fface Instance
            FFACE = fface;

            // Create a new game engine to control our character. 
            GameEngine = new GameEngine(FFACE);

            OnSessionSet?.Invoke(fface);
        }
Exemplo n.º 8
0
        public FiniteStateMachine(IMemoryAPI fface)
        {
            //Create the states
            AddState(new DeadState(fface) { Priority = 6 });
            AddState(new ZoneState(fface) { Priority = 6 });
            AddState(new SetTargetState(fface) { Priority = 6 });
            AddState(new SetFightingState(fface) { Priority = 6 });
            AddState(new FollowState(fface) { Priority = 5 });
            AddState(new RestState(fface) { Priority = 2 });
            AddState(new ApproachState(fface) { Priority = 0 });
            AddState(new BattleState(fface) { Priority = 3 });
            AddState(new WeaponskillState(fface) { Priority = 2 });
            AddState(new PullState(fface) { Priority = 4 });
            AddState(new StartState(fface) { Priority = 5 });
            AddState(new TravelState(fface) { Priority = 1 });
            AddState(new HealingState(fface) { Priority = 2 });
            AddState(new EndState(fface) { Priority = 3 });
            AddState(new StartEngineState(fface) { Priority = Constants.MaxPriority });

            _states.ForEach(x => x.Enabled = true);
        }
Exemplo n.º 9
0
        /// <summary>
        ///     Checks whether a spell or ability can be recasted.
        /// </summary>
        /// <param name="fface"></param>
        /// <param name="ability"></param>
        /// <returns></returns>
        public static bool IsRecastable(IMemoryAPI fface, Ability ability)
        {
            var recast = 0;

            // No recast time on weaponskills. 
            if (ability.AbilityType == AbilityType.Weaponskill) return true;

            // No recast for ranged attacks. 
            if (AbilityType.Range.HasFlag(ability.AbilityType)) return true;

            // If a spell get spell recast
            if (ResourceHelper.IsSpell(ability.AbilityType))
            {
                recast = fface.Timer.GetSpellRecast(ability.Index);
            }

            // if ability get ability recast. 
            if (ResourceHelper.IsAbility(ability.AbilityType))
            {
                recast = fface.Timer.GetAbilityRecast(ability.Id);
            }

            return recast <= 0;
        }
Exemplo n.º 10
0
        /// <summary>
        ///     Filters out unusable targeted abilities.
        /// </summary>
        /// <param name="fface"></param>
        /// <param name="action"></param>
        /// <param name="unit"></param>
        /// <returns></returns>
        public static bool TargetedFilter(IMemoryAPI fface, BattleAbility action, Unit unit)
        {
            // Does not pass the base criteria for casting.
            if (!BuffingFilter(fface, action)) return false;

            // Target HP Checks Enabled.
            if (action.TargetLowerHealth != 0 || action.TargetUpperHealth != 0)
            {
                // Target Upper Health Check
                if (unit.HppCurrent > action.TargetUpperHealth) return false;

                // Target Lower Health Check
                if (unit.HppCurrent < action.TargetLowerHealth) return false;
            }

            // Target Name Checks Enabled.
            if (!string.IsNullOrWhiteSpace(action.TargetName))
            {
                // Target Name Check.
                if (!Regex.IsMatch(unit.Name, action.TargetName, RegexOptions.IgnoreCase)) return false;
            }

            return true;
        }
Exemplo n.º 11
0
 private void ViewModelBase_OnSessionSet(IMemoryAPI fface)
 {
     _recorder = new PathRecorder(fface);
     _recorder.OnPositionAdded += _recorder_OnPositionAdded;
 }
Exemplo n.º 12
0
 public Executor(IMemoryAPI fface)
 {
     _fface = fface;
 }
Exemplo n.º 13
0
 public SummonTrustsState(IMemoryAPI fface) : base(fface)
 {
     Executor = new Executor(fface);
 }
Exemplo n.º 14
0
 public ZoneState(IMemoryAPI fface) : base(fface)
 {
     Zone = fface.Player.Zone;
 }
Exemplo n.º 15
0
 public RestState(IMemoryAPI fface) : base(fface)
 {
     _units = new UnitService(fface);
 }
Exemplo n.º 16
0
        /// <summary>
        /// Returns true if a mob is attackable by the player based on the various settings in the
        /// Config class.
        /// </summary>
        /// <param name="fface"></param>
        /// <param name="mob"></param>
        /// <returns></returns>
        public static bool MobFilter(IMemoryAPI fface, Unit mob)
        {
            // Function to use to filter surrounding mobs by. General Mob Filtering Criteria
            if (fface == null) return false;
            if (mob == null) return false;

            // Mob not active
            if (!mob.IsActive) return false;

            // INFO: fixes trying to attack dead mob problem. Mob is dead
            if (mob.IsDead) return false;

            // Mob not rendered on screen.
            if (!mob.IsRendered) return false;

            // Type is not mob
            if (!mob.NpcType.Equals(NpcType.Mob)) return false;

            // Mob is out of range
            if (!(mob.Distance < Config.Instance.DetectionDistance)) return false;

            if (mob.IsPet) return false;

            // If any unit is within the wander distance then the
            if (Config.Instance.Route.Waypoints.Any())
            {
                if (!(Config.Instance.Route.Waypoints.Any(waypoint => Distance(mob, waypoint) <= Config.Instance.WanderDistance))) return false;
            }

            // Mob too high out of reach.
            if (mob.YDifference > Config.Instance.HeightThreshold) return false;

            // User Specific Filtering

            // Performs a case insensitve match on the mob's name. If any part of the mob's name is
            // in the ignored list, we will not attack it.
            if (MatchAny(mob.Name, Config.Instance.IgnoredMobs,
                RegexOptions.IgnoreCase)) return false;

            // Kill aggro if aggro's checked regardless of target's list but follows the ignored list.
            if (mob.HasAggroed && Config.Instance.AggroFilter) return true;

            // There is a target's list but the mob is not on it.
            if (!MatchAny(mob.Name, Config.Instance.TargetedMobs, RegexOptions.IgnoreCase) &&
                Config.Instance.TargetedMobs.Any())
                return false;

            // Mob on our targets list or not on our ignore list.

            // Kill the creature if it has aggroed and aggro is checked.
            if (mob.HasAggroed && Config.Instance.AggroFilter) return true;

            // Kill the creature if it is claimed by party and party is checked.
            if (mob.PartyClaim && Config.Instance.PartyFilter) return true;

            // Kill the creature if it's not claimed and unclaimed is checked.
            if (!mob.IsClaimed && Config.Instance.UnclaimedFilter) return true;

            // Kill the creature if it's claimed and we we don't have claim but
            // claim is checked.
            //FIX: Temporary fix until player.serverid is fixed.
            if (mob.IsClaimed && Config.Instance.ClaimedFilter) return true;

            // Kill only mobs that we have claim on.
            return mob.ClaimedId == fface.PartyMember[0].ServerID;
        }
Exemplo n.º 17
0
 public ApproachState(IMemoryAPI fface) : base(fface)
 {
 }
Exemplo n.º 18
0
 public CombatState(IMemoryAPI fface) : base(fface)
 {
 }
Exemplo n.º 19
0
 public StartEngineState(IMemoryAPI fface) : base(fface)
 {
 }
Exemplo n.º 20
0
 public Executor(IMemoryAPI fface)
 {
     _fface  = fface;
     _caster = new Caster(fface);
 }
Exemplo n.º 21
0
 public BattleState(IMemoryAPI fface) : base(fface)
 {
     _executor = new Executor(fface);
 }
Exemplo n.º 22
0
        /// <summary>
        ///     Filters out unusable buffing abilities.
        /// </summary>
        /// <param name="fface"></param>
        /// <param name="action"></param>
        /// <returns></returns>
        public static bool BuffingFilter(IMemoryAPI fface, BattleAbility action)
        {
            // Return if not enabled.
            if (!action.IsEnabled)
            {
                return(false);
            }

            // Name Check
            if (string.IsNullOrWhiteSpace(action.Name))
            {
                return(false);
            }

            // MP Check
            if (action.Ability.MpCost > fface.Player.MPCurrent)
            {
                return(false);
            }

            // TP Check
            if (action.Ability.TpCost > fface.Player.TPCurrent)
            {
                return(false);
            }

            // Usage Limit Check.
            if (action.UsageLimit != 0)
            {
                if (action.Usages > action.UsageLimit)
                {
                    return(false);
                }
            }

            // Recast Check
            if (!AbilityUtils.IsRecastable(fface, action.Ability))
            {
                return(false);
            }

            // Limiting Status Effect Check for Spells.
            if (ResourceHelper.IsSpell(action.Ability.AbilityType))
            {
                if (ProhibitEffects.ProhibitEffectsSpell.Intersect(fface.Player.StatusEffects).Any())
                {
                    return(false);
                }
            }

            // Limiting Status Effect Check for Abilities.
            if (ResourceHelper.IsAbility(action.Ability.AbilityType))
            {
                if (ProhibitEffects.ProhibitEffectsAbility.Intersect(fface.Player.StatusEffects).Any())
                {
                    return(false);
                }
            }

            // Player HP Checks Enabled.
            if (action.PlayerLowerHealth != 0 || action.PlayerUpperHealth != 0)
            {
                // Player Upper HP Check
                if (fface.Player.HPPCurrent > action.PlayerUpperHealth)
                {
                    return(false);
                }

                // Player Lower HP Check
                if (fface.Player.HPPCurrent < action.PlayerLowerHealth)
                {
                    return(false);
                }
            }

            // Status Effect Checks Enabled
            if (!string.IsNullOrWhiteSpace(action.StatusEffect))
            {
                var hasEffect = fface.Player.StatusEffects.Any(effect =>
                                                               Regex.IsMatch(effect.ToString(),
                                                                             action.StatusEffect.Replace(" ", "_"),
                                                                             RegexOptions.IgnoreCase));

                // Contains Effect Check
                if (hasEffect && !action.TriggerOnEffectPresent)
                {
                    return(false);
                }

                // Missing EFfect Check
                if (!hasEffect && action.TriggerOnEffectPresent)
                {
                    return(false);
                }
            }

            // Check if action's recast period has passed.
            if (action.Recast != 0)
            {
                if (action.LastCast > DateTime.Now)
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 23
0
 public StartEngineState(IMemoryAPI fface)
     : base(fface)
 {
 }
Exemplo n.º 24
0
 public DeadState(IMemoryAPI fface) : base(fface) { }
Exemplo n.º 25
0
        public FiniteStateMachine(IMemoryAPI fface)
        {
            //Create the states
            AddComponent(new TrackPlayerState(fface)
            {
                Priority = 6
            });
            AddComponent(new DeadState(fface)
            {
                Priority = 6
            });
            AddComponent(new ZoneState(fface)
            {
                Priority = 6
            });
            AddComponent(new SetTargetState(fface)
            {
                Priority = 6
            });
            AddComponent(new SetFightingState(fface)
            {
                Priority = 6
            });
            AddComponent(new FollowState(fface)
            {
                Priority = 5
            });
            AddComponent(new RestState(fface)
            {
                Priority = 2
            });
            AddComponent(new ApproachState(fface)
            {
                Priority = 0
            });
            AddComponent(new BattleState(fface)
            {
                Priority = 3
            });
            AddComponent(new WeaponskillState(fface)
            {
                Priority = 2
            });
            AddComponent(new PullState(fface)
            {
                Priority = 4
            });
            AddComponent(new StartState(fface)
            {
                Priority = 5
            });
            AddComponent(new TravelState(fface)
            {
                Priority = 1
            });
            AddComponent(new HealingState(fface)
            {
                Priority = 2
            });
            AddComponent(new EndState(fface)
            {
                Priority = 3
            });
            AddComponent(new StartEngineState(fface)
            {
                Priority = Constants.MaxPriority
            });

            _components.ForEach(x => x.Enabled = true);
        }
Exemplo n.º 26
0
 public TravelState(IMemoryAPI fface, IConfigFactory configFactory) : base(fface)
 {
     _configFactory = configFactory;
 }
Exemplo n.º 27
0
 public StartState(IMemoryAPI fface) : base(fface)
 {
     Executor = new Executor(fface);
 }
Exemplo n.º 28
0
 public GameEngine(IMemoryAPI fface)
 {
     _fface         = fface;
     _stateMachine  = new FiniteStateMachine(fface);
     _playerMonitor = new PlayerMonitor(fface);
 }
Exemplo n.º 29
0
 public ZoneState(IMemoryAPI fface)
     : base(fface)
 {
     _zone = fface.Player.Zone;
 }
Exemplo n.º 30
0
        public FiniteStateMachine(IMemoryAPI fface)
        {
            _fface   = fface;
            _context = new GameContext(fface);

            //Create the states
            AddState(new DeadState()
            {
                Priority = 7
            });
            AddState(new ZoneState()
            {
                Priority = 7
            });
            AddState(new SetTargetState()
            {
                Priority = 7
            });
            AddState(new SetFightingState()
            {
                Priority = 7
            });
            AddState(new FollowState()
            {
                Priority = 5
            });
            AddState(new RestState()
            {
                Priority = 2
            });
            AddState(new SummonTrustsState()
            {
                Priority = 6
            });
            AddState(new ApproachState()
            {
                Priority = 0
            });
            AddState(new BattleState()
            {
                Priority = 3
            });
            AddState(new WeaponskillState()
            {
                Priority = 2
            });
            AddState(new PullState()
            {
                Priority = 4
            });
            AddState(new StartState()
            {
                Priority = 5
            });
            AddState(new TravelState()
            {
                Priority = 1
            });
            AddState(new HealingState()
            {
                Priority = 2
            });
            AddState(new EndState()
            {
                Priority = 3
            });
            AddState(new StartEngineState()
            {
                Priority = Constants.MaxPriority
            });

            _states.ForEach(x => x.Enabled = true);
        }
Exemplo n.º 31
0
 public StartState(IMemoryAPI fface) : base(fface)
 {
     Executor = new Executor(fface);
 }
Exemplo n.º 32
0
        /// <summary>
        ///     Filters out unusable buffing abilities.
        /// </summary>
        /// <param name="fface"></param>
        /// <param name="action"></param>
        /// <param name="units"></param>
        /// <returns></returns>
        public static IEnumerable <Result> ValidateBuffingAction(
            IMemoryAPI fface,
            BattleAbility action,
            ICollection <IUnit> units)
        {
            // Return if not enabled.
            if (!action.IsEnabled)
            {
                yield return(Result.Fail("Must be enabled"));
            }

            // Name Check
            if (string.IsNullOrWhiteSpace(action.Name))
            {
                yield return(Result.Fail("Must have name"));
            }

            // MP Check
            if (action.Ability.MpCost > fface.Player.MPCurrent)
            {
                yield return(Result.Fail("Not enough mp"));
            }

            // TP Check
            if (action.Ability.TpCost > fface.Player.TPCurrent)
            {
                yield return(Result.Fail("Not enough tp"));
            }

            // MP Range
            var mpReserve = new Range(action.MPReserveLow, action.MPReserveHigh);

            if (!mpReserve.InRange(fface.Player.MPPCurrent) && !mpReserve.NotSet())
            {
                yield return(Result.Fail("Outside mp reserve range"));
            }

            // TP Range
            var tpReserve = new Range(action.TPReserveLow, action.TPReserveHigh);

            if (!tpReserve.InRange(fface.Player.TPCurrent) && !tpReserve.NotSet())
            {
                yield return(Result.Fail("Outside tp reserve range"));
            }

            // Usage Limit Check.
            if (action.UsageLimit != 0)
            {
                if (action.Usages > action.UsageLimit)
                {
                    yield return(Result.Fail("Max uses reached"));
                }
            }

            // Recast Check
            if (!AbilityUtils.IsRecastable(fface, action.Ability))
            {
                yield return(Result.Fail("Not recastable"));
            }

            // Limiting Status Effect Check for Spells.
            if (ResourceHelper.IsSpell(action.Ability.AbilityType))
            {
                if (ProhibitEffects.ProhibitEffectsSpell.Intersect(fface.Player.StatusEffects).Any())
                {
                    yield return(Result.Fail("Status effect blocking spell"));
                }
            }

            // Limiting Status Effect Check for Abilities.
            if (ResourceHelper.IsAbility(action.Ability.AbilityType))
            {
                if (ProhibitEffects.ProhibitEffectsAbility.Intersect(fface.Player.StatusEffects).Any())
                {
                    yield return(Result.Fail("Status effect blocking ability"));
                }
            }

            // Player HP Checks Enabled.
            if (action.PlayerLowerHealth != 0 || action.PlayerUpperHealth != 0)
            {
                // Player Upper HP Check
                if (fface.Player.HPPCurrent > action.PlayerUpperHealth)
                {
                    yield return(Result.Fail("Player health too high"));
                }

                // Player Lower HP Check
                if (fface.Player.HPPCurrent < action.PlayerLowerHealth)
                {
                    yield return(Result.Fail("Player health too low"));
                }
            }

            // Status Effect Checks Enabled
            if (!string.IsNullOrWhiteSpace(action.StatusEffect))
            {
                var hasEffect = fface.Player.StatusEffects.Any(effect =>
                                                               Regex.IsMatch(effect.ToString(),
                                                                             action.StatusEffect.Replace(" ", "_"),
                                                                             RegexOptions.IgnoreCase));

                // Contains Effect Check
                if (hasEffect && !action.TriggerOnEffectPresent)
                {
                    yield return(Result.Fail("Player missing status effect"));
                }

                // Missing EFfect Check
                if (!hasEffect && action.TriggerOnEffectPresent)
                {
                    yield return(Result.Fail("Player contains status effect"));
                }
            }

            // Check if action's recast period has passed.
            if (action.Recast != 0)
            {
                if (action.LastCast > DateTime.Now)
                {
                    yield return(Result.Fail("Recast period not reached"));
                }
            }

            // Do not cast trust magic with aggro.
            var isTrustMagic = action.Ability.Type == "Trust";
            var hasAggro     = units.Any(x => x.HasAggroed);

            if (isTrustMagic && hasAggro)
            {
                yield return(Result.Fail("Cannot use trust magic with aggro"));
            }
        }
Exemplo n.º 33
0
 public EndState(IMemoryAPI fface)
     : base(fface)
 {
     _executor = new Executor(fface);
 }
Exemplo n.º 34
0
 protected BaseState(IMemoryAPI fface)
 {
     this.fface = fface;
 }
Exemplo n.º 35
0
 public Player(IMemoryAPI memoryAPI)
 {
     _memoryAPI   = memoryAPI;
     _unitService = new UnitService(memoryAPI);
 }
Exemplo n.º 36
0
 private static void SetTargetUsingMemory(IMemoryAPI fface, IUnit target)
 {
     fface.Target.SetNPCTarget(target.Id);
     fface.Windower.SendString(Constants.SetTargetCursor);
 }
Exemplo n.º 37
0
 public SetTargetState(IMemoryAPI fface) : base(fface)
 {
     _units = new UnitService(fface);
 }
Exemplo n.º 38
0
 public static void StopRunning(IMemoryAPI fface)
 {
     fface.Navigator.Reset();
     TimeWaiter.Pause(100);
 }
Exemplo n.º 39
0
 public TravelState(IMemoryAPI fface) : base(fface)
 {
 }
 public PlayerMovementTracker(IMemoryAPI fface)
 {
     _fface = fface;
 }
Exemplo n.º 41
0
 public Executor(IMemoryAPI fface)
 {
     _fface = fface;
 }
Exemplo n.º 42
0
 public CombatState(IMemoryAPI fface)
     : base(fface)
 {
 }
Exemplo n.º 43
0
 public FollowState(IMemoryAPI fface) : base(fface)
 {
     this.UnitService = new UnitService(fface);
 }
Exemplo n.º 44
0
 public TrackPlayerState(IMemoryAPI fface) : base(fface)
 {
 }
Exemplo n.º 45
0
 public WeaponskillState(IMemoryAPI fface) : base(fface)
 {
     _executor = new Executor(fface);
 }
Exemplo n.º 46
0
 public SetFightingState(IMemoryAPI fface) : base(fface) { }
Exemplo n.º 47
0
 protected BaseState(IMemoryAPI fface)
 {
     this.fface = fface;
 }
Exemplo n.º 48
0
        /// <summary>
        /// Returns true if a mob is attackable by the player based on the various settings in the
        /// Config class.
        /// </summary>
        /// <param name="fface"></param>
        /// <param name="mob"></param>
        /// <returns></returns>
        public static bool MobFilter(IMemoryAPI fface, IUnit mob)
        {
            // Function to use to filter surrounding mobs by. General Mob Filtering Criteria
            if (fface == null)
            {
                return(false);
            }
            if (mob == null)
            {
                return(false);
            }

            // Mob not active
            if (!mob.IsActive)
            {
                return(false);
            }

            // INFO: fixes trying to attack dead mob problem. Mob is dead
            if (mob.IsDead)
            {
                return(false);
            }

            // Mob not rendered on screen.
            if (!mob.IsRendered)
            {
                return(false);
            }

            // Type is not mob
            if (!mob.NpcType.Equals(NpcType.Mob))
            {
                return(false);
            }

            // Mob is out of range
            if (!(mob.Distance < Config.Instance.DetectionDistance))
            {
                return(false);
            }

            if (mob.IsPet)
            {
                return(false);
            }

            // If any unit is within the wander distance then the
            if (Config.Instance.Route.Waypoints.Any())
            {
                if (!(Config.Instance.Route.Waypoints.Any(waypoint => Distance(mob, waypoint) <= Config.Instance.WanderDistance)))
                {
                    return(false);
                }
            }

            // Mob too high out of reach.
            if (mob.YDifference > Config.Instance.HeightThreshold)
            {
                return(false);
            }

            // User Specific Filtering

            // Performs a case insensitve match on the mob's name. If any part of the mob's name is
            // in the ignored list, we will not attack it.
            if (MatchAny(mob.Name, Config.Instance.IgnoredMobs,
                         RegexOptions.IgnoreCase))
            {
                return(false);
            }

            // Kill aggro if aggro's checked regardless of target's list but follows the ignored list.
            if (mob.HasAggroed && Config.Instance.AggroFilter)
            {
                return(true);
            }

            // There is a target's list but the mob is not on it.
            if (!MatchAny(mob.Name, Config.Instance.TargetedMobs, RegexOptions.IgnoreCase) &&
                Config.Instance.TargetedMobs.Any())
            {
                return(false);
            }

            // Mob on our targets list or not on our ignore list.

            // Kill the creature if it has aggroed and aggro is checked.
            if (mob.HasAggroed && Config.Instance.AggroFilter)
            {
                return(true);
            }

            // Kill the creature if it is claimed by party and party is checked.
            if (mob.PartyClaim && Config.Instance.PartyFilter)
            {
                return(true);
            }

            // Kill the creature if it's not claimed and unclaimed is checked.
            if (!mob.IsClaimed && Config.Instance.UnclaimedFilter)
            {
                return(true);
            }

            // Kill the creature if it's claimed and we we don't have claim but
            // claim is checked.
            //FIX: Temporary fix until player.serverid is fixed.
            if (mob.IsClaimed && Config.Instance.ClaimedFilter)
            {
                return(true);
            }

            // Kill only mobs that we have claim on.
            return(mob.ClaimedId == fface.PartyMember[0].ServerID);
        }
Exemplo n.º 49
0
 public Executor(IMemoryAPI fface)
 {
     _fface = fface;
     _caster = new Caster(fface);
 }
Exemplo n.º 50
0
 public GameEngine(IMemoryAPI fface)
 {
     _fface = fface;
     _stateMachine = new FiniteStateMachine(fface);
 }
Exemplo n.º 51
0
 public RestState(IMemoryAPI fface) : base(fface)
 {
     _units = new UnitService(fface);
 }
Exemplo n.º 52
0
 public PlayerMonitor(IMemoryAPI memory)
 {
     _movementTracker = new PlayerMovementTracker(memory);
 }
Exemplo n.º 53
0
 public ApproachState(IMemoryAPI fface)
     : base(fface)
 {
 }
Exemplo n.º 54
0
 public HealingState(IMemoryAPI fface) : base(fface)
 {
     _executor = new Executor(fface);
 }
Exemplo n.º 55
0
 public PlayerMonitor(IMemoryAPI memory)
 {
     _movementTracker = new PlayerMovementTracker(memory);
 }
Exemplo n.º 56
0
 public Caster(IMemoryAPI fface)
 {
     _fface = fface;
 }
Exemplo n.º 57
0
 /// <summary>
 /// Create a new <see cref="PathRecorder"/> with saving and 
 /// loading features. 
 /// </summary>
 /// <param name="memory"></param>
 public PathRecorder(IMemoryAPI memory)
 {
     _memory = memory;
     _recorder = new Timer(1000);
     _recorder.Elapsed += RouteRecorder_Tick;
 }
Exemplo n.º 58
0
 public DeadState(IMemoryAPI fface) : base(fface)
 {
 }
Exemplo n.º 59
0
 public FollowState(IMemoryAPI fface) : base(fface)
 {
     this.UnitService = new UnitService(fface);
 }
Exemplo n.º 60
0
 /// <summary>
 /// Create a new <see cref="PathRecorder"/> with saving and
 /// loading features.
 /// </summary>
 /// <param name="memory"></param>
 public PathRecorder(IMemoryAPI memory)
 {
     _memory            = memory;
     _recorder          = new Timer(1000);
     _recorder.Elapsed += RouteRecorder_Tick;
 }