Passing class type?

  • (2 Pages)
  • +
  • 1
  • 2

20 Replies - 1230 Views - Last Post: 15 April 2013 - 08:29 AM Rate Topic: -----

#1 kiasta  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 257
  • Joined: 18-November 07

Passing class type?

Posted 03 April 2013 - 02:45 PM

I'm trying to get the class type of a targeted item that I do not know the type of. Example:

IsBaseDragonkin.cs:

namespace Server.Items
{
    class IsBaseDragonkin
    {
        object target;
        public IsBaseDragonkin(object target)
        {
            this.target = target;
        }
        public bool IsDragonkin()
        {
            if (target is BaseDragonkinArmor
                || target is BaseDragonkinBracelet
                || target is BaseDragonkinCloak
                || target is BaseDragonkinEarrings
                || target is BaseDragonkinNecklace
                || target is BaseDragonkinOuterTorso
                || target is BaseDragonkinRing
                || target is BaseDragonkinShield
                || target is BaseDragonkinShoes
                || target is BaseDragonkinWeapon)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        public object GetItemType()
        {
            if (target is BaseDragonkinArmor)
            {
                 return typeof(BaseDragonkinArmor);
            }
            else if (target is BaseDragonkinBracelet)
            {
                return typeof(BaseDragonkinBracelet);
            }
            else if (target is BaseDragonkinCloak)
            {
                return typeof(BaseDragonkinCloak);
            }
            else if (target is BaseDragonkinEarrings)
            {
                return typeof(BaseDragonkinEarrings);
            }
            else if (target is BaseDragonkinNecklace)
            {
                return typeof(BaseDragonkinNecklace);
            }
            else if (target is BaseDragonkinOuterTorso)
            {
                return typeof(BaseDragonkinOuterTorso);
            }
            else if (target is BaseDragonkinRing)
            {
                return typeof(BaseDragonkinRing);
            }
            else if (target is BaseDragonkinShield)
            {
                return typeof(BaseDragonkinShield);
            }
            else if (target is BaseDragonkinShoes)
            {
                return typeof( BaseDragonkinShoes);
            }
            else if (target is BaseDragonkinWeapon)
            {
                return typeof(BaseDragonkinWeapon);
            }
            else
            {
                return null;
            }
        }
    }
}



And the implementation of the class:

LuckDeed.cs

namespace Server.Items
{
    public class LuckTarget : Target
    {
        private LuckDeed m_Deed;
        private string name;
        private int max;
        private int increment;

        public LuckTarget(LuckDeed deed) : base(1, false, TargetFlags.None)
        {
            this.m_Deed = deed;
            this.name = "Luck";
            this.max = 250;
            this.increment = 25;
        }

        protected override void OnTarget(Mobile from, object target)
        {
            IsBaseDragonkin checkItem = new IsBaseDragonkin(target);
        }
    }
}



I've tried all sorts of different ways to return the object type and use it without knowing the name of the object, something like this:

object obj = checkItem.GetItemType();



Perhaps object is not the right type to use, but nothing seems to be working, using Type item or Item item it's all the same. I want to use item as a type so I can access its members without knowing what it is, if that makes sense.

I essentially want to add this code:

BasedragonkinRing item = (BaseDragonkinRing)target;
((BaseDragonkinRing)item).Attributes.Luck += 25;



But I can't know the type BaseDragonkinRing, I want to pass it from the function that determines the type and use it like a type. Something like so (just an example of what I wish to accomplish):

object obj = checkItem.GetItemType();
((obj)item).Attributes.Luck += 25;



This is the code that is going to modify the item attribute (Luck in this example). I would actually like to pass the enumerator element and change it within that function, but then I would not be able to know the name of the element which is another problem I am having, and would make my code so much easier to work with.

ModifyItem.cs

namespace Server.Items
{
    class ItemModify
    {
        private Mobile from;
        private object target;
        private string attributeName;
        private int max;
        private int increment;
        private bool armorOnly;
        private bool weaponOnly;

        public ItemModify(Mobile from, object target, string attributeName, int max, int increment, bool armorOnly, bool weaponOnly)
        {
            this.from = from;
            this.target = target;
            this.attributeName = attributeName;
            this.max = max;
            this.increment = increment;
            this.armorOnly = armorOnly;
            this.weaponOnly = weaponOnly;
        }
        public int Modify(int attribute)
        {
            if (this.armorOnly)
            {
                if (attribute >= this.max)
                {
                    from.SendMessage("That item has max " + attributeName + ".");
                    return 0;
                }
                else
                {
                    attribute += increment;
                    from.SendMessage(attributeName + " successfully added to item.");
                    return attribute;
                }
            }
            else
                return 0;
        }
    }
}



I just am not sure how to go about using obj as a type or at least somehow instantiating the class (BaseDragonkinArmor, for example) without knowing its name. I don't really know how to explain my problem well, so hopefully I made it clear enough through examples. I know a way to make everything work, but it requires I bruteforce every single Attribute (and there are 50 of them), I just want something I can easily change if I need to for all 50 deeds, otherwise I have to go through all 50 of them.

This is what I had before, and it works.

LuckDeed.cs

using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server;

namespace Server.Items
{
    public class LuckTarget : Target
    {
        private LuckDeed m_Deed;
        private string name;
        private int max;
        private int increment;

        public LuckTarget(LuckDeed deed) : base(1, false, TargetFlags.None)
        {
            this.m_Deed = deed;
            this.name = "Luck";
            this.max = 250;
            this.increment = 25;
        }

        protected override void OnTarget(Mobile from, object target)
        {
            if (m_Deed.Deleted || m_Deed.RootParent != from)
            {
                from.SendMessage("You cannot add luck to that.");
                return;
            }
            if (target is BaseDragonkinWeapon)
            {
                BaseDragonkinWeapon item = (BaseDragonkinWeapon)target;
                if (item is BaseDragonkinWeapon)
                {
                    if (((BaseDragonkinWeapon)item).Attributes.Luck >= 250)
                    {
                        from.SendMessage("That item has max luck.");
                    }
                    else
                    {
                        ((BaseDragonkinWeapon)item).Attributes.Luck += 25;
                        from.SendMessage("Luck successfully added to item.");
                        m_Deed.Delete();
                    }
                }
            }
            else if (target is BaseDragonkinArmor)
            {
                BaseDragonkinArmor item = (BaseDragonkinArmor)target;
                if (item is BaseDragonkinArmor)
                {
                    if (((BaseDragonkinArmor)item).Attributes.Luck >= 250)
                    {
                        from.SendMessage("That item has max luck.");
                    }
                    else
                    {
                        ((BaseDragonkinArmor)item).Attributes.Luck += 25;
                        from.SendMessage("Luck successfully added to item.");
                        m_Deed.Delete();
                    }
                }
            }
            else if (target is BaseDragonkinShield)
            {
                BaseDragonkinShield item = (BaseDragonkinShield)target;
                if (item is BaseDragonkinShield)
                {
                    if (((BaseDragonkinShield)item).Attributes.Luck >= 250)
                    {
                        from.SendMessage("That item has max luck.");
                    }
                    else
                    {
                        ((BaseDragonkinShield)item).Attributes.Luck += 25;
                        from.SendMessage("Luck successfully added to item.");
                        m_Deed.Delete();
                    }
                }
            }
            else if (target is BaseDragonkinCloak)
            {
                BaseDragonkinCloak item = (BaseDragonkinCloak)target;
                if (item is BaseDragonkinCloak)
                {
                    if (((BaseDragonkinCloak)item).Attributes.Luck >= 250)
                    {
                        from.SendMessage("That item has max weapon damage increase.");
                    }
                    else
                    {
                        ((BaseDragonkinCloak)item).Attributes.Luck += 25;
                        from.SendMessage("Weapon damage increase successfully added to item.");
                        m_Deed.Delete();
                    }
                }
            }
            else if (target is BaseDragonkinOuterTorso)
            {
                BaseDragonkinOuterTorso item = (BaseDragonkinOuterTorso)target;
                if (item is BaseDragonkinOuterTorso)
                {
                    if (((BaseDragonkinOuterTorso)item).Attributes.Luck >= 250)
                    {
                        from.SendMessage("That item has max weapon damage increase.");
                    }
                    else
                    {
                        ((BaseDragonkinOuterTorso)item).Attributes.Luck += 25;
                        from.SendMessage("Weapon damage increase successfully added to item.");
                        m_Deed.Delete();
                    }
                }
            }
            else if (target is BaseDragonkinShoes)
            {
                BaseDragonkinShoes item = (BaseDragonkinShoes)target;
                if (item is BaseDragonkinShoes)
                {
                    if (((BaseDragonkinShoes)item).Attributes.Luck >= 250)
                    {
                        from.SendMessage("That item has max weapon damage increase.");
                    }
                    else
                    {
                        ((BaseDragonkinShoes)item).Attributes.Luck += 25;
                        from.SendMessage("Weapon damage increase successfully added to item.");
                        m_Deed.Delete();
                    }
                }
            }
            else if (target is BaseDragonkinBracelet)
            {
                BaseDragonkinBracelet item = (BaseDragonkinBracelet)target;
                if (item is BaseDragonkinBracelet)
                {
                    if (((BaseDragonkinBracelet)item).Attributes.Luck >= 250)
                    {
                        from.SendMessage("That item has max weapon damage increase.");
                    }
                    else
                    {
                        ((BaseDragonkinBracelet)item).Attributes.Luck += 25;
                        from.SendMessage("Weapon damage increase successfully added to item.");
                        m_Deed.Delete();
                    }
                }
            }
            else if (target is BaseDragonkinEarrings)
            {
                BaseDragonkinEarrings item = (BaseDragonkinEarrings)target;
                if (item is BaseDragonkinEarrings)
                {
                    if (((BaseDragonkinEarrings)item).Attributes.Luck >= 250)
                    {
                        from.SendMessage("That item has max weapon damage increase.");
                    }
                    else
                    {
                        ((BaseDragonkinEarrings)item).Attributes.Luck += 25;
                        from.SendMessage("Weapon damage increase successfully added to item.");
                        m_Deed.Delete();
                    }
                }
            }
            else if (target is BaseDragonkinNecklace)
            {
                BaseDragonkinNecklace item = (BaseDragonkinNecklace)target;
                if (item is BaseDragonkinNecklace)
                {
                    if (((BaseDragonkinNecklace)item).Attributes.Luck >= 250)
                    {
                        from.SendMessage("That item has max weapon damage increase.");
                    }
                    else
                    {
                        ((BaseDragonkinNecklace)item).Attributes.Luck += 25;
                        from.SendMessage("Weapon damage increase successfully added to item.");
                        m_Deed.Delete();
                    }
                }
            }
            else if (target is BaseDragonkinRing)
            {
                BaseDragonkinRing item = (BaseDragonkinRing)target;
                if (item is BaseDragonkinRing)
                {
                    if (((BaseDragonkinRing)item).Attributes.Luck >= 250)
                    {
                        from.SendMessage("That item has max weapon damage increase.");
                    }
                    else
                    {
                        ((BaseDragonkinRing)item).Attributes.Luck += 25;
                        from.SendMessage("Weapon damage increase successfully added to item.");
                        m_Deed.Delete();
                    }
                }
            }
            else
            {
                from.SendMessage("You cannot put luck on that.");
            }
        }
    }

