Ejemplo n.º 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 augment    = ((Utility.Random(3)) * scalar) + 1;
                            int augmentper = ((Utility.Random(5)) * scalar) + 5;

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

                            from.PlaySound(0x1F5);
                            m_DelRune.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_DelRune.Delete();
                        }
                    }
                }

                else if (targeted is BaseArmor)
                {
                    BaseArmor Armor = targeted as BaseArmor;

                    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 augment    = ((Utility.Random(3)) * scalar) + 1;
                            int augmentper = ((Utility.Random(5)) * scalar) + 5;

                            Armor.ColdBonus += augment; from.SendMessage("The Del Rune enhances your armor.");

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

                        else                         // Fail
                        {
                            from.SendMessage("You have failed to enhance the armor!");
                            from.SendMessage("The armor is damaged beyond repair!");
                            from.PlaySound(42);
                            Armor.Delete();
                            m_DelRune.Delete();
                        }
                    }
                }

                else if (targeted is BaseShield)
                {
                    BaseShield Shield = targeted as BaseShield;

                    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 augment    = ((Utility.Random(3)) * scalar) + 1;
                            int augmentper = ((Utility.Random(5)) * scalar) + 5;

                            Shield.ColdBonus += augment; from.SendMessage("The Del Rune enhances your shield.");

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

                        else                         // Fail
                        {
                            from.SendMessage("You have failed to enhance the shield!");
                            from.SendMessage("The shield is damaged beyond repair!");
                            from.PlaySound(42);
                            Shield.Delete();
                            m_DelRune.Delete();
                        }
                    }
                }

                else if (targeted is BaseJewel)
                {
                    BaseJewel Jewel = targeted as BaseJewel;

                    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 augment    = ((Utility.Random(3)) * scalar) + 1;
                            int augmentper = ((Utility.Random(5)) * scalar) + 5;
                            Jewel.Resistances.Cold += augmentper; from.SendMessage("The Del Rune ennhances your jewelry.");

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

                        else                         // Fail
                        {
                            from.SendMessage("You have failed to enhance the jewelery!");
                            from.SendMessage("The jewelery is damaged beyond repair!");
                            from.PlaySound(62);
                            Jewel.Delete();
                            m_DelRune.Delete();
                        }
                    }
                }

                else
                {
                    from.SendMessage("You cannot enhance that.");
                }
            }