Converted item group database to YAML (#6032)
* Converts the item_bluebox, item_cardalbum, item_giftbox, item_group_db, item_misc, item_package and item_violetbox txt into YAML. * Includes CSV2YAML converter. Co-authored-by: Aleos <aleos89@users.noreply.github.com> Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
@@ -7851,11 +7851,10 @@ BUILDIN_FUNC(getnameditem)
|
||||
* groupranditem <group_num>{,<sub_group>};
|
||||
*------------------------------------------*/
|
||||
BUILDIN_FUNC(grouprandomitem) {
|
||||
struct s_item_group_entry *entry = NULL;
|
||||
int sub_group = 1;
|
||||
|
||||
FETCH(3, sub_group);
|
||||
entry = itemdb_get_randgroupitem(script_getnum(st,2),sub_group);
|
||||
std::shared_ptr<s_item_group_entry> entry = itemdb_group.get_random_entry(script_getnum(st,2),sub_group);
|
||||
if (!entry) {
|
||||
ShowError("buildin_grouprandomitem: Invalid item group with group_id '%d', sub_group '%d'.\n", script_getnum(st,2), sub_group);
|
||||
script_pushint(st,UNKNOWN_ITEM_ID);
|
||||
@@ -21846,7 +21845,6 @@ BUILDIN_FUNC(getrandgroupitem) {
|
||||
uint16 group, qty = 0;
|
||||
uint8 sub_group = 1;
|
||||
struct item item_tmp;
|
||||
struct s_item_group_entry *entry = NULL;
|
||||
|
||||
if (!script_charid2sd(6, sd))
|
||||
return SCRIPT_CMD_SUCCESS;
|
||||
@@ -21862,7 +21860,7 @@ BUILDIN_FUNC(getrandgroupitem) {
|
||||
FETCH(4, sub_group);
|
||||
FETCH(5, identify);
|
||||
|
||||
entry = itemdb_get_randgroupitem(group,sub_group);
|
||||
std::shared_ptr<s_item_group_entry> entry = itemdb_group.get_random_entry(group,sub_group);
|
||||
if (!entry)
|
||||
return SCRIPT_CMD_FAILURE; //ensure valid itemid
|
||||
|
||||
@@ -21908,7 +21906,7 @@ BUILDIN_FUNC(getgroupitem) {
|
||||
if (!script_charid2sd(4,sd))
|
||||
return SCRIPT_CMD_SUCCESS;
|
||||
|
||||
if (itemdb_pc_get_itemgroup(group_id, (script_hasdata(st, 3) ? script_getnum(st, 3) != 0 : false), sd)) {
|
||||
if (itemdb_group.pc_get_itemgroup(group_id, (script_hasdata(st, 3) ? script_getnum(st, 3) != 0 : false), sd)) {
|
||||
ShowError("buildin_getgroupitem: Invalid group id '%d' specified.\n",group_id);
|
||||
return SCRIPT_CMD_FAILURE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user