    public class LuckDeed : Item
    {
        [Constructable]
        public LuckDeed()
            : base(0x14F0)
        {
            Name = "a luck deed";
            Hue = 1150;
            Weight = 1.0;
        }

        public LuckDeed(Serial serial)
            : base(serial)
        {
        }
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write((int)0);
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
        }

        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("The item needs to be in your pack");
            }
            else
            {
                from.SendMessage("Which item would you like to add luck to?");
                from.Target = new LuckTarget(this);
            }
        }
    }
}



As you can tell modifying 50 of these will just be too much work. I added the max and increment members after I changed the code already.

Any help would be appreciated, or perhaps a point in the right direction?

Is This A Good Question/Topic? 0
  • +

Replies To: Passing class type?

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5438
  • View blog
  • Posts: 11,669
  • Joined: 02-June 10

Re: Passing class type?

Posted 03 April 2013 - 02:58 PM

Objects already have the .TypeOf and .GetType() methods.
You should be using those.
Was This Post Helpful? 1
  • +
  • -

#3 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5438
  • View blog
  • Posts: 11,669
  • Joined: 02-June 10

Re: Passing class type?

Posted 03 April 2013 - 03:40 PM

This is also very non-standard and would make other developers you're working with mad at you
03 class IsBaseDragonkin

IsbaseDragonkin sounds like a bool property. It totally matches standards such as .IsChecked .IsEnabled .IsVisible and so on.


Hardcoding things like this is frowned upon:
if (((BaseDragonkinBracelet)item).Attributes.Luck >= 250)
A value of MaxLuck could be set to 250 then you can compare to that.
if (((BaseDragonkinBracelet)item).Attributes.Luck >= MaxLuck)
This lets you change your max in one place, one time, and not have to scrub through thousands of lines of code to replace hardcoded 250 everywhere.
It also lets you change the max during run-time. So at a new level or with the right magically gem the new MaxLuck could double to 500.

You really need to re-examine and re-plan on a more OOP design. These massive If..else blocks are horrible. Repeating so much code is terrible. You could cut a lot of repeat even within all those if...else with just some more thought and better planning.

Whiskey Tango Foxtrot?

Quote

211
        [Constructable]
212        public LuckDeed()
213            : base(0x14F0)


What's with the hex as a constructor argument?

Tons of waste in stuff like this

Quote

