Aantioch_Infernum/_module/nss/random_drop_yy.nss

31 lines
667 B
Plaintext
Raw Permalink Normal View History

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