31 lines
667 B
Plaintext
31 lines
667 B
Plaintext
void MakeItemsDroppable(object oNPC)
|
|
{
|
|
object oItem = GetFirstItemInInventory(oNPC);
|
|
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
if (GetDroppableFlag(oItem) == FALSE)
|
|
{
|
|
SetLocalInt(oItem, "notdroppable", 1);
|
|
}
|
|
|
|
if (GetLocalInt(oItem, "notdroppable") == TRUE)
|
|
{
|
|
// 10% chance to drop item from inventory not already set as droppable
|
|
if (d100() <= 10)
|
|
{
|
|
SetDroppableFlag(oItem, TRUE);
|
|
|
|
}
|
|
}
|
|
|
|
oItem = GetNextItemInInventory(oNPC);
|
|
}
|
|
}
|
|
|
|
void main()
|
|
{
|
|
object oNPC = OBJECT_SELF;
|
|
DelayCommand(0.2, MakeItemsDroppable(oNPC));
|
|
}
|