Converted item database to YAML (#4335)

* Combines item_avail, item_buyingstore, item_delay, item_flag, item_nouse, item_stack, and item_trade databases into one.
* General cleanups and optimizations.
* Includes CSV2YAML conversion tool.
* Includes YAML2SQL conversion tool.
* Adjusts dummy_item from being created by malloc and now creates it by make_shared.
* Item combos are now stored as a STL.
Thanks to @Lemongrass3110, @Atemo, and @cydh!
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
Aleos
2020-10-21 19:02:11 -04:00
committed by GitHub
parent 323db7e661
commit 04cfe17b2b
96 changed files with 293974 additions and 56096 deletions

View File

@@ -2643,7 +2643,7 @@ static void clif_addcards( struct EQUIPSLOTINFO* buf, struct item* item ){
int i = 0, j;
// Client only receives four cards.. so randomly send them a set of cards. [Skotlex]
if( MAX_SLOTS > 4 && ( j = itemdb_slot( item->nameid ) ) > 4 ){
if( MAX_SLOTS > 4 && ( j = itemdb_slots( item->nameid ) ) > 4 ){
i = rnd() % ( j - 3 ); //eg: 6 slots, possible i values: 0->3, 1->4, 2->5 => i = rnd()%3;
}
@@ -6767,8 +6767,8 @@ void clif_use_card(struct map_session_data *sd,int idx)
if(sd->inventory_data[i]->type == IT_ARMOR && (ep & EQP_ACC) && ((ep & EQP_ACC) != EQP_ACC) && ((sd->inventory_data[i]->equip & EQP_ACC) != (ep & EQP_ACC)) ) // specific accessory-card can only be inserted to specific accessory.
continue;
ARR_FIND( 0, sd->inventory_data[i]->slot, j, sd->inventory.u.items_inventory[i].card[j] == 0 );
if( j == sd->inventory_data[i]->slot ) // No room
ARR_FIND( 0, sd->inventory_data[i]->slots, j, sd->inventory.u.items_inventory[i].card[j] == 0 );
if( j == sd->inventory_data[i]->slots ) // No room
continue;
if( sd->inventory.u.items_inventory[i].equip > 0 ) // Do not check items that are already equipped
@@ -6965,7 +6965,7 @@ void clif_item_refine_list( struct map_session_data *sd ){
int count = 0;
for( int i = 0; i < MAX_INVENTORY; i++ ){
unsigned char wlv;
uint16 wlv;
if( sd->inventory.u.items_inventory[i].nameid > 0 && sd->inventory.u.items_inventory[i].refine < skill_lv &&
sd->inventory.u.items_inventory[i].identify && ( wlv = itemdb_wlv(sd->inventory.u.items_inventory[i].nameid ) ) >= 1 &&
@@ -16538,7 +16538,7 @@ void clif_parse_Auction_register(int fd, struct map_session_data *sd)
return;
}
safestrncpy(auction.item_name, item->jname, sizeof(auction.item_name));
safestrncpy(auction.item_name, item->ename.c_str(), sizeof(auction.item_name));
auction.type = item->type;
memcpy(&auction.item, &sd->inventory.u.items_inventory[sd->auction.index], sizeof(struct item));
auction.item.amount = 1;