mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
[Bug Fix] Mob scaling issue with min dmg set to zero while max dmg is not (#3351)
* fix for mob scaling issue with min dmg set to zero while max dmg is not. * Cleanup --------- Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
+18
-2
@@ -2611,15 +2611,31 @@ void NPC::ModifyNPCStat(const std::string& stat, const std::string& value)
|
||||
return;
|
||||
}
|
||||
else if (stat_lower == "min_hit") {
|
||||
min_dmg = Strings::ToInt(value);
|
||||
min_dmg = Strings::ToInt(value);
|
||||
|
||||
// TODO: fix DB
|
||||
|
||||
if (min_dmg > max_dmg) {
|
||||
const auto temporary_damage = max_dmg;
|
||||
max_dmg = min_dmg;
|
||||
min_dmg = temporary_damage;
|
||||
}
|
||||
|
||||
base_damage = round((max_dmg - min_dmg) / 1.9);
|
||||
min_damage = min_dmg - round(base_damage / 10.0);
|
||||
return;
|
||||
}
|
||||
else if (stat_lower == "max_hit") {
|
||||
max_dmg = Strings::ToInt(value);
|
||||
max_dmg = Strings::ToInt(value);
|
||||
|
||||
// TODO: fix DB
|
||||
|
||||
if (max_dmg < min_dmg) {
|
||||
const auto temporary_damage = min_dmg;
|
||||
min_dmg = max_dmg;
|
||||
max_dmg = temporary_damage;
|
||||
}
|
||||
|
||||
base_damage = round((max_dmg - min_dmg) / 1.9);
|
||||
min_damage = min_dmg - round(base_damage / 10.0);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user