I put the script using notepad and Attached it to the post.
Code: Select all
#include "zcommon.acs"
script "PreventSplashDamage"
int attackerTID;
int targetTID;
while (1)
{
if (ThingCount(0, 0, attackerTID) && ThingCount(0, 0, targetTID))
{
attackerTID = ActivatorTID();
targetTID = TargetTID();
if (ThingCountName("Monster", attackerTID) && ThingClassString(targetTID) == "CustomProjectileClass")
{
SetActorPropertyFixed(targetTID, APROP_Damage, 1.0);
}
}
Delay(1);
}
script "NoProjectileDamage"
while (1)
{
int attackerTID = ActivatorTID();
int targetTID = ActivatorTID(1);
if (ThingCountName("Monster", attackerTID) && (ThingClassString(targetTID) == "Projectile" || ThingClassString(targetTID) == "Missile"))
{
DamageThing(targetTID, 0);
}
Delay(1);
}
script "NoDamage"
while (1)
{
int targetTID = ActivatorTID();
if (ThingCountName("Monster", targetTID))
{
int actorClass = GetActorClass(targetTID);
if (actorClass != StrParam("Monster"))
{
DamageThing(targetTID, 0);
}
}
Delay(1);
}
script "ApplyDamage"
while (1)
{
int targetTID = GetActorProperty(0, APROP_TargetTID);
// Your existing code to apply damage
// Call the NoDamage script to exclude the "Monster" class from taking damage
ACS_NamedExecute("NoDamage", targetTID);
Delay(1);
}