generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit.
This commit is contained in:
67
_removed/corpse_crypt_ex.nss
Normal file
67
_removed/corpse_crypt_ex.nss
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user