diff options
-rw-r--r-- | conf/map/battle/guild.conf | 9 | ||||
-rw-r--r-- | src/map/battle.c | 2 | ||||
-rw-r--r-- | src/map/guild.c | 4 | ||||
-rw-r--r-- | src/map/map.c | 5 | ||||
-rw-r--r-- | src/map/map.h | 2 | ||||
-rw-r--r-- | src/map/pc.c | 180 | ||||
-rw-r--r-- | src/map/pc.h | 8 | ||||
-rw-r--r-- | src/map/script.c | 10 | ||||
-rw-r--r-- | src/map/skill.c | 16 | ||||
-rw-r--r-- | src/map/skill.h | 4 | ||||
-rw-r--r-- | src/map/status.c | 19 | ||||
-rw-r--r-- | src/map/status.h | 1 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 22 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 36 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 9 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 256 |
16 files changed, 493 insertions, 90 deletions
diff --git a/conf/map/battle/guild.conf b/conf/map/battle/guild.conf index c8f8db8c3..90282ef53 100644 --- a/conf/map/battle/guild.conf +++ b/conf/map/battle/guild.conf @@ -39,10 +39,11 @@ guild_exp_limit: 50 // Maximum castles one guild can own (0 = unlimited) guild_max_castles: 0 -// Restart guild skills cooldown by relog? (Note 1) -// When false, you relog with the same cooldown remaining as from when you -// logged out, true restarts the cooldown upon login to its full duration. -guild_skill_relog_delay: false +// How guild skills cooldown works? +// 0 - you relog with the same cooldown remaining as from when you logged out +// 1 - restarts the cooldown upon login to its full duration. +// 2 - like 1, but your logged off time is also decreased from the remaining cooldown (Aegis) +guild_skill_relog_delay: 2 // Damage adjustments for WOE battles against defending Guild monsters (Note 2) castle_defense_rate: 100 diff --git a/src/map/battle.c b/src/map/battle.c index 2eddee0e2..f257f3c84 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -6954,7 +6954,7 @@ static const struct battle_data { { "chase_range_rate", &battle_config.chase_range_rate, 100, 0, INT_MAX, }, { "gtb_sc_immunity", &battle_config.gtb_sc_immunity, 50, 0, INT_MAX, }, { "guild_max_castles", &battle_config.guild_max_castles, 0, 0, INT_MAX, }, - { "guild_skill_relog_delay", &battle_config.guild_skill_relog_delay, 0, 0, 1, }, + { "guild_skill_relog_delay", &battle_config.guild_skill_relog_delay, 0, 0, 2, }, { "emergency_call", &battle_config.emergency_call, 11, 0, 31, }, { "atcommand_spawn_quantity_limit", &battle_config.atc_spawn_quantity_limit, 100, 0, INT_MAX, }, { "atcommand_slave_clone_limit", &battle_config.atc_slave_clone_limit, 25, 0, INT_MAX, }, diff --git a/src/map/guild.c b/src/map/guild.c index d33df5e08..d9833a2f4 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -552,7 +552,7 @@ int guild_recv_info(const struct guild *sg) if ((sd = map->nick2sd(sg->master)) != NULL) { //If the guild master is online the first time the guild_info is received, //that means he was the first to join, so apply guild skill blocking here. - if( battle_config.guild_skill_relog_delay ) + if( battle_config.guild_skill_relog_delay == 1) guild->block_skill(sd, 300000); //Also set the guild master flag. @@ -760,7 +760,7 @@ void guild_member_joined(struct map_session_data *sd) // set the Guild Master flag sd->state.gmaster_flag = 1; // prevent Guild Skills from being used directly after relog - if( battle_config.guild_skill_relog_delay ) + if( battle_config.guild_skill_relog_delay == 1 ) guild->block_skill(sd, 300000); } i = guild->getindex(g, sd->status.account_id, sd->status.char_id); diff --git a/src/map/map.c b/src/map/map.c index 780e6f535..90b304865 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -3166,13 +3166,13 @@ void map_iwall_get(struct map_session_data *sd) dbi_destroy(iter); } -void map_iwall_remove(const char *wall_name) +bool map_iwall_remove(const char *wall_name) { struct iwall_data *iwall; int16 i, x1, y1; if( (iwall = (struct iwall_data *)strdb_get(map->iwall_db, wall_name)) == NULL ) - return; // Nothing to do + return false; for( i = 0; i < iwall->size; i++ ) { map->iwall_nextxy(iwall->x, iwall->y, iwall->dir, i, &x1, &y1); @@ -3185,6 +3185,7 @@ void map_iwall_remove(const char *wall_name) map->list[iwall->m].iwall_num--; strdb_remove(map->iwall_db, iwall->wall_name); + return true; } /** diff --git a/src/map/map.h b/src/map/map.h index 5c4c6d59d..d6afdc160 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -1293,7 +1293,7 @@ END_ZEROED_BLOCK; bool (*iwall_set) (int16 m, int16 x, int16 y, int size, int8 dir, bool shootable, const char* wall_name); void (*iwall_get) (struct map_session_data *sd); - void (*iwall_remove) (const char *wall_name); + bool (*iwall_remove) (const char *wall_name); int (*addmobtolist) (unsigned short m, struct spawn_data *spawn); // [Wizputer] void (*spawnmobs) (int16 m); // [Wizputer] diff --git a/src/map/pc.c b/src/map/pc.c index ee1fcd7da..8dd216f55 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -249,11 +249,18 @@ int pc_addspiritball(struct map_session_data *sd,int interval,int max) memmove(sd->spirit_timer+i+1, sd->spirit_timer+i, (sd->spiritball-i)*sizeof(int)); sd->spirit_timer[i] = tid; sd->spiritball++; + pc->addspiritball_sub(sd); + + return 0; +} + +int pc_addspiritball_sub(struct map_session_data *sd) +{ + nullpo_ret(sd); if ((sd->job & MAPID_THIRDMASK) == MAPID_ROYAL_GUARD) clif->millenniumshield(&sd->bl,sd->spiritball); else clif->spiritball(&sd->bl); - return 0; } @@ -287,14 +294,22 @@ int pc_delspiritball(struct map_session_data *sd,int count,int type) sd->spirit_timer[i] = INVALID_TIMER; } - if(!type) { - if ((sd->job & MAPID_THIRDMASK) == MAPID_ROYAL_GUARD) - clif->millenniumshield(&sd->bl,sd->spiritball); - else - clif->spiritball(&sd->bl); + if (!type) { + pc->delspiritball_sub(sd); } return 0; } + +int pc_delspiritball_sub(struct map_session_data *sd) +{ + nullpo_ret(sd); + if ((sd->job & MAPID_THIRDMASK) == MAPID_ROYAL_GUARD) + clif->millenniumshield(&sd->bl,sd->spiritball); + else + clif->spiritball(&sd->bl); + return 0; +} + int pc_check_banding(struct block_list *bl, va_list ap) { int *c, *b_sd; @@ -1586,6 +1601,30 @@ int pc_calc_skillpoint(struct map_session_data* sd) { return skill_point; } +void pc_calc_skilltree_clear(struct map_session_data *sd) +{ + int i; + + nullpo_retv(sd); + + for (i = 0; i < MAX_SKILL_DB; i++) { + if (sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED && sd->status.skill[i].flag != SKILL_FLAG_PERM_GRANTED) //Don't touch these + sd->status.skill[i].id = 0; //First clear skills. + /* permanent skills that must be re-checked */ + if (sd->status.skill[i].flag == SKILL_FLAG_PERMANENT) { + switch (skill->dbs->db[i].nameid) { + case NV_TRICKDEAD: + if ((sd->job & MAPID_UPPERMASK) != MAPID_NOVICE) { + sd->status.skill[i].id = 0; + sd->status.skill[i].lv = 0; + sd->status.skill[i].flag = 0; + } + break; + } + } + } +} + /*========================================== * Calculation of skill level. *------------------------------------------*/ @@ -1604,22 +1643,7 @@ int pc_calc_skilltree(struct map_session_data *sd) } classidx = pc->class2idx(class); - for (i = 0; i < MAX_SKILL_DB; i++) { - if( sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED && sd->status.skill[i].flag != SKILL_FLAG_PERM_GRANTED ) //Don't touch these - sd->status.skill[i].id = 0; //First clear skills. - /* permanent skills that must be re-checked */ - if( sd->status.skill[i].flag == SKILL_FLAG_PERMANENT ) { - switch( skill->dbs->db[i].nameid ) { - case NV_TRICKDEAD: - if ((sd->job & MAPID_UPPERMASK) != MAPID_NOVICE) { - sd->status.skill[i].id = 0; - sd->status.skill[i].lv = 0; - sd->status.skill[i].flag = 0; - } - break; - } - } - } + pc->calc_skilltree_clear(sd); for (i = 0; i < MAX_SKILL_DB; i++) { if( sd->status.skill[i].flag != SKILL_FLAG_PERMANENT && sd->status.skill[i].flag != SKILL_FLAG_PERM_GRANTED && sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED ) @@ -1746,6 +1770,19 @@ int pc_calc_skilltree(struct map_session_data *sd) } } while(flag); + pc->calc_skilltree_bonus(sd, classidx); + + return 0; +} + +void pc_calc_skilltree_bonus(struct map_session_data *sd, int classidx) +{ + int i; + int id = 0; + + nullpo_retv(sd); + Assert_retv(classidx >= 0 && classidx < CLASS_COUNT); + // if (classidx > 0 && (sd->job & MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && sd->status.skill_point == 0 @@ -1771,8 +1808,6 @@ int pc_calc_skilltree(struct map_session_data *sd) sd->status.skill[idx].lv = skill->tree_get_max(id, sd->status.class); } } - - return 0; } //Checks if you can learn a new skill after having leveled up a skill. @@ -6788,18 +6823,7 @@ int pc_checkbaselevelup(struct map_session_data *sd) status_calc_pc(sd,SCO_FORCE); status_percent_heal(&sd->bl,100,100); - if ((sd->job & MAPID_UPPERMASK) == MAPID_SUPER_NOVICE) { - sc_start(NULL,&sd->bl,status->skill2sc(PR_KYRIE),100,1,skill->get_time(PR_KYRIE,1)); - sc_start(NULL,&sd->bl,status->skill2sc(PR_IMPOSITIO),100,1,skill->get_time(PR_IMPOSITIO,1)); - sc_start(NULL,&sd->bl,status->skill2sc(PR_MAGNIFICAT),100,1,skill->get_time(PR_MAGNIFICAT,1)); - sc_start(NULL,&sd->bl,status->skill2sc(PR_GLORIA),100,1,skill->get_time(PR_GLORIA,1)); - sc_start(NULL,&sd->bl,status->skill2sc(PR_SUFFRAGIUM),100,1,skill->get_time(PR_SUFFRAGIUM,1)); - if (sd->state.snovice_dead_flag) - sd->state.snovice_dead_flag = 0; //Reenable steelbody resurrection on dead. - } else if ((sd->job & MAPID_BASEMASK) == MAPID_TAEKWON) { - sc_start(NULL,&sd->bl,status->skill2sc(AL_INCAGI),100,10,600000); - sc_start(NULL,&sd->bl,status->skill2sc(AL_BLESSING),100,10,600000); - } + pc->checkbaselevelup_sc(sd); clif->misceffect(&sd->bl,0); npc->script_event(sd, NPCE_BASELVUP); //LORDALFA - LVLUPEVENT @@ -6810,6 +6834,24 @@ int pc_checkbaselevelup(struct map_session_data *sd) return 1; } +void pc_checkbaselevelup_sc(struct map_session_data *sd) +{ + nullpo_retv(sd); + + if ((sd->job & MAPID_UPPERMASK) == MAPID_SUPER_NOVICE) { + sc_start(NULL, &sd->bl, status->skill2sc(PR_KYRIE), 100, 1, skill->get_time(PR_KYRIE, 1)); + sc_start(NULL, &sd->bl, status->skill2sc(PR_IMPOSITIO), 100, 1, skill->get_time(PR_IMPOSITIO, 1)); + sc_start(NULL, &sd->bl, status->skill2sc(PR_MAGNIFICAT), 100, 1, skill->get_time(PR_MAGNIFICAT, 1)); + sc_start(NULL, &sd->bl, status->skill2sc(PR_GLORIA), 100, 1, skill->get_time(PR_GLORIA, 1)); + sc_start(NULL, &sd->bl, status->skill2sc(PR_SUFFRAGIUM), 100, 1, skill->get_time(PR_SUFFRAGIUM, 1)); + if (sd->state.snovice_dead_flag) + sd->state.snovice_dead_flag = 0; //Reenable steelbody resurrection on dead. + } else if ((sd->job & MAPID_BASEMASK) == MAPID_TAEKWON) { + sc_start(NULL, &sd->bl, status->skill2sc(AL_INCAGI), 100, 10, 600000); + sc_start(NULL, &sd->bl, status->skill2sc(AL_BLESSING), 100, 10, 600000); + } +} + void pc_baselevelchanged(struct map_session_data *sd) { int i; nullpo_retv(sd); @@ -7597,7 +7639,6 @@ int pc_resetskill(struct map_session_data* sd, int flag) } for (i = 1; i < MAX_SKILL_DB; i++) { - uint16 skill_id = 0; int lv = sd->status.skill[i].lv; if (lv < 1) continue; @@ -7606,19 +7647,7 @@ int pc_resetskill(struct map_session_data* sd, int flag) if( inf2&(INF2_WEDDING_SKILL|INF2_SPIRIT_SKILL) ) //Avoid reseting wedding/linker skills. continue; - skill_id = skill->dbs->db[i].nameid; - - // Don't reset trick dead if not a novice/baby - if (skill_id == NV_TRICKDEAD && (sd->job & MAPID_UPPERMASK) != MAPID_NOVICE) { - sd->status.skill[i].lv = 0; - sd->status.skill[i].flag = 0; - continue; - } - - // do not reset basic skill - if (skill_id == NV_BASIC && (sd->job & MAPID_UPPERMASK) != MAPID_NOVICE) - continue; - if (skill_id == SU_BASIC_SKILL && (sd->job & MAPID_BASEMASK) != MAPID_SUMMONER) + if (pc->resetskill_job(sd, i)) continue; if( sd->status.skill[i].flag == SKILL_FLAG_PERM_GRANTED ) @@ -7673,6 +7702,30 @@ int pc_resetskill(struct map_session_data* sd, int flag) return skill_point; } +bool pc_resetskill_job(struct map_session_data* sd, int index) +{ + uint16 skill_id; + + nullpo_retr(false, sd); + Assert_retr(false, index >= 0 && index < MAX_SKILL_DB); + + skill_id = skill->dbs->db[index].nameid; + + // Don't reset trick dead if not a novice/baby + if (skill_id == NV_TRICKDEAD && (sd->job & MAPID_UPPERMASK) != MAPID_NOVICE) { + sd->status.skill[index].lv = 0; + sd->status.skill[index].flag = 0; + return true; + } + + // do not reset basic skill + if (skill_id == NV_BASIC && (sd->job & MAPID_UPPERMASK) != MAPID_NOVICE) + return true; + if (skill_id == SU_BASIC_SKILL && (sd->job & MAPID_BASEMASK) != MAPID_SUMMONER) + return true; + return false; +} + /*========================================== * /resetfeel [Komurka] *------------------------------------------*/ @@ -8035,8 +8088,8 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) { } // changed penalty options, added death by player if pk_mode [Valaris] - if( battle_config.death_penalty_type - && (sd->job & MAPID_UPPERMASK) != MAPID_NOVICE // only novices will receive no penalty + if (battle_config.death_penalty_type + && pc->isDeathPenaltyJob(sd->job) && !map->list[sd->bl.m].flag.noexppenalty && !map_flag_gvg2(sd->bl.m) && !sd->sc.data[SC_BABY] && !sd->sc.data[SC_CASH_DEATHPENALTY] ) { @@ -8184,6 +8237,11 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) { return 1; } +bool pc_isDeathPenaltyJob(uint16 job) +{ + return (job & MAPID_UPPERMASK) != MAPID_NOVICE; // only novices will receive no penalty +} + void pc_revive(struct map_session_data *sd,unsigned int hp, unsigned int sp) { nullpo_retv(sd); if(hp) clif->updatestatus(sd,SP_HP); @@ -11077,6 +11135,11 @@ int pc_split_atoui64(char* str, uint64* val, char sep, int max) return i; } +bool pc_read_skill_job_skip(short skill_id, int job_id) +{ + return skill_id == NV_TRICKDEAD && ((pc->jobid2mapid(job_id) & (MAPID_BASEMASK | JOBL_2)) != MAPID_NOVICE); // skip trickdead for non-novices +} + /** * Parses the skill tree config file. * @@ -11157,8 +11220,8 @@ void pc_read_skill_tree(void) ShowWarning("pc_read_skill_tree: '%s' can't inherit '%s', skill tree is full!\n", job_name, ijob_name); break; } - if (src->id == NV_TRICKDEAD && ((pc->jobid2mapid(job_id)&(MAPID_BASEMASK | JOBL_2)) != MAPID_NOVICE)) - continue; // skip trickdead for non-novices + if (pc->read_skill_job_skip(src->id, job_id)) + continue; dst = &pc->skill_tree[job_idx][cur]; dst->inherited = 1; if (dst->id == 0) { @@ -12211,6 +12274,8 @@ void pc_defaults(void) { pc->checkequip = pc_checkequip; pc->calc_skilltree = pc_calc_skilltree; + pc->calc_skilltree_bonus = pc_calc_skilltree_bonus; + pc->calc_skilltree_clear = pc_calc_skilltree_clear; pc->calc_skilltree_normalize_job = pc_calc_skilltree_normalize_job; pc->clean_skilltree = pc_clean_skilltree; @@ -12273,6 +12338,7 @@ void pc_defaults(void) { pc->maxbaselv = pc_maxbaselv; pc->maxjoblv = pc_maxjoblv; pc->checkbaselevelup = pc_checkbaselevelup; + pc->checkbaselevelup_sc = pc_checkbaselevelup_sc; pc->checkjoblevelup = pc_checkjoblevelup; pc->gainexp = pc_gainexp; pc->nextbaseexp = pc_nextbaseexp; @@ -12289,6 +12355,7 @@ void pc_defaults(void) { pc->resetlvl = pc_resetlvl; pc->resetstate = pc_resetstate; pc->resetskill = pc_resetskill; + pc->resetskill_job = pc_resetskill_job; pc->resetfeel = pc_resetfeel; pc->resethate = pc_resethate; pc->equipitem = pc_equipitem; @@ -12363,7 +12430,9 @@ void pc_defaults(void) { pc->delinvincibletimer = pc_delinvincibletimer; pc->addspiritball = pc_addspiritball; + pc->addspiritball_sub = pc_addspiritball_sub; pc->delspiritball = pc_delspiritball; + pc->delspiritball_sub = pc_delspiritball_sub; pc->addfame = pc_addfame; pc->fame_rank = pc_fame_rank; pc->famelist_type = pc_famelist_type; @@ -12417,6 +12486,7 @@ void pc_defaults(void) { pc->autosave = pc_autosave; pc->follow_timer = pc_follow_timer; pc->read_skill_tree = pc_read_skill_tree; + pc->read_skill_job_skip = pc_read_skill_job_skip; pc->clear_skill_tree = pc_clear_skill_tree; pc->isUseitem = pc_isUseitem; pc->show_steal = pc_show_steal; @@ -12458,4 +12528,6 @@ void pc_defaults(void) { pc->have_magnifier = pc_have_magnifier; pc->check_basicskill = pc_check_basicskill; + + pc->isDeathPenaltyJob = pc_isDeathPenaltyJob; } diff --git a/src/map/pc.h b/src/map/pc.h index e699e5750..49c102206 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -889,6 +889,8 @@ END_ZEROED_BLOCK; /* End */ int (*checkequip) (struct map_session_data *sd,int pos); int (*calc_skilltree) (struct map_session_data *sd); + void (*calc_skilltree_clear) (struct map_session_data *sd); + void (*calc_skilltree_bonus) (struct map_session_data *sd, int classidx); int (*calc_skilltree_normalize_job) (struct map_session_data *sd); int (*clean_skilltree) (struct map_session_data *sd); @@ -952,6 +954,7 @@ END_ZEROED_BLOCK; /* End */ int (*maxbaselv) (const struct map_session_data *sd); int (*maxjoblv) (const struct map_session_data *sd); int (*checkbaselevelup) (struct map_session_data *sd); + void (*checkbaselevelup_sc) (struct map_session_data *sd); int (*checkjoblevelup) (struct map_session_data *sd); bool (*gainexp) (struct map_session_data *sd, struct block_list *src, uint64 base_exp, uint64 job_exp, bool is_quest); uint64 (*nextbaseexp) (const struct map_session_data *sd); @@ -968,6 +971,7 @@ END_ZEROED_BLOCK; /* End */ int (*resetlvl) (struct map_session_data *sd,int type); int (*resetstate) (struct map_session_data *sd); int (*resetskill) (struct map_session_data *sd, int flag); + bool (*resetskill_job) (struct map_session_data *sd, int index); int (*resetfeel) (struct map_session_data *sd); int (*resethate) (struct map_session_data *sd); int (*equipitem) (struct map_session_data *sd,int n,int req_pos); @@ -1040,7 +1044,9 @@ END_ZEROED_BLOCK; /* End */ void (*delinvincibletimer) (struct map_session_data* sd); int (*addspiritball) (struct map_session_data *sd,int interval,int max); + int (*addspiritball_sub) (struct map_session_data *sd); int (*delspiritball) (struct map_session_data *sd,int count,int type); + int (*delspiritball_sub) (struct map_session_data *sd); int (*getmaxspiritball) (struct map_session_data *sd, int min); void (*addfame) (struct map_session_data *sd, int ranktype, int count); int (*fame_rank) (int char_id, int ranktype); @@ -1095,6 +1101,7 @@ END_ZEROED_BLOCK; /* End */ int (*autosave) (int tid, int64 tick, int id, intptr_t data); int (*follow_timer) (int tid, int64 tick, int id, intptr_t data); void (*read_skill_tree) (void); + bool (*read_skill_job_skip) (short skill_id, int job_id); void (*clear_skill_tree) (void); int (*isUseitem) (struct map_session_data *sd,int n); int (*show_steal) (struct block_list *bl,va_list ap); @@ -1137,6 +1144,7 @@ END_ZEROED_BLOCK; /* End */ bool (*process_chat_message) (struct map_session_data *sd, const char *message); void (*check_supernovice_call) (struct map_session_data *sd, const char *message); bool (*check_basicskill) (struct map_session_data *sd, int level); + bool (*isDeathPenaltyJob) (uint16 job); }; #ifdef HERCULES_CORE diff --git a/src/map/script.c b/src/map/script.c index d11b6741a..3c5f4a232 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -13998,9 +13998,15 @@ BUILDIN(setwall) { map->iwall_set(m, x, y, size, dir, shootable, name); return true; } -BUILDIN(delwall) { + +BUILDIN(delwall) +{ const char *name = script_getstr(st,2); - map->iwall_remove(name); + + if (!map->iwall_remove(name)) { + ShowWarning("buildin_delwall: Non-existent '%s' provided.\n", name); + return false; + } return true; } diff --git a/src/map/skill.c b/src/map/skill.c index 9108b6575..87e869ec7 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -19030,9 +19030,7 @@ int skill_blockpc_start_(struct map_session_data *sd, uint16 skill_id, int tick) if (DIFF_TICK32(cd->entry[i]->started + cd->entry[i]->duration, now) > tick) return 0; cd->entry[i]->duration = tick; -#if PACKETVER >= 20120604 cd->entry[i]->total = tick; -#endif cd->entry[i]->started = now; if( timer->settick(cd->entry[i]->timer,now+tick) != -1 ) return 0; @@ -19064,9 +19062,7 @@ int skill_blockpc_start_(struct map_session_data *sd, uint16 skill_id, int tick) cd->entry[cd->cursor] = ers_alloc(skill->cd_entry_ers,struct skill_cd_entry); cd->entry[cd->cursor]->duration = tick; -#if PACKETVER >= 20120604 cd->entry[cd->cursor]->total = tick; -#endif cd->entry[cd->cursor]->skidx = idx; cd->entry[cd->cursor]->skill_id = skill_id; cd->entry[cd->cursor]->started = now; @@ -19715,8 +19711,16 @@ void skill_cooldown_load(struct map_session_data * sd) // process each individual cooldown associated with the character for( i = 0; i < cd->cursor; i++ ) { - cd->entry[i]->started = now; - cd->entry[i]->timer = timer->add(timer->gettick()+cd->entry[i]->duration,skill->blockpc_end,sd->bl.id,cd->entry[i]->skidx); + int64 remaining; + + if (battle_config.guild_skill_relog_delay == 2 && cd->entry[i]->skill_id >= GD_SKILLBASE && cd->entry[i]->skill_id < GD_MAX) { + remaining = cd->entry[i]->started + cd->entry[i]->total - now; + remaining = max(1, remaining); // expired cooldowns will be 1, so they'll expire in the normal way just after this. + } else { + cd->entry[i]->started = now; + remaining = cd->entry[i]->duration; + } + cd->entry[i]->timer = timer->add(timer->gettick() + remaining, skill->blockpc_end, sd->bl.id, cd->entry[i]->skidx); sd->blockskill[cd->entry[i]->skidx] = true; } } diff --git a/src/map/skill.h b/src/map/skill.h index d7590921a..3de7f7bdf 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -1842,9 +1842,7 @@ struct s_skill_magicmushroom_db { struct skill_cd_entry { int duration;//milliseconds -#if PACKETVER >= 20120604 - int total;/* used for display on newer clients */ -#endif + int total;/* used when reducing offline cooldown and for display on newer clients */ short skidx;//the skill index entries belong to int64 started;/* gettick() of when it started, used vs duration to measure how much left upon logout */ int timer;/* timer id */ diff --git a/src/map/status.c b/src/map/status.c index a39449b11..972d1eca9 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2333,6 +2333,18 @@ void status_calc_pc_additional(struct map_session_data* sd, enum e_status_calc_o return; } +void status_calc_pc_recover_hp(struct map_session_data* sd, struct status_data *bstatus) +{ + nullpo_retv(sd); + nullpo_retv(bstatus); + + if ((sd->job & MAPID_BASEMASK) == MAPID_NOVICE && (sd->job & JOBL_2) == 0 + && battle_config.restart_hp_rate < 50) + bstatus->hp = bstatus->max_hp>>1; + else + bstatus->hp = APPLY_RATE(bstatus->max_hp, battle_config.restart_hp_rate); +} + //Calculates player data from scratch without counting SC adjustments. //Should be invoked whenever players raise stats, learn passive skills or change equipment. int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) @@ -2874,11 +2886,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) bstatus->hp = bstatus->max_hp; bstatus->sp = bstatus->max_sp; } else { - if ((sd->job & MAPID_BASEMASK) == MAPID_NOVICE && (sd->job & JOBL_2) == 0 - && battle_config.restart_hp_rate < 50) - bstatus->hp = bstatus->max_hp>>1; - else - bstatus->hp = APPLY_RATE(bstatus->max_hp, battle_config.restart_hp_rate); + status->calc_pc_recover_hp(sd, bstatus); if(!bstatus->hp) bstatus->hp = 1; @@ -13658,6 +13666,7 @@ void status_defaults(void) status->calc_pet_ = status_calc_pet_; status->calc_pc_ = status_calc_pc_; status->calc_pc_additional = status_calc_pc_additional; + status->calc_pc_recover_hp = status_calc_pc_recover_hp; status->calc_homunculus_ = status_calc_homunculus_; status->calc_mercenary_ = status_calc_mercenary_; status->calc_elemental_ = status_calc_elemental_; diff --git a/src/map/status.h b/src/map/status.h index 5a031fa48..5df439237 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -2355,6 +2355,7 @@ struct status_interface { int (*calc_pet_) (struct pet_data* pd, enum e_status_calc_opt opt); int (*calc_pc_) (struct map_session_data* sd, enum e_status_calc_opt opt); void (*calc_pc_additional) (struct map_session_data* sd, enum e_status_calc_opt opt); + void (*calc_pc_recover_hp) (struct map_session_data* sd, struct status_data *bstatus); int (*calc_homunculus_) (struct homun_data *hd, enum e_status_calc_opt opt); int (*calc_mercenary_) (struct mercenary_data *md, enum e_status_calc_opt opt); int (*calc_elemental_) (struct elemental_data *ed, enum e_status_calc_opt opt); diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index ae425e35c..a548d4eaf 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -4282,8 +4282,8 @@ typedef bool (*HPMHOOK_pre_map_iwall_set) (int16 *m, int16 *x, int16 *y, int *si typedef bool (*HPMHOOK_post_map_iwall_set) (bool retVal___, int16 m, int16 x, int16 y, int size, int8 dir, bool shootable, const char *wall_name); typedef void (*HPMHOOK_pre_map_iwall_get) (struct map_session_data **sd); typedef void (*HPMHOOK_post_map_iwall_get) (struct map_session_data *sd); -typedef void (*HPMHOOK_pre_map_iwall_remove) (const char **wall_name); -typedef void (*HPMHOOK_post_map_iwall_remove) (const char *wall_name); +typedef bool (*HPMHOOK_pre_map_iwall_remove) (const char **wall_name); +typedef bool (*HPMHOOK_post_map_iwall_remove) (bool retVal___, const char *wall_name); typedef int (*HPMHOOK_pre_map_addmobtolist) (unsigned short *m, struct spawn_data **spawn); typedef int (*HPMHOOK_post_map_addmobtolist) (int retVal___, unsigned short m, struct spawn_data *spawn); typedef void (*HPMHOOK_pre_map_spawnmobs) (int16 *m); @@ -5554,6 +5554,10 @@ typedef int (*HPMHOOK_pre_pc_checkequip) (struct map_session_data **sd, int *pos typedef int (*HPMHOOK_post_pc_checkequip) (int retVal___, struct map_session_data *sd, int pos); typedef int (*HPMHOOK_pre_pc_calc_skilltree) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_calc_skilltree) (int retVal___, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_pc_calc_skilltree_clear) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_pc_calc_skilltree_clear) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_pc_calc_skilltree_bonus) (struct map_session_data **sd, int *classidx); +typedef void (*HPMHOOK_post_pc_calc_skilltree_bonus) (struct map_session_data *sd, int classidx); typedef int (*HPMHOOK_pre_pc_calc_skilltree_normalize_job) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_calc_skilltree_normalize_job) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_pc_clean_skilltree) (struct map_session_data **sd); @@ -5650,6 +5654,8 @@ typedef int (*HPMHOOK_pre_pc_maxjoblv) (const struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_maxjoblv) (int retVal___, const struct map_session_data *sd); typedef int (*HPMHOOK_pre_pc_checkbaselevelup) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_checkbaselevelup) (int retVal___, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_pc_checkbaselevelup_sc) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_pc_checkbaselevelup_sc) (struct map_session_data *sd); typedef int (*HPMHOOK_pre_pc_checkjoblevelup) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_checkjoblevelup) (int retVal___, struct map_session_data *sd); typedef bool (*HPMHOOK_pre_pc_gainexp) (struct map_session_data **sd, struct block_list **src, uint64 *base_exp, uint64 *job_exp, bool *is_quest); @@ -5682,6 +5688,8 @@ typedef int (*HPMHOOK_pre_pc_resetstate) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_resetstate) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_pc_resetskill) (struct map_session_data **sd, int *flag); typedef int (*HPMHOOK_post_pc_resetskill) (int retVal___, struct map_session_data *sd, int flag); +typedef bool (*HPMHOOK_pre_pc_resetskill_job) (struct map_session_data **sd, int *index); +typedef bool (*HPMHOOK_post_pc_resetskill_job) (bool retVal___, struct map_session_data *sd, int index); typedef int (*HPMHOOK_pre_pc_resetfeel) (struct map_session_data **sd); typedef int (*HPMHOOK_post_pc_resetfeel) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_pc_resethate) (struct map_session_data **sd); @@ -5802,8 +5810,12 @@ typedef void (*HPMHOOK_pre_pc_delinvincibletimer) (struct map_session_data **sd) typedef void (*HPMHOOK_post_pc_delinvincibletimer) (struct map_session_data *sd); typedef int (*HPMHOOK_pre_pc_addspiritball) (struct map_session_data **sd, int *interval, int *max); typedef int (*HPMHOOK_post_pc_addspiritball) (int retVal___, struct map_session_data *sd, int interval, int max); +typedef int (*HPMHOOK_pre_pc_addspiritball_sub) (struct map_session_data **sd); +typedef int (*HPMHOOK_post_pc_addspiritball_sub) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_pc_delspiritball) (struct map_session_data **sd, int *count, int *type); typedef int (*HPMHOOK_post_pc_delspiritball) (int retVal___, struct map_session_data *sd, int count, int type); +typedef int (*HPMHOOK_pre_pc_delspiritball_sub) (struct map_session_data **sd); +typedef int (*HPMHOOK_post_pc_delspiritball_sub) (int retVal___, struct map_session_data *sd); typedef int (*HPMHOOK_pre_pc_getmaxspiritball) (struct map_session_data **sd, int *min); typedef int (*HPMHOOK_post_pc_getmaxspiritball) (int retVal___, struct map_session_data *sd, int min); typedef void (*HPMHOOK_pre_pc_addfame) (struct map_session_data **sd, int *ranktype, int *count); @@ -5892,6 +5904,8 @@ typedef int (*HPMHOOK_pre_pc_follow_timer) (int *tid, int64 *tick, int *id, intp typedef int (*HPMHOOK_post_pc_follow_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data); typedef void (*HPMHOOK_pre_pc_read_skill_tree) (void); typedef void (*HPMHOOK_post_pc_read_skill_tree) (void); +typedef bool (*HPMHOOK_pre_pc_read_skill_job_skip) (short *skill_id, int *job_id); +typedef bool (*HPMHOOK_post_pc_read_skill_job_skip) (bool retVal___, short skill_id, int job_id); typedef void (*HPMHOOK_pre_pc_clear_skill_tree) (void); typedef void (*HPMHOOK_post_pc_clear_skill_tree) (void); typedef int (*HPMHOOK_pre_pc_isUseitem) (struct map_session_data **sd, int *n); @@ -5950,6 +5964,8 @@ typedef void (*HPMHOOK_pre_pc_check_supernovice_call) (struct map_session_data * typedef void (*HPMHOOK_post_pc_check_supernovice_call) (struct map_session_data *sd, const char *message); typedef bool (*HPMHOOK_pre_pc_check_basicskill) (struct map_session_data **sd, int *level); typedef bool (*HPMHOOK_post_pc_check_basicskill) (bool retVal___, struct map_session_data *sd, int level); +typedef bool (*HPMHOOK_pre_pc_isDeathPenaltyJob) (uint16 *job); +typedef bool (*HPMHOOK_post_pc_isDeathPenaltyJob) (bool retVal___, uint16 job); #endif // MAP_PC_H #ifdef MAP_NPC_H /* libpcre */ typedef pcre* (*HPMHOOK_pre_libpcre_compile) (const char **pattern, int *options, const char ***errptr, int **erroffset, const unsigned char **tableptr); @@ -7300,6 +7316,8 @@ typedef int (*HPMHOOK_pre_status_calc_pc_) (struct map_session_data **sd, enum e typedef int (*HPMHOOK_post_status_calc_pc_) (int retVal___, struct map_session_data *sd, enum e_status_calc_opt opt); typedef void (*HPMHOOK_pre_status_calc_pc_additional) (struct map_session_data **sd, enum e_status_calc_opt *opt); typedef void (*HPMHOOK_post_status_calc_pc_additional) (struct map_session_data *sd, enum e_status_calc_opt opt); +typedef void (*HPMHOOK_pre_status_calc_pc_recover_hp) (struct map_session_data **sd, struct status_data **bstatus); +typedef void (*HPMHOOK_post_status_calc_pc_recover_hp) (struct map_session_data *sd, struct status_data *bstatus); typedef int (*HPMHOOK_pre_status_calc_homunculus_) (struct homun_data **hd, enum e_status_calc_opt *opt); typedef int (*HPMHOOK_post_status_calc_homunculus_) (int retVal___, struct homun_data *hd, enum e_status_calc_opt opt); typedef int (*HPMHOOK_pre_status_calc_mercenary_) (struct mercenary_data **md, enum e_status_calc_opt *opt); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index b976d9601..19f91bb11 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -4210,6 +4210,10 @@ struct { struct HPMHookPoint *HP_pc_checkequip_post; struct HPMHookPoint *HP_pc_calc_skilltree_pre; struct HPMHookPoint *HP_pc_calc_skilltree_post; + struct HPMHookPoint *HP_pc_calc_skilltree_clear_pre; + struct HPMHookPoint *HP_pc_calc_skilltree_clear_post; + struct HPMHookPoint *HP_pc_calc_skilltree_bonus_pre; + struct HPMHookPoint *HP_pc_calc_skilltree_bonus_post; struct HPMHookPoint *HP_pc_calc_skilltree_normalize_job_pre; struct HPMHookPoint *HP_pc_calc_skilltree_normalize_job_post; struct HPMHookPoint *HP_pc_clean_skilltree_pre; @@ -4306,6 +4310,8 @@ struct { struct HPMHookPoint *HP_pc_maxjoblv_post; struct HPMHookPoint *HP_pc_checkbaselevelup_pre; struct HPMHookPoint *HP_pc_checkbaselevelup_post; + struct HPMHookPoint *HP_pc_checkbaselevelup_sc_pre; + struct HPMHookPoint *HP_pc_checkbaselevelup_sc_post; struct HPMHookPoint *HP_pc_checkjoblevelup_pre; struct HPMHookPoint *HP_pc_checkjoblevelup_post; struct HPMHookPoint *HP_pc_gainexp_pre; @@ -4338,6 +4344,8 @@ struct { struct HPMHookPoint *HP_pc_resetstate_post; struct HPMHookPoint *HP_pc_resetskill_pre; struct HPMHookPoint *HP_pc_resetskill_post; + struct HPMHookPoint *HP_pc_resetskill_job_pre; + struct HPMHookPoint *HP_pc_resetskill_job_post; struct HPMHookPoint *HP_pc_resetfeel_pre; struct HPMHookPoint *HP_pc_resetfeel_post; struct HPMHookPoint *HP_pc_resethate_pre; @@ -4458,8 +4466,12 @@ struct { struct HPMHookPoint *HP_pc_delinvincibletimer_post; struct HPMHookPoint *HP_pc_addspiritball_pre; struct HPMHookPoint *HP_pc_addspiritball_post; + struct HPMHookPoint *HP_pc_addspiritball_sub_pre; + struct HPMHookPoint *HP_pc_addspiritball_sub_post; struct HPMHookPoint *HP_pc_delspiritball_pre; struct HPMHookPoint *HP_pc_delspiritball_post; + struct HPMHookPoint *HP_pc_delspiritball_sub_pre; + struct HPMHookPoint *HP_pc_delspiritball_sub_post; struct HPMHookPoint *HP_pc_getmaxspiritball_pre; struct HPMHookPoint *HP_pc_getmaxspiritball_post; struct HPMHookPoint *HP_pc_addfame_pre; @@ -4548,6 +4560,8 @@ struct { struct HPMHookPoint *HP_pc_follow_timer_post; struct HPMHookPoint *HP_pc_read_skill_tree_pre; struct HPMHookPoint *HP_pc_read_skill_tree_post; + struct HPMHookPoint *HP_pc_read_skill_job_skip_pre; + struct HPMHookPoint *HP_pc_read_skill_job_skip_post; struct HPMHookPoint *HP_pc_clear_skill_tree_pre; struct HPMHookPoint *HP_pc_clear_skill_tree_post; struct HPMHookPoint *HP_pc_isUseitem_pre; @@ -4606,6 +4620,8 @@ struct { struct HPMHookPoint *HP_pc_check_supernovice_call_post; struct HPMHookPoint *HP_pc_check_basicskill_pre; struct HPMHookPoint *HP_pc_check_basicskill_post; + struct HPMHookPoint *HP_pc_isDeathPenaltyJob_pre; + struct HPMHookPoint *HP_pc_isDeathPenaltyJob_post; struct HPMHookPoint *HP_libpcre_compile_pre; struct HPMHookPoint *HP_libpcre_compile_post; struct HPMHookPoint *HP_libpcre_study_pre; @@ -5900,6 +5916,8 @@ struct { struct HPMHookPoint *HP_status_calc_pc__post; struct HPMHookPoint *HP_status_calc_pc_additional_pre; struct HPMHookPoint *HP_status_calc_pc_additional_post; + struct HPMHookPoint *HP_status_calc_pc_recover_hp_pre; + struct HPMHookPoint *HP_status_calc_pc_recover_hp_post; struct HPMHookPoint *HP_status_calc_homunculus__pre; struct HPMHookPoint *HP_status_calc_homunculus__post; struct HPMHookPoint *HP_status_calc_mercenary__pre; @@ -10527,6 +10545,10 @@ struct { int HP_pc_checkequip_post; int HP_pc_calc_skilltree_pre; int HP_pc_calc_skilltree_post; + int HP_pc_calc_skilltree_clear_pre; + int HP_pc_calc_skilltree_clear_post; + int HP_pc_calc_skilltree_bonus_pre; + int HP_pc_calc_skilltree_bonus_post; int HP_pc_calc_skilltree_normalize_job_pre; int HP_pc_calc_skilltree_normalize_job_post; int HP_pc_clean_skilltree_pre; @@ -10623,6 +10645,8 @@ struct { int HP_pc_maxjoblv_post; int HP_pc_checkbaselevelup_pre; int HP_pc_checkbaselevelup_post; + int HP_pc_checkbaselevelup_sc_pre; + int HP_pc_checkbaselevelup_sc_post; int HP_pc_checkjoblevelup_pre; int HP_pc_checkjoblevelup_post; int HP_pc_gainexp_pre; @@ -10655,6 +10679,8 @@ struct { int HP_pc_resetstate_post; int HP_pc_resetskill_pre; int HP_pc_resetskill_post; + int HP_pc_resetskill_job_pre; + int HP_pc_resetskill_job_post; int HP_pc_resetfeel_pre; int HP_pc_resetfeel_post; int HP_pc_resethate_pre; @@ -10775,8 +10801,12 @@ struct { int HP_pc_delinvincibletimer_post; int HP_pc_addspiritball_pre; int HP_pc_addspiritball_post; + int HP_pc_addspiritball_sub_pre; + int HP_pc_addspiritball_sub_post; int HP_pc_delspiritball_pre; int HP_pc_delspiritball_post; + int HP_pc_delspiritball_sub_pre; + int HP_pc_delspiritball_sub_post; int HP_pc_getmaxspiritball_pre; int HP_pc_getmaxspiritball_post; int HP_pc_addfame_pre; @@ -10865,6 +10895,8 @@ struct { int HP_pc_follow_timer_post; int HP_pc_read_skill_tree_pre; int HP_pc_read_skill_tree_post; + int HP_pc_read_skill_job_skip_pre; + int HP_pc_read_skill_job_skip_post; int HP_pc_clear_skill_tree_pre; int HP_pc_clear_skill_tree_post; int HP_pc_isUseitem_pre; @@ -10923,6 +10955,8 @@ struct { int HP_pc_check_supernovice_call_post; int HP_pc_check_basicskill_pre; int HP_pc_check_basicskill_post; + int HP_pc_isDeathPenaltyJob_pre; + int HP_pc_isDeathPenaltyJob_post; int HP_libpcre_compile_pre; int HP_libpcre_compile_post; int HP_libpcre_study_pre; @@ -12217,6 +12251,8 @@ struct { int HP_status_calc_pc__post; int HP_status_calc_pc_additional_pre; int HP_status_calc_pc_additional_post; + int HP_status_calc_pc_recover_hp_pre; + int HP_status_calc_pc_recover_hp_post; int HP_status_calc_homunculus__pre; int HP_status_calc_homunculus__post; int HP_status_calc_mercenary__pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 19fd8498e..711e25d30 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2161,6 +2161,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->checkallowskill, HP_pc_checkallowskill) }, { HP_POP(pc->checkequip, HP_pc_checkequip) }, { HP_POP(pc->calc_skilltree, HP_pc_calc_skilltree) }, + { HP_POP(pc->calc_skilltree_clear, HP_pc_calc_skilltree_clear) }, + { HP_POP(pc->calc_skilltree_bonus, HP_pc_calc_skilltree_bonus) }, { HP_POP(pc->calc_skilltree_normalize_job, HP_pc_calc_skilltree_normalize_job) }, { HP_POP(pc->clean_skilltree, HP_pc_clean_skilltree) }, { HP_POP(pc->setpos, HP_pc_setpos) }, @@ -2209,6 +2211,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->maxbaselv, HP_pc_maxbaselv) }, { HP_POP(pc->maxjoblv, HP_pc_maxjoblv) }, { HP_POP(pc->checkbaselevelup, HP_pc_checkbaselevelup) }, + { HP_POP(pc->checkbaselevelup_sc, HP_pc_checkbaselevelup_sc) }, { HP_POP(pc->checkjoblevelup, HP_pc_checkjoblevelup) }, { HP_POP(pc->gainexp, HP_pc_gainexp) }, { HP_POP(pc->nextbaseexp, HP_pc_nextbaseexp) }, @@ -2225,6 +2228,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->resetlvl, HP_pc_resetlvl) }, { HP_POP(pc->resetstate, HP_pc_resetstate) }, { HP_POP(pc->resetskill, HP_pc_resetskill) }, + { HP_POP(pc->resetskill_job, HP_pc_resetskill_job) }, { HP_POP(pc->resetfeel, HP_pc_resetfeel) }, { HP_POP(pc->resethate, HP_pc_resethate) }, { HP_POP(pc->equipitem, HP_pc_equipitem) }, @@ -2285,7 +2289,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->setinvincibletimer, HP_pc_setinvincibletimer) }, { HP_POP(pc->delinvincibletimer, HP_pc_delinvincibletimer) }, { HP_POP(pc->addspiritball, HP_pc_addspiritball) }, + { HP_POP(pc->addspiritball_sub, HP_pc_addspiritball_sub) }, { HP_POP(pc->delspiritball, HP_pc_delspiritball) }, + { HP_POP(pc->delspiritball_sub, HP_pc_delspiritball_sub) }, { HP_POP(pc->getmaxspiritball, HP_pc_getmaxspiritball) }, { HP_POP(pc->addfame, HP_pc_addfame) }, { HP_POP(pc->fame_rank, HP_pc_fame_rank) }, @@ -2330,6 +2336,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->autosave, HP_pc_autosave) }, { HP_POP(pc->follow_timer, HP_pc_follow_timer) }, { HP_POP(pc->read_skill_tree, HP_pc_read_skill_tree) }, + { HP_POP(pc->read_skill_job_skip, HP_pc_read_skill_job_skip) }, { HP_POP(pc->clear_skill_tree, HP_pc_clear_skill_tree) }, { HP_POP(pc->isUseitem, HP_pc_isUseitem) }, { HP_POP(pc->show_steal, HP_pc_show_steal) }, @@ -2359,6 +2366,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->process_chat_message, HP_pc_process_chat_message) }, { HP_POP(pc->check_supernovice_call, HP_pc_check_supernovice_call) }, { HP_POP(pc->check_basicskill, HP_pc_check_basicskill) }, + { HP_POP(pc->isDeathPenaltyJob, HP_pc_isDeathPenaltyJob) }, /* pcre_interface */ { HP_POP(libpcre->compile, HP_libpcre_compile) }, { HP_POP(libpcre->study, HP_libpcre_study) }, @@ -3018,6 +3026,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(status->calc_pet_, HP_status_calc_pet_) }, { HP_POP(status->calc_pc_, HP_status_calc_pc_) }, { HP_POP(status->calc_pc_additional, HP_status_calc_pc_additional) }, + { HP_POP(status->calc_pc_recover_hp, HP_status_calc_pc_recover_hp) }, { HP_POP(status->calc_homunculus_, HP_status_calc_homunculus_) }, { HP_POP(status->calc_mercenary_, HP_status_calc_mercenary_) }, { HP_POP(status->calc_elemental_, HP_status_calc_elemental_) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 007a1c004..e7eb005e2 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -44073,31 +44073,32 @@ void HP_map_iwall_get(struct map_session_data *sd) { } return; } -void HP_map_iwall_remove(const char *wall_name) { +bool HP_map_iwall_remove(const char *wall_name) { int hIndex = 0; + bool retVal___ = false; if (HPMHooks.count.HP_map_iwall_remove_pre > 0) { - void (*preHookFunc) (const char **wall_name); + bool (*preHookFunc) (const char **wall_name); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_remove_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_iwall_remove_pre[hIndex].func; - preHookFunc(&wall_name); + retVal___ = preHookFunc(&wall_name); } if (*HPMforce_return) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.map.iwall_remove(wall_name); + retVal___ = HPMHooks.source.map.iwall_remove(wall_name); } if (HPMHooks.count.HP_map_iwall_remove_post > 0) { - void (*postHookFunc) (const char *wall_name); + bool (*postHookFunc) (bool retVal___, const char *wall_name); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_remove_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_iwall_remove_post[hIndex].func; - postHookFunc(wall_name); + retVal___ = postHookFunc(retVal___, wall_name); } } - return; + return retVal___; } int HP_map_addmobtolist(unsigned short m, struct spawn_data *spawn) { int hIndex = 0; @@ -56014,6 +56015,58 @@ int HP_pc_calc_skilltree(struct map_session_data *sd) { } return retVal___; } +void HP_pc_calc_skilltree_clear(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_pc_calc_skilltree_clear_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skilltree_clear_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_calc_skilltree_clear_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.pc.calc_skilltree_clear(sd); + } + if (HPMHooks.count.HP_pc_calc_skilltree_clear_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skilltree_clear_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_calc_skilltree_clear_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} +void HP_pc_calc_skilltree_bonus(struct map_session_data *sd, int classidx) { + int hIndex = 0; + if (HPMHooks.count.HP_pc_calc_skilltree_bonus_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *classidx); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skilltree_bonus_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_calc_skilltree_bonus_pre[hIndex].func; + preHookFunc(&sd, &classidx); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.pc.calc_skilltree_bonus(sd, classidx); + } + if (HPMHooks.count.HP_pc_calc_skilltree_bonus_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int classidx); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skilltree_bonus_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_calc_skilltree_bonus_post[hIndex].func; + postHookFunc(sd, classidx); + } + } + return; +} int HP_pc_calc_skilltree_normalize_job(struct map_session_data *sd) { int hIndex = 0; int retVal___ = 0; @@ -57310,6 +57363,32 @@ int HP_pc_checkbaselevelup(struct map_session_data *sd) { } return retVal___; } +void HP_pc_checkbaselevelup_sc(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_pc_checkbaselevelup_sc_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkbaselevelup_sc_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_checkbaselevelup_sc_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.pc.checkbaselevelup_sc(sd); + } + if (HPMHooks.count.HP_pc_checkbaselevelup_sc_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkbaselevelup_sc_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_checkbaselevelup_sc_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} int HP_pc_checkjoblevelup(struct map_session_data *sd) { int hIndex = 0; int retVal___ = 0; @@ -57742,6 +57821,33 @@ int HP_pc_resetskill(struct map_session_data *sd, int flag) { } return retVal___; } +bool HP_pc_resetskill_job(struct map_session_data *sd, int index) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_pc_resetskill_job_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd, int *index); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetskill_job_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_resetskill_job_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &index); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.resetskill_job(sd, index); + } + if (HPMHooks.count.HP_pc_resetskill_job_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int index); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetskill_job_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_resetskill_job_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, index); + } + } + return retVal___; +} int HP_pc_resetfeel(struct map_session_data *sd) { int hIndex = 0; int retVal___ = 0; @@ -59345,6 +59451,33 @@ int HP_pc_addspiritball(struct map_session_data *sd, int interval, int max) { } return retVal___; } +int HP_pc_addspiritball_sub(struct map_session_data *sd) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_pc_addspiritball_sub_pre > 0) { + int (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addspiritball_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_addspiritball_sub_pre[hIndex].func; + retVal___ = preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.addspiritball_sub(sd); + } + if (HPMHooks.count.HP_pc_addspiritball_sub_post > 0) { + int (*postHookFunc) (int retVal___, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addspiritball_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_addspiritball_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd); + } + } + return retVal___; +} int HP_pc_delspiritball(struct map_session_data *sd, int count, int type) { int hIndex = 0; int retVal___ = 0; @@ -59372,6 +59505,33 @@ int HP_pc_delspiritball(struct map_session_data *sd, int count, int type) { } return retVal___; } +int HP_pc_delspiritball_sub(struct map_session_data *sd) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_pc_delspiritball_sub_pre > 0) { + int (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_delspiritball_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_delspiritball_sub_pre[hIndex].func; + retVal___ = preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.delspiritball_sub(sd); + } + if (HPMHooks.count.HP_pc_delspiritball_sub_post > 0) { + int (*postHookFunc) (int retVal___, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_delspiritball_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_delspiritball_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd); + } + } + return retVal___; +} int HP_pc_getmaxspiritball(struct map_session_data *sd, int min) { int hIndex = 0; int retVal___ = 0; @@ -60567,6 +60727,33 @@ void HP_pc_read_skill_tree(void) { } return; } +bool HP_pc_read_skill_job_skip(short skill_id, int job_id) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_pc_read_skill_job_skip_pre > 0) { + bool (*preHookFunc) (short *skill_id, int *job_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_read_skill_job_skip_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_read_skill_job_skip_pre[hIndex].func; + retVal___ = preHookFunc(&skill_id, &job_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.read_skill_job_skip(skill_id, job_id); + } + if (HPMHooks.count.HP_pc_read_skill_job_skip_post > 0) { + bool (*postHookFunc) (bool retVal___, short skill_id, int job_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_read_skill_job_skip_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_read_skill_job_skip_post[hIndex].func; + retVal___ = postHookFunc(retVal___, skill_id, job_id); + } + } + return retVal___; +} void HP_pc_clear_skill_tree(void) { int hIndex = 0; if (HPMHooks.count.HP_pc_clear_skill_tree_pre > 0) { @@ -61346,6 +61533,33 @@ bool HP_pc_check_basicskill(struct map_session_data *sd, int level) { } return retVal___; } +bool HP_pc_isDeathPenaltyJob(uint16 job) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_pc_isDeathPenaltyJob_pre > 0) { + bool (*preHookFunc) (uint16 *job); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_isDeathPenaltyJob_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_isDeathPenaltyJob_pre[hIndex].func; + retVal___ = preHookFunc(&job); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.isDeathPenaltyJob(job); + } + if (HPMHooks.count.HP_pc_isDeathPenaltyJob_post > 0) { + bool (*postHookFunc) (bool retVal___, uint16 job); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_isDeathPenaltyJob_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_isDeathPenaltyJob_post[hIndex].func; + retVal___ = postHookFunc(retVal___, job); + } + } + return retVal___; +} /* pcre_interface */ pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr) { int hIndex = 0; @@ -79000,6 +79214,32 @@ void HP_status_calc_pc_additional(struct map_session_data *sd, enum e_status_cal } return; } +void HP_status_calc_pc_recover_hp(struct map_session_data *sd, struct status_data *bstatus) { + int hIndex = 0; + if (HPMHooks.count.HP_status_calc_pc_recover_hp_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, struct status_data **bstatus); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pc_recover_hp_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_status_calc_pc_recover_hp_pre[hIndex].func; + preHookFunc(&sd, &bstatus); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.status.calc_pc_recover_hp(sd, bstatus); + } + if (HPMHooks.count.HP_status_calc_pc_recover_hp_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, struct status_data *bstatus); + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pc_recover_hp_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_status_calc_pc_recover_hp_post[hIndex].func; + postHookFunc(sd, bstatus); + } + } + return; +} int HP_status_calc_homunculus_(struct homun_data *hd, enum e_status_calc_opt opt) { int hIndex = 0; int retVal___ = 0; |