HoS_PRC8/_mod/_module/nss/shadow_exit.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

55 lines
1.7 KiB
Plaintext

// Shadow Exit
void fnPurgeShadowItems()
{
object oPC=GetExitingObject();
object oItem=GetFirstItemInInventory(oPC);
string sTag;
while(oItem!=OBJECT_INVALID)
{
sTag=GetTag(oItem);
if (sTag=="rts_it_light"||sTag=="rts_it_blast"||sTag=="rts_it_negprot") DelayCommand(2.0,DestroyObject(oItem));
else if(sTag=="rts_it_shd1"||sTag=="rts_it_shd2"||sTag=="rts_it_shd3"||sTag=="rts_it_shd3"||sTag=="rts_it_shd5") DelayCommand(2.0,DestroyObject(oItem));
oItem=GetNextItemInInventory(oPC);
}
oItem=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
sTag=GetTag(oItem);
if (sTag=="rts_it_light"||sTag=="rts_it_blast"||sTag=="rts_it_negprot"||
sTag=="rts_it_shd1"||sTag=="rts_it_shd2"||sTag=="rts_it_shd3"||
sTag=="rts_it_shd3"||sTag=="rts_it_shd5") DelayCommand(2.0,DestroyObject(oItem));
}
void main()
{
object oPC=GetFirstPC();
int nC=0;
while(oPC!=OBJECT_INVALID)
{
if (GetArea(oPC)==OBJECT_SELF) nC++;
oPC=GetNextPC();
}
if (nC<1)
{ // exit shadow - destroy creatures & items
nC=1;
oPC=GetNearestObject(OBJECT_TYPE_ITEM,OBJECT_SELF,nC);
while(oPC!=OBJECT_INVALID)
{
DestroyObject(oPC);
nC++;
oPC=GetNearestObject(OBJECT_TYPE_ITEM,OBJECT_SELF,nC);
}
nC=1;
oPC=GetNearestObject(OBJECT_TYPE_CREATURE,OBJECT_SELF,nC);
while(oPC!=OBJECT_INVALID)
{
DestroyObject(oPC);
nC++;
oPC=GetNearestObject(OBJECT_TYPE_CREATURE,OBJECT_SELF,nC);
}
} // exit shadow - destroy creatures & items
oPC=GetExitingObject();
oPC=GetItemPossessedBy(oPC,"rtstool_rebirth");
if (oPC!=OBJECT_INVALID) DestroyObject(oPC);
DelayCommand(1.0,fnPurgeShadowItems());
}