here is my code which does what you want, will you be able to modify it yourself?
int StartingConditional()
{
object oPC = GetPCSpeaker();
object oItem = GetFirstItemInInventory(oPC);
int nCount;
while(oItem != OBJECT_INVALID)
{
if(GetResRef(oItem) == "sh_it_lovec005")
{
nCount+= GetItemStackSize(oItem);
DestroyObject(oItem);
}
oItem = GetNextItemInInventory(oPC);
}
if(nCount)
{
SetCustomToken(902,IntToString(nCount));
GiveGoldToCreature(oPC,nCount*20);
SetXP(oPC,GetXP(oPC)+nCount*10);
return FALSE;
}
return TRUE;
}