fix(Core/Spell): Allow using SpellDifficulty in bg (#19422)

* fix(Core/Spell): Allow using SpellDifficulty in bg

* cherry-pick commit (e4caf52e5a)

* "Allow get SpellDifficulty on battleground maps
This is only for Isle of Conquest (Bracket 71-79 is Regular Difficulty, Bracket 80-84 is heroic or 25Man)
Spells of IoC Battleground vehicles, cannons, bombs and bosses have SpellDifficulty in DBC"

* Remove redundant CastSpell and assign a variable instead

Co-Authored-By: Gildor <521036+Jildor@users.noreply.github.com>

* Update isle_of_conquest.cpp

---------

Co-authored-by: Gildor <521036+Jildor@users.noreply.github.com>
This commit is contained in:
Kitzunu
2024-07-18 18:12:41 +02:00
committed by GitHub
parent d26a2cac52
commit 59766e10c6
3 changed files with 21 additions and 11 deletions

View File

@@ -492,7 +492,7 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con
if (!GetSpellInfo(spellId))
return spellId;
if (!caster || !caster->GetMap() || !caster->GetMap()->IsDungeon())
if (!caster || !caster->GetMap() || (!caster->GetMap()->IsDungeon() && !caster->GetMap()->IsBattleground()))
return spellId;
uint32 mode = uint32(caster->GetMap()->GetSpawnMode());