summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-04 18:05:41 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-04 18:05:41 +0000
commitca8e7b4d7621570ee770dd6114eab9986f13accd (patch)
treefe0ed86847b3f9264d352d666fb1e6dcf3a54b6b /src
parent38fc07331284161a3833c295dfa3633d3eecfa66 (diff)
downloadhercules-ca8e7b4d7621570ee770dd6114eab9986f13accd.tar.gz
hercules-ca8e7b4d7621570ee770dd6114eab9986f13accd.tar.bz2
hercules-ca8e7b4d7621570ee770dd6114eab9986f13accd.tar.xz
hercules-ca8e7b4d7621570ee770dd6114eab9986f13accd.zip
Re-designed /db/ folder structure as previously discussed.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15390 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/itemdb.c17
-rw-r--r--src/map/map.c6
-rw-r--r--src/map/mob.c27
-rw-r--r--src/map/pc.c13
-rw-r--r--src/map/skill.c24
-rw-r--r--src/map/status.c8
6 files changed, 56 insertions, 39 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 48532dd60..972d351a5 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -566,8 +566,11 @@ static void itemdb_read_itemgroup_sub(const char* filename)
static void itemdb_read_itemgroup(void)
{
char path[256];
- snprintf(path, 255, "%s/item_group_db.txt", db_path);
-
+#if REMODE
+ snprintf(path, 255, "%s/re/item_group_db.txt", db_path);
+#else
+ snprintf(path, 255, "%s/pre-re/item_group_db.txt", db_path);
+#endif
memset(&itemgroup_db, 0, sizeof(itemgroup_db));
itemdb_read_itemgroup_sub(path);
ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n", "item_group_db.txt");
@@ -867,14 +870,14 @@ static bool itemdb_parse_dbrow(char** str, const char* source, int line, int scr
*------------------------------------------*/
static int itemdb_readdb(void)
{
- /**
- * ro-resources inheritance: item_db -> item_db_re -> item_db2 (user customs)
- **/
+ const char* filename[] = {
#if REMODE
- const char* filename[] = { "item_db.txt","item_db_re.txt","item_db2.txt" };
+ "re/item_db.txt",
#else
- const char* filename[] = { "item_db.txt","item_db2.txt" };
+ "pre-re/item_db.txt",
#endif
+ "item_db2.txt" };
+
int fi;
for( fi = 0; fi < ARRAYLENGTH(filename); ++fi )
diff --git a/src/map/map.c b/src/map/map.c
index 8f7f7efb2..c433857ec 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -3717,6 +3717,12 @@ int do_init(int argc, char *argv[])
}
map_config_read(MAP_CONF_NAME);
+#if REMODE
+ /**
+ * to make pre-re conflict safe
+ **/
+ map_config_read("npc/scripts_renewal.conf");
+#endif
chrif_checkdefaultlogin();
if (!map_ip_set || !char_ip_set) {
diff --git a/src/map/mob.c b/src/map/mob.c
index d76f1eac6..427b0ae5f 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -3679,11 +3679,13 @@ static bool mob_readdb_sub(char* fields[], int columns, int current)
static void mob_readdb(void)
{
+ const char* filename[] = {
#if REMODE
- const char* filename[] = { "mob_db.txt", "mob_db_re.txt" , "mob_db2.txt" };
+ "re/mob_db.txt",
#else
- const char* filename[] = { "mob_db.txt" , "mob_db2.txt" };
+ "pre-re/mob_db.txt",
#endif
+ "mob_db2.txt" };
int fi;
for( fi = 0; fi < ARRAYLENGTH(filename); ++fi )
@@ -3812,9 +3814,14 @@ static int mob_read_randommonster(void)
int i,j;
const char* mobfile[] = {
- "mob_branch.txt",
+#if REMODE
+ "re/mob_branch.txt",
+ "re/mob_boss.txt",
+#else
+ "pre-re/mob_branch.txt",
+ "pre-re/mob_boss.txt",
+#endif
"mob_poring.txt",
- "mob_boss.txt",
"mob_pouch.txt"};
memset(&summon, 0, sizeof(summon));
@@ -4247,16 +4254,14 @@ static bool mob_parse_row_mobskilldb(char** str, int columns, int current)
/*==========================================
* mob_skill_db.txt reading
*------------------------------------------*/
-static void mob_readskilldb(void)
-{
- /**
- * Due to the way mob_skill_db is made entries cannot be overriden, only stacked, so this is the only case we use a full db file on renewal
- **/
+static void mob_readskilldb(void) {
+ const char* filename[] = {
#if REMODE
- const char* filename[] = { "mob_skill_db_re.txt", "mob_skill_db2.txt" };
+ "re/mob_skill_db.txt",
#else
- const char* filename[] = { "mob_skill_db.txt", "mob_skill_db2.txt" };
+ "pre-re/mob_skill_db.txt",
#endif
+ "mob_skill_db2.txt" };
int fi;
if( battle_config.mob_skill_rate == 0 )
diff --git a/src/map/pc.c b/src/map/pc.c
index 9d0868c19..0a7d1c901 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -8249,9 +8249,9 @@ int pc_readdb(void)
for(k=0;k<ELE_MAX;k++)
attr_fix_table[i][j][k]=100;
#if REMODE
- sprintf(line, "%s/attr_fix_re.txt", db_path);
+ sprintf(line, "%s/re/attr_fix.txt", db_path);
#else
- sprintf(line, "%s/attr_fix.txt", db_path);
+ sprintf(line, "%s/pre-re/attr_fix.txt", db_path);
#endif
fp=fopen(line,"r");
if(fp==NULL){
@@ -8301,9 +8301,9 @@ int pc_readdb(void)
memset(statp,0,sizeof(statp));
i=1;
#if REMODE
- sprintf(line, "%s/statpoint_renewal.txt", db_path);
+ sprintf(line, "%s/re/statpoint.txt", db_path);
#else
- sprintf(line, "%s/statpoint.txt", db_path);
+ sprintf(line, "%s/pre-re/statpoint.txt", db_path);
#endif
fp=fopen(line,"r");
if(fp == NULL){
@@ -8323,11 +8323,8 @@ int pc_readdb(void)
i++;
}
fclose(fp);
- #if REMODE
- ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","statpoint_renewal.txt");
- #else
+
ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","statpoint.txt");
- #endif
}
// generate the remaining parts of the db if necessary
k = battle_config.use_statpoint_table; //save setting
diff --git a/src/map/skill.c b/src/map/skill.c
index 234620083..de6dd518b 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -14408,18 +14408,22 @@ static void skill_readdb(void)
// 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, "skill_db.txt" , ',', 17, 17, MAX_SKILL_DB, skill_parse_row_skilldb);
- sv_readdb(db_path, "skill_require_db.txt" , ',', 32, 32, MAX_SKILL_DB, skill_parse_row_requiredb);
- sv_readdb(db_path, "skill_cast_db.txt" , ',', 7, 7, MAX_SKILL_DB, skill_parse_row_castdb);
- sv_readdb(db_path, "skill_castnodex_db.txt", ',', 2, 3, MAX_SKILL_DB, skill_parse_row_castnodexdb);
- sv_readdb(db_path, "skill_nocast_db.txt" , ',', 2, 2, MAX_SKILL_DB, skill_parse_row_nocastdb);
- sv_readdb(db_path, "skill_unit_db.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_unitdb);
#if REMODE
- sv_readdb(db_path, "skill_db_re.txt" , ',', 17, 17, MAX_SKILL_DB, skill_parse_row_skilldb);
- sv_readdb(db_path, "skill_require_db_re.txt" , ',', 32, 32, MAX_SKILL_DB, skill_parse_row_requiredb);
- sv_readdb(db_path, "skill_cast_db_re.txt" , ',', 7, 7, MAX_SKILL_DB, skill_parse_row_castdb);
- sv_readdb(db_path, "skill_unit_db_re.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_unitdb);
+ sv_readdb(db_path, "re/skill_db.txt" , ',', 17, 17, MAX_SKILL_DB, skill_parse_row_skilldb);
+ sv_readdb(db_path, "re/skill_require_db.txt" , ',', 32, 32, MAX_SKILL_DB, skill_parse_row_requiredb);
+ sv_readdb(db_path, "re/skill_cast_db.txt" , ',', 7, 7, MAX_SKILL_DB, skill_parse_row_castdb);
+ sv_readdb(db_path, "re/skill_castnodex_db.txt", ',', 2, 3, MAX_SKILL_DB, skill_parse_row_castnodexdb);
+ sv_readdb(db_path, "re/skill_unit_db.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_unitdb);
+#else
+ sv_readdb(db_path, "pre-re/skill_db.txt" , ',', 17, 17, MAX_SKILL_DB, skill_parse_row_skilldb);
+ sv_readdb(db_path, "pre-re/skill_require_db.txt" , ',', 32, 32, MAX_SKILL_DB, skill_parse_row_requiredb);
+ sv_readdb(db_path, "pre-re/skill_cast_db.txt" , ',', 7, 7, MAX_SKILL_DB, skill_parse_row_castdb);
+ sv_readdb(db_path, "pre-re/skill_castnodex_db.txt", ',', 2, 3, MAX_SKILL_DB, skill_parse_row_castnodexdb);
+ sv_readdb(db_path, "pre-re/skill_unit_db.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_unitdb);
#endif
+
+ sv_readdb(db_path, "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);
diff --git a/src/map/status.c b/src/map/status.c
index 41642e78f..4649f4309 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -9545,12 +9545,14 @@ int status_readdb(void)
sv_readdb(db_path, "job_db1.txt", ',', 5+MAX_WEAPON_TYPE, 5+MAX_WEAPON_TYPE, -1, &status_readdb_job1);
sv_readdb(db_path, "job_db2.txt", ',', 1, 1+MAX_LEVEL, -1, &status_readdb_job2);
sv_readdb(db_path, "size_fix.txt", ',', MAX_WEAPON_TYPE, MAX_WEAPON_TYPE, ARRAYLENGTH(atkmods), &status_readdb_sizefix);
- sv_readdb(db_path, "refine_db.txt", ',', 3+MAX_REFINE+1, 3+MAX_REFINE+1, ARRAYLENGTH(percentrefinery), &status_readdb_refine);
-
#if REMODE
- sv_readdb(db_path, "job_db_re.txt", ',', 1+RE_JOB_DB_MAX, 1+RE_JOB_DB_MAX, -1, &status_readdb_job_re);
+ sv_readdb(db_path, "re/refine_db.txt", ',', 3+MAX_REFINE+1, 3+MAX_REFINE+1, ARRAYLENGTH(percentrefinery), &status_readdb_refine);
+ sv_readdb(db_path, "re/job_db_extra.txt", ',', 1+RE_JOB_DB_MAX, 1+RE_JOB_DB_MAX, -1, &status_readdb_job_re);
+#else
+ sv_readdb(db_path, "pre-re/refine_db.txt", ',', 3+MAX_REFINE+1, 3+MAX_REFINE+1, ARRAYLENGTH(percentrefinery), &status_readdb_refine);
#endif
+
return 0;
}