36 lines
1.2 KiB
Plaintext
36 lines
1.2 KiB
Plaintext
///////////////////////////
|
|
// Destroy Shadow items
|
|
///////////////////////////
|
|
void main()
|
|
{
|
|
object oPC=GetEnteringObject();
|
|
string sTag;
|
|
object oItem;
|
|
if (GetIsPC(oPC)==TRUE&&GetIsDM(oPC)==FALSE)
|
|
{ // check for and destroy shadow items
|
|
oItem=GetFirstItemInInventory(oPC);
|
|
while(oItem!=OBJECT_INVALID)
|
|
{ // test inventory
|
|
sTag=GetResRef(oItem); // rts_it_shd
|
|
sTag=GetStringLeft(sTag,10);
|
|
if (sTag=="rts_it_shd") DelayCommand(2.0,DestroyObject(oItem));
|
|
oItem=GetNextItemInInventory(oPC);
|
|
} // test inventory
|
|
oItem=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
|
|
if (oItem!=OBJECT_INVALID)
|
|
{ // !OI
|
|
sTag=GetResRef(oItem); // rts_it_shd
|
|
sTag=GetStringLeft(sTag,10);
|
|
if (sTag=="rts_it_shd") DelayCommand(2.0,DestroyObject(oItem));
|
|
} // !OI
|
|
oItem=GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
|
|
if (oItem!=OBJECT_INVALID)
|
|
{ // !OI
|
|
sTag=GetResRef(oItem); // rts_it_shd
|
|
sTag=GetStringLeft(sTag,10);
|
|
if (sTag=="rts_it_shd") DelayCommand(2.0,DestroyObject(oItem));
|
|
} // !OI
|
|
DelayCommand(3.0,ExecuteScript("rts_save_player",oPC));
|
|
} // check for and destroy shadow items
|
|
}
|