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

62 lines
1.6 KiB
Plaintext

//
#include "hc_inc"
#include "anph_inc"
void main()
{
object oDC = OBJECT_SELF;
object oItem;
int bFoundToken = FALSE;
string sTag;
/* If the corpse doesn't have the token
in it, destroy it*/
oItem = GetFirstItemInInventory (oDC);
while (oItem != OBJECT_INVALID)
{
sTag = GetTag (oItem);
if (sTag == "PlayerCorpse")
{
bFoundToken = TRUE;
}
oItem = GetNextItemInInventory (oDC);
}
if (bFoundToken == FALSE)
{
oItem = GetFirstItemInInventory (oDC);
WriteTimestampedLogEntry ("Destroying corpse for player " +
GetLocalString (oDC, "Name") +
" because token is not in it.");
DestroyObject (oItem);
DestroyObject (oDC);
return;
}
object oOwner = AnphFindPlayerByKey (GetLocalString (oDC, "Name"),
GetLocalString (oDC, "Key"));
if (GetIsObjectValid (oOwner))
{
if (GetLocalInt (oOwner, "DiedButNotInFugue") == 1)
{
return;
}
if (GetTag (GetArea (oOwner)) == "")
{
return;
}
object oSign = GetNearestObjectByTag ("FugueMarker", oOwner);
if (!GetIsObjectValid (oSign))
{
oItem = GetFirstItemInInventory (oDC);
WriteTimestampedLogEntry ("Destroying corpse for player " +
GetLocalString (oDC, "Name") +
" because player is not in fugue.");
DestroyObject (oItem);
DestroyObject (oDC);
}
}
}