Battledale_PRC8/_module/nss/jw_cabinet_dist.nss

55 lines
601 B
Plaintext
Raw Permalink Normal View History

void makedrink();
void main()
{
object oObject;
int nCounter;
oObject=GetFirstItemInInventory(OBJECT_SELF);
// if there's nothing in there, make something now
if (GetIsObjectValid(oObject))
{}
else
{
makedrink();
}
// check what's in there
nCounter=0;
while (GetIsObjectValid(oObject))
{
if (GetBaseItemType(oObject)==BASE_ITEM_POTIONS)
{
nCounter++;
}
oObject=GetNextItemInInventory(OBJECT_SELF);
}
if ((nCounter < 8))
{
DelayCommand(300.0,makedrink());
}
}
void makedrink()
{
int nRandom;
nRandom=(Random(4)+1);
CreateItemOnObject("jw_drink"+IntToString(nRandom),OBJECT_SELF);
}