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

44 lines
1.3 KiB
Plaintext

/////////////////////////////////////////////////////////
//
// Craftable Natural Resources (CNR) by Festyx
//
// Name: cnr_skin_ondeath
//
// Desc: The OnDeath handler for skinnable animals.
//
// Author: David Bobeck 18Feb03
//
/////////////////////////////////////////////////////////
#include "cnr_config_inc"
void FadeCorpse()
{
object oBones = GetLocalObject(OBJECT_SELF, "CnrCorpseBones");
if (GetIsObjectValid(oBones))
{
DeleteLocalObject(OBJECT_SELF, "CnrCorpseBones");
DestroyObject(oBones);
}
DestroyObject(OBJECT_SELF);
}
void main()
{
string sDeathScript = GetLocalString(OBJECT_SELF, "PAT_post_cnr_skin_ondeath");
if (sDeathScript == "")
sDeathScript = "nw_c2_default7";
ExecuteScript(sDeathScript , OBJECT_SELF);
location locDeath = GetLocation(OBJECT_SELF);
object oCorpse = CreateObject(OBJECT_TYPE_PLACEABLE, "cnrcorpseskin", locDeath, FALSE);
object oBones = CreateObject(OBJECT_TYPE_PLACEABLE, "cnrcorpsebones", locDeath, FALSE);
SetObjectVisualTransform(oCorpse, OBJECT_VISUAL_TRANSFORM_SCALE, 1.5);
SetObjectVisualTransform(oBones, OBJECT_VISUAL_TRANSFORM_SCALE, 1.5);
SetLocalObject(oCorpse, "CnrCorpseBones", oBones);
SetLocalString(oCorpse, "CnrCorpseType", GetTag(OBJECT_SELF));
AssignCommand(oCorpse, DelayCommand(CNR_FLOAT_SKINNABLE_CORPSE_FADE_TIME_SECS, FadeCorpse()));
}