Amon_PRC8/_module/nss/thes_inc.nss

29 lines
956 B
Plaintext
Raw Normal View History

2025-04-03 19:00:46 -04:00
int MassBountyTurnIn(
object oTarget, // the PC
string sItem, // the item's tag
int xpPer, // how much xp per item
int gpPer) { // how much gp per item
int bountyCount = 0;
// iterate over inventory ONE TIME ONLY and both count and remove the item
// same loop as in GetNumItems() in nw_i0_plot.nss
object oItem = GetFirstItemInInventory(oTarget);
while( GetIsObjectValid(oItem) == TRUE ) {
if( GetTag(oItem) == sItem ){
bountyCount = bountyCount + GetNumStackedItems(oItem);
DestroyObject(oItem);
}
oItem = GetNextItemInInventory(oTarget);
}
if( bountyCount > 0 ) {
GiveXPToCreature(oTarget, bountyCount * xpPer);
GiveGoldToCreature(oTarget, bountyCount * gpPer);
}
// monitor its use? fill in following code
// add a PrintString() to log it
// SendMessageToAllDMs()
return bountyCount;
}