PoA_PRC8/_module/_removed files/vat_stripnondrop.nss
Jaysyn904 151d074880 Added "Removed Files" folder
Added "Removed Files" folder in case we needed to review any of them.
2022-10-10 10:39:34 -04:00

52 lines
1.5 KiB
Plaintext

#include "inc_levelset"
void main()
{
object oTarget = GetPCSpeaker();
int iFoundItemFlag = 0;
int i = 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);
// unflag 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);
}
//unflag equipped items in slots
for ( i = 0; i < NUM_INVENTORY_SLOTS; i++ )
{
oItem = GetItemInSlot(i, oTarget);
if (GetItemCursedFlag(oItem) == TRUE)
{
SetItemCursedFlag(oItem, FALSE);
SendMessageToPC(oTarget, GetName(oItem) + " changed to droppable.");
iFoundItemFlag = 1;
}
}
if (iFoundItemFlag == 0) SendMessageToPC(oTarget, "No cursed / non-droppable items found.");
}