Пример #1
0
            public static void InitLadySpells()
            {
                var forkedLightning = SpellHandler.Get(SpellId.ForkedLightningRank1);

                forkedLightning.AISettings.SetCooldownRange(8000);

                // is this correct? shouldn't it be AoE? that spell only does 5 damage
                // in that case it should not have a custom target definition, but stick with the default one
                forkedLightning.MaxTargets = 1;
                forkedLightning.OverrideAITargetDefinitions(
                    DefaultTargetAdders.AddAreaSource,                                                          // Adder
                    DefaultTargetEvaluators.RandomEvaluator,                                                    // Evaluator
                    DefaultTargetFilters.IsHostile, DefaultTargetFilters.IsPlayer);                             // Filters

                var slow = SpellHandler.Get(SpellId.SlowRank1);

                slow.AISettings.SetCooldownRange(13000);
                slow.MaxTargets = 1;
                slow.OverrideAITargetDefinitions(
                    DefaultTargetAdders.AddAreaSource,                                                          // Adder
                    DefaultTargetEvaluators.RandomEvaluator,                                                    // Evaluator
                    DefaultTargetFilters.IsHostile, DefaultTargetFilters.IsPlayer);                             // Filters


                var frostNova = SpellHandler.Get(SpellId.ClassSkillFrostNovaRank2);

                frostNova.AISettings.SetCooldown(20000);
                frostNova.AddTextAndSoundEvent(NPCAiTextMgr.GetFirstTextByEnglishPrefix("You should not be here! Slay them!"));
            }
Пример #2
0
        /// <summary>
        /// Play a text and sound identify by the id
        /// </summary>
        /// <param name="id">Id of the text in creature_ai_texts</param>
        public void PlayTextAndSoundById(int id)
        {
            var text = NPCAiTextMgr.GetFirstTextById(id);

            if (text != null)
            {
                PlayTextAndSound(text);
            }
        }
Пример #3
0
        /// <summary>
        /// TODO: Find a better way to identify texts (i.e. by entry/object-type ids and sequence number)
        /// </summary>
        public void PlayTextAndSoundByEnglishPrefix(string englishPrefix)
        {
            var text = NPCAiTextMgr.GetFirstTextByEnglishPrefix(englishPrefix);

            if (text != null)
            {
                PlayTextAndSound(text);
            }
        }
Пример #4
0
            public static void InitLordSpells()
            {
                // Even use mindblast if there are one or more sleeping targets nearby? -> AI code should prevent targeting of enemies with debuffs that might get cancelled
                var mindblast = SpellHandler.Get(SpellId.MindBlast_2);

                mindblast.AISettings.SetCooldown(3000);

                // What to do if no one is in range for Sleep? -> It won't cast it
                var sleep = SpellHandler.Get(SpellId.Sleep);

                sleep.AISettings.SetCooldown(7000);
                sleep.AddTextAndSoundEvent(NPCAiTextMgr.GetFirstTextByEnglishPrefix("Sleep..."));
            }
Пример #5
0
            public override void OnEnterCombat()
            {
                NPCAiText[] texts          = NPCAiTextMgr.GetEntries("I am the serpent king, I can do anything.");
                NPCAiText   currentNpcText = texts[0];

                m_owner.PlaySound((uint)currentNpcText.Sound);
                var npc = m_owner as NPC;

                if (npc != null)
                {
                    npc.Yell(currentNpcText.Texts);
                }

                m_owner.SpellCast.Start(SpellHandler.Get(SpellId.LightningBolt), false, m_owner.GetNearbyRandomHostileCharacter());

                base.OnEnterCombat();
            }