if (!fDam){ return; } //If damage isn't "real", forget the rest.
if(fHP > 0) //Damage is survivable?
{
iAni = getentityproperty(vSelf, "animationid"); //Get animation.
iPos = getentityproperty(vSelf, "animpos"); //Get current frame.
iLnd = getentityproperty(vSelf, "landframe", iAni); //Get landframe.
if (iPos != iLnd) //Not landing?
{
if (iDrop > 0) //Knockdown hit?
{
if (iAType == ATK_BURN
&& iAni != A_BURN) //Burn hit and not already burning?
{
soun0005(vSelf, VOIBRN, -1, 1, 0, 0); //Burn sound.
}
else
{
if ((fHP / fMaxHP) <= 0.25 ) //Damage below 25% max health?
{
soun0005(vSelf, VOIDYN, -1, 1, 0, 0); //Dying sound (always).
}
else
{
soun0005(vSelf, VOIPN, -1, 1, 0, 0); //Pain sound (always).
}
}
}
else
{
soun0005(vSelf, VOIPN, -1, 0.5, 0, 0); //Pain sound (50%).
}
}
else
{
if ((fHP / fMaxHP) <= 0.25 ) //Damage below 25% max health?
{
soun0005(vSelf, VOIDYN, -1, 1, 0, 0); //Dying sound (always).
}
else
{
soun0005(vSelf, VOIPN, -1, 1, 0, 0); //Pain sound (always).
}
}
}
else
{
fX = getentityproperty(vSelf, "x"); //Get X location.
fZ = getentityproperty(vSelf, "z"); //Get Z location.
if(checkhole(fX, fZ)) //In a pit?
{
soun0005(vSelf, VOIPIT, -1, 1, 0, 0); //Pit KO sound (always).
}
else
{
soun0005(vSelf, VOIDIE, -1, 1, 0, 0); //KO sound (always).
}
}