[Feature] Add Avoidance and HP Regen Per Second too NPC Scaling. (#3050)

This commit is contained in:
Aeadoin
2023-03-09 11:07:03 -05:00
committed by GitHub
parent 412eb5deaa
commit b0be4ca8bd
9 changed files with 88 additions and 37 deletions
+5
View File
@@ -6407,6 +6407,11 @@ int64 Mob::GetHPRegen() const
return hp_regen;
}
int64 Mob::GetHPRegenPerSecond() const
{
return hp_regen_per_second;
}
int64 Mob::GetManaRegen() const
{
return mana_regen;
+1
View File
@@ -1382,6 +1382,7 @@ public:
int64 DoDamageCaps(int64 base_damage);
int64 GetHPRegen() const;
int64 GetHPRegenPerSecond() const;
int64 GetManaRegen() const;
bool CanOpenDoors() const;
+14
View File
@@ -164,6 +164,10 @@ void NpcScaleManager::ScaleNPC(
npc->ModifyNPCStat("hp_regen", std::to_string(scale_data.hp_regen_rate));
}
if (always_scale || (npc->GetHPRegenPerSecond() == 0 && is_auto_scaled)) {
npc->ModifyNPCStat("hp_regen_per_second", std::to_string(scale_data.hp_regen_per_second));
}
if (always_scale || npc->GetAttackDelay() == 0) {
npc->ModifyNPCStat("attack_delay", std::to_string(scale_data.attack_delay));
}
@@ -176,6 +180,10 @@ void NpcScaleManager::ScaleNPC(
npc->ModifyNPCStat("heal_scale", std::to_string(scale_data.heal_scale));
}
if (always_scale || npc->GetAvoidanceRating() == 0) {
npc->ModifyNPCStat("avoidance", std::to_string(scale_data.avoidance));
}
if (always_scale || npc->GetHeroicStrikethrough() == 0) {
npc->ModifyNPCStat("heroic_strikethrough", std::to_string(scale_data.heroic_strikethrough));
}
@@ -253,9 +261,11 @@ bool NpcScaleManager::LoadScaleData()
scale_data.min_dmg = s.min_dmg;
scale_data.max_dmg = s.max_dmg;
scale_data.hp_regen_rate = s.hp_regen_rate;
scale_data.hp_regen_per_second = s.hp_regen_per_second;
scale_data.attack_delay = s.attack_delay;
scale_data.spell_scale = s.spell_scale;
scale_data.heal_scale = s.heal_scale;
scale_data.avoidance = s.avoidance;
scale_data.heroic_strikethrough = s.heroic_strikethrough;
if (!s.special_abilities.empty()) {
@@ -664,9 +674,11 @@ bool NpcScaleManager::ApplyGlobalBaseScalingToNPCStatically(NPC *&npc)
n.mindmg = g.min_dmg;
n.maxdmg = g.max_dmg;
n.hp_regen_rate = g.hp_regen_rate;
n.hp_regen_per_second = g.hp_regen_per_second;
n.attack_delay = g.attack_delay;
n.spellscale = static_cast<float>(g.spell_scale);
n.healscale = static_cast<float>(g.heal_scale);
n.Avoidance = g.avoidance;
n.heroic_strikethrough = g.heroic_strikethrough;
n.special_abilities = g.special_abilities;
@@ -730,9 +742,11 @@ bool NpcScaleManager::ApplyGlobalBaseScalingToNPCDynamically(NPC *&npc)
n.mindmg = 0;
n.maxdmg = 0;
n.hp_regen_rate = 0;
n.hp_regen_per_second = 0;
n.attack_delay = 0;
n.spellscale = 0;
n.healscale = 0;
n.Avoidance = 0;
n.heroic_strikethrough = 0;
n.special_abilities = "";
+5
View File
@@ -54,9 +54,11 @@ public:
int min_dmg;
int max_dmg;
int64 hp_regen_rate;
int64 hp_regen_per_second;
int attack_delay;
int spell_scale;
int heal_scale;
uint32 avoidance;
int heroic_strikethrough;
std::string special_abilities;
@@ -85,9 +87,12 @@ public:
"min_hit",
"max_hit",
"hp_regen",
"hp_regen_per_second",
"attack_delay",
"spell_scale",
"heal_scale",
"avoidance",
"heroic_strikethrough",
"special_abilities"
};