System.TimeSpan.FromSeconds(double)

Here are the examples of the csharp api class System.TimeSpan.FromSeconds(double) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

200 Examples 7

1. Example

Project: FilterLists
Source File: ListsController.cs
[HttpGet]
        public IActionResult Get()
        {
            return memoryCache.GetOrCreate(CacheKeys.Entry, entry =>
            {
                entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(86400);
                return Json(filterListService.GetAllSummaries());
            });
        }

2. Example

Project: FilterLists
Source File: HomeController.cs
public IActionResult Index()
        {
            return memoryCache.GetOrCreate(CacheKeys.Entry, entry =>
            {
                entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(86400);
                return View();
            });
        }

3. Example

Project: confluent-kafka-dotnet
Source File: Program.cs
public static void Main(string[] args)
        {
            var config = new Dictionary<string, /n ..... /n //View Source file for more details /n }

4. Example

Project: confluent-kafka-dotnet
Source File: Producer_ProduceAsync_Await.cs
public static async Task Producer_ProduceAsync_Await_Task(Dictionary<string, object> config, string topic)
        {
            using (var producer = new Producer(config))
            {
                var dr = await producer.ProduceAsync(topic, new byte[] {42}, new byte[] {44});
                Assert.Equal(ErrorCode.NoError, dr.Error.Code);
                producer.Flush(TimeSpan.FromSeconds(10));
            }
        }

5. Example

Project: confluent-kafka-dotnet
Source File: Producer_ProduceAsync_DeliveryHandler.cs
[Theory, MemberData(nameof(KafkaParameters))]
        public static void Producer_ProduceAsync_Deliv/n ..... /n //View Source file for more details /n }

6. Example

Project: confluent-kafka-dotnet
Source File: Producer_ProduceAsync_Null_DeliveryHandler.cs
[Theory, MemberData(nameof(KafkaParameters))]
        public static void Producer_ProduceAsync_Null_DeliveryHandler(string bootstrapServers, string topic, string partitionedTopic)
        {
            var producerConfig = new Dictionary<string, object> 
            { 
                { "bootstrap.servers", bootstrapServers },
                { "api.version.request", true }
            };

            var dh = new DeliveryHandler_PN(topic);

            using (var producer = new Producer(producerConfig))
            {
                producer.ProduceAsync(topic, null, 0, 0, null, 0, 0, 0, true, dh);
                producer.ProduceAsync(topic, null, 0, 0, null, 0, 0, 0, dh);
                producer.ProduceAsync(topic, null, 0, 0, null, 0, 0, true, dh);
                producer.ProduceAsync(topic, null, 0, 0, null, 0, 0, dh);
                producer.ProduceAsync(topic, null, null, dh);
                Assert.Throws<ArgumentException>(() => producer.ProduceAsync(topic, null, -123, int.MinValue, null, int.MaxValue, 44, dh));
                producer.Flush(TimeSpan.FromSeconds(10));
            }

            Assert.Equal(5, dh.Count);
        }

7. Example

Project: confluent-kafka-dotnet
Source File: SerializingProducer_ProduceAsync_Await.cs
public static async Task SerializingProducer_ProduceAsync_Await_Task(Dictionary<string, object> config, string topic)
        {
            using (var producer = new Producer<Null, string>(config, null, new StringSerializer(Encoding.UTF8)))
            {
                var dr = await producer.ProduceAsync(topic, null, "test string");
                Assert.Equal(ErrorCode.NoError, dr.Error.Code);
                producer.Flush(TimeSpan.FromSeconds(10));
            }
        }

8. Example

Project: confluent-kafka-dotnet
Source File: SerializingProducer_ProduceAsync_DeliveryHandler.cs
[Theory, MemberData(nameof(KafkaParameters))]
        public static void SerializingProducer_ProduceAsync_DeliveryHandler(string bootstrapServers, string topic, string partitionedTopic)
        {
            var producerConfig = new Dictionary<string, object> 
            { 
                { "bootstrap.servers", bootstrapServers },
                { "api.version.request", true }
            };

            var dh = new DeliveryHandler_SP(topic);

            using (var producer = new Producer<string, string>(producerConfig, new StringSerializer(Encoding.UTF8), new StringSerializer(Encoding.UTF8)))
            {
                producer.ProduceAsync(topic, "test key 0", "test val 0", 0, true, dh);
                producer.ProduceAsync(topic, "test key 1", "test val 1", 0, dh);
                producer.ProduceAsync(topic, "test key 2", "test val 2", true, dh);
                producer.ProduceAsync(topic, "test key 3", "test val 3", dh);
                producer.Flush(TimeSpan.FromSeconds(10));
            }

            Assert.Equal(4, dh.Count);
        }

9. Example

Project: confluent-kafka-dotnet
Source File: SerializingProducer_ProduceAsync_Null_DeliveryHandler.cs
[Theory, MemberData(nameof(KafkaParameters))]
        public static void SerializingProducer_ProduceAsync_Null_DeliveryHandler(string bootstrapServers, string topic, string partitionedTopic)
        {
            var producerConfig = new Dictionary<string, object> 
            { 
                { "bootstrap.servers", bootstrapServers },
                { "api.version.request", true }
            };

            var dh = new DeliveryHandler_SPN(topic);

            using (var producer = new Producer<Null, Null>(producerConfig, null, null))
            {
                producer.ProduceAsync(topic, null, null, 0, true, dh);
                producer.ProduceAsync(topic, null, null, 0, dh);
                producer.ProduceAsync(topic, null, null, true, dh);
                producer.ProduceAsync(topic, null, null, dh);
                producer.Flush(TimeSpan.FromSeconds(10));
            }

            Assert.Equal(4, dh.Count);
        }

10. Example

Project: GridDomain
Source File: PersistentHubChildrenLifetimeTest.cs
private async Task<HealthStatus> PingChild(string payload)
        {
            return await Child.Ref.Ask(new CheckHealth(payload), TimeSpan.FromSeconds(1)) as HealthStatus;
        }

11. Example

Project: QuickUnity
Source File: ResultSummarizer.cs
public void Summarize(ITestResult result)
        {
            m_Duration += TimeSpan.FromSeconds(r/n ..... /n //View Source file for more details /n }

12. Example

Project: couchbase-net-examples
Source File: Program.cs
static async Task<bool> UpdatePostWithLockAsync(Post modified)
        {
            var bucket = ClusterHelper.GetBucket("default");
            var success = false;

            //get the original document - if it doesn't exist fail
            var result = await bucket.GetWithLockAsync<Post>(modified.PostId, TimeSpan.FromSeconds(5));
            if (result.Success)
            {
                //update the original documents fields
                var original = result.Value;
                original.Content = modified.Content;
                original.Author = modified.Author;
                original.Views = original.Views++;

                //perform the mutation passing in the CAS value
                var updated = await bucket.UpsertAsync(original.PostId, original, result.Cas);
                if (updated.Success)
                {
                    success = true;
                }
                await bucket.UnlockAsync(original.PostId, result.Cas);
            }
            return success;
        }

13. Example

Project: MonoGame.Extended
Source File: ParticlesDemo.cs
private void ParticleInit(TextureRegion2D textureRegion)
        {
            _particleEffect = new/n ..... /n //View Source file for more details /n }

14. Example

Project: MonoGame.Extended
Source File: BulletExplosionTemplate.cs
protected override void Build(Entity entity)
        {
            entity.Group = "EFFECTS";
            entity.Attach<TransformComponent>();
            entity.Attach<SpatialFormComponent>(c => c.SpatialFormFile = "BulletExplosion");
            entity.Attach<ExpiresComponent>(c => c.LifeTime = TimeSpan.FromSeconds(1));
        }

15. Example

Project: MonoGame.Extended
Source File: EnemyShipTemplate.cs
protected override void Build(Entity entity)
        {
            entity.Group = "SHIPS";
            entity.Attach<TransformComponent>();
            entity.Attach<SpatialFormComponent>(c => c.SpatialFormFile = "EnemyShip");
            entity.Attach<HealthComponent>(c => 
            {
                c.Points = 10;
                c.MaximumPoints = 10;
            });
            entity.Attach<WeaponComponent>(c => c.ShootDelay = TimeSpan.FromSeconds(2));
            entity.Attach<EnemyComponent>();
            entity.Attach<PhysicsComponent>();
        }

16. Example

Project: MonoGame.Extended
Source File: TimeSpanJsonConverter.cs
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            if (reader.ValueType == typeof(double))
            {
                var seconds = (double) reader.Value;
                return TimeSpan.FromSeconds(seconds);
            }

            return TimeSpan.Zero;
        }

17. Example

Project: MonoGame.Extended
Source File: EmitterTests.cs
[Test]
            public void WhenThereAreParticlesToExpire_DoesNotPassExpiredParticlesToModifiers()
            {
                var subject = new ParticleEmitter(null, 100, TimeSpan.FromSeconds(1), Profile.Point())
                {
                    Parameters = new ParticleReleaseParameters()
                    {
                        Quantity = 1
                    },
                    Modifiers =
                    {
                        new AssertionModifier(particle => particle.Age <= 1f)
                    }
                };

                subject.Trigger(new Vector2(0f, 0f));
                subject.Update(0.5f);
                subject.Trigger(new Vector2(0f, 0f));
                subject.Update(0.5f);
                subject.Trigger(new Vector2(0f, 0f));
                subject.Update(0.5f);
            }

18. Example

Project: MonoGame.Extended
Source File: EmitterTests.cs
[Test]
            public void IsIdempotent()
            {
                var subject = new ParticleEmitter(null, 10, TimeSpan.FromSeconds(1), Profile.Point());

                subject.Dispose();
                subject.Dispose();
            }

19. Example

Project: SF-Boilerplate
Source File: MemoryTreeCache.cs
public void AddToCache(TreeNode<NavigationNode> tree, string cacheKey)
        {
            cache.Set(
                cacheKey,
                tree,
                new MemoryCacheEntryOptions()
                 .SetSlidingExpiration(TimeSpan.FromSeconds(options.CacheDurationInSeconds))
                 );
        }

20. Example

Project: RedditSharp
Source File: Comment.cs
public async Task<Comment> ReplyAsync(string message)
        {
            // TODO actual error handling. This just hides the error and returns null
            //try
            //{
                var json = await WebAgent.Post(CommentUrl, new
                {
                    text = message,
                    thing_id = FullName,
                    api_type = "json"
                    //r = Subreddit
                }).ConfigureAwait(false);
                if (json["json"]["ratelimit"] != null)
                    throw new RateLimitException(TimeSpan.FromSeconds(json["json"]["ratelimit"].ValueOrDefault<double>()));
                return new Comment(WebAgent, json["json"]["data"]["things"][0], this);
            //}
            //catch (HttpRequestException ex)
            //{
            //    var error = new StreamReader(ex..GetResponseStream()).ReadToEnd();
            //    return null;
            //}
        }

21. Example

Project: RedditSharp
Source File: Post.cs
public async Task<Comment> CommentAsync(string message)
        {
            var json = await WebAgent.Post(CommentUrl, new
            {
                text = message,
                thing_id = FullName,
                api_type = "json"
            }).ConfigureAwait(false);
            if (json["json"]["ratelimit"] != null)
                throw new RateLimitException(TimeSpan.FromSeconds(json["json"]["ratelimit"].ValueOrDefault<double>()));
            return new Comment(WebAgent, json["json"]["data"]["things"][0], this);
        }

22. Example

Project: BoC
Source File: CheckArgumentFixture.cs
[Fact]
        public void IsNotNegative_With_Minus_One_Second_Should_Throw_Exception()
        {
            Assert.Throws<ArgumentOutOfRangeException>(() => Check.Argument.IsNotNegative(TimeSpan.FromSeconds(-1), "MinusOneSecond"));
        }

23. Example

Project: BoC
Source File: CheckArgumentFixture.cs
[Fact]
        public void IsNotNegativeOrZero_With_Plus_One_Second_Should_Not_Throw_Exception()
        {
            Assert.DoesNotThrow(() => Check.Argument.IsNotNegativeOrZero(TimeSpan.FromSeconds(1), "PlusOneSecond"));
        }

24. Example

Project: Xamarin-Plugins
Source File: SimpleAudioPlayerImplementation.cs
public void Seek (double position)
        {
            if (player == null || player.PlaybackSession == null)
                return;

            if (player.PlaybackSession.CanSeek)
                player.PlaybackSession.Position = TimeSpan.FromSeconds(position);
        }

25. Example

Project: CypherCore
Source File: ScriptedAI.cs
public void _DespawnAtEvade(uint delayToRespawn = 30, Creature who = null)
        {
            if (delayToRespawn < 2)
            {
                Log.outError(LogFilter.Scripts, "_DespawnAtEvade called with delay of {0} seconds, defaulting to 2.", delayToRespawn);
                delayToRespawn = 2;
            }

            if (!who)
                who = me;

            TempSummon whoSummon = who.ToTempSummon();
            if (whoSummon)
            {
                Log.outWarn(LogFilter.ScriptsAi, "_DespawnAtEvade called on a temporary summon.");
                whoSummon.UnSummon();
                return;
            }

            who.DespawnOrUnsummon(0, TimeSpan.FromSeconds(delayToRespawn));

            if (instance != null && who == me)
                instance.SetBossState(_bossId, EncounterState.Fail);
        }

26. Example

Project: CypherCore
Source File: SmartAI.cs
void UpdateDespawn(uint diff)
        {
            if (mDespawnState <= 1 || mDespawnState > 3)
                return;

            if (mDespawnTime < diff)
            {
                if (mDespawnState == 2)
                {
                    me.SetVisible(false);
                    mDespawnTime = 5000;
                    mDespawnState++;
                }
                else
                    me.DespawnOrUnsummon(0, TimeSpan.FromSeconds(mRespawnTime));
            }
            else
                mDespawnTime -= diff;
        }

27. Example

Project: CypherCore
Source File: Curator.cs
void Initialize()
        {
            _scheduler.Schedule(TimeSpan.FromSeconds(10), task =>
   /n ..... /n //View Source file for more details /n }

28. Example

Project: CypherCore
Source File: BossHogger.cs
public override void EnterCombat(Unit who)
        {
            _EnterCombat();
            Talk(TextIds.SayPull);

            _scheduler.SetValidator(() => !me.HasUnitState(UnitState.Casting));

            _scheduler.Schedule(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(4), task =>
            {
                DoCastVictim(SpellIds.ViciousSlice);
                task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(14));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2), task =>
            {
                DoCast(SpellIds.MaddeningCall);
                task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(20));
            });
        }

29. Example

Project: CypherCore
Source File: BossHogger.cs
public override void MovementInform(MovementGeneratorType type, uint id)
        {
            if (type == MovementGeneratorType.Point && id == 0)
                _events.ScheduleEvent(Events.SayWarden1, TimeSpan.FromSeconds(1));
        }

30. Example

Project: CypherCore
Source File: BossHogger.cs
public override void UpdateAI(uint diff)
        {
            _events.Update(diff);

            _events.ExecuteEvents(eventId =>
            {
                switch (eventId)
                {
                    case Events.SayWarden1:
                        Talk(TextIds.SayWarden1);
                        _events.ScheduleEvent(Events.SayWarden2, TimeSpan.FromSeconds(4));
                        break;
                    case Events.SayWarden2:
                        Talk(TextIds.SayWarden2);
                        _events.ScheduleEvent(Events.SayWarden3, TimeSpan.FromSeconds(3));
                        break;
                    case Events.SayWarden3:
                        Talk(TextIds.SayWarden3);
                        break;
                }
            });
        }

31. Example

Project: CypherCore
Source File: BossAmanitar.cs
public override void Reset()
        {
            _scheduler.CancelAll();
            _scheduler.SetValidator(() => !me.HasUnitState(UnitState.Casting));

            _scheduler.Schedule(TimeSpan.FromSeconds(1), task =>
            {
                if (me.GetEntry() == CreatureIds.PoisonousMushroom)
                {
                    DoCast(me, SpellIds.PoisonousMushroomVisualArea, true);
                    DoCast(me, SpellIds.PoisonousMushroomPoisonCloud);
                }
                task.Repeat(TimeSpan.FromSeconds(7));
            });

            me.SetDisplayId(me.GetCreatureTemplate().ModelId2);
            DoCast(SpellIds.PutridMushroom);

            if (me.GetEntry() == CreatureIds.PoisonousMushroom)
                DoCast(SpellIds.PoisonousMushroomVisualAura);
            else
                DoCast(SpellIds.PowerMushroomVisualAura);
        }

32. Example

Project: CypherCore
Source File: BossElderNadox.cs
public override void EnterCombat(Unit who)
        {
            _EnterCombat();
            Talk(TextIds.SayAggro);

            _scheduler.Schedule(TimeSpan.FromSeconds(13), task =>
            {
                DoCast(SelectTarget(SelectAggroTarget.Random, 0, 100, true), SpellIds.BroodPlague, true);
                task.Repeat(TimeSpan.FromSeconds(15));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(10), task =>
            {
                /// @todo: summoned by egg
                DoCast(me, SpellIds.SummonSwarmers);
                if (RandomHelper.URand(1, 3) == 3) // 33% chance of dialog
                    Talk(TextIds.SayEggSac);
                task.Repeat();
            });

            if (IsHeroic())
            {
                _scheduler.Schedule(TimeSpan.FromSeconds(12), task =>
                {
                    DoCast(SpellIds.HBroodRage);
                    task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(50));
                });

                _scheduler.Schedule(TimeSpan.FromSeconds(5), task =>
                {
                    if (me.HasAura(SpellIds.Enrage))
                        return;
                    if (me.GetPositionZ() < 24.0f)
                        DoCast(me, SpellIds.Enrage, true);
                    task.Repeat();
                });
            }
        }

33. Example

Project: CypherCore
Source File: BossElderNadox.cs
public override void Reset()
        {
            _scheduler.CancelAll();
            _scheduler.Schedule(TimeSpan.FromSeconds(13), task =>
            {
                DoCast(me, SpellIds.Sprint);
                task.Repeat(TimeSpan.FromSeconds(20));
            });
        }

34. Example

Project: CypherCore
Source File: BossAnubarak.cs
public override void SpellHit(Unit whose, SpellInfo spell)
        {
            if (spell.Id == Spe/n ..... /n //View Source file for more details /n }

35. Example

Project: CypherCore
Source File: BossAnubarak.cs
public override void InitializeAI()
        {
            Creature anubarak = me.GetInstanceScript().GetCreature(ANDataTypes.Anubarak);
            if (anubarak)
            {
                DoCastSelf(SpellIds.ImpaleVisual);
                me.DespawnOrUnsummon(TimeSpan.FromSeconds(6));
                anubarak.GetAI().SetGUID(me.GetGUID(), Misc.GuidTypeImpale);
            }
            else
                me.DespawnOrUnsummon();
        }

36. Example

Project: CypherCore
Source File: BossKrikthirTheGatewatcher.cs
public override void EnterCombat(Unit who)
        {
            _petsInCombat = false;
            me.SetReactState(ReactStates.Aggressive);
            summons.DoZoneInCombat();

            _events.CancelEvent(Misc.EventSendGroup);
            _events.ScheduleEvent(Misc.EventSwarm, TimeSpan.FromSeconds(5));
            _events.ScheduleEvent(Misc.EventMindFlay, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(3));

            base.EnterCombat(who);
        }

37. Example

Project: CypherCore
Source File: BossKrikthirTheGatewatcher.cs
public override void UpdateAI(uint diff)
        {
            if (!UpdateVictim() && !_petsInCombat/n ..... /n //View Source file for more details /n }

38. Example

Project: CypherCore
Source File: BossKrikthirTheGatewatcher.cs
public override void _EnterCombat()
        {
            _scheduler.SetValidator(() => !me.HasUnitState(UnitState.Casting));

            _scheduler.Schedule(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(5), task =>
            {
                DoCastSelf(SpellIds.Enrage);
                task.Repeat(TimeSpan.FromSeconds(12), TimeSpan.FromSeconds(20));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(16), TimeSpan.FromSeconds(19), task =>
            {
                Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100.0f);
                if (target)
                    DoCast(target, SpellIds.WebWrap);
                task.Repeat(TimeSpan.FromSeconds(13), TimeSpan.FromSeconds(19));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(11), task =>
            {
                DoCastVictim(SpellIds.InfectedBite);
                task.Repeat(TimeSpan.FromSeconds(23), TimeSpan.FromSeconds(27));
            });
        }

39. Example

Project: CypherCore
Source File: BossKrikthirTheGatewatcher.cs
public override void _EnterCombat()
        {
            _scheduler.SetValidator(() => !me.HasUnitState(UnitState.Casting));

            _scheduler.Schedule(TimeSpan.FromSeconds(13), TimeSpan.FromSeconds(18), task =>
            {
                DoCastVictim(SpellIds.BlindingWebs);
                task.Repeat(TimeSpan.FromSeconds(23), TimeSpan.FromSeconds(27));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(5), task =>
            {
                Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100, true);
                if (target)
                    DoCast(target, SpellIds.WebWrap);
                task.Repeat(TimeSpan.FromSeconds(13), TimeSpan.FromSeconds(19));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(11), task =>
            {
                DoCastVictim(SpellIds.InfectedBite);
                task.Repeat(TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(25));
            });
        }

40. Example

Project: CypherCore
Source File: BossKrikthirTheGatewatcher.cs
public override void _EnterCombat()
        {
            _scheduler.SetValidator(() => !me.HasUnitState(UnitState.Casting));

            _scheduler.Schedule(TimeSpan.FromSeconds(16), TimeSpan.FromSeconds(19), task =>
             {
                 DoCastVictim(SpellIds.PoisonSpray);
                 task.Repeat(TimeSpan.FromSeconds(13), TimeSpan.FromSeconds(19));
             });

            _scheduler.Schedule(TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(11), task =>
            {
                Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100, true);
                if (target)
                    DoCast(target, SpellIds.WebWrap);
                task.Repeat(TimeSpan.FromSeconds(13), TimeSpan.FromSeconds(17));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(5), task =>
            {
                DoCastVictim(SpellIds.InfectedBite);
                task.Repeat(TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(24));
            });
        }

41. Example

Project: CypherCore
Source File: BossKrikthirTheGatewatcher.cs
public override void _EnterCombat()
        {
            _scheduler.SetValidator(() => !me.HasUnitState(UnitState.Casting));

            _scheduler.Schedule(TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(9), task =>
            {
                DoCastVictim(SpellIds.Cleave);
                task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(16));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(10), task =>
            {
                DoCastVictim(SpellIds.Strike);
                task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(19));
            });
        }

42. Example

Project: CypherCore
Source File: BossKrikthirTheGatewatcher.cs
public override void _EnterCombat()
        {
            _scheduler.SetValidator(() => !me.HasUnitState(UnitState.Casting));

            _scheduler.Schedule(TimeSpan.FromSeconds(6), TimeSpan.FromSeconds(8), task =>
            {
                Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100.0f, true);
                if (target)
                    DoCast(target, SpellIds.Charge);
                task.Repeat(TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(25));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(9), task =>
            {
                if (me.GetVictim() && me.GetVictim().isInBack(me))
                    DoCastVictim(SpellIds.Backstab);
                task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(13));
            });
        }

43. Example

Project: CypherCore
Source File: BossKrikthirTheGatewatcher.cs
public override void _EnterCombat()
        {
            _scheduler.SetValidator(() => !me.HasUnitState(UnitState.Casting));

            _scheduler.Schedule(TimeSpan.FromSeconds(4), task =>
            {
                Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100.0f, true);
                if (target)
                    DoCast(target, SpellIds.ShadowBolt);
                task.Repeat(TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(4));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(14), task =>
            {
                DoCastVictim(SpellIds.ShadowNova);
                task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(16));
            });
        }

44. Example

Project: CypherCore
Source File: BossNadronox.cs
public override void _EnterCombat()
        {
            _scheduler.Schedule(TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(12), task =>
            {
                DoCastVictim(SpellIds.Smash);
                task.Repeat(TimeSpan.FromSeconds(13), TimeSpan.FromSeconds(21));
            });

            if (_myPack != SummonGroups.Crusher1)
                return;

            Creature hadronox = _instance.GetCreature(ANDataTypes.Hadronox);
            if (hadronox)
            {
                if (hadronox.GetAI().GetData(Data.HadronoxEnteredCombat) != 0)
                    return;
                hadronox.GetAI().DoAction(ActionIds.CrusherEngaged);
            }

            Talk(TextIds.SayCrusherAggro);
        }

45. Example

Project: CypherCore
Source File: BossNadronox.cs
public override void _EnterCombat()
        {
            _scheduler.Schedule(TimeSpan.FromSeconds(4), TimeSpan.FromSeconds(8), task =>
            {
                DoCastVictim(SpellIds.Rend);
                task.Repeat(TimeSpan.FromSeconds(12), TimeSpan.FromSeconds(16));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(19), task =>
            {
                DoCastVictim(SpellIds.Pummel);
                task.Repeat(TimeSpan.FromSeconds(12), TimeSpan.FromSeconds(17));
            });
        }

46. Example

Project: CypherCore
Source File: BossNadronox.cs
public override void _EnterCombat()
        {
            _scheduler.Schedule(TimeSpan.FromSeconds(4), TimeSpan.FromSeconds(8), task =>
            {
                DoCastVictim(SpellIds.CrushingWebs);
                task.Repeat(TimeSpan.FromSeconds(12), TimeSpan.FromSeconds(16));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(19), task =>
            {
                DoCastVictim(SpellIds.InfectedWound);
                task.Repeat(TimeSpan.FromSeconds(16), TimeSpan.FromSeconds(25));
            });
        }

47. Example

Project: CypherCore
Source File: BossNadronox.cs
public override void _EnterCombat()
        {
            _scheduler.Schedule(TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(4), task =>
            {
                DoCastVictim(SpellIds.ShadowBolt);
                task.Repeat(TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(5));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(37), TimeSpan.FromSeconds(45), task =>
            {
                DoCastVictim(RandomHelper.URand(0, 1) != 0 ? SpellIds.AnimateBones2 : SpellIds.AnimateBones1);
                task.Repeat(TimeSpan.FromSeconds(35), TimeSpan.FromSeconds(50));
            });
        }

48. Example

Project: CypherCore
Source File: BossNadronox.cs
public override void EnterCombat(Unit who)
        {
            _scheduler.Schedule(TimeSpan.FromSeconds(4), TimeSpan.FromSeconds(8), task =>
            {
                DoCastVictim(SpellIds.Rend);
                task.Repeat(TimeSpan.FromSeconds(12), TimeSpan.FromSeconds(16));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(19), task =>
            {
                DoCastVictim(SpellIds.Pummel);
                task.Repeat(TimeSpan.FromSeconds(12), TimeSpan.FromSeconds(17));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(50), task =>
            {
                DoCastVictim(SpellIds.Taunt);
                task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(50));
            });
        }

49. Example

Project: CypherCore
Source File: BossNadronox.cs
public override void EnterCombat(Unit who)
        {
            _scheduler.Schedule(TimeSpan.FromSeconds(4), TimeSpan.FromSeconds(8), task =>
            {
                DoCastVictim(SpellIds.CrushingWebs);
                task.Repeat(TimeSpan.FromSeconds(12), TimeSpan.FromSeconds(16));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(19), task =>
            {
                DoCastVictim(SpellIds.InfectedWound);
                task.Repeat(TimeSpan.FromSeconds(16), TimeSpan.FromSeconds(25));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(50), task =>
            {
                DoCastVictim(SpellIds.Taunt);
                task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(50));
            });
        }

50. Example

Project: CypherCore
Source File: BossNadronox.cs
public override void EnterCombat(Unit who)
        {
            _scheduler.Schedule(TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(4), task =>
            {
                DoCastVictim(SpellIds.ShadowBolt);
                task.Repeat(TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(5));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(37), TimeSpan.FromSeconds(45), task =>
            {
                DoCastVictim(RandomHelper.URand(0, 1) != 0 ? SpellIds.AnimateBones2 : SpellIds.AnimateBones1);
                task.Repeat(TimeSpan.FromSeconds(35), TimeSpan.FromSeconds(50));
            });

            _scheduler.Schedule(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(50), task =>
            {
                DoCastVictim(SpellIds.Taunt);
                task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(50));
            });
        }