Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Browse files Browse the repository at this point in the history
  • Loading branch information
csnv committed May 27, 2024
2 parents 0a870fa + 7312ec2 commit c9aac01
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 20 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 @@ -22,6 +22,19 @@ If you are reading this in a text editor, simply ignore this section
### Removed
-->

## [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 @@ -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 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
39 changes: 23 additions & 16 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 @@ -13996,6 +13982,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 @@ -14761,6 +14767,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 @@ -1515,6 +1515,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 @@ -9300,6 +9300,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 @@ -7216,6 +7216,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 @@ -14795,6 +14797,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 @@ -3687,6 +3687,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 @@ -96459,6 +96459,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 c9aac01

Please sign in to comment.