39#include <unordered_map>
40#include <unordered_set>
240#define MELEE_BASED_TRIGGER_MASK (PROC_FLAG_DEAL_MELEE_SWING | \
241 PROC_FLAG_TAKE_MELEE_SWING | \
242 PROC_FLAG_DEAL_MELEE_ABILITY | \
243 PROC_FLAG_TAKE_MELEE_ABILITY | \
244 PROC_FLAG_DEAL_RANGED_ATTACK | \
245 PROC_FLAG_TAKE_RANGED_ATTACK | \
246 PROC_FLAG_DEAL_RANGED_ABILITY | \
247 PROC_FLAG_TAKE_RANGED_ABILITY)
309#define PROC_ATTR_ALL_ALLOWED (PROC_ATTR_REQ_EXP_OR_HONOR | \
310 PROC_ATTR_TRIGGERED_CAN_PROC | \
311 PROC_ATTR_REQ_POWER_COST | \
312 PROC_ATTR_REQ_SPELLMOD | \
313 PROC_ATTR_USE_STACKS_FOR_CHARGES | \
314 PROC_ATTR_REDUCE_PROC_60)
366 return hash<uint32>()(
uint32(group));
371#define SPELL_GROUP_DB_RANGE_MIN 1000
485 PetAura() : removeOnChangePet(false), damage(0) { }
488 removeOnChangePet(_removeOnChangePet), damage(_damage)
490 auras[petEntry] = aura;
495 PetAuraMap::const_iterator itr = auras.find(petEntry);
496 if (itr != auras.end())
498 PetAuraMap::const_iterator itr2 = auras.find(0);
499 if (itr2 != auras.end())
506 auras[petEntry] = aura;
511 return removeOnChangePet;
631#define MAX_CREATURE_SPELL_DATA_SLOT 4
641typedef std::unordered_map<std::pair<SpellLinkedType, uint32>, std::vector<int32>>
SpellLinkedMap;
669 std::array<SpellEffectEntry const*, MAX_SPELL_EFFECTS>
Effects = { };
672 std::vector<SpellLabelEntry const*>
Labels;
675 std::array<SpellPowerEntry const*, MAX_POWERS_PER_SPELL>
Powers = { };
682 std::vector<SpellXSpellVisualEntry const*>
Visuals;
704 static bool IsSpellValid(
SpellInfo const* spellInfo,
Player* player =
nullptr,
bool msg =
true);
719 bool IsSpellRequiringSpell(
uint32 spellid,
uint32 req_spellid)
const;
724 bool IsSpellLearnSpell(
uint32 spell_id)
const;
725 bool IsSpellLearnToSpell(
uint32 spell_id1,
uint32 spell_id2)
const;
735 void GetSetOfSpellsInSpellGroup(
SpellGroup group_id, std::set<uint32>& foundSpells)
const;
736 void GetSetOfSpellsInSpellGroup(
SpellGroup group_id, std::set<uint32>& foundSpells, std::set<SpellGroup>& usedGroups)
const;
739 bool AddSameEffectStackRuleSpellGroups(
SpellInfo const* spellInfo,
uint32 auraType,
int32 amount, std::map<SpellGroup, int32>& groups)
const;
755 bool IsArenaAllowedEnchancment(
uint32 ench_id)
const;
778 SpellInfo const* spellInfo = GetSpellInfo(spellId, difficulty);
783 void ForEachSpellInfo(std::function<
void(
SpellInfo const*)> callback);
784 void ForEachSpellInfoDifficulty(
uint32 spellId, std::function<
void(
SpellInfo const*)> callback);
786 void LoadPetFamilySpellsStore();
794 void UnloadSpellInfoChains();
795 void LoadSpellRanks();
796 void LoadSpellRequired();
797 void LoadSpellLearnSkills();
798 void LoadSpellLearnSpells();
799 void LoadSpellTargetPositions();
800 void LoadSpellGroups();
801 void LoadSpellGroupStackRules();
802 void LoadSpellProcs();
803 void LoadSpellThreats();
804 void LoadSkillLineAbilityMap();
805 void LoadSpellPetAuras();
806 void LoadSpellEnchantProcData();
807 void LoadSpellLinked();
808 void LoadPetLevelupSpellMap();
809 void LoadPetDefaultSpells();
810 void LoadSpellAreas();
811 void LoadSpellInfoStore();
812 void UnloadSpellInfoStore();
813 void UnloadSpellInfoImplicitTargetConditionLists();
814 void LoadSpellInfoServerside();
815 void LoadSpellInfoCustomAttributes();
816 void LoadSpellInfoCorrections();
817 void LoadSpellInfoSpellSpecificAndAuraState();
818 void LoadSpellInfoDiminishing();
819 void LoadSpellInfoImmunities();
820 void LoadSpellTotemModel();
849#define sSpellMgr SpellMgr::instance()
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
std::multimap< uint32, SpellLearnSpellNode > SpellLearnSpellMap
bool IsPrimaryProfessionSkill(uint32 skill)
bool IsPartOfSkillLine(uint32 skillId, uint32 spellId)
std::unordered_map< uint32, SpellEnchantProcEntry > SpellEnchantProcEventMap
std::multimap< uint32, SpellArea const * > SpellAreaForAuraMap
std::unordered_map< SpellGroup, std::unordered_set< uint32 > > SameEffectStackMap
bool IsProfessionOrRidingSkill(uint32 skill)
DEFINE_ENUM_FLAG(ProcFlags)
std::unordered_multimap< SpellGroup, int32 > SpellGroupSpellMap
std::pair< SpellsRequiringSpellMap::const_iterator, SpellsRequiringSpellMap::const_iterator > SpellsRequiringSpellMapBounds
@ SPELLFAMILYFLAG_SHAMAN_MANA_SPRING
@ SPELLFAMILYFLAG_WARLOCK_LIFETAP
@ SPELLFAMILYFLAG_WARRIOR_CONCUSSION_BLOW
@ SPELLFAMILYFLAG1_ROGUE_SHADOWSTEP
@ SPELLFAMILYFLAG_WARRIOR_EXECUTE
@ SPELLFAMILYFLAG2_SHAMAN_LAVA_LASH
@ SPELLFAMILYFLAG_SHAMAN_TOTEM_EFFECTS
@ SPELLFAMILYFLAG_DK_DEATH_COIL
@ SPELLFAMILYFLAG_SHAMAN_FROST_SHOCK
@ SPELLFAMILYFLAG_WARRIOR_SLAM
@ SPELLFAMILYFLAG2_DRUID_STARFALL
@ SPELLFAMILYFLAG0_ROGUE_VAN_SPRINT
@ SPELLFAMILYFLAG1_PALADIN_DIVINESTORM
@ SPELLFAMILYFLAG1_ROGUE_DISMANTLE_SMOKE_BOMB
@ SPELLFAMILYFLAG_WARRIOR_CHARGE
@ SPELLFAMILYFLAG_DK_DEATH_STRIKE
@ SPELLFAMILYFLAG_SHAMAN_HEALING_STREAM
@ SPELLFAMILYFLAG0_ROGUE_KICK
@ SPELLFAMILYFLAG0_ROGUE_VANISH
@ SPELLFAMILYFLAG_SHAMAN_FIRE_NOVA
std::map< std::pair< uint32, SpellEffIndex >, SpellTargetPosition > SpellTargetPositionMap
std::pair< SpellSpellGroupMap::const_iterator, SpellSpellGroupMap::const_iterator > SpellSpellGroupMapBounds
bool IsProfessionSkill(uint32 skill)
bool IsWeaponSkill(uint32 skill)
std::multimap< uint32, SpellArea > SpellAreaMap
std::pair< SpellAreaMap::const_iterator, SpellAreaMap::const_iterator > SpellAreaMapBounds
std::map< uint32, uint32 > SpellDifficultySearcherMap
@ SPELL_GROUP_ELIXIR_SHATTRATH
@ SPELL_GROUP_CORE_RANGE_MAX
@ SPELL_GROUP_ELIXIR_BATTLE
@ SPELL_GROUP_ELIXIR_GUARDIAN
@ SPELL_GROUP_ELIXIR_UNSTABLE
@ PROC_ATTR_CANT_PROC_FROM_ITEM_CAST
@ PROC_ATTR_USE_STACKS_FOR_CHARGES
@ PROC_ATTR_REDUCE_PROC_60
@ PROC_ATTR_REQ_EXP_OR_HONOR
@ PROC_ATTR_TRIGGERED_CAN_PROC
@ PROC_ATTR_REQ_POWER_COST
std::pair< SpellAreaForAreaMap::const_iterator, SpellAreaForAreaMap::const_iterator > SpellAreaForAreaMapBounds
std::unordered_map< uint32, SpellChainNode > SpellChainMap
@ PROC_SPELL_PHASE_FINISH
@ PROC_SPELL_PHASE_MASK_ALL
std::multimap< uint32, SpellArea const * > SpellAreaForAreaMap
std::unordered_map< uint32, SpellThreatEntry > SpellThreatMap
#define MAX_CREATURE_SPELL_DATA_SLOT
@ SPELL_GROUP_STACK_RULE_EXCLUSIVE_FROM_SAME_CASTER
@ SPELL_GROUP_STACK_RULE_EXCLUSIVE
@ SPELL_GROUP_STACK_RULE_DEFAULT
@ SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT
@ SPELL_GROUP_STACK_RULE_EXCLUSIVE_HIGHEST
@ SPELL_GROUP_STACK_RULE_MAX
std::unordered_multimap< uint32, SpellGroup > SpellSpellGroupMap
std::pair< SpellRequiredMap::const_iterator, SpellRequiredMap::const_iterator > SpellRequiredMapBounds
std::multimap< uint32, SkillLineAbilityEntry const * > SkillLineAbilityMap
std::map< uint32, PetAura > SpellPetAuraMap
std::unordered_map< std::pair< SpellLinkedType, uint32 >, std::vector< int32 > > SpellLinkedMap
std::multimap< uint32, SpellArea const * > SpellAreaForQuestMap
std::map< int32, PetDefaultSpellsEntry > PetDefaultSpellsMap
@ PROC_SPELL_TYPE_MASK_ALL
@ PROC_SPELL_TYPE_NO_DMG_HEAL
@ SPELLCATEGORY_DEVOUR_MAGIC
@ SPELLCATEGORY_HEALTH_MANA_POTIONS
@ SPELLCATEGORY_JUDGEMENT
std::pair< SpellGroupSpellMap::const_iterator, SpellGroupSpellMap::const_iterator > SpellGroupSpellMapBounds
TC_GAME_API PetFamilySpellsStore sPetFamilySpellsStore
@ SPELL_AREA_FLAG_AUTOREMOVE
@ SPELL_AREA_FLAG_IGNORE_AUTOCAST_ON_QUEST_STATUS_CHANGE
@ SPELL_AREA_FLAG_AUTOCAST
std::unordered_map< uint32, SpellLearnSkillNode > SpellLearnSkillMap
std::pair< SpellAreaForAuraMap::const_iterator, SpellAreaForAuraMap::const_iterator > SpellAreaForAuraMapBounds
std::pair< SkillLineAbilityMap::const_iterator, SkillLineAbilityMap::const_iterator > SkillLineAbilityMapBounds
@ PROC_FLAG_PROC_CLONE_SPELL
@ PROC_FLAG_DEAL_MELEE_ABILITY
@ PROC_FLAG_TAKE_HARMFUL_PERIODIC
@ PROC_FLAG_MAIN_HAND_WEAPON_SWING
@ PROC_FLAG_TAKE_MELEE_SWING
@ PROC_FLAG_TAKE_ANY_DAMAGE
@ AUTO_ATTACK_PROC_FLAG_MASK
@ PROC_FLAG_TAKE_HELPFUL_ABILITY
@ PROC_FLAG_DEAL_RANGED_ABILITY
@ PROC_FLAG_ENCOUNTER_START
@ PROC_FLAG_DEAL_MELEE_SWING
@ TAKEN_HIT_PROC_FLAG_MASK
@ PROC_FLAG_TAKE_HELPFUL_SPELL
@ PROC_FLAG_DEAL_HELPFUL_ABILITY
@ PROC_FLAG_DEAL_RANGED_ATTACK
@ PROC_FLAG_TAKE_HARMFUL_SPELL
@ PROC_FLAG_TAKE_MELEE_ABILITY
@ PROC_FLAG_DEAL_HARMFUL_ABILITY
@ PROC_FLAG_DEAL_HARMFUL_PERIODIC
@ REQ_SPELL_PHASE_PROC_FLAG_MASK
@ PROC_FLAG_OFF_HAND_WEAPON_SWING
@ PROC_FLAG_DEAL_HELPFUL_SPELL
@ PROC_FLAG_DEAL_HELPFUL_PERIODIC
@ PROC_FLAG_DEAL_HARMFUL_SPELL
@ PROC_FLAG_TAKE_RANGED_ABILITY
@ DONE_HIT_PROC_FLAG_MASK
@ PROC_FLAG_TAKE_HELPFUL_PERIODIC
@ PROC_FLAG_TAKE_RANGED_ATTACK
@ PROC_FLAG_TAKE_HARMFUL_ABILITY
std::map< uint32, PetLevelupSpellSet > PetLevelupSpellMap
std::set< uint32 > PetFamilySpellsSet
@ EFFECT_RADIUS_500_YARDS
@ EFFECT_RADIUS_100_YARDS
@ EFFECT_RADIUS_45_YARDS_2
@ EFFECT_RADIUS_60_YARDS_2
@ EFFECT_RADIUS_50000_YARDS_2
@ EFFECT_RADIUS_5_YARDS_3
@ EFFECT_RADIUS_130_YARDS
@ EFFECT_RADIUS_10_YARDS_2
@ EFFECT_RADIUS_15_YARDS_2
@ EFFECT_RADIUS_5_YARDS_2
@ EFFECT_RADIUS_50000_YARDS
@ EFFECT_RADIUS_60_YARDS_3
@ EFFECT_RADIUS_200_YARDS
@ EFFECT_RADIUS_3_5_YARDS
@ EFFECT_RADIUS_150_YARDS
@ EFFECT_RADIUS_80_YARDS_2
@ EFFECT_RADIUS_15_YARDS_3
@ EFFECT_RADIUS_0_5_YARDS
@ PROC_FLAG_2_TARGET_DIES
@ PROC_FLAG_2_CAST_SUCCESSFUL
std::multimap< uint32, uint32 > SpellsRequiringSpellMap
@ ENCHANT_PROC_ATTR_LIMIT_60
@ ENCHANT_PROC_ATTR_WHITE_HIT
std::multimap< uint32, uint32 > SpellRequiredMap
std::map< uint32, PetFamilySpellsSet > PetFamilySpellsStore
std::map< std::pair< uint32, uint8 >, uint32 > SpellTotemModelMap
std::pair< SpellAreaForQuestMap::const_iterator, SpellAreaForQuestMap::const_iterator > SpellAreaForQuestMapBounds
std::unordered_map< SpellGroup, SpellGroupStackRule > SpellGroupStackMap
std::pair< SpellLearnSpellMap::const_iterator, SpellLearnSpellMap::const_iterator > SpellLearnSpellMapBounds
std::multimap< uint32, uint32 > PetLevelupSpellSet
std::unordered_map< uint32, uint32 > PetAuraMap
uint32 GetAura(uint32 petEntry) const
PetAura(uint32 petEntry, uint32 aura, bool _removeOnChangePet, int _damage)
bool IsRemovedOnChangePet() const
void AddAura(uint32 petEntry, uint32 aura)
SpellRequiredMap mSpellReq
SpellLinkedMap mSpellLinkedMap
SpellMgr(SpellMgr const &right)=delete
SpellMgr(SpellMgr &&right)=delete
SkillLineAbilityMap mSkillLineAbilityMap
SpellAreaForAuraMap mSpellAreaForAuraMap
SpellChainMap mSpellChains
SpellMgr & operator=(SpellMgr &&right)=delete
SpellPetAuraMap mSpellPetAuraMap
SpellLearnSkillMap mSpellLearnSkills
SpellAreaForQuestMap mSpellAreaForQuestEndMap
PetDefaultSpellsMap mPetDefaultSpellsMap
SpellDifficultySearcherMap mSpellDifficultySearcherMap
SpellTotemModelMap mSpellTotemModel
SpellGroupStackMap mSpellGroupStack
SpellEnchantProcEventMap mSpellEnchantProcEventMap
PetLevelupSpellMap mPetLevelupSpellMap
SpellsRequiringSpellMap mSpellsReqSpell
SpellTargetPositionMap mSpellTargetPositions
SpellGroupSpellMap mSpellGroupSpell
SameEffectStackMap mSpellSameEffectStack
SpellAreaForAreaMap mSpellAreaForAreaMap
SpellAreaMap mSpellAreaMap
SpellInfo const * AssertSpellInfo(uint32 spellId, Difficulty difficulty) const
SpellLearnSpellMap mSpellLearnSpells
SpellSpellGroupMap mSpellSpellGroup
SpellThreatMap mSpellThreatMap
SpellAreaForQuestMap mSpellAreaForQuestMap
SpellMgr & operator=(SpellMgr const &right)=delete
Utility class to enable range for loop syntax for multimap.equal_range uses.
std::bitset< MAX_MECHANIC > Mechanic
std::vector< SpellEffectName > Effect
std::bitset< MAX_SPELL_SCHOOL > School
std::bitset< DISPEL_MAX > DispelType
std::vector< AuraType > Aura
uint32 spellid[MAX_CREATURE_SPELL_DATA_SLOT]
Trinity::RaceMask< uint64 > raceMask
SpellCastingRequirementsEntry const * CastingRequirements
SpellReagentsEntry const * Reagents
std::vector< SpellXSpellVisualEntry const * > Visuals
SpellTargetRestrictionsEntry const * TargetRestrictions
std::vector< SpellLabelEntry const * > Labels
SpellTotemsEntry const * Totems
SpellAuraRestrictionsEntry const * AuraRestrictions
SpellScalingEntry const * Scaling
SpellInterruptsEntry const * Interrupts
SpellCategoriesEntry const * Categories
SpellEquippedItemsEntry const * EquippedItems
SpellShapeshiftEntry const * Shapeshift
SpellAuraOptionsEntry const * AuraOptions
std::array< SpellEffectEntry const *, MAX_SPELL_EFFECTS > Effects
SpellClassOptionsEntry const * ClassOptions
std::vector< SpellReagentsCurrencyEntry const * > ReagentsCurrency
SpellCooldownsEntry const * Cooldowns
SpellLevelsEntry const * Levels
ProcFlagsSpellPhase SpellPhaseMask
ProcFlagsSpellType SpellTypeMask
uint32 DisableEffectsMask
ProcAttributes AttributesMask
size_t operator()(SpellGroup const &group) const noexcept