aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells')
-rw-r--r--src/server/game/Spells/SpellInfo.cpp10
-rw-r--r--src/server/game/Spells/SpellInfo.h4
2 files changed, 14 insertions, 0 deletions
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();