-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 [Bug] Creature damage configuration option does not apply to physical ranged attacks #2721
Comments
I edited the When changing line 1752 However, when I change line 1754 I would expect it to be multiplied by 10, like with melee damage. |
As stated in the OP, the min and max ranged damage is calculated in the function These values are read by the function We can inspect those values in-game by executing
The correct damage values are written into the These values are read by the function I print a message into the mangos console every time this function is executed, and it turns out that this function is only called when an enemy makes an attack with either the main-hand (attack type Now I need to find out how the damage of a ranged attack is actually calculated. |
As I noted in the previous comment, This function differentiates between Weapon Attacks and Magical Attacks. This makes sense for melee attacks. My current solution is this:
I tested this in Westfall with the Riverpaw Scouts and the Defias Pillagers in Moonbrook. Still, I cannot be sure that there aren't any unwanted side-effects; |
🐛 Bug report
It seems to me that the
Rate.Creature.*.Damage
option inmangosd.conf
does not apply to physical ranged attacks (e.g. bow or crossbow).I compiled vmangos on Arch Linux and used the default mangosd.conf.
I play with a client version 1.12.1, build number 5875.
I created a Level 13 Human Warrior,
set the Defense skill the 65/65,
used only the starting equipment,
i.e. I had nearly no armor.
Then I went to Westfall and got attacked by a Level 12 'Riverpaw Scout'.
This one attacks with a crossbow,
and switches to melee as soon as the player gets in melee range.
I set my HP to 100000 and watched the damage.
I ignored critical hits, blocked, or crushing damage.
The ranged attacks had a strength of 19-25,
while the melee attack did 16-21 damage to me.
Now I set
Rate.Creature.Normal.Damage = 0.2
inmangosd.conf
and restarted the server.Same situation as before;
melee attacks now between 2-4,
but the ranged attacks were still at 19-25.
The config option apparently only had an effect on the melee damage,
but not on the range damage.
Expected behavior
Here is a part of
mangosd.conf
:It says 'Damage' affects melee damage,
but it doesn't say it only affects melee damage.
So it's not clear to me what is the intended behavior.
It would seem strange to me if one could modify melee and spell damage,
but not physical range damage.
Look in the source code where the config option is used:
The config option is set in
src/game/World.cpp
and stored in the arraym_configFloatValues
at indexCONFIG_FLOAT_RATE_CREATURE_NORMAL_DAMAGE
.Look where this config option is used:
In
src/game/Objects/Creature.cpp
, the function_GetDamageMod
returns this config option value:Let's see where the function
_GetDamageMod
is called:So we have the declaration in the header file, the function header in
Creature.cpp
,and 4 function calls in total: three in
Creature.cpp
and one inPet.cpp
.The call in
Pet.cpp
seem to apply to enemy pets, which is not relevant here.Another call is in the function
GetDefaultDamageRange
.This function is only called in some scripts for bosses in mc and zg,
so it is not relevant here.
The same applies to the function
ResetStats
.Inside this function, the
_GetDamageMod
function is called,but the
ResetStats
function itself is only called in some scripts for zg bosses:That leaves only one call of
_GetDamageMod
inCreature.cpp
.It is in the function
InitStatsForLevel
:This seems to me the right place to look at.
I see that the ranged damage is multiplied by
damageMod
.To me this looks how it is supposed to be,
however in the game the damage modifier is not applied.
This is where I don't know what to do anymore.
Why is this important?
I like to play alone locally,
and to do dungeons I set the HP and damage of creatures to 0.2.
This works fine,
but when I encounter an enemy that uses physical range attacks,
its damage output is far higher than all the other enemies.
I label this as a bug,
because I suspect this is not intended behavior.
If it is,
I would appreciate if someone can point me to what parts of the code need to be changed to make it work.
Then I could at least apply a patch for myself before compiling the core.
Steps to reproduce
Version & Environment
Client Version: 1.12.1.5875
Commit Hash: https://github.com/vmangos/core/tree/9b3b375ef34e92b70e343f057eebea6df75601de
OS Client: Arch Linux
OS Server: Arch Linux
Crashlog
The text was updated successfully, but these errors were encountered: