Initial Commit
Initial Commit [v1.01]
This commit is contained in:
24
_module/nss/pcinclude.nss
Normal file
24
_module/nss/pcinclude.nss
Normal file
@@ -0,0 +1,24 @@
|
||||
// destroys iNumToDestroy items with the specified tag from the specified object's inventory
|
||||
int DestroyItemsInInventory(object oPC, string sItemTag, int iNumToDestroy);
|
||||
int DestroyItemsInInventory(object oPC, string sItemTag, int iNumToDestroy)
|
||||
{
|
||||
object oFirstItem = GetFirstItemInInventory(oPC);
|
||||
object oItem = oFirstItem;
|
||||
int iItemCount = 0;
|
||||
while(oItem != OBJECT_INVALID && iItemCount <= iNumToDestroy)
|
||||
{
|
||||
//SpeakString(GetTag(oItem), TALKVOLUME_SHOUT);
|
||||
if(GetTag(oItem) == sItemTag)
|
||||
{
|
||||
iItemCount++;
|
||||
DestroyObject(oItem);
|
||||
}
|
||||
oItem = GetNextItemInInventory(oPC);
|
||||
if(oItem == oFirstItem)
|
||||
{
|
||||
oItem = OBJECT_INVALID;
|
||||
}
|
||||
}
|
||||
return iItemCount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user