Skip to content

Commit

Permalink
Merge branch 'master' into rebalance
Browse files Browse the repository at this point in the history
Signed-off-by: Haru <haru@dotalux.com>
  • Loading branch information
MishimaHaruna committed May 25, 2024
2 parents 3c4fe7b + 7312ec2 commit 950c62d
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 33 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jaBote <jaBote@users.noreply.github.com>
jaBote <javote91@hotmail.com>
jaBote <j@bot.e>
Jackson <chadfield.jackson@gmail.com>
jasonch <31005928+jasonch35@users.noreply.github.com>
Jedzkie <jedzkie13@rocketmail.com>
Jenkijo <jenkijo@hrzn.community>
Jesusaves <cpntb1@ymail.com>
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,19 @@ All these changes only affect Renewal. Pre-renewal is unchanged.
- Damage formula changed
- Auto Blitz Beat no longer splits the damage among multiple targets

## [v2024.05] `May 2024`

### Changed

- Implemented official ATK % calculation for `BS_OVERTHRUST` in pre-renewal. Party members only receive 5% ATK bonus. (#3293)

### Fixed

- Fixed a missing initialization of the (m)atk/(m)def modifiers, resulting into 0 or 1 damage. (#3293, related to #3290)
- Fixed an incorrect call of `clif->updatestatus()` to non-player objects in relation to atk/def percent bonuses. (#3294, related to #3290)
- Fixed a failure on SCs from skills that don't have a `StatusChange` entry in their skill db entries after a `@reloadskilldb`, such as the spirit skills. (#3296, issue #3295)
- Fixed a compiler warning due to a missing case label when `SECURE_NPCTIMEOUT` is enabled. (#3297, issue #3197)

## [v2024.04] `April 2024`

### Added
Expand Down
2 changes: 1 addition & 1 deletion doc/constants_pre-re.md
Original file line number Diff line number Diff line change
Expand Up @@ -4880,7 +4880,7 @@
### Server defines

- `PACKETVER`: 20190530
- `HERCULES_VERSION`: 202404000
- `HERCULES_VERSION`: 202405000
- `MAX_LEVEL`: 175
- `MAX_STORAGE`: 600
- `MAX_GUILD_STORAGE`: 500
Expand Down
2 changes: 1 addition & 1 deletion doc/constants_re.md
Original file line number Diff line number Diff line change
Expand Up @@ -4878,7 +4878,7 @@
### Server defines

- `PACKETVER`: 20190530
- `HERCULES_VERSION`: 202404000
- `HERCULES_VERSION`: 202405000
- `MAX_LEVEL`: 175
- `MAX_STORAGE`: 600
- `MAX_GUILD_STORAGE`: 500
Expand Down
2 changes: 1 addition & 1 deletion src/config/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define CONFIG_CORE_H

/// Hercules version. From tag vYYYY.MM(+PPP) -> YYYYMMPPP
#define HERCULES_VERSION 202404000
#define HERCULES_VERSION 202405000

/// Max number of items on @autolootid list
#define AUTOLOOTITEM_SIZE 10
Expand Down
1 change: 1 addition & 0 deletions src/map/atcommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -3903,6 +3903,7 @@ ACMD(reloadmobdb)
ACMD(reloadskilldb)
{
skill->reload();
status->load_sc_type();
homun->reload_skill();
elemental->reload_skilldb();
mercenary->read_skilldb();
Expand Down
3 changes: 2 additions & 1 deletion src/map/npc.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ static int npc_rr_secure_timeout_timer(int tid, int64 tick, int id, intptr_t dat
case NPCT_MENU:
timeout = NPC_SECURE_TIMEOUT_MENU;
break;
//case NPCT_WAIT: var starts with this value
case NPCT_WAIT: //var starts with this value
break;
}

if( DIFF_TICK(tick,sd->npc_idle_tick) > (timeout*1000) ) {
Expand Down
72 changes: 43 additions & 29 deletions src/map/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,8 @@ static void initChangeTables(void)
memset(status->dbs->ChangeFlagTable, 0, sizeof(status->dbs->ChangeFlagTable));
memset(status->dbs->DisplayType, 0, sizeof(status->dbs->DisplayType));

// Storing the target job rather than simply SC_SOULLINK simplifies code later on.
skill->dbs->db[skill->get_index(SL_ALCHEMIST)].status_type = (sc_type)MAPID_ALCHEMIST;
skill->dbs->db[skill->get_index(SL_MONK)].status_type = (sc_type)MAPID_MONK;
skill->dbs->db[skill->get_index(SL_STAR)].status_type = (sc_type)MAPID_STAR_GLADIATOR;
skill->dbs->db[skill->get_index(SL_SAGE)].status_type = (sc_type)MAPID_SAGE;
skill->dbs->db[skill->get_index(SL_CRUSADER)].status_type = (sc_type)MAPID_CRUSADER;
skill->dbs->db[skill->get_index(SL_SUPERNOVICE)].status_type = (sc_type)MAPID_SUPER_NOVICE;
skill->dbs->db[skill->get_index(SL_KNIGHT)].status_type = (sc_type)MAPID_KNIGHT;
skill->dbs->db[skill->get_index(SL_WIZARD)].status_type = (sc_type)MAPID_WIZARD;
skill->dbs->db[skill->get_index(SL_PRIEST)].status_type = (sc_type)MAPID_PRIEST;
skill->dbs->db[skill->get_index(SL_BARDDANCER)].status_type = (sc_type)MAPID_BARDDANCER;
skill->dbs->db[skill->get_index(SL_ROGUE)].status_type = (sc_type)MAPID_ROGUE;
skill->dbs->db[skill->get_index(SL_ASSASIN)].status_type = (sc_type)MAPID_ASSASSIN;
skill->dbs->db[skill->get_index(SL_BLACKSMITH)].status_type = (sc_type)MAPID_BLACKSMITH;
skill->dbs->db[skill->get_index(SL_HUNTER)].status_type = (sc_type)MAPID_HUNTER;
skill->dbs->db[skill->get_index(SL_SOULLINKER)].status_type = (sc_type)MAPID_SOUL_LINKER;
status->load_sc_type();

#undef set_sc_with_vfx
}

Expand Down Expand Up @@ -3086,22 +3072,14 @@ static void status_calc_bl_main(struct block_list *bl, e_scb_flag flag)
;
}

if ((flag & SCB_ATK_PERC) != 0) {
int prev_atk_percent = st->atk_percent;
if ((flag & SCB_ATK_PERC) != 0)
st->atk_percent = status->calc_atk_percent(bl, sc);
if (prev_atk_percent != st->atk_percent)
clif->updatestatus(sd, SP_ATK1);
}

if ((flag & SCB_MATK_PERC) != 0)
st->matk_percent = status->calc_matk_percent(bl, sc);

if ((flag & SCB_DEF_PERC) != 0) {
int prev_def_percent = st->def_percent;
if ((flag & SCB_DEF_PERC) != 0)
st->def_percent = status->calc_def_percent(bl, sc);
if (prev_def_percent != st->def_percent)
clif->updatestatus(sd, SP_DEF2);
}

if ((flag & SCB_MDEF_PERC) != 0) {
st->mdef_percent = status->calc_mdef_percent(bl, sc);
Expand Down Expand Up @@ -3509,6 +3487,8 @@ static void status_calc_bl_(struct block_list *bl, e_scb_flag flag, enum e_statu
#endif
)
clif->updatestatus(sd,SP_ATK1);
else if (bst.atk_percent != st->atk_percent)
clif->updatestatus(sd, SP_ATK1);

if(bst.def != st->def) {
clif->updatestatus(sd,SP_DEF1);
Expand All @@ -3529,7 +3509,10 @@ static void status_calc_bl_(struct block_list *bl, e_scb_flag flag, enum e_statu
#ifdef RENEWAL
clif->updatestatus(sd,SP_DEF1);
#endif
} else if (bst.def_percent != st->def_percent) {
clif->updatestatus(sd,SP_DEF2);
}

if(bst.flee2 != st->flee2)
clif->updatestatus(sd,SP_FLEE2);
if(bst.cri != st->cri)
Expand Down Expand Up @@ -3898,6 +3881,11 @@ static void status_calc_misc(struct block_list *bl, struct status_data *st, int
st->mdef2 += st->int_ + (st->vit >> 1);
#endif // RENEWAL

st->atk_percent = 100;
st->matk_percent = 100;
st->def_percent = 100;
st->mdef_percent = 100;

if ( bl->type&battle_config.enable_critical )
st->cri += 10 + (st->luk * 10 / 3); // (every 1 luk = +0.33 critical -> 3 luk = +1 critical)
else
Expand Down Expand Up @@ -8413,13 +8401,18 @@ static int status_change_start_sub(struct block_list *src, struct block_list *bl
val2 = 20*val1; //Power increase
break;
case SC_OVERTHRUST:
// val2 holds if it was casted on self (1), or is bonus received from others (0)
#ifndef RENEWAL
val3 = 5 * val1; //Power increase
if (val2 == 1) // cast on self
val3 = 5 * val1; //Power increase
else // received cast
val3 = 5;
#else
// owner: 5, 10, 15, 20, 25
// party: 5, 5, 10, 10, 15
val3 = (val2 == 1 ? (5 * val1) : (5 + (val1 / 2) * 5)); // Power increase
if (val2 == 1) // cast on self
val3 = 5 * val1; // Power increase
else // received cast
val3 = 5 + (val1 / 2) * 5; // Power increase
#endif
if(sd && pc->checkskill(sd,BS_HILTBINDING)>0)
total_tick += total_tick / 10;
Expand Down Expand Up @@ -14119,6 +14112,26 @@ static void status_check_job_bonus(int idx, const char *name, int class)
}
}

static void status_load_sc_type(void)
{
// Storing the target job rather than simply SC_SOULLINK simplifies code later on.
skill->dbs->db[skill->get_index(SL_ALCHEMIST)].status_type = (sc_type)MAPID_ALCHEMIST;
skill->dbs->db[skill->get_index(SL_MONK)].status_type = (sc_type)MAPID_MONK;
skill->dbs->db[skill->get_index(SL_STAR)].status_type = (sc_type)MAPID_STAR_GLADIATOR;
skill->dbs->db[skill->get_index(SL_SAGE)].status_type = (sc_type)MAPID_SAGE;
skill->dbs->db[skill->get_index(SL_CRUSADER)].status_type = (sc_type)MAPID_CRUSADER;
skill->dbs->db[skill->get_index(SL_SUPERNOVICE)].status_type = (sc_type)MAPID_SUPER_NOVICE;
skill->dbs->db[skill->get_index(SL_KNIGHT)].status_type = (sc_type)MAPID_KNIGHT;
skill->dbs->db[skill->get_index(SL_WIZARD)].status_type = (sc_type)MAPID_WIZARD;
skill->dbs->db[skill->get_index(SL_PRIEST)].status_type = (sc_type)MAPID_PRIEST;
skill->dbs->db[skill->get_index(SL_BARDDANCER)].status_type = (sc_type)MAPID_BARDDANCER;
skill->dbs->db[skill->get_index(SL_ROGUE)].status_type = (sc_type)MAPID_ROGUE;
skill->dbs->db[skill->get_index(SL_ASSASIN)].status_type = (sc_type)MAPID_ASSASSIN;
skill->dbs->db[skill->get_index(SL_BLACKSMITH)].status_type = (sc_type)MAPID_BLACKSMITH;
skill->dbs->db[skill->get_index(SL_HUNTER)].status_type = (sc_type)MAPID_HUNTER;
skill->dbs->db[skill->get_index(SL_SOULLINKER)].status_type = (sc_type)MAPID_SOUL_LINKER;
}

static bool status_readdb_job2(char *fields[], int columns, int current)
{
int idx, class, i;
Expand Down Expand Up @@ -14885,6 +14898,7 @@ void status_defaults(void)
status->change_start_unknown_sc = status_change_start_unknown_sc;
status->display_remove = status_display_remove;
status->natural_heal = status_natural_heal;
status->load_sc_type = status_load_sc_type;
status->natural_heal_timer = status_natural_heal_timer;
status->readdb_job2 = status_readdb_job2;
status->readdb_sizefix = status_readdb_sizefix;
Expand Down
1 change: 1 addition & 0 deletions src/map/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -1517,6 +1517,7 @@ struct status_interface {
void (*display_remove) (struct map_session_data *sd, enum sc_type type);
int (*natural_heal) (struct block_list *bl, va_list args);
int (*natural_heal_timer) (int tid, int64 tick, int id, intptr_t data);
void (*load_sc_type) (void);
bool (*readdb_job2) (char *fields[], int columns, int current);
bool (*readdb_sizefix) (char *fields[], int columns, int current);
bool (*read_scdb_libconfig) (void);
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/HPMHooking/HPMHooking.Defs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9296,6 +9296,8 @@ typedef int (*HPMHOOK_pre_status_natural_heal) (struct block_list **bl, va_list
typedef int (*HPMHOOK_post_status_natural_heal) (int retVal___, struct block_list *bl, va_list args);
typedef int (*HPMHOOK_pre_status_natural_heal_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
typedef int (*HPMHOOK_post_status_natural_heal_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
typedef void (*HPMHOOK_pre_status_load_sc_type) (void);
typedef void (*HPMHOOK_post_status_load_sc_type) (void);
typedef bool (*HPMHOOK_pre_status_readdb_job2) (char **fields[], int *columns, int *current);
typedef bool (*HPMHOOK_post_status_readdb_job2) (bool retVal___, char *fields[], int columns, int current);
typedef bool (*HPMHOOK_pre_status_readdb_sizefix) (char **fields[], int *columns, int *current);
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7212,6 +7212,8 @@ struct {
struct HPMHookPoint *HP_status_natural_heal_post;
struct HPMHookPoint *HP_status_natural_heal_timer_pre;
struct HPMHookPoint *HP_status_natural_heal_timer_post;
struct HPMHookPoint *HP_status_load_sc_type_pre;
struct HPMHookPoint *HP_status_load_sc_type_post;
struct HPMHookPoint *HP_status_readdb_job2_pre;
struct HPMHookPoint *HP_status_readdb_job2_post;
struct HPMHookPoint *HP_status_readdb_sizefix_pre;
Expand Down Expand Up @@ -14787,6 +14789,8 @@ struct {
int HP_status_natural_heal_post;
int HP_status_natural_heal_timer_pre;
int HP_status_natural_heal_timer_post;
int HP_status_load_sc_type_pre;
int HP_status_load_sc_type_post;
int HP_status_readdb_job2_pre;
int HP_status_readdb_job2_post;
int HP_status_readdb_sizefix_pre;
Expand Down
1 change: 1 addition & 0 deletions src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3685,6 +3685,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(status->display_remove, HP_status_display_remove) },
{ HP_POP(status->natural_heal, HP_status_natural_heal) },
{ HP_POP(status->natural_heal_timer, HP_status_natural_heal_timer) },
{ HP_POP(status->load_sc_type, HP_status_load_sc_type) },
{ HP_POP(status->readdb_job2, HP_status_readdb_job2) },
{ HP_POP(status->readdb_sizefix, HP_status_readdb_sizefix) },
{ HP_POP(status->read_scdb_libconfig, HP_status_read_scdb_libconfig) },
Expand Down
26 changes: 26 additions & 0 deletions src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -96405,6 +96405,32 @@ int HP_status_natural_heal_timer(int tid, int64 tick, int id, intptr_t data) {
}
return retVal___;
}
void HP_status_load_sc_type(void) {
int hIndex = 0;
if (HPMHooks.count.HP_status_load_sc_type_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_status_load_sc_type_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_load_sc_type_pre[hIndex].func;
preHookFunc();
}
if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
HPMHooks.source.status.load_sc_type();
}
if (HPMHooks.count.HP_status_load_sc_type_post > 0) {
void (*postHookFunc) (void);
for (hIndex = 0; hIndex < HPMHooks.count.HP_status_load_sc_type_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_load_sc_type_post[hIndex].func;
postHookFunc();
}
}
return;
}
bool HP_status_readdb_job2(char *fields[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
Expand Down

0 comments on commit 950c62d

Please sign in to comment.