예제 #1
0
            public override void OnResponse(Mobile from, string text)
            {
                // Pattern match for invalid characters
                Regex InvalidPatt = new Regex("[^-a-zA-Z0-9' ]");

                if (InvalidPatt.IsMatch(text))
                {
                    // Invalid chars
                    from.SendMessage("You may only etch numbers, letters, apostrophes and hyphens.");
                }
                else if (text.Length > 24)
                {
                    // Invalid length
                    from.SendMessage("You may only etch a maximum of 24 characters.");
                }
                else if (!NameVerification.Validate(text, 2, 24, true, true, true, 1, NameVerification.SpaceDashPeriodQuote))
                {
                    // Invalid for some other reason
                    from.SendMessage("You may not etch it with this.");
                }
                else if (Utility.RandomDouble() < ((100 - ((from.Skills[SkillName.Tinkering].Base + from.Skills[SkillName.Inscribe].Base) / 2)) * 2) / 100)
                {
                    // Failed!!
                    from.SendMessage("You fail to etch the piece, ruining it in the process!");
                    m_jewel.Delete();
                }
                else
                {
                    // Make the change
                    m_jewel.Name = text + "\n\n";
                    from.SendMessage("You successfully etch your message.");

                    // Play a little sound
                    from.PlaySound(0x241);

                    // Decrement UsesRemaining of graver
                    m_etchingkit.UsesRemaining--;

                    // Check for 0 charges and delete if has none left
                    if (m_etchingkit.UsesRemaining == 0)
                    {
                        m_etchingkit.Delete();
                        from.SendMessage("You have used up your etching kit!");
                    }

                    // we want to hide the [Exceptional] attribute
                    m_jewel.HideAttributes = true;
                }
            }
