Full Version : Aos Attribute Attachments
xmlspawner >>XMLSpawner Mods and Tips >>Aos Attribute Attachments


<< Prev | Next >>

ArteGordon- 05-20-2007
The following four attachments included in XmlAosAttributes.zip will allow you to temporarily modify aos attribute values on items.

XmlAosAttributes
XmlAosWeaponAttributes
XmlAosArmorAttributes
XmlAosElementAttributes

The constructors for each of the four attachments will accept an expiration value in minutes which is how long the attachment and its modified attribute values will last.

The attribute values on the attachment will be added to any existing attribute values the item might have.
These attachments do not make any actual changes to attribute properties on items themselves. If you remove the attachment, the item will be exactly the way it was originally, so all effects of the attachments are completely reversible.

Thanks to LordHogFred for the idea.

For example, spawning an item like this

longsword/ATTACH/<xmlaosattributes,20/luck/100/attackchance/80>

would create a longsword that had a 100 luck and 80% HCI. The attribute enhancements would expire after 20 minutes.

To temporarily enhance the attributes on an existing item, you could do something like

SETONCARRIED,,longsword,true/ATTACH/<xmlaosattributes,20/luck/100/attackchance/80>

which would temporarily enhance a standard longsword that the player had equipped.

You can also directly edit the [props on the attachment using [getatt and the modified values will be reflected on the item it is attached to.

For these attachments to work, you must make the following four mods to Misc/Aos.cs

around line 260
QUOTE

public int this[AosAttribute attribute]
{
//ARTEGORDONMOD
// add support for XmlAosAttributes attachment
get { return ExtendedGetValue((int)attribute); }
set { SetValue((int)attribute, value); }
}

//ARTEGORDONMOD
// add support for XmlAosAttributes attachment
public int ExtendedGetValue(int bitmask)
{
int value = GetValue(bitmask);

XmlAosAttributes xaos = (XmlAosAttributes)XmlAttach.FindAttachment(Owner, typeof(XmlAosAttributes));
if (xaos != null)
{
value += xaos.GetValue(bitmask);
}

return (value);
}


around line 425

QUOTE

public int this[AosWeaponAttribute attribute]
{
//ARTEGORDONMOD
// add support for XmlAosWeaponAttributes attachment
get { return ExtendedGetValue((int)attribute); }
set { SetValue((int)attribute, value); }
}

//ARTEGORDONMOD
// add support for XmlAosWeaponAttributes attachment
public int ExtendedGetValue(int bitmask)
{
int value = GetValue(bitmask);

XmlAosWeaponAttributes xaos = (XmlAosWeaponAttributes)XmlAttach.FindAttachment(Owner, typeof(XmlAosWeaponAttributes));
if (xaos != null)
{
value += xaos.GetValue(bitmask);
}

return (value);
}


around line 580

QUOTE

public int this[AosArmorAttribute attribute]
{
//ARTEGORDONMOD
// add support for XmlAosArmorAttributes attachment
get { return ExtendedGetValue((int)attribute); }
set { SetValue((int)attribute, value); }
}

//ARTEGORDONMOD
// add support for XmlAosArmorAttributes attachment
public int ExtendedGetValue(int bitmask)
{
int value = GetValue(bitmask);

XmlAosArmorAttributes xaos = (XmlAosArmorAttributes)XmlAttach.FindAttachment(Owner, typeof(XmlAosArmorAttributes));
if (xaos != null)
{
value += xaos.GetValue(bitmask);
}

return (value);
}


and around line 820

QUOTE

public int this[AosElementAttribute attribute]
{
//ARTEGORDONMOD
// add support for XmlAosElementAttributes attachment
get { return ExtendedGetValue((int)attribute); }
set { SetValue((int)attribute, value); }
}

//ARTEGORDONMOD
// add support for XmlAosElementAttributes attachment
public int ExtendedGetValue(int bitmask)
{
int value = GetValue(bitmask);

XmlAosElementAttributes xaos = (XmlAosElementAttributes)XmlAttach.FindAttachment(Owner, typeof(XmlAosElementAttributes));
if (xaos != null)
{
value += xaos.GetValue(bitmask);
}

return (value);
}


Greystar- 02-23-2008
Can we someday get the stuff from the Forum put into an Install.txt for this?


Thanks,
Greystar