script fixes, additions to merchant

This commit is contained in:
EpicValor
2023-08-31 20:34:52 -05:00
parent e6bd2ef68d
commit eb5060ffdd
28 changed files with 2441 additions and 40 deletions

View File

@@ -1,22 +1,30 @@
void main()
void MakeItemsDroppable(object oNPC)
{
object oNPC = OBJECT_SELF;
object oItem = GetFirstItemInInventory(oNPC);
while (GetIsObjectValid(oItem))
{
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);
}
{
if (GetDroppableFlag(oItem) == FALSE)
{
SetLocalInt(oItem, "notdroppable", 1);
}
if (GetLocalInt(oItem, "notdroppable") == TRUE)
{
// 20% chance to drop item from inventory not already set as droppable
if (d100() <= 20)
{
SetDroppableFlag(oItem, TRUE);
}
}
oItem = GetNextItemInInventory(oNPC);
}
}
void main()
{
object oNPC = OBJECT_SELF;
DelayCommand(0.0f,MakeItemsDroppable(oNPC));
}