コード例 #1
0
        protected override void OnUpdate(TimeSpan time)
        {
            var x = Flocks.GetMembers().Any(m => m.AI.Current is AggressorAI);

            if (x)
            {
                ResetDynamicDespawnTimer();
            }

            _lifeTimeTracker.Update(time);

            if (_lifeTimeTracker.Expired)
            {
                OnPresenceExpired();
            }
        }
コード例 #2
0
        private Flock SpawnFlock(int flockID)
        {
            var flock = CreateAndAddFlock(flockID);

            flock.SpawnAllMembers();

            var summoner = GetSummonerPlayer();

            if (summoner != null)
            {
                foreach (var npc in Flocks.GetMembers())
                {
                    npc.AddDirectThreat(summoner, 40 + FastRandom.NextDouble(0.0, 3.0));
                    npc.Tag(summoner, LifeTime);
                }
            }

            Zone.CreateBeam(BeamType.teleport_storm, builder => builder.WithPosition(DynamicPosition.GetRandomPositionInRange2D(0, 3)).WithDuration(100000));
            return(flock);
        }