Skip to content

Commit

Permalink
Rebalance of SA_AUTOSPELL (Hindsight)
Browse files Browse the repository at this point in the history
- Autocast level changed
  - Old: The Bolt skills will vary in level from level 1 to 3
         The level 1 version will occur 50% of the time, level 2 35%,
           and level 3 at 15%
  - New: Levels of autocasted spells is the half of Hindsight level.
         If autocasted spells has lower level than half of Hindsight levels,
            actual skill level will be autocasted instead.
- Autocast chance changed
  - Old: 7% - 25%
  - New: (Skill Level x 2)%
- Usable skills changed
  - Old: Napalm Beat, Fire Bolt, Cold Bolt, Lightning Bolt,
         Soul Strike, Fire Ball, Frost Diver
  - New: Fire Bolt, Cold Bolt, Lightning Bolt, Soul Strike,
         Fire Ball, Earth Spike, Frost Diver, Thunderstorm, Heaven's Drive

From massive skills rebalance (1st/2nd/transclass) (2018.10.31)
  • Loading branch information
guilherme-gm committed Aug 24, 2023
1 parent f0fafa8 commit 1a90711
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 9 deletions.
19 changes: 14 additions & 5 deletions src/map/battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -6832,12 +6832,21 @@ static enum damage_lv battle_weapon_attack(struct block_list *src, struct block_
int sp = 0;
uint16 skill_id = sc->data[SC_AUTOSPELL]->val2;
uint16 skill_lv = sc->data[SC_AUTOSPELL]->val3;
int i = rnd()%100;
if (sc->data[SC_SOULLINK] && sc->data[SC_SOULLINK]->val2 == SL_SAGE)
#ifndef RENEWAL
int i = rnd() % 100;
if (sc->data[SC_SOULLINK] != NULL && sc->data[SC_SOULLINK]->val2 == SL_SAGE)
i = 0; //Max chance, no skill_lv reduction. [Skotlex]
if (i >= 50) skill_lv -= 2;
else if (i >= 15) skill_lv--;
if (skill_lv < 1) skill_lv = 1;

if (i >= 50)
skill_lv -= 2;
else if (i >= 15)
skill_lv--;
if (skill_lv < 1)
skill_lv = 1;
#else
if (sd != NULL && skill_lv > pc->checkskill(sd, skill_id))
skill_lv = pc->checkskill(sd, skill_id);
#endif
sp = skill->get_sp(skill_id,skill_lv) * 2 / 3;

if (status->charge(src, 0, sp)) {
Expand Down
38 changes: 36 additions & 2 deletions src/map/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -17910,6 +17910,7 @@ static int skill_autospell_list(const struct autospell_skill **list)
{
nullpo_retr(0, list);

#ifndef RENEWAL
// MUST be sorted by autospell_level (first field)
static const struct autospell_skill skills_list[] = {
{ 1, MG_NAPALMBEAT, { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 } },
Expand All @@ -17920,6 +17921,20 @@ 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 } },
};
#else
// MUST be sorted by autospell_level (first field)
static const struct autospell_skill skills_list[] = {
{ 1, MG_COLDBOLT },
{ 1, MG_FIREBOLT },
{ 1, MG_LIGHTNINGBOLT },
{ 4, MG_SOULSTRIKE },
{ 4, MG_FIREBALL },
{ 7, WZ_EARTHSPIKE },
{ 7, MG_FROSTDIVER },
{ 10, MG_THUNDERSTORM },
{ 10, WZ_HEAVENDRIVE },
};
#endif
static const int list_len = ARRAYLENGTH(skills_list);

#if PACKETVER_MAIN_NUM < 20181128 && PACKETVER_RE_NUM < 20181031
Expand Down Expand Up @@ -18000,7 +18015,18 @@ static void skill_autospell_select_spell(struct block_list *bl, int skill_lv)
skill_idx += rnd() % (upper_idx - lower_idx);

const struct autospell_skill *sk = (skills_list + skill_idx);
sc_start4(bl, bl, SC_AUTOSPELL, 100, skill_lv, sk->skill_id, sk->skill_lv[skill_lv - 1], 0,

int max_lv;
#ifndef RENEWAL
max_lv = sk->skill_lv[skill_lv - 1]
#else
// @TODO: Is this how AutoSpell works for non-players after rebalance? I made it the same as the player one...
max_lv = skill_lv / 2;
if (max_lv == 0)
max_lv = 1;
#endif

sc_start4(bl, bl, SC_AUTOSPELL, 100, skill_lv, sk->skill_id, max_lv, 0,
skill->get_time(SA_AUTOSPELL, skill_lv), SA_AUTOSPELL);
}

Expand Down Expand Up @@ -18034,7 +18060,15 @@ static int skill_autospell_spell_selected(struct map_session_data *sd, uint16 sk
if (sk->autospell_level > autospell_lv)
return 0; // Don't have enough level to use

int max_lv = sk->skill_lv[autospell_lv - 1];
int max_lv;
#ifndef RENEWAL
max_lv = sk->skill_lv[autospell_lv - 1];
#else
max_lv = autospell_lv / 2;
if (max_lv == 0)
max_lv = 1;
#endif

if (sd->sc.data[SC_SOULLINK] != NULL && sd->sc.data[SC_SOULLINK]->val2 == SL_SAGE) {
if (skill_id == MG_COLDBOLT || skill_id == MG_FIREBOLT || skill_id == MG_LIGHTNINGBOLT)
max_lv = 10; // Soul Linker bonus. [Skotlex]
Expand Down
2 changes: 2 additions & 0 deletions src/map/skill.h
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,9 @@ struct s_skill_db {
struct autospell_skill {
int autospell_level;
int skill_id;
#ifndef RENEWAL
int skill_lv[MAX_SKILL_LEVEL];
#endif
};

struct s_skill_unit_layout {
Expand Down
8 changes: 6 additions & 2 deletions src/map/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -7689,8 +7689,12 @@ static int status_change_start_sub(struct block_list *src, struct block_list *bl
case SC_AUTOSPELL:
//Val1 Skill LV of Autospell
//Val2 Skill ID to cast
//Val3 Max Lv to cast
val4 = 5 + val1*2; //Chance of casting
//Val3 Max Lv to cast (pre-re) / Lv to cast (zero)
#ifndef RENEWAL
val4 = 5 + val1 * 2; // Chance of casting
#else
val4 = 2 * val1; // Chance of casting
#endif
break;
case SC_VOLCANO:
#ifndef RENEWAL
Expand Down

0 comments on commit 1a90711

Please sign in to comment.