PoA_PRC8/_module/nss/codi_ondamage.nss
Jaysyn904 bfbbd2f1ac Major update
Added several new undead models & facelifted overrides for other models.  Added dozens of new undead creatures from Libris Mortis & the monster manuals.  Added CODI Core AI.  Added NESS spawner system.  Added randomized respawning trap system.  Added undead feeding system.  Greatly revamped Catacombs & Halls of the Dead.  Updated nimtools.  Full compile.  Updated release archive.
2024-04-07 01:06:57 -04:00

55 lines
1.6 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Name codi_ondamage
//::
//:://////////////////////////////////////////////
/*
NPC OnDamaged event script caller to run
CODI AI & PRC events.
*/
//:://////////////////////////////////////////////
//:: Created By: Jaysyn
//:: Created On: 20240331
//:://////////////////////////////////////////////
void main()
{
int nTotalDamage = GetTotalDamageDealt();
int nFireDamage = 0;
string sResRef = GetResRef(OBJECT_SELF);
//--------------------------------------------------------------------------
// GZ: 2003-10-16
// Make Plot Creatures Ignore Attacks
//--------------------------------------------------------------------------
if (GetPlotFlag(OBJECT_SELF))
{
return;
}
//:: Handles healing from fire damage
if(sResRef == "BLEAKBORN001" || sResRef == "BLEAKBORN002")
{
if(GetDamageDealtByType(DAMAGE_TYPE_FIRE) != -1)
{
nFireDamage = GetDamageDealtByType(DAMAGE_TYPE_FIRE);
//DelayCommand(0.0f, SpeakString("Fire Damage: " + IntToString(nFireDamage)));
}
effect eHeal = EffectTemporaryHitpoints(nFireDamage/3);
//DelayCommand(0.0f, SpeakString("Subdual damage healed: " + IntToString(nSubDmg)));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, OBJECT_SELF, 0.0f);
}
//:: Execute the CODI AI NPC OnDamaged script
ExecuteScript("no_ai_dam", OBJECT_SELF);
//:: Execute the Default NPC OnDamaged script
//ExecuteScript("nw_c2_default6", OBJECT_SELF);
//:: Execute the PRC NPC OnDamaged script
ExecuteScript("prc_npc_damaged", OBJECT_SELF);
}