I think this code is correct for spawning in critters when OBJECT_SELF is damaged. But nothing happens?
Code:
int nMax = GetMaxHitPoints(OBJECT_SELF);
int nHP = GetCurrentHitPoints(OBJECT_SELF);
int nRatio = (100* nHP)/nMax;
if (nRatio <= 25)
{
SoundObjectPlay(GetNearestObjectByTag("SKELETON_SCREECH"));
AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_FIREFORGET_TAUNT));
DelayCommand(1.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect
( VFX_IMP_DEATH_L ), GetLocation(GetWaypointByTag("SKELE_SUMMON_01"))));
DelayCommand(1.5, CreateObjectVoid(OBJECT_TYPE_CREATURE, "skeleton003", GetLocation(GetWaypointByTag("SKELE_SUMMON_01"))));
DelayCommand(2.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect
( VFX_IMP_DEATH_L ), GetLocation(GetWaypointByTag("SKELE_SUMMON_2"))));
DelayCommand(2.5, CreateObjectVoid(OBJECT_TYPE_CREATURE, "skeleton003", GetLocation(GetWaypointByTag("SKELE_SUMMON_2"))));
// Attack the PC.
DelayCommand(3.0, AdjustReputation(oPC, GetNearestObjectByTag("SKELE_WAR_001"), -100));
DelayCommand(3.0, SetIsTemporaryEnemy(oPC, GetNearestObjectByTag("SKELE_WAR_001")));
DelayCommand(3.0, AssignCommand(GetNearestObjectByTag("SKELE_WAR_001"), DetermineCombatRound(oPC)));
}
Everything works as long as I remove the math problem. So I would have to say the code is incorrect. What say you experts?
Edit: It’s working now. Think I might of had a bracket out of place…