Is it possible to script an event to happen when a mobs health reaches say 75%, 50% then 25%? I’m pretty sure this is possible because the head jailer’s henchman in the prison in the OC gives up when you get him near death. Maybe I should go check that guy out 1st, lol.
Thank you, that was way more simpler than what Bioware did. Bioware had created a UserDefinedEvent, and it’s giving me a headache trying to read all the documentation on that, lol.
about the UserDefinedEvent(s) … the code-blocks of the ud are fired by “signalling”. The signal usually comes from the regular AI event-scripts; the OnDamaged script, eg, should have a block like
if (GetSpawnInCondition(NW_FLAG_DAMAGED_EVENT))
{
SignalEvent(oSelf, EventUserDefined(EVENT_DAMAGED));
}
The condition GetSpawnInCondition() in ‘x0_i0_spawncond’ is set by the OnSpawn handler (usually, it can be set anywhere via script). It’s just a bitflag in a local_int on the creature. If set, the corresponding code in the ud-script fires also, when the regular OnDamaged script runs.
enabling the UD means that, in this case, the OnDamaged script wouldn’t have to be changed. So you’d get all the goodies that’re already happening in the regular script + your custom stuff. As an alternative, if you want to keep the regular OnDamaged code, simply copy and rename the stock OnDamaged script, then insert your custom code. (The signal to the UD-ondamaged code-block can also be kept intact.)
user-defined events provide an additional way to skin the proverbial cat.
How do you get what’s placed in these “hits” to only fire once? Right now anything you put in there fires every time the creature takes damage <25. So at 26%, 27%, 28%… all the way to <100. So when you get to the <50 and <75 you now have three scripts firing with each hit.