I am writing a custom treasure chest system for my shard but the one thing i can not seem to figure out is how to add random socketable items to the chests as part of the loot. I have tried everything i can think of and can not get it to work. Im not asking that someone write the code for me i was just wondering if someone could stear me in the right direction?
I was trying this line but I cant get it to work
switch ( Utility.Random( 3 ))
{
case 0: DropItem( new (Katana/ATTACH/XmlSocketable,4) ); break;
.to add attachments via a script, you would use the XmlAttach.AttachTo method, like
CODE |
switch ( Utility.Random( 3 )) { case 0: Item item = new Katana(); XmlAttach.AttachTo(item, new XmlSocketable(4)) DropItem( item ); break;
|
which is the equivalent of the spawn entry
Katana/ATTACH/XmlSocketable,4
there are also other XmlSocketable constructors that you can call to specify custom socketing requirements.
CODE |
public XmlSocketable(int maxsockets)
public XmlSocketable(int maxsockets, SkillName skillname, double minskilllevel, Type resource, int quantity)
public XmlSocketable(int maxsockets, SkillName skillname, double minskilllevel, SkillName skillname2, double minskilllevel2, Type resource, int quantity)
|
Awesome thanx Arti i spent hours trying to figure this out. This is a great site by the way thanx for setting it up