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 e4794c3

Browse files
committedAug 16, 2024·
fix: Fix output messages after fmt updates
1 parent 7524d6c commit e4794c3

File tree

2 files changed

+13
-42
lines changed

2 files changed

+13
-42
lines changed
 

‎src/mod_zone_difficulty_handler.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ void ZoneDifficulty::AddMythicmodeScore(Map* map, uint32 type, uint32 score)
578578
//}
579579

580580
std::string typestring = sZoneDifficulty->GetContentTypeString(type);
581-
ChatHandler(player->GetSession()).PSendSysMessage("You have received Mythicmode score %s New score: %i", typestring, sZoneDifficulty->MythicmodeScore[player->GetGUID().GetCounter()][type]);
581+
ChatHandler(player->GetSession()).PSendSysMessage("You have received Mythicmode score {} New score: {}", typestring, sZoneDifficulty->MythicmodeScore[player->GetGUID().GetCounter()][type]);
582582
CharacterDatabase.Execute("REPLACE INTO zone_difficulty_mythicmode_score VALUES({}, {}, {})", player->GetGUID().GetCounter(), type, sZoneDifficulty->MythicmodeScore[player->GetGUID().GetCounter()][type]);
583583
}
584584
}
@@ -672,13 +672,11 @@ void ZoneDifficulty::SendItem(Player* player, uint32 category, uint32 itemType,
672672
bool ZoneDifficulty::IsMythicmodeMap(uint32 mapId)
673673
{
674674
if (!sZoneDifficulty->MythicmodeEnable)
675-
{
676675
return false;
677-
}
676+
678677
if (sZoneDifficulty->MythicmodeLoot.find(mapId) == sZoneDifficulty->MythicmodeLoot.end())
679-
{
680678
return false;
681-
}
679+
682680
return true;
683681
}
684682

‎src/mod_zone_difficulty_scripts.cpp

+10-37
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,10 @@ class mod_zone_difficulty_unitscript : public UnitScript
2828
void OnAuraApply(Unit* target, Aura* aura) override
2929
{
3030
if (!sZoneDifficulty->IsEnabled)
31-
{
3231
return;
33-
}
32+
3433
if (!sZoneDifficulty->MythicmodeInNormalDungeons && !target->GetMap()->IsRaidOrHeroicDungeon())
35-
{
3634
return;
37-
}
3835

3936
if (sZoneDifficulty->IsValidNerfTarget(target))
4037
{
@@ -48,9 +45,7 @@ class mod_zone_difficulty_unitscript : public UnitScript
4845
{
4946
// Skip spells not affected by vulnerability (potions)
5047
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
51-
{
5248
return;
53-
}
5449

5550
if (spellInfo->HasAura(SPELL_AURA_SCHOOL_ABSORB))
5651
{
@@ -59,19 +54,13 @@ class mod_zone_difficulty_unitscript : public UnitScript
5954
for (AuraEffect* eff : AuraEffectList)
6055
{
6156
if ((eff->GetAuraType() != SPELL_AURA_SCHOOL_ABSORB) || (eff->GetSpellInfo()->Id != spellInfo->Id))
62-
{
6357
continue;
64-
}
6558

6659
if (sZoneDifficulty->IsDebugInfoEnabled && target)
6760
{
6861
if (Player* player = target->ToPlayer()) // Pointless check? Perhaps.
69-
{
7062
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());
7564
}
7665

7766
int32 absorb = eff->GetAmount();
@@ -124,12 +113,8 @@ class mod_zone_difficulty_unitscript : public UnitScript
124113
if (sZoneDifficulty->IsDebugInfoEnabled && target)
125114
{
126115
if (Player* player = target->ToPlayer()) // Pointless check? Perhaps.
127-
{
128116
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());
133118
}
134119
}
135120
}
@@ -141,34 +126,27 @@ class mod_zone_difficulty_unitscript : public UnitScript
141126
void ModifyHealReceived(Unit* target, Unit* /*healer*/, uint32& heal, SpellInfo const* spellInfo) override
142127
{
143128
if (!sZoneDifficulty->IsEnabled)
144-
{
145129
return;
146-
}
130+
147131
if (!sZoneDifficulty->MythicmodeInNormalDungeons && !target->GetMap()->IsRaidOrHeroicDungeon())
148-
{
149132
return;
150-
}
151133

152134
if (sZoneDifficulty->IsValidNerfTarget(target))
153135
{
154136
if (spellInfo)
155137
{
156138
if (spellInfo->HasEffect(SPELL_EFFECT_HEALTH_LEECH))
157-
{
158139
return;
159-
}
140+
160141
for (auto const& eff : spellInfo->GetEffects())
161142
{
162143
if (eff.ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)
163-
{
164144
return;
165-
}
166145
}
146+
167147
// Skip spells not affected by vulnerability (potions) and bandages
168148
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) || spellInfo->Mechanic == MECHANIC_BANDAGE)
169-
{
170149
return;
171-
}
172150
}
173151

174152
uint32 mapId = target->GetMapId();
@@ -230,9 +208,8 @@ class mod_zone_difficulty_unitscript : public UnitScript
230208
void ModifyPeriodicDamageAurasTick(Unit* target, Unit* attacker, uint32& damage, SpellInfo const* spellInfo) override
231209
{
232210
if (!sZoneDifficulty->IsEnabled)
233-
{
234211
return;
235-
}
212+
236213
if (!sZoneDifficulty->MythicmodeInNormalDungeons && !target->GetMap()->IsRaidOrHeroicDungeon())
237214
{
238215
return;
@@ -252,17 +229,13 @@ class mod_zone_difficulty_unitscript : public UnitScript
252229
}
253230

254231
if (!isDot)
255-
{
256232
return;
257-
}
258233

259234
// Disclaimer: also affects disables boss adds buff.
260235
if (sConfigMgr->GetOption<bool>("ModZoneDifficulty.SpellBuff.OnlyBosses", false))
261236
{
262237
if (attacker->ToCreature() && !attacker->ToCreature()->IsDungeonBoss())
263-
{
264238
return;
265-
}
266239
}
267240

268241
if (sZoneDifficulty->IsValidNerfTarget(target))
@@ -374,8 +347,8 @@ class mod_zone_difficulty_unitscript : public UnitScript
374347
{
375348
if (player->GetSession())
376349
{
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);
379352
}
380353
}
381354
}
@@ -412,7 +385,7 @@ class mod_zone_difficulty_unitscript : public UnitScript
412385
{
413386
if (player->GetSession())
414387
{
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);
416389
}
417390
}
418391
}

0 commit comments

Comments
 (0)
Please sign in to comment.