random drop script updated
This commit is contained in:
@@ -4,16 +4,19 @@ void main()
|
||||
object oItem = GetFirstItemInInventory(oNPC);
|
||||
|
||||
while (GetIsObjectValid(oItem))
|
||||
{
|
||||
// if item set to droppable it will 100% drop
|
||||
if (GetDroppableFlag(oItem)== TRUE)
|
||||
{
|
||||
SetDroppableFlag(oItem, TRUE);
|
||||
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);
|
||||
}
|
||||
//10% chance of item in inventory being droppable if not marked droppable
|
||||
int bDroppable=d100()>90;
|
||||
|
||||
SetDroppableFlag(oItem, bDroppable);
|
||||
oItem = GetNextItemInInventory(oNPC);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user