PWE_PRC8/_module/nss/ats_store_reset.nss
Jaysyn904 ee1dc35889 Initial Commit
Initial Commit
2025-04-03 10:29:41 -04:00

38 lines
1.1 KiB
Plaintext

#include "ats_config"
void main()
{
object oCurrentItem = GetFirstItemInInventory();
string sItemTag;
int iItemCount = 0;
int iTotalCount = 0;
while(oCurrentItem != OBJECT_INVALID)
{
sItemTag = GetTag(oCurrentItem);
iItemCount = GetLocalInt(OBJECT_SELF, "count_" + sItemTag);
if(GetLocalInt(oCurrentItem, "ats_onstore_original") == FALSE)
{
if(iItemCount >= CINT_MERCHANT_MAX_PER_ITEM)
DestroyObject(oCurrentItem);
else if(iTotalCount >= CINT_MERCHANT_MAXITEMS)
DestroyObject(oCurrentItem);
else
{
++iItemCount;
++iTotalCount;
SetLocalInt(OBJECT_SELF, "count_" + sItemTag ,iItemCount );
}
}
oCurrentItem = GetNextItemInInventory();
}
oCurrentItem = GetFirstItemInInventory();
while(oCurrentItem != OBJECT_INVALID)
{
SetLocalInt(OBJECT_SELF, "count_" + GetTag(oCurrentItem) , 0);
oCurrentItem = GetNextItemInInventory();
}
}