Пример #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.");
                }
            }
Пример #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.");
                }
            }
Пример #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.");
                }
            }
Пример #4
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.");
                }
            }