39#include <unordered_map>
40#include <unordered_set>
201#define MELEE_BASED_TRIGGER_MASK (PROC_FLAG_DEAL_MELEE_SWING | \
202 PROC_FLAG_TAKE_MELEE_SWING | \
203 PROC_FLAG_DEAL_MELEE_ABILITY | \
204 PROC_FLAG_TAKE_MELEE_ABILITY | \
205 PROC_FLAG_DEAL_RANGED_ATTACK | \
206 PROC_FLAG_TAKE_RANGED_ATTACK | \
207 PROC_FLAG_DEAL_RANGED_ABILITY | \
208 PROC_FLAG_TAKE_RANGED_ABILITY)
270#define PROC_ATTR_ALL_ALLOWED (PROC_ATTR_REQ_EXP_OR_HONOR | \
271 PROC_ATTR_TRIGGERED_CAN_PROC | \
272 PROC_ATTR_REQ_POWER_COST | \
273 PROC_ATTR_REQ_SPELLMOD | \
274 PROC_ATTR_USE_STACKS_FOR_CHARGES | \
275 PROC_ATTR_REDUCE_PROC_60 | \
276 PROC_ATTR_CANT_PROC_FROM_ITEM_CAST)
328 return hash<uint32>()(
uint32(group));
333#define SPELL_GROUP_DB_RANGE_MIN 1000
440 PetAura() : removeOnChangePet(false), damage(0) { }
443 removeOnChangePet(_removeOnChangePet), damage(_damage)
445 auras[petEntry] = aura;
450 PetAuraMap::const_iterator itr = auras.find(petEntry);
451 if (itr != auras.end())
453 PetAuraMap::const_iterator itr2 = auras.find(0);
454 if (itr2 != auras.end())
461 auras[petEntry] = aura;
466 return removeOnChangePet;
589#define MAX_CREATURE_SPELL_DATA_SLOT 4
599typedef std::unordered_map<std::pair<SpellLinkedType, uint32>, std::vector<int32>>
SpellLinkedMap;
627 std::array<SpellEffectEntry const*, MAX_SPELL_EFFECTS>
Effects = { };
631 std::vector<SpellLabelEntry const*>
Labels;
634 std::array<SpellPowerEntry const*, MAX_POWERS_PER_SPELL>
Powers = { };
641 std::vector<SpellXSpellVisualEntry const*>
Visuals;
663 static bool IsSpellValid(
SpellInfo const* spellInfo,
Player* player =
nullptr,
bool msg =
true);
678 bool IsSpellRequiringSpell(
uint32 spellid,
uint32 req_spellid)
const;
683 bool IsSpellLearnSpell(
uint32 spell_id)
const;
684 bool IsSpellLearnToSpell(
uint32 spell_id1,
uint32 spell_id2)
const;
696 void GetSetOfSpellsInSpellGroup(
SpellGroup group_id, std::set<uint32>& foundSpells)
const;
697 void GetSetOfSpellsInSpellGroup(
SpellGroup group_id, std::set<uint32>& foundSpells, std::set<SpellGroup>& usedGroups)
const;
700 bool AddSameEffectStackRuleSpellGroups(
SpellInfo const* spellInfo,
AuraType auraType,
SpellEffectValue amount, std::map<SpellGroup, SpellEffectValue>& groups)
const;
716 bool IsArenaAllowedEnchancment(
uint32 ench_id)
const;
739 SpellInfo const* spellInfo = GetSpellInfo(spellId, difficulty);
744 void ForEachSpellInfo(std::function<
void(
SpellInfo const*)> callback);
745 void ForEachSpellInfoDifficulty(
uint32 spellId, std::function<
void(
SpellInfo const*)> callback);
747 void LoadPetFamilySpellsStore();
755 void UnloadSpellInfoChains();
756 void LoadSpellRanks();
757 void LoadSpellRequired();
758 void LoadSpellLearnSkills();
759 void LoadSpellLearnSpells();
760 void LoadSpellTargetPositions();
761 void LoadSpellGroups();
762 void LoadSpellGroupStackRules();
763 void LoadSpellProcs();
764 void LoadSpellThreats();
765 void LoadSkillLineAbilityMap();
766 void LoadSpellPetAuras();
767 void LoadSpellEnchantProcData();
768 void LoadSpellLinked();
769 void LoadPetLevelupSpellMap();
770 void LoadPetDefaultSpells();
771 void LoadSpellAreas();
772 void LoadSpellInfoStore();
773 void UnloadSpellInfoStore();
774 void UnloadSpellInfoImplicitTargetConditionLists();
775 void LoadSpellInfoServerside();
776 void LoadSpellInfoCustomAttributes();
777 void LoadSpellInfoCorrections();
778 void LoadSpellInfoSpellSpecificAndAuraState();
779 void LoadSpellInfoDiminishing();
780 void LoadSpellInfoImmunities();
781 void LoadSpellInfoTargetCaps();
782 void LoadSpellTotemModel();
812#define sSpellMgr SpellMgr::instance()
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
#define DEFINE_ENUM_FLAG(enumType)
double SpellEffectValue
This is a double instead of float to be able to store full range of int32.
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)
std::unordered_multimap< SpellGroup, int32 > SpellGroupSpellMap
std::pair< SpellsRequiringSpellMap::const_iterator, SpellsRequiringSpellMap::const_iterator > SpellsRequiringSpellMapBounds
std::multimap< uint32, SpellLearnSpellNode const * > SpellLearnedBySpellMap
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
std::multimap< std::pair< uint32, SpellEffIndex >, SpellTargetPosition > SpellTargetPositionMap
@ 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
@ PROC_FLAG_2_SUCCESSFUL_DISPEL
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
PetAura(uint32 petEntry, uint32 aura, bool _removeOnChangePet, SpellEffectValue _damage)
std::unordered_map< uint32, uint32 > PetAuraMap
uint32 GetAura(uint32 petEntry) const
bool IsRemovedOnChangePet() const
void AddAura(uint32 petEntry, uint32 aura)
SpellEffectValue GetDamage() const
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
SpellLearnedBySpellMap mSpellLearnedBySpells
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
std::vector< SpellEmpowerStageEntry const * > EmpowerStages
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