Full Version : adding to script
xmlspawner >>XMLCustomAttack's Discussion >>adding to script


<< Prev | Next >>

Hanse of DL- 07-13-2006
if I am reading this correct:

switch(Utility.Random(3))
{
case 0:
// add a custom defense attachment with 3 random defenses
XmlAttach.AttachTo(this, new XmlCustomDefenses( "random", 3));
break;
case 1:
// add a named custom defense configuration
XmlAttach.AttachTo(this, new XmlCustomDefenses( "brogan"));
break;
case 2:
// add a specific list of custom defenses like this
XmlAttach.AttachTo(this,
new XmlCustomDefenses(
new XmlCustomDefenses.SpecialDefenses []
{
XmlCustomDefenses.SpecialDefenses.MindDrain,
XmlCustomDefenses.SpecialDefenses.SpikeShield
}
)
);
break;
}

}

would replace:

public override int BasePhysicalResistance{ get{ return 0; } }
public override int BaseFireResistance{ get{ return 0; } }
public override int BaseColdResistance{ get{ return 0; } }
public override int BasePoisonResistance{ get{ return 1; } }
public override int BaseEnergyResistance{ get{ return 0; } }

public override int InitMinHits{ get{ return 40; } }
public override int InitMaxHits{ get{ return 50; } }

public override int AosStrReq{ get{ return 20; } }

public override int ArmorBase{ get{ return 7; } }

IS this correct?

ArteGordon- 07-13-2006
no, you would just add this

CODE

switch(Utility.Random(3))
{
case 0:
// add a custom defense attachment with 3 random defenses
XmlAttach.AttachTo(this, new XmlCustomDefenses( "random", 3));
break;
case 1:
// add a named custom defense configuration
XmlAttach.AttachTo(this, new XmlCustomDefenses( "brogan"));
break;
case 2:
// add a specific list of custom defenses like this
XmlAttach.AttachTo(this,
new XmlCustomDefenses(
new XmlCustomDefenses.SpecialDefenses []
{
XmlCustomDefenses.SpecialDefenses.MindDrain,
XmlCustomDefenses.SpecialDefenses.SpikeShield
}
)
);
break;
}


to the constructor for your item and it will add one of those special attacks to the weapon.

You do not need to remove anything. You can leave those other properties as they are.