I would do it differently, getting a count of all the items first, and then awarding the XP and gold in a lump sum at the end. Otherwise, you have to loop through every party member and check area each time. I would use something along this line for it:
void main()
{
object oPC = GetPCSpeaker();
object oArea = GetArea (oPC);
object oTarget, oItem;
int sNum;
oItem = GetFirstItemInInventory (oPC);
while (GetIsObjectValid(oItem))
{
if (GetTag (oItem) == "JS_SeaFleaCara")
{
sNum += GetNumStackedItems (oItem);
DestroyObject(oItem);
}
oItem = GetNextItemInInventory (oPC);
}
// Adjust the count based on the level determined modifier.
if (GetHitDice (oPC) < 20) sNum *= 10;
else sNum *= 3;
oTarget = GetFirstFactionMember (oPC);
while (GetIsObjectValid(oTarget))
{
// Checks area to ensure only PCs in that area get the award.
if (GetArea (oTarget) == oArea)
{
GiveGoldToCreature (oTarget, sNum);
GiveXPToCreature (oTarget, sNum);
}
oTarget = GetNextFactionMember (oPC);
}
}