|
@@ -5172,7 +5172,6 @@ static void mob_skill_db_set(void) {
|
|
*/
|
|
*/
|
|
static void mob_load(void)
|
|
static void mob_load(void)
|
|
{
|
|
{
|
|
- int i;
|
|
|
|
const char* dbsubpath[] = {
|
|
const char* dbsubpath[] = {
|
|
"",
|
|
"",
|
|
"/" DBIMPORT,
|
|
"/" DBIMPORT,
|
|
@@ -5183,53 +5182,54 @@ static void mob_load(void)
|
|
mob_read_sqldb();
|
|
mob_read_sqldb();
|
|
mob_read_sqlskilldb();
|
|
mob_read_sqlskilldb();
|
|
}else{
|
|
}else{
|
|
- for(i=0; i<ARRAYLENGTH(dbsubpath); i++){
|
|
|
|
|
|
+ for(int i = 0; i < ARRAYLENGTH(dbsubpath); i++){
|
|
int n2 = strlen(db_path)+strlen(DBPATH)+strlen(dbsubpath[i])+1;
|
|
int n2 = strlen(db_path)+strlen(DBPATH)+strlen(dbsubpath[i])+1;
|
|
char* dbsubpath2 = (char*)aMalloc(n2+1);
|
|
char* dbsubpath2 = (char*)aMalloc(n2+1);
|
|
|
|
+ bool silent = i > 0;
|
|
|
|
|
|
- if( i == 0 ){
|
|
|
|
|
|
+ if( i == 0 ) {
|
|
safesnprintf(dbsubpath2,n2,"%s/%s%s",db_path,DBPATH,dbsubpath[i]);
|
|
safesnprintf(dbsubpath2,n2,"%s/%s%s",db_path,DBPATH,dbsubpath[i]);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
safesnprintf(dbsubpath2,n2,"%s%s",db_path,dbsubpath[i]);
|
|
safesnprintf(dbsubpath2,n2,"%s%s",db_path,dbsubpath[i]);
|
|
}
|
|
}
|
|
|
|
|
|
- sv_readdb(dbsubpath2, "mob_db.txt", ',', 31+2*MAX_MVP_DROP+2*MAX_MOB_DROP, 31+2*MAX_MVP_DROP+2*MAX_MOB_DROP, -1, &mob_readdb_sub, i);
|
|
|
|
|
|
+ sv_readdb(dbsubpath2, "mob_db.txt", ',', 31+2*MAX_MVP_DROP+2*MAX_MOB_DROP, 31+2*MAX_MVP_DROP+2*MAX_MOB_DROP, -1, &mob_readdb_sub, silent);
|
|
|
|
|
|
aFree(dbsubpath2);
|
|
aFree(dbsubpath2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- for(i=0; i<ARRAYLENGTH(dbsubpath); i++){
|
|
|
|
|
|
+ for(int i = 0; i < ARRAYLENGTH(dbsubpath); i++){
|
|
int n1 = strlen(db_path)+strlen(dbsubpath[i])+1;
|
|
int n1 = strlen(db_path)+strlen(dbsubpath[i])+1;
|
|
int n2 = strlen(db_path)+strlen(DBPATH)+strlen(dbsubpath[i])+1;
|
|
int n2 = strlen(db_path)+strlen(DBPATH)+strlen(dbsubpath[i])+1;
|
|
|
|
|
|
char* dbsubpath1 = (char*)aMalloc(n1+1);
|
|
char* dbsubpath1 = (char*)aMalloc(n1+1);
|
|
char* dbsubpath2 = (char*)aMalloc(n2+1);
|
|
char* dbsubpath2 = (char*)aMalloc(n2+1);
|
|
|
|
+ bool silent = i > 0;
|
|
|
|
|
|
if(i==0) {
|
|
if(i==0) {
|
|
safesnprintf(dbsubpath1,n1,"%s%s",db_path,dbsubpath[i]);
|
|
safesnprintf(dbsubpath1,n1,"%s%s",db_path,dbsubpath[i]);
|
|
safesnprintf(dbsubpath2,n2,"%s/%s%s",db_path,DBPATH,dbsubpath[i]);
|
|
safesnprintf(dbsubpath2,n2,"%s/%s%s",db_path,DBPATH,dbsubpath[i]);
|
|
- }
|
|
|
|
- else {
|
|
|
|
|
|
+ } else {
|
|
safesnprintf(dbsubpath1,n1,"%s%s",db_path,dbsubpath[i]);
|
|
safesnprintf(dbsubpath1,n1,"%s%s",db_path,dbsubpath[i]);
|
|
safesnprintf(dbsubpath2,n1,"%s%s",db_path,dbsubpath[i]);
|
|
safesnprintf(dbsubpath2,n1,"%s%s",db_path,dbsubpath[i]);
|
|
}
|
|
}
|
|
|
|
|
|
if( !db_use_sqldbs ){
|
|
if( !db_use_sqldbs ){
|
|
- mob_readskilldb(dbsubpath2,i);
|
|
|
|
|
|
+ mob_readskilldb(dbsubpath2, silent);
|
|
}
|
|
}
|
|
|
|
|
|
- sv_readdb(dbsubpath1, "mob_avail.txt", ',', 2, 12, -1, &mob_readdb_mobavail, i);
|
|
|
|
- sv_readdb(dbsubpath2, "mob_race2_db.txt", ',', 2, MAX_RACE2_MOBS, -1, &mob_readdb_race2, i);
|
|
|
|
- sv_readdb(dbsubpath1, "mob_item_ratio.txt", ',', 2, 2+MAX_ITEMRATIO_MOBS, -1, &mob_readdb_itemratio, i);
|
|
|
|
- sv_readdb(dbsubpath1, "mob_chat_db.txt", '#', 3, 3, MAX_MOB_CHAT, &mob_parse_row_chatdb, i);
|
|
|
|
- sv_readdb(dbsubpath2, "mob_random_db.txt", ',', 4, 4, -1, &mob_readdb_group, i );
|
|
|
|
- sv_readdb(dbsubpath2, "mob_branch.txt", ',', 4, 4, -1, &mob_readdb_group, i );
|
|
|
|
- sv_readdb(dbsubpath2, "mob_poring.txt", ',', 4, 4, -1, &mob_readdb_group, i );
|
|
|
|
- sv_readdb(dbsubpath2, "mob_boss.txt", ',', 4, 4, -1, &mob_readdb_group, i );
|
|
|
|
- sv_readdb(dbsubpath1, "mob_pouch.txt", ',', 4, 4, -1, &mob_readdb_group, i );
|
|
|
|
- sv_readdb(dbsubpath1, "mob_classchange.txt", ',', 4, 4, -1, &mob_readdb_group, i );
|
|
|
|
- sv_readdb(dbsubpath2, "mob_drop.txt", ',', 3, 5, -1, &mob_readdb_drop, i );
|
|
|
|
|
|
+ sv_readdb(dbsubpath1, "mob_avail.txt", ',', 2, 12, -1, &mob_readdb_mobavail,silent);
|
|
|
|
+ sv_readdb(dbsubpath2, "mob_race2_db.txt", ',', 2, MAX_RACE2_MOBS, -1, &mob_readdb_race2, silent);
|
|
|
|
+ sv_readdb(dbsubpath1, "mob_item_ratio.txt", ',', 2, 2+MAX_ITEMRATIO_MOBS, -1, &mob_readdb_itemratio, silent);
|
|
|
|
+ sv_readdb(dbsubpath1, "mob_chat_db.txt", '#', 3, 3, MAX_MOB_CHAT, &mob_parse_row_chatdb, silent);
|
|
|
|
+ sv_readdb(dbsubpath2, "mob_random_db.txt", ',', 4, 4, -1, &mob_readdb_group, silent);
|
|
|
|
+ sv_readdb(dbsubpath2, "mob_branch.txt", ',', 4, 4, -1, &mob_readdb_group, silent);
|
|
|
|
+ sv_readdb(dbsubpath2, "mob_poring.txt", ',', 4, 4, -1, &mob_readdb_group, silent);
|
|
|
|
+ sv_readdb(dbsubpath2, "mob_boss.txt", ',', 4, 4, -1, &mob_readdb_group, silent);
|
|
|
|
+ sv_readdb(dbsubpath1, "mob_pouch.txt", ',', 4, 4, -1, &mob_readdb_group, silent);
|
|
|
|
+ sv_readdb(dbsubpath1, "mob_classchange.txt", ',', 4, 4, -1, &mob_readdb_group, silent);
|
|
|
|
+ sv_readdb(dbsubpath2, "mob_drop.txt", ',', 3, 5, -1, &mob_readdb_drop, silent);
|
|
|
|
|
|
aFree(dbsubpath1);
|
|
aFree(dbsubpath1);
|
|
aFree(dbsubpath2);
|
|
aFree(dbsubpath2);
|