Exemple #1
0
            protected override void OnTarget(Mobile from, object target)
            {
                Type type = target as Type;
                Item item = target as Item;

                if (item is BaseWeapon || item is Spellbook)
                {
                    if (Runescribing.GetProps(item) >= 7)
                    {
                        from.SendMessage("This item cannot be enhanced any further");
                    }
                    else if (item.ChantSlots > 0)
                    {
                        from.SendMessage("This item cannot handle any more enhancments.");
                    }
                    else if (Runescribing.CheckBlacklist(type) == true)
                    {
                        from.SendMessage("This item cannot be enhanced.");
                    }
                    else
                    {
                        if (item is BaseWeapon)
                        {
                            BaseWeapon i = item as BaseWeapon;

                            i.Slayer  = SlayerName.Silver;
                            i.Slayer2 = SlayerName.None;

                            i.SlayerSelect = true;

                            item.ChantSlots += 3;

                            m_Rune.Delete();
                        }

                        if (item is Spellbook)
                        {
                            Spellbook i = item as Spellbook;

                            i.Slayer  = SlayerName.Silver;
                            i.Slayer2 = SlayerName.None;

                            //i.SlayerSelect = true;

                            item.ChantSlots += 3;

                            m_Rune.Delete();
                        }
                    }
                }
                else
                {
                    from.SendMessage("You cannot use this enhancement on that.");
                }
            }
Exemple #2
0
            protected override void OnTarget(Mobile from, object target)
            {
                Item item = target as Item;
                Type type = item.GetType();

                if (item is BaseArmor)
                {
                    if (Runescribing.GetProps(item) >= 7)
                    {
                        from.SendMessage("This item cannot be enhanced any further");
                    }
                    else if (item.ChantSlots >= 3)
                    {
                        from.SendMessage("This item cannot handle any more enhancments.");
                    }
                    else if (Runescribing.CheckBlacklist(type) == true)
                    {
                        from.SendMessage("This item cannot be enhanced.");
                    }
                    else
                    {
                        int value = m_Rune.BaseAmount;
                        int max   = m_Rune.MaxAmount;

                        if (item is BaseArmor)
                        {
                            BaseArmor i = item as BaseArmor;

                            if (i.ArmorAttributes.MageArmor + value <= max)
                            {
                                i.ArmorAttributes.MageArmor += value;
                            }
                            else
                            {
                                i.ArmorAttributes.MageArmor = max;
                            }
                        }

                        item.ChantSlots += 1;
                        m_Rune.Delete();
                    }
                }
                else
                {
                    from.SendMessage("You cannot use this enhancement on that.");
                }
            }
