Core/Spells: only provide base difficulty spell Ids to criteria events to match their requirements (see It's Not Easy Being Green' for reference)

This commit is contained in:
Ovahlord committed 2023-10-11 02:09:44 +02:00
1 parent faa4fbfbce
commit 4ff88148c8
3 files changed
+14 -7

No files matched your search

+9 -4
View File
@@ -176,13 +176,18 @@ void SpellMgr::SetSpellDifficultyId(uint32 spellId, uint32 id)
uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, WorldObject const* caster) const
{
if (!GetSpellInfo(spellId))
return spellId;
if (!caster || !caster->GetMap() || !caster->GetMap()->IsDungeon())
return spellId;
uint32 mode = uint32(caster->GetMap()->GetSpawnMode());
return GetSpellIdForDifficulty(spellId, Difficulty(caster->GetMap()->GetSpawnMode()));
}
uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Difficulty difficulty) const
{
if (!GetSpellInfo(spellId))
return spellId;
uint32 mode = difficulty;
if (mode >= MAX_DIFFICULTY)
{
TC_LOG_ERROR("spells", "SpellMgr::GetSpellIdForDifficulty: Incorrect difficulty for spell %u.", spellId);