Exemplo n.º 1
0
            private void FindNextRoamingPosition()
            {
                _presence.Log("finding new roaming position. current: " + _presence.CurrentRoamingPosition);
                var nextRoamingPosition = _presence.PathFinder.FindNextRoamingPosition(_presence);

                _presence.Log("next roaming position: " + nextRoamingPosition + " dist:" + _presence.CurrentRoamingPosition.Distance(nextRoamingPosition));
                _presence.CurrentRoamingPosition = nextRoamingPosition;

                foreach (var npc in _presence.Flocks.GetMembers())
                {
                    npc.HomePosition = _presence.CurrentRoamingPosition.ToPosition();
                }
            }
Exemplo n.º 2
0
            private void SpawnFlocks()
            {
                Position spawnPosition;
                bool     anyPlayersAround;

                do
                {
                    spawnPosition    = _presence.PathFinder.FindSpawnPosition(_presence).ToPosition();
                    anyPlayersAround = _presence.Zone.Players.WithinRange(spawnPosition, 200).Any();
                } while (anyPlayersAround);

                _presence.SpawnOrigin            = spawnPosition;
                _presence.CurrentRoamingPosition = spawnPosition;
                _presence.Log("spawn position: " + spawnPosition);

                //spawn all flocks
                foreach (var flock in _presence.Flocks)
                {
                    flock.SpawnAllMembers();
                }
            }