WoR_PRC8/_module/nss/clearmerchant.nss

37 lines
837 B
Plaintext
Raw Permalink Normal View History

2025-04-03 11:49:34 -04:00
////////////////////////////////////////////////////////////////////////////////
//
// Script: clearmerchant
//
// Use: This script goes into "OnOpenStore".
//
// Created: Added to Rhun 7.25.09
//
// By: Birdman076
//
////////////////////////////////////////////////////////////////////////////////
void main()
{
object oItem = GetFirstItemInInventory();
int nCount = GetLocalInt(OBJECT_SELF, "Count")+1;
SetLocalInt(OBJECT_SELF, "Count", nCount);
if (nCount == 1)
{
while(oItem != OBJECT_INVALID)
{
SetLocalInt(oItem, "Default", 1);
oItem = GetNextItemInInventory();
}
}
else
{
while(oItem != OBJECT_INVALID)
{
if(GetLocalInt(oItem, "Default") == 0)
DestroyObject(oItem);
oItem = GetNextItemInInventory();
}
}
}