Added Random Option item data to getinventorylist (#3030)
* Closes #3021. * Added Random Option item data to script command getinventorylist return values. Thanks to @Yuchinin!
This commit is contained in:
@@ -13880,7 +13880,7 @@ BUILDIN_FUNC(petloot)
|
||||
BUILDIN_FUNC(getinventorylist)
|
||||
{
|
||||
TBL_PC *sd;
|
||||
char card_var[NAME_LENGTH];
|
||||
char card_var[NAME_LENGTH], randopt_var[NAME_LENGTH];
|
||||
int i,j=0,k;
|
||||
|
||||
if (!script_charid2sd(2,sd))
|
||||
@@ -13900,6 +13900,15 @@ BUILDIN_FUNC(getinventorylist)
|
||||
}
|
||||
pc_setreg(sd,reference_uid(add_str("@inventorylist_expire"), j),sd->inventory.u.items_inventory[i].expire_time);
|
||||
pc_setreg(sd,reference_uid(add_str("@inventorylist_bound"), j),sd->inventory.u.items_inventory[i].bound);
|
||||
for (k = 0; k < MAX_ITEM_RDM_OPT; k++)
|
||||
{
|
||||
sprintf(randopt_var, "@inventorylist_option_id%d",k+1);
|
||||
pc_setreg(sd,reference_uid(add_str(randopt_var), j),sd->inventory.u.items_inventory[i].option[k].id);
|
||||
sprintf(randopt_var, "@inventorylist_option_value%d",k+1);
|
||||
pc_setreg(sd,reference_uid(add_str(randopt_var), j),sd->inventory.u.items_inventory[i].option[k].value);
|
||||
sprintf(randopt_var, "@inventorylist_option_parameter%d",k+1);
|
||||
pc_setreg(sd,reference_uid(add_str(randopt_var), j),sd->inventory.u.items_inventory[i].option[k].param);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user