Fixed sitting issue for devoted players (#4538)

Fixes #1927

If aplayer is under devotion and gets attacked he will remain sitting server side, while standing up client side. This will result in the player not being able to move anymore, until he sat down/stood up again.

Since this is the real behavior on AEGIS we added a configuration for the fix, which will be enabled by default, since we think this is broken behavior. You can always turn it off in case you want to mimic official behavior.

Additionally fixed the devoting player as well:
The devoting player should also stand up when the devoted player is hit.
If the player is missed or he lucky dodges and no damage is dealt, no damage packet should be sent to the devoter.
Additionally fixed that the devoter did not use the waving damage animation, because the amotion and dmotion values were not sent.

Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
gamingmagic
2020-01-25 20:57:28 +08:00
committed by Lemongrass3110
parent 8eae62aae2
commit e2a1bb3f0c
3 changed files with 32 additions and 3 deletions

View File

@@ -352,8 +352,16 @@ int battle_delay_damage(t_tick tick, int amotion, struct block_list *src, struct
}
if( ((d_tbl && check_distance_bl(target, d_tbl, sc->data[SC_DEVOTION]->val3)) || e_tbl) &&
damage > 0 && skill_id != PA_PRESSURE && skill_id != CR_REFLECTSHIELD )
damage > 0 && skill_id != PA_PRESSURE && skill_id != CR_REFLECTSHIELD ){
struct map_session_data* tsd = BL_CAST( BL_PC, target );
if( tsd && pc_issit( tsd ) && battle_config.devotion_standup_fix ){
pc_setstand( tsd, true );
skill_sit( tsd, 0 );
}
damage = 0;
}
if ( !battle_config.delay_battle_damage || amotion <= 1 ) {
//Deal damage
@@ -7406,8 +7414,19 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
(d_bl->type == BL_PC && ((TBL_PC*)d_bl)->devotion[sce->val2] == target->id)
) && check_distance_bl(target, d_bl, sce->val3) )
{
clif_damage(d_bl, d_bl, gettick(), 0, 0, damage, 0, DMG_NORMAL, 0, false);
status_fix_damage(NULL, d_bl, damage, 0);
// Only trigger if the devoted player was hit
if( damage > 0 ){
struct map_session_data* dsd = BL_CAST( BL_PC, d_bl );
// The devoting player needs to stand up
if( dsd && pc_issit( dsd ) ){
pc_setstand( dsd, true );
skill_sit( dsd, 0 );
}
clif_damage(d_bl, d_bl, gettick(), wd.amotion, wd.dmotion, damage, 1, DMG_NORMAL, 0, false);
status_fix_damage(NULL, d_bl, damage, 0);
}
}
else
status_change_end(target, SC_DEVOTION, INVALID_TIMER);
@@ -8554,6 +8573,7 @@ static const struct _battle_data {
{ "boss_nopc_idleskill_rate", &battle_config.boss_nopc_idleskill_rate, 100, 0, 100, },
{ "boss_nopc_move_rate", &battle_config.boss_nopc_move_rate, 100, 0, 100, },
{ "hom_idle_no_share", &battle_config.hom_idle_no_share, 0, 0, INT_MAX, },
{ "devotion_standup_fix", &battle_config.devotion_standup_fix, 1, 0, 1, },
#include "../custom/battle_config_init.inc"
};

View File

@@ -664,6 +664,7 @@ struct Battle_Config
int boss_nopc_idleskill_rate;
int boss_nopc_move_rate;
int hom_idle_no_share;
int devotion_standup_fix;
#include "../custom/battle_config_struct.inc"
};