Esempio n. 1
0
        public virtual int ScaleMana(int mana)
        {
            double scalar = 1.0;

            if (ManaPhasingOrb.IsInManaPhase(Caster))
            {
                ManaPhasingOrb.RemoveFromTable(Caster);
                return(0);
            }

            if (!MindRotSpell.GetMindRotScalar(Caster, ref scalar))
            {
                scalar = 1.0;
            }

            if (Mysticism.PurgeMagicSpell.IsUnderCurseEffects(Caster))
            {
                scalar += .5;
            }

            // Lower Mana Cost = 40%
            int lmc = AosAttributes.GetValue(m_Caster, AosAttribute.LowerManaCost);

            if (lmc > 40)
            {
                lmc = 40;
            }

            lmc += BaseArmor.GetInherentLowerManaCost(m_Caster);

            scalar -= (double)lmc / 100;

            return((int)(mana * scalar));
        }
Esempio n. 2
0
        public virtual int ScaleMana(int mana)
        {
            double scalar = 1.0;

            if (ManaPhasingOrb.IsInManaPhase(Caster))
            {
                ManaPhasingOrb.RemoveFromTable(Caster);
                return(0);
            }

            if (!MindRotSpell.GetMindRotScalar(Caster, ref scalar))
            {
                scalar = 1.0;
            }

            // Lower Mana Cost = 40%
            int lmc = AosAttributes.GetValue(m_Caster, AosAttribute.LowerManaCost);

            if (lmc > 40)
            {
                lmc = 40;
            }

            scalar -= (double)lmc / 100;

            return((int)(mana * scalar));
        }
Esempio n. 3
0
        public virtual int ScaleMana(Mobile m, int mana)
        {
            double scalar = 1.0;

            if (ManaPhasingOrb.IsInManaPhase(m))
            {
                ManaPhasingOrb.RemoveFromTable(m);
                return(0);
            }

            if (!Server.Spells.Necromancy.MindRotSpell.GetMindRotScalar(m, ref scalar))
            {
                scalar = 1.0;
            }

            // Lower Mana Cost = 40%
            int lmc = Math.Min(AosAttributes.GetValue(m, AosAttribute.LowerManaCost), 40);

            scalar -= (double)lmc / 100;

            int total = (int)(mana * scalar);

            if (m.Skills[this.MoveSkill].Value < 50.0 && GetContext(m) != null)
            {
                total *= 2;
            }

            return(total);
        }
Esempio n. 4
0
        public virtual int ScaleMana(Mobile m, int mana)
        {
            double scalar = 1.0;

            if (ManaPhasingOrb.IsInManaPhase(m))
            {
                ManaPhasingOrb.RemoveFromTable(m);
                return(0);
            }

            if (!Necromancy.MindRotSpell.GetMindRotScalar(m, ref scalar))
            {
                scalar = 1.0;
            }

            if (Mysticism.PurgeMagicSpell.IsUnderCurseEffects(m))
            {
                scalar += .5;
            }

            int lmc = AosAttributes.GetValue(m, AosAttribute.LowerManaCost);

            scalar -= (double)lmc / 100;

            int total = (int)(mana * scalar);

            if (m.Skills[MoveSkill].Value < 50.0 && GetContext(m) != null)
            {
                total *= 2;
            }

            return(total);
        }
Esempio n. 5
0
		public bool ConsumeAttributes(Mobile from, ref object message, bool consume)
		{
			bool consumMana = false;
			bool consumHits = false;
			bool consumStam = false;

			if (Hits > 0 && from.Hits < Hits)
			{
				message = "You lack the required hit points to make that.";
				return false;
			}
			else
			{
				consumHits = consume;
			}

			if (Mana > 0)
			{
                if (ManaPhasingOrb.IsInManaPhase(from))
                {
                    if (consume)
                        ManaPhasingOrb.RemoveFromTable(from);
                    return true;
                }

                if (from.Mana < Mana)
                {
                    message = "You lack the required mana to make that.";
                    return false;
                }
				else
				{
					consumMana = consume;
				}
			}


			if (Stam > 0 && from.Stam < Stam)
			{
				message = "You lack the required stamina to make that.";
				return false;
			}
			else
			{
				consumStam = consume;
			}

			if (consumMana)
			{
				from.Mana -= Mana;
			}

			if (consumHits)
			{
				from.Hits -= Hits;
			}

			if (consumStam)
			{
				from.Stam -= Stam;
			}

			return true;
		}