Initial commit

Initial commit.
This commit is contained in:
Jaysyn904
2024-08-02 23:18:00 -04:00
parent 779bee26ec
commit adeff59f82
3413 changed files with 2837434 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
/*
Original code by Mojo and his ATS.
He was a great scripter and his presence will be missed.
Code tweaked for generic use in all merchants by:
Chris Morris
*/
void main()
{
object oCurrentItem = GetFirstItemInInventory();
string sItemTag;
int iItemCount = 0;
//this while does the trimming
while(oCurrentItem != OBJECT_INVALID){
sItemTag = GetResRef(oCurrentItem);
iItemCount = GetLocalInt(OBJECT_SELF, "count_" + sItemTag);
if(iItemCount >= 1){ //set this number to amount of duplicates
DestroyObject(oCurrentItem);//that are acceptable
}else{
++iItemCount; //incrementing number in inventory
SetLocalInt(OBJECT_SELF, "count_" + sItemTag ,iItemCount );
}
oCurrentItem = GetNextItemInInventory(); //do next item
}//end while
oCurrentItem = GetFirstItemInInventory();
//this while resets for next onOpen
while(oCurrentItem != OBJECT_INVALID){
SetLocalInt(OBJECT_SELF, "count_" + GetResRef(oCurrentItem) , 0);
oCurrentItem = GetNextItemInInventory();
}//end while
}//end main()