//:://////////////////////////////////////////////////
//:: jx_crde_anadweomer.nss
/*
  Script called by the default OnDeath event handler for NPCs.

  Identify the magical items detected by the spell Analyze Dweomer.
 */
//:://////////////////////////////////////////////
//:: Created By: jallaix
//:: Created On: Aug 19, 2007
//:://////////////////////////////////////////////

#include "jx_inc_magic_const"


void main()
{
	// Loop all items the creature holds
	object oItem; int iLoop;
	for (iLoop = 0; iLoop < 14; iLoop++)
	{
		oItem = GetItemInSlot(iLoop, OBJECT_SELF);
		if (GetIsObjectValid(oItem))
		{
			if (GetDroppableFlag(oItem) && GetLocalInt(oItem, JX_ITEM_IDENTIFIED))
				AssignCommand(GetModule(), SetIdentified(oItem, TRUE));
		}
	}

	// Also look in the inventory
	oItem = GetFirstItemInInventory();
	while (GetIsObjectValid(oItem))
	{
		if (GetDroppableFlag(oItem) && GetLocalInt(oItem, JX_ITEM_IDENTIFIED))
			AssignCommand(GetModule(), SetIdentified(oItem, TRUE));
		oItem = GetNextItemInInventory();
	}
}