Exemple #3
0
            protected override void OnTarget(Mobile from, object target)
            {
                Item item = target as Item;
                Type type = item.GetType();

                if (item is BaseArmor || item is BaseWeapon || item is BaseHat || item is BaseJewel || item is BaseTalisman || item is BaseQuiver || item is Spellbook)
                {
                    if (Runescribing.GetProps(item) >= 7)
                    {
                        from.SendMessage("This item cannot be enhanced any further");
                    }
                    else if (item.ChantSlots >= 3)
                    {
                        from.SendMessage("This item cannot handle any more enhancments.");
                    }
                    else if (Runescribing.CheckBlacklist(type) == true)
                    {
                        from.SendMessage("This item cannot be enhanced.");
                    }
                    else
                    {
                        int value = m_Rune.BaseAmount;
                        int max   = m_Rune.MaxAmount;

                        if (item is BaseArmor)
                        {
                            BaseArmor i = item as BaseArmor;

                            if (i.Attributes.CastRecovery + value <= max)
                            {
                                i.Attributes.CastRecovery += value;
                            }
                            else
                            {
                                i.Attributes.CastRecovery = max;
                            }
                        }

                        if (item is BaseWeapon)
                        {
                            BaseWeapon i = item as BaseWeapon;

                            if (i.Attributes.CastRecovery + value <= max)
                            {
                                i.Attributes.CastRecovery += value;
                            }
                            else
                            {
                                i.Attributes.CastRecovery = max;
                            }
                        }

                        if (item is BaseHat)
                        {
                            BaseHat i = item as BaseHat;

                            if (i.Attributes.CastRecovery + value <= max)
                            {
                                i.Attributes.CastRecovery += value;
                            }
                            else
                            {
                                i.Attributes.CastRecovery = max;
                            }
                        }

                        if (item is BaseJewel)
                        {
                            BaseJewel i = item as BaseJewel;

                            if (i.Attributes.CastRecovery + value <= max)
                            {
                                i.Attributes.CastRecovery += value;
                            }
                            else
                            {
                                i.Attributes.CastRecovery = max;
                            }
                        }

                        if (item is BaseTalisman)
                        {
                            BaseTalisman i = item as BaseTalisman;

                            if (i.Attributes.CastRecovery + value <= max)
                            {
                                i.Attributes.CastRecovery += value;
                            }
                            else
                            {
                                i.Attributes.CastRecovery = max;
                            }
                        }

                        if (item is BaseQuiver)
                        {
                            BaseQuiver i = item as BaseQuiver;

                            if (i.Attributes.CastRecovery + value <= max)
                            {
                                i.Attributes.CastRecovery += value;
                            }
                            else
                            {
                                i.Attributes.CastRecovery = max;
                            }
                        }

                        if (item is Spellbook)
                        {
                            Spellbook i = item as Spellbook;

                            if (i.Attributes.CastRecovery + value <= max)
                            {
                                i.Attributes.CastRecovery += value;
                            }
                            else
                            {
                                i.Attributes.CastRecovery = max;
                            }
                        }

                        item.ChantSlots += 1;
                        m_Rune.Delete();
                    }
                }
                else
                {
                    from.SendMessage("You cannot use this enhancement on that.");
                }
            }
            protected override void OnTarget(Mobile from, object target)
            {
                Item item = target as Item;

                if (target is Item && item.IsChildOf(from.Backpack))
                {
                    if (from.CheckSkill(SkillName.Imbuing, 0, 50))
                    {
                        if (Utility.Random(1000) < from.Luck / 100)
                        {
                            from.SendMessage("You dismantle the item and get some runescribing materials plus something extreamly rare.");
                            from.AddToBackpack(new CosmicCrystal());
                        }
                        else
                        {
                            from.SendMessage("You dismantle the item and get some runescribing materials.");
                        }

                        ItemDismatlerTool tool = m_Item as ItemDismatlerTool;

                        tool.Uses -= 1;

                        if (tool.Uses == 0)
                        {
                            tool.Delete();
                            from.SendMessage("Your tool has worn out.");
                        }

                        if (target is BaseArmor || target is BaseWeapon || target is BaseJewel || target is BaseTalisman || target is BaseClothing || target is Spellbook || target is BaseQuiver)
                        {
                            int props = Runescribing.GetProps(item);

                            if (item.ItemValue == ItemValue.OOAK)
                            {
                                Bag cont = new Bag();

                                cont.DropItem(new MagicalDust(20));
                                cont.DropItem(new LesserMysticEssence(20));
                                cont.DropItem(new MysticEssence(20));
                                cont.DropItem(new CosmicOil(20));
                                cont.DropItem(new MagicalRelic(20));

                                cont.Hue       = 1150;
                                cont.Name      = "a bag of runescribing resources";
                                cont.ItemValue = ItemValue.Uncommon;

                                from.AddToBackpack(cont);

                                item.Delete();
                            }
                            else if (props == 0)
                            {
                                item.Delete();
                                from.AddToBackpack(new MagicalDust(1));
                            }
                            else if (props == 1)
                            {
                                item.Delete();
                                from.AddToBackpack(new MagicalDust(Utility.Random(3)));
                            }
                            else if (props == 2)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new LesserMysticEssence(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new MagicalDust(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else if (props == 3)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new MysticEssence(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new LesserMysticEssence(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else if (props == 4)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new MysticEssence(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new LesserMysticEssence(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else if (props == 5)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new CosmicOil(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new MysticEssence(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else if (props == 6)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new CosmicOil(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new MysticEssence(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else if (props == 7)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new MagicalRelic(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new CosmicOil(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else
                            {
                                from.AddToBackpack(new MagicalRelic(1));
                                item.Delete();
                            }
                        }
                        else
                        {
                            ItemValue ivalue = item.ItemValue;

                            if (ivalue == ItemValue.Trash)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new LesserMysticEssence(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new MagicalDust(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else if (ivalue == ItemValue.Common)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new MysticEssence(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new LesserMysticEssence(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else if (ivalue == ItemValue.Uncommon)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new MysticEssence(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new LesserMysticEssence(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else if (ivalue == ItemValue.Rare)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new CosmicOil(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new MysticEssence(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else if (ivalue == ItemValue.Epic)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new MagicalRelic(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new CosmicOil(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else if (ivalue == ItemValue.Legendary)
                            {
                                from.AddToBackpack(new MagicalRelic(1));
                                item.Delete();
                            }
                            else if (ivalue == ItemValue.OOAK)
                            {
                                Bag cont = new Bag();

                                cont.DropItem(new MagicalDust(20));
                                cont.DropItem(new LesserMysticEssence(20));
                                cont.DropItem(new MysticEssence(20));
                                cont.DropItem(new CosmicOil(20));
                                cont.DropItem(new MagicalRelic(20));

                                cont.Hue       = 1150;
                                cont.Name      = "a bag of runescribing resources";
                                cont.ItemValue = ItemValue.Uncommon;

                                from.AddToBackpack(cont);

                                item.Delete();
                            }
                            else if (ivalue == ItemValue.Fabled)
                            {
                                from.AddToBackpack(new MagicalRelic(3));
                                item.Delete();
                            }
                            else if (ivalue == ItemValue.Crafted)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new LesserMysticEssence(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new MagicalDust(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else if (ivalue == ItemValue.Reagent)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new LesserMysticEssence(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new MagicalDust(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else if (ivalue == ItemValue.Resource)
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new LesserMysticEssence(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new MagicalDust(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                            else if (ivalue == ItemValue.Ancient)
                            {
                                from.AddToBackpack(new MagicalRelic(3));
                                item.Delete();
                            }
                            else if (ivalue == ItemValue.Fabulous)
                            {
                                from.AddToBackpack(new MagicalRelic(3));
                                item.Delete();
                            }
                            else
                            {
                                if (Utility.Random(100) < 5)
                                {
                                    from.AddToBackpack(new LesserMysticEssence(1));
                                }
                                else
                                {
                                    from.AddToBackpack(new MagicalDust(Utility.Random(3)));
                                }

                                item.Delete();
                            }
                        }
                    }
                    else
                    {
                        from.SendMessage("You fail to dismantle this item.");
                    }
                }
                else
                {
                    from.SendMessage("You can only dismantle items in your backpack.");
                }
            }
Exemple #5
0
            protected override void OnTarget(Mobile from, object target)
            {
                Item item = target as Item;
                Type type = item.GetType();

                if (item is BaseArmor || item is BaseWeapon || item is BaseJewel || item is BaseHat)
                {
                    if (Runescribing.GetProps(item) >= 7)
                    {
                        from.SendMessage("This item cannot be enhanced any further");
                    }
                    else if (item.ChantSlots >= 3)
                    {
                        from.SendMessage("This item cannot handle any more enhancments.");
                    }
                    else if (Runescribing.CheckBlacklist(type) == true)
                    {
                        from.SendMessage("This item cannot be enhanced.");
                    }
                    else
                    {
                        int value = m_Rune.BaseAmount;
                        int max   = m_Rune.MaxAmount;

                        if (item is BaseArmor)
                        {
                            BaseArmor i = item as BaseArmor;

                            if (i.PoisonBonus + value <= max)
                            {
                                i.PoisonBonus += value;
                            }
                            else
                            {
                                i.PoisonBonus = max;
                            }
                        }

                        if (item is BaseWeapon)
                        {
                            BaseWeapon i = item as BaseWeapon;

                            if (i.WeaponAttributes.ResistPoisonBonus + value <= max)
                            {
                                i.WeaponAttributes.ResistPoisonBonus += value;
                            }
                            else
                            {
                                i.WeaponAttributes.ResistPoisonBonus = max;
                            }
                        }

                        if (item is BaseJewel)
                        {
                            BaseJewel i = item as BaseJewel;

                            if (i.Resistances.Poison + value <= max)
                            {
                                i.Resistances.Poison += value;
                            }
                            else
                            {
                                i.Resistances.Poison = max;
                            }
                        }

                        if (item is BaseHat)
                        {
                            BaseHat i = item as BaseHat;

                            if (i.Resistances.Cold + value <= max)
                            {
                                i.Resistances.Cold += value;
                            }
                            else
                            {
                                i.Resistances.Cold = max;
                            }
                        }

                        item.ChantSlots += 1;
                        m_Rune.Delete();
                    }
                }
                else
                {
                    from.SendMessage("You cannot use this enhancement on that.");
                }
            }