@@ -28,13 +28,10 @@ class mod_zone_difficulty_unitscript : public UnitScript
28
28
void OnAuraApply (Unit* target, Aura* aura) override
29
29
{
30
30
if (!sZoneDifficulty ->IsEnabled )
31
- {
32
31
return ;
33
- }
32
+
34
33
if (!sZoneDifficulty ->MythicmodeInNormalDungeons && !target->GetMap ()->IsRaidOrHeroicDungeon ())
35
- {
36
34
return ;
37
- }
38
35
39
36
if (sZoneDifficulty ->IsValidNerfTarget (target))
40
37
{
@@ -48,9 +45,7 @@ class mod_zone_difficulty_unitscript : public UnitScript
48
45
{
49
46
// Skip spells not affected by vulnerability (potions)
50
47
if (spellInfo->HasAttribute (SPELL_ATTR0_NO_IMMUNITIES))
51
- {
52
48
return ;
53
- }
54
49
55
50
if (spellInfo->HasAura (SPELL_AURA_SCHOOL_ABSORB))
56
51
{
@@ -59,19 +54,13 @@ class mod_zone_difficulty_unitscript : public UnitScript
59
54
for (AuraEffect* eff : AuraEffectList)
60
55
{
61
56
if ((eff->GetAuraType () != SPELL_AURA_SCHOOL_ABSORB) || (eff->GetSpellInfo ()->Id != spellInfo->Id ))
62
- {
63
57
continue ;
64
- }
65
58
66
59
if (sZoneDifficulty ->IsDebugInfoEnabled && target)
67
60
{
68
61
if (Player* player = target->ToPlayer ()) // Pointless check? Perhaps.
69
- {
70
62
if (player->GetSession ())
71
- {
72
- ChatHandler (player->GetSession ()).PSendSysMessage (" Spell: %s (%u) Base Value: %i" , spellInfo->SpellName [player->GetSession ()->GetSessionDbcLocale ()], spellInfo->Id , eff->GetAmount ());
73
- }
74
- }
63
+ ChatHandler (player->GetSession ()).PSendSysMessage (" Spell: {} ({}) Base Value: {}" , spellInfo->SpellName [player->GetSession ()->GetSessionDbcLocale ()], spellInfo->Id , eff->GetAmount ());
75
64
}
76
65
77
66
int32 absorb = eff->GetAmount ();
@@ -124,12 +113,8 @@ class mod_zone_difficulty_unitscript : public UnitScript
124
113
if (sZoneDifficulty ->IsDebugInfoEnabled && target)
125
114
{
126
115
if (Player* player = target->ToPlayer ()) // Pointless check? Perhaps.
127
- {
128
116
if (player->GetSession ())
129
- {
130
- ChatHandler (player->GetSession ()).PSendSysMessage (" Spell: %s (%u) Post Nerf Value: %i" , spellInfo->SpellName [player->GetSession ()->GetSessionDbcLocale ()], spellInfo->Id , eff->GetAmount ());
131
- }
132
- }
117
+ ChatHandler (player->GetSession ()).PSendSysMessage (" Spell: {} ({}) Post Nerf Value: {}" , spellInfo->SpellName [player->GetSession ()->GetSessionDbcLocale ()], spellInfo->Id , eff->GetAmount ());
133
118
}
134
119
}
135
120
}
@@ -141,34 +126,27 @@ class mod_zone_difficulty_unitscript : public UnitScript
141
126
void ModifyHealReceived (Unit* target, Unit* /* healer*/ , uint32& heal, SpellInfo const * spellInfo) override
142
127
{
143
128
if (!sZoneDifficulty ->IsEnabled )
144
- {
145
129
return ;
146
- }
130
+
147
131
if (!sZoneDifficulty ->MythicmodeInNormalDungeons && !target->GetMap ()->IsRaidOrHeroicDungeon ())
148
- {
149
132
return ;
150
- }
151
133
152
134
if (sZoneDifficulty ->IsValidNerfTarget (target))
153
135
{
154
136
if (spellInfo)
155
137
{
156
138
if (spellInfo->HasEffect (SPELL_EFFECT_HEALTH_LEECH))
157
- {
158
139
return ;
159
- }
140
+
160
141
for (auto const & eff : spellInfo->GetEffects ())
161
142
{
162
143
if (eff.ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)
163
- {
164
144
return ;
165
- }
166
145
}
146
+
167
147
// Skip spells not affected by vulnerability (potions) and bandages
168
148
if (spellInfo->HasAttribute (SPELL_ATTR0_NO_IMMUNITIES) || spellInfo->Mechanic == MECHANIC_BANDAGE)
169
- {
170
149
return ;
171
- }
172
150
}
173
151
174
152
uint32 mapId = target->GetMapId ();
@@ -230,9 +208,8 @@ class mod_zone_difficulty_unitscript : public UnitScript
230
208
void ModifyPeriodicDamageAurasTick (Unit* target, Unit* attacker, uint32& damage, SpellInfo const * spellInfo) override
231
209
{
232
210
if (!sZoneDifficulty ->IsEnabled )
233
- {
234
211
return ;
235
- }
212
+
236
213
if (!sZoneDifficulty ->MythicmodeInNormalDungeons && !target->GetMap ()->IsRaidOrHeroicDungeon ())
237
214
{
238
215
return ;
@@ -252,17 +229,13 @@ class mod_zone_difficulty_unitscript : public UnitScript
252
229
}
253
230
254
231
if (!isDot)
255
- {
256
232
return ;
257
- }
258
233
259
234
// Disclaimer: also affects disables boss adds buff.
260
235
if (sConfigMgr ->GetOption <bool >(" ModZoneDifficulty.SpellBuff.OnlyBosses" , false ))
261
236
{
262
237
if (attacker->ToCreature () && !attacker->ToCreature ()->IsDungeonBoss ())
263
- {
264
238
return ;
265
- }
266
239
}
267
240
268
241
if (sZoneDifficulty ->IsValidNerfTarget (target))
@@ -374,8 +347,8 @@ class mod_zone_difficulty_unitscript : public UnitScript
374
347
{
375
348
if (player->GetSession ())
376
349
{
377
- ChatHandler (player->GetSession ()).PSendSysMessage (" Spell: %s (%u ) Before Nerf Value: %i (%f Normal Mode)" , spellInfo->SpellName [player->GetSession ()->GetSessionDbcLocale ()], spellInfo->Id , damage, sZoneDifficulty ->NerfInfo [mapId][matchingPhase].SpellDamageBuffPct );
378
- ChatHandler (player->GetSession ()).PSendSysMessage (" Spell: %s (%u ) Before Nerf Value: %i (%f Mythic Mode)" , spellInfo->SpellName [player->GetSession ()->GetSessionDbcLocale ()], spellInfo->Id , damage, sZoneDifficulty ->NerfInfo [mapId][matchingPhase].SpellDamageBuffPctHard );
350
+ ChatHandler (player->GetSession ()).PSendSysMessage (" Spell: {} ({} ) Before Nerf Value: {} ({} Normal Mode)" , spellInfo->SpellName [player->GetSession ()->GetSessionDbcLocale ()], spellInfo->Id , damage, sZoneDifficulty ->NerfInfo [mapId][matchingPhase].SpellDamageBuffPct );
351
+ ChatHandler (player->GetSession ()).PSendSysMessage (" Spell: {} ({} ) Before Nerf Value: {} ({} Mythic Mode)" , spellInfo->SpellName [player->GetSession ()->GetSessionDbcLocale ()], spellInfo->Id , damage, sZoneDifficulty ->NerfInfo [mapId][matchingPhase].SpellDamageBuffPctHard );
379
352
}
380
353
}
381
354
}
@@ -412,7 +385,7 @@ class mod_zone_difficulty_unitscript : public UnitScript
412
385
{
413
386
if (player->GetSession ())
414
387
{
415
- ChatHandler (player->GetSession ()).PSendSysMessage (" Spell: %s (%u ) Post Nerf Value: %i " , spellInfo->SpellName [player->GetSession ()->GetSessionDbcLocale ()], spellInfo->Id , damage);
388
+ ChatHandler (player->GetSession ()).PSendSysMessage (" Spell: {} ({} ) Post Nerf Value: {} " , spellInfo->SpellName [player->GetSession ()->GetSessionDbcLocale ()], spellInfo->Id , damage);
416
389
}
417
390
}
418
391
}
0 commit comments