소스 검색

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>
gamingmagic 5 년 전
부모
커밋
e2a1bb3f0c
3개의 변경된 파일32개의 추가작업 그리고 3개의 파일을 삭제
  1. 8 0
      conf/battle/skill.conf
  2. 23 3
      src/map/battle.cpp
  3. 1 0
      src/map/battle.hpp

+ 8 - 0
conf/battle/skill.conf

@@ -196,6 +196,14 @@ devotion_rdamage: 0
 // But if the target is being devoted, it ONLY reflects the damage for melee skill. (Note 1)
 // But if the target is being devoted, it ONLY reflects the damage for melee skill. (Note 1)
 devotion_rdamage_skill_only: yes
 devotion_rdamage_skill_only: yes
 
 
+// On AEGIS there is a bug when the player who is under devotion is sitting and getting hit.
+// The player stands up on client side, but will still remain sitting on server side.
+// Because of this the player will not be able to walk anymore, until the player sat down/stood up again or used @refresh.
+// You can read more about it on https://github.com/rathena/rathena/issues/1927
+// Default: yes (because it is a recommended bug fix from our side)
+// Official: no
+devotion_standup_fix: yes
+
 // If no than you can use the ensemble skills alone. (Note 1)
 // If no than you can use the ensemble skills alone. (Note 1)
 player_skill_partner_check: yes
 player_skill_partner_check: yes
 
 

+ 23 - 3
src/map/battle.cpp

@@ -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) &&
 	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;
 		damage = 0;
+	}
 
 
 	if ( !battle_config.delay_battle_damage || amotion <= 1 ) {
 	if ( !battle_config.delay_battle_damage || amotion <= 1 ) {
 		//Deal damage
 		//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)
 				(d_bl->type == BL_PC && ((TBL_PC*)d_bl)->devotion[sce->val2] == target->id)
 				) && check_distance_bl(target, d_bl, sce->val3) )
 				) && 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
 			else
 				status_change_end(target, SC_DEVOTION, INVALID_TIMER);
 				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_idleskill_rate",           &battle_config.boss_nopc_idleskill_rate,        100,    0,    100,              },
 	{ "boss_nopc_move_rate",                &battle_config.boss_nopc_move_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,        },
 	{ "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"
 #include "../custom/battle_config_init.inc"
 };
 };

+ 1 - 0
src/map/battle.hpp

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