066            else if (target is BaseDragonkinShield)
067            {
068                BaseDragonkinShield item = (BaseDragonkinShield)target;
069                if (item is BaseDragonkinShield)


Line 69 has to be tru if 66 was true. Simply has to be. But the if comparison will cost you on performance. Not much I admit. But if you keep doing this sort of stuff 1,000 times a minute in a game it will be noticed.

If I were you I'd stop. Maybe start a version 2. And reduce the blocks of 200+ lines to about the 40-50 lines should be.
Was This Post Helpful? 1
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2241
  • View blog
  • Posts: 9,412
  • Joined: 29-May 08

Re: Passing class type?

Posted 03 April 2013 - 03:54 PM

Also consider how using Inheritance and Interfaces could make your architecture easier.
Was This Post Helpful? 2
  • +
  • -

#5 kiasta  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 257
  • Joined: 18-November 07

Re: Passing class type?

Posted 03 April 2013 - 04:49 PM

Quote

Objects already have the .TypeOf and .GetType() methods.
You should be using those.


I can try to use the GetType() method, I can do a google search on it's use.

Quote

This is also very non-standard and would make other developers you're working with mad at you


I was thinking about that myself, but I didn't have a good name for the class and just went with it to modify later. I'm doing the project solo, until completely finished.

Quote

Hardcoding things like this is frowned upon:
if (((BaseDragonkinBracelet)item).Attributes.Luck >= 250)

A value of MaxLuck could be set to 250 then you can compare to that.
if (((BaseDragonkinBracelet)item).Attributes.Luck >= MaxLuck)

This lets you change your max in one place, one time, and not have to scrub through thousands of lines of code to replace hardcoded 250 everywhere.
It also lets you change the max during run-time. So at a new level or with the right magically gem the new MaxLuck could double to 500.


Yeah, I added that member when I started to change the code, I think it was on there but I never implemented it with the old code, I was re-doing everything.

Quote

You really need to re-examine and re-plan on a more OOP design. These massive If..else blocks are horrible. Repeating so much code is terrible. You could cut a lot of repeat even within all those if...else with just some more thought and better planning.


That's exactly what I was attempting, but passing and returning class types that I don't know of is setting me back. I could create a member in the item classes called upgradeable and check if the member exists when targeted I suppose, but I think that method is sloppy, but it's doable.

Quote

What's with the hex as a constructor argument?


It's actually the item ID (or so I was told) why it's there I have no idea, but all the items have that constructor.

Quote

Line 69 has to be tru if 66 was true. Simply has to be. But the if comparison will cost you on performance. Not much I admit. But if you keep doing this sort of stuff 1,000 times a minute in a game it will be noticed.

If I were you I'd stop. Maybe start a version 2. And reduce the blocks of 200+ lines to about the 40-50 lines should be.
That's exactly my thought as well, I'm trying to re-create everything more OOP based, but the program I'm working on has 9000+ files to work with and it's difficult to understand what a lot of things do, so I have to be careful.

If I can just figure out how to get a class type without knowing anything about it, while at the same time instantiate that class, than I'd be able to finish. I just haven't found anything on google or at least haven't asked the right question.

Another example of what I need to do:

BaseDragonkinArmor item = (BaseDragonkinArmor)target;



if I target an item, I can get the object of the item as: object target and can then proceed to do something like above, which is fine. Now if I want to make it where I can determine the BaseDragonkin Type (BaseDragonkinArmor, BaseDragonkin Shield, etc.) so I don't have to write all those if/else statements there my problem arises. I have no idea how to return an object type from a function like the first code example I gave on the first post. If I can figure that out I can make this code very small, but I just can't find the right examples and can't express my question properly enough.

The last bit of code I posted on my first post was just an example of what it looked like before I started to re-write it. I did that about 3 years ago, and am starting back up on this project. I'm just having some difficulties. I'm trying to break it all down to 3 different functionalities. To determine if the item is upgradeable by getting the item type from the target object, which is what this does:

BaseDragonkinArmor item = (BaseDragonkinArmor)target;


than modify the item based on the increment value of the deed itself, which is what the ModifyItem.cs file will do. I will have to create a seperate cs file for each attribute but I need only have the identifier file (determines the type of item [BaseDragonkinArmor, etc.) and modifier file (modifies the attribute).

I should also note that I'm using only .NET 2.0, I'm not yet skilled enough to modify 9000+ files to be compatible with .NET 4.5 so I might be limited a bit.

I have everything working with the old code, that's not the issue. My main issue is I don't know how to manipulate clases without knowing anything about them. Like you were saying, I should use GetType() which I will look into soon after this post, but for now I'm a bit stuck.

Maybe I'm asking the wrong question, but I'm not very good with explaining my problems, sorry.
Was This Post Helpful? 0
  • +
  • -

#6 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5438
  • View blog
  • Posts: 11,669
  • Joined: 02-June 10

Re: Passing class type?

Posted 03 April 2013 - 05:21 PM

Quote

I can try to use the GetType() method, I can do a google search on it's use.

Huh? I gave you links right to MSDN page on how to use them.

Quote

I'm doing the project solo,
{...}
It's actually the item ID (or so I was told) why it's there I have no idea, but all the items have that constructor.

That's very inconsistent. Are you doing it solo, or are you being told how to do things and working off base classes that someone else made?


Quote

That's exactly my thought as well, I'm trying to re-create everything more OOP based, but the program I'm working on has 9000+ files to work with and it's difficult to understand what a lot of things do, so I have to be careful.


I'm starting to get the picture now. You took on a contract to re-write someone else's project - only you're not really any more prepared to do that than was the original coder.

Sounds a lot like you bit off more than you can chew. Some times that makes us push to stretch past our boundaries. But given your questions I think you took this on WAY too early in your learning. You obviously don't understand a lot of the base concepts of OOP, classes, inheritence, and even good basic coding practices. Personally I think the right thing to do is be honest with the contractor and admit that this is beyond your skills so they can get a qualified coder to complete it in the time frame they are working with. Dragging it out until they can't find someone else is going to make it hard on them and ruin your reputation before you get started in the industry.
Was This Post Helpful? 0
  • +
  • -

#7 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3479
  • View blog
  • Posts: 10,725
  • Joined: 05-May 12

Re: Passing class type?

Posted 03 April 2013 - 07:41 PM

kiasta's project is related to RunUO: http://www.runuo.com...s/runuo-server/

He even has a mention on one of the posts: http://www.runuo.com...ds-help.101039/
Was This Post Helpful? 0
  • +
  • -

#8 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5438
  • View blog
  • Posts: 11,669
  • Joined: 02-June 10

Re: Passing class type?

Posted 04 April 2013 - 06:02 AM

Ok. But that doesn't mean the code is well done.
I can take a photo of my dog behind the steering wheel of my truck. That doesn't mean he can drive the damned thing.
Was This Post Helpful? 0
  • +
  • -

#9 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3243
  • View blog
  • Posts: 10,882
  • Joined: 12-December 12

Re: Passing class type?

Posted 04 April 2013 - 06:22 AM

View PosttlhIn`toq, on 04 April 2013 - 01:02 PM, said:

Ok. But that doesn't mean the code is well done.
I can take a photo of my dog behind the steering wheel of my truck. That doesn't mean he can drive the damned thing.

Does he have a licence :)
Was This Post Helpful? 1
  • +
  • -

#10 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5438
  • View blog
  • Posts: 11,669
  • Joined: 02-June 10

Re: Passing class type?

Posted 04 April 2013 - 06:37 AM

Attached Image
Was This Post Helpful? 2
  • +
  • -

#11 kiasta  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 257
  • Joined: 18-November 07

Re: Passing class type?

Posted 04 April 2013 - 07:57 AM

Lol I didn't take a contract, I'm just doing it for fun, trying to learn more about the server and get more experience with larger projects. I created this about 3 years ago the way I did it was just following the basic item template they already had available and just create some new items, etc. And yes it's for a RunUO server. I'm just trying to find a way to make it easier to manage, so if I have to alter something I don't have to go through all 50 deeds.

As far as the inheritance part, that's actually not a bad idea. Though I still have the problem of not being able to efficiently get the item's type and altering the attribute member without knowing anything about the class (or it's members, for that matter), still looking into it. Just replying to yalls comments and still doing research. Thanks for all the advice though, I appreciate it :)

*EDIT* Also, regarding the post from the RunUO forums, you won't see any of my posts for some reason my account was banned, I've not logged in there for 3 years (since 2010), I'm guessing it has to do with my laptop being stolen and my homepage set to that forums and auto logged in, either way I just found out about being banned *shrugs*. Anyways, not that it matters but I am the original creater of these items, all my posts seem to have vanished, that's all including the fixes for that guy's problem. I'm trying to get everything situated with them, but until then I'm not posting a single post on their forums.

This post has been edited by kiasta: 04 April 2013 - 08:02 AM

Was This Post Helpful? 0
  • +
  • -

#12 kiasta  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 257
  • Joined: 18-November 07

Re: Passing class type?

Posted 08 April 2013 - 04:41 PM

Well if anyone is interested here is the resolution:

ModifyItem.cs

using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server;

namespace Server.Items
{
    class ModifyItem
    {
        private Mobile m_From;
        private int m_AttributeValue;
        private int m_Max;
        private int m_Modifier;
        private string m_AttributeName;
        private object o_Target;
        public bool IsApplied;
        public ModifyItem(Mobile from, object target, string attributeName, int max, int modifier)
        {
            m_From = from;
            o_Target = target;
            m_AttributeName = attributeName;
            m_Max = max;
            m_Modifier = modifier;
            IsApplied = false;
            DoModify();
        }
        private void DoModify()
        {
            if (o_Target is BaseDragonkinArmor)
            {
                BaseDragonkinArmor item = (BaseDragonkinArmor)o_Target;
                Modify(item);
            }
            else if (o_Target is BaseDragonkinBracelet)
            {
                BaseDragonkinBracelet item = (BaseDragonkinBracelet)o_Target;
                Modify(item);
            }
            else if (o_Target is BaseDragonkinCloak)
            {
                BaseDragonkinCloak item = (BaseDragonkinCloak)o_Target;
                Modify(item);
            }
            else if (o_Target is BaseDragonkinEarrings)
            {
                BaseDragonkinEarrings item = (BaseDragonkinEarrings)o_Target;
                Modify(item);
            }
            else if (o_Target is BaseDragonkinNecklace)
            {
                BaseDragonkinNecklace item = (BaseDragonkinNecklace)o_Target;
                Modify(item);
            }
            else if (o_Target is BaseDragonkinOuterTorso)
            {
                BaseDragonkinOuterTorso item = (BaseDragonkinOuterTorso)o_Target;
                Modify(item);
            }
            else if (o_Target is BaseDragonkinRing)
            {
                BaseDragonkinRing item = (BaseDragonkinRing)o_Target;
                Modify(item);
            }
            else if (o_Target is BaseDragonkinShield)
            {
                BaseDragonkinShield item = (BaseDragonkinShield)o_Target;
                Modify(item);
            }
            else if (o_Target is BaseDragonkinShoes)
            {
                BaseDragonkinShoes item = (BaseDragonkinShoes)o_Target;
                Modify(item);
            }
            else if (o_Target is BaseDragonkinWeapon)
            {
                BaseDragonkinWeapon item = (BaseDragonkinWeapon)o_Target;
                Modify(item);
            }
            else
            {
                m_From.SendMessage("You cannot apply {0} to that.", m_AttributeName);
            }
        }

        #region Modify Overloads

        private void Modify(BaseDragonkinArmor item)
        {
            switch (m_AttributeName)
            {
                case "attack chance":
                    {
                        m_AttributeValue = item.Attributes.AttackChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.AttackChance = m_AttributeValue;
                        }
                        break;
                    }
                case "bless":
                    {
                        if (item.LootType == LootType.Blessed || item.BlessedFor == m_From || (Mobile.InsuranceEnabled && item.Insured))
                        {
                            m_From.SendMessage("Your item is already blessed");
                        }
                        else if (item.RootParent != m_From)
                        {
                            m_From.SendMessage("You cannot bless that object");
                        }
                        else
                        {
                            item.LootType = LootType.Blessed;
                            m_From.SendMessage("Your item has been blessed");
                        }
                        break;
                    }
                case "dexterity bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusDex;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusDex = m_AttributeValue;
                        }
                        break;
                    }
                case "health bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusHits = m_AttributeValue;
                        }
                        break;
                    }
                case "intelligence bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusInt;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusInt = m_AttributeValue;
                        }
                        break;
                    }
                case "mana bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStam = m_AttributeValue;
                        }
                        break;
                    }
                case "strength bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStr;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStr = m_AttributeValue;
                        }
                        break;
                    }
                case "defense chance increase":
                    {
                        m_AttributeValue = item.Attributes.DefendChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.DefendChance = m_AttributeValue;
                        }
                        break;
                    }
                case "durability bonus":
                    {
                        m_AttributeValue = item.ArmorAttributes.DurabilityBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.ArmorAttributes.DurabilityBonus = m_AttributeValue;
                        }
                        break;
                    }
                case "enhance potions":
                    {
                        m_AttributeValue = item.Attributes.EnhancePotions;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.EnhancePotions = m_AttributeValue;
                        }
                        break;
                    }
                case "faster casting speed":
                    {
                        m_AttributeValue = item.Attributes.CastSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "faster cast recovery":
                    {
                        m_AttributeValue = item.Attributes.CastRecovery;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastRecovery = m_AttributeValue;
                        }
                        break;
                    }
                case "lower mana cost":
                    {
                        m_AttributeValue = item.Attributes.LowerManaCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerManaCost = m_AttributeValue;
                        }
                        break;
                    }
                case "lower reagent cost":
                    {
                        m_AttributeValue = item.Attributes.LowerRegCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerRegCost = m_AttributeValue;
                        }
                        break;
                    }
                case "luck":
                    {
                        m_AttributeValue = item.Attributes.Luck;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.Luck = m_AttributeValue;
                        }
                        break;
                    }
                case "mage armor":
                    {
                        m_AttributeValue = item.ArmorAttributes.MageArmor;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.ArmorAttributes.MageArmor = m_AttributeValue;
                        }
                        break;
                    }
                case "night sight":
                    {
                        m_AttributeValue = item.Attributes.NightSight;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.NightSight = m_AttributeValue;
                        }
                        break;
                    }
                case "reflect physical":
                    {
                        m_AttributeValue = item.Attributes.ReflectPhysical;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.ReflectPhysical = m_AttributeValue;
                        }
                        break;
                    }
                case "health regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenHits = m_AttributeValue;
                        }
                        break;
                    }
                case "mana regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenStam = m_AttributeValue;
                        }
                        break;
                    }
                case "self repair":
                    {
                        m_AttributeValue = item.ArmorAttributes.SelfRepair;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.ArmorAttributes.SelfRepair = m_AttributeValue;
                        }
                        break;
                    }
                case "spell damage":
                    {
                        m_AttributeValue = item.Attributes.SpellDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellDamage = m_AttributeValue;
                        }
                        break;
                    }
                case "swing speed increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "weapon damage increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponDamage = m_AttributeValue;
                        }
                        break;
                    }
                default:
                    {
                        m_From.SendMessage("You cannot apply {0} to that.", m_AttributeName);
                        break;
                    }
            }
        }
        private void Modify(BaseDragonkinBracelet item)
        {
            switch (m_AttributeName)
            {
                case "attack chance":
                    {
                        m_AttributeValue = item.Attributes.AttackChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.AttackChance = m_AttributeValue;
                        }
                        break;
                    }
                case "bless":
                    {
                        if (item.LootType == LootType.Blessed || item.BlessedFor == m_From || (Mobile.InsuranceEnabled && item.Insured))
                        {
                            m_From.SendMessage("Your item is already blessed");
                        }
                        else if (item.RootParent != m_From)
                        {
                            m_From.SendMessage("You cannot bless that object");
                        }
                        else
                        {
                            item.LootType = LootType.Blessed;
                            m_From.SendMessage("Your item has been blessed");
                        }
                        break;
                    }
                case "dexterity bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusDex;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusDex = m_AttributeValue;
                        }
                        break;
                    }
                case "health bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusHits = m_AttributeValue;
                        }
                        break;
                    }
                case "intelligence bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusInt;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusInt = m_AttributeValue;
                        }
                        break;
                    }
                case "mana bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStam = m_AttributeValue;
                        }
                        break;
                    }
                case "strength bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStr;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStr = m_AttributeValue;
                        }
                        break;
                    }
                case "defense chance increase":
                    {
                        m_AttributeValue = item.Attributes.DefendChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.DefendChance = m_AttributeValue;
                        }
                        break;
                    }
                case "enhance potions":
                    {
                        m_AttributeValue = item.Attributes.EnhancePotions;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.EnhancePotions = m_AttributeValue;
                        }
                        break;
                    }
                case "faster casting speed":
                    {
                        m_AttributeValue = item.Attributes.CastSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "faster cast recovery":
                    {
                        m_AttributeValue = item.Attributes.CastRecovery;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastRecovery = m_AttributeValue;
                        }
                        break;
                    }
                case "lower mana cost":
                    {
                        m_AttributeValue = item.Attributes.LowerManaCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerManaCost = m_AttributeValue;
                        }
                        break;
                    }
                case "lower reagent cost":
                    {
                        m_AttributeValue = item.Attributes.LowerRegCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerRegCost = m_AttributeValue;
                        }
                        break;
                    }
                case "luck":
                    {
                        m_AttributeValue = item.Attributes.Luck;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.Luck = m_AttributeValue;
                        }
                        break;
                    }
                case "night sight":
                    {
                        m_AttributeValue = item.Attributes.NightSight;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.NightSight = m_AttributeValue;
                        }
                        break;
                    }
                case "reflect physical":
                    {
                        m_AttributeValue = item.Attributes.ReflectPhysical;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.ReflectPhysical = m_AttributeValue;
                        }
                        break;
                    }
                case "health regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenHits = m_AttributeValue;
                        }
                        break;
                    }
                case "mana regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenStam = m_AttributeValue;
                        }
                        break;
                    }
                case "spell damage":
                    {
                        m_AttributeValue = item.Attributes.SpellDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellDamage = m_AttributeValue;
                        }
                        break;
                    }
                case "swing speed increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "weapon damage increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponDamage = m_AttributeValue;
                        }
                        break;
                    }
                default:
                    {
                        m_From.SendMessage("You cannot apply {0} to that.", m_AttributeName);
                        break;
                    }
            }
        }
        private void Modify(BaseDragonkinCloak item)
        {
            switch (m_AttributeName)
            {
                case "attack chance":
                    {
                        m_AttributeValue = item.Attributes.AttackChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.AttackChance = m_AttributeValue;
                        }
                        break;
                    }
                case "bless":
                    {
                        if (item.LootType == LootType.Blessed || item.BlessedFor == m_From || (Mobile.InsuranceEnabled && item.Insured))
                        {
                            m_From.SendMessage("Your item is already blessed");
                        }
                        else if (item.RootParent != m_From)
                        {
                            m_From.SendMessage("You cannot bless that object");
                        }
                        else
                        {
                            item.LootType = LootType.Blessed;
                            m_From.SendMessage("Your item has been blessed");
                        }
                        break;
                    }
                case "dexterity bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusDex;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusDex = m_AttributeValue;
                        }
                        break;
                    }
                case "health bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusHits = m_AttributeValue;
                        }
                        break;
                    }
                case "intelligence bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusInt;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusInt = m_AttributeValue;
                        }
                        break;
                    }
                case "mana bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStam = m_AttributeValue;
                        }
                        break;
                    }
                case "strength bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStr;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStr = m_AttributeValue;
                        }
                        break;
                    }
                case "defense chance increase":
                    {
                        m_AttributeValue = item.Attributes.DefendChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.DefendChance = m_AttributeValue;
                        }
                        break;
                    }
                case "enhance potions":
                    {
                        m_AttributeValue = item.Attributes.EnhancePotions;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.EnhancePotions = m_AttributeValue;
                        }
                        break;
                    }
                case "faster casting speed":
                    {
                        m_AttributeValue = item.Attributes.CastSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "faster cast recovery":
                    {
                        m_AttributeValue = item.Attributes.CastRecovery;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastRecovery = m_AttributeValue;
                        }
                        break;
                    }
                case "lower mana cost":
                    {
                        m_AttributeValue = item.Attributes.LowerManaCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerManaCost = m_AttributeValue;
                        }
                        break;
                    }
                case "lower reagent cost":
                    {
                        m_AttributeValue = item.Attributes.LowerRegCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerRegCost = m_AttributeValue;
                        }
                        break;
                    }
                case "luck":
                    {
                        m_AttributeValue = item.Attributes.Luck;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.Luck = m_AttributeValue;
                        }
                        break;
                    }
                case "night sight":
                    {
                        m_AttributeValue = item.Attributes.NightSight;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.NightSight = m_AttributeValue;
                        }
                        break;
                    }
                case "reflect physical":
                    {
                        m_AttributeValue = item.Attributes.ReflectPhysical;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.ReflectPhysical = m_AttributeValue;
                        }
                        break;
                    }
                case "health regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenHits = m_AttributeValue;
                        }
                        break;
                    }
                case "mana regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenStam = m_AttributeValue;
                        }
                        break;
                    }
                case "spell damage":
                    {
                        m_AttributeValue = item.Attributes.SpellDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellDamage = m_AttributeValue;
                        }
                        break;
                    }
                case "swing speed increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "weapon damage increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponDamage = m_AttributeValue;
                        }
                        break;
                    }
                default:
                    {
                        m_From.SendMessage("You cannot apply {0} to that.", m_AttributeName);
                        break;
                    }
            }
        }
        private void Modify(BaseDragonkinEarrings item)
        {
            switch (m_AttributeName)
            {
                case "attack chance":
                    {
                        m_AttributeValue = item.Attributes.AttackChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.AttackChance = m_AttributeValue;
                        }
                        break;
                    }
                case "bless":
                    {
                        if (item.LootType == LootType.Blessed || item.BlessedFor == m_From || (Mobile.InsuranceEnabled && item.Insured))
                        {
                            m_From.SendMessage("Your item is already blessed");
                        }
                        else if (item.RootParent != m_From)
                        {
                            m_From.SendMessage("You cannot bless that object");
                        }
                        else
                        {
                            item.LootType = LootType.Blessed;
                            m_From.SendMessage("Your item has been blessed");
                        }
                        break;
                    }
                case "dexterity bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusDex;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusDex = m_AttributeValue;
                        }
                        break;
                    }
                case "health bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusHits = m_AttributeValue;
                        }
                        break;
                    }
                case "intelligence bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusInt;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusInt = m_AttributeValue;
                        }
                        break;
                    }
                case "mana bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStam = m_AttributeValue;
                        }
                        break;
                    }
                case "strength bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStr;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStr = m_AttributeValue;
                        }
                        break;
                    }
                case "defense chance increase":
                    {
                        m_AttributeValue = item.Attributes.DefendChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.DefendChance = m_AttributeValue;
                        }
                        break;
                    }
                case "enhance potions":
                    {
                        m_AttributeValue = item.Attributes.EnhancePotions;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.EnhancePotions = m_AttributeValue;
                        }
                        break;
                    }
                case "faster casting speed":
                    {
                        m_AttributeValue = item.Attributes.CastSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "faster cast recovery":
                    {
                        m_AttributeValue = item.Attributes.CastRecovery;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastRecovery = m_AttributeValue;
                        }
                        break;
                    }
                case "lower mana cost":
                    {
                        m_AttributeValue = item.Attributes.LowerManaCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerManaCost = m_AttributeValue;
                        }
                        break;
                    }
                case "lower reagent cost":
                    {
                        m_AttributeValue = item.Attributes.LowerRegCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerRegCost = m_AttributeValue;
                        }
                        break;
                    }
                case "luck":
                    {
                        m_AttributeValue = item.Attributes.Luck;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.Luck = m_AttributeValue;
                        }
                        break;
                    }
                case "night sight":
                    {
                        m_AttributeValue = item.Attributes.NightSight;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.NightSight = m_AttributeValue;
                        }
                        break;
                    }
                case "reflect physical":
                    {
                        m_AttributeValue = item.Attributes.ReflectPhysical;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.ReflectPhysical = m_AttributeValue;
                        }
                        break;
                    }
                case "health regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenHits = m_AttributeValue;
                        }
                        break;
                    }
                case "mana regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenStam = m_AttributeValue;
                        }
                        break;
                    }
                case "spell damage":
                    {
                        m_AttributeValue = item.Attributes.SpellDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellDamage = m_AttributeValue;
                        }
                        break;
                    }
                case "swing speed increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "weapon damage increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponDamage = m_AttributeValue;
                        }
                        break;
                    }
                default:
                    {
                        m_From.SendMessage("You cannot apply {0} to that.", m_AttributeName);
                        break;
                    }
            }
        }
        private void Modify(BaseDragonkinNecklace item)
        {
            switch (m_AttributeName)
            {
                case "attack chance":
                    {
                        m_AttributeValue = item.Attributes.AttackChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.AttackChance = m_AttributeValue;
                        }
                        break;
                    }
                case "bless":
                    {
                        if (item.LootType == LootType.Blessed || item.BlessedFor == m_From || (Mobile.InsuranceEnabled && item.Insured))
                        {
                            m_From.SendMessage("Your item is already blessed");
                        }
                        else if (item.RootParent != m_From)
                        {
                            m_From.SendMessage("You cannot bless that object");
                        }
                        else
                        {
                            item.LootType = LootType.Blessed;
                            m_From.SendMessage("Your item has been blessed");
                        }
                        break;
                    }
                case "dexterity bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusDex;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusDex = m_AttributeValue;
                        }
                        break;
                    }
                case "health bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusHits = m_AttributeValue;
                        }
                        break;
                    }
                case "intelligence bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusInt;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusInt = m_AttributeValue;
                        }
                        break;
                    }
                case "mana bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStam = m_AttributeValue;
                        }
                        break;
                    }
                case "strength bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStr;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStr = m_AttributeValue;
                        }
                        break;
                    }
                case "defense chance increase":
                    {
                        m_AttributeValue = item.Attributes.DefendChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.DefendChance = m_AttributeValue;
                        }
                        break;
                    }
                case "enhance potions":
                    {
                        m_AttributeValue = item.Attributes.EnhancePotions;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.EnhancePotions = m_AttributeValue;
                        }
                        break;
                    }
                case "faster casting speed":
                    {
                        m_AttributeValue = item.Attributes.CastSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "faster cast recovery":
                    {
                        m_AttributeValue = item.Attributes.CastRecovery;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastRecovery = m_AttributeValue;
                        }
                        break;
                    }
                case "lower mana cost":
                    {
                        m_AttributeValue = item.Attributes.LowerManaCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerManaCost = m_AttributeValue;
                        }
                        break;
                    }
                case "lower reagent cost":
                    {
                        m_AttributeValue = item.Attributes.LowerRegCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerRegCost = m_AttributeValue;
                        }
                        break;
                    }
                case "luck":
                    {
                        m_AttributeValue = item.Attributes.Luck;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.Luck = m_AttributeValue;
                        }
                        break;
                    }
                case "night sight":
                    {
                        m_AttributeValue = item.Attributes.NightSight;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.NightSight = m_AttributeValue;
                        }
                        break;
                    }
                case "reflect physical":
                    {
                        m_AttributeValue = item.Attributes.ReflectPhysical;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.ReflectPhysical = m_AttributeValue;
                        }
                        break;
                    }
                case "health regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenHits = m_AttributeValue;
                        }
                        break;
                    }
                case "mana regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenStam = m_AttributeValue;
                        }
                        break;
                    }
                case "spell damage":
                    {
                        m_AttributeValue = item.Attributes.SpellDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellDamage = m_AttributeValue;
                        }
                        break;
                    }
                case "swing speed increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "weapon damage increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponDamage = m_AttributeValue;
                        }
                        break;
                    }
                default:
                    {
                        m_From.SendMessage("You cannot apply {0} to that.", m_AttributeName);
                        break;
                    }
            }
        }
        private void Modify(BaseDragonkinOuterTorso item)
        {
            switch (m_AttributeName)
            {
                case "attack chance":
                    {
                        m_AttributeValue = item.Attributes.AttackChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.AttackChance = m_AttributeValue;
                        }
                        break;
                    }
                case "bless":
                    {
                        if (item.LootType == LootType.Blessed || item.BlessedFor == m_From || (Mobile.InsuranceEnabled && item.Insured))
                        {
                            m_From.SendMessage("Your item is already blessed");
                        }
                        else if (item.RootParent != m_From)
                        {
                            m_From.SendMessage("You cannot bless that object");
                        }
                        else
                        {
                            item.LootType = LootType.Blessed;
                            m_From.SendMessage("Your item has been blessed");
                        }
                        break;
                    }
                case "dexterity bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusDex;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusDex = m_AttributeValue;
                        }
                        break;
                    }
                case "health bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusHits = m_AttributeValue;
                        }
                        break;
                    }
                case "intelligence bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusInt;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusInt = m_AttributeValue;
                        }
                        break;
                    }
                case "mana bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStam = m_AttributeValue;
                        }
                        break;
                    }
                case "strength bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStr;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStr = m_AttributeValue;
                        }
                        break;
                    }
                case "defense chance increase":
                    {
                        m_AttributeValue = item.Attributes.DefendChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.DefendChance = m_AttributeValue;
                        }
                        break;
                    }
                case "enhance potions":
                    {
                        m_AttributeValue = item.Attributes.EnhancePotions;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.EnhancePotions = m_AttributeValue;
                        }
                        break;
                    }
                case "faster casting speed":
                    {
                        m_AttributeValue = item.Attributes.CastSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "faster cast recovery":
                    {
                        m_AttributeValue = item.Attributes.CastRecovery;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastRecovery = m_AttributeValue;
                        }
                        break;
                    }
                case "lower mana cost":
                    {
                        m_AttributeValue = item.Attributes.LowerManaCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerManaCost = m_AttributeValue;
                        }
                        break;
                    }
                case "lower reagent cost":
                    {
                        m_AttributeValue = item.Attributes.LowerRegCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerRegCost = m_AttributeValue;
                        }
                        break;
                    }
                case "luck":
                    {
                        m_AttributeValue = item.Attributes.Luck;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.Luck = m_AttributeValue;
                        }
                        break;
                    }
                case "night sight":
                    {
                        m_AttributeValue = item.Attributes.NightSight;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.NightSight = m_AttributeValue;
                        }
                        break;
                    }
                case "reflect physical":
                    {
                        m_AttributeValue = item.Attributes.ReflectPhysical;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.ReflectPhysical = m_AttributeValue;
                        }
                        break;
                    }
                case "health regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenHits = m_AttributeValue;
                        }
                        break;
                    }
                case "mana regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenStam = m_AttributeValue;
                        }
                        break;
                    }
                case "spell damage":
                    {
                        m_AttributeValue = item.Attributes.SpellDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellDamage = m_AttributeValue;
                        }
                        break;
                    }
                case "swing speed increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "weapon damage increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponDamage = m_AttributeValue;
                        }
                        break;
                    }
                default:
                    {
                        m_From.SendMessage("You cannot apply {0} to that.", m_AttributeName);
                        break;
                    }
            }
        }
        private void Modify(BaseDragonkinRing item)
        {
            switch (m_AttributeName)
            {
                case "attack chance":
                    {
                        m_AttributeValue = item.Attributes.AttackChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.AttackChance = m_AttributeValue;
                        }
                        break;
                    }
                case "bless":
                    {
                        if (item.LootType == LootType.Blessed || item.BlessedFor == m_From || (Mobile.InsuranceEnabled && item.Insured))
                        {
                            m_From.SendMessage("Your item is already blessed");
                        }
                        else if (item.RootParent != m_From)
                        {
                            m_From.SendMessage("You cannot bless that object");
                        }
                        else
                        {
                            item.LootType = LootType.Blessed;
                            m_From.SendMessage("Your item has been blessed");
                        }
                        break;
                    }
                case "dexterity bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusDex;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusDex = m_AttributeValue;
                        }
                        break;
                    }
                case "health bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusHits = m_AttributeValue;
                        }
                        break;
                    }
                case "intelligence bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusInt;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusInt = m_AttributeValue;
                        }
                        break;
                    }
                case "mana bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStam = m_AttributeValue;
                        }
                        break;
                    }
                case "strength bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStr;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStr = m_AttributeValue;
                        }
                        break;
                    }
                case "defense chance increase":
                    {
                        m_AttributeValue = item.Attributes.DefendChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.DefendChance = m_AttributeValue;
                        }
                        break;
                    }
                case "enhance potions":
                    {
                        m_AttributeValue = item.Attributes.EnhancePotions;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.EnhancePotions = m_AttributeValue;
                        }
                        break;
                    }
                case "faster casting speed":
                    {
                        m_AttributeValue = item.Attributes.CastSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "faster cast recovery":
                    {
                        m_AttributeValue = item.Attributes.CastRecovery;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastRecovery = m_AttributeValue;
                        }
                        break;
                    }
                case "lower mana cost":
                    {
                        m_AttributeValue = item.Attributes.LowerManaCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerManaCost = m_AttributeValue;
                        }
                        break;
                    }
                case "lower reagent cost":
                    {
                        m_AttributeValue = item.Attributes.LowerRegCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerRegCost = m_AttributeValue;
                        }
                        break;
                    }
                case "luck":
                    {
                        m_AttributeValue = item.Attributes.Luck;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.Luck = m_AttributeValue;
                        }
                        break;
                    }
                case "night sight":
                    {
                        m_AttributeValue = item.Attributes.NightSight;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.NightSight = m_AttributeValue;
                        }
                        break;
                    }
                case "reflect physical":
                    {
                        m_AttributeValue = item.Attributes.ReflectPhysical;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.ReflectPhysical = m_AttributeValue;
                        }
                        break;
                    }
                case "health regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenHits = m_AttributeValue;
                        }
                        break;
                    }
                case "mana regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenStam = m_AttributeValue;
                        }
                        break;
                    }
                case "spell damage":
                    {
                        m_AttributeValue = item.Attributes.SpellDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellDamage = m_AttributeValue;
                        }
                        break;
                    }
                case "swing speed increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "weapon damage increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponDamage = m_AttributeValue;
                        }
                        break;
                    }
                default:
                    {
                        m_From.SendMessage("You cannot apply {0} to that.", m_AttributeName);
                        break;
                    }
            }
        }
        private void Modify(BaseDragonkinShield item)
        {
            switch (m_AttributeName)
            {
                case "attack chance":
                    {
                        m_AttributeValue = item.Attributes.AttackChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.AttackChance = m_AttributeValue;
                        }
                        break;
                    }
                case "bless":
                    {
                        if (item.LootType == LootType.Blessed || item.BlessedFor == m_From || (Mobile.InsuranceEnabled && item.Insured))
                        {
                            m_From.SendMessage("Your item is already blessed");
                        }
                        else if (item.RootParent != m_From)
                        {
                            m_From.SendMessage("You cannot bless that object");
                        }
                        else
                        {
                            item.LootType = LootType.Blessed;
                            m_From.SendMessage("Your item has been blessed");
                        }
                        break;
                    }
                case "dexterity bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusDex;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusDex = m_AttributeValue;
                        }
                        break;
                    }
                case "health bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusHits = m_AttributeValue;
                        }
                        break;
                    }
                case "intelligence bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusInt;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusInt = m_AttributeValue;
                        }
                        break;
                    }
                case "mana bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStam = m_AttributeValue;
                        }
                        break;
                    }
                case "strength bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStr;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStr = m_AttributeValue;
                        }
                        break;
                    }
                case "defense chance increase":
                    {
                        m_AttributeValue = item.Attributes.DefendChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.DefendChance = m_AttributeValue;
                        }
                        break;
                    }
                case "durability bonus":
                    {
                        m_AttributeValue = item.ArmorAttributes.DurabilityBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.ArmorAttributes.DurabilityBonus = m_AttributeValue;
                        }
                        break;
                    }
                case "enhance potions":
                    {
                        m_AttributeValue = item.Attributes.EnhancePotions;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.EnhancePotions = m_AttributeValue;
                        }
                        break;
                    }
                case "faster casting speed":
                    {
                        m_AttributeValue = item.Attributes.CastSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "faster cast recovery":
                    {
                        m_AttributeValue = item.Attributes.CastRecovery;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastRecovery = m_AttributeValue;
                        }
                        break;
                    }
                case "lower mana cost":
                    {
                        m_AttributeValue = item.Attributes.LowerManaCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerManaCost = m_AttributeValue;
                        }
                        break;
                    }
                case "lower reagent cost":
                    {
                        m_AttributeValue = item.Attributes.LowerRegCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerRegCost = m_AttributeValue;
                        }
                        break;
                    }
                case "luck":
                    {
                        m_AttributeValue = item.Attributes.Luck;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.Luck = m_AttributeValue;
                        }
                        break;
                    }
                case "night sight":
                    {
                        m_AttributeValue = item.Attributes.NightSight;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.NightSight = m_AttributeValue;
                        }
                        break;
                    }
                case "reflect physical":
                    {
                        m_AttributeValue = item.Attributes.ReflectPhysical;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.ReflectPhysical = m_AttributeValue;
                        }
                        break;
                    }
                case "health regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenHits = m_AttributeValue;
                        }
                        break;
                    }
                case "mana regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenStam = m_AttributeValue;
                        }
                        break;
                    }
                case "self repair":
                    {
                        m_AttributeValue = item.ArmorAttributes.SelfRepair;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.ArmorAttributes.SelfRepair = m_AttributeValue;
                        }
                        break;
                    }
                case "spell channeling":
                    {
                        m_AttributeValue = item.Attributes.SpellChanneling;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellChanneling = m_AttributeValue;
                        }
                        break;
                    }
                case "spell damage":
                    {
                        m_AttributeValue = item.Attributes.SpellDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellDamage = m_AttributeValue;
                        }
                        break;
                    }
                case "swing speed increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "weapon damage increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponDamage = m_AttributeValue;
                        }
                        break;
                    }
                default:
                    {
                        m_From.SendMessage("You cannot apply {0} to that.", m_AttributeName);
                        break;
                    }
            }
        }
        private void Modify(BaseDragonkinShoes item)
        {
            switch (m_AttributeName)
            {
                case "attack chance":
                    {
                        m_AttributeValue = item.Attributes.AttackChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.AttackChance = m_AttributeValue;
                        }
                        break;
                    }
                case "bless":
                    {
                        if (item.LootType == LootType.Blessed || item.BlessedFor == m_From || (Mobile.InsuranceEnabled && item.Insured))
                        {
                            m_From.SendMessage("Your item is already blessed");
                        }
                        else if (item.RootParent != m_From)
                        {
                            m_From.SendMessage("You cannot bless that object");
                        }
                        else
                        {
                            item.LootType = LootType.Blessed;
                            m_From.SendMessage("Your item has been blessed");
                        }
                        break;
                    }
                case "dexterity bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusDex;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusDex = m_AttributeValue;
                        }
                        break;
                    }
                case "health bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusHits = m_AttributeValue;
                        }
                        break;
                    }
                case "intelligence bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusInt;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusInt = m_AttributeValue;
                        }
                        break;
                    }
                case "mana bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStam = m_AttributeValue;
                        }
                        break;
                    }
                case "strength bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStr;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStr = m_AttributeValue;
                        }
                        break;
                    }
                case "defense chance increase":
                    {
                        m_AttributeValue = item.Attributes.DefendChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.DefendChance = m_AttributeValue;
                        }
                        break;
                    }
                case "enhance potions":
                    {
                        m_AttributeValue = item.Attributes.EnhancePotions;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.EnhancePotions = m_AttributeValue;
                        }
                        break;
                    }
                case "faster casting speed":
                    {
                        m_AttributeValue = item.Attributes.CastSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "faster cast recovery":
                    {
                        m_AttributeValue = item.Attributes.CastRecovery;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastRecovery = m_AttributeValue;
                        }
                        break;
                    }
                case "lower mana cost":
                    {
                        m_AttributeValue = item.Attributes.LowerManaCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerManaCost = m_AttributeValue;
                        }
                        break;
                    }
                case "lower reagent cost":
                    {
                        m_AttributeValue = item.Attributes.LowerRegCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerRegCost = m_AttributeValue;
                        }
                        break;
                    }
                case "luck":
                    {
                        m_AttributeValue = item.Attributes.Luck;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.Luck = m_AttributeValue;
                        }
                        break;
                    }
                case "night sight":
                    {
                        m_AttributeValue = item.Attributes.NightSight;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.NightSight = m_AttributeValue;
                        }
                        break;
                    }
                case "reflect physical":
                    {
                        m_AttributeValue = item.Attributes.ReflectPhysical;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.ReflectPhysical = m_AttributeValue;
                        }
                        break;
                    }
                case "health regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenHits = m_AttributeValue;
                        }
                        break;
                    }
                case "mana regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenStam = m_AttributeValue;
                        }
                        break;
                    }
                case "spell damage":
                    {
                        m_AttributeValue = item.Attributes.SpellDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellDamage = m_AttributeValue;
                        }
                        break;
                    }
                case "swing speed increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "weapon damage increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponDamage = m_AttributeValue;
                        }
                        break;
                    }
                default:
                    {
                        m_From.SendMessage("You cannot apply {0} to that.", m_AttributeName);
                        break;
                    }
            }
        }
        private void Modify(BaseDragonkinWeapon item)
        {
            switch (m_AttributeName)
            {
                case "attack chance":
                    {
                        m_AttributeValue = item.Attributes.AttackChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.AttackChance = m_AttributeValue;
                        }
                        break;
                    }
                case "bless":
                    {
                        if (item.LootType == LootType.Blessed || item.BlessedFor == m_From || (Mobile.InsuranceEnabled && item.Insured))
                        {
                            m_From.SendMessage("Your item is already blessed");
                        }
                        else if (item.RootParent != m_From)
                        {
                            m_From.SendMessage("You cannot bless that object");
                        }
                        else
                        {
                            item.LootType = LootType.Blessed;
                            m_From.SendMessage("Your item has been blessed");
                        }
                        break;
                    }
                case "dexterity bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusDex;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusDex = m_AttributeValue;
                        }
                        break;
                    }
                case "health bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusHits = m_AttributeValue;
                        }
                        break;
                    }
                case "intelligence bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusInt;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusInt = m_AttributeValue;
                        }
                        break;
                    }
                case "mana bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStam = m_AttributeValue;
                        }
                        break;
                    }
                case "strength bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStr;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStr = m_AttributeValue;
                        }
                        break;
                    }
                case "defense chance increase":
                    {
                        m_AttributeValue = item.Attributes.DefendChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.DefendChance = m_AttributeValue;
                        }
                        break;
                    }
                case "durability bonus":
                    {
                        m_AttributeValue = item.WeaponAttributes.DurabilityBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.DurabilityBonus = m_AttributeValue;
                        }
                        break;
                    }
                case "enhance potions":
                    {
                        m_AttributeValue = item.Attributes.EnhancePotions;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.EnhancePotions = m_AttributeValue;
                        }
                        break;
                    }
                case "faster casting speed":
                    {
                        m_AttributeValue = item.Attributes.CastSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "faster cast recovery":
                    {
                        m_AttributeValue = item.Attributes.CastRecovery;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastRecovery = m_AttributeValue;
                        }
                        break;
                    }
                case "hit cold area":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitColdArea;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitColdArea = m_AttributeValue;
                        }
                        break;
                    }
                case "hit dispel":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitDispel;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitDispel = m_AttributeValue;
                        }
                        break;
                    }
                case "hit energy area":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitEnergyArea;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitEnergyArea = m_AttributeValue;
                        }
                        break;
                    }
                case "hit fire area":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitFireArea;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitFireArea = m_AttributeValue;
                        }
                        break;
                    }
                case "hit fireball":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitFireball;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitFireball = m_AttributeValue;
                        }
                        break;
                    }
                case "hit harm":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitHarm;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitHarm = m_AttributeValue;
                        }
                        break;
                    }
                case "hit life leech":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitLeechHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitLeechHits = m_AttributeValue;
                        }
                        break;
                    }
                case "hit lightning":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitLightning;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitLightning = m_AttributeValue;
                        }
                        break;
                    }
                case "hit lower attack":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitLowerAttack;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitLowerAttack = m_AttributeValue;
                        }
                        break;
                    }
                case "hit lower defense":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitLowerDefend;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitLowerDefend = m_AttributeValue;
                        }
                        break;
                    }
                case "hit magic arrow":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitMagicArrow;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitMagicArrow = m_AttributeValue;
                        }
                        break;
                    }
                case "hit mana leech":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitLeechMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitLeechMana = m_AttributeValue;
                        }
                        break;
                    }
                case "hit physical area":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitPhysicalArea;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitPhysicalArea = m_AttributeValue;
                        }
                        break;
                    }
                case "hit poison area":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitPoisonArea;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitPoisonArea = m_AttributeValue;
                        }
                        break;
                    }
                case "hit stamina leech":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitLeechStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitColdArea = m_AttributeValue;
                        }
                        break;
                    }
                case "lower mana cost":
                    {
                        m_AttributeValue = item.Attributes.LowerManaCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerManaCost = m_AttributeValue;
                        }
                        break;
                    }
                case "lower reagent cost":
                    {
                        m_AttributeValue = item.Attributes.LowerRegCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerRegCost = m_AttributeValue;
                        }
                        break;
                    }
                case "luck":
                    {
                        m_AttributeValue = item.Attributes.Luck;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.Luck = m_AttributeValue;
                        }
                        break;
                    }
                case "night sight":
                    {
                        m_AttributeValue = item.Attributes.NightSight;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.NightSight = m_AttributeValue;
                        }
                        break;
                    }
                case "reflect physical":
                    {
                        m_AttributeValue = item.Attributes.ReflectPhysical;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.ReflectPhysical = m_AttributeValue;
                        }
                        break;
                    }
                case "health regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenHits = m_AttributeValue;
                        }
                        break;
                    }
                case "mana regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenMana = m_AttributeValue;
                        }
                        break;
                    }
                case "stamina regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenStam = m_AttributeValue;
                        }
                        break;
                    }
                case "resist cold bonus":
                    {
                        m_AttributeValue = item.WeaponAttributes.ResistColdBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.ResistColdBonus = m_AttributeValue;
                        }
                        break;
                    }
                case "resist energy bonus":
                    {
                        m_AttributeValue = item.WeaponAttributes.ResistEnergyBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.ResistEnergyBonus = m_AttributeValue;
                        }
                        break;
                    }
                case "resist fire bonus":
                    {
                        m_AttributeValue = item.WeaponAttributes.ResistFireBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.ResistFireBonus = m_AttributeValue;
                        }
                        break;
                    }
                case "resist physical bonus":
                    {
                        m_AttributeValue = item.WeaponAttributes.ResistPhysicalBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.ResistColdBonus = m_AttributeValue;
                        }
                        break;
                    }
                case "resist poison bonus":
                    {
                        m_AttributeValue = item.WeaponAttributes.ResistPoisonBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.ResistPoisonBonus = m_AttributeValue;
                        }
                        break;
                    }
                case "self repair":
                    {
                        m_AttributeValue = item.WeaponAttributes.SelfRepair;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.SelfRepair = m_AttributeValue;
                        }
                        break;
                    }
                case "spell channeling":
                    {
                        m_AttributeValue = item.Attributes.SpellChanneling;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellChanneling = m_AttributeValue;
                        }
                        break;
                    }
                case "spell damage":
                    {
                        m_AttributeValue = item.Attributes.SpellDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellDamage = m_AttributeValue;
                        }
                        break;
                    }
                case "swing speed increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponSpeed = m_AttributeValue;
                        }
                        break;
                    }
                case "use best skill":
                    {
                        m_AttributeValue = item.WeaponAttributes.UseBestSkill;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.UseBestSkill = m_AttributeValue;
                        }
                        break;
                    }
                case "weapon damage increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponDamage = m_AttributeValue;
                        }
                        break;
                    }
                default:
                    {
                        m_From.SendMessage("You cannot apply {0} to that.", m_AttributeName);
                        break;
                    }
            }
        }

        /*private void Modify(BaseDragonkinWeapon item)
        {
            switch (m_AttributeName)
            {
                case "attack chance":
                    {
                        m_AttributeValue = item.Attributes.AttackChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.AttackChance = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "bless":
                    {
                        if (item.LootType == LootType.Blessed || item.BlessedFor == m_From || (Mobile.InsuranceEnabled && item.Insured))
                        {
                            m_From.SendMessage("Your item is already blessed");
                        }
                        else if (item.RootParent != m_From)
                        {
                            m_From.SendMessage("You cannot bless that object");
                        }
                        else
                        {
                            item.LootType = LootType.Blessed;
                            m_From.SendMessage("Your item has been blessed");
                        }
                        break;
                    }
                case "dexterity bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusDex;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusDex = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "health bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusHits = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "intelligence bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusInt;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusInt = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "mana bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusMana = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "stamina bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStam = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "strength bonus":
                    {
                        m_AttributeValue = item.Attributes.BonusStr;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.BonusStr = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "defense chance increase":
                    {
                        m_AttributeValue = item.Attributes.DefendChance;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.DefendChance = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "durability bonus":
                    {
                        m_AttributeValue = item.WeaponAttributes.DurabilityBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.DurabilityBonus = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "enhance potions":
                    {
                        m_AttributeValue = item.Attributes.EnhancePotions;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.EnhancePotions = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "faster casting speed":
                    {
                        m_AttributeValue = item.Attributes.CastSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastSpeed = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "faster cast recovery":
                    {
                        m_AttributeValue = item.Attributes.CastRecovery;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.CastRecovery = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit cold area":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitColdArea;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitColdArea = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit dispel":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitDispel;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitDispel = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit energy area":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitEnergyArea;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitEnergyArea = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit fire area":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitFireArea;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitFireArea = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit fireball":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitFireball;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitFireball = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit harm":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitHarm;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitHarm = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit life leech":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitLeechHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitLeechHits = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit lightning":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitLightning;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitLightning = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit lower attack":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitLowerAttack;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitLowerAttack= m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit lower defense":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitLowerDefend;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitLowerDefend = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit magic arrow":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitMagicArrow;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitMagicArrow = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit mana leech":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitLeechMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitLeechMana = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit physical area":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitPhysicalArea;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitPhysicalArea = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit poison area":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitPoisonArea;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitPoisonArea = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "hit stamina leech":
                    {
                        m_AttributeValue = item.WeaponAttributes.HitLeechStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.HitColdArea = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "lower mana cost":
                    {
                        m_AttributeValue = item.Attributes.LowerManaCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerManaCost = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "lower reagent cost":
                    {
                        m_AttributeValue = item.Attributes.LowerRegCost;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.LowerRegCost = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "luck":
                    {
                        m_AttributeValue = item.Attributes.Luck;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.Luck = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "night sight":
                    {
                        m_AttributeValue = item.Attributes.NightSight;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.NightSight = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "reflect physical":
                    {
                        m_AttributeValue = item.Attributes.ReflectPhysical;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.ReflectPhysical = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "health regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenHits;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenHits = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "mana regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenMana;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenMana = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "stamina regeneration":
                    {
                        m_AttributeValue = item.Attributes.RegenStam;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.RegenStam = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "resist cold bonus":
                    {
                        m_AttributeValue = item.WeaponAttributes.ResistColdBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.ResistColdBonus = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "resist energy bonus":
                    {
                        m_AttributeValue = item.WeaponAttributes.ResistEnergyBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.ResistEnergyBonus = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "resist fire bonus":
                    {
                        m_AttributeValue = item.WeaponAttributes.ResistFireBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.ResistFireBonus = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "resist physical bonus":
                    {
                        m_AttributeValue = item.WeaponAttributes.ResistPhysicalBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.ResistColdBonus = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "resist poison bonus":
                    {
                        m_AttributeValue = item.WeaponAttributes.ResistPoisonBonus;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.ResistPoisonBonus = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "self repair":
                    {
                        m_AttributeValue = item.WeaponAttributes.SelfRepair;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.SelfRepair = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "spell channeling":
                    {
                        m_AttributeValue = item.Attributes.SpellChanneling;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellChanneling = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "spell damage":
                    {
                        m_AttributeValue = item.Attributes.SpellDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.SpellDamage = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "swing speed increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponSpeed;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponSpeed = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "use best skill":
                    {
                        m_AttributeValue = item.WeaponAttributes.UseBestSkill;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.WeaponAttributes.UseBestSkill = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
                case "weapon damage increase":
                    {
                        m_AttributeValue = item.Attributes.WeaponDamage;
                        ModifyAlgorithm();
                        if (IsApplied)
                        {
                            item.Attributes.WeaponDamage = m_AttributeValue;
                            IsApplied = true;
                        }
                        break;
                    }
            }
        }*/

        #endregion

        private void ModifyAlgorithm()
        {
            if (m_AttributeValue >= m_Max)
            {
                m_From.SendMessage("That item has max {0} you cannot add anymore.", m_AttributeName);
            }
            else if (m_AttributeValue < m_Max)
            {
                m_AttributeValue += m_Modifier;
                m_From.SendMessage("You have applied +{0} {1} to that item.", m_Modifier, m_AttributeName);
                IsApplied = true;
            }
            else
            {
                m_From.SendMessage("You cannot apply {0} to that.", m_AttributeName);
            }
        }
    }
}



BaseDeed.cs

using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server;

namespace Server.Items
{
    public class BaseDeedTarget : Target
    {
        public Type m_ItemType;
        public int m_Max;
        public int m_Modifier;
        public string m_Name;

        public BaseDeedTarget() : base(1, false, TargetFlags.None)
        {
        }
    }

    /*public class BaseDeed : Item
    {
        [Constructable]
        public BaseDeed() : base(itemID)
        {
            Weight = 1.0;
        }

        public BaseDeed(Serial serial) : base(serial)
        {
        }
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write((int)0);
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
        }
    }*/
}



And an example deed:

AttackChanceDeed.cs

using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server;

namespace Server.Items
{
    public class AttackChanceTarget : BaseDeedTarget
    {
        private AttackChanceDeed m_Deed;

        public AttackChanceTarget(AttackChanceDeed deed)
        {
            m_Deed = deed;
            m_Name = "attack chance";
            m_Max = 100;
            m_Modifier = 5;
        }

        protected override void OnTarget(Mobile from, object target)
        {
            if (m_Deed.Deleted || m_Deed.RootParent != from)
            {
                from.SendMessage("You cannot apply {0} to that.", m_Name);
                return;
            }
            else
            {
                ModifyItem modify = new ModifyItem(from, target, m_Name, m_Max, m_Modifier);
                if (modify.IsApplied)
                {
                    m_Deed.Delete();
                }
            }
        }
    }

    public class AttackChanceDeed : Item
    {
        [Constructable]
        public AttackChanceDeed() : base(0x14F0)
        {
            Name = "an attack chance increase deed";
            Hue = 1150;
            Stackable = false;
            Weight = 1.0;
        }

        public AttackChanceDeed(Serial serial) : base(serial)
        {
        }
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write((int)0);
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
        }

        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("The item needs to be in your pack");
            }
            else
            {
                from.SendMessage("Which item would you like to add attack chance increase to?");
                from.Target = new AttackChanceTarget(this);
            }
        }
    }
}



It's not the most elegant code... but it works. If I could use the dynamic type it would be so much easier, but I can't seem to get it to work. Any suggestions on how to make it more efficient would be great... I would show the BaseArmor.cs file to give a more detailed example but then I would have to show the AOS.cs file along with all the parent classes it uses.
Was This Post Helpful? 0
  • +
  • -

#13 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3479
  • View blog
  • Posts: 10,725
  • Joined: 05-May 12

Re: Passing class type?

Posted 08 April 2013 - 06:12 PM

OMG! A 3000+ line class! I hoped that about 500 lines you figured that you are doing something wrong by having that much repetitive code. Please tell me that you used T4 to generate that code instead of typing or copying pasting all that.

May I suggest looking at polymorphism, interfaces, and the strategy pattern.
Was This Post Helpful? 1
  • +
  • -

#14 kiasta  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 257
  • Joined: 18-November 07

Re: Passing class type?

Posted 09 April 2013 - 10:29 AM

View PostSkydiver, on 08 April 2013 - 09:12 PM, said:

OMG! A 3000+ line class! I hoped that about 500 lines you figured that you are doing something wrong by having that much repetitive code. Please tell me that you used T4 to generate that code instead of typing or copying pasting all that.

May I suggest looking at polymorphism, interfaces, and the strategy pattern.


So I am a complete idiot sometimes... I was sitting here trying to explain how I couldn't make the code any shorter then something dawned on me... So here is the revised code, quite simple actually.

ModifyItem.cs

using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server;

namespace Server.Items
{
    class ModifyItem
    {
        private Mobile m_From;
        private int m_AttributeValue;
        private int m_Max;
        private int m_Modifier;
        private AosAttribute m_Attribute;
        private AosAttributes m_Attributes;
        private string m_AttributeName;
        private object o_Target;
        public bool IsApplied;
        public ModifyItem(Mobile from, object target, AosAttribute attribute, string attributeName, int max, int modifier)
        {
            m_From = from;
            o_Target = target;
            m_Attribute = attribute;
            m_AttributeName = attributeName;
            m_Max = max;
            m_Modifier = modifier;
            IsApplied = false;
            DoModify();
        }
        private void DoModify()
        {
            Item item = (Item)o_Target;
            if (item is BaseDragonkinArmor)
            {
                m_Attributes = ((BaseDragonkinArmor)item).Attributes;
                ModifyAlgorithm();
            }
            else if (item is BaseDragonkinBracelet)
            {
                m_Attributes = ((BaseDragonkinBracelet)item).Attributes;
                ModifyAlgorithm();
            }
            else if (item is BaseDragonkinCloak)
            {
                m_Attributes = ((BaseDragonkinCloak)item).Attributes;
                ModifyAlgorithm();
            }
            else if (item is BaseDragonkinEarrings)
            {
                m_Attributes = ((BaseDragonkinEarrings)item).Attributes;
                ModifyAlgorithm();
            }
            else if (item is BaseDragonkinNecklace)
            {
                m_Attributes = ((BaseDragonkinNecklace)item).Attributes;
                ModifyAlgorithm();
            }
            else if (item is BaseDragonkinOuterTorso)
            {
                m_Attributes = ((BaseDragonkinOuterTorso)item).Attributes;
                ModifyAlgorithm();
            }
            else if (item is BaseDragonkinRing)
            {
                m_Attributes = ((BaseDragonkinRing)item).Attributes;
                ModifyAlgorithm();
            }
            else if (item is BaseDragonkinShield)
            {
                m_Attributes = ((BaseDragonkinShield)item).Attributes;
                ModifyAlgorithm();
            }
            else if (item is BaseDragonkinShoes)
            {
                m_Attributes = ((BaseDragonkinShoes)item).Attributes;
                ModifyAlgorithm();
            }
            else if (item is BaseDragonkinWeapon)
            {
                m_Attributes = ((BaseDragonkinWeapon)item).Attributes;
                ModifyAlgorithm();
            }
            else
            {
                m_From.SendMessage("You cannot add {0} to that.", m_AttributeName);
            }
        }
        private void ModifyAlgorithm()
        {
            m_AttributeValue = m_Attributes[m_Attribute];
            if (m_AttributeValue >= m_Max)
            {
                m_From.SendMessage("That item has max {0} you cannot add anymore.", m_AttributeName);
            }
            else if (m_AttributeValue < m_Max)
            {
                m_Attributes[m_Attribute] += m_Modifier;
                m_From.SendMessage("You have applied +{0} {1} to that item.", m_Modifier, m_AttributeName);
                IsApplied = true;
            }
            else
            {
                m_From.SendMessage("You cannot apply {0} to that.", m_AttributeName);
            }
        }
    }
}



The implementation:

AttackChanceDeed.cs

using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server;

namespace Server.Items
{
    public class AttackChanceTarget : BaseDeedTarget
    {
        private AttackChanceDeed m_Deed;

        public AttackChanceTarget(AttackChanceDeed deed)
        {
            m_Deed = deed;
            m_Name = "attack chance";
            m_Max = 100;
            m_Modifier = 5;
        }

        protected override void OnTarget(Mobile from, object target)
        {
            if (m_Deed.Deleted || m_Deed.RootParent != from)
            {
                from.SendMessage("You cannot apply {0} to that.", m_Name);
                return;
            }
            else
            {
                ModifyItem modify = new ModifyItem(from,target,AosAttribute.AttackChance,m_Name,m_Max,m_Modifier);
                if (modify.IsApplied)
                {
                    m_Deed.Delete();
                }
            }
        }
    }

    public class AttackChanceDeed : Item
    {
        [Constructable]
        public AttackChanceDeed() : base(0x14F0)
        {
            Name = "an attack chance increase deed";
            Hue = 1150;
            Stackable = false;
            Weight = 1.0;
        }

        public AttackChanceDeed(Serial serial) : base(serial)
        {
        }
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write((int)0);
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
        }

        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("The item needs to be in your pack");
            }
            else
            {
                from.SendMessage("Which item would you like to add attack chance increase to?");
                from.Target = new AttackChanceTarget(this);
            }
        }
    }
}


Was This Post Helpful? 0
  • +
  • -

#15 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3479
  • View blog
  • Posts: 10,725
  • Joined: 05-May 12

Re: Passing class type?

Posted 09 April 2013 - 11:22 AM

But if all your items had a common base class, or they all exposed a common interface that exposed attributes, that you wouldn't even need all those if statements for 34-88.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2