예제 #2
0
파일: Runes.cs 프로젝트: zerodowned/annox
            protected override void OnTarget(Mobile from, object targeted)
            {
                int    scalar;
                double mageSkill = from.Skills[SkillName.Magery].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(10);

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

                            switch (Utility.Random(9))
                            {
                            case 0: Weapon.Attributes.AttackChance += augmentper; from.SendMessage("A true weapon strikes true wounds."); break;

                            case 1: Weapon.Attributes.BonusMana += augment; from.SendMessage("The spirit rises within."); break;

                            case 2: Weapon.Attributes.WeaponDamage += augmentper; from.SendMessage("A warrior is only as good as his best weapon."); break;

                            case 3: Weapon.Attributes.SpellChanneling = 1; from.SendMessage("The mage's best ally."); break;

                            case 4: Weapon.WeaponAttributes.HitDispel += augmentper; from.SendMessage("The bane of demons, the unsummoner."); break;

                            case 5: Weapon.WeaponAttributes.HitFireball += augmentper; from.SendMessage("What the blade leaves alive, the fire purifies."); break;

                            case 6: Weapon.WeaponAttributes.HitHarm += augmentper; from.SendMessage("Sometimes the sting can be worse."); break;

                            case 7: Weapon.WeaponAttributes.HitLightning += augmentper; from.SendMessage("The power of the storm is called to strike."); break;

                            case 8: Weapon.Attributes.WeaponSpeed += augmentper; from.SendMessage("What can beat speed but more speed?"); break;
                            }

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

                        else                         // Fail
                        {
                            from.SendMessage("You have failed to enhance the weapon!");
                            from.SendMessage("The weapon is damaged beyond repair!");
                            from.PlaySound(0x1F8);
                            Weapon.Delete();
                            m_RuneStone.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(10);

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

                            switch (Utility.Random(12))
                            {
                            case 0: Armor.Attributes.BonusHits += augment; from.SendMessage("Even pierced, the armor protects."); break;

                            case 1: Armor.Attributes.NightSight = 1; from.SendMessage("In the darkest night, your path can be seen."); break;

                            case 2: Armor.Attributes.Luck += augment; from.SendMessage("The unluckiest always get the biggest breaks."); break;

                            case 3: Armor.Attributes.LowerManaCost += augment; from.SendMessage("The power of the spirit can be harnessed by metal."); break;

                            case 4: Armor.ArmorAttributes.DurabilityBonus += augmentper; from.SendMessage("Metal lasts longer than flesh."); break;

                            case 5: Armor.ArmorAttributes.MageArmor = 1; from.SendMessage("Channels of magic aren't held back."); break;

                            case 6: Armor.ArmorAttributes.SelfRepair += augment; from.SendMessage("The weapon that strikes mends the metal."); break;

                            case 7: Armor.PhysicalBonus += augment; from.SendMessage("Armor focus renews."); break;

                            case 8: Armor.FireBonus += augment; from.SendMessage("Armor focus renews."); break;

                            case 9: Armor.ColdBonus += augment; from.SendMessage("Armor focus renews."); break;

                            case 10: Armor.PoisonBonus += augment; from.SendMessage("Armor focus renews."); break;

                            case 11: Armor.EnergyBonus += augment; from.SendMessage("Armor focus renews."); break;
                            }

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

                        else                         // Fail
                        {
                            from.SendMessage("You have failed to enhance the armor!");
                            from.SendMessage("The armor is damaged beyond repair!");
                            from.PlaySound(0x1F8);
                            Armor.Delete();
                            m_RuneStone.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(10);

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

                            switch (Utility.Random(12))
                            {
                            case 0: Shield.Attributes.BonusStam += augment; from.SendMessage("Sometimes the warrior's best friend is his shield."); break;

                            case 1: Shield.Attributes.DefendChance += augment; from.SendMessage("The shield's purpose is to defend."); break;

                            case 2: Shield.Attributes.ReflectPhysical += augment; from.SendMessage("Turn the attack against the attacker."); break;

                            case 3: Shield.Attributes.SpellChanneling = 1; from.SendMessage("Sometimes even mages carry shields."); break;

                            case 4: Shield.Attributes.CastRecovery += augment; from.SendMessage("The shield supports when the warrior leans upon it."); break;

                            case 5: Shield.ArmorAttributes.SelfRepair += augment; from.SendMessage("The sword mends, the mace fixes."); break;

                            case 6: Shield.ArmorAttributes.DurabilityBonus += augmentper; from.SendMessage("Time cannot rust a trusted companion."); break;

                            case 7: Shield.PhysicalBonus += augment; from.SendMessage("Armor focus renews."); break;

                            case 8: Shield.FireBonus += augment; from.SendMessage("Armor focus renews."); break;

                            case 9: Shield.ColdBonus += augment; from.SendMessage("Armor focus renews."); break;

                            case 10: Shield.PoisonBonus += augment; from.SendMessage("Armor focus renews."); break;

                            case 11: Shield.EnergyBonus += augment; from.SendMessage("Armor focus renews."); break;
                            }

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

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

                else if (targeted is BaseClothing)
                {
                    BaseClothing Clothing = targeted as BaseClothing;

                    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(10);

                        if (DestroyChance > 0)                           // Success
                        {
                            int augment = ((Utility.Random(3)) * scalar) + 1;

                            switch (Utility.Random(9))
                            {
                            case 0: Clothing.Attributes.RegenHits += augment; from.SendMessage("Sturdy clothes help everyone."); break;

                            case 1: Clothing.Attributes.RegenStam += augment; from.SendMessage("Light clothes mean less of a burden."); break;

                            case 2: Clothing.Attributes.RegenMana += augment; from.SendMessage("Meditation is easier when one is comfortable."); break;

                            case 3: Clothing.Attributes.Luck += augment; from.SendMessage("Everyone should have at least one lucky piece of clothing."); break;

                            case 4: Clothing.Resistances.Physical += augment; from.SendMessage("Cotton or flax, it is now stronger."); break;

                            case 5: Clothing.Resistances.Fire += augment; from.SendMessage("Cotton or flax, it is now stronger."); break;

                            case 6: Clothing.Resistances.Cold += augment; from.SendMessage("Cotton or flax, it is now stronger."); break;

                            case 7: Clothing.Resistances.Poison += augment; from.SendMessage("Cotton or flax, it is now stronger."); break;

                            case 8: Clothing.Resistances.Energy += augment; from.SendMessage("Cotton or flax, it is now stronger."); break;
                            }

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

                        else                         // Fail
                        {
                            from.SendMessage("You have failed to enhance the clothing!");
                            from.SendMessage("The clothing is damaged beyond repair!");
                            from.PlaySound(0x1F8);
                            Clothing.Delete();
                            m_RuneStone.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(10);

                        if (DestroyChance > 0)                           // Success
                        {
                            int augment = ((Utility.Random(3)) * scalar) + 1;

                            switch (Utility.Random(16))
                            {
                            case 0: Jewel.Attributes.BonusDex += augment; from.SendMessage("The light of the gem speeds the wearer's feet."); break;

                            case 1: Jewel.Attributes.BonusInt += augment; from.SendMessage("The spirit of the gem helps concentration."); break;

                            case 2: Jewel.Attributes.BonusStr += augment; from.SendMessage("The strength of the gem resonates in the muscles."); break;

                            case 3: Jewel.Attributes.Luck += augment; from.SendMessage("Gifts will rain while the gem is worn."); break;

                            case 4: Jewel.Attributes.SpellDamage += augment; from.SendMessage("Mana focuses into a stronger form."); break;

                            case 5: Jewel.Attributes.NightSight = 1; from.SendMessage("The gem lights the way."); break;

                            case 6: Jewel.Resistances.Physical += augment; from.SendMessage("The fortitude of the gem grows even stronger."); break;

                            case 7: Jewel.Resistances.Fire += augment; from.SendMessage("The fortitude of the gem grows even stronger."); break;

                            case 8: Jewel.Resistances.Cold += augment; from.SendMessage("The fortitude of the gem grows even stronger."); break;

                            case 9: Jewel.Resistances.Poison += augment; from.SendMessage("The fortitude of the gem grows even stronger."); break;

                            case 10: Jewel.Resistances.Energy += augment; from.SendMessage("The fortitude of the gem grows even stronger."); break;

                            case 11: Jewel.Attributes.AttackChance += augment; from.SendMessage("The gem glows a deep red."); break;

                            case 12: Jewel.Attributes.DefendChance += augment; from.SendMessage("The gem glows a faint yellow."); break;

                            case 13: Jewel.Attributes.LowerManaCost += augment; from.SendMessage("The gem glows an undulating blue."); break;

                            case 14: Jewel.Attributes.ReflectPhysical += augment; from.SendMessage("The gem glows a bright orange."); break;

                            case 15: Jewel.Attributes.WeaponSpeed += augment; from.SendMessage("The gem glows an eery green."); break;
                            }

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

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

                else
                {
                    from.SendMessage("You can not enhance that.");
                }
            }
예제 #3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                int DestroyChance = Utility.Random(5);
                int augment       = Utility.Random(2) + 1;

                if (targeted is Item)                 // protects from crash if targeting a Mobile.
                {
                    Item item = (Item)targeted;

                    if (!from.InRange(((Item)targeted).GetWorldLocation(), 3))
                    {
                        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 if (targeted is BaseWeapon)
                    {
                        BaseWeapon Weapon = targeted as BaseWeapon;
                        {
                            if (DestroyChance > 0)                       // Success
                            {
                                Weapon.Attributes.RegenHits += augment;
                                from.SendMessage("The Rune enhances your weapon.");
                                from.PlaySound(0x1F5);
                                m_RegenHitsRune.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_RegenHitsRune.Delete();
                            }
                        }
                    }

                    else if (targeted is BaseArmor)
                    {
                        BaseArmor Armor = targeted as BaseArmor;
                        {
                            if (DestroyChance > 0)                       // Success
                            {
                                Armor.Attributes.RegenHits += augment;
                                from.SendMessage("The Rune enhances your armor.");
                                from.PlaySound(0x1F5);
                                m_RegenHitsRune.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_RegenHitsRune.Delete();
                            }
                        }
                    }

                    else if (targeted is BaseShield)
                    {
                        BaseShield Shield = targeted as BaseShield;
                        {
                            if (DestroyChance > 0)                       // Success
                            {
                                Shield.Attributes.RegenHits += augment;
                                from.SendMessage("The Rune enhances your shield.");
                                from.PlaySound(0x1F5);
                                m_RegenHitsRune.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_RegenHitsRune.Delete();
                            }
                        }
                    }

                    else if (targeted is BaseClothing)
                    {
                        BaseClothing Clothing = targeted as BaseClothing;
                        {
                            if (DestroyChance > 0)                       // Success
                            {
                                Clothing.Attributes.RegenHits += augment;
                                from.SendMessage("The Rune enhances your clothing.");
                                from.PlaySound(0x1F5);
                                m_RegenHitsRune.Delete();
                            }

                            else                     // Fail
                            {
                                from.SendMessage("You have failed to enhance the clothing!");
                                from.SendMessage("The clothing is damaged beyond repair!");
                                from.PlaySound(88);
                                Clothing.Delete();
                                m_RegenHitsRune.Delete();
                            }
                        }
                    }

                    else if (targeted is BaseJewel)
                    {
                        BaseJewel Jewel = targeted as BaseJewel;
                        {
                            if (DestroyChance > 0)                       // Success
                            {
                                Jewel.Attributes.RegenHits += augment;
                                from.SendMessage("The Rune enhances your jewelry.");
                                from.PlaySound(0x1F5);
                                m_RegenHitsRune.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_RegenHitsRune.Delete();
                            }
                        }
                    }
                }
                else
                {
                    from.SendMessage("You cannot enhance that.");
                }
            }
예제 #4
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;

                            Weapon.Attributes.NightSight += 1; from.SendMessage("The Lor Rune enhances your weapon.");

                            from.PlaySound(0x1F5);
                            m_LorRune.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_LorRune.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.Attributes.NightSight += 1; from.SendMessage("The Lor Rune enhances your armor.");

                            from.PlaySound(0x1F5);
                            m_LorRune.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_LorRune.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.Attributes.NightSight += 1; from.SendMessage("The Lor Rune enhances your shield.");

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

                else if (targeted is BaseClothing)
                {
                    BaseClothing Clothing = targeted as BaseClothing;

                    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;

                            Clothing.Attributes.NightSight += 1; from.SendMessage("The Lor Rune enhances your clothing.");

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

                        else                         // Fail
                        {
                            from.SendMessage("You have failed to enhance the clothing!");
                            from.SendMessage("The clothing is damaged beyond repair!");
                            from.PlaySound(88);
                            Clothing.Delete();
                            m_LorRune.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;
                            Jewel.Attributes.NightSight += 1; from.SendMessage("The Lor Rune enhances your jewelry.");

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

                else
                {
                    from.SendMessage("You cannot enhance that.");
                }
            }
예제 #5
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (o is Item)
                {
                    if (from.CheckTargetSkill(SkillName.ItemID, o, 0, 100))
                    {
                        #region BaseWeapon
                        if (o is BaseWeapon && !((BaseWeapon)o).Identified)
                        {
                            BaseWeapon idarme = (BaseWeapon)o;

                            int difficulty = idarme.WeaponDifficulty;

                            if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) <= 5)
                            {
                                from.SendMessage("Cette arme dégage un pouvoir trop grand pour vos maigres moyens");
                                return;
                            }
                            else if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) >= Utility.Random(difficulty * 10))
                            {
                                from.SendMessage("Vous parvenez à décerner les capacités de l'arme");
                                idarme.Identified = true;
                            }
                            else
                            {
                                int consequence = Utility.Random(from.RawInt);

                                if (consequence < difficulty)
                                {
                                    from.SendMessage("Dans votre tentative d'identifier l'arme, vous l'avez brisée");
                                    idarme.Delete();
                                }
                                else if (consequence < difficulty * 10)
                                {
                                    from.SendMessage("Vous n'avez rien décelé, mais avez abimé l'arme");
                                    idarme.MaxHitPoints -= 1;
                                }
                                else
                                {
                                    from.SendMessage("Vous n'avez rien décelé");
                                }
                            }
                        }
                        #endregion
                        #region BaseArmor
                        else if (o is BaseArmor && !((BaseArmor)o).Identified)
                        {
                            BaseArmor idarmure = (BaseArmor)o;

                            int difficulty = idarmure.ArmorDifficulty;

                            if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) <= 5)
                            {
                                from.SendMessage("Cette armure dégage un pouvoir trop grand pour vos maigres moyens");
                                return;
                            }
                            else if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) >= Utility.Random(difficulty * 10))
                            {
                                from.SendMessage("Vous parvenez à décerner les capacités de l'armure");
                                idarmure.Identified = true;
                            }
                            else
                            {
                                int consequence = Utility.Random(from.RawInt);

                                if (consequence < difficulty)
                                {
                                    from.SendMessage("Dans votre tentative d'identifier l'armure, vous l'avez brisée");
                                    idarmure.Delete();
                                }
                                else if (consequence < difficulty * 10)
                                {
                                    from.SendMessage("Vous n'avez rien décelé, mais avez abimé l'armure");
                                    idarmure.MaxHitPoints -= 1;
                                }
                                else
                                {
                                    from.SendMessage("Vous n'avez rien décelé");
                                }
                            }
                        }
                        #endregion
                        #region BaseClothing
                        else if (o is BaseClothing && !((BaseClothing)o).Identified)
                        {
                            BaseClothing idclothing = (BaseClothing)o;

                            int difficulty = idclothing.ClothingDifficulty;

                            if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) <= 5)
                            {
                                from.SendMessage("Ce vêtement dégage un pouvoir trop grand pour vos maigres moyens");
                                return;
                            }
                            else if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) >= Utility.Random(difficulty * 10))
                            {
                                from.SendMessage("Vous parvenez à décerner les capacités du vêtement");
                                idclothing.Identified = true;
                            }
                            else
                            {
                                int consequence = Utility.Random(from.RawInt);

                                if (consequence < difficulty)
                                {
                                    from.SendMessage("Dans votre tentative d'identifier le vêtement, vous l'avez brisé");
                                    idclothing.Delete();
                                }
                                else if (consequence < difficulty * 10)
                                {
                                    from.SendMessage("Vous n'avez rien décelé, mais avez abimé le vêtement");
                                    idclothing.MaxHitPoints -= 1;
                                }
                                else
                                {
                                    from.SendMessage("Vous n'avez rien décelé");
                                }
                            }
                        }
                        #endregion
                        #region BaseJewel
                        else if (o is BaseJewel && !((BaseJewel)o).Identified)
                        {
                            BaseJewel idjewel = (BaseJewel)o;

                            int difficulty = idjewel.JewelDifficulty;

                            if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) <= 5)
                            {
                                from.SendMessage("Ce bijou dégage un pouvoir trop grand pour vos maigres moyens");
                                return;
                            }
                            else if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) >= Utility.Random(difficulty * 10))
                            {
                                from.SendMessage("Vous parvenez à décerner les capacités du bijou");
                                idjewel.Identified = true;
                            }
                            else
                            {
                                int consequence = Utility.Random(from.RawInt);

                                if (consequence < difficulty * 2)
                                {
                                    from.SendMessage("Dans votre tentative d'identifier le bijou, vous l'avez brisé");
                                    idjewel.Delete();
                                }
                                else
                                {
                                    from.SendMessage("Vous n'avez rien décelé");
                                }
                            }
                        }
                        else
                        {
                            from.SendMessage("Cet objet est déjà identifié");
                        }
                        #endregion

                        if (!Core.AOS)
                        {
                            ((Item)o).OnSingleClick(from);
                        }
                    }
                    else
                    {
                        from.SendMessage("Vous ne parvenez pas à vous concentrer.");
                    }
                }
                else if (o is Mobile)
                {
                    ((Mobile)o).OnSingleClick(from);
                }
                else
                {
                    from.SendMessage("Vous ne pouvez rien apprendre de cela");
                }
            }