Core/Spells: implement reputation requirements for spells (mostly used in guild spells such as Guild Page)

This commit is contained in:
Ovahlord committed 2023-08-13 11:48:20 +02:00
1 parent e936684e78
commit a57e27e6d3
3 files changed
+9

No files matched your search

+5
View File
@@ -5916,6 +5916,11 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
return SPELL_FAILED_REQUIRES_SPELL_FOCUS;
}
// check reputation
if (m_spellInfo->MinFactionId && m_spellInfo->MinReputation && m_caster->IsPlayer())
if (m_caster->ToPlayer()->GetReputationRank(m_spellInfo->MinFactionId) < static_cast<ReputationRank>(m_spellInfo->MinReputation))
return SPELL_FAILED_REPUTATION;
SpellCastResult castResult = SPELL_CAST_OK;
// always (except passive spells) check items (only player related checks)