예제 #1
0
        public virtual int CalculateMana(Mobile from)
        {
            int mana = BaseMana;

            double skillTotal = GetSkill(from, SkillName.Swords) + GetSkill(from, SkillName.Macing) +
                                GetSkill(from, SkillName.Fencing) + GetSkill(from, SkillName.Archery) + GetSkill(from, SkillName.Parry) +
                                GetSkill(from, SkillName.Lumberjacking) + GetSkill(from, SkillName.Stealth) +
                                GetSkill(from, SkillName.Poisoning) + GetSkill(from, SkillName.Bushido) + GetSkill(from, SkillName.Ninjitsu);

            if (skillTotal >= 300.0)
            {
                mana -= 10;
            }
            else if (skillTotal >= 200.0)
            {
                mana -= 5;
            }

            double scalar = 1.0;

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

            if (Server.Spells.Mysticism.PurgeMagicSpell.IsUnderCurseEffects(from))
            {
                scalar += .5;
            }

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

            lmc += BaseArmor.GetInherentLowerManaCost(from);

            scalar -= (double)lmc / 100;
            mana    = (int)(mana * scalar);

            // Using a special move within 3 seconds of the previous special move costs double mana
            if (GetContext(from) != null)
            {
                mana *= 2;
            }

            return(mana);
        }
예제 #2
0
        public static int CheckHit(Mobile attacker, Mobile defender)
        {
            int mana   = (int)(30.0 * ((double)(AosAttributes.GetValue(attacker, AosAttribute.LowerManaCost) + BaseArmor.GetInherentLowerManaCost(attacker)) / 100.0));
            int damage = 0;

            if (attacker.Mana >= mana)
            {
                attacker.Mana -= mana;
                damage        += 50;

                defender.SendLocalizedMessage(1157317); // The attack shatters your bones!
            }

            if (IsImmune(defender))
            {
                attacker.SendLocalizedMessage(1157316); // Your target is currently immune to bone breaking!
                return(damage);
            }

            if (20 > Utility.Random(100))
            {
                BoneBreakerContext context = PropertyEffect.GetContext <BoneBreakerContext>(attacker, defender, EffectsType.BoneBreaker);

                if (context == null)
                {
                    new BoneBreakerContext(attacker, defender, null);
                    defender.SendLocalizedMessage(1157363); // Your bones are broken! Stamina drain over time!

                    defender.PlaySound(0x204);
                    defender.FixedEffect(0x376A, 9, 32);

                    defender.FixedEffect(0x3779, 10, 20, 1365, 0);
                }
            }

            return(damage);
        }
예제 #3
0
        public static void CheckHit(Mobile attacker, Mobile defender)
        {
            BoneBreakerContext context = GetContext <BoneBreakerContext>(attacker, defender);

            if (IsImmune(defender) || context != null)
            {
                attacker.SendLocalizedMessage(1157316); // Your target is currently immune to bone breaking!
            }
            else if (20 > Utility.Random(100))
            {
                AddEffects(new BoneBreakerContext(attacker, defender, null));
                defender.SendLocalizedMessage(1157317); // The attack shatters your bones!

                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.BoneBreaker, 1157318, 1157363));
                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.BoneBreakerImmune, 1157318, 1157364, _EffectsDuration + _ImmunityDuration, defender));

                defender.PlaySound(0x204);
                defender.FixedEffect(0x376A, 9, 32);

                defender.FixedEffect(0x3779, 10, 20, 1365, 0);
            }
            else if (attacker.Skills[SkillName.Tactics].Value >= 60.0)
            {
                int mana = (int)(30.0 * ((AosAttributes.GetValue(attacker, AosAttribute.LowerManaCost) + BaseArmor.GetInherentLowerManaCost(attacker)) / 100.0));

                if (attacker.Mana >= mana)
                {
                    attacker.Mana -= mana;
                    AOS.Damage(defender, attacker, 100, 100, 0, 0, 0, 0);

                    defender.SendLocalizedMessage(1157317); // The attack shatters your bones!
                }
            }
        }