Shikazu 11 Posted May 30, 2013 Hey guys, i would suggest, that we fix something in the database (flat file & sql). An Update which added a new field to the database ruined the database template : Line 943/** * [RRInd] * For backwards compatibility, in Renewal mode, MATK from weapons comes from the atk slot * We use a ':' delimiter which, if not found, assumes the weapon does not provide any matk. **/void itemdb_re_split_atoi(char *str, int *atk, int *matk) { int i, val[2]; for (i=0; i<2; i++) { if (!str) break; val[i] = atoi(str); str = strchr(str,':'); if (str) *str++=0; } if( i == 0 ) { *atk = *matk = 0; return;//no data found } if( i == 1 ) {//Single Value, we assume it's the ATK *atk = val[0]; *matk = 0; return; } //We assume we have 2 values. *atk = val[0]; *matk = val[1]; return;} This is wasting a lot of cycle times for nothing and there could easily be a new database column that takes matk instead of appending it as string to attack.. just change the structure "item_data" in /src/map/itemdb.h struct item_data { uint16 nameid; char name[ITEM_NAME_LENGTH],jname[ITEM_NAME_LENGTH]; //Do not add stuff between value_buy and view_id (see how getiteminfo works) int value_buy; int value_sell; int type; int maxchance; //For logs, for external game info, for scripts: Max drop chance of this item (e.g. 0.01% , etc.. if it = 0, then monsters don't drop it, -1 denotes items sold in shops only) [Lupus] int sex; int equip; int weight; int atk; int def; int range;... to struct item_data { uint16 nameid; char name[ITEM_NAME_LENGTH],jname[ITEM_NAME_LENGTH]; //Do not add stuff between value_buy and view_id (see how getiteminfo works) int value_buy; int value_sell; int type; int maxchance; //For logs, for external game info, for scripts: Max drop chance of this item (e.g. 0.01% , etc.. if it = 0, then monsters don't drop it, -1 denotes items sold in shops only) [Lupus] int sex; int equip; int weight; int atk; int matk; int def; int range;... and then the database reader (just have not much time to explain, cause its 1:16am) If i should do that, just let me know ~Shikazu Share this post Link to post Share on other sites
Ind 945 Posted May 31, 2013 Thank you for your suggestion, we have been discussing the item db format for a while and should we move on with it this issue will be solved, this will be pending till we're done discussing it Share this post Link to post Share on other sites
Euphy 5 Posted May 31, 2013 The rationale behind this, I'm guessing, is that you'd end up with a lot of zeroes otherwise. Share this post Link to post Share on other sites
Shikazu 11 Posted June 1, 2013 if it's because of the zeroes, then the database needs to be rewritten Share this post Link to post Share on other sites
jaBote 438 Posted June 20, 2013 Moving to Accepted Suggestions since this has already been implemented. Share this post Link to post Share on other sites