Пример #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                int    scalar;
                double mageSkill = from.Skills[SkillName.Inscribe].Value;

                if (mageSkill >= 100.0)
                {
                    scalar = 3;
                }
                else if (mageSkill >= 90.0)
                {
                    scalar = 2;
                }
                else
                {
                    scalar = 1;
                }

                if (targeted is BaseWeapon)
                {
                    BaseWeapon Weapon = targeted as BaseWeapon;

                    if (!from.InRange(((Item)targeted).GetWorldLocation(), 1))
                    {
                        from.SendLocalizedMessage(500446);                           // That is too far away.
                    }

                    else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile))
                    {
                        from.SendMessage("You cannot enhance that in it's current location.");
                    }

                    else
                    {
                        int DestroyChance = Utility.Random(5);

                        if (DestroyChance > 0)                           // Success
                        {
                            int augmentper = ((Utility.Random(5)) * scalar) + 5;

                            Weapon.WeaponAttributes.HitHarm += augmentper; from.SendMessage("The Jux Rune enhances your weapon.");

                            from.PlaySound(0x1F5);
                            m_JuxRune.Delete();
                        }

                        else                         // Fail
                        {
                            from.SendMessage("You have failed to enhance the weapon!");
                            from.SendMessage("The weapon is damaged beyond repair!");
                            from.PlaySound(42);
                            Weapon.Delete();
                            m_JuxRune.Delete();
                        }
                    }
                }
                else
                {
                    from.SendMessage("You cannot enhance that.");
                }
            }