diff --git a/ryzom/server/src/entities_game_service/egs_variables.cpp b/ryzom/server/src/entities_game_service/egs_variables.cpp index bc4fb54b4..7288af5b3 100644 --- a/ryzom/server/src/entities_game_service/egs_variables.cpp +++ b/ryzom/server/src/entities_game_service/egs_variables.cpp @@ -307,6 +307,8 @@ CVariable MaxCharacteristicValue("egs","MaxCharacteristicValue", "Max // factor on creature and npc damage CVariable BotDamageFactor("egs","BotDamageFactor", "Factor applied on all Bots (creature and npcs) damage", 1.0f, 0, true ); +CVariable ApplyAverageDodgeFactor("egs","ApplyAverageDodgeFactor", "Whether to use the average dodge factor in calculating mob damage ", true, 0, true ); + CVariable HitChestStaLossFactor("egs","HitChestStaLossFactor", "factor of damage also lost in sta when hit to chest", 0.5f, 0, true ); CVariable HitHeadStunDuration("egs","HitHeadStunDuration", "duration (in seconds) of a stun when hit to head", 2.5f, 0, true ); CVariable HitArmsSlowDuration("egs","HitArmsSlowDuration", "duration (in seconds) of a slow attack when hit to arms", 5.0f, 0, true ); diff --git a/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp b/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp index 9ab1925bd..68e10593e 100644 --- a/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp +++ b/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp @@ -40,6 +40,7 @@ extern CCreatureManager CreatureManager; // skill used when no weapon in hand (hand to hand combat) extern SKILLS::ESkills BarehandCombatSkill; extern CVariable HandToHandReachValue; +extern CVariable ApplyAverageDodgeFactor; //-------------------------------------------------------------- @@ -294,7 +295,8 @@ void CCombatAttackerAI::initFromRowId( const TDataSetRow &rowId ) _SkillValue = form->getAttackLevel(); _RightHandWeapon.Quality = (uint16)_SkillValue; - _RightHandWeapon.Damage = (float)form->getCreatureDamagePerHit() * BotDamageFactor; + uint32 creatureDph = ApplyAverageDodgeFactor ? form->getCreatureDamagePerHit() : form->getCreatureDamagePerHitWithoutAverageDodge(); + _RightHandWeapon.Damage = (float)creatureDph * BotDamageFactor; _RightHandWeapon.DmgType = DMGTYPE::SLASHING; _RightHandWeapon.LatencyInTicks = (double)form->getAttackLatency(); @@ -439,7 +441,8 @@ void CCombatAttackerNpc::initFromRowId( const TDataSetRow &rowId ) _RightHandWeapon.LatencyInTicks = HandToHandLatency; _RightHandWeapon.Quality = (uint16)_SkillValue; - _RightHandWeapon.Damage = (float)form->getCreatureDamagePerHit() * BotDamageFactor; + uint32 creatureDph = ApplyAverageDodgeFactor ? form->getCreatureDamagePerHit() : form->getCreatureDamagePerHitWithoutAverageDodge(); + _RightHandWeapon.Damage = (float)creatureDph * BotDamageFactor; _RightHandWeapon.SabrinaCost = (uint16)_SkillValue; _RightHandWeapon.ReachValue = form->getMeleeReachValue();