Beispiel #1
0
        public virtual bool CheckMana(Mobile from, bool consume)
        {
            int mana = CalculateMana(from);

            if (from.Mana < mana)
            {
                from.SendLocalizedMessage(1060181, mana.ToString()); // You need ~1_MANA_REQUIREMENT~ mana to perform that attack
                return(false);
            }

            if (consume)
            {
                if (GetContext(from) == null)
                {
                    Timer timer = new WeaponAbilityTimer(from);
                    timer.Start();

                    AddContext(from, new WeaponAbilityContext(timer));
                }

                if (ManaPhasingOrb.IsInManaPhase(from))
                {
                    ManaPhasingOrb.RemoveFromTable(from);
                }
                else
                {
                    from.Mana -= mana;
                }

                CrazedMage.ManaCorruption(from, BaseMana);
            }

            return(true);
        }
        public virtual bool CheckMana(Mobile from, bool consume)
        {
            int mana = CalculateMana(from);

            if (from.Mana < mana)
            {
                from.SendLocalizedMessage(1060181, mana.ToString());                   // You need ~1_MANA_REQUIREMENT~ mana to perform that attack
                return(false);
            }

            if (consume)
            {
                if (GetContext(from) == null)
                {
                    Timer timer = new WeaponAbilityTimer(from);
                    timer.Start();

                    AddContext(from, new WeaponAbilityContext(timer));
                }

                from.Mana -= mana;
            }

            return(true);
        }
Beispiel #3
0
        public virtual bool CheckStam(Mobile from, bool consume)
        {
            BaseWeapon weapon = from.Weapon as BaseWeapon;

            int stamReq = (int)(weapon.Weight * 2.75);

            if (from.Stam < stamReq)
            {
                from.SendMessage("You require an additional {0} stamina to use this ability.", stamReq);
                return(false);
            }

            if (consume)
            {
                if (GetContext(from) == null)
                {
                    Timer timer = new WeaponAbilityTimer(from);
                    timer.Start();

                    AddContext(from, new WeaponAbilityContext(timer));
                }

                from.Stam -= stamReq;
            }

            return(true);
        }
Beispiel #4
0
        public virtual bool CheckStam(Mobile from, bool consume)
        {
            int stam = CalculateStam(from);

            if (from.Stam < stam)
            {
                from.SendMessage("You need ~1_STAMINA_REQUIREMENT~ to perform that attack.");
                return(false);
            }

            if (consume)
            {
                if (GetContext(from) == null)
                {
                    Timer timer = new WeaponAbilityTimer(from);
                    timer.Start();

                    AddContext(from, new WeaponAbilityContext(timer));
                }

                from.Stam -= stam;
            }

            return(true);
        }
Beispiel #5
0
        public virtual bool CheckStam(Mobile from, bool consume)
        {
            int stam = CalculateStam(from);

            if (from.Stam < stam)
            {
                from.SendMessage("You are too tired to do that.");
                return(false);
            }

            if (consume)
            {
                if (GetContext(from) == null)
                {
                    Timer timer = new WeaponAbilityTimer(from);
                    timer.Start();

                    AddContext(from, new WeaponAbilityContext(timer));
                }

                from.Stam -= stam;
            }

            return(true);
        }
Beispiel #6
0
        public virtual bool CheckMana(Mobile from, bool consume)
        {
            int mana = this.CalculateMana(from);

            if (from.Mana < mana)
            {
                from.SendLocalizedMessage(1060181, mana.ToString()); // You need ~1_MANA_REQUIREMENT~ mana to perform that attack
                return false;
            }

            if (consume)
            {
                if (GetContext(from) == null)
                {
                    Timer timer = new WeaponAbilityTimer(from);
                    timer.Start();

                    AddContext(from, new WeaponAbilityContext(timer));
                }

                if (ManaPhasingOrb.IsInManaPhase(from))
                    ManaPhasingOrb.RemoveFromTable(from);
                else
                    from.Mana -= mana;
            }

            return true;
        }
Beispiel #7
0
        public virtual bool CheckStam(Mobile from, bool consume)
        {

            BaseWeapon weapon = from.Weapon as BaseWeapon;

            int stamReq = (int)(weapon.Weight * 1.5);

            if (from.Stam < stamReq)
            {
                from.SendMessage("You require an additional {0} stamina to use this ability.", stamReq);
                return false;
            }

            if (consume)
            {
                if (GetContext(from) == null)
                {
                    Timer timer = new WeaponAbilityTimer(from);
                    timer.Start();

                    AddContext(from, new WeaponAbilityContext(timer));
                }

                from.Stam -= stamReq;
            }

            return true;
        }
Beispiel #8
0
		public virtual bool CheckMana( Mobile from, bool consume )
		{
			int mana = CalculateMana( from );

			if ( from.Mana < mana )
			{
				if( ( from is BaseCreature ) && ( from as BaseCreature ).HasManaOveride )
				{
					return true;
				}

				from.SendLocalizedMessage( 1060181, mana.ToString() ); // You need ~1_MANA_REQUIREMENT~ mana to perform that attack
				return false;
			}

			if ( consume )
			{
				if ( GetContext( from ) == null )
				{
					Timer timer = new WeaponAbilityTimer( from );
					timer.Start();

					AddContext( from, new WeaponAbilityContext( timer ) );
				}

				from.Mana -= mana;
			}

			return true;
		}
Beispiel #9
0
        public virtual bool CheckMana( Mobile from, bool consume )
        {
            int mana = CalculateMana( from );

            if ( from.Mana < mana )
            {
                from.SendLocalizedMessage( 1060181, mana.ToString() ); // You need ~1_MANA_REQUIREMENT~ mana to perform that attack
                return false;
            }

            if ( consume )
            {
                if ( GetContext( from ) == null )
                {
                    Timer timer = new WeaponAbilityTimer( from );
                    timer.Start();

                    AddContext( from, new WeaponAbilityContext( timer ) );
                }

                from.Mana -= mana;

                #region Mana Phase
                if ( ManaPhase.UnderEffect( from ) )
                    ManaPhase.OnManaConsumed( from );
                #endregion
            }

            return true;
        }
        public virtual bool CheckMana( Mobile from, bool consume )
        {
            int mana = CalculateMana( from );

            if ( from.Mana < mana )
            {
                from.SendLocalizedMessage( 1060181, mana.ToString() ); // You need ~1_MANA_REQUIREMENT~ mana to perform that attack
                return false;
            }

            if ( consume )
            {
                //edit by Sunny
                int consecutives = 1;
                WeaponAbilityContext context = GetContext( from );

                if ( context != null )
                {
                    consecutives = context.Consecutives + 1;
                    RemoveContext( from, context );
                }

                Timer timer = new WeaponAbilityTimer(from);
                timer.Start();
                AddContext( from, new WeaponAbilityContext( timer, consecutives ) );

                from.Mana -= mana;
                //end edit
            }

            return true;
        }
        public virtual bool CheckStam( Mobile from, bool consume )
        {
            int stam = CalculateStam( from );

            if ( from.Stam < stam )
            {
                from.SendMessage( "You are too tired to do that." );
                return false;
            }

            if ( consume )
            {
                if ( GetContext( from ) == null )
                {
                    Timer timer = new WeaponAbilityTimer( from );
                    timer.Start();

                    AddContext( from, new WeaponAbilityContext( timer ) );
                }

                from.Stam -= stam;
            }

            return true;
        }