Initial Commit

Initial Commit.
This commit is contained in:
Jaysyn904
2025-09-14 15:40:46 -04:00
parent 7083b33d71
commit 1eefc84201
19230 changed files with 11539227 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
#include "corpse_lib"
object GetFinalMaster(object target)
{
object master = GetMaster(target);
object lastMaster = OBJECT_INVALID;
while(GetIsObjectValid(master))
{
lastMaster = master;
master = GetMaster(lastMaster);
}
return lastMaster;
}
void restoreEquipement(object target)
{
int slot = 0;
while(slot<= NUM_INVENTORY_SLOTS)
{
object item = GetItemInSlot(slot++,target);
if(GetIsObjectValid(item))
{
if(GetLocalInt(item,CorspeWasDroppableSet))
{
DeleteLocalInt(item,CorspeWasDroppableSet);
SetItemCursedFlag(item,GetLocalInt(item,CorspeWasDroppable));
}
}
}
}
void main()
{
object exitingObject = GetExitingObject();
if(!GetIsDM(exitingObject) && !GetIsDMPossessed(exitingObject) && !GetIsDM(GetFinalMaster(exitingObject))&& !GetIsCorpseCopying(exitingObject))
{
effect ghost = GetFirstEffect(exitingObject);
while(GetIsEffectValid(ghost) && GetEffectType(ghost) != EFFECT_TYPE_CUTSCENEGHOST)
{
ghost = GetNextEffect(exitingObject);
}
if(GetIsEffectValid(ghost))
{
RemoveEffect(exitingObject,ghost);
}
SetImmortal(exitingObject,FALSE);
restoreEquipement(exitingObject);
}
}