Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/mod_zone_difficulty_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ class mod_zone_difficulty_unitscript : public UnitScript
public:
mod_zone_difficulty_unitscript() : UnitScript("mod_zone_difficulty_unitscript") { }

bool IsExcludedSpell(uint32 spellId)
{
static const std::unordered_set<uint32> excludedSpells = { 31852, 31851, 31850 };
return excludedSpells.find(spellId) != excludedSpells.end();
}

void OnAuraApply(Unit* target, Aura* aura) override
{
if (!sZoneDifficulty->IsEnabled)
Expand All @@ -38,7 +44,7 @@ class mod_zone_difficulty_unitscript : public UnitScript
uint32 mapId = target->GetMapId();
bool nerfInDuel = sZoneDifficulty->ShouldNerfInDuels(target);

//Check if the map of the target is subject of a nerf at all OR if the target is subject of a nerf in a duel
// Check if the map of the target is subject to a nerf at all OR if the target is subject to a nerf in a duel
if (sZoneDifficulty->ShouldNerfMap(mapId) || nerfInDuel)
{
if (SpellInfo const* spellInfo = aura->GetSpellInfo())
Expand All @@ -47,6 +53,10 @@ class mod_zone_difficulty_unitscript : public UnitScript
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))
return;

// Use the function to skip excluded spells
if (IsExcludedSpell(spellInfo->Id))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just checkk for the spell ids here instead of adding another iteration please

return;

if (spellInfo->HasAura(SPELL_AURA_SCHOOL_ABSORB))
{
std::list<AuraEffect*> AuraEffectList = target->GetAuraEffectsByType(SPELL_AURA_SCHOOL_ABSORB);
Expand Down Expand Up @@ -81,7 +91,7 @@ class mod_zone_difficulty_unitscript : public UnitScript
absorb = eff->GetAmount() * sZoneDifficulty->NerfInfo[DUEL_INDEX][0].AbsorbNerfPct;
}

//This check must be last and override duel and map adjustments
// This check must be last and override duel and map adjustments
if (sZoneDifficulty->SpellNerfOverrides.find(spellInfo->Id) != sZoneDifficulty->SpellNerfOverrides.end())
{
if (sZoneDifficulty->SpellNerfOverrides[spellInfo->Id].find(mapId) != sZoneDifficulty->SpellNerfOverrides[spellInfo->Id].end())
Expand Down