Aantioch_Infernum/_module/nss/random_drop.nss
EpicValor f6270c3cb8 Tweaked several areas, mobs, and added
the codi ai to some mobs.
2023-09-28 23:01:25 -05:00

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));
}