Files
HeroesStone_PRC8/_module/nss/corpse_death.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

41 lines
1.3 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Name corpse_death
//:: FileName
//::
//:://////////////////////////////////////////////
/*
Responds to the ondeath event of the placeable.
Gives back items to our owner and destroys it.
*/
//:://////////////////////////////////////////////
//:: Created By: Alexandre Brunel
//:: Created On: 21/04/2003
//:://////////////////////////////////////////////
#include "corpse_lib"
void main()
{
//WriteTimestampedLogEntry("CorpseDestruction: "+GetTag(GetLocalObject(OBJECT_SELF,"LinkedTo")));
AssignCommand(GetLocalObject(OBJECT_SELF,CorpseCreatureCorpse),SetIsDestroyable(TRUE));
object item = GetFirstItemInInventory();
/*while(GetIsObjectValid(item))
{
object linked = GetLocalObject(item,CorpseOriginalObject);
if(GetIsObjectValid(linked))
{
SetPlotFlag(linked,FALSE);
DestroyObject(item);
DeleteLocalObject(item,CorpseOriginalObject);
}
item = GetNextItemInInventory();
}*/
//GetItemsInInventory(GetLocalObject(OBJECT_SELF,CorpseCreatureCorpse));
DestroyObject(GetPickableCorpse());
SetCommandable(TRUE);
AssignCommand(GetLocalObject(OBJECT_SELF,CorpseCreatureCorpse),giveBackItems(OBJECT_SELF,TRUE,TRUE));
giveBackItems(GetLocalObject(OBJECT_SELF,CorpseCreatureCorpse),TRUE,TRUE);
}