From 354d2605f28f4d87c4bead36d4bea7c2fd747977 Mon Sep 17 00:00:00 2001 From: Aleos Date: Tue, 7 Jun 2022 11:05:37 -0400 Subject: [PATCH] Corrects Doram healing skill effects (#6978) * Fixes #6962. * Tuna Belly and Fresh Shrimp don't apply normal green heal effects. * Resolves an issue with the HP bars not properly updating for party members as well. Thanks to @KrokusPokus! --- src/map/clif.cpp | 23 ++++++++++++++--------- src/map/clif.hpp | 1 + src/map/pc.cpp | 6 +++++- src/map/skill.cpp | 2 +- src/map/status.cpp | 2 +- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/map/clif.cpp b/src/map/clif.cpp index c5e0a4fe19..7ba8eb6a7b 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -3345,6 +3345,19 @@ static int clif_hpmeter(struct map_session_data *sd) return 0; } +/** + * Send HP bar update to others. + * @param sd: Player invoking update + */ +void clif_update_hp(map_session_data &sd) { + if (map_getmapdata(sd.bl.m)->hpmeter_visible) + clif_hpmeter(&sd); + if (!battle_config.party_hp_mode && sd.status.party_id) + clif_party_hp(&sd); + if (sd.bg_id) + clif_bg_hp(&sd); +} + /// Notifies client of a character parameter change. /// 00b0 .W .L (ZC_PAR_CHANGE) /// 00b1 .W .L (ZC_LONGPAR_CHANGE) @@ -3717,15 +3730,7 @@ void clif_updatestatus(struct map_session_data *sd,int type) } break; case SP_HP: - if( map_getmapdata(sd->bl.m)->hpmeter_visible ){ - clif_hpmeter(sd); - } - if( !battle_config.party_hp_mode && sd->status.party_id ){ - clif_party_hp(sd); - } - if( sd->bg_id ){ - clif_bg_hp(sd); - } + clif_update_hp(*sd); break; } } diff --git a/src/map/clif.hpp b/src/map/clif.hpp index cbb0a6cc49..239e0ed9fd 100644 --- a/src/map/clif.hpp +++ b/src/map/clif.hpp @@ -647,6 +647,7 @@ void clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x, in void clif_additem(struct map_session_data *sd, int n, int amount, unsigned char fail); // self void clif_dropitem(struct map_session_data *sd,int n,int amount); //self void clif_delitem(struct map_session_data *sd,int n,int amount, short reason); //self +void clif_update_hp(map_session_data &sd); void clif_updatestatus(struct map_session_data *sd,int type); //self void clif_changestatus(struct map_session_data* sd,int type,int val); //area int clif_damage(struct block_list* src, struct block_list* dst, t_tick tick, int sdelay, int ddelay, int64 sdamage, int div, enum e_damage_type type, int64 sdamage2, bool spdamage); // area diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 28cd75ee51..468f3d58b5 100755 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -9947,9 +9947,13 @@ bool pc_setparam(struct map_session_data *sd,int64 type,int64 val_tmp) *------------------------------------------*/ void pc_heal(struct map_session_data *sd,unsigned int hp,unsigned int sp, unsigned int ap, int type) {// Is there going to be a effect for gaining AP soon??? [Rytech] + nullpo_retv(sd); + if (type&2) { - if (hp || type&4) + if (hp || type&4) { clif_heal(sd->fd,SP_HP,hp); + clif_update_hp(*sd); + } if (sp) clif_heal(sd->fd,SP_SP,sp); if (ap) diff --git a/src/map/skill.cpp b/src/map/skill.cpp index 21c3a64546..34f495e88a 100755 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -12077,7 +12077,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui else if (status_get_hp(bl) != status_get_max_hp(bl)) heal = ((2 * skill_lv - 1) * 10) * status_get_max_hp(bl) / 100; clif_skill_nodamage(src, bl, skill_id, skill_lv, 1); - status_heal(bl, heal, 0, 1|2|4); + status_heal(bl, heal, 0, 0); } break; diff --git a/src/map/status.cpp b/src/map/status.cpp index c84178f0ca..fbfb914067 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -14331,7 +14331,7 @@ TIMER_FUNC(status_change_timer){ break; case SC_FRESHSHRIMP: if (--(sce->val4) >= 0) { - status_heal(bl, sce->val2, 0, 3); + status_heal(bl, sce->val2, 0, 0); sc_timer_next((10000 - ((sce->val1 - 1) * 1000)) + tick); return 0; }