Skip to content

Commit

Permalink
fix: Do not apply Normal scaling if Mythic is enabled (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
sogladev authored Jan 10, 2025
1 parent 0e0b185 commit bceea32
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions src/mod_zone_difficulty_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,15 @@ class mod_zone_difficulty_unitscript : public UnitScript
if (matchingPhase != -1)
{
Map* map = target->GetMap();
if (sZoneDifficulty->HasNormalMode(mode))
uint32 instanceId = map->GetInstanceId();
bool isMythicMode = sZoneDifficulty->MythicmodeInstanceData[instanceId];

if (!isMythicMode && sZoneDifficulty->HasNormalMode(mode))
absorb = scaleAbsorb(absorb, sZoneDifficulty->NerfInfo[mapId][matchingPhase].AbsorbNerfPct);

if (sZoneDifficulty->HasMythicmode(mode) && sZoneDifficulty->MythicmodeInstanceData[target->GetMap()->GetInstanceId()])
{
if (isMythicMode && sZoneDifficulty->HasMythicmode(mode))
if (map->IsRaid() || (map->IsHeroic() && map->IsDungeon()))
absorb = scaleAbsorb(absorb, sZoneDifficulty->NerfInfo[mapId][matchingPhase].AbsorbNerfPctHard);
}
}
else if (sZoneDifficulty->NerfInfo[DUEL_INDEX][0].Enabled > 0 && nerfInDuel)
absorb = scaleAbsorb(absorb, sZoneDifficulty->NerfInfo[DUEL_INDEX][0].AbsorbNerfPct);
Expand Down Expand Up @@ -178,17 +179,18 @@ class mod_zone_difficulty_unitscript : public UnitScript
if (matchingPhase != -1)
{
Map* map = target->GetMap();
if (sZoneDifficulty->HasNormalMode(mode))
uint32 instanceId = map->GetInstanceId();
bool isMythicMode = sZoneDifficulty->MythicmodeInstanceData[instanceId];

if (!isMythicMode && sZoneDifficulty->HasNormalMode(mode))
heal = heal * sZoneDifficulty->NerfInfo[mapId][matchingPhase].HealingNerfPct;

if (sZoneDifficulty->HasMythicmode(mode) && sZoneDifficulty->MythicmodeInstanceData[map->GetInstanceId()])
if (isMythicMode && sZoneDifficulty->HasMythicmode(mode))
if (map->IsRaid() || (map->IsHeroic() && map->IsDungeon()))
heal = heal * sZoneDifficulty->NerfInfo[mapId][matchingPhase].HealingNerfPctHard;
}
else if (sZoneDifficulty->NerfInfo[DUEL_INDEX][0].Enabled > 0 && nerfInDuel)
{
heal = heal * sZoneDifficulty->NerfInfo[DUEL_INDEX][0].HealingNerfPct;
}
}
}
}
Expand Down Expand Up @@ -234,19 +236,19 @@ class mod_zone_difficulty_unitscript : public UnitScript
{
int8 mode = sZoneDifficulty->NerfInfo[mapId][matchingPhase].Enabled;
Map* map = target->GetMap();
uint32 instanceId = map->GetInstanceId();
bool isMythicMode = sZoneDifficulty->MythicmodeInstanceData[instanceId];

if (sZoneDifficulty->HasNormalMode(mode))
if (!isMythicMode && sZoneDifficulty->HasNormalMode(mode))
damage = damage * sZoneDifficulty->NerfInfo[mapId][matchingPhase].SpellDamageBuffPct;

if (sZoneDifficulty->HasMythicmode(mode) && sZoneDifficulty->MythicmodeInstanceData[map->GetInstanceId()])
if (isMythicMode && sZoneDifficulty->HasMythicmode(mode))
if (map->IsRaid() || (map->IsHeroic() && map->IsDungeon()))
damage = damage * sZoneDifficulty->NerfInfo[mapId][matchingPhase].SpellDamageBuffPctHard;
}
else if (sZoneDifficulty->ShouldNerfInDuels(target))
{
if (sZoneDifficulty->NerfInfo[DUEL_INDEX][0].Enabled > 0)
damage = damage * sZoneDifficulty->NerfInfo[DUEL_INDEX][0].SpellDamageBuffPct;
}

if (sZoneDifficulty->IsDebugInfoEnabled && attacker)
if (Player* player = attacker->ToPlayer())
Expand Down Expand Up @@ -309,19 +311,19 @@ class mod_zone_difficulty_unitscript : public UnitScript
{
int8 mode = sZoneDifficulty->NerfInfo[mapId][matchingPhase].Enabled;
Map* map = target->GetMap();
uint32 instanceId = map->GetInstanceId();
bool isMythicMode = sZoneDifficulty->MythicmodeInstanceData[instanceId];

if (sZoneDifficulty->HasNormalMode(mode))
if (!isMythicMode && sZoneDifficulty->HasNormalMode(mode))
damage = damage * sZoneDifficulty->NerfInfo[mapId][matchingPhase].SpellDamageBuffPct;

if (sZoneDifficulty->HasMythicmode(mode) && sZoneDifficulty->MythicmodeInstanceData[map->GetInstanceId()])
if (isMythicMode && sZoneDifficulty->HasMythicmode(mode))
if (map->IsRaid() || (map->IsHeroic() && map->IsDungeon()))
damage = damage * sZoneDifficulty->NerfInfo[mapId][matchingPhase].SpellDamageBuffPctHard;
}
else if (sZoneDifficulty->ShouldNerfInDuels(target))
{
if (sZoneDifficulty->NerfInfo[DUEL_INDEX][0].Enabled > 0)
damage = damage * sZoneDifficulty->NerfInfo[DUEL_INDEX][0].SpellDamageBuffPct;
}

if (sZoneDifficulty->IsDebugInfoEnabled && target)
if (Player* player = target->ToPlayer()) // Pointless check? Perhaps.
Expand Down Expand Up @@ -351,19 +353,19 @@ class mod_zone_difficulty_unitscript : public UnitScript
{
int8 mode = sZoneDifficulty->NerfInfo[mapId][matchingPhase].Enabled;
Map* map = target->GetMap();
uint32 instanceId = map->GetInstanceId();
bool isMythicMode = sZoneDifficulty->MythicmodeInstanceData[instanceId];

if (sZoneDifficulty->HasNormalMode(mode))
if (!isMythicMode && sZoneDifficulty->HasNormalMode(mode))
damage = damage * sZoneDifficulty->NerfInfo[mapId][matchingPhase].MeleeDamageBuffPct;

if (sZoneDifficulty->HasMythicmode(mode) && sZoneDifficulty->MythicmodeInstanceData[target->GetMap()->GetInstanceId()])
if (isMythicMode && sZoneDifficulty->HasMythicmode(mode))
if (map->IsRaid() || (map->IsHeroic() && map->IsDungeon()))
damage = damage * sZoneDifficulty->NerfInfo[mapId][matchingPhase].MeleeDamageBuffPctHard;
}
else if (sZoneDifficulty->ShouldNerfInDuels(target))
{
if (sZoneDifficulty->NerfInfo[DUEL_INDEX][0].Enabled > 0)
damage = damage * sZoneDifficulty->NerfInfo[DUEL_INDEX][0].MeleeDamageBuffPct;
}
}
}

Expand Down

0 comments on commit bceea32

Please sign in to comment.