Skip to content

Commit

Permalink
跟随 344021f, 调整 mob_default_damagemotion 战斗配置选项的作用位置
Browse files Browse the repository at this point in the history
  • Loading branch information
CairoLee committed Oct 28, 2023
1 parent 344021f commit 54b0008
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
6 changes: 5 additions & 1 deletion conf/battle/pandas.conf
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,15 @@ itemdb_warning_policy: 0
// 将此选项设置为 1 可用于解决部分技能在
// 攻击 DamageMotion 为 0 的魔物时可能出现的异常:
//
// - 无法正常播放攻击者的施法动作
// - 攻击者的施法动作异常
//
// - 用刀刃之舞 (SHC_DANCING_KNIFE) 打训练用龙蛋 (编号: 2411)
// 由于龙蛋的 DamageMotion 字段没被定义因此默认值是 0,
// 这会导致刀刃之舞的攻击动画出现异常.
//
// 异常的表现是施法角色会对被攻击的魔物进行平砍攻击动作,
// 而官服的正常情况下不会有此动作.
//
// 通过将此选项的值改成 1, 攻击此类魔物就可以避免动画异常.
//
// - 发生了暴击但是伤害数字没有暴击的红色气泡
Expand Down
21 changes: 21 additions & 0 deletions src/map/mob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4673,6 +4673,27 @@ s_mob_db::s_mob_db()
status.amotion = cap_value(0, battle_config.monster_max_aspd, 2000);
status.mode = static_cast<e_mode>(MONSTER_TYPE_06);

#ifdef Pandas_BattleConfig_MobDB_DamageMotion_Min
if (battle_config.mob_default_damagemotion) {
uint16 speed = battle_config.mob_default_damagemotion;

if (battle_config.monster_damage_delay_rate != 100)
speed = speed * battle_config.monster_damage_delay_rate / 100;

status.dmotion = speed;

if (battle_config.mob_default_damagemotion == 1 &&
battle_config.monster_damage_delay_rate < 100 && speed == 0) {
// 避免在 mob_default_damagemotion 设置为 1 且 monster_damage_delay_rate 在小于 100 的时候,
// 值会被修正成了 0 从而导致客户端跳过播放受伤动画的问题
status.dmotion = 1;
}
}
else {
status.dmotion = 0;
}
#endif // Pandas_BattleConfig_MobDB_DamageMotion_Min

vd.class_ = id;
}

Expand Down

0 comments on commit 54b0008

Please sign in to comment.