2023-09-28 23:01:25 -05:00
|
|
|
void MakeItemsDroppable(object oNPC)
|
2023-08-08 16:22:17 -04:00
|
|
|
{
|
|
|
|
object oItem = GetFirstItemInInventory(oNPC);
|
|
|
|
|
2023-09-28 23:01:25 -05:00
|
|
|
while (GetIsObjectValid(oItem))
|
2023-08-08 16:22:17 -04:00
|
|
|
{
|
2023-09-28 23:01:25 -05:00
|
|
|
if (GetDroppableFlag(oItem) == FALSE)
|
|
|
|
{
|
|
|
|
SetLocalInt(oItem, "notdroppable", 1);
|
|
|
|
}
|
2023-08-08 16:22:17 -04:00
|
|
|
|
2023-09-28 23:01:25 -05:00
|
|
|
if (GetLocalInt(oItem, "notdroppable") == TRUE)
|
|
|
|
{
|
2023-11-17 01:59:49 -06:00
|
|
|
// 40% chance to drop item from inventory not already set as droppable
|
2023-09-28 23:01:25 -05:00
|
|
|
if (d100() <= 40)
|
|
|
|
{
|
|
|
|
SetDroppableFlag(oItem, TRUE);
|
2023-08-08 16:22:17 -04:00
|
|
|
|
2023-09-28 23:01:25 -05:00
|
|
|
}
|
|
|
|
}
|
2023-08-08 16:22:17 -04:00
|
|
|
|
2023-09-28 23:01:25 -05:00
|
|
|
oItem = GetNextItemInInventory(oNPC);
|
|
|
|
}
|
|
|
|
}
|
2023-08-08 16:22:17 -04:00
|
|
|
|
2023-09-28 23:01:25 -05:00
|
|
|
void main()
|
|
|
|
{
|
|
|
|
object oNPC = OBJECT_SELF;
|
|
|
|
DelayCommand(0.2, MakeItemsDroppable(oNPC));
|
2023-08-08 16:22:17 -04:00
|
|
|
}
|