1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Ehanced Stealing Mod 1.0

Stealing XML Mod

Tags:
  1. Joshua
    Requirements:
    XMLSpawner2
    Description:
    This is a system that evolved from the idea's of 'Frosttiger' as he developed the core modded version of this system. This is the XML Attachment version, no core mods required and is easily expanded. I will be adding expansions as time goes on to see what else I can do with this.

    So what this does as of right now.. This attaches an XML Att to any item *any* that is stolen, then when *any* vendor that is setup using BaseVendor.cs tries to buy from you, they will ignore any item that has that attachment, bringing upon the idea you cannot sell stolen loot (using the steal command) to a vendor.

    Plans for Change:
    I will be adding a special vendor to 'fence' items at that have this attachment, and they will only buy items with this attachment. They will pay good money for this. These vendors are probably best put in hard to reach places to give value to stealing and selling on the 'black market'. (sounds a little RPISH =p)

    Also to note, of course any stolen items can still be sold on player vendors like normal, a system to add penalties to those items or bonuses depending on the item might be put into place.

    Current Known Issues:

    1) If you add an item to a stack that has the attachment, the full stack will have the attachment so nothing of that stack can be sold. So issue only exist with stacked items, I'm working on a way to separate this properly, maybe make the stolen item not stackable. If you take apart the stack, the item with the attachment also gets separated, thus the stack can be sold again.

    Instructions.
    1) Open BaseVendor.CS
    Locate This Line: public virtual void VendorSell(Mobile from)
    Scroll down and locate the code snippet that looks like this.
    Code (C#):
    1.                     foreach (Item item in items)
    2.                     {
    3.                         if (item is Container && (item).Items.Count != 0)
    4.                         {
    5.                             continue;
    6.                         }
    And below that snippet Add this
    Code (C#):
    1.                         //advanced stealing
    2.                         StolenAtt stolen = (StolenAtt)XmlAttach.FindAttachment(item, typeof(StolenAtt));
    3.                         if (stolen != null)
    4.                         {
    5.                             continue;
    6.                         }
    Save it...
    2) Open stealing.cs
    Locate this snippet of code
    Code (C#):
    1.                         if (stolen != null)
    2.                         {
    3.                             m_Thief.SendLocalizedMessage(502724); // You succesfully steal the item.
    4.  
    5.                             ItemFlags.SetTaken(stolen, true);
    6.                             ItemFlags.SetStealable(stolen, false);
    7.                             stolen.Movable = true;
    Just below stolen.Movable = true; add XmlAttach.AttachTo(stolen, new StolenAtt());
    So that it looks like this
    Code (C#):
    1.                         if (stolen != null)
    2.                         {
    3.                             m_Thief.SendLocalizedMessage(502724); // You succesfully steal the item.
    4.  
    5.                             ItemFlags.SetTaken(stolen, true);
    6.                             ItemFlags.SetStealable(stolen, false);
    7.                             stolen.Movable = true;
    8.                             XmlAttach.AttachTo(stolen, new StolenAtt());
    save it...
    Then you will want to download StolenAtt.cs to your customs folder.

    Restart the server and go steal something. Can check the attachment on the stolen item with [getatt command.