generated from Jaysyn/ModuleTemplate
Initial upload
Initial upload.
This commit is contained in:
50
_module/nss/vat_identify.nss
Normal file
50
_module/nss/vat_identify.nss
Normal file
@@ -0,0 +1,50 @@
|
||||
#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.");
|
||||
} }
|
||||
Reference in New Issue
Block a user