Skip to content

Commit

Permalink
Added option to disable autoscaling.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnchyDev committed Mar 8, 2024
1 parent 786c3fe commit 4768402
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
20 changes: 11 additions & 9 deletions src/scripts/ToSInstanceScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>("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);

Expand Down
8 changes: 4 additions & 4 deletions src/scripts/ToSUnitScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32>("TrialOfStrength.Scaling.BaseDamage.Physical", 500);
uint32 damageDivider = sConfigMgr->GetOption<uint32>("TrialOfStrength.Scaling.BaseDamage.PhysicalDivider", 15);;
uint32 baseDamage = sConfigMgr->GetOption<uint32>("TrialOfStrength.AutoScaling.BaseDamage.Physical", 500);
uint32 damageDivider = sConfigMgr->GetOption<uint32>("TrialOfStrength.AutoScaling.BaseDamage.PhysicalDivider", 15);;

uint32 newDamage = baseDamage * (1.0f + (float(currentWave) / float(damageDivider)));

Expand Down Expand Up @@ -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<uint32>("TrialOfStrength.Scaling.BaseDamage.Spell", 2000);
uint32 damageDivider = sConfigMgr->GetOption<uint32>("TrialOfStrength.Scaling.BaseDamage.SpellDivider", 15);;
uint32 baseDamage = sConfigMgr->GetOption<uint32>("TrialOfStrength.AutoScaling.BaseDamage.Spell", 2000);
uint32 damageDivider = sConfigMgr->GetOption<uint32>("TrialOfStrength.AutoScaling.BaseDamage.SpellDivider", 15);;

uint32 newDamage = baseDamage * (1.0f + (float(currentWave) / float(damageDivider)));

Expand Down

0 comments on commit 4768402

Please sign in to comment.