Simple little ‘does PC have item in inventory, If yes, delete and reward xp and gp’ script.
I’d like it to repeat for every item in the players inventory that matches the item tag, but what I added does some strange things with rewarding xp and gp.
#include "nw_i0_tool"
void main()
{
object oPC = GetPCSpeaker();
object oItem;
oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (GetTag(oItem)=="NW_IT_MSMLMISC13") DestroyObject(oItem);
//I added the following two lines
RewardPartyXP(15, oPC, FALSE);
RewardPartyGP(25, oPC, FALSE);
oItem = GetNextItemInInventory(oPC);
}
}
Currently it does take all the items with the item tag, but it’s rewarding the xp 50 times and gp a random number of times.