Skip to content

Commit

Permalink
add alternative list of skills for Auto Spell
Browse files Browse the repository at this point in the history
this loads pre-re autospell_db even on RENEWAL,
and is offered as an alternative for RE servers that
doesn't support more than 7 skills at once.
  • Loading branch information
guilherme-gm committed Oct 26, 2023
1 parent a34d121 commit 5a646e5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/config/classes/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@
**/
//#define DEVOTION_REFLECT_DAMAGE

/**
* When enabled, RENEWAL servers loads db/pre-re/autospell_db.conf instead of db/re/autospell_db.conf.
*
* This makes the autospell skill list and used levels follow Pre-RE version, but every other effect stays as renewal.
*
* More details:
* - Maximum used level of a skill will follow Pre-RE, instead of the half autospell level of RE
* - Bolt skills will stay at the maximum "enabled" level instead of random levels
*
* You may want to enable this if you have a client that can't support the list with more than 7 skills.
*/
//#define CLASSIC_AUTOSPELL_LIST

/**
* No settings past this point
**/
Expand Down
8 changes: 8 additions & 0 deletions src/map/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -25083,6 +25083,9 @@ static bool skill_read_autospell_db(const char *filename)
if (count > 7) {
ShowWarning("%s: Your current packet version only supports up to 7 autospell skills, but your autospell db contains \"%d\" skills. Some skills may not be shown.\n", __func__, count);
ShowWarning("%s: Update your packet version or reduce the number of skills to fix this warning.\n", __func__);
#ifdef RENEWAL
ShowWarning("%s: You may also enable CLASSIC_AUTOSPELL_LIST in general.h for an alternative skill list (Read the comment on it for details!!)\n", __func__);
#endif
}
#endif

Expand Down Expand Up @@ -25162,7 +25165,12 @@ static void skill_readdb(bool minimal)
sv->readdb(map->db_path, "magicmushroom_db.txt", ',', 1, 1, MAX_SKILL_MAGICMUSHROOM_DB, skill->parse_row_magicmushroomdb);
sv->readdb(map->db_path, "skill_improvise_db.txt", ',', 2, 2, MAX_SKILL_IMPROVISE_DB, skill->parse_row_improvisedb);
sv->readdb(map->db_path, "skill_changematerial_db.txt", ',', 4, 4+2*5, MAX_SKILL_PRODUCE_DB, skill->parse_row_changematerialdb);
#ifdef CLASSIC_AUTOSPELL_LIST // Force usage of pre-re autospell_db
skill->read_autospell_db(DBPATH_PRE "autospell_db.conf");
#else
skill->read_autospell_db(DBPATH "autospell_db.conf");
#endif

}

static void skill_reload(void)
Expand Down

0 comments on commit 5a646e5

Please sign in to comment.