From 4768402fed3355ea57c9f9a02c31f1be132bee05 Mon Sep 17 00:00:00 2001 From: AnchyDev Date: Fri, 8 Mar 2024 20:55:07 +1100 Subject: [PATCH] Added option to disable autoscaling. --- src/scripts/ToSInstanceScript.cpp | 20 +++++++++++--------- src/scripts/ToSUnitScript.cpp | 8 ++++---- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/scripts/ToSInstanceScript.cpp b/src/scripts/ToSInstanceScript.cpp index 02299e9..b82bd09 100644 --- a/src/scripts/ToSInstanceScript.cpp +++ b/src/scripts/ToSInstanceScript.cpp @@ -85,15 +85,17 @@ void ToSInstanceScript::SpawnNextWave(ToSWaveTemplate* waveTemplate = nullptr) auto summon = sToSMapMgr->SpawnNPC(enemy->creatureEntry, instance, &tempPos); - // Scale the mobs to 80 - summon->SetLevel(80, true); - - uint32 baseHP = 8000; - uint32 hpDivider = 15; - float hpMultiplier = (1.0f + (float(currentWave) / float(hpDivider))); - uint32 health = baseHP * hpMultiplier; - summon->SetMaxHealth(health); - summon->SetHealth(health); + if(sConfigMgr->GetOption("TrialOfStrength.AutoScaling", true)) + { + summon->SetLevel(80, true); + + uint32 baseHP = 8000; + uint32 hpDivider = 15; + float hpMultiplier = (1.0f + (float(currentWave) / float(hpDivider))); + uint32 health = baseHP * hpMultiplier; + summon->SetMaxHealth(health); + summon->SetHealth(health); + } ApplyCurses(summon); diff --git a/src/scripts/ToSUnitScript.cpp b/src/scripts/ToSUnitScript.cpp index be524b8..6ec377f 100644 --- a/src/scripts/ToSUnitScript.cpp +++ b/src/scripts/ToSUnitScript.cpp @@ -66,8 +66,8 @@ void ToSUnitScript::ModifyMeleeDamage(Unit* /*target*/, Unit* attacker, uint32& uint32 currentWave = iScript->GetData(TOS_DATA_ENCOUNTER_CURRENT_WAVE); - uint32 baseDamage = sConfigMgr->GetOption("TrialOfStrength.Scaling.BaseDamage.Physical", 500); - uint32 damageDivider = sConfigMgr->GetOption("TrialOfStrength.Scaling.BaseDamage.PhysicalDivider", 15);; + uint32 baseDamage = sConfigMgr->GetOption("TrialOfStrength.AutoScaling.BaseDamage.Physical", 500); + uint32 damageDivider = sConfigMgr->GetOption("TrialOfStrength.AutoScaling.BaseDamage.PhysicalDivider", 15);; uint32 newDamage = baseDamage * (1.0f + (float(currentWave) / float(damageDivider))); @@ -111,8 +111,8 @@ void ToSUnitScript::ModifySpellDamageTaken(Unit* /*target*/, Unit* attacker, int uint32 currentWave = iScript->GetData(TOS_DATA_ENCOUNTER_CURRENT_WAVE); - uint32 baseDamage = sConfigMgr->GetOption("TrialOfStrength.Scaling.BaseDamage.Spell", 2000); - uint32 damageDivider = sConfigMgr->GetOption("TrialOfStrength.Scaling.BaseDamage.SpellDivider", 15);; + uint32 baseDamage = sConfigMgr->GetOption("TrialOfStrength.AutoScaling.BaseDamage.Spell", 2000); + uint32 damageDivider = sConfigMgr->GetOption("TrialOfStrength.AutoScaling.BaseDamage.SpellDivider", 15);; uint32 newDamage = baseDamage * (1.0f + (float(currentWave) / float(damageDivider)));