예제 #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 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();
                }
            }