NPC Checks for more than 1 of the same item in a PCs inventory

NPC Check's for more than 1 of the same item in a PC's
A simple way to check for Items in a "Text Appeares When" script mode is to use the GetNumItems. This is a bit easier than going threw the Inventory and "counting" each item.

This need to be in the "Text Appeares When" Script node of the Text line you want to appeare to the PC if he/she has the correct amount of said Item. Change "ITEM_TAG" to that of the Item you are looking for and set nMarkCount to the number of items you want.

int StartingConditional {   //check inventory of oPC for oQuestItem and get iNumItems string sMark = "ITEM_TAG"; int nMarkCount = 2; object oMark = GetObjectByTag(sMark); if(GetNumItems(GetPCSpeaker,sMark) >= nMarkCount) return TRUE; return FALSE; }
 * 1) include "nw_i0_plot"

If you want to take the Items in the "Action Taken" node of the next Text node. We can use TakeNumItems.

Place this script in the "Actions Taken" of the next NPC response. Again change "ITEM_TAG" to that of the Item your looking for and set nMarkCount to the number of Items to take.

void main {   string sMark = "ITEM_TAG"; // Enter tag of your Item object oMark = GetObjectByTag(sMark); int nMarkCount = 2; // Change to num Items you want if(GetNumItems(GetPCSpeaker,sMark) >= nMarkCount) {       TakeNumItems(GetPCSpeaker,sMark,nMarkCount); // Uncomment the following line to Give the PC an Item Also // CreateItemOnObject("item_ResRef",GetPCSpeaker,1); } }
 * 1) include "nw_i0_plot"

Sample Conversation
+Root -NPC: "I see you have 2 Items" [Text appeares When script] ---PC: "Yes I do" -NPC:"Thanks" [Actions Taken] -NPC: "I need you to get 2 Items" ---PC: "Ok, Beright back"