Full Version : XmlReleasePet Attachment
xmlspawner >>XMLSpawner Attachments >>XmlReleasePet Attachment
<< Prev | Next >>
ArteGordon- 07-25-2006
XmlReleasePet is an attachment that you can add to creatures, weapons, or non-movable items in the world that will add some chance of releasing a players pet.
If you add it to a mobile or weapon, then every time that mobile or weapon hits a target, there is a chance that the target will have one of its pets released.
If you add it to a immovable object in the world, then coming within a certain distance of the object will result in a player having a nearby pet released with some probability.
[addatt xmlreleasepet 0.25
would add a 25% chance of releasing a pet on a hit or nearby movement (depending on what you attached it to).
if you used it in a spawner entry like
orc/ATTACH/xmlreleasepet,0.75
then this orc would have a 75% chance of causing a pet to be released every time it hit the owner.
If you wanted to change it so that instead of releasing the pet when the mobile hit the player (ReleaseOnAttack), the player would have its pet released when it hit the mobile (ReleaseOnDefend), you can set the ReleaseOnAttack and/or ReleaseOnDefend switches.
orc/ATTACH/<xmlreleasepet,0.75/releaseonattack/false/releaseondefend/true>
Properties that can be set and their default values include
double Chance = 0.05; // default 5% chance of release on triggering
int TriggerRange = 5; // default movement activation from 5 tiles away
int PetDistance = 7; // default max distance of pet from owner
bool ReleaseOnDefend = false; // release pet when the mobile or armor is defending
bool ReleaseOnAttack = true; // release pet when the mobile or weapon is attacking