Aantioch_Infernum/_module/nss/random_drop.nss

23 lines
599 B
Plaintext
Raw Normal View History

2023-08-08 16:22:17 -04:00
void main()
{
object oNPC = OBJECT_SELF;
object oItem = GetFirstItemInInventory(oNPC);
while (GetIsObjectValid(oItem))
{
2023-08-31 00:53:09 -05:00
if (GetDroppableFlag(oItem) == TRUE)
{
//items already set as droppable should stay that way
SetLocalInt (oItem, "droppable", 1);
GetNextItemInInventory(oNPC);
}
if (GetLocalInt(oItem, "droppable") == FALSE)
{
//20% chance to drop item inventory not already set as droppable
int bDroppable=d100()>80;
SetDroppableFlag(oItem, bDroppable);
oItem = GetNextItemInInventory(oNPC);
}
}
2023-08-08 16:22:17 -04:00
}