PGCC_PRC8/_module/nss/vat_identify.nss
Jaysyn904 e51634d39b Initial upload
Initial upload.
2024-10-09 14:17:22 -04:00

51 lines
1.5 KiB
Plaintext

#include "inc_levelset"
void main()
{
object oTarget = GetPCSpeaker();
int iFoundItemFlag = 0;
int i = 0;
//for testing
//AssignCommand(oTarget, SpeakString("identify fired"));
//valid only for creatures
//if ( GetObjectType(oTarget) != OBJECT_TYPE_CREATURE) return;
// set the variables
object oItem = GetFirstItemInInventory(oTarget);
// ID unequipped items in inventory
while ( GetIsObjectValid(oItem) )
{
//SendMessageToPC(oTarget, "Evaluating " + GetName(oItem));
if (GetIsDMFI(oItem) != TRUE)
{
if (GetIdentified(oItem) == FALSE)
{
SetIdentified(oItem, FALSE);
SendMessageToPC(oTarget, "Identified " + GetName(oItem) + ".");
iFoundItemFlag = 1;
}
//else SendMessageToPC(oTarget, GetName(oItem) + " was not changed.");
}
else SendMessageToPC(oTarget, GetName(oItem) + " is a DMFI item.");
oItem = GetNextItemInInventory(oTarget);
}
//ID equipped items in slots--just to be safe
for ( i = 0; i < NUM_INVENTORY_SLOTS; i++ )
{
oItem = GetItemInSlot(i, oTarget);
if (GetIdentified(oItem) == FALSE)
{
SetIdentified(oItem, FALSE);
SendMessageToPC(oTarget, "Identified " + GetName(oItem) + ".");
iFoundItemFlag = 1;
}
if (iFoundItemFlag == 0) SendMessageToPC(oTarget, "No unidentified items found.");
} }