- 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.
And below that snippet Add this
Save it...
2) Open stealing.cs
Locate this snippet of code
Just below stolen.Movable = true; add XmlAttach.AttachTo(stolen, new StolenAtt());
So that it looks like this
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.
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:
foreach (Item item in items)
{
if (item is Container && (item).Items.Count != 0)
{
continue;
}
Code:
//advanced stealing
StolenAtt stolen = (StolenAtt)XmlAttach.FindAttachment(item, typeof(StolenAtt));
if (stolen != null)
{
continue;
}
2) Open stealing.cs
Locate this snippet of code
Code:
if (stolen != null)
{
m_Thief.SendLocalizedMessage(502724); // You succesfully steal the item.
ItemFlags.SetTaken(stolen, true);
ItemFlags.SetStealable(stolen, false);
stolen.Movable = true;
So that it looks like this
Code:
if (stolen != null)
{
m_Thief.SendLocalizedMessage(502724); // You succesfully steal the item.
ItemFlags.SetTaken(stolen, true);
ItemFlags.SetStealable(stolen, false);
stolen.Movable = true;
XmlAttach.AttachTo(stolen, new StolenAtt());
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.