The script in question is currently being handled by OnDamaged()
At about 25% of health, I have two skeletons is that puffs up with his taunt anim and then spawns in a lesser skeleton.
First off, anytime the PC attacks said skeletons, they start the spawn sequence way ahead of time. Definitely not down to 25% when they spawn. They spawn on the first hit.
I’ve tried using OnPhysicallyAttacked() as well.
So, I’m a little miffed.
Code so far:
void main()
{
object oPC = GetLastDamager();
if (!GetIsPC(oPC)) return;
int nMaxHP = GetMaxHitPoints();
int nCurHP = GetCurrentHitPoints();
int nRatio = (100* nCurHP)/nMaxHP;
if ( nRatio >= 25 )
{
object oSound = GetNearestObjectByTag("SKELETON_SCREECH");
ClearAllActions();
ActionPlayAnimation(ANIMATION_FIREFORGET_TAUNT);
SoundObjectPlay(oSound);
object oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "skeleton001", GetLocation(oPC));
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect
( VFX_FNF_GAS_EXPLOSION_NATURE ), oSpawn));
}
}