示例#1
0
        public override void OnThink()
        {
            base.OnThink();

            if (Combatant == null)
            {
                return;
            }

            if (CanDoSpecial && InRange(Combatant, 4) && 0.1 > Utility.RandomDouble() && _NextSpecial < DateTime.UtcNow)
            {
                DoSpecial();

                _NextSpecial = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(30, 60));
            }
            else if (_Sampire)
            {
                if (0.1 > Utility.RandomDouble() && Weapon is BaseWeapon && !CurseWeaponSpell.IsCursed(this, (BaseWeapon)Weapon))
                {
                    CurseWeaponSpell spell = new CurseWeaponSpell(this, null);
                    spell.Cast();
                }
                else if (!TransformationSpellHelper.UnderTransformation(this, typeof(VampiricEmbraceSpell)))
                {
                    VampiricEmbraceSpell spell = new VampiricEmbraceSpell(this, null);
                    spell.Cast();
                }
            }
        }
示例#2
0
        public override Spell GetRandomCurseSpell()
        {
            var mana   = m_Mobile.Mana;
            var select = 1;

            if (mana >= 17)
            {
                select = 5;
            }
            else if (mana >= 13)
            {
                select = 4;
            }
            else if (mana >= 11)
            {
                select = 3;
            }

            switch (Utility.Random(select))
            {
            case 0:
                return(new CurseWeaponSpell(m_Mobile, null));

            case 1:
                Spell spell;

                if (NecroMageAI.CheckCastCorpseSkin(m_Mobile))
                {
                    spell = new CorpseSkinSpell(m_Mobile, null);
                }
                else
                {
                    spell = new CurseWeaponSpell(m_Mobile, null);
                }

                return(spell);

            case 2:
                return(new EvilOmenSpell(m_Mobile, null));

            case 3:
                return(new BloodOathSpell(m_Mobile, null));

            case 4:
                return(new MindRotSpell(m_Mobile, null));
            }

            return(null);
        }
示例#3
0
        public override void OnThink()
        {
            base.OnThink();

            if (Blessed && _Controller != null && _Controller.MasterBlessCheck(this))
            {
                for (int i = 1; i < 4; i++)
                {
                    Timer.DelayCall(TimeSpan.FromMilliseconds(i * 50), o =>
                    {
                        Geometry.Circle2D(Location, Map, o, (pnt, map) =>
                        {
                            Effects.SendLocationEffect(pnt, map, 0x36B0, 14, 14, 2053, 0);
                        });
                    }, i);
                }

                Blessed = false;
            }

            if (!Hidden && 0.1 > Utility.RandomDouble() && (_Specialty == MasterTitle.Rogue || _Specialty == MasterTitle.Assassin))
            {
                HideSelf();
            }

            if (Combatant == null)
            {
                return;
            }

            if (!Utility.InRange(Location, Home, 20))
            {
                Timer.DelayCall(TimeSpan.FromSeconds(5), () => { Location = Home; });
            }

            if (0.3 > Utility.RandomDouble() && _NextSpecial < DateTime.UtcNow)
            {
                switch (_Specialty)
                {
                case MasterTitle.Macer:
                    Teleport();
                    break;

                case MasterTitle.Fencer:
                case MasterTitle.Swordsman:
                    ChangeWeapon();
                    break;

                case MasterTitle.Wizard:
                    if (0.5 > Utility.RandomDouble())
                    {
                        DoNuke(Location);
                    }
                    else
                    {
                        DoDismount((Mobile)Combatant);
                    }
                    break;
                }

                _NextSpecial = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(30, 60));
            }
            else if (_Specialty == MasterTitle.Sampire)
            {
                if (0.1 > Utility.RandomDouble() && Weapon is BaseWeapon weapon && !CurseWeaponSpell.IsCursed(this, weapon))
                {
                    CurseWeaponSpell spell = new CurseWeaponSpell(this, null);
                    spell.Cast();
                }
                else if (!TransformationSpellHelper.UnderTransformation(this, typeof(VampiricEmbraceSpell)))
                {
                    VampiricEmbraceSpell spell = new VampiricEmbraceSpell(this, null);
                    spell.Cast();
                }
            }