Full Version : Help: Sockets only for Craft Custom.
xmlspawner >>XMLSockets Discussion >>Help: Sockets only for Craft Custom.
<< Prev | Next >>
jingz2k2- 10-18-2007
Hello,
I would like to ask for help.
I would like to make it so that with these kind of difficulty settings:

CODE
// mod to randomly add sockets and socketability features to armor. These settings will yield // 2% drop rate of socketed/socketable items // 0.5% chance of 5 sockets // 1.5% of 4 sockets // 3% chance of 3 sockets
// 15% chance of 2 sockets
// 50% chance of 1 socket
// the remainder will be 0 socket (31.4% in this case)
// uncomment the next line to prevent artifacts from being socketed
if(ArtifactRarity == 0)
XmlSockets.ConfigureRandom(this, 20.0, 0.5, 1.5, 3.0, 15.0, 50.0);

To make it so that single weapons can have max sockets of 7 upon crafting only and craftable artifacts can't be socketed.
And that two handed weapons can have a max sockets of 9 upon crafting only and craftable artifacts can't be socketed.
How can I do this? Is it a must to modify individual weapon types or can we do this in BaseWeapon.cs?
Many thanks in advanced.
Kind regards
Jingz
ArteGordon- 10-18-2007
if you wanted to limit socketed items to craftables then you would not put that into the baseweapon constructor.
Do it like this
http://xmlspawner.15.forumer.com/index.php?showtopic=316
jingz2k2- 10-18-2007
Hi ArteGordon,
Thank you for your response.
My problem is I want to have different socketable limits for different types of weapons.
Like Axe can have a maximum of 7 but the TwoHandedAxe can have a maximum of 9.
I do not know how to add that in the craftitem.cs:(
if ( item is Axe)
{
// mod to randomly add sockets and socketability features to armor. These settings will yield
// 2% drop rate of socketed/socketable items
// 0.1% chance of 5 sockets
// 0.5% of 4 sockets
// 3% chance of 3 sockets
// 15% chance of 2 sockets
// 50% chance of 1 socket
// the remainder will be 0 socket (31.4% in this case)
// uncomment the next line to prevent artifacts from being socketed
// if(ArtifactRarity == 0)
XmlSockets.ConfigureRandom(item, 2.0, 0.1, 0.5, 3.0, 15.0, 50.0);
}
The settings is up to 5 socketable maximum.
Do I have to make a long list like the axe one above ?
ArteGordon- 10-18-2007
the ConfigureRandom method is just a handy way of quickly setting up sockets on an item. You dont have to use it if you dont like.
You can always just manually put the sockets or socketability onto an item like this
XmlAttach.AttachTo(item, new XmlSockets(5));
which would add 5 sockets to the item
or
XmlAttach.AttachTo(item, new XmlSocketable(5));
which would make it socketable with a max of 5 sockets.
Note that there are also other constructors available that you can use that allow you to specify more than just the max number of sockets, like these

CODE
public XmlSocketable(int maxsockets, SkillName skillname, double minskilllevel, Type resource, int quantity) { MaxSockets = maxsockets; RequiredResource = resource; ResourceQuantity = quantity;
RequiredSkill = skillname;
MinSkillLevel = minskilllevel;
InvalidateParentProperties();
}
public XmlSocketable(int maxsockets, SkillName skillname, double minskilllevel, SkillName skillname2, double minskilllevel2, Type resource, int quantity)
{
MaxSockets = maxsockets;
RequiredResource = resource;
ResourceQuantity = quantity;
RequiredSkill = skillname;
MinSkillLevel = minskilllevel;
RequiredSkill2 = skillname2;
MinSkillLevel2 = minskilllevel2;
InvalidateParentProperties();
}

jingz2k2- 10-18-2007
ArteGordon,
Thank you for telling me the other constructors. I'm going to put them to good use.
I'm trying another method Utility.RandomDouble for the % on the 1 handed and 2 handed weapons now.
Thank you for always being patient with me. I'm really grateful for all this:D
Jingz