Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bceea32

Browse files
authoredJan 10, 2025··
fix: Do not apply Normal scaling if Mythic is enabled (#59)
1 parent 0e0b185 commit bceea32

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed
 

‎src/mod_zone_difficulty_scripts.cpp

+22-20
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,15 @@ class mod_zone_difficulty_unitscript : public UnitScript
7575
if (matchingPhase != -1)
7676
{
7777
Map* map = target->GetMap();
78-
if (sZoneDifficulty->HasNormalMode(mode))
78+
uint32 instanceId = map->GetInstanceId();
79+
bool isMythicMode = sZoneDifficulty->MythicmodeInstanceData[instanceId];
80+
81+
if (!isMythicMode && sZoneDifficulty->HasNormalMode(mode))
7982
absorb = scaleAbsorb(absorb, sZoneDifficulty->NerfInfo[mapId][matchingPhase].AbsorbNerfPct);
8083

81-
if (sZoneDifficulty->HasMythicmode(mode) && sZoneDifficulty->MythicmodeInstanceData[target->GetMap()->GetInstanceId()])
82-
{
84+
if (isMythicMode && sZoneDifficulty->HasMythicmode(mode))
8385
if (map->IsRaid() || (map->IsHeroic() && map->IsDungeon()))
8486
absorb = scaleAbsorb(absorb, sZoneDifficulty->NerfInfo[mapId][matchingPhase].AbsorbNerfPctHard);
85-
}
8687
}
8788
else if (sZoneDifficulty->NerfInfo[DUEL_INDEX][0].Enabled > 0 && nerfInDuel)
8889
absorb = scaleAbsorb(absorb, sZoneDifficulty->NerfInfo[DUEL_INDEX][0].AbsorbNerfPct);
@@ -178,17 +179,18 @@ class mod_zone_difficulty_unitscript : public UnitScript
178179
if (matchingPhase != -1)
179180
{
180181
Map* map = target->GetMap();
181-
if (sZoneDifficulty->HasNormalMode(mode))
182+
uint32 instanceId = map->GetInstanceId();
183+
bool isMythicMode = sZoneDifficulty->MythicmodeInstanceData[instanceId];
184+
185+
if (!isMythicMode && sZoneDifficulty->HasNormalMode(mode))
182186
heal = heal * sZoneDifficulty->NerfInfo[mapId][matchingPhase].HealingNerfPct;
183187

184-
if (sZoneDifficulty->HasMythicmode(mode) && sZoneDifficulty->MythicmodeInstanceData[map->GetInstanceId()])
188+
if (isMythicMode && sZoneDifficulty->HasMythicmode(mode))
185189
if (map->IsRaid() || (map->IsHeroic() && map->IsDungeon()))
186190
heal = heal * sZoneDifficulty->NerfInfo[mapId][matchingPhase].HealingNerfPctHard;
187191
}
188192
else if (sZoneDifficulty->NerfInfo[DUEL_INDEX][0].Enabled > 0 && nerfInDuel)
189-
{
190193
heal = heal * sZoneDifficulty->NerfInfo[DUEL_INDEX][0].HealingNerfPct;
191-
}
192194
}
193195
}
194196
}
@@ -234,19 +236,19 @@ class mod_zone_difficulty_unitscript : public UnitScript
234236
{
235237
int8 mode = sZoneDifficulty->NerfInfo[mapId][matchingPhase].Enabled;
236238
Map* map = target->GetMap();
239+
uint32 instanceId = map->GetInstanceId();
240+
bool isMythicMode = sZoneDifficulty->MythicmodeInstanceData[instanceId];
237241

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

241-
if (sZoneDifficulty->HasMythicmode(mode) && sZoneDifficulty->MythicmodeInstanceData[map->GetInstanceId()])
245+
if (isMythicMode && sZoneDifficulty->HasMythicmode(mode))
242246
if (map->IsRaid() || (map->IsHeroic() && map->IsDungeon()))
243247
damage = damage * sZoneDifficulty->NerfInfo[mapId][matchingPhase].SpellDamageBuffPctHard;
244248
}
245249
else if (sZoneDifficulty->ShouldNerfInDuels(target))
246-
{
247250
if (sZoneDifficulty->NerfInfo[DUEL_INDEX][0].Enabled > 0)
248251
damage = damage * sZoneDifficulty->NerfInfo[DUEL_INDEX][0].SpellDamageBuffPct;
249-
}
250252

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

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

316-
if (sZoneDifficulty->HasMythicmode(mode) && sZoneDifficulty->MythicmodeInstanceData[map->GetInstanceId()])
320+
if (isMythicMode && sZoneDifficulty->HasMythicmode(mode))
317321
if (map->IsRaid() || (map->IsHeroic() && map->IsDungeon()))
318322
damage = damage * sZoneDifficulty->NerfInfo[mapId][matchingPhase].SpellDamageBuffPctHard;
319323
}
320324
else if (sZoneDifficulty->ShouldNerfInDuels(target))
321-
{
322325
if (sZoneDifficulty->NerfInfo[DUEL_INDEX][0].Enabled > 0)
323326
damage = damage * sZoneDifficulty->NerfInfo[DUEL_INDEX][0].SpellDamageBuffPct;
324-
}
325327

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

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

358-
if (sZoneDifficulty->HasMythicmode(mode) && sZoneDifficulty->MythicmodeInstanceData[target->GetMap()->GetInstanceId()])
362+
if (isMythicMode && sZoneDifficulty->HasMythicmode(mode))
359363
if (map->IsRaid() || (map->IsHeroic() && map->IsDungeon()))
360364
damage = damage * sZoneDifficulty->NerfInfo[mapId][matchingPhase].MeleeDamageBuffPctHard;
361365
}
362366
else if (sZoneDifficulty->ShouldNerfInDuels(target))
363-
{
364367
if (sZoneDifficulty->NerfInfo[DUEL_INDEX][0].Enabled > 0)
365368
damage = damage * sZoneDifficulty->NerfInfo[DUEL_INDEX][0].MeleeDamageBuffPct;
366-
}
367369
}
368370
}
369371

0 commit comments

Comments
 (0)
Please sign in to comment.