Files
Anphillia_PRC8/_module/nss/mod_ondeath.nss
Jaysyn904 28cdb617b3 Initial commit
Adding all of the current content for Anphillia Unlimited.
2024-01-04 07:49:38 -05:00

45 lines
1.1 KiB
Plaintext

///////////////////////////////////////////////////////////////////////////////
// mod_ondeath
// written by: eyesolated
// written at: Jan. 30, 2004
//
// Notes: Placeholder for the module-wide OnPlayerDeath Event
///////////
// Includes
//
#include "datetime_inc"
#include "chr_inc"
#include "chr_death_inc"
#include "nwnx_object"
///////////////////////
// Function Declaration
//
////////////////
// Function Code
//
void main()
{
object oPC = GetLastPlayerDied();
object oLastHostileActor = GetLastHostileActor();
if (GetLocalInt(oLastHostileActor, "FACTION_SPARRING_MODE"))
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oPC);
NWNX_Object_SetCurrentHitPoints(oPC, 1);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,SupernaturalEffect(EffectKnockdown()),oPC,RoundsToSeconds(2));
return;
}
// Drop the player's backpack if he isn't in a safe location
object oNoFugue = GetNearestObjectByTag("noFugue", oPC);
if (!GetIsObjectValid(oNoFugue))
chr_Drop_Backpack(oPC);
// Call Death
chr_Death_OnDeath(oPC, oLastHostileActor);
}