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 applies the list of skills from Pre-RE into RE,
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 Aug 24, 2023
1 parent 1a90711 commit 4ca91a1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/config/classes/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@
**/
//#define DEVOTION_REFLECT_DAMAGE

/**
* When enabled, the list of usable skills in Auto Spell (Hindsight) for renewal servers follows
* the list from Pre-RE servers.
*
* This only applies for the "unlocked" skills. The used level and other effects still follows
* Renewal.
*
* 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
18 changes: 17 additions & 1 deletion src/map/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -17921,6 +17921,22 @@ static int skill_autospell_list(const struct autospell_skill **list)
{ 8, MG_FIREBALL, { 0, 0, 0, 0, 0, 0, 0, 1, 2, 2 } },
{ 10, MG_FROSTDIVER, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } },
};
#elif defined(CLASSIC_AUTOSPELL_LIST)
/* Renewal structure/effect with pre-re skill list.
* This is a custom alternative for RENEWAL servers that doesn't support more than 7 skills
* but can't migrate to a newer client right now.
*/

// MUST be sorted by autospell_level (first field)
static const struct autospell_skill skills_list[] = {
{ 1, MG_NAPALMBEAT },
{ 2, MG_COLDBOLT },
{ 2, MG_FIREBOLT },
{ 2, MG_LIGHTNINGBOLT },
{ 5, MG_SOULSTRIKE },
{ 8, MG_FIREBALL },
{ 10, MG_FROSTDIVER },
};
#else
// MUST be sorted by autospell_level (first field)
static const struct autospell_skill skills_list[] = {
Expand All @@ -17939,7 +17955,7 @@ static int skill_autospell_list(const struct autospell_skill **list)

#if PACKETVER_MAIN_NUM < 20181128 && PACKETVER_RE_NUM < 20181031
STATIC_ASSERT(ARRAYLENGTH(skills_list) <= 7,
"Older clients only supports AutoSpell list with up to 7 skills. Customize the list above or update your client.");
"Older clients only supports AutoSpell list with up to 7 skills. Customize the list above, update your client or consider using CLASSIC_AUTOSPELL_LIST.");
#endif

*list = skills_list;
Expand Down

0 comments on commit 4ca91a1

Please sign in to comment.