From b4bdc4eea678628ffdfda9bf2c1f8c9f02b7b7f1 Mon Sep 17 00:00:00 2001 From: Matan Shukry Date: Wed, 10 Feb 2021 00:06:45 +0200 Subject: Core/Players: - Fixed auto learning class abilities that are rewarded from quests if starting Exile's Reach in case player chose not to start there (#26036) --- src/server/game/Spells/SpellInfo.cpp | 10 ++++++++++ src/server/game/Spells/SpellInfo.h | 4 ++++ 2 files changed, 14 insertions(+) (limited to 'src/server/game/Spells') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index c005bfab5bd..c58ae80fa1a 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1127,6 +1127,7 @@ SpellInfo::SpellInfo(SpellNameEntry const* spellName, ::Difficulty difficulty, S IconFileDataId = _misc ? _misc->SpellIconFileDataID : 0; ActiveIconFileDataId = _misc ? _misc->ActiveIconFileDataID : 0; ContentTuningId = _misc ? _misc->ContentTuningID : 0; + ShowFutureSpellPlayerConditionID = _misc ? _misc->ShowFutureSpellPlayerConditionID : 0; _visuals = std::move(visuals); @@ -4532,3 +4533,12 @@ void SpellInfo::_UnloadImplicitTargetConditionLists() } } } + +bool SpellInfo::MeetsFutureSpellPlayerCondition(Player const* player) const +{ + if (ShowFutureSpellPlayerConditionID == 0) + return false; + + PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(ShowFutureSpellPlayerConditionID); + return !playerCondition || ConditionMgr::IsPlayerMeetingCondition(player, playerCondition); +} diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index aa5c6400a3f..be0dda67508 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -509,6 +509,7 @@ class TC_GAME_API SpellInfo uint32 IconFileDataId; uint32 ActiveIconFileDataId; uint32 ContentTuningId; + uint32 ShowFutureSpellPlayerConditionID; LocalizedString const* SpellName; float ConeAngle; float Width; @@ -686,6 +687,9 @@ class TC_GAME_API SpellInfo uint32 GetAllowedMechanicMask() const; + // Player Condition + bool MeetsFutureSpellPlayerCondition(Player const* player) const; + private: // loading helpers void _InitializeExplicitTargetMask(); -- cgit v1.2.3