Aschbourne_PRC8/_module/nss/vg_coffinondeath.nss

28 lines
945 B
Plaintext
Raw Permalink Normal View History

2024-06-14 10:48:20 -04:00
void main()
{
object oVamp = GetNearestObjectByTag(GetLocalString(OBJECT_SELF, "NW_L_MYCREATOR"),OBJECT_SELF);
int iVampHealth = GetMaxHitPoints(oVamp);
effect eDamage = EffectDamage((iVampHealth/2),DAMAGE_TYPE_MAGICAL,DAMAGE_POWER_PLUS_TWENTY);
//Remove effects from the "sleeping vamp" and wake him up with 1/2 hit points
effect eLoop=GetFirstEffect(oVamp);
while (GetIsEffectValid(eLoop))
{
if (GetEffectType(eLoop)==EFFECT_TYPE_CUTSCENE_PARALYZE)
RemoveEffect(oVamp, eLoop);
if (GetEffectType(eLoop)==EFFECT_TYPE_DAMAGE_REDUCTION)
RemoveEffect(oVamp, eLoop);
if (GetEffectType(eLoop)==EFFECT_TYPE_IMMUNITY)
RemoveEffect(oVamp, eLoop);
if (GetEffectType(eLoop)==EFFECT_TYPE_VISUALEFFECT)
RemoveEffect(oVamp, eLoop);
if (GetEffectType(eLoop)==EFFECT_TYPE_ETHEREAL)
RemoveEffect(oVamp, eLoop);
eLoop=GetNextEffect(oVamp);
}
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oVamp);
}