|
@@ -18971,8 +18971,14 @@ static bool skill_parse_row_skilldamage(char* split[], int columns, int current)
|
|
|
* create_arrow_db.txt
|
|
|
* abra_db.txt
|
|
|
*------------------------------*/
|
|
|
-static void skill_readdb(void)
|
|
|
-{
|
|
|
+static void skill_readdb(void) {
|
|
|
+ int i;
|
|
|
+ const char* dbsubpath[] = {
|
|
|
+ "",
|
|
|
+ "import"
|
|
|
+ //add other path here
|
|
|
+ };
|
|
|
+
|
|
|
// init skill db structures
|
|
|
db_clear(skilldb_name2id);
|
|
|
memset(skill_db,0,sizeof(skill_db));
|
|
@@ -18982,38 +18988,49 @@ static void skill_readdb(void)
|
|
|
memset(skill_spellbook_db,0,sizeof(skill_spellbook_db));
|
|
|
memset(skill_magicmushroom_db,0,sizeof(skill_magicmushroom_db));
|
|
|
memset(skill_changematerial_db,0,sizeof(skill_changematerial_db));
|
|
|
-
|
|
|
// load skill databases
|
|
|
safestrncpy(skill_db[0].name, "UNKNOWN_SKILL", sizeof(skill_db[0].name));
|
|
|
safestrncpy(skill_db[0].desc, "Unknown Skill", sizeof(skill_db[0].desc));
|
|
|
|
|
|
- sv_readdb(db_path, DBPATH"skill_db.txt" , ',', 18, 18, MAX_SKILL_DB, skill_parse_row_skilldb);
|
|
|
- sv_readdb(db_path, DBPATH"skill_require_db.txt" , ',', 34, 34, MAX_SKILL_DB, skill_parse_row_requiredb);
|
|
|
+ for(i=0; i<ARRAYLENGTH(dbsubpath); i++){
|
|
|
+ int n1 = strlen(db_path)+strlen(dbsubpath[i])+1;
|
|
|
+ int n2 = strlen(db_path)+strlen(DBPATH)+strlen(dbsubpath[i])+1;
|
|
|
+ char* dbsubpath1 = aMalloc(n1+1);
|
|
|
+ char* dbsubpath2 = aMalloc(n2+1);
|
|
|
+ safesnprintf(dbsubpath1,n1+1,"%s/%s",db_path,dbsubpath[i]);
|
|
|
+ if(i==0) safesnprintf(dbsubpath2,n2,"%s/%s%s",db_path,DBPATH,dbsubpath[i]);
|
|
|
+ else safesnprintf(dbsubpath2,n2,"%s/%s",db_path,dbsubpath[i]);
|
|
|
+
|
|
|
+ sv_readdb(dbsubpath2, "skill_db.txt" , ',', 18, 18, MAX_SKILL_DB, skill_parse_row_skilldb, i);
|
|
|
+ sv_readdb(dbsubpath2, "skill_require_db.txt" , ',', 34, 34, MAX_SKILL_DB, skill_parse_row_requiredb, i);
|
|
|
#ifdef RENEWAL_CAST
|
|
|
- sv_readdb(db_path, "re/skill_cast_db.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_castdb);
|
|
|
+ sv_readdb(dbsubpath1, "re/skill_cast_db.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_castdb, i);
|
|
|
#else
|
|
|
- sv_readdb(db_path, "pre-re/skill_cast_db.txt" , ',', 7, 7, MAX_SKILL_DB, skill_parse_row_castdb);
|
|
|
+ sv_readdb(dbsubpath1, "pre-re/skill_cast_db.txt" , ',', 7, 7, MAX_SKILL_DB, skill_parse_row_castdb, i);
|
|
|
#endif
|
|
|
- sv_readdb(db_path, DBPATH"skill_castnodex_db.txt", ',', 2, 3, MAX_SKILL_DB, skill_parse_row_castnodexdb);
|
|
|
- sv_readdb(db_path, DBPATH"skill_unit_db.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_unitdb);
|
|
|
-
|
|
|
- sv_readdb(db_path, DBPATH"skill_nocast_db.txt" , ',', 2, 2, MAX_SKILL_DB, skill_parse_row_nocastdb);
|
|
|
-
|
|
|
- skill_init_unit_layout();
|
|
|
- sv_readdb(db_path, "produce_db.txt" , ',', 4, 4+2*MAX_PRODUCE_RESOURCE, MAX_SKILL_PRODUCE_DB, skill_parse_row_producedb);
|
|
|
- sv_readdb(db_path, "create_arrow_db.txt" , ',', 1+2, 1+2*MAX_ARROW_RESOURCE, MAX_SKILL_ARROW_DB, skill_parse_row_createarrowdb);
|
|
|
- sv_readdb(db_path, "abra_db.txt" , ',', 3, 3, MAX_SKILL_ABRA_DB, skill_parse_row_abradb);
|
|
|
- //Warlock
|
|
|
- sv_readdb(db_path, "spellbook_db.txt" , ',', 3, 3, MAX_SKILL_SPELLBOOK_DB, skill_parse_row_spellbookdb);
|
|
|
- //Guillotine Cross
|
|
|
- sv_readdb(db_path, "magicmushroom_db.txt" , ',', 1, 1, MAX_SKILL_MAGICMUSHROOM_DB, skill_parse_row_magicmushroomdb);
|
|
|
- sv_readdb(db_path, "skill_copyable_db.txt" , ',', 2, 4, MAX_SKILL_DB, skill_parse_row_copyabledb);
|
|
|
- sv_readdb(db_path, "skill_improvise_db.txt" , ',', 2, 2, MAX_SKILL_IMPROVISE_DB, skill_parse_row_improvisedb);
|
|
|
- sv_readdb(db_path, "skill_changematerial_db.txt" , ',', 4, 4+2*5, MAX_SKILL_PRODUCE_DB, skill_parse_row_changematerialdb);
|
|
|
- sv_readdb(db_path, "skill_nonearnpc_db.txt" , ',', 2, 3, MAX_SKILL_DB, skill_parse_row_nonearnpcrangedb);
|
|
|
+ sv_readdb(dbsubpath2, "skill_castnodex_db.txt", ',', 2, 3, MAX_SKILL_DB, skill_parse_row_castnodexdb, i);
|
|
|
+ sv_readdb(dbsubpath2, "skill_unit_db.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_unitdb, i);
|
|
|
+ sv_readdb(dbsubpath2, "skill_nocast_db.txt" , ',', 2, 2, MAX_SKILL_DB, skill_parse_row_nocastdb, i);
|
|
|
+
|
|
|
+ sv_readdb(dbsubpath1, "produce_db.txt" , ',', 4, 4+2*MAX_PRODUCE_RESOURCE, MAX_SKILL_PRODUCE_DB, skill_parse_row_producedb, i);
|
|
|
+ sv_readdb(dbsubpath1, "create_arrow_db.txt" , ',', 1+2, 1+2*MAX_ARROW_RESOURCE, MAX_SKILL_ARROW_DB, skill_parse_row_createarrowdb, i);
|
|
|
+ sv_readdb(dbsubpath1, "abra_db.txt" , ',', 3, 3, MAX_SKILL_ABRA_DB, skill_parse_row_abradb, i);
|
|
|
+ //Warlock
|
|
|
+ sv_readdb(dbsubpath1, "spellbook_db.txt" , ',', 3, 3, MAX_SKILL_SPELLBOOK_DB, skill_parse_row_spellbookdb, i);
|
|
|
+ //Guillotine Cross
|
|
|
+ sv_readdb(dbsubpath1, "magicmushroom_db.txt" , ',', 1, 1, MAX_SKILL_MAGICMUSHROOM_DB, skill_parse_row_magicmushroomdb, i);
|
|
|
+ sv_readdb(dbsubpath1, "skill_copyable_db.txt" , ',', 2, 4, MAX_SKILL_DB, skill_parse_row_copyabledb, i);
|
|
|
+ sv_readdb(dbsubpath1, "skill_improvise_db.txt" , ',', 2, 2, MAX_SKILL_IMPROVISE_DB, skill_parse_row_improvisedb, i);
|
|
|
+ sv_readdb(dbsubpath1, "skill_changematerial_db.txt" , ',', 4, 4+2*5, MAX_SKILL_PRODUCE_DB, skill_parse_row_changematerialdb, i);
|
|
|
+ sv_readdb(dbsubpath1, "skill_nonearnpc_db.txt" , ',', 2, 3, MAX_SKILL_DB, skill_parse_row_nonearnpcrangedb, i);
|
|
|
#ifdef ADJUST_SKILL_DAMAGE
|
|
|
- sv_readdb(db_path, "skill_damage_db.txt" , ',', 4, 7, MAX_SKILL_DB, skill_parse_row_skilldamage);
|
|
|
+ sv_readdb(dbsubpath1, "skill_damage_db.txt" , ',', 4, 7, MAX_SKILL_DB, skill_parse_row_skilldamage, i);
|
|
|
#endif
|
|
|
+ aFree(dbsubpath1);
|
|
|
+ aFree(dbsubpath2);
|
|
|
+ }
|
|
|
+
|
|
|
+ skill_init_unit_layout();
|
|
|
}
|
|
|
|
|
|
void skill_reload (void) {
|