Rune_PRC8/_module/nss/vat_stripnondrop.nss
Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

38 lines
1.1 KiB
Plaintext

#include "inc_levelset"
void main()
{
object oTarget = GetPCSpeaker();
int iFoundItemFlag = 0;
//for testing
//AssignCommand(oTarget, SpeakString("stripInventory fired"));
//valid only for creatures
//if ( GetObjectType(oTarget) != OBJECT_TYPE_CREATURE) return;
// set the variables
object oItem = GetFirstItemInInventory(oTarget);
// destroy unequipped items in inventory
while ( GetIsObjectValid(oItem) )
{
//SendMessageToPC(oTarget, "Evaluating " + GetName(oItem));
if (GetIsDMFI(oItem) != TRUE)
{
if (GetItemCursedFlag(oItem) == TRUE)
{
SetItemCursedFlag(oItem, FALSE);
SendMessageToPC(oTarget, GetName(oItem) + " changed to droppable.");
iFoundItemFlag = 1;
}
//else SendMessageToPC(oTarget, GetName(oItem) + " was not changed.");
}
else SendMessageToPC(oTarget, GetName(oItem) + " is a DMFI item.");
oItem = GetNextItemInInventory(oTarget);
}
if (iFoundItemFlag == 0) SendMessageToPC(oTarget, "No cursed / non-droppable items found.");
}