AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
SpellMgr Class Reference

#include "SpellMgr.h"

Public Member Functions

CreatureImmunities const * GetCreatureImmunities (int32 creatureImmunitiesId) const
 
uint32 GetSpellDifficultyId (uint32 spellId) const
 
void SetSpellDifficultyId (uint32 spellId, uint32 id)
 
uint32 GetSpellIdForDifficulty (uint32 spellId, WorldObject const *caster) const
 
SpellInfo const * GetSpellForDifficultyFromSpell (SpellInfo const *spell, WorldObject const *caster) const
 
SpellChainNode const * GetSpellChainNode (uint32 spell_id) const
 
uint32 GetFirstSpellInChain (uint32 spell_id) const
 
uint32 GetLastSpellInChain (uint32 spell_id) const
 
uint32 GetNextSpellInChain (uint32 spell_id) const
 
uint32 GetPrevSpellInChain (uint32 spell_id) const
 
uint8 GetSpellRank (uint32 spell_id) const
 
uint32 GetSpellWithRank (uint32 spell_id, uint32 rank, bool strict=false) const
 
Acore::IteratorPair< SpellRequiredMap::const_iterator > GetSpellsRequiredForSpellBounds (uint32 spell_id) const
 
SpellsRequiringSpellMapBounds GetSpellsRequiringSpellBounds (uint32 spell_id) const
 
bool IsSpellRequiringSpell (uint32 spellid, uint32 req_spellid) const
 
SpellLearnSkillNode const * GetSpellLearnSkill (uint32 spell_id) const
 
std::vector< uint32 > GetSkillRankSpells (uint32 skillId) const
 
SpellTargetPosition const * GetSpellTargetPosition (uint32 spell_id, SpellEffIndex effIndex) const
 
SpellCone const * GetSpellCone (uint32 spell_id) const
 
SpellSpellGroupMapBounds GetSpellSpellGroupMapBounds (uint32 spell_id) const
 
bool IsSpellMemberOfSpellGroup (uint32 spell_id, SpellGroup group_id) const
 
SpellGroupSpellMapBounds GetSpellGroupSpellMapBounds (SpellGroup group_id) const
 
void GetSetOfSpellsInSpellGroup (SpellGroup group_id, std::set< uint32 > &foundSpells) const
 
void GetSetOfSpellsInSpellGroup (SpellGroup group_id, std::set< uint32 > &foundSpells, std::set< SpellGroup > &usedGroups) const
 
bool AddSameEffectStackRuleSpellGroups (SpellInfo const *spellInfo, uint32 auraType, int32 miscValue, int32 amount, std::map< SpellGroup, int32 > &groups) const
 
SpellGroupStackRule CheckSpellGroupStackRules (SpellInfo const *spellInfo1, SpellInfo const *spellInfo2) const
 
SpellGroupStackRule GetSpellGroupStackRule (SpellGroup group_id) const
 
SpellProcEntry const * GetSpellProcEntry (uint32 spellId) const
 
bool CanSpellTriggerProcOnEvent (SpellProcEntry const &procEntry, ProcEventInfo &eventInfo) const
 
SpellBonusEntry const * GetSpellBonusData (uint32 spellId) const
 
SpellThreatEntry const * GetSpellThreatEntry (uint32 spellID) const
 
float GetSpellMixologyBonus (uint32 spellId) const
 
SkillLineAbilityMapBounds GetSkillLineAbilityMapBounds (uint32 spell_id) const
 
PetAura const * GetPetAura (uint32 spell_id, uint8 eff) const
 
SpellEnchantProcEntry const * GetSpellEnchantProcEvent (uint32 enchId) const
 
bool IsArenaAllowedEnchancment (uint32 ench_id) const
 
std::vector< int32 > const * GetSpellLinked (int32 spell_id) const
 
PetLevelupSpellSet const * GetPetLevelupSpellList (uint32 petFamily) const
 
PetDefaultSpellsEntry const * GetPetDefaultSpellsEntry (int32 id) const
 
SpellAreaMapBounds GetSpellAreaMapBounds (uint32 spell_id) const
 
SpellAreaForQuestMapBounds GetSpellAreaForQuestMapBounds (uint32 quest_id) const
 
SpellAreaForQuestMapBounds GetSpellAreaForQuestEndMapBounds (uint32 quest_id) const
 
SpellAreaForAuraMapBounds GetSpellAreaForAuraMapBounds (uint32 spell_id) const
 
SpellAreaForAreaMapBounds GetSpellAreaForAreaMapBounds (uint32 area_id) const
 
SpellInfo const * GetSpellInfo (uint32 spellId) const
 
SpellInfo const * AssertSpellInfo (uint32 spellId) const
 
SpellInfo const * CheckSpellInfo (uint32 spellId) const
 
uint32 GetSpellInfoStoreSize () const
 
bool IsAdditionalTalentSpell (uint32 spellId) const
 
bool HasSpellCooldownOverride (uint32 spellId) const
 
SpellCooldownOverride GetSpellCooldownOverride (uint32 spellId) const
 
void UnloadSpellInfoChains ()
 
void LoadSpellTalentRanks ()
 
void LoadSpellRanks ()
 
void LoadSpellRequired ()
 
void LoadSpellLearnSkills ()
 
void LoadSpellTargetPositions ()
 
void LoadSpellCones ()
 
void LoadSpellGroups ()
 
void LoadSpellGroupStackRules ()
 
void LoadSpellProcs ()
 
void LoadSpellBonuses ()
 
void LoadSpellThreats ()
 
void LoadSpellMixology ()
 
void LoadSkillLineAbilityMap ()
 
void LoadSpellPetAuras ()
 
void LoadEnchantCustomAttr ()
 
void LoadSpellEnchantProcData ()
 
void LoadSpellLinked ()
 
void LoadPetLevelupSpellMap ()
 
void LoadPetDefaultSpells ()
 
void LoadSpellAreas ()
 
void LoadSpellInfoStore ()
 
void LoadCreatureImmunities ()
 
void LoadSpellCooldownOverrides ()
 
void UnloadSpellInfoStore ()
 
void UnloadSpellInfoImplicitTargetConditionLists ()
 
void LoadSpellInfoCustomAttributes ()
 
void LoadSpellInfoImmunities ()
 
void LoadSpellInfoCorrections ()
 
void LoadSpellSpecificAndAuraState ()
 
void LoadSpellJumpDistances ()
 

Static Public Member Functions

static SpellMgr * instance ()
 
static bool ComputeIsSpellValid (SpellInfo const *spellInfo, bool msg=true)
 Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book, etc.
 
static bool IsSpellValid (SpellInfo const *spellInfo)
 
static bool CheckSpellValid (SpellInfo const *spellInfo, uint32 spellId, bool isTalent)
 

Private Member Functions

 SpellMgr ()
 
 ~SpellMgr ()
 
SpellInfo * _GetSpellInfo (uint32 spellId)
 

Private Attributes

SpellDifficultySearcherMap mSpellDifficultySearcherMap
 
SpellChainMap mSpellChains
 
SpellsRequiringSpellMap mSpellsReqSpell
 
SpellRequiredMap mSpellReq
 
SpellLearnSkillMap mSpellLearnSkills
 
SpellTargetPositionMap mSpellTargetPositions
 
SpellConeMap mSpellCones
 
SpellSpellGroupMap mSpellSpellGroup
 
SpellGroupSpellMap mSpellGroupSpell
 
SpellGroupStackMap mSpellGroupStack
 
SameEffectStackMap mSpellSameEffectStack
 
SameEffectStackSharedMiscMap mSpellSameEffectSharedMisc
 
SpellProcMap mSpellProcMap
 
CreatureImmunitiesMap mCreatureImmunities
 
SpellBonusMap mSpellBonusMap
 
SpellThreatMap mSpellThreatMap
 
SpellMixologyMap mSpellMixologyMap
 
SpellPetAuraMap mSpellPetAuraMap
 
SpellLinkedMap mSpellLinkedMap
 
SpellEnchantProcEventMap mSpellEnchantProcEventMap
 
EnchantCustomAttribute mEnchantCustomAttr
 
SpellAreaMap mSpellAreaMap
 
SpellAreaForQuestMap mSpellAreaForQuestMap
 
SpellAreaForQuestMap mSpellAreaForQuestEndMap
 
SpellAreaForAuraMap mSpellAreaForAuraMap
 
SpellAreaForAreaMap mSpellAreaForAreaMap
 
SkillLineAbilityMap mSkillLineAbilityMap
 
PetLevelupSpellMap mPetLevelupSpellMap
 
PetDefaultSpellsMap mPetDefaultSpellsMap
 
SpellInfoMap mSpellInfoMap
 
SpellCooldownOverrideMap mSpellCooldownOverrideMap
 
TalentAdditionalSet mTalentSpellAdditionalSet
 

Detailed Description

Constructor & Destructor Documentation

◆ SpellMgr()

SpellMgr::SpellMgr ( )
private
404{
405}

◆ ~SpellMgr()

SpellMgr::~SpellMgr ( )
private
408{
410}
void UnloadSpellInfoStore()
Definition SpellMgr.cpp:3136

References UnloadSpellInfoStore().

Member Function Documentation

◆ _GetSpellInfo()

SpellInfo * SpellMgr::_GetSpellInfo ( uint32  spellId)
inlineprivate
779{ return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : nullptr; }
uint32 GetSpellInfoStoreSize() const
Definition SpellMgr.h:770
SpellInfoMap mSpellInfoMap
Definition SpellMgr.h:846

References GetSpellInfoStoreSize(), and mSpellInfoMap.

Referenced by LoadSpellInfoCustomAttributes(), and LoadSpellJumpDistances().

◆ AddSameEffectStackRuleSpellGroups()

bool SpellMgr::AddSameEffectStackRuleSpellGroups ( SpellInfo const *  spellInfo,
uint32  auraType,
int32  miscValue,
int32  amount,
std::map< SpellGroup, int32 > &  groups 
) const
779{
780 uint32 spellId = spellInfo->GetFirstRankSpell()->Id;
781 auto spellGroupBounds = GetSpellSpellGroupMapBounds(spellId);
782 // Find group with SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT if it belongs to one
783 // A spell can be in several such groups for the same auraType (one per stat, e.g. K'iru's Song of Victory),
784 // prefer the group where another spell has the same auraType and miscValue, else the first matching group
786 for (auto itr = spellGroupBounds.first; itr != spellGroupBounds.second; ++itr)
787 {
788 auto found = mSpellSameEffectStack.find(itr->second);
789 // check auraTypes
790 if (found == mSpellSameEffectStack.end() || !found->second.count(auraType))
791 continue;
792
793 if (group == SPELL_GROUP_NONE)
794 group = itr->second;
795
796 auto shared = mSpellSameEffectSharedMisc.find(itr->second);
797 if (shared != mSpellSameEffectSharedMisc.end() && shared->second.count({ auraType, miscValue }))
798 {
799 group = itr->second;
800 break;
801 }
802 }
803
804 // Not in a SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT group, so return false
805 if (group == SPELL_GROUP_NONE)
806 return false;
807
808 // Put the highest amount in the map
809 auto groupItr = groups.find(group);
810 if (groupItr == groups.end())
811 groups.emplace(group, amount);
812 else
813 {
814 int32 curr_amount = groups[group];
815 // Take absolute value because this also counts for the highest negative aura
816 if (std::abs(curr_amount) < std::abs(amount))
817 groupItr->second = amount;
818 }
819
820 return true;
821}
std::int32_t int32
Definition Define.h:103
std::uint32_t uint32
Definition Define.h:107
SpellGroup
Definition SpellMgr.h:331
@ SPELL_GROUP_NONE
Definition SpellMgr.h:332
SameEffectStackMap mSpellSameEffectStack
Definition SpellMgr.h:827
SpellSpellGroupMapBounds GetSpellSpellGroupMapBounds(uint32 spell_id) const
Definition SpellMgr.cpp:728
SameEffectStackSharedMiscMap mSpellSameEffectSharedMisc
Definition SpellMgr.h:828

References SpellInfo::GetFirstRankSpell(), GetSpellSpellGroupMapBounds(), SpellInfo::Id, mSpellSameEffectSharedMisc, mSpellSameEffectStack, and SPELL_GROUP_NONE.

◆ AssertSpellInfo()

SpellInfo const * SpellMgr::AssertSpellInfo ( uint32  spellId) const
inline
748 {
749 ASSERT(spellId < GetSpellInfoStoreSize());
750 SpellInfo const* spellInfo = mSpellInfoMap[spellId];
751 ASSERT(spellInfo);
752 return spellInfo;
753 }
#define ASSERT
Definition Errors.h:68
Definition SpellInfo.h:340

References ASSERT, GetSpellInfoStoreSize(), and mSpellInfoMap.

Referenced by LoadSpellGroupStackRules().

◆ CanSpellTriggerProcOnEvent()

bool SpellMgr::CanSpellTriggerProcOnEvent ( SpellProcEntry const &  procEntry,
ProcEventInfo &  eventInfo 
) const
888{
889 // proc type doesn't match
890 if (!(eventInfo.GetTypeMask() & procEntry.ProcFlags))
891 return false;
892
893 // check XP or honor target requirement
894 if (procEntry.AttributesMask & PROC_ATTR_REQ_EXP_OR_HONOR)
895 if (Player* actor = eventInfo.GetActor()->ToPlayer())
896 if (eventInfo.GetActionTarget() && !actor->isHonorOrXPTarget(eventInfo.GetActionTarget()))
897 return false;
898
899 // check mana cost requirement (used by Clearcasting and similar effects)
900 if (procEntry.AttributesMask & PROC_ATTR_REQ_MANA_COST)
901 {
902 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
903 if (!spellInfo || (!spellInfo->ManaCost && !spellInfo->ManaCostPercentage))
904 return false;
905 }
906
907 // always trigger for these types
909 return true;
910
911 // check school mask (if set) for other trigger types
912 if (procEntry.SchoolMask && !(eventInfo.GetSchoolMask() & procEntry.SchoolMask))
913 return false;
914
915 // check spell family name/flags (if set) for spells
916 if (eventInfo.GetTypeMask() & SPELL_PROC_FLAG_MASK)
917 if (SpellInfo const* eventSpellInfo = eventInfo.GetSpellInfo())
918 if (!eventSpellInfo->IsAffected(procEntry.SpellFamilyName, procEntry.SpellFamilyMask))
919 return false;
920
921 // check spell type mask (if set)
923 {
924 if (procEntry.SpellTypeMask && !(eventInfo.GetSpellTypeMask() & procEntry.SpellTypeMask))
925 return false;
926 }
927
928 // check spell phase mask
930 {
931 if (!(eventInfo.GetSpellPhaseMask() & procEntry.SpellPhaseMask))
932 return false;
933 }
934
935 // check hit mask (on taken hit or on done hit)
936 // For CAST phase with DONE flags, only check if HitMask is explicitly set (crit is pre-calculated for travel time spells)
937 if ((eventInfo.GetTypeMask() & TAKEN_HIT_PROC_FLAG_MASK) ||
938 ((eventInfo.GetTypeMask() & DONE_HIT_PROC_FLAG_MASK) &&
939 (!(eventInfo.GetSpellPhaseMask() & PROC_SPELL_PHASE_CAST) || procEntry.HitMask)))
940 {
941 uint32 hitMask = procEntry.HitMask;
942 // get default values if hit mask not set
943 if (!hitMask)
944 {
945 // for taken procs allow normal + critical hits by default
946 if (eventInfo.GetTypeMask() & TAKEN_HIT_PROC_FLAG_MASK)
948 // for done procs allow normal + critical + absorbs by default
949 else
951 }
952 if (!(eventInfo.GetHitMask() & hitMask))
953 return false;
954 }
955
956 return true;
957}
@ PROC_HIT_ABSORB
Definition SpellMgr.h:267
@ PROC_HIT_CRITICAL
Definition SpellMgr.h:258
@ PROC_HIT_NORMAL
Definition SpellMgr.h:257
@ PROC_ATTR_REQ_MANA_COST
Definition SpellMgr.h:278
@ PROC_ATTR_REQ_EXP_OR_HONOR
Definition SpellMgr.h:276
@ PROC_SPELL_PHASE_CAST
Definition SpellMgr.h:248
@ TAKEN_HIT_PROC_FLAG_MASK
Definition SpellMgr.h:178
@ PERIODIC_PROC_FLAG_MASK
Definition SpellMgr.h:169
@ PROC_FLAG_KILLED
Definition SpellMgr.h:110
@ PROC_FLAG_DEATH
Definition SpellMgr.h:146
@ REQ_SPELL_PHASE_PROC_FLAG_MASK
Definition SpellMgr.h:184
@ PROC_FLAG_KILL
Definition SpellMgr.h:111
@ SPELL_PROC_FLAG_MASK
Definition SpellMgr.h:159
@ DONE_HIT_PROC_FLAG_MASK
Definition SpellMgr.h:171
Player * ToPlayer()
Definition Object.h:208
Definition Player.h:1086
uint32 GetHitMask() const
Definition Unit.h:474
SpellSchoolMask GetSchoolMask() const
Definition Unit.cpp:315
Unit * GetActionTarget() const
Definition Unit.h:469
uint32 GetSpellTypeMask() const
Definition Unit.h:472
uint32 GetTypeMask() const
Definition Unit.h:471
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:301
Unit * GetActor()
Definition Unit.h:468
uint32 GetSpellPhaseMask() const
Definition Unit.h:473
uint32 ManaCostPercentage
Definition SpellInfo.h:391
uint32 ManaCost
Definition SpellInfo.h:387

References SpellProcEntry::AttributesMask, DONE_HIT_PROC_FLAG_MASK, ProcEventInfo::GetActionTarget(), ProcEventInfo::GetActor(), ProcEventInfo::GetHitMask(), ProcEventInfo::GetSchoolMask(), ProcEventInfo::GetSpellInfo(), ProcEventInfo::GetSpellPhaseMask(), ProcEventInfo::GetSpellTypeMask(), ProcEventInfo::GetTypeMask(), SpellProcEntry::HitMask, SpellInfo::ManaCost, SpellInfo::ManaCostPercentage, PERIODIC_PROC_FLAG_MASK, PROC_ATTR_REQ_EXP_OR_HONOR, PROC_ATTR_REQ_MANA_COST, PROC_FLAG_DEATH, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_HIT_ABSORB, PROC_HIT_CRITICAL, PROC_HIT_NORMAL, PROC_SPELL_PHASE_CAST, SpellProcEntry::ProcFlags, REQ_SPELL_PHASE_PROC_FLAG_MASK, SpellProcEntry::SchoolMask, SPELL_PROC_FLAG_MASK, SpellProcEntry::SpellFamilyMask, SpellProcEntry::SpellFamilyName, SpellProcEntry::SpellPhaseMask, SpellProcEntry::SpellTypeMask, TAKEN_HIT_PROC_FLAG_MASK, and Object::ToPlayer().

◆ CheckSpellGroupStackRules()

SpellGroupStackRule SpellMgr::CheckSpellGroupStackRules ( SpellInfo const *  spellInfo1,
SpellInfo const *  spellInfo2 
) const
824{
825 ASSERT(spellInfo1);
826 ASSERT(spellInfo2);
827
828 uint32 spell_id1 = spellInfo1->GetFirstRankSpell()->Id;
829 uint32 spell_id2 = spellInfo2->GetFirstRankSpell()->Id;
830
831 // find SpellGroups which are common for both spells
833 std::set<SpellGroup> groups;
834 for (SpellSpellGroupMap::const_iterator itr = spellGroup1.first; itr != spellGroup1.second; ++itr)
835 {
836 if (IsSpellMemberOfSpellGroup(spell_id2, itr->second))
837 {
838 bool add = true;
840 for (SpellGroupSpellMap::const_iterator itr2 = groupSpell.first; itr2 != groupSpell.second; ++itr2)
841 {
842 if (itr2->second < 0)
843 {
844 SpellGroup currGroup = (SpellGroup)abs(itr2->second);
845 if (IsSpellMemberOfSpellGroup(spell_id1, currGroup) && IsSpellMemberOfSpellGroup(spell_id2, currGroup))
846 {
847 add = false;
848 break;
849 }
850 }
851 }
852 if (add)
853 groups.insert(itr->second);
854 }
855 }
856
858
859 for (std::set<SpellGroup>::iterator itr = groups.begin(); itr!= groups.end(); ++itr)
860 {
861 SpellGroupStackMap::const_iterator found = mSpellGroupStack.find(*itr);
862 if (found != mSpellGroupStack.end())
863 rule = found->second;
864 if (rule)
865 break;
866 }
867 return rule;
868}
std::pair< SpellSpellGroupMap::const_iterator, SpellSpellGroupMap::const_iterator > SpellSpellGroupMapBounds
Definition SpellMgr.h:354
SpellGroupStackRule
Definition SpellMgr.h:361
@ SPELL_GROUP_STACK_RULE_DEFAULT
Definition SpellMgr.h:362
std::pair< SpellGroupSpellMap::const_iterator, SpellGroupSpellMap::const_iterator > SpellGroupSpellMapBounds
Definition SpellMgr.h:358
SpellGroupSpellMapBounds GetSpellGroupSpellMapBounds(SpellGroup group_id) const
Definition SpellMgr.cpp:745
bool IsSpellMemberOfSpellGroup(uint32 spell_id, SpellGroup group_id) const
Definition SpellMgr.cpp:734
SpellGroupStackMap mSpellGroupStack
Definition SpellMgr.h:826

References ASSERT, SpellInfo::GetFirstRankSpell(), GetSpellGroupSpellMapBounds(), GetSpellSpellGroupMapBounds(), SpellInfo::Id, IsSpellMemberOfSpellGroup(), mSpellGroupStack, and SPELL_GROUP_STACK_RULE_DEFAULT.

◆ CheckSpellInfo()

SpellInfo const * SpellMgr::CheckSpellInfo ( uint32  spellId) const
inline
756 {
757 if (spellId >= GetSpellInfoStoreSize())
758 {
759 LOG_ERROR("server", "spellId {} is not lower than GetSpellInfoStoreSize() ({})", spellId, GetSpellInfoStoreSize());
760 return nullptr;
761 }
762 SpellInfo const* spellInfo = mSpellInfoMap[spellId];
763 if (!spellInfo)
764 {
765 LOG_ERROR("server", "spellId {} has invalid spellInfo", spellId);
766 return nullptr;
767 }
768 return spellInfo;
769 }
#define LOG_ERROR(filterType__,...)
Definition Log.h:145

References GetSpellInfoStoreSize(), LOG_ERROR, and mSpellInfoMap.

◆ CheckSpellValid()

bool SpellMgr::CheckSpellValid ( SpellInfo const *  spellInfo,
uint32  spellId,
bool  isTalent 
)
static
509{
510 if (!spellInfo)
511 {
513 LOG_ERROR("spells", "Player::{}: Non-existed in SpellStore spell #{} request.", (isTalent ? "AddTalent" : "addSpell"), spellId);
514 return false;
515 }
516
517 if (!IsSpellValid(spellInfo))
518 {
520 LOG_ERROR("spells", "Player::{}: Broken spell #{} learning not allowed.", (isTalent ? "AddTalent" : "addSpell"), spellId);
521 return false;
522 }
523
524 return true;
525}
void DeleteSpellFromAllPlayers(uint32 spellId)
Definition SpellMgr.cpp:497
static bool IsSpellValid(SpellInfo const *spellInfo)
Definition SpellMgr.cpp:490

References DeleteSpellFromAllPlayers(), IsSpellValid(), and LOG_ERROR.

Referenced by Player::_addSpell(), and Player::addTalent().

◆ ComputeIsSpellValid()

bool SpellMgr::ComputeIsSpellValid ( SpellInfo const *  spellInfo,
bool  msg = true 
)
static

Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book, etc.

420{
421 // not exist
422 if (!spellInfo)
423 return false;
424
425 bool need_check_reagents = false;
426
427 // check effects
428 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
429 {
430 switch (spellInfo->Effects[i].Effect)
431 {
432 case 0:
433 continue;
434
435 // craft spell for crafting non-existed item (break client recipes list show)
438 {
439 if (spellInfo->Effects[i].ItemType == 0)
440 {
441 // skip auto-loot crafting spells, its not need explicit item info (but have special fake items sometime)
442 if (!spellInfo->IsLootCrafting())
443 {
444 if (msg)
445 LOG_ERROR("sql.sql", "Craft spell {} not have create item entry.", spellInfo->Id);
446 return false;
447 }
448 }
449 // also possible IsLootCrafting case but fake item must exist anyway
450 else if (!sObjectMgr->GetItemTemplate(spellInfo->Effects[i].ItemType))
451 {
452 if (msg)
453 LOG_ERROR("sql.sql", "Craft spell {} create not-exist in DB item (Entry: {}) and then...", spellInfo->Id, spellInfo->Effects[i].ItemType);
454 return false;
455 }
456
457 need_check_reagents = true;
458 break;
459 }
461 {
462 SpellInfo const* spellInfo2 = sSpellMgr->GetSpellInfo(spellInfo->Effects[i].TriggerSpell);
463 if (!ComputeIsSpellValid(spellInfo2, msg))
464 {
465 if (msg)
466 LOG_ERROR("sql.sql", "Spell {} learn to invalid spell {}, and then...", spellInfo->Id, spellInfo->Effects[i].TriggerSpell);
467 return false;
468 }
469 break;
470 }
471 }
472 }
473
474 if (need_check_reagents)
475 {
476 for (uint8 j = 0; j < MAX_SPELL_REAGENTS; ++j)
477 {
478 if (spellInfo->Reagent[j] > 0 && !sObjectMgr->GetItemTemplate(spellInfo->Reagent[j]))
479 {
480 if (msg)
481 LOG_ERROR("sql.sql", "Craft spell {} have not-exist reagent in DB item (Entry: {}) and then...", spellInfo->Id, spellInfo->Reagent[j]);
482 return false;
483 }
484 }
485 }
486
487 return true;
488}
#define MAX_SPELL_REAGENTS
Definition DBCStructure.h:1675
#define MAX_SPELL_EFFECTS
Definition DBCStructure.h:1673
std::uint8_t uint8
Definition Define.h:109
#define sObjectMgr
Definition ObjectMgr.h:1734
@ SPELL_EFFECT_CREATE_ITEM_2
Definition SharedDefines.h:923
@ SPELL_EFFECT_LEARN_SPELL
Definition SharedDefines.h:802
@ SPELL_EFFECT_CREATE_ITEM
Definition SharedDefines.h:790
#define sSpellMgr
Definition SpellMgr.h:851
static bool ComputeIsSpellValid(SpellInfo const *spellInfo, bool msg=true)
Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book,...
Definition SpellMgr.cpp:419

References ComputeIsSpellValid(), SpellInfo::Effects, SpellInfo::Id, SpellInfo::IsLootCrafting(), LOG_ERROR, MAX_SPELL_EFFECTS, MAX_SPELL_REAGENTS, SpellInfo::Reagent, sObjectMgr, SPELL_EFFECT_CREATE_ITEM, SPELL_EFFECT_CREATE_ITEM_2, SPELL_EFFECT_LEARN_SPELL, and sSpellMgr.

Referenced by ComputeIsSpellValid(), ObjectMgr::InitializeSpellInfoPrecomputedData(), and ObjectMgr::LoadQuests().

◆ GetCreatureImmunities()

CreatureImmunities const * SpellMgr::GetCreatureImmunities ( int32  creatureImmunitiesId) const
61{
62 return Acore::Containers::MapGetValuePtr(mCreatureImmunities, creatureImmunitiesId);
63}
CreatureImmunitiesMap mCreatureImmunities
Definition SpellMgr.h:830
auto MapGetValuePtr(M &map, typename M::key_type const &key) -> decltype(AddressOrSelf(map.find(key) ->second))
Definition Containers.h:216

References Acore::Containers::MapGetValuePtr(), and mCreatureImmunities.

◆ GetFirstSpellInChain()

uint32 SpellMgr::GetFirstSpellInChain ( uint32  spell_id) const
604{
605 if (SpellChainNode const* node = GetSpellChainNode(spell_id))
606 return node->first->Id;
607
608 return spell_id;
609}
SpellChainNode const * GetSpellChainNode(uint32 spell_id) const
Definition SpellMgr.cpp:594
Definition SpellMgr.h:553

References SpellChainNode::first, GetSpellChainNode(), and SpellInfo::Id.

Referenced by GetSpellBonusData(), GetSpellCone(), GetSpellSpellGroupMapBounds(), GetSpellThreatEntry(), LoadSpellCones(), and LoadSpellRequired().

◆ GetLastSpellInChain()

uint32 SpellMgr::GetLastSpellInChain ( uint32  spell_id) const
612{
613 if (SpellChainNode const* node = GetSpellChainNode(spell_id))
614 return node->last->Id;
615
616 return spell_id;
617}

References GetSpellChainNode().

◆ GetNextSpellInChain()

uint32 SpellMgr::GetNextSpellInChain ( uint32  spell_id) const
620{
621 if (SpellChainNode const* node = GetSpellChainNode(spell_id))
622 if (node->next)
623 return node->next->Id;
624
625 return 0;
626}

References GetSpellChainNode().

◆ GetPetAura()

PetAura const * SpellMgr::GetPetAura ( uint32  spell_id,
uint8  eff 
) const
1005{
1006 SpellPetAuraMap::const_iterator itr = mSpellPetAuraMap.find((spell_id << 8) + eff);
1007 if (itr != mSpellPetAuraMap.end())
1008 return &itr->second;
1009 else
1010 return nullptr;
1011}
SpellPetAuraMap mSpellPetAuraMap
Definition SpellMgr.h:834

References mSpellPetAuraMap.

◆ GetPetDefaultSpellsEntry()

PetDefaultSpellsEntry const * SpellMgr::GetPetDefaultSpellsEntry ( int32  id) const
1042{
1043 PetDefaultSpellsMap::const_iterator itr = mPetDefaultSpellsMap.find(id);
1044 if (itr != mPetDefaultSpellsMap.end())
1045 return &itr->second;
1046 return nullptr;
1047}
PetDefaultSpellsMap mPetDefaultSpellsMap
Definition SpellMgr.h:845

References mPetDefaultSpellsMap.

◆ GetPetLevelupSpellList()

PetLevelupSpellSet const * SpellMgr::GetPetLevelupSpellList ( uint32  petFamily) const
1033{
1034 PetLevelupSpellMap::const_iterator itr = mPetLevelupSpellMap.find(petFamily);
1035 if (itr != mPetLevelupSpellMap.end())
1036 return &itr->second;
1037 else
1038 return nullptr;
1039}
PetLevelupSpellMap mPetLevelupSpellMap
Definition SpellMgr.h:844

References mPetLevelupSpellMap.

◆ GetPrevSpellInChain()

uint32 SpellMgr::GetPrevSpellInChain ( uint32  spell_id) const
629{
630 if (SpellChainNode const* node = GetSpellChainNode(spell_id))
631 if (node->prev)
632 return node->prev->Id;
633
634 return 0;
635}

References GetSpellChainNode().

◆ GetSetOfSpellsInSpellGroup() [1/2]

void SpellMgr::GetSetOfSpellsInSpellGroup ( SpellGroup  group_id,
std::set< uint32 > &  foundSpells 
) const
751{
752 std::set<SpellGroup> usedGroups;
753 GetSetOfSpellsInSpellGroup(group_id, foundSpells, usedGroups);
754}
void GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set< uint32 > &foundSpells) const
Definition SpellMgr.cpp:750

References GetSetOfSpellsInSpellGroup().

Referenced by GetSetOfSpellsInSpellGroup(), GetSetOfSpellsInSpellGroup(), LoadSpellGroups(), and LoadSpellGroupStackRules().

◆ GetSetOfSpellsInSpellGroup() [2/2]

void SpellMgr::GetSetOfSpellsInSpellGroup ( SpellGroup  group_id,
std::set< uint32 > &  foundSpells,
std::set< SpellGroup > &  usedGroups 
) const
757{
758 if (usedGroups.find(group_id) != usedGroups.end())
759 return;
760 usedGroups.insert(group_id);
761
763 for (SpellGroupSpellMap::const_iterator itr = groupSpell.first; itr != groupSpell.second; ++itr)
764 {
765 if (itr->second < 0)
766 {
767 SpellGroup currGroup = (SpellGroup)abs(itr->second);
768 GetSetOfSpellsInSpellGroup(currGroup, foundSpells, usedGroups);
769 }
770 else
771 {
772 foundSpells.insert(itr->second);
773 }
774 }
775}

References GetSetOfSpellsInSpellGroup(), and GetSpellGroupSpellMapBounds().

◆ GetSkillLineAbilityMapBounds()

SkillLineAbilityMapBounds SpellMgr::GetSkillLineAbilityMapBounds ( uint32  spell_id) const
1000{
1001 return mSkillLineAbilityMap.equal_range(spell_id);
1002}
SkillLineAbilityMap mSkillLineAbilityMap
Definition SpellMgr.h:843

References mSkillLineAbilityMap.

◆ GetSkillRankSpells()

std::vector< uint32 > SpellMgr::GetSkillRankSpells ( uint32  skillId) const
693{
694 // Returns every spell that grants this skill via SPELL_EFFECT_SKILL,
695 // i.e. the profession rank/proficiency spells (Apprentice -> Grand Master),
696 // ordered by step. Not strictly limited to the six ranks: any skill-granting
697 // spell for the line is included.
698 std::vector<uint32> result;
699 for (auto const& [spellId, node] : mSpellLearnSkills)
700 if (node.skill == skillId)
701 result.push_back(spellId);
702
703 std::ranges::sort(result, [this](uint32 a, uint32 b)
704 {
705 return mSpellLearnSkills.at(a).step < mSpellLearnSkills.at(b).step;
706 });
707 return result;
708}
SpellLearnSkillMap mSpellLearnSkills
Definition SpellMgr.h:821

References mSpellLearnSkills.

◆ GetSpellAreaForAreaMapBounds()

SpellAreaForAreaMapBounds SpellMgr::GetSpellAreaForAreaMapBounds ( uint32  area_id) const
1070{
1071 return mSpellAreaForAreaMap.equal_range(area_id);
1072}
SpellAreaForAreaMap mSpellAreaForAreaMap
Definition SpellMgr.h:842

References mSpellAreaForAreaMap.

◆ GetSpellAreaForAuraMapBounds()

SpellAreaForAuraMapBounds SpellMgr::GetSpellAreaForAuraMapBounds ( uint32  spell_id) const
1065{
1066 return mSpellAreaForAuraMap.equal_range(spell_id);
1067}
SpellAreaForAuraMap mSpellAreaForAuraMap
Definition SpellMgr.h:841

References mSpellAreaForAuraMap.

Referenced by LoadSpellAreas().

◆ GetSpellAreaForQuestEndMapBounds()

SpellAreaForQuestMapBounds SpellMgr::GetSpellAreaForQuestEndMapBounds ( uint32  quest_id) const
1060{
1061 return mSpellAreaForQuestEndMap.equal_range(quest_id);
1062}
SpellAreaForQuestMap mSpellAreaForQuestEndMap
Definition SpellMgr.h:840

References mSpellAreaForQuestEndMap.

◆ GetSpellAreaForQuestMapBounds()

SpellAreaForQuestMapBounds SpellMgr::GetSpellAreaForQuestMapBounds ( uint32  quest_id) const
1055{
1056 return mSpellAreaForQuestMap.equal_range(quest_id);
1057}
SpellAreaForQuestMap mSpellAreaForQuestMap
Definition SpellMgr.h:839

References mSpellAreaForQuestMap.

◆ GetSpellAreaMapBounds()

SpellAreaMapBounds SpellMgr::GetSpellAreaMapBounds ( uint32  spell_id) const
1050{
1051 return mSpellAreaMap.equal_range(spell_id);
1052}
SpellAreaMap mSpellAreaMap
Definition SpellMgr.h:838

References mSpellAreaMap.

Referenced by LoadSpellAreas().

◆ GetSpellBonusData()

SpellBonusEntry const * SpellMgr::GetSpellBonusData ( uint32  spellId) const
960{
961 // Lookup data
962 SpellBonusMap::const_iterator itr = mSpellBonusMap.find(spellId);
963 if (itr != mSpellBonusMap.end())
964 return &itr->second;
965 // Not found, try lookup for 1 spell rank if exist
966 if (uint32 rank_1 = GetFirstSpellInChain(spellId))
967 {
968 SpellBonusMap::const_iterator itr2 = mSpellBonusMap.find(rank_1);
969 if (itr2 != mSpellBonusMap.end())
970 return &itr2->second;
971 }
972 return nullptr;
973}
uint32 GetFirstSpellInChain(uint32 spell_id) const
Definition SpellMgr.cpp:603
SpellBonusMap mSpellBonusMap
Definition SpellMgr.h:831

References GetFirstSpellInChain(), and mSpellBonusMap.

◆ GetSpellChainNode()

SpellChainNode const * SpellMgr::GetSpellChainNode ( uint32  spell_id) const
595{
596 SpellChainMap::const_iterator itr = mSpellChains.find(spell_id);
597 if (itr == mSpellChains.end())
598 return nullptr;
599
600 return &itr->second;
601}
SpellChainMap mSpellChains
Definition SpellMgr.h:818

References mSpellChains.

Referenced by GetFirstSpellInChain(), GetLastSpellInChain(), GetNextSpellInChain(), GetPrevSpellInChain(), GetSpellRank(), and GetSpellWithRank().

◆ GetSpellCone()

SpellCone const * SpellMgr::GetSpellCone ( uint32  spell_id) const
719{
720 spell_id = GetFirstSpellInChain(spell_id);
721 auto itr = mSpellCones.find(spell_id);
722 if (itr != mSpellCones.end())
723 return &itr->second;
724
725 return nullptr;
726}
SpellConeMap mSpellCones
Definition SpellMgr.h:823

References GetFirstSpellInChain(), and mSpellCones.

◆ GetSpellCooldownOverride()

SpellCooldownOverride SpellMgr::GetSpellCooldownOverride ( uint32  spellId) const
3131{
3132 auto range = mSpellCooldownOverrideMap.find(spellId);
3133 return range->second;
3134}
SpellCooldownOverrideMap mSpellCooldownOverrideMap
Definition SpellMgr.h:847

References mSpellCooldownOverrideMap.

Referenced by LoadSpellInfoCustomAttributes().

◆ GetSpellDifficultyId()

uint32 SpellMgr::GetSpellDifficultyId ( uint32  spellId) const
528{
529 SpellDifficultySearcherMap::const_iterator i = mSpellDifficultySearcherMap.find(spellId);
530 return i == mSpellDifficultySearcherMap.end() ? 0 : (*i).second;
531}
SpellDifficultySearcherMap mSpellDifficultySearcherMap
Definition SpellMgr.h:817

References mSpellDifficultySearcherMap.

Referenced by GetSpellIdForDifficulty().

◆ GetSpellEnchantProcEvent()

SpellEnchantProcEntry const * SpellMgr::GetSpellEnchantProcEvent ( uint32  enchId) const
1014{
1015 SpellEnchantProcEventMap::const_iterator itr = mSpellEnchantProcEventMap.find(enchId);
1016 if (itr != mSpellEnchantProcEventMap.end())
1017 return &itr->second;
1018 return nullptr;
1019}
SpellEnchantProcEventMap mSpellEnchantProcEventMap
Definition SpellMgr.h:836

References mSpellEnchantProcEventMap.

◆ GetSpellForDifficultyFromSpell()

SpellInfo const * SpellMgr::GetSpellForDifficultyFromSpell ( SpellInfo const *  spell,
WorldObject const *  caster 
) const
581{
582 uint32 newSpellId = GetSpellIdForDifficulty(spell->Id, caster);
583 SpellInfo const* newSpell = GetSpellInfo(newSpellId);
584 if (!newSpell)
585 {
586 LOG_DEBUG("spells.aura", "SpellMgr::GetSpellForDifficultyFromSpell: spell {} not found. Check spelldifficulty_dbc!", newSpellId);
587 return spell;
588 }
589
590 LOG_DEBUG("spells.aura", "SpellMgr::GetSpellForDifficultyFromSpell: Spell id for instance mode is {} (original {})", newSpell->Id, spell->Id);
591 return newSpell;
592}
#define LOG_DEBUG(filterType__,...)
Definition Log.h:157
uint32 Id
Definition SpellInfo.h:344
SpellInfo const * GetSpellInfo(uint32 spellId) const
Definition SpellMgr.h:745
uint32 GetSpellIdForDifficulty(uint32 spellId, WorldObject const *caster) const
Definition SpellMgr.cpp:538

References GetSpellIdForDifficulty(), GetSpellInfo(), SpellInfo::Id, and LOG_DEBUG.

◆ GetSpellGroupSpellMapBounds()

SpellGroupSpellMapBounds SpellMgr::GetSpellGroupSpellMapBounds ( SpellGroup  group_id) const
746{
747 return mSpellGroupSpell.equal_range(group_id);
748}
SpellGroupSpellMap mSpellGroupSpell
Definition SpellMgr.h:825

References mSpellGroupSpell.

Referenced by CheckSpellGroupStackRules(), GetSetOfSpellsInSpellGroup(), and LoadSpellGroupStackRules().

◆ GetSpellGroupStackRule()

SpellGroupStackRule SpellMgr::GetSpellGroupStackRule ( SpellGroup  group_id) const
871{
872 SpellGroupStackMap::const_iterator itr = mSpellGroupStack.find(group);
873 if (itr != mSpellGroupStack.end())
874 return itr->second;
875
877}

References mSpellGroupStack, and SPELL_GROUP_STACK_RULE_DEFAULT.

◆ GetSpellIdForDifficulty()

uint32 SpellMgr::GetSpellIdForDifficulty ( uint32  spellId,
WorldObject const *  caster 
) const
539{
540 if (!GetSpellInfo(spellId))
541 return spellId;
542
543 if (!caster || !caster->GetMap() || (!caster->GetMap()->IsDungeon() && !caster->GetMap()->IsBattleground()))
544 return spellId;
545
546 uint32 mode = uint32(caster->GetMap()->GetSpawnMode());
547 if (mode >= MAX_DIFFICULTY)
548 {
549 LOG_ERROR("spells", "SpellMgr::GetSpellIdForDifficulty: Incorrect Difficulty for spell {}.", spellId);
550 return spellId; //return source spell
551 }
552
553 uint32 difficultyId = GetSpellDifficultyId(spellId);
554 if (!difficultyId)
555 return spellId; //return source spell, it has only REGULAR_DIFFICULTY
556
557 SpellDifficultyEntry const* difficultyEntry = sSpellDifficultyStore.LookupEntry(difficultyId);
558 if (!difficultyEntry)
559 {
560 LOG_DEBUG("spells.aura", "SpellMgr::GetSpellIdForDifficulty: SpellDifficultyEntry not found for spell {}. This should never happen.", spellId);
561 return spellId; //return source spell
562 }
563
564 if (difficultyEntry->SpellID[mode] <= 0 && mode > DUNGEON_DIFFICULTY_HEROIC)
565 {
566 LOG_DEBUG("spells.aura", "SpellMgr::GetSpellIdForDifficulty: spell {} mode {} spell is nullptr, using mode {}", spellId, mode, mode - 2);
567 mode -= 2;
568 }
569
570 if (difficultyEntry->SpellID[mode] <= 0)
571 {
572 LOG_ERROR("sql.sql", "SpellMgr::GetSpellIdForDifficulty: spell {} mode {} spell is 0. Check spelldifficulty_dbc!", spellId, mode);
573 return spellId;
574 }
575
576 LOG_DEBUG("spells.aura", "SpellMgr::GetSpellIdForDifficulty: spellid for spell {} in mode {} is {}", spellId, mode, difficultyEntry->SpellID[mode]);
577 return uint32(difficultyEntry->SpellID[mode]);
578}
@ DUNGEON_DIFFICULTY_HEROIC
Definition DBCEnums.h:270
#define MAX_DIFFICULTY
Definition DBCEnums.h:283
DBCStorage< SpellDifficultyEntry > sSpellDifficultyStore(SpellDifficultyfmt)
uint32 GetSpellDifficultyId(uint32 spellId) const
Definition SpellMgr.cpp:527
Definition DBCStructure.h:1808
int32 SpellID[MAX_DIFFICULTY]
Definition DBCStructure.h:1810

References DUNGEON_DIFFICULTY_HEROIC, WorldObject::GetMap(), Map::GetSpawnMode(), GetSpellDifficultyId(), GetSpellInfo(), Map::IsBattleground(), Map::IsDungeon(), LOG_DEBUG, LOG_ERROR, MAX_DIFFICULTY, SpellDifficultyEntry::SpellID, and sSpellDifficultyStore.

Referenced by GetSpellForDifficultyFromSpell().

◆ GetSpellInfo()

◆ GetSpellInfoStoreSize()

◆ GetSpellLearnSkill()

SpellLearnSkillNode const * SpellMgr::GetSpellLearnSkill ( uint32  spell_id) const
684{
685 SpellLearnSkillMap::const_iterator itr = mSpellLearnSkills.find(spell_id);
686 if (itr != mSpellLearnSkills.end())
687 return &itr->second;
688 else
689 return nullptr;
690}

References mSpellLearnSkills.

◆ GetSpellLinked()

std::vector< int32 > const * SpellMgr::GetSpellLinked ( int32  spell_id) const
1027{
1028 SpellLinkedMap::const_iterator itr = mSpellLinkedMap.find(spell_id);
1029 return itr != mSpellLinkedMap.end() ? &(itr->second) : nullptr;
1030}
SpellLinkedMap mSpellLinkedMap
Definition SpellMgr.h:835

References mSpellLinkedMap.

◆ GetSpellMixologyBonus()

float SpellMgr::GetSpellMixologyBonus ( uint32  spellId) const
991{
992 SpellMixologyMap::const_iterator itr = mSpellMixologyMap.find(spellId);
993 if (itr == mSpellMixologyMap.end())
994 return 30.0f;
995
996 return itr->second;
997}
SpellMixologyMap mSpellMixologyMap
Definition SpellMgr.h:833

References mSpellMixologyMap.

◆ GetSpellProcEntry()

SpellProcEntry const * SpellMgr::GetSpellProcEntry ( uint32  spellId) const
880{
881 SpellProcMap::const_iterator itr = mSpellProcMap.find(spellId);
882 if (itr != mSpellProcMap.end())
883 return &itr->second;
884 return nullptr;
885}
SpellProcMap mSpellProcMap
Definition SpellMgr.h:829

References mSpellProcMap.

◆ GetSpellRank()

uint8 SpellMgr::GetSpellRank ( uint32  spell_id) const
638{
639 if (SpellChainNode const* node = GetSpellChainNode(spell_id))
640 return node->rank;
641
642 return 0;
643}

References GetSpellChainNode().

◆ GetSpellSpellGroupMapBounds()

SpellSpellGroupMapBounds SpellMgr::GetSpellSpellGroupMapBounds ( uint32  spell_id) const
729{
730 spell_id = GetFirstSpellInChain(spell_id);
731 return mSpellSpellGroup.equal_range(spell_id);
732}
SpellSpellGroupMap mSpellSpellGroup
Definition SpellMgr.h:824

References GetFirstSpellInChain(), and mSpellSpellGroup.

Referenced by AddSameEffectStackRuleSpellGroups(), CheckSpellGroupStackRules(), and IsSpellMemberOfSpellGroup().

◆ GetSpellsRequiredForSpellBounds()

Acore::IteratorPair< SpellRequiredMap::const_iterator > SpellMgr::GetSpellsRequiredForSpellBounds ( uint32  spell_id) const
658{
660}
SpellRequiredMap mSpellReq
Definition SpellMgr.h:820
auto MapEqualRange(M &map, typename M::key_type const &key) -> IteratorPair< decltype(map.begin())>
Definition IteratorPair.h:48

References Acore::Containers::MapEqualRange(), and mSpellReq.

◆ GetSpellsRequiringSpellBounds()

SpellsRequiringSpellMapBounds SpellMgr::GetSpellsRequiringSpellBounds ( uint32  spell_id) const
663{
664 return mSpellsReqSpell.equal_range(spell_id);
665}
SpellsRequiringSpellMap mSpellsReqSpell
Definition SpellMgr.h:819

References mSpellsReqSpell.

Referenced by IsSpellRequiringSpell().

◆ GetSpellTargetPosition()

SpellTargetPosition const * SpellMgr::GetSpellTargetPosition ( uint32  spell_id,
SpellEffIndex  effIndex 
) const
711{
712 SpellTargetPositionMap::const_iterator itr = mSpellTargetPositions.find(std::make_pair(spell_id, effIndex));
713 if (itr != mSpellTargetPositions.end())
714 return &itr->second;
715 return nullptr;
716}
SpellTargetPositionMap mSpellTargetPositions
Definition SpellMgr.h:822

References mSpellTargetPositions.

◆ GetSpellThreatEntry()

SpellThreatEntry const * SpellMgr::GetSpellThreatEntry ( uint32  spellID) const
976{
977 SpellThreatMap::const_iterator itr = mSpellThreatMap.find(spellID);
978 if (itr != mSpellThreatMap.end())
979 return &itr->second;
980 else
981 {
982 uint32 firstSpell = GetFirstSpellInChain(spellID);
983 itr = mSpellThreatMap.find(firstSpell);
984 if (itr != mSpellThreatMap.end())
985 return &itr->second;
986 }
987 return nullptr;
988}
SpellThreatMap mSpellThreatMap
Definition SpellMgr.h:832

References GetFirstSpellInChain(), and mSpellThreatMap.

◆ GetSpellWithRank()

uint32 SpellMgr::GetSpellWithRank ( uint32  spell_id,
uint32  rank,
bool  strict = false 
) const
646{
647 if (SpellChainNode const* node = GetSpellChainNode(spell_id))
648 {
649 if (rank != node->rank)
650 return GetSpellWithRank(node->rank < rank ? node->next->Id : node->prev->Id, rank, strict);
651 }
652 else if (strict && rank > 1)
653 return 0;
654 return spell_id;
655}
uint32 GetSpellWithRank(uint32 spell_id, uint32 rank, bool strict=false) const
Definition SpellMgr.cpp:645

References GetSpellChainNode(), and GetSpellWithRank().

Referenced by GetSpellWithRank().

◆ HasSpellCooldownOverride()

bool SpellMgr::HasSpellCooldownOverride ( uint32  spellId) const
3126{
3127 return mSpellCooldownOverrideMap.find(spellId) != mSpellCooldownOverrideMap.end();
3128}

References mSpellCooldownOverrideMap.

Referenced by LoadSpellInfoCustomAttributes().

◆ instance()

SpellMgr * SpellMgr::instance ( )
static
413{
414 static SpellMgr instance;
415 return &instance;
416}
Definition SpellMgr.h:651
static SpellMgr * instance()
Definition SpellMgr.cpp:412

References instance().

Referenced by instance().

◆ IsAdditionalTalentSpell()

bool SpellMgr::IsAdditionalTalentSpell ( uint32  spellId) const
679{
680 return mTalentSpellAdditionalSet.find(spellId) != mTalentSpellAdditionalSet.end();
681}
TalentAdditionalSet mTalentSpellAdditionalSet
Definition SpellMgr.h:848

References mTalentSpellAdditionalSet.

◆ IsArenaAllowedEnchancment()

bool SpellMgr::IsArenaAllowedEnchancment ( uint32  ench_id) const
1022{
1023 return mEnchantCustomAttr[ench_id];
1024}
EnchantCustomAttribute mEnchantCustomAttr
Definition SpellMgr.h:837

References mEnchantCustomAttr.

◆ IsSpellMemberOfSpellGroup()

bool SpellMgr::IsSpellMemberOfSpellGroup ( uint32  spell_id,
SpellGroup  group_id 
) const
735{
737 for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second; ++itr)
738 {
739 if (itr->second == group_id)
740 return true;
741 }
742 return false;
743}

References GetSpellSpellGroupMapBounds().

Referenced by CheckSpellGroupStackRules().

◆ IsSpellRequiringSpell()

bool SpellMgr::IsSpellRequiringSpell ( uint32  spellid,
uint32  req_spellid 
) const
668{
669 SpellsRequiringSpellMapBounds spellsRequiringSpell = GetSpellsRequiringSpellBounds(req_spellid);
670 for (SpellsRequiringSpellMap::const_iterator itr = spellsRequiringSpell.first; itr != spellsRequiringSpell.second; ++itr)
671 {
672 if (itr->second == spellid)
673 return true;
674 }
675 return false;
676}
std::pair< SpellsRequiringSpellMap::const_iterator, SpellsRequiringSpellMap::const_iterator > SpellsRequiringSpellMapBounds
Definition SpellMgr.h:569
SpellsRequiringSpellMapBounds GetSpellsRequiringSpellBounds(uint32 spell_id) const
Definition SpellMgr.cpp:662

References GetSpellsRequiringSpellBounds().

Referenced by LoadSpellRequired().

◆ IsSpellValid()

◆ LoadCreatureImmunities()

void SpellMgr::LoadCreatureImmunities ( )
66{
67 mCreatureImmunities.clear();
68 if (QueryResult result = WorldDatabase.Query("SELECT ID, SchoolMask, DispelTypeMask, MechanicsMask, Effects, Auras, ImmuneAoE, ImmuneChain FROM creature_immunities"))
69 {
70 do
71 {
72 Field* fields = result->Fetch();
73 int32 id = fields[0].Get<int32>();
74 uint8 school = fields[1].Get<uint8>();
75 uint16 dispelType = fields[2].Get<uint16>();
76 uint64 mechanics = fields[3].Get<uint64>();
78 immunities.School = school;
79 immunities.DispelType = dispelType;
80 immunities.Mechanic = mechanics;
81 immunities.ImmuneAoE = fields[6].Get<bool>();
82 immunities.ImmuneChain = fields[7].Get<bool>();
83 {
84 std::string effects = fields[4].Get<std::string>();
85 for (std::string_view token : Acore::Tokenize(effects, ',', false))
86 {
87 if (Optional<uint32> val = Acore::StringTo<uint32>(token); val && *val < uint32(TOTAL_SPELL_EFFECTS))
88 immunities.Effect.push_back(SpellEffects(*val));
89 else
90 LOG_ERROR("sql.sql", "Invalid effect type in `Effects` {} for creature immunities {}, skipped", token, id);
91 }
92 }
93 {
94 std::string auras = fields[5].Get<std::string>();
95 for (std::string_view token : Acore::Tokenize(auras, ',', false))
96 {
97 if (Optional<uint32> val = Acore::StringTo<uint32>(token); val && *val < TOTAL_AURAS)
98 immunities.Aura.push_back(AuraType(*val));
99 else
100 LOG_ERROR("sql.sql", "Invalid aura type in `Auras` {} for creature immunities {}, skipped", token, id);
101 }
102 }
103 } while (result->NextRow());
104 }
105}
std::shared_ptr< ResultSet > QueryResult
Definition DatabaseEnvFwd.h:27
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
Definition DatabaseEnv.cpp:20
std::uint64_t uint64
Definition Define.h:106
std::uint16_t uint16
Definition Define.h:108
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:24
SpellEffects
Definition SharedDefines.h:766
@ TOTAL_SPELL_EFFECTS
Definition SharedDefines.h:931
AuraType
Definition SpellAuraDefines.h:62
@ TOTAL_AURAS
Definition SpellAuraDefines.h:380
Class used to access individual fields of database query result.
Definition Field.h:99
std::enable_if_t< std::is_arithmetic_v< T >, T > Get() const
Definition Field.h:113
Definition AsioHacksFwd.h:47
std::vector< std::string_view > Tokenize(std::string_view str, char sep, bool keepEmpty)
Definition Tokenize.cpp:20
Definition SpellMgr.h:573
std::bitset< MAX_SPELL_SCHOOL > School
Definition SpellMgr.h:574

References Field::Get(), LOG_ERROR, mCreatureImmunities, CreatureImmunities::School, Acore::Tokenize(), TOTAL_AURAS, TOTAL_SPELL_EFFECTS, and WorldDatabase.

Referenced by LoadSpellInfoStore().

◆ LoadEnchantCustomAttr()

void SpellMgr::LoadEnchantCustomAttr ( )
Todo:
: find a better check
2540{
2541 uint32 oldMSTime = getMSTime();
2542
2543 uint32 size = sSpellItemEnchantmentStore.GetNumRows();
2544 mEnchantCustomAttr.resize(size);
2545
2546 for (uint32 i = 0; i < size; ++i)
2547 mEnchantCustomAttr[i] = 0;
2548
2549 uint32 count = 0;
2550 for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
2551 {
2552 SpellInfo const* spellInfo = GetSpellInfo(i);
2553 if (!spellInfo)
2554 continue;
2555
2557 // Xinef: commented second part, fixes warlock enchants like firestone, spellstone
2558 if (!spellInfo->HasAttribute(SPELL_ATTR2_ENCHANT_OWN_ITEM_ONLY)/* || !spellInfo->HasAttribute(SPELL_ATTR0_NOT_SHAPESHIFTED)*/)
2559 continue;
2560
2561 for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
2562 {
2563 if (spellInfo->Effects[j].Effect == SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY)
2564 {
2565 uint32 enchId = spellInfo->Effects[j].MiscValue;
2566 SpellItemEnchantmentEntry const* ench = sSpellItemEnchantmentStore.LookupEntry(enchId);
2567 if (!ench)
2568 continue;
2569 mEnchantCustomAttr[enchId] = true;
2570 ++count;
2571 break;
2572 }
2573 }
2574 }
2575
2576 LOG_INFO("server.loading", ">> Loaded {} Custom Enchant Attributes in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2577 LOG_INFO("server.loading", " ");
2578}
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
#define LOG_INFO(filterType__,...)
Definition Log.h:153
@ SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY
Definition SharedDefines.h:820
@ SPELL_ATTR2_ENCHANT_OWN_ITEM_ONLY
Definition SharedDefines.h:457
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition Timer.h:131
uint32 getMSTime()
Definition Timer.h:103
bool HasAttribute(SpellAttr0 attribute) const
Definition SpellInfo.h:441
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
Definition SpellInfo.h:417
Definition DBCStructure.h:1877

References SpellInfo::Effects, getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), GetSpellInfoStoreSize(), SpellInfo::HasAttribute(), LOG_INFO, MAX_SPELL_EFFECTS, mEnchantCustomAttr, SPELL_ATTR2_ENCHANT_OWN_ITEM_ONLY, SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY, and sSpellItemEnchantmentStore.

◆ LoadPetDefaultSpells()

void SpellMgr::LoadPetDefaultSpells ( )
2773{
2774 uint32 oldMSTime = getMSTime();
2775
2776 mPetDefaultSpellsMap.clear();
2777
2778 uint32 countCreature = 0;
2779 uint32 countData = 0;
2780
2781 CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates();
2782 for (CreatureTemplateContainer::const_iterator itr = ctc->begin(); itr != ctc->end(); ++itr)
2783 {
2784 if (!itr->second.PetSpellDataId)
2785 continue;
2786
2787 // for creature with PetSpellDataId get default pet spells from dbc
2788 CreatureSpellDataEntry const* spellDataEntry = sCreatureSpellDataStore.LookupEntry(itr->second.PetSpellDataId);
2789 if (!spellDataEntry)
2790 continue;
2791
2792 int32 petSpellsId = -int32(itr->second.PetSpellDataId);
2793 PetDefaultSpellsEntry petDefSpells;
2794 for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
2795 petDefSpells.spellid[j] = spellDataEntry->spellId[j];
2796
2797 if (LoadPetDefaultSpells_helper(&itr->second, petDefSpells))
2798 {
2799 mPetDefaultSpellsMap[petSpellsId] = petDefSpells;
2800 ++countData;
2801 }
2802 }
2803
2804 LOG_INFO("server.loading", ">> Loaded Addition Spells For {} Pet Spell Data Entries in {} ms", countData, GetMSTimeDiffToNow(oldMSTime));
2805 LOG_INFO("server.loading", " ");
2806
2807 LOG_INFO("server.loading", "Loading Summonable Creature Templates...");
2808 oldMSTime = getMSTime();
2809
2810 // different summon spells
2811 for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
2812 {
2813 SpellInfo const* spellInfo = GetSpellInfo(i);
2814 if (!spellInfo)
2815 continue;
2816
2817 for (uint8 k = 0; k < MAX_SPELL_EFFECTS; ++k)
2818 {
2819 if (spellInfo->Effects[k].Effect == SPELL_EFFECT_SUMMON || spellInfo->Effects[k].Effect == SPELL_EFFECT_SUMMON_PET)
2820 {
2821 uint32 creature_id = spellInfo->Effects[k].MiscValue;
2822 CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creature_id);
2823 if (!cInfo)
2824 continue;
2825
2826 // already loaded
2827 if (cInfo->PetSpellDataId)
2828 continue;
2829
2830 // for creature without PetSpellDataId get default pet spells from creature_template
2831 int32 petSpellsId = cInfo->Entry;
2832 if (mPetDefaultSpellsMap.find(cInfo->Entry) != mPetDefaultSpellsMap.end())
2833 continue;
2834
2835 PetDefaultSpellsEntry petDefSpells;
2836 for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
2837 petDefSpells.spellid[j] = cInfo->spells[j];
2838
2839 if (LoadPetDefaultSpells_helper(cInfo, petDefSpells))
2840 {
2841 mPetDefaultSpellsMap[petSpellsId] = petDefSpells;
2842 ++countCreature;
2843 }
2844 }
2845 }
2846 }
2847
2848 LOG_INFO("server.loading", ">> Loaded {} Summonable Creature emplates in {} ms", countCreature, GetMSTimeDiffToNow(oldMSTime));
2849 LOG_INFO("server.loading", " ");
2850}
std::unordered_map< uint32, CreatureTemplate > CreatureTemplateContainer
Definition CreatureData.h:287
DBCStorage< CreatureSpellDataEntry > sCreatureSpellDataStore(CreatureSpellDatafmt)
#define MAX_CREATURE_SPELL_DATA_SLOT
Definition DBCStructure.h:834
@ SPELL_EFFECT_SUMMON_PET
Definition SharedDefines.h:822
@ SPELL_EFFECT_SUMMON
Definition SharedDefines.h:794
static bool LoadPetDefaultSpells_helper(CreatureTemplate const *cInfo, PetDefaultSpellsEntry &petDefSpells)
Definition SpellMgr.cpp:2724
Definition DBCStructure.h:837
uint32 spellId[MAX_CREATURE_SPELL_DATA_SLOT]
Definition DBCStructure.h:839
Definition CreatureData.h:187
uint32 Entry
Definition CreatureData.h:188
uint32 spells[MAX_CREATURE_SPELLS]
Definition CreatureData.h:224
uint32 PetSpellDataId
Definition CreatureData.h:225
Definition SpellMgr.h:603
uint32 spellid[MAX_CREATURE_SPELL_DATA_SLOT]
Definition SpellMgr.h:604

References SpellInfo::Effects, CreatureTemplate::Entry, getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), GetSpellInfoStoreSize(), LoadPetDefaultSpells_helper(), LOG_INFO, MAX_CREATURE_SPELL_DATA_SLOT, MAX_SPELL_EFFECTS, mPetDefaultSpellsMap, CreatureTemplate::PetSpellDataId, sCreatureSpellDataStore, sObjectMgr, SPELL_EFFECT_SUMMON, SPELL_EFFECT_SUMMON_PET, PetDefaultSpellsEntry::spellid, CreatureSpellDataEntry::spellId, and CreatureTemplate::spells.

◆ LoadPetLevelupSpellMap()

void SpellMgr::LoadPetLevelupSpellMap ( )
2679{
2680 uint32 oldMSTime = getMSTime();
2681
2682 mPetLevelupSpellMap.clear(); // need for reload case
2683
2684 uint32 count = 0;
2685 uint32 family_count = 0;
2686
2687 for (uint32 i = 0; i < sCreatureFamilyStore.GetNumRows(); ++i)
2688 {
2689 CreatureFamilyEntry const* creatureFamily = sCreatureFamilyStore.LookupEntry(i);
2690 if (!creatureFamily) // not exist
2691 continue;
2692
2693 for (uint8 j = 0; j < 2; ++j)
2694 {
2695 if (!creatureFamily->skillLine[j])
2696 continue;
2697
2698 for (SkillLineAbilityEntry const* skillLine : GetSkillLineAbilitiesBySkillLine(creatureFamily->skillLine[j]))
2699 {
2700 if (skillLine->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
2701 continue;
2702
2703 SpellInfo const* spell = GetSpellInfo(skillLine->Spell);
2704 if (!spell) // not exist or triggered or talent
2705 continue;
2706
2707 if (!spell->SpellLevel)
2708 continue;
2709
2710 PetLevelupSpellSet& spellSet = mPetLevelupSpellMap[creatureFamily->ID];
2711 if (spellSet.empty())
2712 ++family_count;
2713
2714 spellSet.insert(PetLevelupSpellSet::value_type(spell->SpellLevel, spell->Id));
2715 ++count;
2716 }
2717 }
2718 }
2719
2720 LOG_INFO("server.loading", ">> Loaded {} Pet Levelup And Default Spells For {} Families in {} ms", count, family_count, GetMSTimeDiffToNow(oldMSTime));
2721 LOG_INFO("server.loading", " ");
2722}
@ SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN
Definition DBCEnums.h:361
DBCStorage< CreatureFamilyEntry > sCreatureFamilyStore(CreatureFamilyfmt)
std::vector< SkillLineAbilityEntry const * > const & GetSkillLineAbilitiesBySkillLine(uint32 skillLine)
Definition DBCStores.cpp:939
std::multimap< uint32, uint32 > PetLevelupSpellSet
Definition SpellMgr.h:597
uint32 SpellLevel
Definition SpellInfo.h:384
Definition DBCStructure.h:781
uint32 ID
Definition DBCStructure.h:782
uint32 skillLine[2]
Definition DBCStructure.h:787
Definition DBCStructure.h:1634

References getMSTime(), GetMSTimeDiffToNow(), GetSkillLineAbilitiesBySkillLine(), GetSpellInfo(), SpellInfo::Id, CreatureFamilyEntry::ID, LOG_INFO, mPetLevelupSpellMap, sCreatureFamilyStore, SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN, CreatureFamilyEntry::skillLine, and SpellInfo::SpellLevel.

◆ LoadSkillLineAbilityMap()

void SpellMgr::LoadSkillLineAbilityMap ( )
2455{
2456 uint32 oldMSTime = getMSTime();
2457
2458 mSkillLineAbilityMap.clear();
2459
2460 uint32 count = 0;
2461
2462 for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i)
2463 {
2464 SkillLineAbilityEntry const* SkillInfo = sSkillLineAbilityStore.LookupEntry(i);
2465 if (!SkillInfo)
2466 continue;
2467
2468 mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->Spell, SkillInfo));
2469 ++count;
2470 }
2471
2472 LOG_INFO("server.loading", ">> Loaded {} SkillLineAbility MultiMap Data in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2473 LOG_INFO("server.loading", " ");
2474}
DBCStorage< SkillLineAbilityEntry > sSkillLineAbilityStore(SkillLineAbilityfmt)
uint32 Spell
Definition DBCStructure.h:1637

References getMSTime(), GetMSTimeDiffToNow(), LOG_INFO, mSkillLineAbilityMap, SkillLineAbilityEntry::Spell, and sSkillLineAbilityStore.

◆ LoadSpellAreas()

void SpellMgr::LoadSpellAreas ( )
2853{
2854 uint32 oldMSTime = getMSTime();
2855
2856 mSpellAreaMap.clear(); // need for reload case
2857 mSpellAreaForQuestMap.clear();
2859 mSpellAreaForAuraMap.clear();
2860
2861 // 0 1 2 3 4 5 6 7 8 9
2862 QueryResult result = WorldDatabase.Query("SELECT spell, area, quest_start, quest_start_status, quest_end_status, quest_end, aura_spell, racemask, gender, autocast FROM spell_area");
2863
2864 if (!result)
2865 {
2866 LOG_WARN("server.loading", ">> Loaded 0 spell area requirements. DB table `spell_area` is empty.");
2867 LOG_INFO("server.loading", " ");
2868 return;
2869 }
2870
2871 uint32 count = 0;
2872 do
2873 {
2874 Field* fields = result->Fetch();
2875
2876 uint32 spell = fields[0].Get<uint32>();
2877 SpellArea spellArea;
2878 spellArea.spellId = spell;
2879 spellArea.areaId = fields[1].Get<uint32>();
2880 spellArea.questStart = fields[2].Get<uint32>();
2881 spellArea.questStartStatus = fields[3].Get<uint32>();
2882 spellArea.questEndStatus = fields[4].Get<uint32>();
2883 spellArea.questEnd = fields[5].Get<uint32>();
2884 spellArea.auraSpell = fields[6].Get<int32>();
2885 spellArea.raceMask = fields[7].Get<uint32>();
2886 spellArea.gender = Gender(fields[8].Get<uint8>());
2887 spellArea.autocast = fields[9].Get<bool>();
2888
2889 if (SpellInfo const* spellInfo = GetSpellInfo(spell))
2890 {
2891 if (spellArea.autocast)
2892 const_cast<SpellInfo*>(spellInfo)->Attributes |= SPELL_ATTR0_NO_AURA_CANCEL;
2893 }
2894 else
2895 {
2896 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` does not exist", spell);
2897 continue;
2898 }
2899
2900 {
2901 bool ok = true;
2902 SpellAreaMapBounds sa_bounds = GetSpellAreaMapBounds(spellArea.spellId);
2903 for (SpellAreaMap::const_iterator itr = sa_bounds.first; itr != sa_bounds.second; ++itr)
2904 {
2905 if (spellArea.spellId != itr->second.spellId)
2906 continue;
2907 if (spellArea.areaId != itr->second.areaId)
2908 continue;
2909 if (spellArea.questStart != itr->second.questStart)
2910 continue;
2911 if (spellArea.auraSpell != itr->second.auraSpell)
2912 continue;
2913 if ((spellArea.raceMask & itr->second.raceMask) == 0)
2914 continue;
2915 if (spellArea.gender != itr->second.gender)
2916 continue;
2917
2918 // duplicate by requirements
2919 ok = false;
2920 break;
2921 }
2922
2923 if (!ok)
2924 {
2925 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` already listed with similar requirements.", spell);
2926 continue;
2927 }
2928 }
2929
2930 if (spellArea.areaId && !sAreaTableStore.LookupEntry(spellArea.areaId))
2931 {
2932 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have wrong area ({}) requirement", spell, spellArea.areaId);
2933 continue;
2934 }
2935
2936 if (spellArea.questStart && !sObjectMgr->GetQuestTemplate(spellArea.questStart))
2937 {
2938 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have wrong start quest ({}) requirement", spell, spellArea.questStart);
2939 continue;
2940 }
2941
2942 if (spellArea.questEnd)
2943 {
2944 if (!sObjectMgr->GetQuestTemplate(spellArea.questEnd))
2945 {
2946 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have wrong end quest ({}) requirement", spell, spellArea.questEnd);
2947 continue;
2948 }
2949 }
2950
2951 if (spellArea.auraSpell)
2952 {
2953 SpellInfo const* spellInfo = GetSpellInfo(std::abs(spellArea.auraSpell));
2954 if (!spellInfo)
2955 {
2956 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have wrong aura spell ({}) requirement", spell, std::abs(spellArea.auraSpell));
2957 continue;
2958 }
2959
2960 if (uint32(std::abs(spellArea.auraSpell)) == spellArea.spellId)
2961 {
2962 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have aura spell ({}) requirement for itself", spell, std::abs(spellArea.auraSpell));
2963 continue;
2964 }
2965
2966 // not allow autocast chains by auraSpell field (but allow use as alternative if not present)
2967 if (spellArea.autocast && spellArea.auraSpell > 0)
2968 {
2969 bool chain = false;
2970 SpellAreaForAuraMapBounds saBound = GetSpellAreaForAuraMapBounds(spellArea.spellId);
2971 for (SpellAreaForAuraMap::const_iterator itr = saBound.first; itr != saBound.second; ++itr)
2972 {
2973 if (itr->second->autocast && itr->second->auraSpell > 0)
2974 {
2975 chain = true;
2976 break;
2977 }
2978 }
2979
2980 if (chain)
2981 {
2982 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have aura spell ({}) requirement that itself autocast from aura", spell, spellArea.auraSpell);
2983 continue;
2984 }
2985
2986 SpellAreaMapBounds saBound2 = GetSpellAreaMapBounds(spellArea.auraSpell);
2987 for (SpellAreaMap::const_iterator itr2 = saBound2.first; itr2 != saBound2.second; ++itr2)
2988 {
2989 if (itr2->second.autocast && itr2->second.auraSpell > 0)
2990 {
2991 chain = true;
2992 break;
2993 }
2994 }
2995
2996 if (chain)
2997 {
2998 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have aura spell ({}) requirement that itself autocast from aura", spell, spellArea.auraSpell);
2999 continue;
3000 }
3001 }
3002 }
3003
3004 if (spellArea.raceMask && (spellArea.raceMask & sRaceMgr->GetPlayableRaceMask()) == 0)
3005 {
3006 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have wrong race mask ({}) requirement", spell, spellArea.raceMask);
3007 continue;
3008 }
3009
3010 if (spellArea.gender != GENDER_NONE && spellArea.gender != GENDER_FEMALE && spellArea.gender != GENDER_MALE)
3011 {
3012 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have wrong gender ({}) requirement", spell, spellArea.gender);
3013 continue;
3014 }
3015
3016 SpellArea const* sa = &mSpellAreaMap.insert(SpellAreaMap::value_type(spell, spellArea))->second;
3017
3018 // for search by current zone/subzone at zone/subzone change
3019 if (spellArea.areaId)
3020 mSpellAreaForAreaMap.insert(SpellAreaForAreaMap::value_type(spellArea.areaId, sa));
3021
3022 // for search at quest start/reward
3023 if (spellArea.questStart)
3024 mSpellAreaForQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart, sa));
3025
3026 // for search at quest start/reward
3027 if (spellArea.questEnd)
3028 mSpellAreaForQuestEndMap.insert(SpellAreaForQuestMap::value_type(spellArea.questEnd, sa));
3029
3030 // for search at aura apply
3031 if (spellArea.auraSpell)
3032 mSpellAreaForAuraMap.insert(SpellAreaForAuraMap::value_type(std::abs(spellArea.auraSpell), sa));
3033
3034 ++count;
3035 } while (result->NextRow());
3036
3037 if (sWorld->getIntConfig(CONFIG_ICC_BUFF_HORDE) > 0)
3038 {
3039 LOG_INFO("server.loading", ">> Using ICC Buff Horde: {}", sWorld->getIntConfig(CONFIG_ICC_BUFF_HORDE));
3040 SpellArea spellAreaICCBuffHorde = { sWorld->getIntConfig(CONFIG_ICC_BUFF_HORDE), ICC_AREA, 0, 0, 0, ICC_RACEMASK_HORDE, Gender(2), 64, 11, 1 };
3041 SpellArea const* saICCBuffHorde = &mSpellAreaMap.insert(SpellAreaMap::value_type(sWorld->getIntConfig(CONFIG_ICC_BUFF_HORDE), spellAreaICCBuffHorde))->second;
3042 mSpellAreaForAreaMap.insert(SpellAreaForAreaMap::value_type(ICC_AREA, saICCBuffHorde));
3043 ++count;
3044 }
3045 else
3046 LOG_INFO("server.loading", ">> ICC Buff Horde: disabled");
3047
3048 if (sWorld->getIntConfig(CONFIG_ICC_BUFF_ALLIANCE) > 0)
3049 {
3050 LOG_INFO("server.loading", ">> Using ICC Buff Alliance: {}", sWorld->getIntConfig(CONFIG_ICC_BUFF_ALLIANCE));
3051 SpellArea spellAreaICCBuffAlliance = { sWorld->getIntConfig(CONFIG_ICC_BUFF_ALLIANCE), ICC_AREA, 0, 0, 0, ICC_RACEMASK_ALLIANCE, Gender(2), 64, 11, 1 };
3052 SpellArea const* saICCBuffAlliance = &mSpellAreaMap.insert(SpellAreaMap::value_type(sWorld->getIntConfig(CONFIG_ICC_BUFF_ALLIANCE), spellAreaICCBuffAlliance))->second;
3053 mSpellAreaForAreaMap.insert(SpellAreaForAreaMap::value_type(ICC_AREA, saICCBuffAlliance));
3054 ++count;
3055 }
3056 else
3057 LOG_INFO("server.loading", ">> ICC Buff Alliance: disabled");
3058
3059 LOG_INFO("server.loading", ">> Loaded {} Spell Area Requirements in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
3060 LOG_INFO("server.loading", " ");
3061}
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTableEntryfmt)
#define LOG_WARN(filterType__,...)
Definition Log.h:149
#define sRaceMgr
Definition RaceMgr.h:52
Gender
Definition SharedDefines.h:60
@ GENDER_MALE
Definition SharedDefines.h:61
@ GENDER_FEMALE
Definition SharedDefines.h:62
@ GENDER_NONE
Definition SharedDefines.h:63
@ SPELL_ATTR0_NO_AURA_CANCEL
Definition SharedDefines.h:401
std::pair< SpellAreaMap::const_iterator, SpellAreaMap::const_iterator > SpellAreaMapBounds
Definition SpellMgr.h:546
@ ICC_RACEMASK_HORDE
Definition SpellMgr.h:521
@ ICC_AREA
Definition SpellMgr.h:520
@ ICC_RACEMASK_ALLIANCE
Definition SpellMgr.h:522
std::pair< SpellAreaForAuraMap::const_iterator, SpellAreaForAuraMap::const_iterator > SpellAreaForAuraMapBounds
Definition SpellMgr.h:548
@ CONFIG_ICC_BUFF_ALLIANCE
Definition WorldConfig.h:358
@ CONFIG_ICC_BUFF_HORDE
Definition WorldConfig.h:357
SpellAreaMapBounds GetSpellAreaMapBounds(uint32 spell_id) const
Definition SpellMgr.cpp:1049
SpellAreaForAuraMapBounds GetSpellAreaForAuraMapBounds(uint32 spell_id) const
Definition SpellMgr.cpp:1064
#define sWorld
Definition World.h:337
Definition SpellMgr.h:526
uint32 spellId
Definition SpellMgr.h:527

References CONFIG_ICC_BUFF_ALLIANCE, CONFIG_ICC_BUFF_HORDE, GENDER_FEMALE, GENDER_MALE, GENDER_NONE, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), GetSpellAreaForAuraMapBounds(), GetSpellAreaMapBounds(), GetSpellInfo(), ICC_AREA, ICC_RACEMASK_ALLIANCE, ICC_RACEMASK_HORDE, LOG_ERROR, LOG_INFO, LOG_WARN, mSpellAreaForAreaMap, mSpellAreaForAuraMap, mSpellAreaForQuestEndMap, mSpellAreaForQuestMap, mSpellAreaMap, sAreaTableStore, sObjectMgr, SPELL_ATTR0_NO_AURA_CANCEL, SpellArea::spellId, sRaceMgr, sWorld, and WorldDatabase.

◆ LoadSpellBonuses()

void SpellMgr::LoadSpellBonuses ( )
2337{
2338 uint32 oldMSTime = getMSTime();
2339
2340 mSpellBonusMap.clear(); // need for reload case
2341
2342 // 0 1 2 3 4
2343 QueryResult result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data");
2344 if (!result)
2345 {
2346 LOG_WARN("server.loading", ">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty.");
2347 LOG_INFO("server.loading", " ");
2348 return;
2349 }
2350
2351 uint32 count = 0;
2352 do
2353 {
2354 Field* fields = result->Fetch();
2355 uint32 entry = fields[0].Get<uint32>();
2356
2357 SpellInfo const* spell = GetSpellInfo(entry);
2358 if (!spell)
2359 {
2360 LOG_ERROR("sql.sql", "Spell {} listed in `spell_bonus_data` does not exist", entry);
2361 continue;
2362 }
2363
2364 SpellBonusEntry& sbe = mSpellBonusMap[entry];
2365 sbe.direct_damage = fields[1].Get<float>();
2366 sbe.dot_damage = fields[2].Get<float>();
2367 sbe.ap_bonus = fields[3].Get<float>();
2368 sbe.ap_dot_bonus = fields[4].Get<float>();
2369
2370 ++count;
2371 } while (result->NextRow());
2372
2373 LOG_INFO("server.loading", ">> Loaded {} Extra Spell Bonus Data in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2374 LOG_INFO("server.loading", " ");
2375}
Definition SpellMgr.h:321
float ap_dot_bonus
Definition SpellMgr.h:325
float dot_damage
Definition SpellMgr.h:323
float ap_bonus
Definition SpellMgr.h:324
float direct_damage
Definition SpellMgr.h:322

References SpellBonusEntry::ap_bonus, SpellBonusEntry::ap_dot_bonus, SpellBonusEntry::direct_damage, SpellBonusEntry::dot_damage, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), LOG_ERROR, LOG_INFO, LOG_WARN, mSpellBonusMap, and WorldDatabase.

◆ LoadSpellCones()

void SpellMgr::LoadSpellCones ( )
1626{
1627 uint32 oldMSTime = getMSTime();
1628
1629 mSpellCones.clear(); // need for reload case
1630
1631 // 0 1
1632 QueryResult result = WorldDatabase.Query("SELECT ID, ConeDegrees FROM spell_cone");
1633
1634 if (!result)
1635 {
1636 LOG_WARN("server.loading", ">> Loaded 0 spell cone definitions. DB table `spell_cone` is empty.");
1637 LOG_INFO("server.loading", " ");
1638 return;
1639 }
1640
1641 uint32 count = 0;
1642 do
1643 {
1644 Field* fields = result->Fetch();
1645
1646 uint32 spellId = fields[0].Get<uint32>();
1647 int16 coneDeg = fields[1].Get<int16>();
1648
1649 SpellInfo const* spellInfo = GetSpellInfo(spellId);
1650 if (!spellInfo)
1651 {
1652 LOG_ERROR("sql.sql", "Spell (ID:{}) listed in `spell_cone` does not exist.", spellId);
1653 continue;
1654 }
1655
1656 if (coneDeg < -360 || coneDeg > 360)
1657 {
1658 LOG_ERROR("sql.sql", "Spell (Id: {}) cone degrees {} out of range (-360..360).", spellId, coneDeg);
1659 continue;
1660 }
1661
1662 uint32 firstRankId = GetFirstSpellInChain(spellId);
1663 SpellInfo const* firstSpellInfo = GetSpellInfo(firstRankId);
1664
1665 SpellInfo const* checkInfo = firstSpellInfo ? firstSpellInfo : spellInfo;
1666
1667 bool hasCone = false;
1668 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
1669 {
1670 if (checkInfo->Effects[i].TargetA.GetSelectionCategory() == TARGET_SELECT_CATEGORY_CONE ||
1671 checkInfo->Effects[i].TargetB.GetSelectionCategory() == TARGET_SELECT_CATEGORY_CONE)
1672 {
1673 hasCone = true;
1674 break;
1675 }
1676 }
1677
1678 if (!hasCone)
1679 {
1680 LOG_ERROR("sql.sql", "Spell (ID:{}) listed in `spell_cone` does not have a cone implicit target.", spellId);
1681 continue;
1682 }
1683
1684 if (firstRankId != spellId)
1685 LOG_INFO("server.loading", "Spell (ID:{}) listed in `spell_cone` is not first rank; mapping to first rank {}.", spellId, firstRankId);
1686
1687 SpellCone sc{};
1688 sc.cone_degrees = coneDeg;
1689
1690 // Avoid overwriting an existing first-rank entry with conflicting values
1691 auto itr = mSpellCones.find(firstRankId);
1692 if (itr != mSpellCones.end())
1693 {
1694 if (itr->second.cone_degrees != sc.cone_degrees)
1695 LOG_ERROR("sql.sql",
1696 "Conflicting `spell_cone` entries for first-rank spell ID {}: {} vs {}. Keeping first value.",
1697 firstRankId,
1698 itr->second.cone_degrees,
1699 sc.cone_degrees);
1700 }
1701 else
1702 {
1703 mSpellCones[firstRankId] = sc;
1704 ++count;
1705 }
1706 } while (result->NextRow());
1707
1708 LOG_INFO("server.loading", ">> Loaded {} Spell Cone definitions in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
1709 LOG_INFO("server.loading", " ");
1710}
std::int16_t int16
Definition Define.h:104
@ TARGET_SELECT_CATEGORY_CONE
Definition SpellInfo.h:82
Definition SpellMgr.h:399
int16_t cone_degrees
Definition SpellMgr.h:400

References SpellCone::cone_degrees, SpellInfo::Effects, Field::Get(), GetFirstSpellInChain(), getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), LOG_ERROR, LOG_INFO, LOG_WARN, MAX_SPELL_EFFECTS, mSpellCones, TARGET_SELECT_CATEGORY_CONE, and WorldDatabase.

◆ LoadSpellCooldownOverrides()

void SpellMgr::LoadSpellCooldownOverrides ( )
3095{
3096 uint32 oldMSTime = getMSTime();
3097
3099
3100 QueryResult result = WorldDatabase.Query("SELECT Id, RecoveryTime, CategoryRecoveryTime, StartRecoveryTime, StartRecoveryCategory FROM spell_cooldown_overrides");
3101
3102 uint32 count = 0;
3103
3104 if (result)
3105 {
3106 do
3107 {
3108 Field* fields = result->Fetch();
3109 SpellCooldownOverride spellCooldown;
3110 uint32 spellId = fields[0].Get<uint32>();
3111 spellCooldown.RecoveryTime = fields[1].Get<uint32>();
3112 spellCooldown.CategoryRecoveryTime = fields[2].Get<uint32>();
3113 spellCooldown.StartRecoveryTime = fields[3].Get<uint32>();
3114 spellCooldown.StartRecoveryCategory = fields[4].Get<uint32>();
3115 mSpellCooldownOverrideMap[spellId] = spellCooldown;
3116
3117 ++count;
3118 } while (result->NextRow());
3119 }
3120
3121 LOG_INFO("server.loading", ">> Loaded {} Spell Cooldown Overrides entries in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
3122 LOG_INFO("server.loading", " ");
3123}
Definition SpellMgr.h:618
uint32 StartRecoveryTime
Definition SpellMgr.h:621
uint32 CategoryRecoveryTime
Definition SpellMgr.h:620
uint32 StartRecoveryCategory
Definition SpellMgr.h:622
uint32 RecoveryTime
Definition SpellMgr.h:619

References SpellCooldownOverride::CategoryRecoveryTime, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_INFO, mSpellCooldownOverrideMap, SpellCooldownOverride::RecoveryTime, SpellCooldownOverride::StartRecoveryCategory, SpellCooldownOverride::StartRecoveryTime, and WorldDatabase.

◆ LoadSpellEnchantProcData()

void SpellMgr::LoadSpellEnchantProcData ( )
2581{
2582 uint32 oldMSTime = getMSTime();
2583
2584 mSpellEnchantProcEventMap.clear(); // need for reload case
2585
2586 // 0 1 2 3 4
2587 QueryResult result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx, attributeMask FROM spell_enchant_proc_data");
2588 if (!result)
2589 {
2590 LOG_WARN("server.loading", ">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty.");
2591 LOG_INFO("server.loading", " ");
2592 return;
2593 }
2594
2595 uint32 count = 0;
2596 do
2597 {
2598 Field* fields = result->Fetch();
2599
2600 uint32 enchantId = fields[0].Get<uint32>();
2601
2602 SpellItemEnchantmentEntry const* ench = sSpellItemEnchantmentStore.LookupEntry(enchantId);
2603 if (!ench)
2604 {
2605 LOG_ERROR("sql.sql", "Enchancment {} listed in `spell_enchant_proc_data` does not exist", enchantId);
2606 continue;
2607 }
2608
2610
2611 spe.customChance = fields[1].Get<uint32>();
2612 spe.PPMChance = fields[2].Get<float>();
2613 spe.procEx = fields[3].Get<uint32>();
2614 spe.attributeMask = fields[4].Get<uint32>();
2615
2616 mSpellEnchantProcEventMap[enchantId] = spe;
2617
2618 ++count;
2619 } while (result->NextRow());
2620
2621 LOG_INFO("server.loading", ">> Loaded {} Enchant Proc Data Definitions in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2622 LOG_INFO("server.loading", " ");
2623}
Definition SpellMgr.h:311
uint32 procEx
Definition SpellMgr.h:314
uint32 attributeMask
Definition SpellMgr.h:315
uint32 customChance
Definition SpellMgr.h:312
float PPMChance
Definition SpellMgr.h:313

References SpellEnchantProcEntry::attributeMask, SpellEnchantProcEntry::customChance, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, mSpellEnchantProcEventMap, SpellEnchantProcEntry::PPMChance, SpellEnchantProcEntry::procEx, sSpellItemEnchantmentStore, and WorldDatabase.

◆ LoadSpellGroups()

void SpellMgr::LoadSpellGroups ( )
1713{
1714 uint32 oldMSTime = getMSTime();
1715
1716 mSpellSpellGroup.clear(); // need for reload case
1717 mSpellGroupSpell.clear();
1718
1719 // 0 1
1720 QueryResult result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group");
1721 if (!result)
1722 {
1723 LOG_WARN("server.loading", ">> Loaded 0 spell group definitions. DB table `spell_group` is empty.");
1724 LOG_INFO("server.loading", " ");
1725 return;
1726 }
1727
1728 std::set<uint32> groups;
1729 uint32 count = 0;
1730 do
1731 {
1732 Field* fields = result->Fetch();
1733
1734 uint32 group_id = fields[0].Get<uint32>();
1735 if (group_id <= SPELL_GROUP_DB_RANGE_MIN && group_id >= SPELL_GROUP_CORE_RANGE_MAX)
1736 {
1737 LOG_ERROR("sql.sql", "SpellGroup id {} listed in `spell_group` is in core range, but is not defined in core!", group_id);
1738 continue;
1739 }
1740 int32 spell_id = fields[1].Get<int32>();
1741
1742 groups.insert(group_id);
1743 mSpellGroupSpell.emplace(SpellGroup(group_id), spell_id);
1744
1745 } while (result->NextRow());
1746
1747 for (auto itr = mSpellGroupSpell.begin(); itr!= mSpellGroupSpell.end();)
1748 {
1749 if (itr->second < 0)
1750 {
1751 if (groups.find(abs(itr->second)) == groups.end())
1752 {
1753 LOG_ERROR("sql.sql", "SpellGroup id {} listed in `spell_group` does not exist", abs(itr->second));
1754 itr = mSpellGroupSpell.erase(itr);
1755 }
1756 else
1757 ++itr;
1758 }
1759 else
1760 {
1761 SpellInfo const* spellInfo = GetSpellInfo(itr->second);
1762 if (!spellInfo)
1763 {
1764 LOG_ERROR("sql.sql", "Spell {} listed in `spell_group` does not exist", itr->second);
1765 itr = mSpellGroupSpell.erase(itr);
1766 }
1767 else if (spellInfo->GetRank() > 1)
1768 {
1769 LOG_ERROR("sql.sql", "Spell {} listed in `spell_group` is not first rank of spell.", itr->second);
1770 itr = mSpellGroupSpell.erase(itr);
1771 }
1772 else
1773 ++itr;
1774 }
1775 }
1776
1777 for (auto groupItr = groups.begin(); groupItr != groups.end(); ++groupItr)
1778 {
1779 std::set<uint32> spells;
1781
1782 for (auto spellItr = spells.begin(); spellItr != spells.end(); ++spellItr)
1783 {
1784 ++count;
1785 mSpellSpellGroup.emplace(*spellItr, SpellGroup(*groupItr));
1786 }
1787 }
1788
1789 LOG_INFO("server.loading", ">> Loaded {} spell group Definitions in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
1790 LOG_INFO("server.loading", " ");
1791}
@ SPELL_GROUP_CORE_RANGE_MAX
Definition SpellMgr.h:335
spells
Definition boss_krystallus.cpp:26
uint8 GetRank() const
Definition SpellInfo.cpp:2941

References Field::Get(), getMSTime(), GetMSTimeDiffToNow(), SpellInfo::GetRank(), GetSetOfSpellsInSpellGroup(), GetSpellInfo(), LOG_ERROR, LOG_INFO, LOG_WARN, mSpellGroupSpell, mSpellSpellGroup, SPELL_GROUP_CORE_RANGE_MAX, and WorldDatabase.

◆ LoadSpellGroupStackRules()

void SpellMgr::LoadSpellGroupStackRules ( )
1794{
1795 uint32 oldMSTime = getMSTime();
1796
1797 mSpellGroupStack.clear(); // need for reload case
1798 mSpellSameEffectStack.clear();
1800
1801 std::vector<uint32> sameEffectGroups;
1802
1803 // 0 1
1804 QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules");
1805 if (!result)
1806 {
1807 LOG_WARN("server.loading", ">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty.");
1808 LOG_INFO("server.loading", " ");
1809 return;
1810 }
1811
1812 uint32 count = 0;
1813 do
1814 {
1815 Field* fields = result->Fetch();
1816
1817 uint32 group_id = fields[0].Get<uint32>();
1818 uint8 stack_rule = fields[1].Get<int8>();
1819 if (stack_rule >= SPELL_GROUP_STACK_RULE_MAX)
1820 {
1821 LOG_ERROR("sql.sql", "SpellGroupStackRule {} listed in `spell_group_stack_rules` does not exist.", stack_rule);
1822 continue;
1823 }
1824
1825 auto bounds = GetSpellGroupSpellMapBounds((SpellGroup)group_id);
1826 if (bounds.first == bounds.second)
1827 {
1828 LOG_ERROR("sql.sql", "SpellGroup id {} listed in `spell_group_stack_rules` does not exist.", group_id);
1829 continue;
1830 }
1831
1832 mSpellGroupStack.emplace(SpellGroup(group_id), SpellGroupStackRule(stack_rule));
1833
1834 // different container for same effect stack rules, need to check effect types
1836 sameEffectGroups.push_back(group_id);
1837
1838 ++count;
1839 } while (result->NextRow());
1840
1841 LOG_INFO("server.loading", ">> Loaded {} spell group stack rules in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
1842 LOG_INFO("server.loading", " ");
1843
1844 count = 0;
1845 oldMSTime = getMSTime();
1846
1847 for (uint32 group_id : sameEffectGroups)
1848 {
1849 std::set<uint32> spellIds;
1850 GetSetOfSpellsInSpellGroup(SpellGroup(group_id), spellIds);
1851
1852 std::unordered_set<uint32> auraTypes;
1853
1854 // we have to 'guess' what effect this group corresponds to
1855 {
1856 std::unordered_multiset<uint32 /*auraName*/> frequencyContainer;
1857
1858 // only waylay for the moment (shared group)
1859 std::vector<std::vector<uint32 /*auraName*/>> const SubGroups =
1860 {
1862 };
1863
1864 for (uint32 spellId : spellIds)
1865 {
1866 SpellInfo const* spellInfo = AssertSpellInfo(spellId);
1867 for (SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
1868 {
1869 if (!spellEffectInfo.IsAura())
1870 continue;
1871
1872 uint32 auraName = spellEffectInfo.ApplyAuraName;
1873 for (std::vector<uint32> const& subGroup : SubGroups)
1874 {
1875 if (std::find(subGroup.begin(), subGroup.end(), auraName) != subGroup.end())
1876 {
1877 // count as first aura
1878 auraName = subGroup.front();
1879 break;
1880 }
1881 }
1882
1883 frequencyContainer.insert(auraName);
1884 }
1885 }
1886
1887 uint32 auraType = 0;
1888 size_t auraTypeCount = 0;
1889 for (uint32 auraName : frequencyContainer)
1890 {
1891 size_t currentCount = frequencyContainer.count(auraName);
1892 if (currentCount > auraTypeCount)
1893 {
1894 auraType = auraName;
1895 auraTypeCount = currentCount;
1896 }
1897 }
1898
1899 for (std::vector<uint32> const& subGroup : SubGroups)
1900 {
1901 if (auraType == subGroup.front())
1902 {
1903 auraTypes.insert(subGroup.begin(), subGroup.end());
1904 break;
1905 }
1906 }
1907
1908 if (auraTypes.empty())
1909 auraTypes.insert(auraType);
1910 }
1911
1912 // re-check spells against guessed group
1913 for (uint32 spellId : spellIds)
1914 {
1915 SpellInfo const* spellInfo = AssertSpellInfo(spellId);
1916
1917 bool found = false;
1918 while (spellInfo)
1919 {
1920 for (uint32 auraType : auraTypes)
1921 {
1922 if (spellInfo->HasAura(AuraType(auraType)))
1923 {
1924 found = true;
1925 break;
1926 }
1927 }
1928
1929 if (found)
1930 break;
1931
1932 spellInfo = spellInfo->GetNextRankSpell();
1933 }
1934
1935 // not found either, log error
1936 if (!found)
1937 LOG_ERROR("sql.sql", "SpellId {} listed in `spell_group` with stack rule 3 does not share aura assigned for group {}", spellId, group_id);
1938 }
1939
1940 // a spell can be in several groups for the same aura type (one per stat, e.g. K'iru's Song of Victory),
1941 // keep the (auraType, miscValue) pairs carried by at least two spells to tell which group an effect is in
1942 {
1943 std::map<std::pair<uint32 /*auraName*/, int32 /*miscValue*/>, uint32 /*spellCount*/> miscCount;
1944 for (uint32 spellId : spellIds)
1945 {
1946 std::set<std::pair<uint32, int32>> spellPairs;
1947 SpellInfo const* spellInfo = AssertSpellInfo(spellId);
1948 for (; spellInfo; spellInfo = spellInfo->GetNextRankSpell())
1949 {
1950 for (SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
1951 {
1952 if (!spellEffectInfo.IsAura() || !auraTypes.count(spellEffectInfo.ApplyAuraName))
1953 continue;
1954
1955 spellPairs.emplace(uint32(spellEffectInfo.ApplyAuraName), spellEffectInfo.MiscValue);
1956 }
1957 }
1958
1959 for (auto const& spellPair : spellPairs)
1960 ++miscCount[spellPair];
1961 }
1962
1963 for (auto const& [spellPair, spellCount] : miscCount)
1964 if (spellCount >= 2)
1965 mSpellSameEffectSharedMisc[SpellGroup(group_id)].insert(spellPair);
1966 }
1967
1968 mSpellSameEffectStack[SpellGroup(group_id)] = auraTypes;
1969 ++count;
1970 }
1971
1972 LOG_INFO("server.loading", ">> Loaded {} SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT stack rules in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
1973 LOG_INFO("server.loading", " ");
1974}
std::int8_t int8
Definition Define.h:105
@ SPELL_AURA_MOD_MELEE_HASTE
Definition SpellAuraDefines.h:201
@ SPELL_AURA_MOD_RANGED_HASTE
Definition SpellAuraDefines.h:203
@ SPELL_AURA_MOD_MELEE_RANGED_HASTE
Definition SpellAuraDefines.h:255
@ SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT
Definition SpellMgr.h:365
@ SPELL_GROUP_STACK_RULE_MAX
Definition SpellMgr.h:367
Definition SpellInfo.h:270
SpellInfo const * GetNextRankSpell() const
Definition SpellInfo.cpp:2960
bool HasAura(AuraType aura) const
Definition SpellInfo.cpp:906
SpellInfo const * AssertSpellInfo(uint32 spellId) const
Definition SpellMgr.h:747

References AssertSpellInfo(), Field::Get(), SpellInfo::GetEffects(), getMSTime(), GetMSTimeDiffToNow(), SpellInfo::GetNextRankSpell(), GetSetOfSpellsInSpellGroup(), GetSpellGroupSpellMapBounds(), SpellInfo::HasAura(), LOG_ERROR, LOG_INFO, LOG_WARN, mSpellGroupStack, mSpellSameEffectSharedMisc, mSpellSameEffectStack, SPELL_AURA_MOD_MELEE_HASTE, SPELL_AURA_MOD_MELEE_RANGED_HASTE, SPELL_AURA_MOD_RANGED_HASTE, SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT, SPELL_GROUP_STACK_RULE_MAX, and WorldDatabase.

◆ LoadSpellInfoCorrections()

void SpellMgr::LoadSpellInfoCorrections ( )
40{
41 uint32 oldMSTime = getMSTime();
42
44 467, // Thorns (Rank 1)
45 782, // Thorns (Rank 2)
46 1075, // Thorns (Rank 3)
47 8914, // Thorns (Rank 4)
48 9756, // Thorns (Rank 5)
49 9910, // Thorns (Rank 6)
50 26992, // Thorns (Rank 7)
51 53307, // Thorns (Rank 8)
52 53352, // Explosive Shot (trigger)
53 50783, // Slam (Triggered spell)
54 20647 // Execute (Triggered spell)
55 }, [](SpellInfo* spellInfo)
56 {
57 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
58 });
59
60 // Scarlet Raven Priest Image
61 ApplySpellFix({ 48763, 48761 }, [](SpellInfo* spellInfo)
62 {
63 spellInfo->AuraInterruptFlags &= ~AURA_INTERRUPT_FLAG_SPELL_ATTACK;
64 });
65
66 // Has Brewfest Mug
67 ApplySpellFix({ 42533 }, [](SpellInfo* spellInfo)
68 {
69 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(347); // 15 min
70 });
71
72 // Headless Horseman's Mount - use the flying creature model for the flying variants
73 ApplySpellFix({ 48023, 51617 }, [](SpellInfo* spellInfo)
74 {
75 spellInfo->Effects[EFFECT_0].MiscValue = 27152;
76 });
77
78 // Elixir of Minor Fortitude
79 ApplySpellFix({ 2378 }, [](SpellInfo* spellInfo)
80 {
81 spellInfo->ManaCost = 0;
82 spellInfo->ManaPerSecond = 0;
83 });
84
85 // Elixir of Detect Undead
86 ApplySpellFix({ 11389 }, [](SpellInfo* spellInfo)
87 {
88 spellInfo->PowerType = POWER_MANA;
89 spellInfo->ManaCost = 0;
90 spellInfo->ManaPerSecond = 0;
91 });
92
93 // Evergrove Druid Transform Crow
94 ApplySpellFix({ 38776 }, [](SpellInfo* spellInfo)
95 {
96 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(4); // 120 seconds
97 });
98
100 63026, // Force Cast (HACK: Target shouldn't be changed)
101 63137 // Force Cast (HACK: Target shouldn't be changed; summon position should be untied from spell destination)
102 }, [](SpellInfo* spellInfo)
103 {
104 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB);
105 });
106
108 53096, // Quetz'lun's Judgment
109 70743, // AoD Special
110 70614 // AoD Special - Vegard
111 }, [](SpellInfo* spellInfo)
112 {
113 spellInfo->MaxAffectedTargets = 1;
114 });
115
116 // Summon Skeletons
117 ApplySpellFix({ 52611, 52612 }, [](SpellInfo* spellInfo)
118 {
119 spellInfo->Effects[EFFECT_0].MiscValueB = 64;
120 });
121
123 40244, // Simon Game Visual
124 40245, // Simon Game Visual
125 40246, // Simon Game Visual
126 40247, // Simon Game Visual
127 42835 // Spout, remove damage effect, only anim is needed
128 }, [](SpellInfo* spellInfo)
129 {
130 spellInfo->Effects[EFFECT_0].Effect = 0;
131 });
132
134 63665, // Charge (Argent Tournament emote on riders)
135 2895, // Wrath of Air Totem rank 1 (Aura)
136 68933, // Wrath of Air Totem rank 2 (Aura)
137 29200 // Purify Helboar Meat
138 }, [](SpellInfo* spellInfo)
139 {
140 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
141 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(0);
142 });
143
144 // Howl of Azgalor
145 ApplySpellFix({ 31344 }, [](SpellInfo* spellInfo)
146 {
147 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yards instead of 50000?!
148 });
149
151 42818, // Headless Horseman - Wisp Flight Port
152 42821 // Headless Horseman - Wisp Flight Missile
153 }, [](SpellInfo* spellInfo)
154 {
155 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100 yards
156 });
157
158 // Spirit of Kirith
159 ApplySpellFix({ 10853 }, [](SpellInfo* spellInfo)
160 {
161 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(3); // 1min
162 });
163
164 // Headless Horseman - Start Fire
165 ApplySpellFix({ 42132 }, [](SpellInfo* spellInfo)
166 {
167 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100 yards
168 });
169
170 //They Must Burn Bomb Aura (self)
171 ApplySpellFix({ 36350 }, [](SpellInfo* spellInfo)
172 {
173 spellInfo->Effects[EFFECT_0].TriggerSpell = 36325; // They Must Burn Bomb Drop (DND)
174 });
175
176 // Mana Shield (rank 2)
177 ApplySpellFix({ 8494 }, [](SpellInfo* spellInfo)
178 {
179 spellInfo->ProcChance = 0; // because of bug in dbc
180 });
181
183 63320, // Glyph of Life Tap
184 20335, // Heart of the Crusader
185 20336, // Heart of the Crusader
186 20337, // Heart of the Crusader
187 53228, // Rapid Killing (Rank 1)
188 53232, // Rapid Killing (Rank 2)
189 }, [](SpellInfo* spellInfo)
190 {
191 spellInfo->AttributesEx3 |= SPELL_ATTR3_CAN_PROC_FROM_PROCS; // Entries were not updated after spell effect change, we have to do that manually
192 });
193
195 31347, // Doom
196 41635, // Prayer of Mending
197 39365, // Thundering Storm
198 52124, // Sky Darkener Assault
199 42442, // Vengeance Landing Cannonfire
200 45863, // Cosmetic - Incinerate to Random Target
201 25425, // Shoot
202 45761, // Shoot
203 42611, // Shoot
204 61588, // Blazing Harpoon
205 36327 // Shoot Arcane Explosion Arrow
206 }, [](SpellInfo* spellInfo)
207 {
208 spellInfo->MaxAffectedTargets = 1;
209 });
210
211 // Skartax Purple Beam
212 ApplySpellFix({ 36384 }, [](SpellInfo* spellInfo)
213 {
214 spellInfo->MaxAffectedTargets = 2;
215 });
216
218 37790, // Spread Shot
219 54172, // Divine Storm (heal)
220 66588 // Flaming Spear
221 }, [](SpellInfo* spellInfo)
222 {
223 spellInfo->MaxAffectedTargets = 3;
224 });
225
226 // Divine Storm
227 ApplySpellFix({ 54171 }, [](SpellInfo* spellInfo)
228 {
229 spellInfo->MaxAffectedTargets = 3;
230 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
231 });
232
233 // Divine Storm (Damage)
234 ApplySpellFix({ 53385 }, [](SpellInfo* spellInfo)
235 {
236 spellInfo->MaxAffectedTargets = 4;
237 });
238
239 // Spitfire Totem
240 ApplySpellFix({ 38296 }, [](SpellInfo* spellInfo)
241 {
242 spellInfo->MaxAffectedTargets = 5;
243 });
244
246 40827, // Sinful Beam
247 40859, // Sinister Beam
248 40860, // Vile Beam
249 40861 // Wicked Beam
250 }, [](SpellInfo* spellInfo)
251 {
252 spellInfo->MaxAffectedTargets = 10;
253 });
254
255 // Unholy Frenzy
256 ApplySpellFix({ 50312 }, [](SpellInfo* spellInfo)
257 {
258 spellInfo->MaxAffectedTargets = 15;
259 });
260
262 17941, // Shadow Trance
263 22008, // Netherwind Focus
264 31834, // Light's Grace
265 34754, // Clearcasting
266 34936, // Backlash
267 48108, // Hot Streak
268 51124, // Killing Machine
269 54741, // Firestarter
270 64823, // Item - Druid T8 Balance 4P Bonus
271 34477, // Misdirection
272 18820, // Insight
273 57761 // Fireball!
274 }, [](SpellInfo* spellInfo)
275 {
276 spellInfo->ProcCharges = 1;
277 });
278
279 // Tidal Wave
280 ApplySpellFix({ 53390 }, [](SpellInfo* spellInfo)
281 {
282 spellInfo->ProcCharges = 2;
283 });
284
285 // Oscillation Field
286 ApplySpellFix({ 37408 }, [](SpellInfo* spellInfo)
287 {
288 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
289 });
290
291 // Ascendance (Talisman of Ascendance trinket)
292 ApplySpellFix({ 28200 }, [](SpellInfo* spellInfo)
293 {
294 spellInfo->ProcCharges = 6;
295 });
296
297 // Crafty's Ultra-Advanced Proto-Typical Shortening Blaster
298 ApplySpellFix({ 51912 }, [](SpellInfo* spellInfo)
299 {
300 spellInfo->Effects[EFFECT_0].Amplitude = 3000;
301 });
302
303 // Desecration Arm - 36 instead of 37 - typo?
304 ApplySpellFix({ 29809 }, [](SpellInfo* spellInfo)
305 {
306 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_7_YARDS);
307 });
308
309 // Sic'em
310 ApplySpellFix({ 42767 }, [](SpellInfo* spellInfo)
311 {
312 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_NEARBY_ENTRY);
313 });
314
315 // Master Shapeshifter: missing stance data for forms other than bear - bear version has correct data
316 // To prevent aura staying on target after talent unlearned
317 ApplySpellFix({ 48420 }, [](SpellInfo* spellInfo)
318 {
319 spellInfo->Stances = 1 << (FORM_CAT - 1);
320 });
321
322 ApplySpellFix({ 48421 }, [](SpellInfo* spellInfo)
323 {
324 spellInfo->Stances = 1 << (FORM_MOONKIN - 1);
325 });
326
327 ApplySpellFix({ 48422 }, [](SpellInfo* spellInfo)
328 {
329 spellInfo->Stances = 1 << (FORM_TREE - 1);
330 });
331
332 // Elemental Oath
333 ApplySpellFix({ 51466, 51470 }, [](SpellInfo* spellInfo)
334 {
335 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
336 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
337 spellInfo->Effects[EFFECT_1].MiscValue = SPELLMOD_EFFECT2;
338 spellInfo->Effects[EFFECT_1].SpellClassMask = flag96(0x00000000, 0x00004000, 0x00000000);
339 });
340
341 // Improved Shadowform (Rank 1)
342 ApplySpellFix({ 47569 }, [](SpellInfo* spellInfo)
343 {
344 spellInfo->Attributes &= ~SPELL_ATTR0_NOT_SHAPESHIFTED; // with this spell atrribute aura can be stacked several times
345 });
346
347 // Natural shapeshifter
348 ApplySpellFix({ 16834, 16835 }, [](SpellInfo* spellInfo)
349 {
350 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21);
351 });
352
353 // Ebon Plague
354 ApplySpellFix({ 51735, 51734, 51726 }, [](SpellInfo* spellInfo)
355 {
356 spellInfo->SpellFamilyFlags[2] = 0x10;
357 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN;
358 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
359 });
360
361 // Parasitic Shadowfiend Passive
362 ApplySpellFix({ 41013 }, [](SpellInfo* spellInfo)
363 {
364 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_DUMMY; // proc debuff, and summon infinite fiends
365 });
366
368 27892, // To Anchor 1
369 27928, // To Anchor 1
370 27935, // To Anchor 1
371 }, [](SpellInfo* spellInfo)
372 {
373 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS);
374 });
375
376 // Wrath of the Plaguebringer
377 ApplySpellFix({ 29214, 54836 }, [](SpellInfo* spellInfo)
378 {
379 // target allys instead of enemies, target A is src_caster, spells with effect like that have ally target
380 // this is the only known exception, probably just wrong data
381 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY);
382 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY);
383 });
384
385 // Wind Shear
386 ApplySpellFix({ 57994 }, [](SpellInfo* spellInfo)
387 {
388 // improper data for EFFECT_1 in 3.3.5 DBC, but is correct in 4.x
389 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_MODIFY_THREAT_PERCENT;
390 spellInfo->Effects[EFFECT_1].BasePoints = -6; // -5%
391 });
392
393 // Improved Devouring Plague
394 ApplySpellFix({ 63675 }, [](SpellInfo* spellInfo)
395 {
396 spellInfo->Effects[EFFECT_0].BonusMultiplier = 0;
397 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
398 });
399
401 8145, // Tremor Totem (instant pulse)
402 6474 // Earthbind Totem (instant pulse)
403 }, [](SpellInfo* spellInfo)
404 {
405 spellInfo->AttributesEx5 |= SPELL_ATTR5_EXTRA_INITIAL_PERIOD;
406 });
407
408 // Marked for Death
409 ApplySpellFix({ 53241, 53243, 53244, 53245, 53246 }, [](SpellInfo* spellInfo)
410 {
411 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(399361, 276955137, 1);
412 });
413
415 70728, // Exploit Weakness
416 70840 // Devious Minds
417 }, [](SpellInfo* spellInfo)
418 {
419 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
420 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_PET);
421 });
422
423 // Culling The Herd
424 ApplySpellFix({ 70893 }, [](SpellInfo* spellInfo)
425 {
426 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
427 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_MASTER);
428 });
429
430 // Sigil of the Frozen Conscience
431 ApplySpellFix({ 54800 }, [](SpellInfo* spellInfo)
432 {
433 // change class mask to custom extended flags of Icy Touch
434 // this is done because another spell also uses the same SpellFamilyFlags as Icy Touch
435 // SpellFamilyFlags[0] & 0x00000040 in SPELLFAMILY_DEATHKNIGHT is currently unused (3.3.5a)
436 // this needs research on modifier applying rules, does not seem to be in Attributes fields
437 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000040, 0x00000000, 0x00000000);
438 });
439
440 // Idol of the Flourishing Life
441 ApplySpellFix({ 64949 }, [](SpellInfo* spellInfo)
442 {
443 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000000, 0x02000000, 0x00000000);
444 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
445 });
446
448 34231, // Libram of the Lightbringer
449 60792, // Libram of Tolerance
450 64956 // Libram of the Resolute
451 }, [](SpellInfo* spellInfo)
452 {
453 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x80000000, 0x00000000, 0x00000000);
454 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
455 });
456
458 28851, // Libram of Light
459 28853, // Libram of Divinity
460 32403 // Blessed Book of Nagrand
461 }, [](SpellInfo* spellInfo)
462 {
463 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x40000000, 0x00000000, 0x00000000);
464 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
465 });
466
467 // Ride Carpet
468 ApplySpellFix({ 45602 }, [](SpellInfo* spellInfo)
469 {
470 spellInfo->Effects[EFFECT_0].BasePoints = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)"
471 });
472
474 64745, // Item - Death Knight T8 Tank 4P Bonus
475 64936 // Item - Warrior T8 Protection 4P Bonus
476 }, [](SpellInfo* spellInfo)
477 {
478 spellInfo->Effects[EFFECT_0].BasePoints = 100; // 100% chance of procc'ing, not -10% (chance calculated in PrepareTriggersExecutedOnHit)
479 });
480
481 // Easter Lay Noblegarden Egg Aura
482 ApplySpellFix({ 61719 }, [](SpellInfo* spellInfo)
483 {
484 // Interrupt flags copied from aura which this aura is linked with
485 spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE;
486 });
487
488 // Bleh, need to change FamilyFlags :/ (have the same as original aura - bad!)
489 ApplySpellFix({ 63510 }, [](SpellInfo* spellInfo)
490 {
491 spellInfo->SpellFamilyFlags[EFFECT_0] = 0;
492 spellInfo->SpellFamilyFlags[EFFECT_2] = 0x4000000;
493 });
494
495 ApplySpellFix({ 63514 }, [](SpellInfo* spellInfo)
496 {
497 spellInfo->SpellFamilyFlags[EFFECT_0] = 0;
498 spellInfo->SpellFamilyFlags[EFFECT_2] = 0x2000000;
499 });
500
501 ApplySpellFix({ 63531 }, [](SpellInfo* spellInfo)
502 {
503 spellInfo->SpellFamilyFlags[EFFECT_0] = 0;
504 spellInfo->SpellFamilyFlags[EFFECT_2] = 0x8000000;
505 });
506
507 // And affecting spells
509 20138, // Improved Devotion Aura
510 20139,
511 20140
512 }, [](SpellInfo* spellInfo)
513 {
514 spellInfo->Effects[EFFECT_1].SpellClassMask[0] = 0;
515 spellInfo->Effects[EFFECT_1].SpellClassMask[2] = 0x2000000;
516 });
517
519 20254, // Improved concentration aura
520 20255,
521 20256
522 }, [](SpellInfo* spellInfo)
523 {
524 spellInfo->Effects[EFFECT_1].SpellClassMask[0] = 0;
525 spellInfo->Effects[EFFECT_1].SpellClassMask[2] = 0x4000000;
526 spellInfo->Effects[EFFECT_2].SpellClassMask[0] = 0;
527 spellInfo->Effects[EFFECT_2].SpellClassMask[2] = 0x4000000;
528 });
529
531 53379, // Swift Retribution
532 53484,
533 53648
534 }, [](SpellInfo* spellInfo)
535 {
536 spellInfo->Effects[EFFECT_0].SpellClassMask[0] = 0;
537 spellInfo->Effects[EFFECT_0].SpellClassMask[2] = 0x8000000;
538 });
539
540 // Sanctified Retribution
541 ApplySpellFix({ 31869 }, [](SpellInfo* spellInfo)
542 {
543 spellInfo->Effects[EFFECT_0].SpellClassMask[0] = 0;
544 spellInfo->Effects[EFFECT_0].SpellClassMask[2] = 0x8000000;
545 });
546
547 // Retribution Aura - damage shield hits cannot miss
549 7294, // Retribution Aura (Rank 1)
550 10298, // Retribution Aura (Rank 2)
551 10299, // Retribution Aura (Rank 3)
552 10300, // Retribution Aura (Rank 4)
553 10301, // Retribution Aura (Rank 5)
554 27150, // Retribution Aura (Rank 6)
555 54043, // Retribution Aura (Rank 7)
556 8990, // Retribution Aura (NPC)
557 13008 // Retribution Aura (NPC)
558 }, [](SpellInfo* spellInfo)
559 {
560 spellInfo->AttributesEx7 |= SPELL_ATTR7_NO_ATTACK_MISS;
561 });
562
563 // Seal of Light trigger
564 ApplySpellFix({ 20167 }, [](SpellInfo* spellInfo)
565 {
566 spellInfo->SpellLevel = 0;
567 spellInfo->BaseLevel = 0;
568 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
569 });
570
571 // Hand of Reckoning
572 ApplySpellFix({ 62124 }, [](SpellInfo* spellInfo)
573 {
574 spellInfo->AttributesEx |= SPELL_ATTR1_NO_REDIRECTION;
575 });
576
577 // Redemption
578 ApplySpellFix({ 7328, 10322, 10324, 20772, 20773, 48949, 48950 }, [](SpellInfo* spellInfo)
579 {
580 spellInfo->SpellFamilyName = SPELLFAMILY_PALADIN;
581 });
582
584 20184, // Judgement of Justice
585 20185, // Judgement of Light
586 20186, // Judgement of Wisdom
587 20267, // Judgement of Light (triggered heal on attacker)
588 20268, // Judgement of Wisdom (triggered mana on attacker)
589 68055 // Judgements of the Just
590 }, [](SpellInfo* spellInfo)
591 {
592 // hack for seal of light and few spells, judgement consists of few single casts and each of them can proc
593 // some spell, base one has disabled proc flag but those dont have this flag
594 // 20267/20268 are passive proc effects from the judgement debuff; they must not cause the paladin's
595 // on-heal/on-cast procs (e.g. Soul Preserver, which has CAN_PROC_FROM_PROCS) to fire
596 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
597 });
598
600 6940, // Hand of Sacrifice
601 64205 // Divine Sacrifice
602 }, [](SpellInfo* spellInfo)
603 {
604 spellInfo->AttributesEx7 |= SPELL_ATTR7_DONT_CAUSE_SPELL_PUSHBACK;
605 });
606
607 // Seal of Command trigger
608 ApplySpellFix({ 20424 }, [](SpellInfo* spellInfo)
609 {
610 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
611 });
612
613 // Vindication
614 ApplySpellFix({ 67, 26017}, [](SpellInfo* spellInfo)
615 {
616 spellInfo->Effects[EFFECT_0].MiscValue = 0;
617 });
618
619 // Arcane Missiles
620 ApplySpellFix({ 5143, 5144, 5145, 8416, 8417, 10211, 10212, 25345, 27075, 38699, 38704, 42843, 42846 }, [](SpellInfo* spellInfo)
621 {
622 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
623 });
624
625 // Glyph of Holy Light
626 ApplySpellFix({ 54968 }, [](SpellInfo* spellInfo)
627 {
628 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
629 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
630 });
631
632 // Beacon of Light
633 ApplySpellFix({ 53652, 53653, 53654 }, [](SpellInfo* spellInfo)
634 {
635 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
636 spellInfo->AttributesEx6 &= ~SPELL_ATTR6_IGNORE_HEALTH_MODIFIERS;
637 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
638 });
639
640 // Wild Hunt
641 ApplySpellFix({ 62758, 62762 }, [](SpellInfo* spellInfo)
642 {
643 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AURA;
644 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_DUMMY;
645 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
646 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_DUMMY;
647 });
648
649 // Intervene
650 ApplySpellFix({ 3411 }, [](SpellInfo* spellInfo)
651 {
652 spellInfo->Attributes |= SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT;
653 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
654 });
655
656 // Roar of Sacrifice
657 ApplySpellFix({ 53480 }, [](SpellInfo* spellInfo)
658 {
659 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
660 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_SPLIT_DAMAGE_PCT;
661 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY);
662 spellInfo->Effects[EFFECT_1].DieSides = 1;
663 spellInfo->Effects[EFFECT_1].BasePoints = 19;
664 spellInfo->Effects[EFFECT_1].BasePoints = 127; // all schools
665 });
666
667 // Silencing Shot
668 ApplySpellFix({ 34490, 41084, 42671 }, [](SpellInfo* spellInfo)
669 {
670 spellInfo->Speed = 0.0f;
671 });
672
673 // Monstrous Bite
674 ApplySpellFix({ 54680, 55495, 55496, 55497, 55498, 55499 }, [](SpellInfo* spellInfo)
675 {
676 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
677 });
678
679 // Hunter's Mark
680 ApplySpellFix({ 1130, 14323, 14324, 14325, 53338 }, [](SpellInfo* spellInfo)
681 {
682 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
683 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
684 });
685
686 // Explosive Trap Effect
688 13812, // Explosive Trap Effect (Rank 1)
689 14314, // Explosive Trap Effect (Rank 2)
690 14315, // Explosive Trap Effect (Rank 3)
691 27026, // Explosive Trap Effect (Rank 4)
692 49064, // Explosive Trap Effect (Rank 5)
693 49065 // Explosive Trap Effect (Rank 6)
694 }, [](SpellInfo* spellInfo)
695 {
696 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
697 });
698
699 // Kill Command
700 // Kill Command, Overpower
701 ApplySpellFix({ 34027, 37529 }, [](SpellInfo* spellInfo)
702 {
703 spellInfo->ProcCharges = 0;
704 });
705
706 // Kindred Spirits, damage aura
707 ApplySpellFix({ 57458 }, [](SpellInfo* spellInfo)
708 {
709 spellInfo->AttributesEx4 |= SPELL_ATTR4_ALLOW_ENETRING_ARENA;
710 });
711
712 // Chimera Shot - Serpent trigger
713 ApplySpellFix({ 53353 }, [](SpellInfo* spellInfo)
714 {
715 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
716 });
717
718 // Entrapment trigger
719 ApplySpellFix({ 19185, 64803, 64804 }, [](SpellInfo* spellInfo)
720 {
721 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_TARGET_ENEMY);
722 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_DEST_AREA_ENEMY);
723 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT;
724 });
725
726 // Improved Stings (Rank 2)
727 ApplySpellFix({ 19465 }, [](SpellInfo* spellInfo)
728 {
729 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
730 });
731
732 // Heart of the Phoenix (triggered)
733 ApplySpellFix({ 54114 }, [](SpellInfo* spellInfo)
734 {
735 spellInfo->AttributesEx &= ~SPELL_ATTR1_DISMISS_PET_FIRST;
736 spellInfo->RecoveryTime = 8 * 60 * IN_MILLISECONDS; // prev 600000
737 });
738
739 // Master of Subtlety
740 ApplySpellFix({ 31221, 31222, 31223 }, [](SpellInfo* spellInfo)
741 {
742 spellInfo->SpellFamilyName = SPELLFAMILY_ROGUE;
743 });
744
746 31666, // Master of Subtlety triggers
747 58428 // Overkill
748 }, [](SpellInfo* spellInfo)
749 {
750 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_SCRIPT_EFFECT;
751 });
752
754 5171, // Slice and Dice
755 6774 // Slice and Dice
756 }, [](SpellInfo* spellInfo)
757 {
758 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
759 });
760
761 // Envenom
762 ApplySpellFix({ 32645, 32684, 57992, 57993 }, [](SpellInfo* spellInfo)
763 {
764 spellInfo->Dispel = DISPEL_NONE;
765 });
766
768 64014, // Expedition Base Camp Teleport
769 64032, // Formation Grounds Teleport
770 64028, // Colossal Forge Teleport
771 64031, // Scrapyard Teleport
772 64030, // Antechamber Teleport
773 64029, // Shattered Walkway Teleport
774 64024, // Conservatory Teleport
775 64025, // Halls of Invention Teleport
776 65042 // Prison of Yogg-Saron Teleport
777 }, [](SpellInfo* spellInfo)
778 {
779 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_DEST_DB);
780 });
781
782 // Killing Spree (teleport)
783 ApplySpellFix({ 57840 }, [](SpellInfo* spellInfo)
784 {
785 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100 yards
786 });
787
788 // Killing Spree
789 ApplySpellFix({ 51690 }, [](SpellInfo* spellInfo)
790 {
791 spellInfo->AttributesEx |= SPELL_ATTR1_ALLOW_WHILE_STEALTHED;
792 });
793
794 // Blood Tap visual cd reset
795 ApplySpellFix({ 47804 }, [](SpellInfo* spellInfo)
796 {
797 spellInfo->Effects[EFFECT_2].Effect = 0;
798 spellInfo->Effects[EFFECT_1].Effect = 0;
799 spellInfo->RuneCostID = 442;
800 });
801
802 // Chains of Ice
803 ApplySpellFix({ 45524 }, [](SpellInfo* spellInfo)
804 {
805 spellInfo->Effects[EFFECT_2].Effect = 0;
806 });
807
808 // Impurity
809 ApplySpellFix({ 49220, 49633, 49635, 49636, 49638 }, [](SpellInfo* spellInfo)
810 {
811 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AURA;
812 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_DUMMY;
813 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
814 spellInfo->SpellFamilyName = SPELLFAMILY_DEATHKNIGHT;
815 });
816
817 // Deadly Aggression (Deadly Gladiator's Death Knight Relic, item: 42620)
818 ApplySpellFix({ 60549 }, [](SpellInfo* spellInfo)
819 {
820 spellInfo->Effects[EFFECT_1].Effect = 0;
821 });
822
823 // Magic Suppression
824 ApplySpellFix({ 49224, 49610, 49611 }, [](SpellInfo* spellInfo)
825 {
826 spellInfo->ProcCharges = 0;
827 });
828
829 // Wandering Plague
830 ApplySpellFix({ 50526 }, [](SpellInfo* spellInfo)
831 {
832 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
833 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
834 });
835
836 // Dancing Rune Weapon
837 ApplySpellFix({ 49028 }, [](SpellInfo* spellInfo)
838 {
839 spellInfo->Effects[EFFECT_2].Effect = 0;
840 spellInfo->ProcFlags |= PROC_FLAG_DONE_MELEE_AUTO_ATTACK;
841 });
842
843 // Death and Decay
844 ApplySpellFix({ 52212 }, [](SpellInfo* spellInfo)
845 {
846 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
847 spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_PHASE_SHIFT;
848 });
849
850 // T9 blood plague crit bonus
851 ApplySpellFix({ 67118 }, [](SpellInfo* spellInfo)
852 {
853 spellInfo->Effects[EFFECT_1].Effect = 0;
854 });
855
856 // Pestilence
857 ApplySpellFix({ 50842 }, [](SpellInfo* spellInfo)
858 {
859 spellInfo->Effects[EFFECT_2].TargetA = TARGET_DEST_TARGET_ENEMY;
860 });
861
862 // Horn of Winter, stacking issues
863 ApplySpellFix({ 57330, 57623 }, [](SpellInfo* spellInfo)
864 {
865 spellInfo->Effects[EFFECT_1].TargetA = 0;
866 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
867 });
868
869 // Scourge Strike trigger
870 ApplySpellFix({ 70890 }, [](SpellInfo* spellInfo)
871 {
872 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
873 });
874
875 // Blood-caked Blade - Blood-caked Strike trigger
876 ApplySpellFix({ 50463 }, [](SpellInfo* spellInfo)
877 {
878 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
879 });
880
881 // Blood Gorged
882 ApplySpellFix({ 61274, 61275, 61276, 61277,61278 }, [](SpellInfo* spellInfo)
883 {
884 // ARP affect Death Strike and Rune Strike
885 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x1400011, 0x20000000, 0x0);
886 });
887
888 // Death Grip
889 ApplySpellFix({ 49576, 49560 }, [](SpellInfo* spellInfo)
890 {
891 // remove main grip mechanic, leave only effect one
892 // should fix taunt on bosses and not break the pull protection at the same time (no aura provides immunity to grip mechanic)
893 spellInfo->Mechanic = 0;
894 });
895
896 // Death Grip Jump Dest
897 ApplySpellFix({ 57604 }, [](SpellInfo* spellInfo)
898 {
899 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
900 });
901
902 // Death Pact
903 ApplySpellFix({ 48743 }, [](SpellInfo* spellInfo)
904 {
905 spellInfo->AttributesEx &= ~SPELL_ATTR1_EXCLUDE_CASTER;
906 });
907
908 // Raise Ally (trigger)
909 ApplySpellFix({ 46619 }, [](SpellInfo* spellInfo)
910 {
911 spellInfo->Attributes &= ~SPELL_ATTR0_NO_AURA_CANCEL;
912 });
913
914 // Frost Strike
915 ApplySpellFix({ 49143, 51416, 51417, 51418, 51419, 55268 }, [](SpellInfo* spellInfo)
916 {
917 spellInfo->AttributesEx3 |= SPELL_ATTR3_COMPLETELY_BLOCKED;
918 });
919
920 // Death Knight T10 Tank 2p Bonus
921 ApplySpellFix({ 70650 }, [](SpellInfo* spellInfo)
922 {
923 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_PCT_MODIFIER;
924 });
925
926 ApplySpellFix({ 45297, 45284 }, [](SpellInfo* spellInfo)
927 {
928 spellInfo->CategoryRecoveryTime = 0;
929 spellInfo->RecoveryTime = 0;
930 spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_CASTER_DAMAGE_MODIFIERS;
931 });
932
933 // Improved Earth Shield
934 ApplySpellFix({ 51560, 51561 }, [](SpellInfo* spellInfo)
935 {
936 spellInfo->Effects[EFFECT_1].MiscValue = SPELLMOD_DAMAGE;
937 });
938
939 // Tidal Force
940 ApplySpellFix({ 55166, 55198 }, [](SpellInfo* spellInfo)
941 {
942 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(18);
943 spellInfo->ProcCharges = 0;
944 });
945
946 // Healing Stream Totem
947 ApplySpellFix({ 52042 }, [](SpellInfo* spellInfo)
948 {
949 spellInfo->SpellLevel = 0;
950 spellInfo->BaseLevel = 0;
951 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
952 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(5); // 40yd
953 });
954
955 // Earth Shield
956 ApplySpellFix({ 379 }, [](SpellInfo* spellInfo)
957 {
958 spellInfo->SpellLevel = 0;
959 spellInfo->BaseLevel = 0;
960 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
961 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
962 });
963
964 // Stormstrike
965 ApplySpellFix({ 17364 }, [](SpellInfo* spellInfo)
966 {
967 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
968 });
969
970 // Strength of Earth totem effect
971 ApplySpellFix({ 8076, 8162, 8163, 10441, 25362, 25527, 57621, 58646 }, [](SpellInfo* spellInfo)
972 {
973 spellInfo->Effects[EFFECT_1].RadiusEntry = spellInfo->Effects[EFFECT_0].RadiusEntry;
974 spellInfo->Effects[EFFECT_2].RadiusEntry = spellInfo->Effects[EFFECT_0].RadiusEntry;
975 });
976
977 // Flametongue Totem effect
978 ApplySpellFix({ 52109, 52110, 52111, 52112, 52113, 58651, 58654, 58655 }, [](SpellInfo* spellInfo)
979 {
980 spellInfo->Effects[EFFECT_2].TargetB = spellInfo->Effects[EFFECT_1].TargetB = spellInfo->Effects[EFFECT_0].TargetB = 0;
981 spellInfo->Effects[EFFECT_2].TargetA = spellInfo->Effects[EFFECT_1].TargetA = spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
982 });
983
984 // Sentry Totem
985 ApplySpellFix({ 6495 }, [](SpellInfo* spellInfo)
986 {
987 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(0);
988 });
989
990 // Bind Sight (PT)
991 ApplySpellFix({ 6277 }, [](SpellInfo* spellInfo)
992 {
993 // because it is passive, needs this to be properly removed at death in RemoveAllAurasOnDeath()
994 spellInfo->AttributesEx &= ~SPELL_ATTR1_IS_CHANNELED;
995 spellInfo->Attributes |= SPELL_ATTR0_PASSIVE;
996 spellInfo->AttributesEx7 |= SPELL_ATTR7_DISABLE_AURA_WHILE_DEAD;
997 });
998
999 // Ancestral Awakening Heal
1000 ApplySpellFix({ 52752 }, [](SpellInfo* spellInfo)
1001 {
1002 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
1003 });
1004
1005 // Heroism
1006 ApplySpellFix({ 32182 }, [](SpellInfo* spellInfo)
1007 {
1008 spellInfo->ExcludeTargetAuraSpell = 57723; // Exhaustion
1009 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
1010 });
1011
1012 // Bloodlust
1013 ApplySpellFix({ 2825 }, [](SpellInfo* spellInfo)
1014 {
1015 spellInfo->ExcludeTargetAuraSpell = 57724; // Sated
1016 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
1017 });
1018
1019 // Improved Succubus
1020 ApplySpellFix({ 18754, 18755, 18756 }, [](SpellInfo* spellInfo)
1021 {
1022 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
1023 });
1024
1025 // Unstable Affliction
1026 ApplySpellFix({ 31117 }, [](SpellInfo* spellInfo)
1027 {
1028 spellInfo->PreventionType = SPELL_PREVENTION_TYPE_NONE;
1029 });
1030
1031 // Shadowflame - trigger
1033 47960, // r1
1034 61291 // r2
1035 }, [](SpellInfo* spellInfo)
1036 {
1037 spellInfo->AttributesEx |= SPELL_ATTR1_NO_REDIRECTION;
1038 });
1039
1040 // Curse of Doom
1041 ApplySpellFix({ 18662 }, [](SpellInfo* spellInfo)
1042 {
1043 // summoned doomguard duration fix
1044 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(6);
1045 });
1046
1047 // Everlasting Affliction
1048 ApplySpellFix({ 47201, 47202, 47203, 47204, 47205 }, [](SpellInfo* spellInfo)
1049 {
1050 spellInfo->Effects[EFFECT_1].SpellClassMask[0] |= 2; // add corruption to affected spells
1051 });
1052
1053 // Death's Embrace
1054 ApplySpellFix({ 47198, 47199, 47200 }, [](SpellInfo* spellInfo)
1055 {
1056 spellInfo->Effects[EFFECT_1].SpellClassMask[0] |= 0x4000; // include Drain Soul
1057 });
1058
1059 // Improved Demonic Tactics
1060 ApplySpellFix({ 54347, 54348, 54349 }, [](SpellInfo* spellInfo)
1061 {
1062 spellInfo->Effects[EFFECT_1].Effect = spellInfo->Effects[EFFECT_0].Effect;
1063 spellInfo->Effects[EFFECT_1].ApplyAuraName = spellInfo->Effects[EFFECT_0].ApplyAuraName;
1064 spellInfo->Effects[EFFECT_1].TargetA = spellInfo->Effects[EFFECT_0].TargetA;
1065 spellInfo->Effects[EFFECT_0].MiscValue = SPELLMOD_EFFECT1;
1066 spellInfo->Effects[EFFECT_1].MiscValue = SPELLMOD_EFFECT2;
1067 });
1068
1069 // Rain of Fire (Doomguard)
1070 ApplySpellFix({ 42227 }, [](SpellInfo* spellInfo)
1071 {
1072 spellInfo->Speed = 0.0f;
1073 });
1074
1075 // Ritual Enslavement
1076 ApplySpellFix({ 22987 }, [](SpellInfo* spellInfo)
1077 {
1078 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_MOD_CHARM;
1079 });
1080
1081 // Combustion, make this passive
1082 ApplySpellFix({ 11129 }, [](SpellInfo* spellInfo)
1083 {
1084 spellInfo->Dispel = DISPEL_NONE;
1085 });
1086
1087 // Magic Absorption
1088 ApplySpellFix({ 29441, 29444 }, [](SpellInfo* spellInfo)
1089 {
1090 spellInfo->SpellLevel = 0;
1091 });
1092
1093 // Living Bomb
1094 ApplySpellFix({ 44461, 55361, 55362 }, [](SpellInfo* spellInfo)
1095 {
1096 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
1097 spellInfo->AttributesEx4 |= SPELL_ATTR4_DAMAGE_DOESNT_BREAK_AURAS;
1098 // Explosion is AoE triggered on aura expiry - cannot be reflected (retail: Spell Reflection only works on single-target spells)
1099 spellInfo->AttributesEx |= SPELL_ATTR1_NO_REFLECTION;
1100 });
1101
1102 // Evocation
1103 ApplySpellFix({ 12051 }, [](SpellInfo* spellInfo)
1104 {
1105 spellInfo->InterruptFlags |= SPELL_INTERRUPT_FLAG_INTERRUPT;
1106 });
1107
1108 // MI Fireblast, WE Frostbolt, MI Frostbolt
1109 ApplySpellFix({ 59637, 31707, 72898 }, [](SpellInfo* spellInfo)
1110 {
1111 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
1112 });
1113
1114 // Blazing Speed
1115 ApplySpellFix({ 31641, 31642 }, [](SpellInfo* spellInfo)
1116 {
1117 spellInfo->Effects[EFFECT_0].TriggerSpell = 31643;
1118 });
1119
1120 // Summon Water Elemental (permanent)
1121 ApplySpellFix({ 70908 }, [](SpellInfo* spellInfo)
1122 {
1123 // treat it as pet
1124 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_SUMMON_PET;
1125 });
1126
1127 // // Burnout, trigger
1128 ApplySpellFix({ 44450 }, [](SpellInfo* spellInfo)
1129 {
1130 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_POWER_BURN;
1131 });
1132
1133 // Mirror Image - Summon Spells
1134 ApplySpellFix({ 58831, 58833, 58834, 65047 }, [](SpellInfo* spellInfo)
1135 {
1136 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER);
1137 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(0);
1138 });
1139
1140 // Initialize Images (Mirror Image)
1141 ApplySpellFix({ 58836 }, [](SpellInfo* spellInfo)
1142 {
1143 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
1144 });
1145
1146 // Arcane Blast, can't be dispelled
1147 ApplySpellFix({ 36032 }, [](SpellInfo* spellInfo)
1148 {
1149 spellInfo->Attributes |= SPELL_ATTR0_NO_IMMUNITIES;
1150 });
1151
1152 // Chilled (frost armor, ice armor proc)
1153 ApplySpellFix({ 6136, 7321 }, [](SpellInfo* spellInfo)
1154 {
1155 spellInfo->PreventionType = SPELL_PREVENTION_TYPE_NONE;
1156 });
1157
1158 // Mirror Image Frostbolt
1159 ApplySpellFix({ 59638 }, [](SpellInfo* spellInfo)
1160 {
1161 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
1162 spellInfo->SpellFamilyName = SPELLFAMILY_MAGE;
1163 spellInfo->SpellFamilyFlags = flag96(0x20, 0x0, 0x0);
1164 });
1165
1166 // Fingers of Frost
1167 ApplySpellFix({ 44544 }, [](SpellInfo* spellInfo)
1168 {
1169 spellInfo->Dispel = DISPEL_NONE;
1170 spellInfo->AttributesEx4 |= SPELL_ATTR4_CANNOT_BE_STOLEN;
1171 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(685904631, 1151040, 32);
1172 });
1173
1174 // Fingers of Frost visual buff
1175 ApplySpellFix({ 74396 }, [](SpellInfo* spellInfo)
1176 {
1177 spellInfo->ProcCharges = 2;
1178 spellInfo->StackAmount = 0;
1179 });
1180
1181 // Glyph of blocking
1182 ApplySpellFix({ 58375 }, [](SpellInfo* spellInfo)
1183 {
1184 spellInfo->Effects[EFFECT_0].TriggerSpell = 58374;
1185 });
1186
1187 // Sweeping Strikes stance change
1188 ApplySpellFix({ 12328 }, [](SpellInfo* spellInfo)
1189 {
1190 spellInfo->Attributes |= SPELL_ATTR0_NOT_SHAPESHIFTED;
1191 });
1192
1193 // Damage Shield
1194 ApplySpellFix({ 59653 }, [](SpellInfo* spellInfo)
1195 {
1196 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
1197 spellInfo->SpellLevel = 0;
1198 });
1199
1201 20230, // Retaliation
1202 871, // Shield Wall
1203 1719 // Recklessness
1204 }, [](SpellInfo* spellInfo)
1205 {
1206 // Strange shared cooldown
1207 spellInfo->AttributesEx6 |= SPELL_ATTR6_NO_CATEGORY_COOLDOWN_MODS;
1208 });
1209
1210 // Vigilance
1211 ApplySpellFix({ 50720 }, [](SpellInfo* spellInfo)
1212 {
1213 // fixes bug with empowered renew, single target aura
1214 spellInfo->SpellFamilyName = SPELLFAMILY_WARRIOR;
1215 });
1216
1217 // Sunder Armor - Old Ranks
1218 ApplySpellFix({ 7405, 8380, 11596, 11597, 25225, 47467 }, [](SpellInfo* spellInfo)
1219 {
1220 spellInfo->Effects[EFFECT_0].TriggerSpell = 11971;
1221 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE;
1222 });
1223
1224 // Improved Spell Reflection
1225 ApplySpellFix({ 59725 }, [](SpellInfo* spellInfo)
1226 {
1227 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER_AREA_PARTY);
1228 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
1229 });
1230
1231 // Hymn of Hope
1232 ApplySpellFix({ 64904 }, [](SpellInfo* spellInfo)
1233 {
1234 // rewrite part of aura system or swap effects...
1235 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT;
1236 spellInfo->Effects[EFFECT_2].Effect = spellInfo->Effects[EFFECT_0].Effect;
1237 spellInfo->Effects[EFFECT_0].Effect = 0;
1238 spellInfo->Effects[EFFECT_2].DieSides = spellInfo->Effects[EFFECT_0].DieSides;
1239 spellInfo->Effects[EFFECT_2].TargetA = spellInfo->Effects[EFFECT_0].TargetB;
1240 spellInfo->Effects[EFFECT_2].RadiusEntry = spellInfo->Effects[EFFECT_0].RadiusEntry;
1241 spellInfo->Effects[EFFECT_2].BasePoints = spellInfo->Effects[EFFECT_0].BasePoints;
1242 });
1243
1244 // Divine Hymn
1245 ApplySpellFix({ 64844 }, [](SpellInfo* spellInfo)
1246 {
1247 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
1248 spellInfo->SpellLevel = 0;
1249 });
1250
1252 14898, // Spiritual Healing affects prayer of mending
1253 15349,
1254 15354,
1255 15355,
1256 15356,
1257 47562, // Divine Providence affects prayer of mending
1258 47564,
1259 47565,
1260 47566,
1261 47567,
1262 47586, // Twin Disciplines affects prayer of mending
1263 47587,
1264 47588,
1265 52802,
1266 52803
1267 }, [](SpellInfo* spellInfo)
1268 {
1269 spellInfo->Effects[EFFECT_0].SpellClassMask[1] |= 0x20; // prayer of mending
1270 });
1271
1272 // Lifebloom final bloom
1273 ApplySpellFix({ 33778 }, [](SpellInfo* spellInfo)
1274 {
1275 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
1276 spellInfo->SpellLevel = 0;
1277 spellInfo->SpellFamilyFlags = flag96(0, 0x10, 0);
1278 });
1279
1280 // Owlkin Frenzy
1281 ApplySpellFix({ 48391 }, [](SpellInfo* spellInfo)
1282 {
1283 spellInfo->Attributes |= SPELL_ATTR0_NOT_SHAPESHIFTED;
1284 });
1285
1286 // Item T10 Restoration 4P Bonus
1287 ApplySpellFix({ 70691 }, [](SpellInfo* spellInfo)
1288 {
1289 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
1290 });
1291
1293 770, // Faerie Fire
1294 16857 // Faerie Fire (Feral)
1295 }, [](SpellInfo* spellInfo)
1296 {
1297 spellInfo->AttributesEx &= ~SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS;
1298 });
1299
1300 ApplySpellFix({ 49376 }, [](SpellInfo* spellInfo)
1301 {
1302 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // 3yd
1303 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
1304 });
1305
1306 // Feral Charge - Cat
1307 ApplySpellFix({ 61138, 61132, 50259 }, [](SpellInfo* spellInfo)
1308 {
1309 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
1310 });
1311
1312 // Glyph of Barkskin
1313 ApplySpellFix({ 63058 }, [](SpellInfo* spellInfo)
1314 {
1315 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE;
1316 });
1317
1318 // Resurrection Sickness
1319 ApplySpellFix({ 15007 }, [](SpellInfo* spellInfo)
1320 {
1321 spellInfo->SpellFamilyName = SPELLFAMILY_GENERIC;
1322 });
1323
1324 // Luck of the Draw
1325 ApplySpellFix({ 72221 }, [](SpellInfo* spellInfo)
1326 {
1327 spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CHANGE_MAP;
1328 });
1329
1330 // Bind
1331 ApplySpellFix({ 3286 }, [](SpellInfo* spellInfo)
1332 {
1333 spellInfo->Targets = 0; // neutral innkeepers not friendly?
1334 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
1335 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
1336 });
1337
1338 // Playback Speech
1339 ApplySpellFix({ 74209 }, [](SpellInfo* spellInfo)
1340 {
1341 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(1);
1342 });
1343
1345 2641, // Dismiss Pet
1346 23356 // Taming Lesson
1347 }, [](SpellInfo* spellInfo)
1348 {
1349 // remove creaturetargettype
1350 spellInfo->TargetCreatureType = 0;
1351 });
1352
1353 // Aspect of the Viper
1354 ApplySpellFix({ 34074 }, [](SpellInfo* spellInfo)
1355 {
1356 spellInfo->Effects[EFFECT_2].Effect = SPELL_EFFECT_APPLY_AURA;
1357 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(1);
1358 spellInfo->Effects[EFFECT_2].ApplyAuraName = SPELL_AURA_DUMMY;
1359 });
1360
1361 // Strength of Wrynn
1362 ApplySpellFix({ 60509 }, [](SpellInfo* spellInfo)
1363 {
1364 spellInfo->Effects[EFFECT_2].BasePoints = 1500;
1365 spellInfo->Effects[EFFECT_1].BasePoints = 150;
1366 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_PERIODIC_HEAL;
1367 });
1368
1369 // Winterfin First Responder
1370 ApplySpellFix({ 48739 }, [](SpellInfo* spellInfo)
1371 {
1372 spellInfo->Effects[EFFECT_0].BasePoints = 1;
1373 spellInfo->Effects[EFFECT_0].RealPointsPerLevel = 0;
1374 spellInfo->Effects[EFFECT_0].DieSides = 0;
1375 spellInfo->Effects[EFFECT_0].DamageMultiplier = 0;
1376 spellInfo->Effects[EFFECT_0].BonusMultiplier = 0;
1377 });
1378
1379 // Army of the Dead (trigger npc aura)
1380 ApplySpellFix({ 49099 }, [](SpellInfo* spellInfo)
1381 {
1382 spellInfo->Effects[EFFECT_0].Amplitude = 15000;
1383 });
1384
1385 // Frightening Shout
1386 ApplySpellFix({ 19134 }, [](SpellInfo* spellInfo)
1387 {
1388 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_DUMMY;
1389 });
1390
1391 // Isle of Conquest
1392 ApplySpellFix({ 66551 }, [](SpellInfo* spellInfo)
1393 {
1394 // Teleport in, missing range
1395 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd
1396 });
1397
1399 57607, // WintergraspCatapult - Spell Plague Barrel - EffectRadiusIndex
1400 57619, // WintergraspDemolisher - Spell Hourl Boulder - EffectRadiusIndex
1401 57610 // Cannon (Siege Turret)
1402 }, [](SpellInfo* spellInfo)
1403 {
1404 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_25_YARDS); // SPELL_EFFECT_WMO_DAMAGE
1405 });
1406
1407 // WintergraspCannon - Spell Fire Cannon - EffectRadiusIndex
1408 ApplySpellFix({ 51422 }, [](SpellInfo* spellInfo)
1409 {
1410 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // SPELL_EFFECT_SCHOOL_DAMAGE
1411 });
1412
1413 // WintergraspDemolisher - Spell Ram - EffectRadiusIndex
1414 ApplySpellFix({ 54107 }, [](SpellInfo* spellInfo)
1415 {
1416 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // SPELL_EFFECT_KNOCK_BACK
1417 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // SPELL_EFFECT_SCHOOL_DAMAGE
1418 spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // SPELL_EFFECT_WEAPON_DAMAGE
1419 });
1420
1421 // WintergraspSiegeEngine - Spell Ram - EffectRadiusIndex
1422 ApplySpellFix({ 51678 }, [](SpellInfo* spellInfo)
1423 {
1424 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // SPELL_EFFECT_KNOCK_BACK
1425 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // SPELL_EFFECT_SCHOOL_DAMAGE
1426 spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS); // SPELL_EFFECT_WEAPON_DAMAGE
1427 });
1428
1429 // WintergraspCatapult - Spell Plague Barrell - Range
1430 ApplySpellFix({ 57606 }, [](SpellInfo* spellInfo)
1431 {
1432 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(164); // "Catapult Range"
1433 });
1434
1435 // Boulder (Demolisher)
1436 ApplySpellFix({ 50999 }, [](SpellInfo* spellInfo)
1437 {
1438 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd
1439 });
1440
1441 // Flame Breath (Catapult)
1442 ApplySpellFix({ 50990 }, [](SpellInfo* spellInfo)
1443 {
1444 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_18_YARDS); // 18yd
1445 });
1446
1447 // Jormungar Bite
1448 ApplySpellFix({ 56103 }, [](SpellInfo* spellInfo)
1449 {
1450 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
1451 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1452 });
1453
1454 // Throw Proximity Bomb
1455 ApplySpellFix({ 34095 }, [](SpellInfo* spellInfo)
1456 {
1457 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_TARGET_ENEMY);
1458 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1459 });
1460
1462 53348, // DEATH KNIGHT SCARLET FIRE ARROW
1463 53117 // BALISTA
1464 }, [](SpellInfo* spellInfo)
1465 {
1466 spellInfo->RecoveryTime = 5000;
1467 spellInfo->CategoryRecoveryTime = 5000;
1468 });
1469
1470 // Teleport To Molten Core
1471 ApplySpellFix({ 25139 }, [](SpellInfo* spellInfo)
1472 {
1473 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD;
1474 });
1475
1476 // Landen Stilwell Transform
1477 ApplySpellFix({ 31310 }, [](SpellInfo* spellInfo)
1478 {
1479 spellInfo->Attributes |= SPELL_ATTR0_PASSIVE;
1480 });
1481
1482 // Shadowstalker Stealth
1483 ApplySpellFix({ 5916 }, [](SpellInfo* spellInfo)
1484 {
1485 spellInfo->Effects[EFFECT_0].RealPointsPerLevel = 5.0f;
1486 });
1487
1488 // Sneak
1489 ApplySpellFix({ 22766 }, [](SpellInfo* spellInfo)
1490 {
1491 spellInfo->Effects[EFFECT_0].RealPointsPerLevel = 5.0f;
1492 });
1493
1494 // Murmur's Touch
1495 ApplySpellFix({ 38794, 33711 }, [](SpellInfo* spellInfo)
1496 {
1497 spellInfo->MaxAffectedTargets = 1;
1498 spellInfo->Effects[EFFECT_0].TriggerSpell = 33760;
1499 });
1500
1501 // Negaton Field
1503 36729, // Normal
1504 38834 // Heroic
1505 }, [](SpellInfo* spellInfo)
1506 {
1507 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
1508 });
1509
1510 // Curse of the Doomsayer NORMAL
1511 ApplySpellFix({ 36173 }, [](SpellInfo* spellInfo)
1512 {
1513 spellInfo->Effects[EFFECT_0].TriggerSpell = 36174; // Currently triggers heroic version...
1514 });
1515
1516 // Crystal Channel
1517 ApplySpellFix({ 34156 }, [](SpellInfo* spellInfo)
1518 {
1519 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(35); // 35yd;
1520 spellInfo->ChannelInterruptFlags |= AURA_INTERRUPT_FLAG_MOVE;
1521 });
1522
1523 // Debris - Debris Visual
1524 ApplySpellFix({ 36449, 30632 }, [](SpellInfo* spellInfo)
1525 {
1526 spellInfo->Attributes |= SPELL_ATTR0_AURA_IS_DEBUFF;
1527 });
1528
1529 // Soul Channel
1530 ApplySpellFix({ 30531 }, [](SpellInfo* spellInfo)
1531 {
1532 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
1533 });
1534
1535 // Activate Sunblade Protector
1536 ApplySpellFix({ 46475, 46476 }, [](SpellInfo* spellInfo)
1537 {
1538 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(14); // 60yd
1539 });
1540
1541 // Break Ice
1542 ApplySpellFix({ 46638 }, [](SpellInfo* spellInfo)
1543 {
1544 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_ONLY_ON_PLAYER; // Obvious fail, it targets gameobject...
1545 });
1546
1547 // Sinister Reflection Clone
1548 ApplySpellFix({ 45785 }, [](SpellInfo* spellInfo)
1549 {
1550 spellInfo->Speed = 0.0f;
1551 });
1552
1553 // Armageddon
1554 ApplySpellFix({ 45909 }, [](SpellInfo* spellInfo)
1555 {
1556 spellInfo->Speed = 8.0f;
1557 });
1558
1559 // Shadowmoon Reaver - Spell Absorption
1560 ApplySpellFix({ 41034 }, [](SpellInfo* spellInfo)
1561 {
1562 spellInfo->Effects[EFFECT_2].Effect = SPELL_EFFECT_APPLY_AURA;
1563 spellInfo->Effects[EFFECT_2].ApplyAuraName = SPELL_AURA_SCHOOL_ABSORB;
1564 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
1565 spellInfo->Effects[EFFECT_2].MiscValue = SPELL_SCHOOL_MASK_MAGIC;
1566 });
1567
1568 // Priestess of Delight and Priestess of Torment - Shared Bonds
1569 ApplySpellFix({ 41363 }, [](SpellInfo* spellInfo)
1570 {
1571 spellInfo->AttributesEx &= ~SPELL_ATTR1_IS_CHANNELED;
1572 });
1573
1574 // Illidari Council - Veras Darkshadow
1576 41485, // Deadly Poison
1577 41487 // Envenom
1578 }, [](SpellInfo* spellInfo)
1579 {
1580 spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_PHASE_SHIFT;
1581 });
1582
1583 // Illidan Stormrage - Parasitic Shadowfiend
1584 ApplySpellFix({ 41914 }, [](SpellInfo* spellInfo)
1585 {
1586 spellInfo->Attributes |= SPELL_ATTR0_AURA_IS_DEBUFF;
1587 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
1588 });
1589
1590 // Illidan Stormrage - Demon Fire
1591 ApplySpellFix({ 40030 }, [](SpellInfo* spellInfo)
1592 {
1593 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
1594 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_NO_CAST_LOG;
1595 });
1596
1597 // Illidan Stormrage - Teleport Maiev
1598 ApplySpellFix({ 41221 }, [](SpellInfo* spellInfo)
1599 {
1600 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 0-50000yd
1601 });
1602
1603 // Morogrim Tidewalker - Watery Grave Explosion
1604 ApplySpellFix({ 37852 }, [](SpellInfo* spellInfo)
1605 {
1606 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALLOW_WHILE_STUNNED;
1607 });
1608
1609 // Prince Malchezaar - Amplify Damage
1610 ApplySpellFix({ 39095 }, [](SpellInfo* spellInfo)
1611 {
1612 spellInfo->MaxAffectedTargets = 1;
1613 });
1614
1615 // Energy Feedback
1616 ApplySpellFix({ 44335 }, [](SpellInfo* spellInfo)
1617 {
1618 spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CHANGE_MAP;
1619 spellInfo->AttributesCu |= SPELL_ATTR0_CU_SINGLE_AURA_STACK;
1620 });
1621
1622 // Archimonde
1624 31984, // Finger of Death
1625 35354 // Hand of Death
1626 }, [](SpellInfo* spellInfo)
1627 {
1628 // Spell doesn't need to ignore invulnerabilities
1629 spellInfo->Attributes = SPELL_ATTR0_IS_ABILITY;
1630 });
1631
1632 // Archimonde - Finger of Death
1633 ApplySpellFix({ 32111 }, [](SpellInfo* spellInfo)
1634 {
1635 spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(0); // We only need the animation, no damage
1636 });
1637
1638 // Archimonde - Doomfire
1639 ApplySpellFix({ 31944, 31969 }, [](SpellInfo* spellInfo)
1640 {
1641 spellInfo->AttributesEx4 |= SPELL_ATTR4_NO_CAST_LOG;
1642 });
1643
1644 // Flame Breath, catapult spell
1645 ApplySpellFix({ 50989 }, [](SpellInfo* spellInfo)
1646 {
1647 spellInfo->Attributes &= ~SPELL_ATTR0_SCALES_WITH_CREATURE_LEVEL;
1648 });
1649
1650 // Koralon, Flaming Cinder
1651 ApplySpellFix({ 66690 }, [](SpellInfo* spellInfo)
1652 {
1653 // missing radius index
1654 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
1655 spellInfo->MaxAffectedTargets = 1;
1656 });
1657
1658 // Acid Volley
1659 ApplySpellFix({ 54714, 29325 }, [](SpellInfo* spellInfo)
1660 {
1661 spellInfo->MaxAffectedTargets = 1;
1662 });
1663
1664 // Summon Plagued Warrior
1665 ApplySpellFix({ 29237 }, [](SpellInfo* spellInfo)
1666 {
1667 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_DUMMY;
1668 spellInfo->Effects[EFFECT_1].Effect = spellInfo->Effects[EFFECT_2].Effect = 0;
1669 });
1670
1671 // Icebolt
1672 ApplySpellFix({ 28526 }, [](SpellInfo* spellInfo)
1673 {
1674 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
1675 });
1676
1677 // Infected Wound
1678 ApplySpellFix({ 29306 }, [](SpellInfo* spellInfo)
1679 {
1680 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
1681 });
1682
1683 // Hopeless
1684 ApplySpellFix({ 29125 }, [](SpellInfo* spellInfo)
1685 {
1686 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
1687 });
1688
1689 // Jagged Knife
1690 ApplySpellFix({ 55550 }, [](SpellInfo* spellInfo)
1691 {
1692 spellInfo->Attributes |= SPELL_ATTR0_USES_RANGED_SLOT;
1693 });
1694
1695 // Moorabi - Transformation
1696 ApplySpellFix({ 55098 }, [](SpellInfo* spellInfo)
1697 {
1698 spellInfo->InterruptFlags |= SPELL_INTERRUPT_FLAG_INTERRUPT;
1699 });
1700
1702 55521, // Poisoned Spear (Normal)
1703 58967, // Poisoned Spear (Heroic)
1704 55348, // Throw (Normal)
1705 58966 // Throw (Heroic)
1706 }, [](SpellInfo* spellInfo)
1707 {
1708 spellInfo->Attributes |= SPELL_ATTR0_USES_RANGED_SLOT;
1709 });
1710
1711 // Charged Chaotic rift aura, trigger
1712 ApplySpellFix({ 47737 }, [](SpellInfo* spellInfo)
1713 {
1714 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(37); // 50yd
1715 });
1716
1717 // Vanish
1718 ApplySpellFix({ 55964 }, [](SpellInfo* spellInfo)
1719 {
1720 spellInfo->Effects[EFFECT_1].Effect = 0;
1721 spellInfo->Effects[EFFECT_2].Effect = 0;
1722 });
1723
1724 // Trollgore - Summon Drakkari Invader
1725 ApplySpellFix({ 49456, 49457, 49458 }, [](SpellInfo* spellInfo)
1726 {
1727 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB);
1728 });
1729
1731 48278, // Paralyse
1732 47669 // Awaken subboss
1733 }, [](SpellInfo* spellInfo)
1734 {
1735 spellInfo->Effects[0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
1736 spellInfo->Effects[0].TargetB = SpellImplicitTargetInfo();
1737 });
1738
1739 // Skarvald, Charge
1740 ApplySpellFix({ 43651 }, [](SpellInfo* spellInfo)
1741 {
1742 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 0-50000yd
1743 });
1744
1745 // Ingvar the Plunderer, Woe Strike
1746 ApplySpellFix({ 42730 }, [](SpellInfo* spellInfo)
1747 {
1748 spellInfo->Effects[EFFECT_1].TriggerSpell = 42739;
1749 });
1750
1751 ApplySpellFix({ 59735 }, [](SpellInfo* spellInfo)
1752 {
1753 spellInfo->Effects[EFFECT_1].TriggerSpell = 59736;
1754 });
1755
1756 // Ingvar the Plunderer, Ingvar transform
1757 ApplySpellFix({ 42796 }, [](SpellInfo* spellInfo)
1758 {
1759 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD;
1760 });
1761
1763 42772, // Hurl Dagger (Normal)
1764 59685 // Hurl Dagger (Heroic)
1765 }, [](SpellInfo* spellInfo)
1766 {
1767 spellInfo->Attributes |= SPELL_ATTR0_USES_RANGED_SLOT;
1768 });
1769
1770 // Control Crystal Activation
1771 ApplySpellFix({ 57804 }, [](SpellInfo* spellInfo)
1772 {
1773 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(1);
1774 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1775 });
1776
1777 // Destroy Door Seal
1778 ApplySpellFix({ 58040 }, [](SpellInfo* spellInfo)
1779 {
1780 spellInfo->ChannelInterruptFlags &= ~(AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE);
1781 });
1782
1783 // Ichoron, Water Blast
1784 ApplySpellFix({ 54237, 59520 }, [](SpellInfo* spellInfo)
1785 {
1786 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
1787 });
1788
1789 // Krik'thir - Mind Flay
1790 ApplySpellFix({ 52586, 59367 }, [](SpellInfo* spellInfo)
1791 {
1792 spellInfo->ChannelInterruptFlags |= AURA_INTERRUPT_FLAG_MOVE;
1793 });
1794
1795 // Glare of the Tribunal
1796 ApplySpellFix({ 50988, 59870 }, [](SpellInfo* spellInfo)
1797 {
1798 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
1799 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1800 });
1801
1802 // Static Charge
1803 ApplySpellFix({ 50835, 59847 }, [](SpellInfo* spellInfo)
1804 {
1805 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY);
1806 });
1807
1808 // Gift of Twilight Shadow/Fire
1809 ApplySpellFix({ 57835, 58766 }, [](SpellInfo* spellInfo)
1810 {
1811 spellInfo->AttributesEx &= ~SPELL_ATTR1_IS_CHANNELED;
1812 });
1813
1814 // Pyrobuffet
1815 ApplySpellFix({ 57557 }, [](SpellInfo* spellInfo)
1816 {
1817 spellInfo->ExcludeTargetAuraSpell = 56911;
1818 });
1819
1820 // Arcane Barrage
1821 ApplySpellFix({ 56397 }, [](SpellInfo* spellInfo)
1822 {
1823 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
1824 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1825 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
1826 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo();
1827 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
1828 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo();
1829 });
1830
1832 55849, // Power Spark (ground +50% dmg aura)
1833 56438, // Arcane Overload (-50% dmg taken) - this is to prevent apply -> unapply -> apply ... dunno whether it's correct
1834 }, [](SpellInfo* spellInfo)
1835 {
1836 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
1837 });
1838
1839 // Vortex (Control Vehicle)
1840 ApplySpellFix({ 56263 }, [](SpellInfo* spellInfo)
1841 {
1842 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
1843 });
1844
1845 // Haste (Nexus Lord, increase run Speed of the disk)
1846 ApplySpellFix({ 57060 }, [](SpellInfo* spellInfo)
1847 {
1848 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_VEHICLE);
1849 });
1850
1851 // Arcane Overload
1852 ApplySpellFix({ 56430 }, [](SpellInfo* spellInfo)
1853 {
1854 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
1855 spellInfo->Effects[EFFECT_0].TriggerSpell = 56429;
1856 });
1857
1858 // Summon Arcane Bomb
1859 ApplySpellFix({ 56429 }, [](SpellInfo* spellInfo)
1860 {
1861 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
1862 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1863 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo();
1864 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo();
1865 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo();
1866 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo();
1867 });
1868
1869 // Destroy Platform Event
1870 ApplySpellFix({ 59099 }, [](SpellInfo* spellInfo)
1871 {
1872 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(22);
1873 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(15);
1874 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(22);
1875 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo(15);
1876 });
1877
1878 // Surge of Power (Phase 3)
1880 57407, // N
1881 }, [](SpellInfo* spellInfo)
1882 {
1883 spellInfo->MaxAffectedTargets = 1;
1884 spellInfo->InterruptFlags = 0;
1885 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS);
1886 spellInfo->AttributesEx4 |= SPELL_ATTR4_ALLOW_CAST_WHILE_CASTING;
1887 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
1888 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY);
1889 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
1890 });
1891
1892 // Surge of Power (Phase 3)
1894 60936 // H
1895 }, [](SpellInfo* spellInfo)
1896 {
1897 spellInfo->MaxAffectedTargets = 3;
1898 spellInfo->InterruptFlags = 0;
1899 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS);
1900 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
1901 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY);
1902 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
1903 });
1904
1905 // Wyrmrest Drake - Life Burst
1906 ApplySpellFix({ 57143 }, [](SpellInfo* spellInfo)
1907 {
1908 spellInfo->Effects[EFFECT_0].Effect = 0;
1909 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo();
1910 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1911 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
1912 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY);
1913 spellInfo->Effects[EFFECT_1].PointsPerComboPoint = 2500;
1914 spellInfo->Effects[EFFECT_1].BasePoints = 2499;
1915 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(1);
1916 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
1917 });
1918
1919 //Alexstrasza - Gift
1920 ApplySpellFix({ 61028 }, [](SpellInfo* spellInfo)
1921 {
1922 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
1923 });
1924
1925 // Meeting Stone Summon
1926 ApplySpellFix({ 23598 }, [](SpellInfo* spellInfo)
1927 {
1928 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER);
1929 });
1930
1931 // Ulduar, Flame Leviathan, Flame Vents
1932 // The channel carries no interrupt flags, so Electroshock and player interrupts could never stop it
1933 ApplySpellFix({ 62396 }, [](SpellInfo* spellInfo)
1934 {
1935 spellInfo->ChannelInterruptFlags |= CHANNEL_INTERRUPT_FLAG_INTERRUPT;
1936 });
1937
1938 // Ulduar, Mimiron, bomb bot explosion
1939 ApplySpellFix({ 63801 }, [](SpellInfo* spellInfo)
1940 {
1941 spellInfo->Effects[EFFECT_1].MiscValue = 17286;
1942 });
1943
1944 // Ulduar, Mimiron, Summon Flames Initial
1945 ApplySpellFix({ 64563 }, [](SpellInfo* spellInfo)
1946 {
1947 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
1948 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
1949 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
1950 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1951 });
1952
1953 // Ulduar, Mimiron, Flames (damage)
1954 ApplySpellFix({ 64566 }, [](SpellInfo* spellInfo)
1955 {
1956 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
1957 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_NO_CAST_LOG;
1958 });
1959
1960 // Ulduar, Hodir, Starlight
1961 ApplySpellFix({ 62807 }, [](SpellInfo* spellInfo)
1962 {
1963 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_1_YARD); // 1yd
1964 });
1965
1966 // Hodir Shatter Cache
1967 ApplySpellFix({ 62502 }, [](SpellInfo* spellInfo)
1968 {
1969 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
1970 });
1971
1972 // Ulduar, General Vezax, Mark of the Faceless
1973 ApplySpellFix({ 63278 }, [](SpellInfo* spellInfo)
1974 {
1975 spellInfo->Effects[EFFECT_0].Effect = 0;
1976 });
1977
1978 // Ulduar, General Vezax, Shadow Crash (area aura)
1979 ApplySpellFix({ 63277 }, [](SpellInfo* spellInfo)
1980 {
1981 spellInfo->AttributesEx5 |= SPELL_ATTR5_DO_NOT_DISPLAY_DURATION;
1982 });
1983
1984 // Boom (XT-002)
1985 ApplySpellFix({ 62834 }, [](SpellInfo* spellInfo)
1986 {
1987 spellInfo->Effects[EFFECT_1].Effect = 0;
1988 });
1989
1990 // Supercharge
1991 ApplySpellFix({ 61920 }, [](SpellInfo* spellInfo)
1992 {
1993 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
1994 });
1995
1996 // Lightning Whirl
1997 ApplySpellFix({ 61916 }, [](SpellInfo* spellInfo)
1998 {
1999 spellInfo->MaxAffectedTargets = 3;
2000 });
2001
2002 ApplySpellFix({ 63482 }, [](SpellInfo* spellInfo)
2003 {
2004 spellInfo->MaxAffectedTargets = 8;
2005 });
2006
2007 // Stone Grip, remove absorb aura
2008 ApplySpellFix({ 62056, 63985 }, [](SpellInfo* spellInfo)
2009 {
2010 spellInfo->Effects[EFFECT_1].Effect = 0;
2011 });
2012
2013 // Sentinel Blast
2014 ApplySpellFix({ 64389, 64678 }, [](SpellInfo* spellInfo)
2015 {
2016 spellInfo->Dispel = DISPEL_MAGIC;
2017 });
2018
2019 // Potent Pheromones
2020 ApplySpellFix({ 62619 }, [](SpellInfo* spellInfo)
2021 {
2022 spellInfo->AttributesEx |= SPELL_ATTR1_IMMUNITY_PURGES_EFFECT;
2023 });
2024
2025 // Healthy spore summon periodic
2026 ApplySpellFix({ 62566 }, [](SpellInfo* spellInfo)
2027 {
2028 spellInfo->Effects[EFFECT_0].Amplitude = 2000;
2029 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_PERIODIC_TRIGGER_SPELL;
2030 });
2031
2032 // Brightleaf Essence trigger
2033 ApplySpellFix({ 62968 }, [](SpellInfo* spellInfo)
2034 {
2035 spellInfo->Effects[EFFECT_1].Effect = 0; // duplicate
2036 });
2037
2038 // Potent Pheromones
2039 ApplySpellFix({ 64321 }, [](SpellInfo* spellInfo)
2040 {
2041 spellInfo->AttributesEx |= SPELL_ATTR1_IMMUNITY_PURGES_EFFECT;
2042 });
2043
2044 // Lightning Orb Charged
2045 ApplySpellFix({ 62186 }, [](SpellInfo* spellInfo)
2046 {
2047 spellInfo->Effects[EFFECT_0].Amplitude = 5000; // Duration 5 secs, amplitude 8 secs...
2048 });
2049
2050 // Lightning Pillar
2051 ApplySpellFix({ 62976 }, [](SpellInfo* spellInfo)
2052 {
2053 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6);
2054 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(28); // 5 seconds, wrong DBC data?
2055 });
2056
2057 // Sif's Blizzard
2058 ApplySpellFix({ 62576, 62602 }, [](SpellInfo* spellInfo)
2059 {
2060 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_8_YARDS); // 8yd
2061 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_8_YARDS); // 8yd
2062 });
2063
2064 // Protective Gaze
2065 ApplySpellFix({ 64175 }, [](SpellInfo* spellInfo)
2066 {
2067 spellInfo->RecoveryTime = 25000;
2068 });
2069
2070 // Shadow Beacon
2071 ApplySpellFix({ 64465 }, [](SpellInfo* spellInfo)
2072 {
2073 spellInfo->Effects[EFFECT_0].TriggerSpell = 64467; // why do they need two script effects :/ (this one has visual effect)
2074 });
2075
2076 // Sanity
2077 ApplySpellFix({ 63050 }, [](SpellInfo* spellInfo)
2078 {
2079 spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_PHASE_SHIFT;
2080 });
2081
2082 // Shadow Nova (Sara)
2083 ApplySpellFix({ 65719 }, [](SpellInfo* spellInfo)
2084 {
2085 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
2086 spellInfo->AttributesEx4 |= SPELL_ATTR4_NO_CAST_LOG;
2087 });
2088
2089 // Cosmic Smash (Algalon the Observer)
2090 ApplySpellFix({ 62311, 64596 }, [](SpellInfo* spellInfo)
2091 {
2092 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
2093 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
2094 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd
2095 });
2096
2097 // Constellation Phase Effect
2098 ApplySpellFix({ 65509 }, [](SpellInfo* spellInfo)
2099 {
2100 spellInfo->MaxAffectedTargets = 1;
2101 });
2102
2103 // Black Hole
2104 ApplySpellFix({ 62168, 65250, 62169 }, [](SpellInfo* spellInfo)
2105 {
2106 spellInfo->Attributes |= SPELL_ATTR0_AURA_IS_DEBUFF;
2107 spellInfo->AttributesEx3 |= SPELL_ATTR3_ONLY_ON_PLAYER; // pets phased away from their owner get despawned
2108 });
2109
2110 // Ground Slam
2111 ApplySpellFix({ 62625 }, [](SpellInfo* spellInfo)
2112 {
2113 spellInfo->InterruptFlags |= SPELL_INTERRUPT_FLAG_INTERRUPT;
2114 });
2115
2116 // Onyxia's Lair, Onyxia, Flame Breath (TriggerSpell = 0 and spamming errors in console)
2117 ApplySpellFix({ 18435 }, [](SpellInfo* spellInfo)
2118 {
2119 spellInfo->Effects[EFFECT_1].Effect = 0;
2120 });
2121
2122 // Onyxia's Lair, Onyxia, Create Onyxia Spawner
2123 ApplySpellFix({ 17647 }, [](SpellInfo* spellInfo)
2124 {
2125 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(37);
2126 });
2127
2129 17646, // Onyxia's Lair, Onyxia, Summon Onyxia Whelp
2130 68968 // Onyxia's Lair, Onyxia, Summon Lair Guard
2131 }, [](SpellInfo* spellInfo)
2132 {
2133 spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
2134 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
2135 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd
2136 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(5);
2137 });
2138
2139 // Onyxia's Lair, Onyxia, Breath
2141 18576, 18578, 18579, 18580, 18581, 18582, 18583, 18609, 18611, 18612, 18613, 18614, 18615, 18616, 18584,
2142 18585, 18586, 18587, 18588, 18589, 18590, 18591, 18592, 18593, 18594, 18595, 18564, 18565, 18566, 18567,
2143 18568, 18569, 18570, 18571, 18572, 18573, 18574, 18575, 18596, 18597, 18598, 18599, 18600, 18601, 18602,
2144 18603, 18604, 18605, 18606, 18607, 18617, 18619, 18620, 18621, 18622, 18623, 18624, 18625, 18626, 18627,
2145 18628, 18618, 18351, 18352, 18353, 18354, 18355, 18356, 18357, 18358, 18359, 18360, 18361, 17086, 17087,
2146 17088, 17089, 17090, 17091, 17092, 17093, 17094, 17095, 17097, 22267, 22268, 21132, 21133, 21135, 21136,
2147 21137, 21138, 21139
2148 }, [](SpellInfo* spellInfo)
2149 {
2150 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(328); // 250ms
2151 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(1);
2152 if (spellInfo->Effects[EFFECT_1].Effect)
2153 {
2154 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
2155 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_PERIODIC_TRIGGER_SPELL;
2156 spellInfo->Effects[EFFECT_1].Amplitude = ((spellInfo->CastTimeEntry == sSpellCastTimesStore.LookupEntry(170)) ? 50 : 215);
2157 }
2158 });
2159
2161 48760, // Oculus, Teleport to Coldarra DND
2162 49305 // Oculus, Teleport to Boss 1 DND
2163 }, [](SpellInfo* spellInfo)
2164 {
2165 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(25);
2166 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(17);
2167 });
2168
2169 // Oculus, Drake spell Stop Time
2170 ApplySpellFix({ 49838 }, [](SpellInfo* spellInfo)
2171 {
2172 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
2173 spellInfo->ExcludeTargetAuraSpell = 51162; // exclude planar shift
2174 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_150_YARDS);
2175 });
2176
2177 // Oculus, Varos Cloudstrider, Energize Cores
2178 ApplySpellFix({ 61407, 62136, 56251, 54069 }, [](SpellInfo* spellInfo)
2179 {
2180 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CONE_ENTRY);
2181 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2182 });
2183
2184 // Halls of Lightning, Arc Weld
2185 ApplySpellFix({ 59086 }, [](SpellInfo* spellInfo)
2186 {
2187 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(1);
2188 });
2189
2190 // Trial of the Champion, Death's Respite
2191 ApplySpellFix({ 68306 }, [](SpellInfo* spellInfo)
2192 {
2193 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(25);
2194 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(25);
2195 });
2196
2197 // Trial of the Champion, Eadric Achievement (The Faceroller)
2198 ApplySpellFix({ 68197 }, [](SpellInfo* spellInfo)
2199 {
2200 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY);
2201 spellInfo->Attributes |= SPELL_ATTR0_ALLOW_CAST_WHILE_DEAD;
2202 });
2203
2204 // Trial of the Champion, Earth Shield
2205 ApplySpellFix({ 67530 }, [](SpellInfo* spellInfo)
2206 {
2207 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_PROC_TRIGGER_SPELL; // will trigger 67537
2208 });
2209
2210 // Trial of the Champion, Hammer of the Righteous
2211 ApplySpellFix({ 66867 }, [](SpellInfo* spellInfo)
2212 {
2213 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_DUMMY;
2214 });
2215
2216 // Trial of the Champion, Summon Risen Jaeren/Arelas
2217 ApplySpellFix({ 67705, 67715 }, [](SpellInfo* spellInfo)
2218 {
2219 spellInfo->AttributesEx2 |= SPELL_ATTR2_ALLOW_DEAD_TARGET;
2220 });
2221
2222 // Trial of the Champion, Ghoul Explode
2223 ApplySpellFix({ 67751 }, [](SpellInfo* spellInfo)
2224 {
2225 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
2226 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
2227 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS);
2228 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
2229 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
2230 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS);
2231 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
2232 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
2233 spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS);
2234 });
2235
2236 // Trial of the Champion, Desecration
2237 ApplySpellFix({ 67778, 67877 }, [](SpellInfo* spellInfo)
2238 {
2239 spellInfo->Effects[EFFECT_0].TriggerSpell = 68766;
2240 });
2241
2242 // Killing Spree (Off hand damage)
2243 ApplySpellFix({ 57842 }, [](SpellInfo* spellInfo)
2244 {
2245 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(2); // Melee Range
2246 });
2247
2248 // Trial of the Crusader, Jaraxxus Intro spell
2249 ApplySpellFix({ 67888 }, [](SpellInfo* spellInfo)
2250 {
2251 spellInfo->Attributes |= SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT;
2252 spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT;
2253 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
2254 });
2255
2256 // Trial of the Crusader, Lich King Intro spell
2257 ApplySpellFix({ 68193 }, [](SpellInfo* spellInfo)
2258 {
2259 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY);
2260 });
2261
2262 // Trial of the Crusader, Gormok, Fire Bomb
2263 ApplySpellFix({ 66317 }, [](SpellInfo* spellInfo)
2264 {
2265 spellInfo->Attributes |= SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT;
2266 spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT;
2267 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
2268 });
2269
2270 ApplySpellFix({ 66318 }, [](SpellInfo* spellInfo)
2271 {
2272 spellInfo->Attributes |= SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT;
2273 spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT;
2274 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
2275 });
2276
2277 ApplySpellFix({ 66320, 67472, 67473, 67475 }, [](SpellInfo* spellInfo)
2278 {
2279 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_2_YARDS);
2280 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_2_YARDS);
2281 });
2282
2283 // Trial of the Crusader, Acidmaw & Dreadscale, Emerge
2284 ApplySpellFix({ 66947 }, [](SpellInfo* spellInfo)
2285 {
2286 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALLOW_WHILE_STUNNED;
2287 });
2288
2289 // Trial of the Crusader, Jaraxxus, Curse of the Nether
2290 ApplySpellFix({ 66211 }, [](SpellInfo* spellInfo)
2291 {
2292 spellInfo->ExcludeTargetAuraSpell = 66209; // exclude Touch of Jaraxxus
2293 });
2294
2295 // Trial of the Crusader, Jaraxxus, Summon Volcano
2296 ApplySpellFix({ 66258, 67901 }, [](SpellInfo* spellInfo)
2297 {
2298 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(85); // summon for 18 seconds, 15 not enough
2299 });
2300
2301 // Trial of the Crusader, Jaraxxus, Spinning Pain Spike
2302 ApplySpellFix({ 66281 }, [](SpellInfo* spellInfo)
2303 {
2304 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_4_YARDS);
2305 });
2306
2307 ApplySpellFix({ 66287 }, [](SpellInfo* spellInfo)
2308 {
2309 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
2310 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_TAUNT;
2311 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_NEARBY_ENTRY);
2312 spellInfo->Effects[EFFECT_2].Effect = SPELL_EFFECT_APPLY_AURA;
2313 spellInfo->Effects[EFFECT_2].ApplyAuraName = SPELL_AURA_MOD_STUN;
2314 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
2315 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(35); // 4 secs
2316 });
2317
2318 // Trial of the Crusader, Jaraxxus, Fel Fireball
2319 ApplySpellFix({ 66532, 66963, 66964, 66965 }, [](SpellInfo* spellInfo)
2320 {
2321 spellInfo->InterruptFlags |= SPELL_INTERRUPT_FLAG_INTERRUPT;
2322 });
2323
2324 // Trial of the Crusader, Faction Champions, Druid - Tranquality
2325 ApplySpellFix({ 66086, 67974, 67975, 67976 }, [](SpellInfo* spellInfo)
2326 {
2327 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AREA_AURA_FRIEND;
2328 });
2329
2330 // Trial of the Crusader, Faction Champions, Shaman - Earth Shield
2331 ApplySpellFix({ 66063 }, [](SpellInfo* spellInfo)
2332 {
2333 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_PROC_TRIGGER_SPELL;
2334 spellInfo->Effects[EFFECT_0].TriggerSpell = 66064;
2335 });
2336
2337 // Trial of the Crusader, Faction Champions, Priest - Mana Burn
2338 ApplySpellFix({ 66100 }, [](SpellInfo* spellInfo)
2339 {
2340 spellInfo->Effects[EFFECT_0].BasePoints = 5;
2341 spellInfo->Effects[EFFECT_0].DieSides = 0;
2342 });
2343
2344 ApplySpellFix({ 68026 }, [](SpellInfo* spellInfo)
2345 {
2346 spellInfo->Effects[EFFECT_0].BasePoints = 8;
2347 spellInfo->Effects[EFFECT_0].DieSides = 0;
2348 });
2349
2350 ApplySpellFix({ 68027 }, [](SpellInfo* spellInfo)
2351 {
2352 spellInfo->Effects[EFFECT_0].BasePoints = 6;
2353 spellInfo->Effects[EFFECT_0].DieSides = 0;
2354 });
2355
2356 ApplySpellFix({ 68028 }, [](SpellInfo* spellInfo)
2357 {
2358 spellInfo->Effects[EFFECT_0].BasePoints = 10;
2359 spellInfo->Effects[EFFECT_0].DieSides = 0;
2360 });
2361
2362 // Trial of the Crusader, Twin Valkyr, Clear Val'kyr Essence
2363 ApplySpellFix({ 67547 }, [](SpellInfo* spellInfo)
2364 {
2365 // Light and Dark Essence persist through death, so dead players must be cleared too
2366 spellInfo->AttributesEx2 |= SPELL_ATTR2_ALLOW_DEAD_TARGET;
2367 });
2368
2369 // Trial of the Crusader, Twin Valkyr, Touch of Light/Darkness, Light/Dark Surge
2371 65950 // light 0
2372 }, [](SpellInfo* spellInfo)
2373 {
2374 //spellInfo->EffectApplyAuraName[0] = SPELL_AURA_PERIODIC_DUMMY;
2375 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2376 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2377 spellInfo->Effects[EFFECT_1].Effect = 0;
2378 spellInfo->Effects[EFFECT_2].Effect = 0;
2379 });
2380
2382 65767 // light surge 0
2383 }, [](SpellInfo* spellInfo)
2384 {
2385 spellInfo->ExcludeTargetAuraSpell = 65686;
2386 });
2387
2389 67296 // light 1
2390 }, [](SpellInfo* spellInfo)
2391 {
2392 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2393 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2394 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2395 spellInfo->Effects[EFFECT_1].Effect = 0;
2396 spellInfo->Effects[EFFECT_2].Effect = 0;
2397 });
2398
2400 67274 // light surge 1
2401 }, [](SpellInfo* spellInfo)
2402 {
2403 spellInfo->ExcludeTargetAuraSpell = 67222;
2404 });
2405
2407 67297 // light 2
2408 }, [](SpellInfo* spellInfo)
2409 {
2410 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2411 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2412 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2413 spellInfo->Effects[EFFECT_1].Effect = 0;
2414 spellInfo->Effects[EFFECT_2].Effect = 0;
2415 });
2416
2418 67275 // light surge 2
2419 }, [](SpellInfo* spellInfo)
2420 {
2421 spellInfo->ExcludeTargetAuraSpell = 67223;
2422 });
2423
2425 67298 // light 3
2426 }, [](SpellInfo* spellInfo)
2427 {
2428 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2429 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2430 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2431 spellInfo->Effects[EFFECT_1].Effect = 0;
2432 spellInfo->Effects[EFFECT_2].Effect = 0;
2433 });
2434
2436 67276 // light surge 3
2437 }, [](SpellInfo* spellInfo)
2438 {
2439 spellInfo->ExcludeTargetAuraSpell = 67224;
2440 });
2441
2443 66001 // dark 0
2444 }, [](SpellInfo* spellInfo)
2445 {
2446 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2447 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2448 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2449 spellInfo->Effects[EFFECT_1].Effect = 0;
2450 spellInfo->Effects[EFFECT_2].Effect = 0;
2451 });
2452
2454 65769 // dark surge 0
2455 }, [](SpellInfo* spellInfo)
2456 {
2457 spellInfo->ExcludeTargetAuraSpell = 65684;
2458 });
2459
2461 67281 // dark 1
2462 }, [](SpellInfo* spellInfo)
2463 {
2464 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2465 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2466 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2467 spellInfo->Effects[EFFECT_1].Effect = 0;
2468 spellInfo->Effects[EFFECT_2].Effect = 0;
2469 });
2470
2472 67265 // dark surge 1
2473 }, [](SpellInfo* spellInfo)
2474 {
2475 spellInfo->ExcludeTargetAuraSpell = 67176;
2476 });
2477
2479 67282 // dark 2
2480 }, [](SpellInfo* spellInfo)
2481 {
2482 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2483 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2484 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2485 spellInfo->Effects[EFFECT_1].Effect = 0;
2486 spellInfo->Effects[EFFECT_2].Effect = 0;
2487 });
2488
2490 67266 // dark surge 2
2491 }, [](SpellInfo* spellInfo)
2492 {
2493 spellInfo->ExcludeTargetAuraSpell = 67177;
2494 });
2495
2497 67283 // dark 3
2498 }, [](SpellInfo* spellInfo)
2499 {
2500 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2501 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2502 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2503 spellInfo->Effects[EFFECT_1].Effect = 0;
2504 spellInfo->Effects[EFFECT_2].Effect = 0;
2505 });
2506
2508 67267 // dark surge 3
2509 }, [](SpellInfo* spellInfo)
2510 {
2511 spellInfo->ExcludeTargetAuraSpell = 67178;
2512 });
2513
2514 // Trial of the Crusader, Anub'arak, Emerge
2515 ApplySpellFix({ 65982 }, [](SpellInfo* spellInfo)
2516 {
2517 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALLOW_WHILE_STUNNED;
2518 });
2519
2520 // Trial of the Crusader, Anub'arak, Penetrating Cold
2521 ApplySpellFix({ 66013, 67700, 68509, 68510 }, [](SpellInfo* spellInfo)
2522 {
2523 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
2524 });
2525
2526 // Trial of the Crusader, Anub'arak, Shadow Strike
2527 ApplySpellFix({ 66134 }, [](SpellInfo* spellInfo)
2528 {
2529 spellInfo->InterruptFlags |= SPELL_INTERRUPT_FLAG_INTERRUPT;
2530 spellInfo->Effects[EFFECT_0].Effect = 0;
2531 });
2532
2533 // Trial of the Crusader, Anub'arak, Pursuing Spikes
2534 ApplySpellFix({ 65920, 65922, 65923 }, [](SpellInfo* spellInfo)
2535 {
2536 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_PERIODIC_DUMMY;
2537 //spellInfo->EffectTriggerSpell[0] = 0;
2538 });
2539
2540 // Trial of the Crusader, Anub'arak, Achievements: The Traitor King
2542 68186, // Anub'arak Scarab Achievement 10
2543 68515 // Anub'arak Scarab Achievement 25
2544 }, [](SpellInfo* spellInfo)
2545 {
2546 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
2547 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY);
2548 spellInfo->Attributes |= SPELL_ATTR0_ALLOW_CAST_WHILE_DEAD;
2549 });
2550
2551 // Trial of the Crusader, Anub'arak, Spider Frenzy
2552 ApplySpellFix({ 66129 }, [](SpellInfo* spellInfo)
2553 {
2554 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
2555 });
2556
2557 // Soul Sickness
2558 ApplySpellFix({ 69131 }, [](SpellInfo* spellInfo)
2559 {
2560 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_PERIODIC_TRIGGER_SPELL;
2561 spellInfo->Effects[EFFECT_0].Amplitude = 8000;
2562 spellInfo->Effects[EFFECT_0].TriggerSpell = 69133;
2563 });
2564
2565 // Phantom Blast
2566 ApplySpellFix({ 68982, 70322 }, [](SpellInfo* spellInfo)
2567 {
2568 spellInfo->InterruptFlags |= SPELL_INTERRUPT_FLAG_INTERRUPT;
2569 });
2570
2571 // Empowered Blizzard
2572 ApplySpellFix({ 70131 }, [](SpellInfo* spellInfo)
2573 {
2574 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
2575 });
2576
2577 // Ice Lance Volley
2578 ApplySpellFix({ 70464 }, [](SpellInfo* spellInfo)
2579 {
2580 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
2581 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
2582 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_70_YARDS);
2583 });
2584
2586 70513, // Multi-Shot
2587 59514 // Shriek of the Highborne
2588 }, [](SpellInfo* spellInfo)
2589 {
2590 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CONE_ENTRY);
2591 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2592 });
2593
2594 // Icicle
2595 ApplySpellFix({ 69428, 69426 }, [](SpellInfo* spellInfo)
2596 {
2597 spellInfo->InterruptFlags = 0;
2598 spellInfo->AuraInterruptFlags = 0;
2599 spellInfo->ChannelInterruptFlags = 0;
2600 });
2601
2602 ApplySpellFix({ 70525, 70639 }, [](SpellInfo* spellInfo)
2603 {
2604 spellInfo->Effects[EFFECT_0].Effect = 0;
2605 spellInfo->Effects[EFFECT_1].Effect = 0;
2606 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
2607 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
2608 spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_500_YARDS); // 500yd
2609 });
2610
2611 // Frost Nova
2612 ApplySpellFix({ 68198 }, [](SpellInfo* spellInfo)
2613 {
2614 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13);
2615 spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
2616 });
2617
2618 // Blight
2619 ApplySpellFix({ 69604, 70286 }, [](SpellInfo* spellInfo)
2620 {
2621 spellInfo->MaxAffectedTargets = 1;
2622 spellInfo->AttributesEx3 |= (SPELL_ATTR3_ALWAYS_HIT | SPELL_ATTR3_ONLY_ON_PLAYER);
2623 });
2624
2625 // Chilling Wave
2626 ApplySpellFix({ 68778, 70333 }, [](SpellInfo* spellInfo)
2627 {
2628 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_TARGET_ENEMY);
2629 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2630 });
2631
2632 ApplySpellFix({ 68786, 70336 }, [](SpellInfo* spellInfo)
2633 {
2634 spellInfo->AttributesEx3 |= (SPELL_ATTR3_ALWAYS_HIT | SPELL_ATTR3_ONLY_ON_PLAYER);
2635 spellInfo->Effects[EFFECT_2].Effect = SPELL_EFFECT_DUMMY;
2636 });
2637
2638 // Pursuit
2639 ApplySpellFix({ 68987 }, [](SpellInfo* spellInfo)
2640 {
2641 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2642 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2643 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2644 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo();
2645 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
2646 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo();
2647 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100yd
2648 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
2649 });
2650
2651 ApplySpellFix({ 69029, 70850 }, [](SpellInfo* spellInfo)
2652 {
2653 spellInfo->Effects[EFFECT_2].Effect = 0;
2654 });
2655
2656 // Explosive Barrage
2657 ApplySpellFix({ 69263 }, [](SpellInfo* spellInfo)
2658 {
2659 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_MOD_STUN;
2660 });
2661
2662 // Overlord's Brand
2663 ApplySpellFix({ 69172 }, [](SpellInfo* spellInfo)
2664 {
2665 spellInfo->ProcFlags = DONE_HIT_PROC_FLAG_MASK & ~PROC_FLAG_DONE_PERIODIC;
2666 spellInfo->ProcChance = 100;
2667 });
2668
2669 // Icy Blast
2670 ApplySpellFix({ 69232 }, [](SpellInfo* spellInfo)
2671 {
2672 spellInfo->Effects[EFFECT_1].TriggerSpell = 69238;
2673 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
2674 });
2675
2676 ApplySpellFix({ 69233, 69646 }, [](SpellInfo* spellInfo)
2677 {
2678 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
2679 });
2680
2681 ApplySpellFix({ 69238, 69628 }, [](SpellInfo* spellInfo)
2682 {
2683 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
2684 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_DEST_DYNOBJ_NONE);
2685 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
2686 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_DEST_DYNOBJ_NONE);
2687 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
2688 });
2689
2690 // Hoarfrost
2691 ApplySpellFix({ 69246, 69245, 69645 }, [](SpellInfo* spellInfo)
2692 {
2693 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
2694 });
2695
2696 // Devour Humanoid
2697 ApplySpellFix({ 69503 }, [](SpellInfo* spellInfo)
2698 {
2699 spellInfo->ChannelInterruptFlags |= 0;
2700 spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_TURNING;
2701 });
2702
2703 // Falric: Defiling Horror
2704 ApplySpellFix({ 72435, 72452 }, [](SpellInfo* spellInfo)
2705 {
2706 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS);
2707 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS);
2708 });
2709
2710 // Frostsworn General - Throw Shield
2711 ApplySpellFix({ 69222, 73076 }, [](SpellInfo* spellInfo)
2712 {
2713 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
2714 });
2715
2716 // Halls of Reflection Clone
2717 ApplySpellFix({ 69828 }, [](SpellInfo* spellInfo)
2718 {
2719 spellInfo->Effects[EFFECT_1].Effect = 0;
2720 spellInfo->Effects[EFFECT_2].Effect = 0;
2721 });
2722
2723 // Summon Ice Wall
2724 ApplySpellFix({ 69768 }, [](SpellInfo* spellInfo)
2725 {
2726 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2727 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALLOW_ACTION_DURING_CHANNEL;
2728 });
2729
2730 ApplySpellFix({ 69767 }, [](SpellInfo* spellInfo)
2731 {
2732 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_TARGET_ANY);
2733 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2734 });
2735
2736 // Essence of the Captured
2737 ApplySpellFix({ 73035, 70719 }, [](SpellInfo* spellInfo)
2738 {
2739 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13);
2740 });
2741
2742 // Achievement Check
2743 ApplySpellFix({ 72830 }, [](SpellInfo* spellInfo)
2744 {
2745 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS);
2746 });
2747
2749 70781, // Light's Hammer Teleport
2750 70856, // Oratory of the Damned Teleport
2751 70857, // Rampart of Skulls Teleport
2752 70858, // Deathbringer's Rise Teleport
2753 70859, // Upper Spire Teleport
2754 70860, // Frozen Throne Teleport
2755 70861 // Sindragosa's Lair Teleport
2756 }, [](SpellInfo* spellInfo)
2757 {
2758 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2759 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2760 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB); // this target is for SPELL_EFFECT_TELEPORT_UNITS
2761 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo();
2762 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2763 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo();
2764 });
2765
2767 70960, // Bone Flurry
2768 71258 // Adrenaline Rush (Ymirjar Battle-Maiden)
2769 }, [](SpellInfo* spellInfo)
2770 {
2771 spellInfo->AttributesEx &= ~SPELL_ATTR1_IS_SELF_CHANNELED;
2772 });
2773
2774 // Saber Lash (Lord Marrowgar)
2775 ApplySpellFix({ 69055, 70814 }, [](SpellInfo* spellInfo)
2776 {
2777 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS); // 5yd
2778 });
2779
2780 // Impaled (Lord Marrowgar)
2781 ApplySpellFix({ 69065 }, [](SpellInfo* spellInfo)
2782 {
2783 spellInfo->Effects[EFFECT_0].Effect = 0; // remove stun so Dispersion can be used
2784 });
2785
2786 // Cold Flame (Lord Marrowgar)
2787 ApplySpellFix({ 72701, 72702, 72703, 72704 }, [](SpellInfo* spellInfo)
2788 {
2789 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
2790 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
2791 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo();
2792 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(9); // 30 secs instead of 12, need him for longer, but will stop his actions after 12 secs
2793 });
2794
2795 ApplySpellFix({ 69138 }, [](SpellInfo* spellInfo)
2796 {
2797 spellInfo->Effects[EFFECT_0].Effect = 0;
2798 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
2799 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(9); // 30 secs instead of 12, need him for longer, but will stop his actions after 12 secs
2800 });
2801
2802 ApplySpellFix({ 69146, 70823, 70824, 70825 }, [](SpellInfo* spellInfo)
2803 {
2804 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // 3yd instead of 5yd
2805 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_NO_CAST_LOG;
2806 });
2807
2808 // Dark Martyrdom (Lady Deathwhisper)
2809 ApplySpellFix({ 70897 }, [](SpellInfo* spellInfo)
2810 {
2811 spellInfo->AttributesEx2 |= SPELL_ATTR2_ALLOW_DEAD_TARGET;
2812 });
2813
2815 69075, // Bone Storm (Lord Marrowgar)
2816 70834, // Bone Storm (Lord Marrowgar)
2817 70835, // Bone Storm (Lord Marrowgar)
2818 70836, // Bone Storm (Lord Marrowgar)
2819 72378, // Blood Nova (Deathbringer Saurfang)
2820 73058, // Blood Nova (Deathbringer Saurfang)
2821 72769, // Scent of Blood (Deathbringer Saurfang)
2822 72385, // Boiling Blood (Deathbringer Saurfang)
2823 72441, // Boiling Blood (Deathbringer Saurfang)
2824 72442, // Boiling Blood (Deathbringer Saurfang)
2825 72443, // Boiling Blood (Deathbringer Saurfang)
2826 71160, // Plague Stench (Stinky)
2827 71161, // Plague Stench (Stinky)
2828 71123, // Decimate (Stinky & Precious)
2829 71464 // Divine Surge (Sister Svalna)
2830 }, [](SpellInfo* spellInfo)
2831 {
2832 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
2833 });
2834
2835 // Shadow's Fate
2836 ApplySpellFix({ 71169 }, [](SpellInfo* spellInfo)
2837 {
2838 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
2839 });
2840
2841 // Lock Players and Tap Chest
2842 ApplySpellFix({ 72347 }, [](SpellInfo* spellInfo)
2843 {
2844 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
2845 });
2846
2847 // Award Reputation - Boss Kill
2848 ApplySpellFix({ 73843, 73844, 73845, 73846 }, [](SpellInfo* spellInfo)
2849 {
2850 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS);
2851 });
2852
2853 // Death Plague (Rotting Frost Giant)
2854 ApplySpellFix({ 72864 }, [](SpellInfo* spellInfo)
2855 {
2856 spellInfo->ExcludeTargetAuraSpell = 0;
2857 });
2858
2859 // Gunship Battle, spell Below Zero
2860 ApplySpellFix({ 69705 }, [](SpellInfo* spellInfo)
2861 {
2862 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
2863 });
2864
2865 // Resistant Skin (Deathbringer Saurfang adds)
2866 ApplySpellFix({ 72723 }, [](SpellInfo* spellInfo)
2867 {
2868 // this spell initially granted Shadow damage immunity, however it was removed but the data was left in client
2869 spellInfo->Effects[EFFECT_2].Effect = 0;
2870 });
2871
2872 // Mark of the Fallen Champion (Deathbringer Saurfang)
2873 ApplySpellFix({ 72255, 72444, 72445, 72446 }, [](SpellInfo* spellInfo)
2874 {
2875 // Patch 3.3.2 (2010-01-02): Deathbringer Saurfang will no longer gain blood power from Mark of the Fallen Champion.
2876 // prevented in script, effect needed for Prayer of Mending
2877 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
2878 });
2879
2880 // Coldflame Jets (Traps after Saurfang)
2881 ApplySpellFix({ 70460 }, [](SpellInfo* spellInfo)
2882 {
2883 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(1); // 10 seconds
2884 });
2885
2887 70461, // Coldflame Jets (Traps after Saurfang)
2888 71289 // Dominate Mind (Lady Deathwhisper)
2889 }, [](SpellInfo* spellInfo)
2890 {
2891 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
2892 });
2893
2894 // Severed Essence (Val'kyr Herald)
2895 ApplySpellFix({ 71906, 71942 }, [](SpellInfo* spellInfo)
2896 {
2897 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
2898 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2899 spellInfo->Effects[EFFECT_1].Effect = 0;
2900 });
2901
2903 71159, // Awaken Plagued Zombies (Precious)
2904 71302 // Awaken Ymirjar Fallen (Ymirjar Deathbringer)
2905 }, [](SpellInfo* spellInfo)
2906 {
2907 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21);
2908 });
2909
2910 // Blood Prince Council, Invocation of Blood
2911 ApplySpellFix({ 70981, 70982, 70952 }, [](SpellInfo* spellInfo)
2912 {
2913 spellInfo->Effects[EFFECT_0].Effect = 0; // clear share health aura
2914 });
2915
2916 // Ymirjar Frostbinder, Frozen Orb
2917 ApplySpellFix({ 71274 }, [](SpellInfo* spellInfo)
2918 {
2919 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2920 });
2921
2922 // Ooze Flood (Rotface)
2923 ApplySpellFix({ 69783, 69797, 69799, 69802 }, [](SpellInfo* spellInfo)
2924 {
2925 spellInfo->AttributesEx |= SPELL_ATTR1_EXCLUDE_CASTER;
2926 });
2927
2928 // Volatile Ooze Beam Protection
2929 ApplySpellFix({ 70530 }, [](SpellInfo* spellInfo)
2930 {
2931 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AURA; // blizzard typo, 65 instead of 6, aura itself is defined (dummy)
2932 });
2933
2934 // Professor Putricide, Gaseous Bloat (Orange Ooze Channel)
2935 ApplySpellFix({ 70672, 72455, 72832, 72833 }, [](SpellInfo* spellInfo)
2936 {
2937 // copied attributes from Green Ooze Channel
2938 spellInfo->Attributes |= SPELL_ATTR0_NO_IMMUNITIES;
2939 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
2940 });
2941
2942 // Professor Putricide, Expunged Gas (Gas Cloud detonation)
2943 ApplySpellFix({ 70701 }, [](SpellInfo* spellInfo)
2944 {
2945 // custom: the detonation is an unavoidable raid-wide hit, it must not be resisted away
2946 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
2947 });
2948
2950 71412, // Green Ooze Summon (Professor Putricide)
2951 71415 // Orange Ooze Summon (Professor Putricide)
2952 }, [](SpellInfo* spellInfo)
2953 {
2954 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2955 });
2956
2958 71621, // Create Concoction (Professor Putricide)
2959 72850,
2960 72851,
2961 72852,
2962 71893, // Guzzle Potions (Professor Putricide)
2963 73120,
2964 73121,
2965 73122
2966 }, [](SpellInfo* spellInfo)
2967 {
2968 spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(15); // 4 sec
2969 });
2970
2971 // Mutated Plague (Professor Putricide)
2972 ApplySpellFix({ 72454, 72464, 72506, 72507 }, [](SpellInfo* spellInfo)
2973 {
2974 spellInfo->AttributesEx4 |= SPELL_ATTR4_NO_CAST_LOG;
2975 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
2976 });
2977
2978 // Unbound Plague (Professor Putricide) (needs target selection script)
2979 ApplySpellFix({ 70911, 72854, 72855, 72856 }, [](SpellInfo* spellInfo)
2980 {
2981 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
2982 });
2983
2984 // Mutated Transformation (Professor Putricide)
2985 ApplySpellFix({ 70402, 72511, 72512, 72513 }, [](SpellInfo* spellInfo)
2986 {
2987 spellInfo->AttributesEx2 |= SPELL_ATTR2_CANT_CRIT;
2988 });
2989
2990 // Empowered Flare (Blood Prince Council)
2991 ApplySpellFix({ 71708, 72785, 72786, 72787 }, [](SpellInfo* spellInfo)
2992 {
2993 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
2994 });
2995
2997 71518, // Unholy Infusion Quest Credit (Professor Putricide)
2998 72934, // Blood Infusion Quest Credit (Blood-Queen Lana'thel)
2999 72289 // Frost Infusion Quest Credit (Sindragosa)
3000 }, [](SpellInfo* spellInfo)
3001 {
3002 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // another missing radius
3003 });
3004
3005 // Swarming Shadows
3006 ApplySpellFix({ 71266, 72890 }, [](SpellInfo* spellInfo)
3007 {
3008 spellInfo->AreaGroupId = 0; // originally, these require area 4522, which is... outside of Icecrown Citadel
3009 });
3010
3012 71301, // Summon Dream Portal (Valithria Dreamwalker)
3013 71977 // Summon Nightmare Portal (Valithria Dreamwalker)
3014 }, [](SpellInfo* spellInfo)
3015 {
3016 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
3017 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
3018 });
3019
3020 // Column of Frost (visual marker)
3021 ApplySpellFix({ 70715 }, [](SpellInfo* spellInfo)
3022 {
3023 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(32); // 6 seconds (missing)
3024 });
3025
3026 // Mana Void (periodic aura)
3027 ApplySpellFix({ 71085 }, [](SpellInfo* spellInfo)
3028 {
3029 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(9); // 30 seconds (missing)
3030 });
3031
3032 // Summon Suppressor (needs target selection script)
3033 ApplySpellFix({ 70936 }, [](SpellInfo* spellInfo)
3034 {
3035 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
3036 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
3037 });
3038
3039 // Corruption
3040 ApplySpellFix({ 70602 }, [](SpellInfo* spellInfo)
3041 {
3042 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
3043 });
3044
3046 72706, // Achievement Check (Valithria Dreamwalker)
3047 71357 // Order Whelp
3048 }, [](SpellInfo* spellInfo)
3049 {
3050 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3051 });
3052
3053 // Sindragosa's Fury
3054 ApplySpellFix({ 70598 }, [](SpellInfo* spellInfo)
3055 {
3056 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
3057 });
3058
3059 // Tail Smash (Sindragosa)
3060 ApplySpellFix({ 71077 }, [](SpellInfo* spellInfo)
3061 {
3062 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3063 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER_BACK);
3064 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_DEST_AREA_ENEMY);
3065 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER_BACK);
3066 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_DEST_AREA_ENEMY);
3067 });
3068
3069 // Frost Bomb
3070 ApplySpellFix({ 69846 }, [](SpellInfo* spellInfo)
3071 {
3072 spellInfo->Speed = 0.0f; // This spell's summon happens instantly
3073 });
3074
3075 // Mystic Buffet (Sindragosa)
3076 ApplySpellFix({ 70127, 72528, 72529, 72530 }, [](SpellInfo* spellInfo)
3077 {
3078 spellInfo->Effects[EFFECT_1].Effect = 0; // remove obsolete spell effect with no targets
3079 });
3080
3081 // Sindragosa, Frost Aura
3082 ApplySpellFix({ 70084, 71050, 71051, 71052 }, [](SpellInfo* spellInfo)
3083 {
3084 spellInfo->Attributes &= ~SPELL_ATTR0_NO_IMMUNITIES;
3085 });
3086
3087 // Ice Lock
3088 ApplySpellFix({ 71614 }, [](SpellInfo* spellInfo)
3089 {
3090 spellInfo->Mechanic = MECHANIC_STUN;
3091 });
3092
3093 // Lich King, Infest
3094 ApplySpellFix({ 70541, 73779, 73780, 73781 }, [](SpellInfo* spellInfo)
3095 {
3096 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3097 });
3098
3099 // Lich King, Necrotic Plague
3100 ApplySpellFix({ 70337, 73912, 73913, 73914, 70338, 73785, 73786, 73787 }, [](SpellInfo* spellInfo)
3101 {
3102 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
3103 });
3104
3106 69099, // Ice Pulse 10n
3107 73776, // Ice Pulse 25n
3108 73777, // Ice Pulse 10h
3109 73778 // Ice Pulse 25h
3110 }, [](SpellInfo* spellInfo)
3111 {
3112 spellInfo->AttributesEx2 |= SPELL_ATTR2_CANT_CRIT;
3113 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_NO_CAST_LOG;
3114 });
3115
3116 // Fury of Frostmourne
3117 ApplySpellFix({ 72350 }, [](SpellInfo* spellInfo)
3118 {
3119 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3120 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3121 });
3122
3124 72351, // Fury of Frostmourne
3125 72431, // Jump (removes Fury of Frostmourne debuff)
3126 72429, // Mass Resurrection
3127 73159 // Play Movie
3128 }, [](SpellInfo* spellInfo)
3129 {
3130 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3131 });
3132
3133 // Raise Dead
3134 ApplySpellFix({ 72376 }, [](SpellInfo* spellInfo)
3135 {
3136 spellInfo->MaxAffectedTargets = 4;
3137 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3138 });
3139
3140 // Jump
3141 ApplySpellFix({ 71809 }, [](SpellInfo* spellInfo)
3142 {
3143 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(5); // 40yd
3144 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd
3145 spellInfo->Effects[EFFECT_0].MiscValue = 190;
3146 });
3147
3148 // Broken Frostmourne
3149 ApplySpellFix({ 72405 }, [](SpellInfo* spellInfo)
3150 {
3151 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3152 });
3153
3154 // Summon Shadow Trap
3155 ApplySpellFix({ 73540 }, [](SpellInfo* spellInfo)
3156 {
3157 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(3); // 60 seconds
3158 });
3159
3160 // Shadow Trap (visual)
3161 ApplySpellFix({ 73530 }, [](SpellInfo* spellInfo)
3162 {
3163 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(28); // 5 seconds
3164 });
3165
3166 // Shadow Trap
3167 ApplySpellFix({ 73529 }, [](SpellInfo* spellInfo)
3168 {
3169 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd
3170 });
3171
3172 // Shadow Trap (searcher)
3173 ApplySpellFix({ 74282 }, [](SpellInfo* spellInfo)
3174 {
3175 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // 3yd
3176 });
3177
3178 // Raging Spirit Visual
3179 ApplySpellFix({ 69198 }, [](SpellInfo* spellInfo)
3180 {
3181 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd
3182 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3183 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
3184 });
3185
3186 // Defile
3187 ApplySpellFix({ 72762 }, [](SpellInfo* spellInfo)
3188 {
3189 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(559); // 53 seconds
3190 spellInfo->ExcludeCasterAuraSpell = 0;
3191 spellInfo->Attributes |= SPELL_ATTR0_NO_IMMUNITIES;
3193 });
3194
3195 // Defile
3196 ApplySpellFix({ 72743 }, [](SpellInfo* spellInfo)
3197 {
3198 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(22); // 45 seconds
3199 });
3200
3201 ApplySpellFix({ 72754, 73708, 73709, 73710 }, [](SpellInfo* spellInfo)
3202 {
3203 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3204 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3205 });
3206
3207 // Val'kyr Target Search
3208 ApplySpellFix({ 69030 }, [](SpellInfo* spellInfo)
3209 {
3210 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3211 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3212 spellInfo->Attributes |= SPELL_ATTR0_NO_IMMUNITIES;
3213 });
3214
3215 // Harvest Souls
3216 ApplySpellFix({ 73654, 74295, 74296, 74297 }, [](SpellInfo* spellInfo)
3217 {
3218 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3219 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3220 spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3221 });
3222
3223 // Restore Soul
3224 ApplySpellFix({ 72595, 73650 }, [](SpellInfo* spellInfo)
3225 {
3226 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3227 });
3228
3229 // Kill Frostmourne Players
3230 ApplySpellFix({ 75127 }, [](SpellInfo* spellInfo)
3231 {
3232 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3233 });
3234
3235 // Harvest Soul
3236 ApplySpellFix({ 73655 }, [](SpellInfo* spellInfo)
3237 {
3238 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
3239 });
3240
3241 // Destroy Soul
3242 ApplySpellFix({ 74086 }, [](SpellInfo* spellInfo)
3243 {
3244 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3245 });
3246
3247 // Summon Spirit Bomb
3248 ApplySpellFix({ 74302, 74342 }, [](SpellInfo* spellInfo)
3249 {
3250 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3251 spellInfo->MaxAffectedTargets = 1;
3252 });
3253
3254 // Summon Spirit Bomb
3255 ApplySpellFix({ 74341, 74343 }, [](SpellInfo* spellInfo)
3256 {
3257 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3258 spellInfo->MaxAffectedTargets = 3;
3259 });
3260
3261 // Summon Spirit Bomb
3262 ApplySpellFix({ 73579 }, [](SpellInfo* spellInfo)
3263 {
3264 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_25_YARDS); // 25yd
3265 });
3266
3267 // Trigger Vile Spirit (Inside, Heroic)
3268 ApplySpellFix({ 73582 }, [](SpellInfo* spellInfo)
3269 {
3270 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3271 });
3272
3273 // Scale Aura (used during Dominate Mind from Lady Deathwhisper)
3274 ApplySpellFix({ 73261 }, [](SpellInfo* spellInfo)
3275 {
3276 spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CHANGE_MAP;
3277 });
3278
3279 // Leap to a Random Location
3280 ApplySpellFix({ 70485 }, [](SpellInfo* spellInfo)
3281 {
3282 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100yd
3283 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS);
3284 spellInfo->Effects[EFFECT_0].MiscValue = 100;
3285 });
3286
3287 ApplySpellFix({ 74509 }, [](SpellInfo* spellInfo)
3288 {
3289 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS); // 20yd
3290 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS); // 20yd
3291 spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS); // 20yd
3292 });
3293
3294 // Rallying Shout
3295 ApplySpellFix({ 75414 }, [](SpellInfo* spellInfo)
3296 {
3297 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS); // 20yd
3298 });
3299
3300 // Barrier Channel
3301 ApplySpellFix({ 76221 }, [](SpellInfo* spellInfo)
3302 {
3303 spellInfo->ChannelInterruptFlags &= ~(AURA_INTERRUPT_FLAG_TURNING | AURA_INTERRUPT_FLAG_MOVE);
3304 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_NEARBY_ENTRY);
3305 });
3306
3307 // Intimidating Roar
3308 ApplySpellFix({ 74384 }, [](SpellInfo* spellInfo)
3309 {
3310 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
3311 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
3312 });
3313
3315 74562, // Fiery Combustion
3316 74792 // Soul Consumption
3317 }, [](SpellInfo* spellInfo)
3318 {
3319 spellInfo->AttributesEx |= SPELL_ATTR1_NO_REDIRECTION;
3320 });
3321
3322 // Combustion
3323 ApplySpellFix({ 75883, 75884 }, [](SpellInfo* spellInfo)
3324 {
3325 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_6_YARDS); // 6yd
3326 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_6_YARDS); // 6yd
3327 });
3328
3329 // Consumption
3330 ApplySpellFix({ 75875, 75876 }, [](SpellInfo* spellInfo)
3331 {
3332 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_6_YARDS); // 6yd
3333 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_6_YARDS); // 6yd
3334 spellInfo->Effects[EFFECT_0].Mechanic = MECHANIC_NONE;
3335 spellInfo->Effects[EFFECT_1].Mechanic = MECHANIC_SNARE;
3336 });
3337
3338 // Soul Consumption
3339 ApplySpellFix({ 74799 }, [](SpellInfo* spellInfo)
3340 {
3341 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_12_YARDS); // 12yd
3342 });
3343
3344 // Twilight Cutter
3345 ApplySpellFix({ 74769, 77844, 77845, 77846 }, [](SpellInfo* spellInfo)
3346 {
3347 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
3348 });
3349
3350 // Twilight Mending
3351 ApplySpellFix({ 75509 }, [](SpellInfo* spellInfo)
3352 {
3353 spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_PHASE_SHIFT;
3354 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3355 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
3356 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
3357 });
3358
3359 // Meteor Strike
3360 ApplySpellFix({ 74637 }, [](SpellInfo* spellInfo)
3361 {
3362 spellInfo->Speed = 0;
3363 });
3364
3365 //Blazing Aura
3366 ApplySpellFix({ 75885, 75886 }, [](SpellInfo* spellInfo)
3367 {
3368 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_NO_CAST_LOG;
3369 });
3370
3372 75952, //Meteor Strike
3373 74629 //Combustion Periodic
3374 }, [](SpellInfo* spellInfo)
3375 {
3376 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_NO_CAST_LOG;
3377 });
3378
3379 // Going Bearback
3380 ApplySpellFix({ 54897 }, [](SpellInfo* spellInfo)
3381 {
3382 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_DUMMY;
3383 spellInfo->Effects[EFFECT_1].RadiusEntry = spellInfo->Effects[EFFECT_0].RadiusEntry;
3384 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_DEST_AREA_ENTRY);
3385 });
3386
3387 // Still At It
3388 ApplySpellFix({ 51931, 51932, 51933 }, [](SpellInfo* spellInfo)
3389 {
3390 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(38);
3391 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
3392 });
3393
3394 // Rallying the Troops
3395 ApplySpellFix({ 47394 }, [](SpellInfo* spellInfo)
3396 {
3397 spellInfo->ExcludeTargetAuraSpell = 47394;
3398 });
3399
3400 // A Tangled Skein
3401 ApplySpellFix({ 51165, 51173 }, [](SpellInfo* spellInfo)
3402 {
3403 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
3404 });
3405
3407 69563, // A Cloudlet of Classy Cologne
3408 69445, // A Perfect Puff of Perfume
3409 69489 // Bonbon Blitz
3410 }, [](SpellInfo* spellInfo)
3411 {
3412 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
3413 });
3414
3415 // Control
3416 ApplySpellFix({ 30790 }, [](SpellInfo* spellInfo)
3417 {
3418 spellInfo->Effects[EFFECT_1].MiscValue = 0;
3419 });
3420
3421 // Reclusive Runemaster
3422 ApplySpellFix({ 48028 }, [](SpellInfo* spellInfo)
3423 {
3424 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
3425 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY);
3426 });
3427
3428 // Mastery of
3429 ApplySpellFix({ 65147 }, [](SpellInfo* spellInfo)
3430 {
3431 spellInfo->CategoryEntry = sSpellCategoryStore.LookupEntry(1244);
3432 spellInfo->CategoryRecoveryTime = 1500;
3433 });
3434
3435 // Weakness to Lightning
3436 ApplySpellFix({ 46432 }, [](SpellInfo* spellInfo)
3437 {
3438 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD;
3439 });
3440
3441 // Wrangle Some Aether Rays!
3442 ApplySpellFix({ 40856 }, [](SpellInfo* spellInfo)
3443 {
3444 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(27); // 3000ms
3445 });
3446
3447 // The Black Knight's Orders
3448 ApplySpellFix({ 63163 }, [](SpellInfo* spellInfo)
3449 {
3450 spellInfo->Effects[EFFECT_0].BasePoints = 52390;
3451 });
3452
3453 // The Warp Rifts
3454 ApplySpellFix({ 34888 }, [](SpellInfo* spellInfo)
3455 {
3456 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(5); // 300 secs
3457 });
3458
3459 // The Smallest Creatures
3460 ApplySpellFix({ 38544 }, [](SpellInfo* spellInfo)
3461 {
3462 spellInfo->Effects[EFFECT_0].MiscValueB = 427;
3463 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(1);
3464 spellInfo->Effects[EFFECT_1].Effect = 0;
3465 });
3466
3467 // Ridding the red rocket
3468 ApplySpellFix({ 49177 }, [](SpellInfo* spellInfo)
3469 {
3470 spellInfo->Effects[EFFECT_0].BasePoints = 1; // corrects seat id (points - 1 = seatId)
3471 });
3472
3473 // Jormungar Strike
3474 ApplySpellFix({ 56513 }, [](SpellInfo* spellInfo)
3475 {
3476 spellInfo->RecoveryTime = 2000;
3477 });
3478
3480 37851, // Tag Greater Felfire Diemetradon
3481 37918 // Arcano-pince
3482 }, [](SpellInfo* spellInfo)
3483 {
3484 spellInfo->RecoveryTime = 3000;
3485 });
3486
3488 54997, // Cast Net (tooltip says 10s but sniffs say 6s)
3489 56524 // Acid Breath
3490 }, [](SpellInfo* spellInfo)
3491 {
3492 spellInfo->RecoveryTime = 6000;
3493 });
3494
3496 47911, // EMP
3497 48620, // Wing Buffet
3498 51752 // Stampy's Stompy-Stomp
3499 }, [](SpellInfo* spellInfo)
3500 {
3501 spellInfo->RecoveryTime = 10000;
3502 });
3503
3505 37727, // Touch of Darkness
3506 54996 // Ice Slick (tooltip says 20s but sniffs say 12s)
3507 }, [](SpellInfo* spellInfo)
3508 {
3509 spellInfo->RecoveryTime = 12000;
3510 });
3511
3512 // Signal Helmet to Attack
3513 ApplySpellFix({ 51748 }, [](SpellInfo* spellInfo)
3514 {
3515 spellInfo->RecoveryTime = 15000;
3516 });
3517
3519 51756, // Charge
3520 37919, //Arcano-dismantle
3521 37917 //Arcano-Cloak
3522 }, [](SpellInfo* spellInfo)
3523 {
3524 spellInfo->RecoveryTime = 20000;
3525 });
3526
3527 // Kaw the Mammoth Destroyer
3528 ApplySpellFix({ 46260 }, [](SpellInfo* spellInfo)
3529 {
3530 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3531 });
3532
3533 // That's Abominable
3534 ApplySpellFix({ 59565 }, [](SpellInfo* spellInfo)
3535 {
3536 spellInfo->Effects[EFFECT_0].MiscValueB = 1721; // controllable guardian
3537 });
3538
3539 // Investigate the Blue Recluse (1920)
3540 // Investigate the Alchemist Shop (1960)
3541 ApplySpellFix({ 9095 }, [](SpellInfo* spellInfo)
3542 {
3543 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_DUMMY;
3544 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd
3545 });
3546
3547 // Gauging the Resonant Frequency (10594)
3548 ApplySpellFix({ 37390 }, [](SpellInfo* spellInfo)
3549 {
3550 spellInfo->Effects[EFFECT_0].MiscValueB = 181;
3551 });
3552
3553 // Where in the World is Hemet Nesingwary? (12521)
3554 ApplySpellFix({ 50860 }, [](SpellInfo* spellInfo)
3555 {
3556 spellInfo->Effects[EFFECT_0].BasePoints = 50860;
3557 });
3558
3559 ApplySpellFix({ 50861 }, [](SpellInfo* spellInfo)
3560 {
3561 spellInfo->Effects[EFFECT_0].BasePoints = 0;
3562 });
3563
3564 // Riding Jokkum
3565 ApplySpellFix({ 56606 }, [](SpellInfo* spellInfo)
3566 {
3567 spellInfo->Effects[EFFECT_0].BasePoints = 1;
3568 });
3569
3570 // Blightbeasts be Damned! (12072)
3571 ApplySpellFix({ 47424 }, [](SpellInfo* spellInfo)
3572 {
3573 spellInfo->AuraInterruptFlags &= ~AURA_INTERRUPT_FLAG_NOT_ABOVEWATER;
3574 });
3575
3576 // Dark Horizon (12664), Reunited (12663)
3577 ApplySpellFix({ 52190 }, [](SpellInfo* spellInfo)
3578 {
3579 spellInfo->Effects[EFFECT_0].BasePoints = 52391 - 1;
3580 });
3581
3582 // The Sum is Greater than the Parts (13043) - Chained Grip
3583 ApplySpellFix({ 60540 }, [](SpellInfo* spellInfo)
3584 {
3585 spellInfo->Effects[EFFECT_0].MiscValue = 300;
3586 });
3587
3588 // Not a Bug (13342)
3589 ApplySpellFix({ 60531 }, [](SpellInfo* spellInfo)
3590 {
3591 spellInfo->AttributesEx2 |= SPELL_ATTR2_ALLOW_DEAD_TARGET;
3592 });
3593
3594 // Frankly, It Makes No Sense... (10672)
3595 ApplySpellFix({ 37851 }, [](SpellInfo* spellInfo)
3596 {
3597 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
3598 });
3599
3600 // Honor Challenge (12939)
3601 ApplySpellFix({ 21855 }, [](SpellInfo* spellInfo)
3602 {
3603 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
3604 });
3605
3606 // Convocation at Zol'Heb (12730)
3607 ApplySpellFix({ 52956 }, [](SpellInfo* spellInfo)
3608 {
3609 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_DEST_AREA_ENTRY);
3610 });
3611
3612 // Mangletooth
3614 7764, // Wisdom of Agamaggan
3615 10767, // Rising Spirit
3616 16610, // Razorhide
3617 16612, // Agamaggan's Strength
3618 16618, // Spirit of the Wind
3619 17013 // Agamaggan's Agility
3620 }, [](SpellInfo* spellInfo)
3621
3622 {
3623 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3624 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT;
3625 });
3626
3627 // Battle for the Undercity
3629 59892 // Cyclone fall
3630 }, [](SpellInfo* spellInfo)
3631 {
3632 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AREA_AURA_FRIEND;
3633 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd
3634 spellInfo->AttributesEx &= ~SPELL_ATTR0_NO_AURA_CANCEL;
3635 spellInfo->AttributesEx3 |= SPELL_ATTR3_ONLY_ON_PLAYER;
3636 });
3637
3638 // enchant Lightweave Embroidery
3639 ApplySpellFix({ 55637 }, [](SpellInfo* spellInfo)
3640 {
3641 spellInfo->Effects[EFFECT_1].MiscValue = 126;
3642 });
3643
3645 47977, // Magic Broom
3646 65917 // Magic Rooster
3647 }, [](SpellInfo* spellInfo)
3648 {
3649 // First two effects apply auras, which shouldn't be there
3650 // due to NO_TARGET applying aura on current caster (core bug)
3651 // Just wipe effect data, to mimic blizz-behavior
3652 spellInfo->Effects[EFFECT_0].Effect = 0;
3653 spellInfo->Effects[EFFECT_1].Effect = 0;
3654 });
3655
3656 // Titanium Seal of Dalaran, Toss your luck
3657 ApplySpellFix({ 60476 }, [](SpellInfo* spellInfo)
3658 {
3659 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
3660 });
3661
3662 // Mind Amplification Dish, change charm aura
3663 ApplySpellFix({ 26740 }, [](SpellInfo* spellInfo)
3664 {
3665 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_MOD_CHARM;
3666 });
3667
3668 // Deadly Swiftness
3669 ApplySpellFix({ 31255 }, [](SpellInfo* spellInfo)
3670 {
3671 spellInfo->Effects[EFFECT_0].TriggerSpell = 22588;
3672 });
3673
3674 // Black Magic enchant
3675 ApplySpellFix({ 59630 }, [](SpellInfo* spellInfo)
3676 {
3677 spellInfo->Attributes |= SPELL_ATTR0_PASSIVE;
3678 });
3679
3680 // Precious's Ribbon
3681 ApplySpellFix({ 72968 }, [](SpellInfo* spellInfo)
3682 {
3683 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD;
3684 });
3685
3687 71646, // Item - Bauble of True Blood 10m
3688 71607, // Item - Bauble of True Blood 25m
3689 71610, // Item - Althor's Abacus trigger 10m
3690 71641 // Item - Althor's Abacus trigger 25m
3691 }, [](SpellInfo* spellInfo)
3692 {
3693 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
3694 spellInfo->SpellLevel = 0;
3695 });
3696
3698 6789, // Warlock - Death Coil (Rank 1)
3699 17925, // Warlock - Death Coil (Rank 2)
3700 17926, // Warlock - Death Coil (Rank 3)
3701 27223, // Warlock - Death Coil (Rank 4)
3702 47859, // Warlock - Death Coil (Rank 5)
3703 71838, // Drain Life - Bryntroll Normal
3704 71839 // Drain Life - Bryntroll Heroic
3705 }, [](SpellInfo* spellInfo)
3706 {
3707 spellInfo->AttributesEx2 |= SPELL_ATTR2_CANT_CRIT;
3708 });
3709
3710 // Alchemist's Stone
3711 ApplySpellFix({ 17619 }, [](SpellInfo* spellInfo)
3712 {
3713 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD;
3714 });
3715
3716 // Stormchops
3717 ApplySpellFix({ 43730 }, [](SpellInfo* spellInfo)
3718 {
3719 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(1);
3720 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo();
3721 });
3722
3723 // Savory Deviate Delight (transformations), allow to mount while transformed
3724 ApplySpellFix({ 8219, 8220, 8221, 8222 }, [](SpellInfo* spellInfo)
3725 {
3726 spellInfo->Attributes &= ~SPELL_ATTR0_NO_IMMUNITIES;
3727 });
3728
3729 // Clamlette Magnifique
3730 ApplySpellFix({ 72623 }, [](SpellInfo* spellInfo)
3731 {
3732 spellInfo->Effects[EFFECT_0].BasePoints = spellInfo->Effects[EFFECT_1].BasePoints;
3733 });
3734
3735 // Compact Harvest Reaper
3736 ApplySpellFix({ 4078 }, [](SpellInfo* spellInfo)
3737 {
3738 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(6); // 10 minutes
3739 });
3740
3741 // Dragon Kite, Tuskarr Kite - Kite String
3742 ApplySpellFix({ 45192 }, [](SpellInfo* spellInfo)
3743 {
3744 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100yd
3745 });
3746
3747 // Frigid Frostling, Infrigidate
3748 ApplySpellFix({ 74960 }, [](SpellInfo* spellInfo)
3749 {
3750 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS); // 20yd
3751 });
3752
3753 // Apple Trap
3754 ApplySpellFix({ 43450 }, [](SpellInfo* spellInfo)
3755 {
3756 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY);
3757 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
3758 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_DUMMY;
3759 });
3760
3761 // Dark Iron Attack - spawn mole machine
3762 ApplySpellFix({ 43563 }, [](SpellInfo* spellInfo)
3763 {
3764 spellInfo->Effects[EFFECT_2].Effect = 0; // summon GO's manually
3765 });
3766
3767 // Throw Mug visual
3768 ApplySpellFix({ 42300 }, [](SpellInfo* spellInfo)
3769 {
3770 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
3771 });
3772
3773 // Dark Iron knockback Aura
3774 ApplySpellFix({ 42299 }, [](SpellInfo* spellInfo)
3775 {
3776 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_DUMMY;
3777 spellInfo->Effects[EFFECT_0].MiscValue = 100;
3778 spellInfo->Effects[EFFECT_0].BasePoints = 79;
3779 });
3780
3781 // Chug and Chuck!
3782 ApplySpellFix({ 42436 }, [](SpellInfo* spellInfo)
3783 {
3784 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
3785 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
3786 spellInfo->MaxAffectedTargets = 0;
3787 spellInfo->ExcludeCasterAuraSpell = 42299;
3788 });
3789
3790 // Brewfest quests
3791 ApplySpellFix({ 47134, 51798 }, [](SpellInfo* spellInfo)
3792 {
3793 spellInfo->Effects[EFFECT_0].Effect = 0;
3794 });
3795
3796 // The Heart of The Storms (12998)
3797 ApplySpellFix({ 43528 }, [](SpellInfo* spellInfo)
3798 {
3799 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(18);
3800 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(25);
3801 });
3802
3803 // Water splash
3804 ApplySpellFix({ 42348 }, [](SpellInfo* spellInfo)
3805 {
3806 spellInfo->Effects[EFFECT_0].Effect = 0;
3807 });
3808
3809 // Summon Lantersn
3810 ApplySpellFix({ 44255, 44231 }, [](SpellInfo* spellInfo)
3811 {
3812 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
3813 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
3814 });
3815
3816 // Throw Head Back
3817 ApplySpellFix({ 42401 }, [](SpellInfo* spellInfo)
3818 {
3819 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_NEARBY_ENTRY);
3820 });
3821
3822 // Food
3823 ApplySpellFix({ 65418 }, [](SpellInfo* spellInfo)
3824 {
3825 spellInfo->Effects[EFFECT_2].TriggerSpell = 65410;
3826 });
3827
3828 ApplySpellFix({ 65422 }, [](SpellInfo* spellInfo)
3829 {
3830 spellInfo->Effects[EFFECT_2].TriggerSpell = 65414;
3831 });
3832
3833 ApplySpellFix({ 65419 }, [](SpellInfo* spellInfo)
3834 {
3835 spellInfo->Effects[EFFECT_2].TriggerSpell = 65416;
3836 });
3837
3838 ApplySpellFix({ 65420 }, [](SpellInfo* spellInfo)
3839 {
3840 spellInfo->Effects[EFFECT_2].TriggerSpell = 65412;
3841 });
3842
3843 ApplySpellFix({ 65421 }, [](SpellInfo* spellInfo)
3844 {
3845 spellInfo->Effects[EFFECT_2].TriggerSpell = 65415;
3846 });
3847
3848 // Stamp Out Bonfire
3849 ApplySpellFix({ 45437 }, [](SpellInfo* spellInfo)
3850 {
3851 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_DUMMY;
3852 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_NEARBY_ENTRY);
3853 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3854 });
3855
3856 // Light Bonfire (DND)
3857 ApplySpellFix({ 29831 }, [](SpellInfo* spellInfo)
3858 {
3859 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3860 });
3861
3862 // Infernal
3863 ApplySpellFix({ 33240 }, [](SpellInfo* spellInfo)
3864 {
3865 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
3866 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
3867 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
3868 });
3869
3871 47476, // Deathknight - Strangulate
3872 15487, // Priest - Silence
3873 5211, // Druid - Bash - R1
3874 6798, // Druid - Bash - R2
3875 8983 // Druid - Bash - R3
3876 }, [](SpellInfo* spellInfo)
3877 {
3878 spellInfo->AttributesEx7 |= SPELL_ATTR7_CAN_CAUSE_INTERRUPT;
3879 });
3880
3881 // Shadowmeld
3882 ApplySpellFix({ 58984 }, [](SpellInfo* spellInfo)
3883 {
3884 spellInfo->AttributesEx3 |= SPELL_ATTR3_ONLY_ON_PLAYER;
3885 });
3886
3887 // Flare activation speed
3888 ApplySpellFix({ 1543 }, [](SpellInfo* spellInfo)
3889 {
3890 spellInfo->Speed = 0.0f;
3891 });
3892
3893 // Light's Beacon
3894 ApplySpellFix({ 53651 }, [](SpellInfo* spellInfo)
3895 {
3896 spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT;
3897 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3898 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
3899 });
3900
3901 // Shadow Hunter Vosh'gajin - Hex
3902 ApplySpellFix({ 16097 }, [](SpellInfo* spellInfo)
3903 {
3904 spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(16);
3905 });
3906
3907 // Sacred Cleansing
3908 ApplySpellFix({ 53659 }, [](SpellInfo* spellInfo)
3909 {
3910 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(5); // 40yd
3911 });
3912
3913 // Silithyst
3914 ApplySpellFix({ 29519 }, [](SpellInfo* spellInfo)
3915 {
3916 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_MOD_DECREASE_SPEED;
3917 spellInfo->Effects[EFFECT_0].BasePoints = -25;
3918 });
3919
3920 // Eye of Kilrogg Passive (DND)
3921 ApplySpellFix({ 2585 }, [](SpellInfo* spellInfo)
3922 {
3923 spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE;
3924 });
3925
3926 // Nefarius Corruption
3927 ApplySpellFix({ 23642 }, [](SpellInfo* spellInfo)
3928 {
3929 spellInfo->MaxAffectedTargets = 1;
3930 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
3931 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
3932 });
3933
3934 // Conflagration, Horseman's Cleave
3935 ApplySpellFix({ 42380, 42587 }, [](SpellInfo* spellInfo)
3936 {
3937 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
3938 });
3939
3940 // Serverside - Summon Arcane Disruptor
3941 ApplySpellFix({ 49591 }, [](SpellInfo* spellInfo)
3942 {
3943 spellInfo->ProcChance = 101;
3944 spellInfo->Effects[EFFECT_1].Effect = 24;
3945 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(25);
3946 spellInfo->Effects[EFFECT_1].ItemType = 37888;
3947 });
3948
3949 // Serverside - Create Rocket Pack
3950 ApplySpellFix({ 70055 }, [](SpellInfo* spellInfo)
3951 {
3952 spellInfo->ProcChance = 101;
3953 spellInfo->Effects[EFFECT_1].Effect = 24;
3954 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(25);
3955 spellInfo->Effects[EFFECT_1].ItemType = 49278;
3956 });
3957
3958 // Ashenvale Outrunner Sneak
3959 // Stealth
3960 ApplySpellFix({ 20540, 32199 }, [](SpellInfo* spellInfo)
3961 {
3962 spellInfo->AuraInterruptFlags |= (AURA_INTERRUPT_FLAG_MELEE_ATTACK | AURA_INTERRUPT_FLAG_CAST);
3963 });
3964
3965 // Arcane Bolt
3966 ApplySpellFix({ 15979 }, [](SpellInfo* spellInfo)
3967 {
3968 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(3); // 20y
3969 });
3970
3971 // Mortal Shots
3972 ApplySpellFix({ 19485, 19487, 19488, 19489, 19490 }, [](SpellInfo* spellInfo)
3973 {
3974 spellInfo->Effects[EFFECT_0].SpellClassMask[0] |= 0x00004000;
3975 spellInfo->Effects[EFFECT_1].Effect = 0;
3976 });
3977
3978 // Item - Death Knight T9 Melee 4P Bonus
3979 // Item - Hunter T9 2P Bonus
3980 // Item - Paladin T9 Retribution 2P Bonus (Righteous Vengeance)
3981 ApplySpellFix({ 67118, 67150, 67188 }, [](SpellInfo* spellInfo)
3982 {
3983 spellInfo->Effects[EFFECT_1].Effect = 0;
3984 });
3985
3986 // Green Beam
3987 ApplySpellFix({31628, 31630, 31631}, [](SpellInfo* spellInfo)
3988 {
3989 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
3990 spellInfo->MaxAffectedTargets = 1;
3991 });
3992
3994 20271, 57774, // Judgement of Light
3995 20425, // Judgement of Command
3996 32220, // Judgement of Blood
3997 53407, // Judgement of Justice
3998 53408, // Judgement of Wisdom
3999 53725 // Judgement of the Martyr
4000 }, [](SpellInfo* spellInfo)
4001 {
4002 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
4003 });
4004
4005 // Chaos Bolt Passive
4006 ApplySpellFix({ 58284 }, [](SpellInfo* spellInfo)
4007 {
4008 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
4009 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST;
4010 spellInfo->Effects[EFFECT_1].BasePoints = 100;
4011 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
4012 spellInfo->Effects[EFFECT_1].MiscValue = 127;
4013 spellInfo->Effects[EFFECT_1].SpellClassMask[1] = 0x00020000;
4014 });
4015
4016 // Nefarian: Shadowbolt, Shadow Command
4017 ApplySpellFix({ 22667, 22677 }, [](SpellInfo* spellInfo)
4018 {
4019 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(152); // 150 yards
4020 });
4021
4022 // Manastorm
4023 ApplySpellFix({ 21097 }, [](SpellInfo* spellInfo)
4024 {
4025 spellInfo->InterruptFlags &= ~SPELL_INTERRUPT_FLAG_INTERRUPT;
4026 });
4027
4028 // Arcane Vacuum
4029 ApplySpellFix({ 21147 }, [](SpellInfo* spellInfo)
4030 {
4031 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(4); // 30 yards
4032 spellInfo->AttributesEx3 |= SPELL_ATTR3_ONLY_ON_PLAYER;
4033 });
4034
4035 // Reflection
4036 ApplySpellFix({ 22067 }, [](SpellInfo* spellInfo)
4037 {
4038 spellInfo->Dispel = DISPEL_NONE;
4039 });
4040
4041 // Focused Assault
4042 // Brutal Assault
4043 ApplySpellFix({ 46392, 46393 }, [](SpellInfo* spellInfo)
4044 {
4045 spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CHANGE_MAP;
4046 });
4047
4048 // Improved Blessing Protection (Nefarian Class Call)
4049 ApplySpellFix({ 23415 }, [](SpellInfo* spellInfo)
4050 {
4051 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_TARGET_ENEMY);
4052 });
4053
4054 // Bestial Wrath
4055 ApplySpellFix({ 19574 }, [](SpellInfo* spellInfo)
4056 {
4057 spellInfo->AttributesEx4 |= SPELL_ATTR4_AURA_EXPIRES_OFFLINE;
4058 });
4059
4060 // Shadowflame
4061 ApplySpellFix({ 22539 }, [](SpellInfo* spellInfo)
4062 {
4063 spellInfo->InterruptFlags &= ~SPELL_INTERRUPT_FLAG_INTERRUPT;
4064 });
4065
4066 // PX-238 Winter Wondervolt
4067 ApplySpellFix({ 26157, 26272, 26273, 26274 }, [](SpellInfo* spellInfo)
4068 {
4069 spellInfo->Mechanic = 0;
4070 });
4071
4072 // Calm Dragonkin
4073 ApplySpellFix({ 19872 }, [](SpellInfo* spellInfo)
4074 {
4075 spellInfo->AttributesEx |= SPELL_ATTR1_EXCLUDE_CASTER;
4076 });
4077
4078 // Cosmetic - Lightning Beam Channel
4079 ApplySpellFix({ 45537 }, [](SpellInfo* spellInfo)
4080 {
4081 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4082 });
4083
4084 // Burning Adrenaline
4085 ApplySpellFix({ 23478 }, [](SpellInfo* spellInfo)
4086 {
4087 spellInfo->Effects[EFFECT_0].BasePoints = 4374;
4088 spellInfo->Effects[EFFECT_0].DieSides = 1250;
4089 });
4090
4091 // Explosion - Razorgore
4092 ApplySpellFix({ 20038 }, [](SpellInfo* spellInfo)
4093 {
4094 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS);
4095 spellInfo->Attributes |= SPELL_ATTR0_NO_IMMUNITIES;
4096 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4097 });
4098
4099 // Brood Power : Bronze
4100 ApplySpellFix({ 22311 }, [](SpellInfo* spellInfo)
4101 {
4102 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
4103 });
4104
4105 // Rapture
4106 ApplySpellFix({ 63652, 63653, 63654, 63655 }, [](SpellInfo* spellInfo)
4107 {
4108 spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT;
4109 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4110 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
4111 });
4112
4113 // Everlasting Affliction
4114 ApplySpellFix({ 47422 }, [](SpellInfo* spellInfo)
4115 {
4116 spellInfo->SchoolMask = SPELL_SCHOOL_MASK_SHADOW;
4117 });
4118
4119 // Flametongue Weapon (Passive) (Rank 6)
4120 ApplySpellFix({ 16312 }, [](SpellInfo* spellInfo)
4121 {
4122 spellInfo->Attributes |= SPELL_ATTR0_PASSIVE;
4123 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21);
4124 });
4125
4126 // Mana Tide Totem
4127 // Cleansing Totem Effect
4128 ApplySpellFix({ 39609, 52025 }, [](SpellInfo* spellInfo)
4129 {
4130 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(5); // 40yd
4131 });
4132
4133 // Increased Totem Radius
4134 ApplySpellFix({ 21895 }, [](SpellInfo* spellInfo)
4135 {
4136 spellInfo->Effects[0].SpellClassMask = flag96(0x0603E000, 0x00200100);
4137 });
4138
4139 // Jokkum Summon
4140 ApplySpellFix({ 56541 }, [](SpellInfo* spellInfo)
4141 {
4142 spellInfo->Effects[EFFECT_0].MiscValueB = 844;
4143 });
4144
4145 // Hakkar Cause Insanity
4146 ApplySpellFix({ 24327 }, [](SpellInfo* spellInfo)
4147 {
4148 spellInfo->Dispel = DISPEL_NONE;
4149 });
4150
4151 // Summon Nightmare Illusions
4152 ApplySpellFix({ 24681, 24728, 24729 }, [](SpellInfo* spellInfo)
4153 {
4154 spellInfo->Effects[EFFECT_0].MiscValueB = 64;
4155 });
4156
4157 // Blood Siphon
4158 ApplySpellFix({ 24322, 24323 }, [](SpellInfo* spellInfo)
4159 {
4160 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_STUN;
4161 spellInfo->Effects[EFFECT_2].Effect = 0;
4162 spellInfo->Attributes |= SPELL_ATTR0_NO_AURA_CANCEL;
4163 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALLOW_ACTION_DURING_CHANNEL;
4164 spellInfo->ChannelInterruptFlags &= ~AURA_INTERRUPT_FLAG_MOVE;
4165 });
4166
4167 // Place Fake Fur
4168 ApplySpellFix({ 46085 }, [](SpellInfo* spellInfo)
4169 {
4170 spellInfo->Effects[EFFECT_0].MiscValue = 8;
4171 });
4172
4173 // Smash Mammoth Trap
4174 ApplySpellFix({ 46201 }, [](SpellInfo* spellInfo)
4175 {
4176 spellInfo->Effects[EFFECT_0].MiscValue = 8;
4177 });
4178
4179 // Elemental Mastery
4180 ApplySpellFix({ 16166 }, [](SpellInfo* spellInfo)
4181 {
4182 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000003, 0x00001000);
4183 });
4184
4185 // Elemental Vulnerability
4186 ApplySpellFix({ 28772 }, [](SpellInfo* spellInfo)
4187 {
4188 spellInfo->Speed = 1;
4189 });
4190
4191 // Find the Ancient Hero: Kill Credit
4192 ApplySpellFix({ 25729 }, [](SpellInfo* spellInfo)
4193 {
4194 spellInfo->Effects[EFFECT_0].TargetA = TARGET_UNIT_SUMMONER;
4195 });
4196
4197 // Artorius Demonic Doom
4198 ApplySpellFix({ 23298 }, [](SpellInfo* spellInfo)
4199 {
4200 spellInfo->AttributesEx4 |= SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS;
4201 spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_CASTER_DAMAGE_MODIFIERS;
4202 });
4203
4204 // Lash
4205 ApplySpellFix({ 25852 }, [](SpellInfo* spellInfo)
4206 {
4207 spellInfo->Effects[EFFECT_1].Effect = 0;
4208 });
4209
4210 // Explosion
4211 ApplySpellFix({ 5255 }, [](SpellInfo* spellInfo)
4212 {
4213 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4214 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
4215 });
4216
4217 // Death's Respite
4218 ApplySpellFix({ 67731, 68305 }, [](SpellInfo* spellInfo)
4219 {
4220 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
4221 });
4222
4223 // Wyvern Sting DoT
4224 ApplySpellFix({ 24131, 24134, 24135 }, [](SpellInfo* spellInfo)
4225 {
4226 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
4227 });
4228
4229 // Feed Pet
4230 ApplySpellFix({ 1539, 51284 }, [](SpellInfo* spellInfo)
4231 {
4232 spellInfo->Attributes |= SPELL_ATTR0_ALLOW_WHILE_SITTING;
4233 });
4234
4235 // Judgement (Paladin T2 8P Bonus)
4236 // Battlegear of Eternal Justice
4237 ApplySpellFix({ 23591, 26135 }, [](SpellInfo* spellInfo)
4238 {
4239 spellInfo->ProcFlags = PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS;
4240 });
4241
4242 // Gift of Arthas
4243 ApplySpellFix({ 11371 }, [](SpellInfo* spellInfo)
4244 {
4245 spellInfo->SpellFamilyName = SPELLFAMILY_POTION;
4246 });
4247
4248 // Refocus (Renataki's charm of beasts)
4249 ApplySpellFix({ 24531 }, [](SpellInfo* spellInfo)
4250 {
4251 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
4252 });
4253
4254 // Collect Rookery Egg
4255 ApplySpellFix({ 15958 }, [](SpellInfo* spellInfo)
4256 {
4257 spellInfo->Effects[EFFECT_1].Effect = 0;
4258 });
4259
4260 // WotLK Prologue Frozen Shade Visual, temp used to restore visual after Dispersion
4261 ApplySpellFix({ 53444 }, [](SpellInfo* spellInfo)
4262 {
4263 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(27);
4264 });
4265
4266 // Rental Racing Ram
4267 ApplySpellFix({ 43883 }, [](SpellInfo* spellInfo)
4268 {
4269 spellInfo->AuraInterruptFlags &= ~AURA_INTERRUPT_FLAG_NOT_ABOVEWATER;
4270 });
4271
4272 // Summon Worm
4273 ApplySpellFix({ 518, 25831, 25832 }, [](SpellInfo* spellInfo)
4274 {
4275 spellInfo->Effects[EFFECT_0].MiscValueB = 64;
4276 });
4277
4278 // Uppercut
4279 ApplySpellFix({ 26007 }, [](SpellInfo* spellInfo)
4280 {
4281 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
4282 });
4283
4284 // Digestive Acid (Temporary)
4285 ApplySpellFix({ 26476 }, [](SpellInfo* spellInfo)
4286 {
4287 spellInfo->Attributes |= SPELL_ATTR0_NO_IMMUNITIES;
4288 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4289 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
4290 });
4291
4292 // Drums of War/Battle/Speed/Restoration
4293 ApplySpellFix({ 35475, 35476, 35477, 35478 }, [](SpellInfo* spellInfo)
4294 {
4295 spellInfo->ExcludeTargetAuraSpell = 51120;
4296 });
4297
4298 // Slap!
4299 ApplySpellFix({ 6754 }, [](SpellInfo* spellInfo)
4300 {
4301 spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT;
4302 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
4303 });
4304
4305 // Summon Cauldron Stuff
4306 ApplySpellFix({ 36549 }, [](SpellInfo* spellInfo)
4307 {
4308 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(28); // 5 seconds
4309 spellInfo->Effects[EFFECT_0].TargetB = TARGET_DEST_CASTER;
4310 });
4311
4312 // Hunter's Mark
4313 ApplySpellFix({ 31615 }, [](SpellInfo* spellInfo)
4314 {
4315 for (uint8 index = EFFECT_0; index <= EFFECT_1; ++index)
4316 {
4317 spellInfo->Effects[index].TargetA = TARGET_UNIT_TARGET_ENEMY;
4318 spellInfo->Effects[index].TargetB = 0;
4319 }
4320 });
4321
4322 // Self Visual - Sleep Until Cancelled(DND)
4323 ApplySpellFix({ 6606, 14915, 16093 }, [](SpellInfo* spellInfo)
4324 {
4325 spellInfo->AuraInterruptFlags &= ~AURA_INTERRUPT_FLAG_NOT_SEATED;
4326 });
4327
4328 // Cleansing Totem, Healing Stream Totem, Mana Tide Totem
4329 ApplySpellFix({ 8171,52025, 52041, 52042, 52046, 52047, 52048, 52049, 52050, 58759, 58760, 58761, 39610, 39609 }, [](SpellInfo* spellInfo)
4330 {
4331 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4332 });
4333 // Game In Session
4334 ApplySpellFix({ 39331 }, [](SpellInfo* spellInfo)
4335 {
4336 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AURA;
4337 spellInfo->Attributes |= SPELL_ATTR0_NO_AURA_CANCEL;
4338 spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CHANGE_MAP;
4339 });
4340 // Death Ray Warning Visual, Death Ray Damage Visual
4341 ApplySpellFix({ 63882, 63886 }, [](SpellInfo* spellInfo)
4342 {
4343 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALLOW_ACTION_DURING_CHANNEL;
4344 });
4345
4346 // Buffeting Winds of Susurrus
4347 ApplySpellFix({ 32474 }, [](SpellInfo* spellInfo)
4348 {
4349 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(556); // 28 seconds
4350 });
4351
4352 // Quest - Healing Salve
4353 ApplySpellFix({ 29314 }, [](SpellInfo* spellInfo)
4354 {
4355 spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(1); // 0s
4356 });
4357
4358 // Seed of Corruption
4359 ApplySpellFix({ 27285, 47833, 47834 }, [](SpellInfo* spellInfo)
4360 {
4361 spellInfo->AttributesEx |= SPELL_ATTR1_NO_REFLECTION;
4362 });
4363
4364 // Turn the Tables
4365 ApplySpellFix({ 51627, 51628, 51629 }, [](SpellInfo* spellInfo)
4366 {
4367 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
4368 });
4369
4370 // Silence
4371 ApplySpellFix({ 18278 }, [](SpellInfo* spellInfo)
4372 {
4373 spellInfo->AttributesEx4 |= SPELL_ATTR4_NOT_IN_ARENA_OR_RATED_BATTLEGROUND;
4374 });
4375
4376 // Honor Among Thieves - allow area aura from different casters to coexist
4377 ApplySpellFix({ 51698, 51700, 51701 }, [](SpellInfo* spellInfo)
4378 {
4379 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
4380 });
4381
4382 // Absorb Life
4383 ApplySpellFix({ 34239 }, [](SpellInfo* spellInfo)
4384 {
4385 spellInfo->Effects[EFFECT_0].ValueMultiplier = 1;
4386 });
4387
4388 // Summon a Warp Rift in Void Ridge
4389 ApplySpellFix({ 35036 }, [](SpellInfo* spellInfo)
4390 {
4391 spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(1); // 0s
4392 });
4393
4394 // Hit Rating (Dungeon T3 - 2P Bonus - Wastewalker, Doomplate)
4395 ApplySpellFix({ 37608, 37610 }, [](SpellInfo* spellInfo)
4396 {
4397 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(0);
4398 spellInfo->Effects[EFFECT_0].MiscValue = 224;
4399 });
4400
4401 // Target Fissures
4402 ApplySpellFix({ 30745 }, [](SpellInfo* spellInfo)
4403 {
4404 spellInfo->MaxAffectedTargets = 1;
4405 });
4406
4407 // Acid Spit
4408 ApplySpellFix({ 34290 }, [](SpellInfo* spellInfo)
4409 {
4410 spellInfo->MaxAffectedTargets = 1;
4411 });
4412
4413 // Mulgore Hatchling (periodic)
4414 ApplySpellFix({ 62586 }, [](SpellInfo* spellInfo)
4415 {
4416 spellInfo->Effects[EFFECT_0].TriggerSpell = 62585; // Mulgore Hatchling (fear)
4417 });
4418
4419 // Poultryized!
4420 ApplySpellFix({ 30504 }, [](SpellInfo* spellInfo)
4421 {
4422 spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_TAKE_DAMAGE;
4423 });
4424
4425 // Torment of the Worgen
4426 ApplySpellFix({ 30567 }, [](SpellInfo* spellInfo)
4427 {
4428 spellInfo->ProcChance = 3;
4429 });
4430
4431 // Summon Water Elementals
4432 ApplySpellFix({ 29962, 37051, 37052, 37053 }, [](SpellInfo* spellInfo)
4433 {
4434 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd
4435 });
4436
4437 // Instill Lord Valthalak's Spirit DND
4438 ApplySpellFix({ 27360 }, [](SpellInfo* spellInfo)
4439 {
4440 spellInfo->ChannelInterruptFlags |= AURA_INTERRUPT_FLAG_MOVE;
4441 });
4442
4443 // Holiday - Midsummer, Ribbon Pole Periodic Visual
4444 ApplySpellFix({ 45406 }, [](SpellInfo* spellInfo)
4445 {
4446 spellInfo->AuraInterruptFlags |= ( AURA_INTERRUPT_FLAG_MOUNT | AURA_INTERRUPT_FLAG_CAST | AURA_INTERRUPT_FLAG_TALK );
4447 });
4448
4449 // Improved Mind Flay and Smite
4450 ApplySpellFix({ 37571 }, [](SpellInfo* spellInfo)
4451 {
4452 spellInfo->Effects[EFFECT_0].SpellClassMask[0] = 8388736;
4453 });
4454
4455 // Improved Corruption and Immolate (Updated)
4456 ApplySpellFix({ 61992 }, [](SpellInfo* spellInfo)
4457 {
4458 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
4459 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_ADD_PCT_MODIFIER;
4460 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
4461 spellInfo->Effects[EFFECT_1].BasePoints = 4;
4462 spellInfo->Effects[EFFECT_1].DieSides = 1;
4463 spellInfo->Effects[EFFECT_1].MiscValue = 22;
4464 spellInfo->Effects[EFFECT_1].SpellClassMask[0] = 6;
4465 });
4466
4467 // 46747 Fling torch
4468 ApplySpellFix({ 46747 }, [](SpellInfo* spellInfo)
4469 {
4470 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER);
4471 });
4472
4473 // Chains of Naberius
4474 ApplySpellFix({ 36146 }, [](SpellInfo* spellInfo)
4475 {
4476 spellInfo->MaxAffectedTargets = 1;
4477 });
4478
4479 // Force of Neltharaku
4480 ApplySpellFix({ 38762 }, [](SpellInfo* spellInfo)
4481 {
4482 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
4483 });
4484
4485 // Spotlight
4486 ApplySpellFix({ 29683, 32214 }, [](SpellInfo* spellInfo)
4487 {
4488 spellInfo->AttributesEx5 |= SPELL_ATTR5_DO_NOT_DISPLAY_DURATION;
4489 });
4490
4491 // Haunted
4492 ApplySpellFix({ 53768 }, [](SpellInfo* spellInfo)
4493 {
4494 spellInfo->Attributes |= SPELL_ATTR0_NO_AURA_CANCEL;
4495 });
4496
4497 // Tidal Wave
4498 ApplySpellFix({ 37730 }, [](SpellInfo* spellInfo)
4499 {
4500 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4501 });
4502
4503 // Commanding Shout
4504 ApplySpellFix({ 469, 47439, 47440 }, [](SpellInfo* spellInfo)
4505 {
4506 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4507 });
4508
4509 // Battle Shout
4510 ApplySpellFix({ 2048, 5242, 6192, 6673, 11549, 11550, 11551, 25289, 47436 }, [](SpellInfo* spellInfo)
4511 {
4512 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4513 });
4514
4515 // Plague Effect
4516 ApplySpellFix({ 19594, 26557 }, [](SpellInfo* spellInfo)
4517 {
4518 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4519 });
4520
4521 // Prayer of Fortitude
4522 ApplySpellFix({ 21562, 21564, 25392, 48162 }, [](SpellInfo* spellInfo)
4523 {
4524 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4525 });
4526
4527 // Gift of the Wild
4528 ApplySpellFix({ 21849, 21850, 26991, 48470, 69381 }, [](SpellInfo* spellInfo)
4529 {
4530 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4531 });
4532
4533 // Arcane Brilliance
4534 ApplySpellFix({ 23028, 27127, 43002 }, [](SpellInfo* spellInfo)
4535 {
4536 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4537 });
4538
4539 // Prayer of Spirit
4540 ApplySpellFix({ 27681, 32999, 48074 }, [](SpellInfo* spellInfo)
4541 {
4542 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4543 });
4544
4545 // Prayer of Shadow Protection
4546 ApplySpellFix({ 27683, 39374, 48170 }, [](SpellInfo* spellInfo)
4547 {
4548 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4549 });
4550
4551 // Nagrand Fort Buff Reward Raid
4552 ApplySpellFix({ 33006 }, [](SpellInfo* spellInfo)
4553 {
4554 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4555 });
4556
4557 // Ancestral Awakening
4558 ApplySpellFix({ 52759 }, [](SpellInfo* spellInfo)
4559 {
4560 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4561 });
4562
4563 // Turn the Tables
4564 ApplySpellFix({ 52910, 52914, 52915 }, [](SpellInfo* spellInfo)
4565 {
4566 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4567 });
4568
4569 // Judgements of the Wise
4570 ApplySpellFix({ 54180 }, [](SpellInfo* spellInfo)
4571 {
4572 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4573 });
4574
4575 // Replenishment
4576 ApplySpellFix({ 57669 }, [](SpellInfo* spellInfo)
4577 {
4578 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4579 });
4580
4581 // Dalaran Brilliance
4582 ApplySpellFix({ 61316 }, [](SpellInfo* spellInfo)
4583 {
4584 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4585 });
4586
4587 // [DND] Dalaran Brilliance
4588 ApplySpellFix({ 61332 }, [](SpellInfo* spellInfo)
4589 {
4590 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4591 });
4592
4593 // Infinite Replenishment + Wisdom
4594 ApplySpellFix({ 61782 }, [](SpellInfo* spellInfo)
4595 {
4596 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4597 });
4598
4599 // Renewed Hope
4600 ApplySpellFix({ 63944 }, [](SpellInfo* spellInfo)
4601 {
4602 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4603 });
4604
4605 // Fortitude
4606 ApplySpellFix({ 69377 }, [](SpellInfo* spellInfo)
4607 {
4608 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4609 });
4610
4611 // Blessing of Forgotten Kings
4612 ApplySpellFix({ 69378 }, [](SpellInfo* spellInfo)
4613 {
4614 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4615 });
4616
4617 // Lucky Charm
4618 ApplySpellFix({ 69511 }, [](SpellInfo* spellInfo)
4619 {
4620 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4621 });
4622
4623 // Shiny Shard of the Scale Heal Targeter
4624 ApplySpellFix({ 69749 }, [](SpellInfo* spellInfo)
4625 {
4626 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4627 });
4628
4629 // Purified Shard of the Scale Heal Targeter
4630 ApplySpellFix({ 69754 }, [](SpellInfo* spellInfo)
4631 {
4632 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4633 });
4634
4635 // Brilliance
4636 ApplySpellFix({ 69994 }, [](SpellInfo* spellInfo)
4637 {
4638 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4639 });
4640
4641 // Domination
4642 ApplySpellFix({ 37135 }, [](SpellInfo* spellInfo)
4643 {
4644 spellInfo->MaxAffectedTargets = 5;
4645 });
4646
4647 // Presence Of Mind
4648 ApplySpellFix({ 12043 }, [](SpellInfo* spellInfo)
4649 {
4650 // It should not share cooldown mods with category[1151] spells (Arcane Power [12042], Decimate [47271])
4651 spellInfo->AttributesEx6 |= SPELL_ATTR6_NO_CATEGORY_COOLDOWN_MODS;
4652 });
4653
4654 // Eye of Grillok
4655 ApplySpellFix({ 38495 }, [](SpellInfo* spellInfo)
4656 {
4657 spellInfo->Effects[EFFECT_0].TriggerSpell = 38530; // Quest Credit for Eye of Grillok
4658 });
4659
4660 // Greater Fireball
4661 ApplySpellFix({ 33051 }, [](SpellInfo* spellInfo)
4662 {
4663 spellInfo->AttributesEx4 |= SPELL_ATTR4_NO_CAST_LOG;
4664 });
4665
4666 // Gor'drek's Ointment
4667 ApplySpellFix({ 32578 }, [](SpellInfo* spellInfo)
4668 {
4669 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
4670 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_TARGET_PROCS;
4671 });
4672
4673 // Shadow Grasp
4674 ApplySpellFix({ 30410 }, [](SpellInfo* spellInfo)
4675 {
4676 spellInfo->AttributesEx6 |= SPELL_ATTR6_NO_PUSHBACK;
4677 });
4678
4680 471, // Palamino
4681 8980, // Skeletal Horse
4682 10788, // Leopard
4683 10790, // Tiger
4684 10792, // Spotted Panther
4685 60136, // Grand Caravan Mammoth
4686 60140 // Grand Caravan Mammoth
4687 }, [](SpellInfo* spellInfo)
4688 {
4689 spellInfo->AuraInterruptFlags &= ~AURA_INTERRUPT_FLAG_NOT_ABOVEWATER;
4690 });
4691
4692 // Molten Punch
4693 ApplySpellFix({ 40126 }, [](SpellInfo* spellInfo)
4694 {
4695 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_DEST_CASTER);
4696 });
4697
4698 // Wing Buffet
4699 ApplySpellFix({ 37319 }, [](SpellInfo* spellInfo)
4700 {
4701 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CONE_ENEMY_24);
4702 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(0);
4703 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS);
4704 });
4705
4706 // Flame Wave
4707 ApplySpellFix({ 33800 }, [](SpellInfo* spellInfo)
4708 {
4709 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
4710 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_PERIODIC_TRIGGER_SPELL;
4711 spellInfo->Effects[EFFECT_1].Amplitude = 500;
4712 });
4713
4714 // Chromatic Resistance Aura
4715 ApplySpellFix({ 41453 }, [](SpellInfo* spellInfo)
4716 {
4717 spellInfo->Effects[EFFECT_0].MiscValue = 124;
4718 });
4719
4720 // Power of the Guardian
4721 ApplySpellFix({ 28142, 28143, 28144, 28145 }, [](SpellInfo* spellInfo)
4722 {
4723 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD;
4724 });
4725
4726 // Warrior stances passives
4728 2457, // Battle Stance
4729 2458, // Berserker Stance
4730 7376 // Defensive Stance Passive
4731 }, [](SpellInfo* spellInfo)
4732 {
4733 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
4734 });
4735
4737 698, // Ritual of Summoning (portal for clicking)
4738 61993 // Ritual of Summoning (summons the closet)
4739 }, [](SpellInfo* spellInfo)
4740 {
4741 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS);
4742 });
4743
4744 // Paralyze
4745 ApplySpellFix({ 41083 }, [](SpellInfo* spellInfo)
4746 {
4747 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALLOW_ACTION_DURING_CHANNEL;
4748 });
4749
4750 // Fatal Attraction
4751 ApplySpellFix({ 40869 }, [](SpellInfo* spellInfo)
4752 {
4753 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_DEST_CASTER); // target set by script
4754 });
4755
4756 // Fatal Attraction
4757 ApplySpellFix({ 40870 }, [](SpellInfo* spellInfo)
4758 {
4759 spellInfo->MaxAffectedTargets = 1;
4760 });
4761
4762 // Removing Dragonflayer Harpoon
4763 ApplySpellFix({ 42968 }, [](SpellInfo* spellInfo)
4764 {
4765 spellInfo->MaxAffectedTargets = 1;
4766 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(7);
4767 });
4768
4769 // Siphon Life (heal)
4770 ApplySpellFix({ 63106 }, [](SpellInfo* spellInfo)
4771 {
4772 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
4773 });
4774
4775 // Fury
4776 ApplySpellFix({ 40601 }, [](SpellInfo* spellInfo)
4777 {
4778 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
4779 });
4780
4781 // Claw Rage
4782 ApplySpellFix({ 43149 }, [](SpellInfo* spellInfo)
4783 {
4784 spellInfo->Effects[EFFECT_0].TriggerSpell = 0;
4785 });
4786
4787 // Black Qiraji Battle Tank
4788 ApplySpellFix({ 26655, 26656 }, [](SpellInfo* spellInfo)
4789 {
4790 spellInfo->AuraInterruptFlags &= ~(AURA_INTERRUPT_FLAG_CHANGE_MAP | AURA_INTERRUPT_FLAG_TELEPORTED);
4791 });
4792
4793 // Summon Cyclone
4794 ApplySpellFix({ 43112 }, [](SpellInfo* spellInfo)
4795 {
4796 spellInfo->RequiresSpellFocus = 0;
4797 });
4798
4799 // Booming Voice
4800 ApplySpellFix({ 40080 }, [](SpellInfo* spellInfo)
4801 {
4802 spellInfo->Effects[EFFECT_0].RealPointsPerLevel = 0;
4803 });
4804
4805 // Mangle (Nalorakk)
4806 ApplySpellFix({ 42389 }, [](SpellInfo* spellInfo)
4807 {
4808 spellInfo->SchoolMask = SPELL_SCHOOL_MASK_NATURE;
4809 });
4810
4811 // Event food, fixes to give correct stamina and spirit of 25% of the character level
4812 ApplySpellFix({ 24870 }, [](SpellInfo* spellInfo)
4813 {
4814 spellInfo->Effects[EFFECT_1].BasePoints = 0;
4815 spellInfo->Effects[EFFECT_0].RealPointsPerLevel = 0.25;
4816 spellInfo->Effects[EFFECT_1].RealPointsPerLevel = 0.25;
4817 });
4818
4819 // Smash
4820 // Dark Smash
4821 ApplySpellFix({ 42669, 59706, 42723, 59709 }, [](SpellInfo* spellInfo)
4822 {
4823 spellInfo->AttributesEx2 &= ~SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4824 });
4825
4826 // Swoop (Moth hunter pet) root effect fix
4827 ApplySpellFix({ 52825 }, [](SpellInfo* spellInfo)
4828 {
4829 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
4830 });
4831
4832 // Felmyst Strafe (Top)
4833 ApplySpellFix({ 45585 }, [](SpellInfo* spellInfo)
4834 {
4835 spellInfo->MaxAffectedTargets = 3;
4836 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_70_YARDS);
4837 });
4838
4839 // Felmyst Strafe (Middle, Bottom)
4840 ApplySpellFix({ 45633, 45635 }, [](SpellInfo* spellInfo)
4841 {
4842 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_70_YARDS);
4843 });
4844
4845 // Torch (Death Knights near the Chapel)
4846 ApplySpellFix({ 52953 }, [](SpellInfo* spellInfo)
4847 {
4848 spellInfo->MaxAffectedTargets = 1;
4849 });
4850
4851 // Missile Barrage
4852 ApplySpellFix({ 44401 }, [](SpellInfo* spellInfo)
4853 {
4854 spellInfo->ProcCharges = 1;
4855 spellInfo->SpellPriority = 100;
4856 });
4857
4858 // Item - Mage T8 4P Bonus
4859 ApplySpellFix({ 64869 }, [](SpellInfo* spellInfo)
4860 {
4861 // DBC amount is 10, but the chance to not consume Missile Barrage,
4862 // Hot Streak or Brain Freeze is 20% according to the available sources
4863 spellInfo->Effects[EFFECT_0].BasePoints = 20;
4864 spellInfo->Effects[EFFECT_0].DieSides = 0;
4865 });
4866
4867 // Auto Shot
4868 ApplySpellFix({ 75 }, [](SpellInfo* spellInfo)
4869 {
4870 spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(1); // 0s
4871 spellInfo->InterruptFlags &= ~SPELL_INTERRUPT_UNK;
4872 });
4873
4874 // Explosive Sheep
4875 ApplySpellFix({ 4074 }, [](SpellInfo* spellInfo)
4876 {
4877 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(25);
4878 });
4879
4880 // Phase Shift
4881 ApplySpellFix({ 4511 }, [](SpellInfo* spellInfo)
4882 {
4883 spellInfo->AuraInterruptFlags &= ~AURA_INTERRUPT_FLAG_MELEE_ATTACK;
4884 spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CAST;
4885 });
4886
4887 // Charge Stun
4888 ApplySpellFix({ 7922 }, [](SpellInfo* spellInfo)
4889 {
4890 spellInfo->Attributes |= SPELL_ATTR0_NO_ACTIVE_DEFENSE;
4891 });
4892
4893 // Tharnariun's Heal
4894 ApplySpellFix({ 9457 }, [](SpellInfo* spellInfo)
4895 {
4896 spellInfo->AttributesEx2 &= ~SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
4897 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_AND_TARGET_RESTRICTIONS;
4898 spellInfo->Effects[EFFECT_0].DieSides = 0;
4899 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
4900 });
4901
4902 // Supercharge
4903 ApplySpellFix({ 10732 }, [](SpellInfo* spellInfo)
4904 {
4905 spellInfo->CategoryEntry = sSpellCategoryStore.LookupEntry(0);
4906 spellInfo->Attributes &= ~(SPELL_ATTR0_IS_ABILITY | SPELL_ATTR0_DO_NOT_SHEATH);
4907 spellInfo->Attributes |= SPELL_ATTR0_NOT_SHAPESHIFTED;
4908 spellInfo->AttributesEx |= SPELL_ATTR1_TRACK_TARGET_IN_CHANNEL;
4909 spellInfo->AttributesEx2 |= SPELL_ATTR2_NO_TARGET_PER_SECOND_COST;
4910 spellInfo->AttributesEx3 |= SPELL_ATTR3_CAN_PROC_FROM_PROCS;
4911 spellInfo->FacingCasterFlags |= SPELL_FACING_FLAG_INFRONT;
4912 spellInfo->InterruptFlags |= (SPELL_INTERRUPT_FLAG_MOVEMENT | SPELL_INTERRUPT_FLAG_PUSH_BACK |
4914 spellInfo->ChannelInterruptFlags &= ~AURA_INTERRUPT_FLAG_JUMP;
4915 spellInfo->ChannelInterruptFlags |= AURA_INTERRUPT_FLAG_UNK14;
4916 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY);
4917 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY);
4918 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY);
4919 spellInfo->Effects[EFFECT_0].Amplitude = 3000;
4920 spellInfo->Effects[EFFECT_1].Amplitude = 3000;
4921 spellInfo->Effects[EFFECT_2].Amplitude = 3000;
4922 spellInfo->SpellVisual[0] = 12656;
4923 });
4924
4925 // Intercept
4926 ApplySpellFix({ 20252 }, [](SpellInfo* spellInfo)
4927 {
4929 spellInfo->Attributes |= SPELL_ATTR0_ALLOW_ITEM_SPELL_IN_PVP;
4930 });
4931
4932 // Intercept
4933 ApplySpellFix({ 20253 }, [](SpellInfo* spellInfo)
4934 {
4936 spellInfo->Attributes |= SPELL_ATTR0_ALLOW_ITEM_SPELL_IN_PVP;
4937 spellInfo->AttributesEx7 |= (SPELL_ATTR7_NO_ATTACK_DODGE | SPELL_ATTR7_NO_ATTACK_PARRY);
4938 spellInfo->SpellLevel = 0;
4939 });
4940
4941 // Heart of the Crusader
4942 ApplySpellFix({ 20335, 20336, 20337 }, [](SpellInfo* spellInfo)
4943 {
4944 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
4945 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
4946 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_DUMMY;
4947 });
4948
4949 // Heart of the Crusader (Rank 1)
4950 ApplySpellFix({ 20335 }, [](SpellInfo* spellInfo)
4951 {
4952 spellInfo->Effects[EFFECT_1].TriggerSpell = 21183; // Heart of the Crusader (Rank 1)
4953 });
4954
4955 // Heart of the Crusader (Rank 2)
4956 ApplySpellFix({ 20336 }, [](SpellInfo* spellInfo)
4957 {
4958 spellInfo->Effects[EFFECT_1].TriggerSpell = 54498; // Heart of the Crusader (Rank 2)
4959 });
4960
4961 // Heart of the Crusader (Rank 3)
4962 ApplySpellFix({ 20337 }, [](SpellInfo* spellInfo)
4963 {
4964 spellInfo->Effects[EFFECT_1].TriggerSpell = 54499; // Heart of the Crusader (Rank 3)
4965 });
4966
4967 // Gordok Ogre Suit
4968 ApplySpellFix({ 22736 }, [](SpellInfo* spellInfo)
4969 {
4970 spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_MOUNT;
4971 });
4972
4973 // Soul Flame
4974 ApplySpellFix({ 23272 }, [](SpellInfo* spellInfo)
4975 {
4976 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
4977 });
4978
4979 // Tree Disguise
4980 ApplySpellFix({ 30298 }, [](SpellInfo* spellInfo)
4981 {
4982 spellInfo->InterruptFlags |= (SPELL_INTERRUPT_FLAG_MOVEMENT | SPELL_INTERRUPT_FLAG_PUSH_BACK |
4984 spellInfo->Effects[EFFECT_2].ApplyAuraName = SPELL_AURA_MOD_STUN;
4985 });
4986
4987 // Internal Shake Camera w/ rumble sound
4988 ApplySpellFix({ 33271 }, [](SpellInfo* spellInfo)
4989 {
4990 spellInfo->Attributes |= SPELL_ATTR0_ALLOW_WHILE_MOUNTED;
4991 });
4992
4993 // Glaive
4994 ApplySpellFix({ 36500 }, [](SpellInfo* spellInfo)
4995 {
4996 spellInfo->Attributes &= ~SPELL_ATTR0_SCALES_WITH_CREATURE_LEVEL;
4997 spellInfo->Effects[EFFECT_0].DieSides = 68;
4998 spellInfo->Effects[EFFECT_0].BasePoints = 201;
4999 });
5000
5001 // Create Anchorite Relic
5002 ApplySpellFix({ 39183 }, [](SpellInfo* spellInfo)
5003 {
5004 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(0);
5005 });
5006
5007 // Charge Rifts
5008 ApplySpellFix({ 47747 }, [](SpellInfo* spellInfo)
5009 {
5010 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_45_YARDS);
5011 });
5012
5013 // New Summon Test
5014 ApplySpellFix({ 49214 }, [](SpellInfo* spellInfo)
5015 {
5016 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(3);
5017 });
5018
5019 // Plague Strike
5020 ApplySpellFix({ 54469 }, [](SpellInfo* spellInfo)
5021 {
5022 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS);
5023 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS);
5024 spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS);
5025 });
5026
5027 // Glyph of Chains of Ice:
5028 ApplySpellFix({ 58620 }, [](SpellInfo* spellInfo)
5029 {
5030 spellInfo->SpellLevel = 0;
5031 });
5032
5033 // Exit Portal
5034 ApplySpellFix({ 60474 }, [](SpellInfo* spellInfo)
5035 {
5036 spellInfo->AttributesEx6 |= SPELL_ATTR6_ALLOW_WHILE_RIDING_VEHICLE;
5037 });
5038
5039 // Eye of Acherus Flight (Boost)
5040 ApplySpellFix({ 51923 }, [](SpellInfo* spellInfo)
5041 {
5042 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
5043 });
5044
5045 // Shattering Throw
5046 ApplySpellFix({ 64382 }, [](SpellInfo* spellInfo)
5047 {
5049 spellInfo->Attributes |= SPELL_ATTR0_ALLOW_ITEM_SPELL_IN_PVP;
5050 });
5051
5053 43444, // Explosive Trap (Hex Lord Malacrass)
5054 43447, // Freezing Trap (Hex Lord Malacrass)
5055 43449, // Snake Trap (Hex Lord Malacrass)
5056 }, [](SpellInfo* spellInfo)
5057 {
5058 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_SUMMON_OBJECT_SLOT1;
5059 });
5060
5061 // Arcane Missiles
5062 ApplySpellFix({ 58529, 61592 }, [](SpellInfo* spellInfo)
5063 {
5064 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
5065 });
5066
5067 // Siphon Bloodgem
5068 ApplySpellFix({ 34367 }, [](SpellInfo* spellInfo)
5069 {
5070 spellInfo->ChannelInterruptFlags &= ~AURA_INTERRUPT_FLAG_TURNING;
5071 });
5072
5073 // Summon Scourged Captive
5074 ApplySpellFix({ 51597 }, [](SpellInfo* spellInfo)
5075 {
5076 spellInfo->Effects[EFFECT_0].BasePoints = 1;
5077 spellInfo->Effects[EFFECT_0].DieSides = 0;
5078 });
5079
5080 // The Green Tower
5081 ApplySpellFix({ 18097 }, [](SpellInfo* spellInfo)
5082 {
5083 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21); // -1
5084 });
5085
5087 28032, // Zap Crystal
5088 28056, // Zap Crystal Corpse
5089 }, [](SpellInfo* spellInfo)
5090 {
5091 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
5092 });
5093
5094 // Earth Shield
5095 ApplySpellFix({ 55599, 58981 }, [](SpellInfo* spellInfo)
5096 {
5097 spellInfo->AttributesEx5 |= SPELL_ATTR5_LIMIT_N;
5098 });
5099
5100 // Acid Splash
5101 ApplySpellFix({ 52446, 59363 }, [](SpellInfo* spellInfo)
5102 {
5103 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
5104 });
5105
5106 // King Mrlg-Mrgl's Spare Suit
5107 ApplySpellFix({ 45278 }, [](SpellInfo* spellInfo)
5108 {
5109 spellInfo->ProcCharges = 1;
5110 });
5111
5113 56917, // To Icecrown Airship - Teleport to Airship (A)
5114 57417, // To Icecrown Airship - Teleport to Airship (H)
5115 }, [](SpellInfo* spellInfo)
5116 {
5117 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100 yards
5118 });
5119
5121 60586, // Mighty Spear Thrust
5122 60776, // Claw Swipe
5123 60881, // Fatal Strike
5124 60864, // Jaws of Death
5125 }, [](SpellInfo* spellInfo)
5126 {
5127 spellInfo->AttributesEx4 |= SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS;
5128 });
5129
5130 // The Brothers Bronzebeard
5132 56675, // Summon Brann Bronzebeard
5133 56676, // Summon Yorg Stormheart
5134 56697, // Summon Magni Bronzebeard
5135 }, [](SpellInfo* spellInfo)
5136 {
5137 spellInfo->Effects[EFFECT_0].MiscValueB = 64;
5138 });
5139
5141 57374, // Shadow Bolt (Lady Blaumeux 10m)
5142 57464, // Shadow Bolt (Lady Blaumeux 25m)
5143 57376, // Holy Bolt (Sir Zeliek 10m)
5144 57465, // Holy Bolt (Sir Zeliek 25m)
5145 }, [](SpellInfo* spellInfo)
5146 {
5147 spellInfo->InterruptFlags &= ~SPELL_INTERRUPT_FLAG_INTERRUPT;
5148 });
5149
5150 // Twilight Torment
5151 ApplySpellFix({ 57935, 58835 }, [](SpellInfo* spellInfo)
5152 {
5153 spellInfo->ProcCharges = 0;
5154 });
5155
5156 // 54933 Hyldnir Harpoon
5157 ApplySpellFix({ 54933 }, [](SpellInfo* spellInfo)
5158 {
5159 spellInfo->Effects[EFFECT_0].BasePoints = 1;
5160 });
5161
5163 42292, // PvP Trinket
5164 59752, // Every Man for Himself
5165 19574, // Bestial Wrath
5166 34471 // The Beast Within
5167 }, [](SpellInfo* spellInfo)
5168 {
5169 spellInfo->AttributesEx2 |= SPELL_ATTR2_NO_SCHOOL_IMMUNITIES;
5170 });
5171
5172 // 51036 Summon Venture Co. Air Patrol
5173 ApplySpellFix({ 51036 }, [](SpellInfo* spellInfo)
5174 {
5175 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER);
5176 });
5177
5178 // 68415 Corrupted Rage
5179 ApplySpellFix({ 68415 }, [](SpellInfo* spellInfo)
5180 {
5181 spellInfo->Effects[EFFECT_1].SpellClassMask = flag96(0, 0x20000, 0);
5182 });
5183
5184 // 31930 Judgements of the Wise
5185 ApplySpellFix({ 31930 }, [](SpellInfo* spellInfo)
5186 {
5187 spellInfo->SpellFamilyName = SPELLFAMILY_PALADIN;
5188 spellInfo->SpellFamilyFlags = flag96(0x200, 0, 0);
5189 });
5190
5191 // 64646 Corrupted Wisdom
5192 ApplySpellFix({ 64646 }, [](SpellInfo* spellInfo)
5193 {
5194 spellInfo->Effects[EFFECT_1].SpellClassMask = flag96(0x200, 0, 0);
5195 });
5196
5197 // Shadowhorn Charge (Rank 1)
5198 ApplySpellFix({ 6921 }, [](SpellInfo* spellInfo)
5199 {
5200 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
5201 });
5202
5203 // Drag Mine Cart
5204 ApplySpellFix({ 52414 }, [](SpellInfo* spellInfo)
5205 {
5206 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
5207 });
5208
5209 // Boulder Assault (Sorlof's Booty)
5210 ApplySpellFix({ 44966 }, [](SpellInfo* spellInfo)
5211 {
5212 spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT;
5213 });
5214
5215 // Cannon Assault (Sorlof's Booty)
5216 ApplySpellFix({ 45008 }, [](SpellInfo* spellInfo)
5217 {
5218 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
5219 });
5220
5221 // Heroic Strike
5223 45026,
5224 29426
5225 }, [](SpellInfo* spellInfo)
5226 {
5227 spellInfo->SpellLevel = 10;
5228 });
5229
5230 // Diminish Power
5231 ApplySpellFix({ 64145 }, [](SpellInfo* spellInfo)
5232 {
5233 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
5234 });
5235
5236 // Oil of Immolation
5237 ApplySpellFix({ 11350 }, [](SpellInfo* spellInfo)
5238 {
5239 spellInfo->SpellFamilyName = SPELLFAMILY_POTION;
5240 spellInfo->CategoryEntry = sSpellCategoryStore.LookupEntry(79);
5241 });
5242
5243 for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
5244 {
5245 SpellInfo* spellInfo = mSpellInfoMap[i];
5246 if (!spellInfo)
5247 {
5248 continue;
5249 }
5250
5251 for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
5252 {
5253 switch (spellInfo->Effects[j].Effect)
5254 {
5257 case SPELL_EFFECT_JUMP:
5260 if (!spellInfo->Speed && !spellInfo->SpellFamilyName)
5261 {
5262 spellInfo->Speed = SPEED_CHARGE;
5263 }
5264 break;
5265 }
5266
5267 // Xinef: i hope this will fix the problem with not working resurrection
5268 if (spellInfo->Effects[j].Effect == SPELL_EFFECT_SELF_RESURRECT)
5269 {
5270 spellInfo->Effects[j].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
5271 }
5272 }
5273
5274 // Fix range for trajectory triggered spell
5275 for (SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
5276 {
5277 if (spellEffectInfo.IsEffect() && (spellEffectInfo.TargetA.GetTarget() == TARGET_DEST_TRAJ || spellEffectInfo.TargetB.GetTarget() == TARGET_DEST_TRAJ))
5278 {
5279 // Get triggered spell if any
5280 if (SpellInfo* spellInfoTrigger = const_cast<SpellInfo*>(GetSpellInfo(spellEffectInfo.TriggerSpell)))
5281 {
5282 float maxRangeMain = spellInfo->RangeEntry ? spellInfo->RangeEntry->RangeMax[0] : 0.0f;
5283 float maxRangeTrigger = spellInfoTrigger->RangeEntry ? spellInfoTrigger->RangeEntry->RangeMax[0] : 0.0f;
5284
5285 // check if triggered spell has enough max range to cover trajectory
5286 if (maxRangeTrigger < maxRangeMain)
5287 spellInfoTrigger->RangeEntry = spellInfo->RangeEntry;
5288 }
5289 }
5290 }
5291
5292 if (spellInfo->ActiveIconID == 2158) // flight
5293 {
5294 spellInfo->Attributes |= SPELL_ATTR0_PASSIVE;
5295 }
5296
5297 switch (spellInfo->SpellFamilyName)
5298 {
5300 // Seals of the Pure should affect Seal of Righteousness
5301 if (spellInfo->SpellIconID == 25 && (spellInfo->Attributes & SPELL_ATTR0_PASSIVE))
5302 spellInfo->Effects[EFFECT_0].SpellClassMask[1] |= 0x20000000;
5303 break;
5305 // Icy Touch - extend FamilyFlags (unused value) for Sigil of the Frozen Conscience to use
5306 if (spellInfo->SpellIconID == 2721 && spellInfo->SpellFamilyFlags[0] & 0x2)
5307 spellInfo->SpellFamilyFlags[0] |= 0x40;
5308 break;
5309 case SPELLFAMILY_HUNTER:
5310 // Aimed Shot not affected by category cooldown modifiers
5311 if (spellInfo->SpellFamilyFlags[0] & 0x00020000)
5312 {
5314 spellInfo->RecoveryTime = 10 * IN_MILLISECONDS;
5315 }
5316 break;
5317 }
5318
5319 // Recklessness/Shield Wall/Retaliation
5320 if (spellInfo->CategoryEntry == sSpellCategoryStore.LookupEntry(132) && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR)
5321 {
5323 }
5324 }
5325
5326 // Xinef: The Veiled Sea area in outlands (Draenei zone), client blocks casting flying mounts
5327 for (uint32 i = 0; i < sAreaTableStore.GetNumRows(); ++i)
5328 if (AreaTableEntry* areaEntry = const_cast<AreaTableEntry*>(sAreaTableStore.LookupEntry(i)))
5329 {
5330 if (areaEntry->ID == 3479)
5331 areaEntry->flags |= AREA_FLAG_NO_FLY_ZONE;
5332 // Xinef: Dun Morogh, Kharanos tavern, missing resting flag
5333 else if (areaEntry->ID == 2102)
5334 areaEntry->flags |= AREA_FLAG_REST_ZONE_ALLIANCE;
5335 }
5336
5337 // Xinef: fix for something?
5338 SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(121));
5339 properties->Type = SUMMON_TYPE_TOTEM;
5340 properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(647)); // 52893
5341 properties->Type = SUMMON_TYPE_TOTEM;
5342 if ((properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(628)))) // Hungry Plaguehound
5343 {
5344 properties->Category = SUMMON_CATEGORY_PET;
5345 properties->Type = SUMMON_TYPE_PET;
5346 }
5347
5348 // Correct Pet Size
5349 CreatureDisplayInfoEntry* displayEntry = const_cast<CreatureDisplayInfoEntry*>(sCreatureDisplayInfoStore.LookupEntry(17028)); // Kurken
5350 displayEntry->scale = 2.5f;
5351
5352 // Oracles and Frenzyheart faction
5353 FactionEntry* factionEntry = const_cast<FactionEntry*>(sFactionStore.LookupEntry(1104));
5354 factionEntry->ReputationFlags[0] = 0;
5355 factionEntry = const_cast<FactionEntry*>(sFactionStore.LookupEntry(1105));
5356 factionEntry->ReputationFlags[0] = 0;
5357
5358 // Various factions, added 14, 16 to hostile mask
5359 FactionTemplateEntry* factionTemplateEntry = const_cast<FactionTemplateEntry*>(sFactionTemplateStore.LookupEntry(1978)); // Warsong Offensive
5360 factionTemplateEntry->hostileMask |= 8;
5361 factionTemplateEntry = const_cast<FactionTemplateEntry*>(sFactionTemplateStore.LookupEntry(1921)); // The Taunka
5362 factionTemplateEntry->hostileMask |= 8;
5363
5364 // Remove vehicles attr, making accessories selectable
5365 VehicleSeatEntry* vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(4689)); // Siege Engine, Accessory
5366 vse->m_flags &= ~VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE;
5367 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(4692)); // Siege Engine, Accessory
5368 vse->m_flags &= ~VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE;
5369 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(4693)); // Siege Engine, Accessory
5370 vse->m_flags &= ~VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE;
5371 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(1520)); // Wyrmrest Vanquisher
5373
5374 // Salvaged Siege Engine (Ulduar) extra passenger seats: the only salvaged vehicle seats
5375 // without this flag, leaving those passengers targetable by Flame Leviathan's AoE
5376 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(4026));
5378 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(4027));
5380
5381 // pussywizard: fix z offset for some vehicles:
5382 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(6206)); // Marrowgar - Bone Spike
5383 vse->m_attachmentOffsetZ = 4.0f;
5384 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(3806)); // Mimiron - seat on VX-001 for ACU during last phase
5385 vse->m_attachmentOffsetZ = 15.0f;
5386 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(3566)); // Mimiron - Working seat
5387 vse->m_attachmentOffsetX = -3.5f;
5388 vse->m_attachmentOffsetY = 0.0f;
5389 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(3567)); // Mimiron - Working seat
5390 vse->m_attachmentOffsetX = 2.3f;
5391 vse->m_attachmentOffsetY = -2.3f;
5392
5393 // Pilgrim's Bounty offsets
5394 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(2841));
5395 vse->m_attachmentOffsetX += 1.65f;
5396 vse->m_attachmentOffsetY += 0.75f;
5397 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(2842));
5398 vse->m_attachmentOffsetX += 1.6f;
5399 vse->m_attachmentOffsetY += -1.0f;
5400 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(2843));
5401 vse->m_attachmentOffsetX += -1.2f;
5402 vse->m_attachmentOffsetY += 0.2f;
5403 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(2844));
5404 vse->m_attachmentOffsetX += -0.1f;
5405 vse->m_attachmentOffsetY += -1.6f;
5406 vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(2845));
5407 vse->m_attachmentOffsetX += 0.0f;
5408 vse->m_attachmentOffsetY += 1.6f;
5409
5410 // Once Bitten, Twice Shy (10 player) - Icecrown Citadel
5411 AchievementEntry* achievement = const_cast<AchievementEntry*>(sAchievementStore.LookupEntry(4539));
5412 achievement->mapID = 631; // Correct map requirement (currently has Ulduar)
5413
5414 // Ring of Valor starting Locations
5415 GraveyardStruct const* entry = sGraveyard->GetGraveyard(1364);
5416 const_cast<GraveyardStruct*>(entry)->z += 6.0f;
5417 entry = sGraveyard->GetGraveyard(1365);
5418 const_cast<GraveyardStruct*>(entry)->z += 6.0f;
5419
5420 LockEntry* key = const_cast<LockEntry*>(sLockStore.LookupEntry(36)); // 3366 Opening, allows to open without proper key
5421 key->Type[2] = LOCK_KEY_NONE;
5422
5423 LOG_INFO("server.loading", ">> Loading spell dbc data corrections in {} ms", GetMSTimeDiffToNow(oldMSTime));
5424 LOG_INFO("server.loading", " ");
5425}
constexpr auto IN_MILLISECONDS
Definition Common.h:53
@ VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE
Definition DBCEnums.h:464
@ AREA_FLAG_REST_ZONE_ALLIANCE
Definition DBCEnums.h:257
@ AREA_FLAG_NO_FLY_ZONE
Definition DBCEnums.h:262
DBCStorage< VehicleSeatEntry > sVehicleSeatStore(VehicleSeatEntryfmt)
DBCStorage< FactionEntry > sFactionStore(FactionEntryfmt)
DBCStorage< SpellRadiusEntry > sSpellRadiusStore(SpellRadiusfmt)
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
DBCStorage< LockEntry > sLockStore(LockEntryfmt)
DBCStorage< SpellCategoryEntry > sSpellCategoryStore(SpellCategoryfmt)
DBCStorage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore(CreatureDisplayInfofmt)
DBCStorage< SpellCastTimesEntry > sSpellCastTimesStore(SpellCastTimefmt)
DBCStorage< SpellRangeEntry > sSpellRangeStore(SpellRangefmt)
DBCStorage< AchievementEntry > sAchievementStore(Achievementfmt)
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
DBCStorage< SpellDurationEntry > sSpellDurationStore(SpellDurationfmt)
#define sGraveyard
Definition GameGraveyard.h:76
#define SPEED_CHARGE
Definition MotionMaster.h:136
@ EFFECT_1
Definition SharedDefines.h:32
@ EFFECT_0
Definition SharedDefines.h:31
@ EFFECT_2
Definition SharedDefines.h:33
@ POWER_MANA
Definition SharedDefines.h:257
@ SPELL_ATTR7_DONT_CAUSE_SPELL_PUSHBACK
Definition SharedDefines.h:635
@ SPELL_ATTR7_CAN_CAUSE_INTERRUPT
Definition SharedDefines.h:640
@ SPELL_ATTR7_NO_ATTACK_PARRY
Definition SharedDefines.h:653
@ SPELL_ATTR7_NO_ATTACK_MISS
Definition SharedDefines.h:654
@ SPELL_ATTR7_NO_ATTACK_DODGE
Definition SharedDefines.h:652
@ SPELL_ATTR7_DISABLE_AURA_WHILE_DEAD
Definition SharedDefines.h:631
@ SPELL_EFFECT_DUMMY
Definition SharedDefines.h:769
@ SPELL_EFFECT_SCRIPT_EFFECT
Definition SharedDefines.h:843
@ SPELL_EFFECT_POWER_BURN
Definition SharedDefines.h:828
@ SPELL_EFFECT_APPLY_AREA_AURA_FRIEND
Definition SharedDefines.h:894
@ SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE
Definition SharedDefines.h:908
@ SPELL_EFFECT_SELF_RESURRECT
Definition SharedDefines.h:860
@ SPELL_EFFECT_SUMMON_OBJECT_SLOT1
Definition SharedDefines.h:870
@ SPELL_EFFECT_TRIGGER_MISSILE
Definition SharedDefines.h:798
@ SPELL_EFFECT_JUMP_DEST
Definition SharedDefines.h:808
@ SPELL_EFFECT_MODIFY_THREAT_PERCENT
Definition SharedDefines.h:891
@ SPELL_EFFECT_LEAP_BACK
Definition SharedDefines.h:904
@ SPELL_EFFECT_CHARGE
Definition SharedDefines.h:862
@ SPELL_EFFECT_CHARGE_DEST
Definition SharedDefines.h:915
@ SPELL_EFFECT_JUMP
Definition SharedDefines.h:807
@ SPELL_EFFECT_APPLY_AURA
Definition SharedDefines.h:772
@ SPELL_PREVENTION_TYPE_NONE
Definition SharedDefines.h:1557
@ SPELL_ATTR5_EXTRA_INITIAL_PERIOD
Definition SharedDefines.h:564
@ SPELL_ATTR5_ALLOW_WHILE_STUNNED
Definition SharedDefines.h:558
@ SPELL_ATTR5_DO_NOT_DISPLAY_DURATION
Definition SharedDefines.h:565
@ SPELL_ATTR5_ALLOW_ACTION_DURING_CHANNEL
Definition SharedDefines.h:555
@ SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT
Definition SharedDefines.h:581
@ SPELL_ATTR5_LIMIT_N
Definition SharedDefines.h:560
@ TARGET_DEST_TARGET_ANY
Definition SharedDefines.h:1471
@ TARGET_UNIT_CONE_ENTRY
Definition SharedDefines.h:1468
@ TARGET_DEST_DB
Definition SharedDefines.h:1426
@ TARGET_UNIT_CASTER_AREA_PARTY
Definition SharedDefines.h:1428
@ TARGET_UNIT_SRC_AREA_ENTRY
Definition SharedDefines.h:1420
@ TARGET_UNIT_DEST_AREA_ENEMY
Definition SharedDefines.h:1425
@ TARGET_UNIT_SRC_AREA_ALLY
Definition SharedDefines.h:1438
@ TARGET_UNIT_TARGET_ALLY
Definition SharedDefines.h:1429
@ TARGET_DEST_CASTER_BACK
Definition SharedDefines.h:1456
@ TARGET_UNIT_VEHICLE
Definition SharedDefines.h:1502
@ TARGET_UNIT_TARGET_ANY
Definition SharedDefines.h:1433
@ TARGET_DEST_DEST
Definition SharedDefines.h:1495
@ TARGET_UNIT_SRC_AREA_ENEMY
Definition SharedDefines.h:1424
@ TARGET_DEST_TARGET_ENEMY
Definition SharedDefines.h:1461
@ TARGET_UNIT_PET
Definition SharedDefines.h:1418
@ TARGET_DEST_DYNOBJ_NONE
Definition SharedDefines.h:1496
@ TARGET_UNIT_TARGET_ENEMY
Definition SharedDefines.h:1419
@ TARGET_UNIT_MASTER
Definition SharedDefines.h:1435
@ TARGET_DEST_TRAJ
Definition SharedDefines.h:1497
@ TARGET_UNIT_DEST_AREA_ENTRY
Definition SharedDefines.h:1421
@ TARGET_UNIT_NEARBY_ENTRY
Definition SharedDefines.h:1446
@ TARGET_DEST_CASTER
Definition SharedDefines.h:1427
@ TARGET_UNIT_CASTER
Definition SharedDefines.h:1414
@ TARGET_UNIT_CONE_ENEMY_24
Definition SharedDefines.h:1432
@ TARGET_SRC_CASTER
Definition SharedDefines.h:1430
@ TARGET_UNIT_SUMMONER
Definition SharedDefines.h:1500
@ SPELL_ATTR2_CANT_CRIT
Definition SharedDefines.h:473
@ SPELL_ATTR2_NO_TARGET_PER_SECOND_COST
Definition SharedDefines.h:455
@ SPELL_ATTR2_ALLOW_DEAD_TARGET
Definition SharedDefines.h:444
@ SPELL_ATTR2_IGNORE_LINE_OF_SIGHT
Definition SharedDefines.h:446
@ SPELL_ATTR2_NO_SCHOOL_IMMUNITIES
Definition SharedDefines.h:470
@ SPELL_ATTR1_NO_THREAT
Definition SharedDefines.h:417
@ SPELL_ATTR1_EXCLUDE_CASTER
Definition SharedDefines.h:426
@ SPELL_ATTR1_ALLOW_WHILE_STEALTHED
Definition SharedDefines.h:412
@ SPELL_ATTR1_TRACK_TARGET_IN_CHANNEL
Definition SharedDefines.h:421
@ SPELL_ATTR1_IMMUNITY_PURGES_EFFECT
Definition SharedDefines.h:422
@ SPELL_ATTR1_NO_REFLECTION
Definition SharedDefines.h:414
@ SPELL_ATTR1_NO_REDIRECTION
Definition SharedDefines.h:410
@ SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD
Definition SharedDefines.h:501
@ SPELL_ATTR3_SUPPRESS_TARGET_PROCS
Definition SharedDefines.h:498
@ SPELL_ATTR3_IGNORE_CASTER_AND_TARGET_RESTRICTIONS
Definition SharedDefines.h:509
@ SPELL_ATTR3_ALWAYS_HIT
Definition SharedDefines.h:499
@ SPELL_ATTR3_DOT_STACKING_RULE
Definition SharedDefines.h:488
@ SPELL_ATTR3_CAN_PROC_FROM_PROCS
Definition SharedDefines.h:507
@ SPELL_ATTR3_SUPPRESS_CASTER_PROCS
Definition SharedDefines.h:497
@ SPELL_ATTR3_COMPLETELY_BLOCKED
Definition SharedDefines.h:484
@ SPELL_ATTR3_IGNORE_CASTER_MODIFIERS
Definition SharedDefines.h:510
@ SPELL_ATTR3_ONLY_ON_PLAYER
Definition SharedDefines.h:489
@ SPELL_DAMAGE_CLASS_MAGIC
Definition SharedDefines.h:1550
@ LOCK_KEY_NONE
Definition SharedDefines.h:2588
@ SUMMON_TYPE_PET
Definition SharedDefines.h:3528
@ SUMMON_TYPE_TOTEM
Definition SharedDefines.h:3531
@ MECHANIC_NONE
Definition SharedDefines.h:1313
@ MECHANIC_STUN
Definition SharedDefines.h:1325
@ MECHANIC_SNARE
Definition SharedDefines.h:1324
@ SPELLFAMILY_MAGE
Definition SharedDefines.h:3787
@ SPELLFAMILY_GENERIC
Definition SharedDefines.h:3784
@ SPELLFAMILY_WARRIOR
Definition SharedDefines.h:3788
@ SPELLFAMILY_PALADIN
Definition SharedDefines.h:3794
@ SPELLFAMILY_HUNTER
Definition SharedDefines.h:3793
@ SPELLFAMILY_POTION
Definition SharedDefines.h:3797
@ SPELLFAMILY_ROGUE
Definition SharedDefines.h:3792
@ SPELLFAMILY_DEATHKNIGHT
Definition SharedDefines.h:3799
@ SPELL_ATTR0_NO_ACTIVE_DEFENSE
Definition SharedDefines.h:391
@ SPELL_ATTR0_NOT_SHAPESHIFTED
Definition SharedDefines.h:386
@ SPELL_ATTR0_ALLOW_ITEM_SPELL_IN_PVP
Definition SharedDefines.h:383
@ SPELL_ATTR0_ALLOW_WHILE_SITTING
Definition SharedDefines.h:397
@ SPELL_ATTR0_AURA_IS_DEBUFF
Definition SharedDefines.h:396
@ SPELL_ATTR0_ALLOW_WHILE_MOUNTED
Definition SharedDefines.h:394
@ SPELL_ATTR0_PASSIVE
Definition SharedDefines.h:376
@ SPELL_ATTR0_IS_ABILITY
Definition SharedDefines.h:374
@ SPELL_ATTR0_NO_IMMUNITIES
Definition SharedDefines.h:399
@ SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT
Definition SharedDefines.h:390
@ SPELL_ATTR0_USES_RANGED_SLOT
Definition SharedDefines.h:371
@ SPELL_ATTR0_ALLOW_CAST_WHILE_DEAD
Definition SharedDefines.h:393
@ SPELL_ATTR0_DO_NOT_SHEATH
Definition SharedDefines.h:388
@ DISPEL_MAGIC
Definition SharedDefines.h:1376
@ DISPEL_NONE
Definition SharedDefines.h:1375
@ SPELL_ATTR4_AURA_EXPIRES_OFFLINE
Definition SharedDefines.h:520
@ SPELL_ATTR4_ALLOW_ENETRING_ARENA
Definition SharedDefines.h:539
@ SPELL_ATTR4_NOT_IN_ARENA_OR_RATED_BATTLEGROUND
Definition SharedDefines.h:534
@ SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS
Definition SharedDefines.h:526
@ SPELL_ATTR4_NO_CAST_LOG
Definition SharedDefines.h:518
@ SPELL_ATTR4_ALLOW_CAST_WHILE_CASTING
Definition SharedDefines.h:525
@ SPELL_ATTR4_CANNOT_BE_STOLEN
Definition SharedDefines.h:524
@ SPELL_ATTR4_DAMAGE_DOESNT_BREAK_AURAS
Definition SharedDefines.h:532
@ SUMMON_CATEGORY_PET
Definition SharedDefines.h:3518
@ SPELL_ATTR6_NO_PUSHBACK
Definition SharedDefines.h:607
@ SPELL_ATTR6_CAN_TARGET_UNTARGETABLE
Definition SharedDefines.h:616
@ SPELL_ATTR6_ALLOW_WHILE_RIDING_VEHICLE
Definition SharedDefines.h:604
@ SPELL_ATTR6_IGNORE_CASTER_DAMAGE_MODIFIERS
Definition SharedDefines.h:621
@ SPELL_ATTR6_IGNORE_PHASE_SHIFT
Definition SharedDefines.h:605
@ SPELL_ATTR6_NO_CATEGORY_COOLDOWN_MODS
Definition SharedDefines.h:623
@ SPELL_SCHOOL_MASK_SHADOW
Definition SharedDefines.h:290
@ SPELL_SCHOOL_MASK_MAGIC
Definition SharedDefines.h:300
@ SPELL_SCHOOL_MASK_NATURE
Definition SharedDefines.h:288
@ SPELL_AURA_ADD_PCT_MODIFIER
Definition SpellAuraDefines.h:171
@ SPELL_AURA_PROC_TRIGGER_SPELL
Definition SpellAuraDefines.h:105
@ SPELL_AURA_ADD_FLAT_MODIFIER
Definition SpellAuraDefines.h:170
@ SPELL_AURA_PERIODIC_HEAL
Definition SpellAuraDefines.h:71
@ SPELL_AURA_DUMMY
Definition SpellAuraDefines.h:67
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
Definition SpellAuraDefines.h:150
@ SPELL_AURA_SPLIT_DAMAGE_PCT
Definition SpellAuraDefines.h:144
@ SPELL_AURA_MOD_CHARM
Definition SpellAuraDefines.h:69
@ SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE
Definition SpellAuraDefines.h:250
@ SPELL_AURA_MOD_TAUNT
Definition SpellAuraDefines.h:74
@ SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT
Definition SpellAuraDefines.h:195
@ SPELL_AURA_MOD_DECREASE_SPEED
Definition SpellAuraDefines.h:96
@ SPELL_AURA_SCHOOL_ABSORB
Definition SpellAuraDefines.h:132
@ SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST
Definition SpellAuraDefines.h:333
@ SPELL_AURA_PERIODIC_DUMMY
Definition SpellAuraDefines.h:289
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
Definition SpellAuraDefines.h:86
@ SPELL_AURA_MOD_STUN
Definition SpellAuraDefines.h:75
@ CHANNEL_INTERRUPT_FLAG_INTERRUPT
Definition SpellDefines.h:45
@ AURA_INTERRUPT_FLAG_TAKE_DAMAGE
Definition SpellDefines.h:52
@ AURA_INTERRUPT_FLAG_TELEPORTED
Definition SpellDefines.h:73
@ AURA_INTERRUPT_FLAG_CAST
Definition SpellDefines.h:53
@ AURA_INTERRUPT_FLAG_UNK14
Definition SpellDefines.h:65
@ AURA_INTERRUPT_FLAG_TALK
Definition SpellDefines.h:61
@ AURA_INTERRUPT_FLAG_HITBYSPELL
Definition SpellDefines.h:51
@ AURA_INTERRUPT_FLAG_MOVE
Definition SpellDefines.h:54
@ AURA_INTERRUPT_FLAG_TURNING
Definition SpellDefines.h:55
@ AURA_INTERRUPT_FLAG_MELEE_ATTACK
Definition SpellDefines.h:63
@ AURA_INTERRUPT_FLAG_CHANGE_MAP
Definition SpellDefines.h:70
@ AURA_INTERRUPT_FLAG_MOUNT
Definition SpellDefines.h:68
@ SPELLMOD_EFFECT2
Definition SpellDefines.h:96
@ SPELLMOD_DAMAGE
Definition SpellDefines.h:84
@ SPELLMOD_EFFECT1
Definition SpellDefines.h:87
@ SPELL_INTERRUPT_FLAG_UNK3
Definition SpellDefines.h:36
@ SPELL_INTERRUPT_FLAG_PUSH_BACK
Definition SpellDefines.h:35
@ SPELL_INTERRUPT_FLAG_INTERRUPT
Definition SpellDefines.h:37
@ SPELL_INTERRUPT_FLAG_MOVEMENT
Definition SpellDefines.h:34
@ SPELL_FACING_FLAG_INFRONT
Definition SpellDefines.h:136
void ApplySpellFix(std::initializer_list< uint32 > spellIds, void(*fix)(SpellInfo *))
Definition SpellInfoCorrections.cpp:24
@ TARGET_FLAG_DEST_LOCATION
Definition SpellInfo.h:53
@ SPELL_ATTR0_CU_SINGLE_AURA_STACK
Definition SpellInfo.h:199
@ EFFECT_RADIUS_500_YARDS
Definition SpellMgr.h:431
@ EFFECT_RADIUS_7_YARDS
Definition SpellMgr.h:437
@ EFFECT_RADIUS_100_YARDS
Definition SpellMgr.h:413
@ EFFECT_RADIUS_20_YARDS
Definition SpellMgr.h:410
@ EFFECT_RADIUS_8_YARDS
Definition SpellMgr.h:415
@ EFFECT_RADIUS_45_YARDS
Definition SpellMgr.h:412
@ EFFECT_RADIUS_2_YARDS
Definition SpellMgr.h:408
@ EFFECT_RADIUS_1_YARD
Definition SpellMgr.h:417
@ EFFECT_RADIUS_4_YARDS
Definition SpellMgr.h:427
@ EFFECT_RADIUS_25_YARDS
Definition SpellMgr.h:421
@ EFFECT_RADIUS_5_YARDS
Definition SpellMgr.h:409
@ EFFECT_RADIUS_70_YARDS
Definition SpellMgr.h:426
@ EFFECT_RADIUS_3_YARDS
Definition SpellMgr.h:416
@ EFFECT_RADIUS_50000_YARDS
Definition SpellMgr.h:429
@ EFFECT_RADIUS_18_YARDS
Definition SpellMgr.h:420
@ EFFECT_RADIUS_200_YARDS
Definition SpellMgr.h:423
@ EFFECT_RADIUS_12_YARDS
Definition SpellMgr.h:433
@ EFFECT_RADIUS_10_YARDS
Definition SpellMgr.h:414
@ EFFECT_RADIUS_150_YARDS
Definition SpellMgr.h:441
@ EFFECT_RADIUS_6_YARDS
Definition SpellMgr.h:430
@ PROC_FLAG_DONE_MELEE_AUTO_ATTACK
Definition SpellMgr.h:113
@ PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS
Definition SpellMgr.h:116
@ FORM_MOONKIN
Definition UnitDefines.h:101
@ FORM_CAT
Definition UnitDefines.h:73
@ FORM_TREE
Definition UnitDefines.h:74
Definition SpellInfo.h:238
flag96 SpellFamilyFlags
Definition SpellInfo.h:412
uint32 RecoveryTime
Definition SpellInfo.h:372
SpellRangeEntry const * RangeEntry
Definition SpellInfo.h:393
uint32 ActiveIconID
Definition SpellInfo.h:405
float Speed
Definition SpellInfo.h:394
uint32 Attributes
Definition SpellInfo.h:348
SpellCategoryEntry const * CategoryEntry
Definition SpellInfo.h:345
uint32 AttributesEx6
Definition SpellInfo.h:354
uint32 SpellIconID
Definition SpellInfo.h:404
uint32 SpellFamilyName
Definition SpellInfo.h:411
Definition Util.h:442
Definition DBCStructure.h:40
int32 mapID
Definition DBCStructure.h:43
Definition DBCStructure.h:519
Definition DBCStructure.h:748
float scale
Definition DBCStructure.h:753
Definition DBCStructure.h:943
uint32 ReputationFlags[4]
Definition DBCStructure.h:949
Definition DBCStructure.h:975
uint32 hostileMask
Definition DBCStructure.h:981
Definition GameGraveyard.h:27
Definition DBCStructure.h:1344
uint32 Type[MAX_LOCK_CASE]
Definition DBCStructure.h:1346
float RangeMax[2]
Definition DBCStructure.h:1832
Definition DBCStructure.h:1945
uint32 Type
Definition DBCStructure.h:1949
uint32 Category
Definition DBCStructure.h:1947
Definition DBCStructure.h:2100
float m_attachmentOffsetX
Definition DBCStructure.h:2104
float m_attachmentOffsetY
Definition DBCStructure.h:2105
float m_attachmentOffsetZ
Definition DBCStructure.h:2106
uint32 m_flags
Definition DBCStructure.h:2102

References SpellInfo::ActiveIconID, ApplySpellFix(), AREA_FLAG_NO_FLY_ZONE, AREA_FLAG_REST_ZONE_ALLIANCE, SpellInfo::Attributes, SpellInfo::AttributesEx6, AURA_INTERRUPT_FLAG_CAST, AURA_INTERRUPT_FLAG_CHANGE_MAP, AURA_INTERRUPT_FLAG_HITBYSPELL, AURA_INTERRUPT_FLAG_MELEE_ATTACK, AURA_INTERRUPT_FLAG_MOUNT, AURA_INTERRUPT_FLAG_MOVE, AURA_INTERRUPT_FLAG_TAKE_DAMAGE, AURA_INTERRUPT_FLAG_TALK, AURA_INTERRUPT_FLAG_TELEPORTED, AURA_INTERRUPT_FLAG_TURNING, AURA_INTERRUPT_FLAG_UNK14, SummonPropertiesEntry::Category, SpellInfo::CategoryEntry, CHANNEL_INTERRUPT_FLAG_INTERRUPT, DISPEL_MAGIC, DISPEL_NONE, DONE_HIT_PROC_FLAG_MASK, EFFECT_0, EFFECT_1, EFFECT_2, EFFECT_RADIUS_100_YARDS, EFFECT_RADIUS_10_YARDS, EFFECT_RADIUS_12_YARDS, EFFECT_RADIUS_150_YARDS, EFFECT_RADIUS_18_YARDS, EFFECT_RADIUS_1_YARD, EFFECT_RADIUS_200_YARDS, EFFECT_RADIUS_20_YARDS, EFFECT_RADIUS_25_YARDS, EFFECT_RADIUS_2_YARDS, EFFECT_RADIUS_3_YARDS, EFFECT_RADIUS_45_YARDS, EFFECT_RADIUS_4_YARDS, EFFECT_RADIUS_50000_YARDS, EFFECT_RADIUS_500_YARDS, EFFECT_RADIUS_5_YARDS, EFFECT_RADIUS_6_YARDS, EFFECT_RADIUS_70_YARDS, EFFECT_RADIUS_7_YARDS, EFFECT_RADIUS_8_YARDS, SpellInfo::Effects, FORM_CAT, FORM_MOONKIN, FORM_TREE, SpellInfo::GetEffects(), getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), GetSpellInfoStoreSize(), FactionTemplateEntry::hostileMask, IN_MILLISECONDS, LOCK_KEY_NONE, LOG_INFO, VehicleSeatEntry::m_attachmentOffsetX, VehicleSeatEntry::m_attachmentOffsetY, VehicleSeatEntry::m_attachmentOffsetZ, VehicleSeatEntry::m_flags, AchievementEntry::mapID, MAX_SPELL_EFFECTS, MECHANIC_NONE, MECHANIC_SNARE, MECHANIC_STUN, mSpellInfoMap, POWER_MANA, PROC_FLAG_DONE_MELEE_AUTO_ATTACK, PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS, SpellInfo::RangeEntry, SpellRangeEntry::RangeMax, SpellInfo::RecoveryTime, FactionEntry::ReputationFlags, sAchievementStore, sAreaTableStore, CreatureDisplayInfoEntry::scale, sCreatureDisplayInfoStore, sFactionStore, sFactionTemplateStore, sGraveyard, sLockStore, SpellInfo::Speed, SPEED_CHARGE, SPELL_ATTR0_ALLOW_CAST_WHILE_DEAD, SPELL_ATTR0_ALLOW_ITEM_SPELL_IN_PVP, SPELL_ATTR0_ALLOW_WHILE_MOUNTED, SPELL_ATTR0_ALLOW_WHILE_SITTING, SPELL_ATTR0_AURA_IS_DEBUFF, SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT, SPELL_ATTR0_CU_SINGLE_AURA_STACK, SPELL_ATTR0_DO_NOT_SHEATH, SPELL_ATTR0_IS_ABILITY, SPELL_ATTR0_NO_ACTIVE_DEFENSE, SPELL_ATTR0_NO_AURA_CANCEL, SPELL_ATTR0_NO_IMMUNITIES, SPELL_ATTR0_NOT_SHAPESHIFTED, SPELL_ATTR0_PASSIVE, SPELL_ATTR0_USES_RANGED_SLOT, SPELL_ATTR1_ALLOW_WHILE_STEALTHED, SPELL_ATTR1_EXCLUDE_CASTER, SPELL_ATTR1_IMMUNITY_PURGES_EFFECT, SPELL_ATTR1_NO_REDIRECTION, SPELL_ATTR1_NO_REFLECTION, SPELL_ATTR1_NO_THREAT, SPELL_ATTR1_TRACK_TARGET_IN_CHANNEL, SPELL_ATTR2_ALLOW_DEAD_TARGET, SPELL_ATTR2_CANT_CRIT, SPELL_ATTR2_IGNORE_LINE_OF_SIGHT, SPELL_ATTR2_NO_SCHOOL_IMMUNITIES, SPELL_ATTR2_NO_TARGET_PER_SECOND_COST, SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD, SPELL_ATTR3_ALWAYS_HIT, SPELL_ATTR3_CAN_PROC_FROM_PROCS, SPELL_ATTR3_COMPLETELY_BLOCKED, SPELL_ATTR3_DOT_STACKING_RULE, SPELL_ATTR3_IGNORE_CASTER_AND_TARGET_RESTRICTIONS, SPELL_ATTR3_IGNORE_CASTER_MODIFIERS, SPELL_ATTR3_ONLY_ON_PLAYER, SPELL_ATTR3_SUPPRESS_CASTER_PROCS, SPELL_ATTR3_SUPPRESS_TARGET_PROCS, SPELL_ATTR4_ALLOW_CAST_WHILE_CASTING, SPELL_ATTR4_ALLOW_ENETRING_ARENA, SPELL_ATTR4_AURA_EXPIRES_OFFLINE, SPELL_ATTR4_CANNOT_BE_STOLEN, SPELL_ATTR4_DAMAGE_DOESNT_BREAK_AURAS, SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS, SPELL_ATTR4_NO_CAST_LOG, SPELL_ATTR4_NOT_IN_ARENA_OR_RATED_BATTLEGROUND, SPELL_ATTR5_ALLOW_ACTION_DURING_CHANNEL, SPELL_ATTR5_ALLOW_WHILE_STUNNED, SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT, SPELL_ATTR5_DO_NOT_DISPLAY_DURATION, SPELL_ATTR5_EXTRA_INITIAL_PERIOD, SPELL_ATTR5_LIMIT_N, SPELL_ATTR6_ALLOW_WHILE_RIDING_VEHICLE, SPELL_ATTR6_CAN_TARGET_UNTARGETABLE, SPELL_ATTR6_IGNORE_CASTER_DAMAGE_MODIFIERS, SPELL_ATTR6_IGNORE_PHASE_SHIFT, SPELL_ATTR6_NO_CATEGORY_COOLDOWN_MODS, SPELL_ATTR6_NO_PUSHBACK, SPELL_ATTR7_CAN_CAUSE_INTERRUPT, SPELL_ATTR7_DISABLE_AURA_WHILE_DEAD, SPELL_ATTR7_DONT_CAUSE_SPELL_PUSHBACK, SPELL_ATTR7_NO_ATTACK_DODGE, SPELL_ATTR7_NO_ATTACK_MISS, SPELL_ATTR7_NO_ATTACK_PARRY, SPELL_AURA_ADD_FLAT_MODIFIER, SPELL_AURA_ADD_PCT_MODIFIER, SPELL_AURA_DUMMY, SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST, SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE, SPELL_AURA_MOD_CHARM, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, SPELL_AURA_MOD_DECREASE_SPEED, SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT, SPELL_AURA_MOD_STUN, SPELL_AURA_MOD_TAUNT, SPELL_AURA_PERIODIC_DUMMY, SPELL_AURA_PERIODIC_HEAL, SPELL_AURA_PERIODIC_TRIGGER_SPELL, SPELL_AURA_PROC_TRIGGER_SPELL, SPELL_AURA_SCHOOL_ABSORB, SPELL_AURA_SPLIT_DAMAGE_PCT, SPELL_DAMAGE_CLASS_MAGIC, SPELL_EFFECT_APPLY_AREA_AURA_FRIEND, SPELL_EFFECT_APPLY_AURA, SPELL_EFFECT_CHARGE, SPELL_EFFECT_CHARGE_DEST, SPELL_EFFECT_DUMMY, SPELL_EFFECT_JUMP, SPELL_EFFECT_JUMP_DEST, SPELL_EFFECT_LEAP_BACK, SPELL_EFFECT_MODIFY_THREAT_PERCENT, SPELL_EFFECT_POWER_BURN, SPELL_EFFECT_SCRIPT_EFFECT, SPELL_EFFECT_SELF_RESURRECT, SPELL_EFFECT_SUMMON_OBJECT_SLOT1, SPELL_EFFECT_SUMMON_PET, SPELL_EFFECT_TRIGGER_MISSILE, SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE, SPELL_FACING_FLAG_INFRONT, SPELL_INTERRUPT_FLAG_INTERRUPT, SPELL_INTERRUPT_FLAG_MOVEMENT, SPELL_INTERRUPT_FLAG_PUSH_BACK, SPELL_INTERRUPT_FLAG_UNK3, SPELL_PREVENTION_TYPE_NONE, SPELL_SCHOOL_MASK_MAGIC, SPELL_SCHOOL_MASK_NATURE, SPELL_SCHOOL_MASK_SHADOW, SPELLFAMILY_DEATHKNIGHT, SPELLFAMILY_GENERIC, SPELLFAMILY_HUNTER, SPELLFAMILY_MAGE, SPELLFAMILY_PALADIN, SPELLFAMILY_POTION, SPELLFAMILY_ROGUE, SPELLFAMILY_WARRIOR, SpellInfo::SpellFamilyFlags, SpellInfo::SpellFamilyName, SpellInfo::SpellIconID, SPELLMOD_DAMAGE, SPELLMOD_EFFECT1, SPELLMOD_EFFECT2, sSpellCastTimesStore, sSpellCategoryStore, sSpellDurationStore, sSpellRadiusStore, sSpellRangeStore, sSummonPropertiesStore, SUMMON_CATEGORY_PET, SUMMON_TYPE_PET, SUMMON_TYPE_TOTEM, sVehicleSeatStore, TARGET_DEST_CASTER, TARGET_DEST_CASTER_BACK, TARGET_DEST_DB, TARGET_DEST_DEST, TARGET_DEST_DYNOBJ_NONE, TARGET_DEST_TARGET_ANY, TARGET_DEST_TARGET_ENEMY, TARGET_DEST_TRAJ, TARGET_FLAG_DEST_LOCATION, TARGET_SRC_CASTER, TARGET_UNIT_CASTER, TARGET_UNIT_CASTER_AREA_PARTY, TARGET_UNIT_CONE_ENEMY_24, TARGET_UNIT_CONE_ENTRY, TARGET_UNIT_DEST_AREA_ENEMY, TARGET_UNIT_DEST_AREA_ENTRY, TARGET_UNIT_MASTER, TARGET_UNIT_NEARBY_ENTRY, TARGET_UNIT_PET, TARGET_UNIT_SRC_AREA_ALLY, TARGET_UNIT_SRC_AREA_ENEMY, TARGET_UNIT_SRC_AREA_ENTRY, TARGET_UNIT_SUMMONER, TARGET_UNIT_TARGET_ALLY, TARGET_UNIT_TARGET_ANY, TARGET_UNIT_TARGET_ENEMY, TARGET_UNIT_VEHICLE, LockEntry::Type, SummonPropertiesEntry::Type, and VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE.

◆ LoadSpellInfoCustomAttributes()

void SpellMgr::LoadSpellInfoCustomAttributes ( )
Todo:
: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
3208{
3209 uint32 const oldMSTime = getMSTime();
3210 uint32 const customAttrTime = getMSTime();
3211 uint32 count;
3212
3213 QueryResult result = WorldDatabase.Query("SELECT spell_id, attributes FROM spell_custom_attr");
3214
3215 if (!result)
3216 {
3217 LOG_WARN("server.loading", ">> Loaded 0 Spell Custom Attributes From DB. DB table `spell_custom_attr` Is Empty.");
3218 }
3219 else
3220 {
3221 count = 0;
3222
3223 do
3224 {
3225 ++count;
3226
3227 Field const* fields = result->Fetch();
3228
3229 uint32 const spellId = fields[0].Get<uint32>();
3230 uint32 attributes = fields[1].Get<uint32>();
3231
3232 SpellInfo* spellInfo = _GetSpellInfo(spellId);
3233 if (!spellInfo)
3234 {
3235 LOG_INFO("sql.sql", "Table `spell_custom_attr` has wrong spell (spell_id: {}), ignored.", spellId);
3236 continue;
3237 }
3238
3239 if (attributes & SPELL_ATTR0_CU_NEGATIVE)
3240 {
3241 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
3242 {
3243 if (spellInfo->Effects[i].IsEffect())
3244 {
3245 if ((attributes & (SPELL_ATTR0_CU_NEGATIVE_EFF0 << i)) && (attributes & (SPELL_ATTR0_CU_POSITIVE_EFF0 << i)))
3246 {
3247 LOG_ERROR("sql.sql", "Table `spell_custom_attr` has attribute SPELL_ATTR0_CU_NEGATIVE_EFF{} and SPELL_ATTR0_CU_POSITIVE_EFF{} attributes for spell {} which cannot stack together. Attributes will not get applied", static_cast<uint32>(i), static_cast<uint32>(i), spellId);
3249 }
3250 continue;
3251 }
3252
3253 if (attributes & (SPELL_ATTR0_CU_NEGATIVE_EFF0 << i))
3254 {
3255 LOG_ERROR("sql.sql", "Table `spell_custom_attr` has attribute SPELL_ATTR0_CU_NEGATIVE_EFF{} for spell {} with no EFFECT_{}", static_cast<uint32>(i), spellId, static_cast<uint32>(i));
3256 attributes &= ~(SPELL_ATTR0_CU_NEGATIVE_EFF0 << i);
3257 }
3258 }
3259 }
3260
3261 if (attributes & SPELL_ATTR0_CU_POSITIVE)
3262 {
3263 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
3264 {
3265 if (spellInfo->Effects[i].IsEffect())
3266 {
3267 continue;
3268 }
3269
3270 if ((attributes & (SPELL_ATTR0_CU_POSITIVE_EFF0 << i)))
3271 {
3272 LOG_ERROR("sql.sql", "Table `spell_custom_attr` has attribute SPELL_ATTR0_CU_POSITIVE_EFF{} for spell {} with no EFFECT_{}", uint32(i), spellId, uint32(i));
3273 attributes &= ~(SPELL_ATTR0_CU_POSITIVE_EFF0 << i);
3274 }
3275 }
3276 }
3277
3278 if ((attributes & SPELL_ATTR0_CU_FORCE_AURA_SAVING) && (attributes & SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED))
3279 {
3280 LOG_ERROR("sql.sql", "Table `spell_custom_attr` attribute1 field has attributes SPELL_ATTR1_CU_FORCE_AURA_SAVING and SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED which cannot stack for spell {}. Both attributes will be ignored.", spellId);
3282 }
3283
3284 spellInfo->AttributesCu |= attributes;
3285 } while (result->NextRow());
3286
3287 LOG_INFO("server.loading", ">> Loaded {} spell custom attributes from DB in {} ms", count, GetMSTimeDiffToNow(customAttrTime));
3288 }
3289
3290 // xinef: create talent spells set
3291 for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
3292 {
3293 TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
3294 if (!talentInfo)
3295 continue;
3296
3297 for (uint8 j = 0; j < MAX_TALENT_RANK; j++)
3298 if (uint32 spellId = talentInfo->RankID[j])
3299 if (SpellInfo const* spellInfo = GetSpellInfo(spellId))
3300 for (uint8 k = 0; k < MAX_SPELL_EFFECTS; ++k)
3301 if (spellInfo->Effects[k].Effect == SPELL_EFFECT_LEARN_SPELL)
3302 if (SpellInfo const* learnSpell = GetSpellInfo(spellInfo->Effects[k].TriggerSpell))
3303 if (learnSpell->IsRanked() && !learnSpell->HasAttribute(SpellAttr0(SPELL_ATTR0_PASSIVE | SPELL_ATTR0_DO_NOT_DISPLAY)))
3304 mTalentSpellAdditionalSet.insert(learnSpell->Id);
3305 }
3306
3307 SpellInfo* spellInfo = nullptr;
3308 for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
3309 {
3310 spellInfo = mSpellInfoMap[i];
3311 if (!spellInfo)
3312 continue;
3313
3314 for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
3315 {
3316 switch (spellInfo->Effects[j].ApplyAuraName)
3317 {
3319 {
3320 switch (spellInfo->Id)
3321 {
3322 // Exceptions
3323 case 37411: // Skettis Corrupted Ghosts (Time-Lost Skettis, seen with Elixir of Shadows)
3324 case 43062: // Alpha Worg: Garwal's Invisibility
3325 case 44801: // Spectral Invisibility (Kalecgos, SWP)
3326 case 45614: // Shroud of the Scourge (Blending In, Temple City of En'kilah)
3327 case 46021: // Spectral Realm (SWP)
3328 case 52951: // Chapel Invisibility (DK starting zone)
3329 break;
3330 default:
3332 break;
3333 }
3334 }
3335 break;
3342 break;
3343 default:
3344 break;
3345 }
3346
3347 switch (spellInfo->Effects[j].ApplyAuraName)
3348 {
3349 case SPELL_AURA_CONVERT_RUNE: // Can't be saved - aura handler relies on calculated amount and changes it
3350 case SPELL_AURA_OPEN_STABLE: // No point in saving this, since the stable dialog can't be open on aura load anyway.
3351 // Auras that require both caster & target to be in world cannot be saved
3359 break;
3360 default:
3361 break;
3362 }
3363
3364 switch (spellInfo->Effects[j].ApplyAuraName)
3365 {
3373 break;
3376 break;
3377 default:
3378 break;
3379 }
3380
3381 switch (spellInfo->Effects[j].Effect)
3382 {
3388 case SPELL_EFFECT_HEAL:
3390 break;
3401 break;
3404 break;
3409 {
3410 // Only Enchanting profession enchant procs can stack when dual-wielding
3411 // DK runes (e.g., Unholy Strength) should refresh, not stack
3413 {
3414 uint32 enchantId = spellInfo->Effects[j].MiscValue;
3415 SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId);
3416 if (!enchant)
3417 break;
3418
3419 for (uint8 s = 0; s < MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS; ++s)
3420 {
3421 if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
3422 continue;
3423
3424 SpellInfo* procInfo = _GetSpellInfo(enchant->spellid[s]);
3425 if (!procInfo)
3426 continue;
3427
3428 // if proced directly from enchantment, not via proc aura
3429 // NOTE: Enchant Weapon - Blade Ward also has proc aura spell and is proced directly
3430 // however its not expected to stack so this check is good
3432 continue;
3433
3435 }
3436 }
3437 break;
3438 }
3439 }
3440 }
3441
3442 // Xinef: spells ignoring hit result should not be binary
3444 {
3445 for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
3446 {
3447 if (spellInfo->Effects[j].Effect)
3448 {
3449 switch (spellInfo->Effects[j].Effect)
3450 {
3458 continue;
3467 if (spellInfo->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE ||
3468 spellInfo->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE_PERCENT ||
3469 spellInfo->Effects[j].ApplyAuraName == SPELL_AURA_DUMMY ||
3470 spellInfo->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH ||
3471 spellInfo->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_HEALTH_FUNNEL ||
3472 spellInfo->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_DUMMY)
3473 continue;
3474 [[fallthrough]];
3475 default:
3476 if (!(spellInfo->Effects[j].CalcValue() ||
3477 ((spellInfo->Effects[j].Effect == SPELL_EFFECT_INTERRUPT_CAST || spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH)) &&
3479 continue;
3480
3481 if (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (spellInfo->SpellFamilyFlags[0] & 0x20)) // Frostbolt
3482 continue;
3483
3484 if (spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK &&
3485 ((spellInfo->SpellFamilyFlags[1] & 0x40000) || (spellInfo->SpellFamilyFlags[0] & 0x4000))) // Haunt/Drain Soul
3486 continue;
3487
3489 break;
3490 }
3491 }
3492 }
3493 }
3494
3495 // pussywizard:
3496 if ((spellInfo->SchoolMask & SPELL_SCHOOL_MASK_NORMAL) && (spellInfo->SchoolMask & SPELL_SCHOOL_MASK_MAGIC))
3497 {
3498 spellInfo->SchoolMask &= ~SPELL_SCHOOL_MASK_NORMAL;
3500 }
3501
3502 if (!spellInfo->_IsPositiveEffect(EFFECT_0, false))
3504
3505 if (!spellInfo->_IsPositiveEffect(EFFECT_1, false))
3507
3508 if (!spellInfo->_IsPositiveEffect(EFFECT_2, false))
3510
3511 if (spellInfo->SpellVisual[0] == 3879)
3513
3514 switch (spellInfo->SpellFamilyName)
3515 {
3517 // Shout
3518 if (spellInfo->SpellFamilyFlags[0] & 0x20000 || spellInfo->SpellFamilyFlags[1] & 0x20)
3520 break;
3521 case SPELLFAMILY_DRUID:
3522 // Roar
3523 if (spellInfo->SpellFamilyFlags[0] & 0x8)
3525 break;
3526 case SPELLFAMILY_HUNTER:
3527 // Aspects
3528 if (spellInfo->GetCategory() == 47)
3529 {
3531 }
3532 // Aimed Shot
3533 if (spellInfo->SpellFamilyFlags[0] & 0x00020000)
3534 {
3536 }
3537 break;
3538 default:
3539 break;
3540 }
3541
3542 switch (spellInfo->Id)
3543 {
3544 // Xinef: NOT CUSTOM, cant add in DBC CORRECTION because i need to swap effects, too much work to do there
3545 // Envenom
3546 case 32645:
3547 case 32684:
3548 case 57992:
3549 case 57993:
3550 {
3551 SpellEffectInfo info = spellInfo->Effects[EFFECT_0];
3552 spellInfo->Effects[EFFECT_0] = spellInfo->Effects[EFFECT_2];
3553 spellInfo->Effects[EFFECT_2] = info;
3554 break;
3555 }
3556
3557 // Xinef: Cooldown overwrites
3558 // Burst of Speed
3559 case 57493:
3560 spellInfo->RecoveryTime = 60000;
3561 spellInfo->_requireCooldownInfo = true;
3562 break;
3563 // Strafe Jotunheim Building
3564 case 7769:
3565 spellInfo->RecoveryTime = 1500;
3566 spellInfo->_requireCooldownInfo = true;
3567 break;
3568 case 44535: // Spirit Heal, abilities also have no cost
3569 spellInfo->Effects[EFFECT_0].MiscValue = 127;
3570 break;
3571 default:
3572 break;
3573 }
3574
3575 if (spellInfo->Speed > 0.0f)
3576 {
3577 if (SpellVisualEntry const* spellVisual = sSpellVisualStore.LookupEntry(spellInfo->SpellVisual[0]))
3578 {
3579 if (spellVisual->HasMissile)
3580 {
3581 if (spellVisual->MissileModel == -4 || spellVisual->MissileModel == -5)
3582 {
3584 }
3585 }
3586 }
3587 }
3588
3589 spellInfo->_InitializeExplicitTargetMask();
3590
3591 if (HasSpellCooldownOverride(spellInfo->Id))
3592 {
3593 SpellCooldownOverride spellOverride = GetSpellCooldownOverride(spellInfo->Id);
3594
3595 if (spellInfo->RecoveryTime != spellOverride.RecoveryTime)
3596 {
3597 spellInfo->RecoveryTime = spellOverride.RecoveryTime;
3598 }
3599
3600 if (spellInfo->CategoryRecoveryTime != spellOverride.CategoryRecoveryTime)
3601 {
3602 spellInfo->CategoryRecoveryTime = spellOverride.CategoryRecoveryTime;
3603 }
3604
3605 if (spellInfo->StartRecoveryTime != spellOverride.StartRecoveryTime)
3606 {
3607 spellInfo->RecoveryTime = spellOverride.RecoveryTime;
3608 }
3609
3610 if (spellInfo->StartRecoveryCategory != spellOverride.StartRecoveryCategory)
3611 {
3612 spellInfo->RecoveryTime = spellOverride.RecoveryTime;
3613 }
3614 }
3615
3616 sScriptMgr->OnLoadSpellCustomAttr(spellInfo);
3617 }
3618
3619 // Xinef: addition for binary spells, ommit spells triggering other spells
3620 for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
3621 {
3622 spellInfo = mSpellInfoMap[i];
3623 if (!spellInfo)
3624 continue;
3625
3626 if (!(spellInfo->AttributesCu & SPELL_ATTR0_CU_BINARY_SPELL))
3627 continue;
3628
3629 bool allNonBinary = true;
3630 bool overrideAttr = false;
3631 for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
3632 {
3633 if (spellInfo->Effects[j].ApplyAuraName && spellInfo->Effects[j].TriggerSpell)
3634 {
3635 switch (spellInfo->Effects[j].ApplyAuraName)
3636 {
3640 if (SpellInfo const* triggerSpell = GetSpellInfo(spellInfo->Effects[j].TriggerSpell))
3641 {
3642 overrideAttr = true;
3643 if (triggerSpell->AttributesCu & SPELL_ATTR0_CU_BINARY_SPELL)
3644 allNonBinary = false;
3645 }
3646 break;
3647 default:
3648 break;
3649 }
3650 }
3651 }
3652
3653 if (overrideAttr && allNonBinary)
3654 spellInfo->AttributesCu &= ~SPELL_ATTR0_CU_BINARY_SPELL;
3655 }
3656
3657 LOG_INFO("server.loading", ">> Loaded SpellInfo Custom Attributes in {} ms", GetMSTimeDiffToNow(oldMSTime));
3658 LOG_INFO("server.loading", " ");
3659}
@ ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL
Definition DBCEnums.h:367
DBCStorage< SpellVisualEntry > sSpellVisualStore(SpellVisualfmt)
DBCStorage< TalentEntry > sTalentStore(TalentEntryfmt)
#define MAX_TALENT_RANK
Definition DBCStructure.h:1954
#define MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS
Definition DBCStructure.h:1874
#define sScriptMgr
Definition ScriptMgr.h:769
@ SPELL_EFFECT_ENERGIZE_PCT
Definition SharedDefines.h:903
@ SPELL_EFFECT_APPLY_AREA_AURA_PARTY
Definition SharedDefines.h:801
@ SPELL_EFFECT_ENCHANT_HELD_ITEM
Definition SharedDefines.h:858
@ SPELL_EFFECT_ENCHANT_ITEM
Definition SharedDefines.h:819
@ SPELL_EFFECT_HEALTH_LEECH
Definition SharedDefines.h:775
@ SPELL_EFFECT_WEAPON_DAMAGE
Definition SharedDefines.h:824
@ SPELL_EFFECT_HEAL
Definition SharedDefines.h:776
@ SPELL_EFFECT_NORMALIZED_WEAPON_DMG
Definition SharedDefines.h:887
@ SPELL_EFFECT_TRIGGER_SPELL
Definition SharedDefines.h:830
@ SPELL_EFFECT_HEAL_MAX_HEALTH
Definition SharedDefines.h:833
@ SPELL_EFFECT_APPLY_AREA_AURA_PET
Definition SharedDefines.h:885
@ SPELL_EFFECT_PICKPOCKET
Definition SharedDefines.h:837
@ SPELL_EFFECT_HEAL_MECHANICAL
Definition SharedDefines.h:841
@ SPELL_EFFECT_WEAPON_PERCENT_DAMAGE
Definition SharedDefines.h:797
@ SPELL_EFFECT_APPLY_AREA_AURA_RAID
Definition SharedDefines.h:831
@ SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL
Definition SharedDefines.h:783
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
Definition SharedDefines.h:793
@ SPELL_EFFECT_ENERGIZE
Definition SharedDefines.h:796
@ SPELL_EFFECT_POWER_DRAIN
Definition SharedDefines.h:774
@ SPELL_EFFECT_SCHOOL_DAMAGE
Definition SharedDefines.h:768
@ SPELL_EFFECT_APPLY_AREA_AURA_ENEMY
Definition SharedDefines.h:895
@ SPELL_EFFECT_HEAL_PCT
Definition SharedDefines.h:902
@ SPELL_EFFECT_INTERRUPT_CAST
Definition SharedDefines.h:834
@ SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC
Definition SharedDefines.h:922
@ SPELL_EFFECT_APPLY_AREA_AURA_OWNER
Definition SharedDefines.h:909
@ SPELLFAMILY_WARLOCK
Definition SharedDefines.h:3789
@ SPELLFAMILY_DRUID
Definition SharedDefines.h:3791
SpellAttr0
Definition SharedDefines.h:369
@ SPELL_ATTR0_DO_NOT_DISPLAY
Definition SharedDefines.h:377
@ SKILL_ENCHANTING
Definition SharedDefines.h:3187
@ SPELL_SCHOOL_MASK_NORMAL
Definition SharedDefines.h:285
@ SPELL_AURA_PERIODIC_DAMAGE
Definition SpellAuraDefines.h:66
@ SPELL_AURA_PERIODIC_HEALTH_FUNNEL
Definition SpellAuraDefines.h:125
@ SPELL_AURA_MOD_POSSESS_PET
Definition SpellAuraDefines.h:191
@ SPELL_AURA_CONVERT_RUNE
Definition SpellAuraDefines.h:312
@ SPELL_AURA_MOD_FEAR
Definition SpellAuraDefines.h:70
@ SPELL_AURA_CONTROL_VEHICLE
Definition SpellAuraDefines.h:299
@ SPELL_AURA_MOD_INVISIBILITY
Definition SpellAuraDefines.h:81
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
Definition SpellAuraDefines.h:152
@ SPELL_AURA_AOE_CHARM
Definition SpellAuraDefines.h:240
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE
Definition SpellAuraDefines.h:290
@ SPELL_AURA_MOD_INVISIBILITY_DETECT
Definition SpellAuraDefines.h:82
@ SPELL_AURA_WATER_BREATHING
Definition SpellAuraDefines.h:145
@ SPELL_AURA_PERIODIC_LEECH
Definition SpellAuraDefines.h:116
@ SPELL_AURA_OPEN_STABLE
Definition SpellAuraDefines.h:355
@ SPELL_AURA_MOD_CONFUSE
Definition SpellAuraDefines.h:68
@ SPELL_AURA_TRACK_CREATURES
Definition SpellAuraDefines.h:107
@ SPELL_AURA_MOD_POSSESS
Definition SpellAuraDefines.h:65
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT
Definition SpellAuraDefines.h:111
@ SPELL_AURA_BIND_SIGHT
Definition SpellAuraDefines.h:64
@ SPELL_ATTR0_CU_IGNORE_BINARY
Definition SpellInfo.h:186
@ SPELL_ATTR0_CU_ENCHANT_PROC
Definition SpellInfo.h:177
@ SPELL_ATTR0_CU_FORCE_SEND_CATEGORY_COOLDOWNS
Definition SpellInfo.h:205
@ SPELL_ATTR0_CU_DIRECT_DAMAGE
Definition SpellInfo.h:185
@ SPELL_ATTR0_CU_POSITIVE
Definition SpellInfo.h:212
@ SPELL_ATTR0_CU_FORCE_AURA_SAVING
Definition SpellInfo.h:206
@ SPELL_ATTR0_CU_NO_PVP_FLAG
Definition SpellInfo.h:184
@ SPELL_ATTR0_CU_DONT_BREAK_STEALTH
Definition SpellInfo.h:183
@ SPELL_ATTR0_CU_CONE_BACK
Definition SpellInfo.h:178
@ SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED
Definition SpellInfo.h:201
@ SPELL_ATTR0_CU_NEGATIVE_EFF2
Definition SpellInfo.h:191
@ SPELL_ATTR0_CU_AURA_CC
Definition SpellInfo.h:182
@ SPELL_ATTR0_CU_NEGATIVE_EFF1
Definition SpellInfo.h:190
@ SPELL_ATTR0_CU_NEGATIVE
Definition SpellInfo.h:211
@ SPELL_ATTR0_CU_NEEDS_AMMO_DATA
Definition SpellInfo.h:196
@ SPELL_ATTR0_CU_POSITIVE_EFF0
Definition SpellInfo.h:202
@ SPELL_ATTR0_CU_NEGATIVE_EFF0
Definition SpellInfo.h:189
@ SPELL_ATTR0_CU_BINARY_SPELL
Definition SpellInfo.h:197
@ SPELL_ATTR0_CU_SCHOOLMASK_NORMAL_WITH_MAGIC
Definition SpellInfo.h:200
@ SPELL_ATTR0_CU_PICKPOCKET
Definition SpellInfo.h:187
@ SPELL_ATTR0_CU_NO_INITIAL_THREAT
Definition SpellInfo.h:181
bool IsPartOfSkillLine(uint32 skillId, uint32 spellId)
Definition SpellMgr.cpp:50
uint32 GetCategory() const
Definition SpellInfo.cpp:884
uint32 AttributesCu
Definition SpellInfo.h:356
bool _requireCooldownInfo
Definition SpellInfo.h:427
uint32 SchoolMask
Definition SpellInfo.h:416
std::array< uint32, 2 > SpellVisual
Definition SpellInfo.h:403
uint32 CategoryRecoveryTime
Definition SpellInfo.h:373
bool _IsPositiveEffect(uint8 effIndex, bool deep) const
Definition SpellInfo.cpp:3071
uint32 StartRecoveryTime
Definition SpellInfo.h:375
void _InitializeExplicitTargetMask()
Definition SpellInfo.cpp:3043
uint32 StartRecoveryCategory
Definition SpellInfo.h:374
uint32 AuraInterruptFlags
Definition SpellInfo.h:377
SpellCooldownOverride GetSpellCooldownOverride(uint32 spellId) const
Definition SpellMgr.cpp:3130
SpellInfo * _GetSpellInfo(uint32 spellId)
Definition SpellMgr.h:779
bool HasSpellCooldownOverride(uint32 spellId) const
Definition SpellMgr.cpp:3125
uint32 spellid[MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS]
Definition DBCStructure.h:1883
uint32 type[MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS]
Definition DBCStructure.h:1880
Definition DBCStructure.h:1907
Definition DBCStructure.h:1959
std::array< uint32, MAX_TALENT_RANK > RankID
Definition DBCStructure.h:1964

References _GetSpellInfo(), SpellInfo::_InitializeExplicitTargetMask(), SpellInfo::_IsPositiveEffect(), SpellInfo::_requireCooldownInfo, SpellInfo::AttributesCu, AURA_INTERRUPT_FLAG_CAST, SpellInfo::AuraInterruptFlags, SpellInfo::CategoryRecoveryTime, SpellCooldownOverride::CategoryRecoveryTime, EFFECT_0, EFFECT_1, EFFECT_2, SpellInfo::Effects, Field::Get(), SpellInfo::GetCategory(), getMSTime(), GetMSTimeDiffToNow(), GetSpellCooldownOverride(), GetSpellInfo(), GetSpellInfoStoreSize(), SpellInfo::HasAttribute(), SpellInfo::HasAura(), HasSpellCooldownOverride(), SpellInfo::Id, IsPartOfSkillLine(), ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL, LOG_ERROR, LOG_INFO, LOG_WARN, MAX_SPELL_EFFECTS, MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS, MAX_TALENT_RANK, mSpellInfoMap, mTalentSpellAdditionalSet, TalentEntry::RankID, SpellInfo::RecoveryTime, SpellCooldownOverride::RecoveryTime, SpellInfo::SchoolMask, SKILL_ENCHANTING, SpellInfo::Speed, SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED, SPELL_ATTR0_CU_AURA_CC, SPELL_ATTR0_CU_BINARY_SPELL, SPELL_ATTR0_CU_CONE_BACK, SPELL_ATTR0_CU_DIRECT_DAMAGE, SPELL_ATTR0_CU_DONT_BREAK_STEALTH, SPELL_ATTR0_CU_ENCHANT_PROC, SPELL_ATTR0_CU_FORCE_AURA_SAVING, SPELL_ATTR0_CU_FORCE_SEND_CATEGORY_COOLDOWNS, SPELL_ATTR0_CU_IGNORE_BINARY, SPELL_ATTR0_CU_NEEDS_AMMO_DATA, SPELL_ATTR0_CU_NEGATIVE, SPELL_ATTR0_CU_NEGATIVE_EFF0, SPELL_ATTR0_CU_NEGATIVE_EFF1, SPELL_ATTR0_CU_NEGATIVE_EFF2, SPELL_ATTR0_CU_NO_INITIAL_THREAT, SPELL_ATTR0_CU_NO_PVP_FLAG, SPELL_ATTR0_CU_PICKPOCKET, SPELL_ATTR0_CU_POSITIVE, SPELL_ATTR0_CU_POSITIVE_EFF0, SPELL_ATTR0_CU_SCHOOLMASK_NORMAL_WITH_MAGIC, SPELL_ATTR0_DO_NOT_DISPLAY, SPELL_ATTR0_NO_IMMUNITIES, SPELL_ATTR0_PASSIVE, SPELL_ATTR3_ALWAYS_HIT, SPELL_AURA_AOE_CHARM, SPELL_AURA_BIND_SIGHT, SPELL_AURA_CONTROL_VEHICLE, SPELL_AURA_CONVERT_RUNE, SPELL_AURA_DUMMY, SPELL_AURA_MOD_CHARM, SPELL_AURA_MOD_CONFUSE, SPELL_AURA_MOD_FEAR, SPELL_AURA_MOD_INVISIBILITY, SPELL_AURA_MOD_INVISIBILITY_DETECT, SPELL_AURA_MOD_POSSESS, SPELL_AURA_MOD_POSSESS_PET, SPELL_AURA_MOD_RANGED_HASTE, SPELL_AURA_MOD_STUN, SPELL_AURA_OPEN_STABLE, SPELL_AURA_PERIODIC_DAMAGE, SPELL_AURA_PERIODIC_DAMAGE_PERCENT, SPELL_AURA_PERIODIC_DUMMY, SPELL_AURA_PERIODIC_HEALTH_FUNNEL, SPELL_AURA_PERIODIC_LEECH, SPELL_AURA_PERIODIC_TRIGGER_SPELL, SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT, SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE, SPELL_AURA_PROC_TRIGGER_SPELL, SPELL_AURA_TRACK_CREATURES, SPELL_AURA_WATER_BREATHING, SPELL_EFFECT_APPLY_AREA_AURA_ENEMY, SPELL_EFFECT_APPLY_AREA_AURA_FRIEND, SPELL_EFFECT_APPLY_AREA_AURA_OWNER, SPELL_EFFECT_APPLY_AREA_AURA_PARTY, SPELL_EFFECT_APPLY_AREA_AURA_PET, SPELL_EFFECT_APPLY_AREA_AURA_RAID, SPELL_EFFECT_APPLY_AURA, SPELL_EFFECT_CREATE_ITEM, SPELL_EFFECT_ENCHANT_HELD_ITEM, SPELL_EFFECT_ENCHANT_ITEM, SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC, SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY, SPELL_EFFECT_ENERGIZE, SPELL_EFFECT_ENERGIZE_PCT, SPELL_EFFECT_HEAL, SPELL_EFFECT_HEAL_MAX_HEALTH, SPELL_EFFECT_HEAL_MECHANICAL, SPELL_EFFECT_HEAL_PCT, SPELL_EFFECT_HEALTH_LEECH, SPELL_EFFECT_INTERRUPT_CAST, SPELL_EFFECT_LEARN_SPELL, SPELL_EFFECT_NORMALIZED_WEAPON_DMG, SPELL_EFFECT_PERSISTENT_AREA_AURA, SPELL_EFFECT_PICKPOCKET, SPELL_EFFECT_POWER_BURN, SPELL_EFFECT_POWER_DRAIN, SPELL_EFFECT_SCHOOL_DAMAGE, SPELL_EFFECT_TRIGGER_SPELL, SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE, SPELL_EFFECT_WEAPON_DAMAGE, SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL, SPELL_EFFECT_WEAPON_PERCENT_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, SPELL_SCHOOL_MASK_NORMAL, SPELLFAMILY_DRUID, SPELLFAMILY_HUNTER, SPELLFAMILY_MAGE, SPELLFAMILY_WARLOCK, SPELLFAMILY_WARRIOR, SpellInfo::SpellFamilyFlags, SpellInfo::SpellFamilyName, SpellItemEnchantmentEntry::spellid, SpellInfo::SpellVisual, sScriptMgr, sSpellItemEnchantmentStore, sSpellVisualStore, sTalentStore, SpellInfo::StartRecoveryCategory, SpellCooldownOverride::StartRecoveryCategory, SpellInfo::StartRecoveryTime, SpellCooldownOverride::StartRecoveryTime, SpellItemEnchantmentEntry::type, and WorldDatabase.

◆ LoadSpellInfoImmunities()

void SpellMgr::LoadSpellInfoImmunities ( )
3662{
3663 uint32 oldMSTime = getMSTime();
3664
3665 for (SpellInfo* spellInfo : mSpellInfoMap)
3666 {
3667 if (!spellInfo)
3668 continue;
3669 spellInfo->_LoadImmunityInfo();
3670 }
3671
3672 LOG_INFO("server.loading", ">> Loaded SpellInfo immunity infos in {} ms", GetMSTimeDiffToNow(oldMSTime));
3673}

References getMSTime(), GetMSTimeDiffToNow(), LOG_INFO, and mSpellInfoMap.

◆ LoadSpellInfoStore()

void SpellMgr::LoadSpellInfoStore ( )
3064{
3065 uint32 oldMSTime = getMSTime();
3066
3068 mSpellInfoMap.resize(sSpellStore.GetNumRows(), nullptr);
3069
3070 for (SpellEntry const* spellEntry : sSpellStore)
3071 mSpellInfoMap[spellEntry->Id] = new SpellInfo(spellEntry);
3072
3073 for (uint32 spellIndex = 0; spellIndex < GetSpellInfoStoreSize(); ++spellIndex)
3074 {
3075 if (!mSpellInfoMap[spellIndex])
3076 continue;
3077
3078 for (SpellEffectInfo const& spellEffectInfo : mSpellInfoMap[spellIndex]->GetEffects())
3079 {
3080 //ASSERT(effect.EffectIndex < MAX_SPELL_EFFECTS, "MAX_SPELL_EFFECTS must be at least {}", effect.EffectIndex + 1);
3081 ASSERT(spellEffectInfo.Effect < TOTAL_SPELL_EFFECTS, "TOTAL_SPELL_EFFECTS must be at least {}", spellEffectInfo.Effect + 1);
3082 ASSERT(spellEffectInfo.ApplyAuraName < TOTAL_AURAS, "TOTAL_AURAS must be at least {}", spellEffectInfo.ApplyAuraName + 1);
3083 ASSERT(spellEffectInfo.TargetA.GetTarget() < TOTAL_SPELL_TARGETS, "TOTAL_SPELL_TARGETS must be at least {}", spellEffectInfo.TargetA.GetTarget() + 1);
3084 ASSERT(spellEffectInfo.TargetB.GetTarget() < TOTAL_SPELL_TARGETS, "TOTAL_SPELL_TARGETS must be at least {}", spellEffectInfo.TargetB.GetTarget() + 1);
3085 }
3086 }
3087
3089
3090 LOG_INFO("server.loading", ">> Loaded Spell Custom Attributes in {} ms", GetMSTimeDiffToNow(oldMSTime));
3091 LOG_INFO("server.loading", " ");
3092}
DBCStorage< SpellEntry > sSpellStore(SpellEntryfmt)
@ TOTAL_SPELL_TARGETS
Definition SharedDefines.h:1518
void LoadCreatureImmunities()
Definition SpellMgr.cpp:65
Definition DBCStructure.h:1678

References ASSERT, getMSTime(), GetMSTimeDiffToNow(), GetSpellInfoStoreSize(), LoadCreatureImmunities(), LOG_INFO, mSpellInfoMap, sSpellStore, TOTAL_AURAS, TOTAL_SPELL_EFFECTS, TOTAL_SPELL_TARGETS, and UnloadSpellInfoStore().

◆ LoadSpellJumpDistances()

void SpellMgr::LoadSpellJumpDistances ( )
3172{
3173 uint32 oldMSTime = getMSTime();
3174
3175 QueryResult result = WorldDatabase.Query("SELECT ID, JumpDistance FROM spell_jump_distance");
3176
3177 if (!result)
3178 {
3179 LOG_WARN("server.loading", ">> Loaded 0 spell jump distances. DB table `spell_jump_distance` is empty.");
3180 LOG_INFO("server.loading", " ");
3181 return;
3182 }
3183
3184 uint32 count = 0;
3185 do
3186 {
3187 Field const* fields = result->Fetch();
3188
3189 uint32 const spellId = fields[0].Get<uint32>();
3190 float const jumpDistance = fields[1].Get<float>();
3191
3192 SpellInfo* spellInfo = _GetSpellInfo(spellId);
3193 if (!spellInfo)
3194 {
3195 LOG_ERROR("sql.sql", "Table `spell_jump_distance` has wrong spell (spell_id: {}), ignored.", spellId);
3196 continue;
3197 }
3198
3199 spellInfo->JumpDistance = jumpDistance;
3200 ++count;
3201 } while (result->NextRow());
3202
3203 LOG_INFO("server.loading", ">> Loaded {} spell jump distances in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
3204 LOG_INFO("server.loading", " ");
3205}

References _GetSpellInfo(), Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, and WorldDatabase.

◆ LoadSpellLearnSkills()

void SpellMgr::LoadSpellLearnSkills ( )
1468{
1469 uint32 oldMSTime = getMSTime();
1470
1471 mSpellLearnSkills.clear(); // need for reload case
1472
1473 // search auto-learned skills and add its to map also for use in unlearn spells/talents
1474 uint32 dbc_count = 0;
1475 for (uint32 spell = 0; spell < GetSpellInfoStoreSize(); ++spell)
1476 {
1477 SpellInfo const* entry = GetSpellInfo(spell);
1478
1479 if (!entry)
1480 continue;
1481
1482 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
1483 {
1484 SpellLearnSkillNode dbc_node;
1485 switch (entry->Effects[i].Effect)
1486 {
1487 case SPELL_EFFECT_SKILL:
1488 dbc_node.skill = entry->Effects[i].MiscValue;
1489 dbc_node.step = entry->Effects[i].CalcValue();
1490 if (dbc_node.skill != SKILL_RIDING)
1491 {
1492 dbc_node.value = 1;
1493 }
1494 else
1495 {
1496 dbc_node.value = dbc_node.step * 75;
1497 }
1498 dbc_node.maxvalue = dbc_node.step * 75;
1499 break;
1501 dbc_node.skill = SKILL_DUAL_WIELD;
1502 dbc_node.step = 1;
1503 dbc_node.value = 1;
1504 dbc_node.maxvalue = 1;
1505 break;
1506 default:
1507 continue;
1508 }
1509
1510 mSpellLearnSkills[spell] = dbc_node;
1511 ++dbc_count;
1512 break;
1513 }
1514 }
1515
1516 LOG_INFO("server.loading", ">> Loaded {} Spell Learn Skills From DBC in {} ms", dbc_count, GetMSTimeDiffToNow(oldMSTime));
1517 LOG_INFO("server.loading", " ");
1518}
@ SPELL_EFFECT_SKILL
Definition SharedDefines.h:884
@ SPELL_EFFECT_DUAL_WIELD
Definition SharedDefines.h:806
@ SKILL_DUAL_WIELD
Definition SharedDefines.h:3121
@ SKILL_RIDING
Definition SharedDefines.h:3224
Definition SpellMgr.h:585
uint16 value
Definition SpellMgr.h:588
uint16 step
Definition SpellMgr.h:587
uint16 maxvalue
Definition SpellMgr.h:589
uint16 skill
Definition SpellMgr.h:586

References SpellInfo::Effects, getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), GetSpellInfoStoreSize(), LOG_INFO, MAX_SPELL_EFFECTS, SpellLearnSkillNode::maxvalue, mSpellLearnSkills, SpellLearnSkillNode::skill, SKILL_DUAL_WIELD, SKILL_RIDING, SPELL_EFFECT_DUAL_WIELD, SPELL_EFFECT_SKILL, SpellLearnSkillNode::step, and SpellLearnSkillNode::value.

◆ LoadSpellLinked()

void SpellMgr::LoadSpellLinked ( )
2626{
2627 uint32 oldMSTime = getMSTime();
2628
2629 mSpellLinkedMap.clear(); // need for reload case
2630
2631 // 0 1 2
2632 QueryResult result = WorldDatabase.Query("SELECT spell_trigger, spell_effect, type FROM spell_linked_spell");
2633 if (!result)
2634 {
2635 LOG_WARN("server.loading", ">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty.");
2636 LOG_INFO("server.loading", " ");
2637 return;
2638 }
2639
2640 uint32 count = 0;
2641 do
2642 {
2643 Field* fields = result->Fetch();
2644
2645 int32 trigger = fields[0].Get<int32>();
2646 int32 effect = fields[1].Get<int32>();
2647 int32 type = fields[2].Get<uint8>();
2648
2649 SpellInfo const* spellInfo = GetSpellInfo(std::abs(trigger));
2650 if (!spellInfo)
2651 {
2652 LOG_ERROR("sql.sql", "Spell {} listed in `spell_linked_spell` does not exist", std::abs(trigger));
2653 continue;
2654 }
2655 spellInfo = GetSpellInfo(std::abs(effect));
2656 if (!spellInfo)
2657 {
2658 LOG_ERROR("sql.sql", "Spell {} listed in `spell_linked_spell` does not exist", std::abs(effect));
2659 continue;
2660 }
2661
2662 if (type) //we will find a better way when more types are needed
2663 {
2664 if (trigger > 0)
2665 trigger += SPELL_LINKED_MAX_SPELLS * type;
2666 else
2667 trigger -= SPELL_LINKED_MAX_SPELLS * type;
2668 }
2669 mSpellLinkedMap[trigger].push_back(effect);
2670
2671 ++count;
2672 } while (result->NextRow());
2673
2674 LOG_INFO("server.loading", ">> Loaded {} Linked Spells in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2675 LOG_INFO("server.loading", " ");
2676}
#define SPELL_LINKED_MAX_SPELLS
Definition SpellMgr.h:95

References Field::Get(), getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), LOG_ERROR, LOG_INFO, LOG_WARN, mSpellLinkedMap, SPELL_LINKED_MAX_SPELLS, and WorldDatabase.

◆ LoadSpellMixology()

void SpellMgr::LoadSpellMixology ( )
2419{
2420 uint32 oldMSTime = getMSTime();
2421
2422 mSpellMixologyMap.clear(); // need for reload case
2423
2424 // 0 1
2425 QueryResult result = WorldDatabase.Query("SELECT entry, pctMod FROM spell_mixology");
2426 if (!result)
2427 {
2428 LOG_WARN("server.loading", ">> Loaded 0 mixology bonuses. DB table `spell_mixology` is empty.");
2429 LOG_INFO("server.loading", " ");
2430 return;
2431 }
2432
2433 uint32 count = 0;
2434 do
2435 {
2436 Field* fields = result->Fetch();
2437
2438 uint32 entry = fields[0].Get<uint32>();
2439
2440 if (!GetSpellInfo(entry))
2441 {
2442 LOG_ERROR("sql.sql", "Spell {} listed in `spell_mixology` does not exist", entry);
2443 continue;
2444 }
2445
2446 mSpellMixologyMap[entry] = fields[1].Get<float>();
2447 ++count;
2448 } while (result->NextRow());
2449
2450 LOG_INFO("server.loading", ">> Loaded {} Mixology Bonuses in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2451 LOG_INFO("server.loading", " ");
2452}

References Field::Get(), getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), LOG_ERROR, LOG_INFO, LOG_WARN, mSpellMixologyMap, and WorldDatabase.

◆ LoadSpellPetAuras()

void SpellMgr::LoadSpellPetAuras ( )
2477{
2478 uint32 oldMSTime = getMSTime();
2479
2480 mSpellPetAuraMap.clear(); // need for reload case
2481
2482 // 0 1 2 3
2483 QueryResult result = WorldDatabase.Query("SELECT spell, effectId, pet, aura FROM spell_pet_auras");
2484 if (!result)
2485 {
2486 LOG_WARN("server.loading", ">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty.");
2487 LOG_INFO("server.loading", " ");
2488 return;
2489 }
2490
2491 uint32 count = 0;
2492 do
2493 {
2494 Field* fields = result->Fetch();
2495
2496 uint32 spell = fields[0].Get<uint32>();
2497 uint8 eff = fields[1].Get<uint8>();
2498 uint32 pet = fields[2].Get<uint32>();
2499 uint32 aura = fields[3].Get<uint32>();
2500
2501 SpellPetAuraMap::iterator itr = mSpellPetAuraMap.find((spell << 8) + eff);
2502 if (itr != mSpellPetAuraMap.end())
2503 itr->second.AddAura(pet, aura);
2504 else
2505 {
2506 SpellInfo const* spellInfo = GetSpellInfo(spell);
2507 if (!spellInfo)
2508 {
2509 LOG_ERROR("sql.sql", "Spell {} listed in `spell_pet_auras` does not exist", spell);
2510 continue;
2511 }
2512 if (spellInfo->Effects[eff].Effect != SPELL_EFFECT_DUMMY &&
2513 (spellInfo->Effects[eff].Effect != SPELL_EFFECT_APPLY_AURA ||
2514 spellInfo->Effects[eff].ApplyAuraName != SPELL_AURA_DUMMY))
2515 {
2516 LOG_ERROR("spells", "Spell {} listed in `spell_pet_auras` does not have dummy aura or dummy effect", spell);
2517 continue;
2518 }
2519
2520 SpellInfo const* spellInfo2 = GetSpellInfo(aura);
2521 if (!spellInfo2)
2522 {
2523 LOG_ERROR("sql.sql", "Aura {} listed in `spell_pet_auras` does not exist", aura);
2524 continue;
2525 }
2526
2527 PetAura pa(pet, aura, spellInfo->Effects[eff].TargetA.GetTarget() == TARGET_UNIT_PET, spellInfo->Effects[eff].CalcValue());
2528 mSpellPetAuraMap[(spell << 8) + eff] = pa;
2529 }
2530
2531 ++count;
2532 } while (result->NextRow());
2533
2534 LOG_INFO("server.loading", ">> Loaded {} Spell Pet Auras in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2535 LOG_INFO("server.loading", " ");
2536}
Definition SpellMgr.h:469

References SpellInfo::Effects, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), LOG_ERROR, LOG_INFO, LOG_WARN, mSpellPetAuraMap, SPELL_AURA_DUMMY, SPELL_EFFECT_APPLY_AURA, SPELL_EFFECT_DUMMY, TARGET_UNIT_PET, and WorldDatabase.

◆ LoadSpellProcs()

void SpellMgr::LoadSpellProcs ( )
2048{
2049 uint32 oldMSTime = getMSTime();
2050
2051 mSpellProcMap.clear(); // need for reload case
2052
2053 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
2054 QueryResult result = WorldDatabase.Query("SELECT SpellId, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, ProcFlags, SpellTypeMask, SpellPhaseMask, HitMask, AttributesMask, DisableEffectsMask, ProcsPerMinute, Chance, Cooldown, Charges FROM spell_proc");
2055 if (!result)
2056 {
2057 LOG_WARN("server.loading", ">> Loaded 0 Spell Proc Conditions And Data. DB table `spell_proc` Is Empty.");
2058 LOG_INFO("server.loading", " ");
2059 return;
2060 }
2061
2062 uint32 count = 0;
2063 do
2064 {
2065 Field* fields = result->Fetch();
2066
2067 int32 spellId = fields[0].Get<int32>();
2068
2069 bool allRanks = false;
2070 if (spellId < 0)
2071 {
2072 allRanks = true;
2073 spellId = -spellId;
2074 }
2075
2076 SpellInfo const* spellInfo = GetSpellInfo(spellId);
2077 if (!spellInfo)
2078 {
2079 LOG_ERROR("sql.sql", "Spell {} listed in `spell_proc` does not exist", spellId);
2080 continue;
2081 }
2082
2083 if (allRanks)
2084 {
2085 if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId))
2086 {
2087 LOG_ERROR("sql.sql", "Spell {} listed in `spell_proc` is not first rank of spell.", fields[0].Get<int32>());
2088 continue;
2089 }
2090 }
2091
2092 SpellProcEntry baseProcEntry;
2093
2094 baseProcEntry.SchoolMask = fields[1].Get<int8>();
2095 baseProcEntry.SpellFamilyName = fields[2].Get<uint16>();
2096 baseProcEntry.SpellFamilyMask[0] = fields[3].Get<uint32>();
2097 baseProcEntry.SpellFamilyMask[1] = fields[4].Get<uint32>();
2098 baseProcEntry.SpellFamilyMask[2] = fields[5].Get<uint32>();
2099 baseProcEntry.ProcFlags = fields[6].Get<uint32>();
2100 baseProcEntry.SpellTypeMask = fields[7].Get<uint32>();
2101 baseProcEntry.SpellPhaseMask = fields[8].Get<uint32>();
2102 baseProcEntry.HitMask = fields[9].Get<uint32>();
2103 baseProcEntry.AttributesMask = fields[10].Get<uint32>();
2104 baseProcEntry.DisableEffectsMask = fields[11].Get<uint32>();
2105 baseProcEntry.ProcsPerMinute = fields[12].Get<float>();
2106 baseProcEntry.Chance = fields[13].Get<float>();
2107 baseProcEntry.Cooldown = Milliseconds(fields[14].Get<uint32>());
2108 baseProcEntry.Charges = fields[15].Get<uint32>();
2109
2110 while (spellInfo)
2111 {
2112 if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end())
2113 {
2114 LOG_ERROR("sql.sql", "Spell {} listed in `spell_proc` has duplicate entry in the table", spellId);
2115 break;
2116 }
2117 SpellProcEntry procEntry = SpellProcEntry(baseProcEntry);
2118
2119 // take defaults from dbcs
2120 if (!procEntry.ProcFlags)
2121 procEntry.ProcFlags = spellInfo->ProcFlags;
2122 if (!procEntry.Charges)
2123 procEntry.Charges = spellInfo->ProcCharges;
2124 if (!procEntry.Chance && !procEntry.ProcsPerMinute)
2125 procEntry.Chance = float(spellInfo->ProcChance);
2126
2127 // validate data
2128 if (procEntry.SchoolMask & ~SPELL_SCHOOL_MASK_ALL)
2129 LOG_ERROR("sql.sql", "`spell_proc` table entry for SpellId {} has wrong `SchoolMask` set: {}", spellId, procEntry.SchoolMask);
2130 if (procEntry.SpellFamilyName && (procEntry.SpellFamilyName < 3 || procEntry.SpellFamilyName > 17 || procEntry.SpellFamilyName == 14 || procEntry.SpellFamilyName == 16))
2131 LOG_ERROR("sql.sql", "`spell_proc` table entry for SpellId {} has wrong `SpellFamilyName` set: {}", spellId, procEntry.SpellFamilyName);
2132 if (procEntry.Chance < 0)
2133 {
2134 LOG_ERROR("sql.sql", "`spell_proc` table entry for SpellId {} has negative value in `Chance` field", spellId);
2135 procEntry.Chance = 0;
2136 }
2137 if (procEntry.ProcsPerMinute < 0)
2138 {
2139 LOG_ERROR("sql.sql", "`spell_proc` table entry for SpellId {} has negative value in `ProcsPerMinute` field", spellId);
2140 procEntry.ProcsPerMinute = 0;
2141 }
2142 if (procEntry.Charges > 99)
2143 {
2144 LOG_ERROR("sql.sql", "`spell_proc` table entry for SpellId {} has too big value in `Charges` field", spellId);
2145 procEntry.Charges = 99;
2146 }
2147 if (!procEntry.ProcFlags)
2148 LOG_ERROR("sql.sql", "`spell_proc` table entry for SpellId {} doesn't have `ProcFlags` value defined, proc will not be triggered", spellId);
2149 if (procEntry.SpellTypeMask & ~PROC_SPELL_TYPE_MASK_ALL)
2150 LOG_ERROR("sql.sql", "`spell_proc` table entry for SpellId {} has wrong `SpellTypeMask` set: {}", spellId, procEntry.SpellTypeMask);
2151 if (procEntry.SpellTypeMask && !(procEntry.ProcFlags & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK)))
2152 LOG_ERROR("sql.sql", "`spell_proc` table entry for SpellId {} has `SpellTypeMask` value defined, but it won't be used for defined `ProcFlags` value", spellId);
2153 if (!procEntry.SpellPhaseMask && procEntry.ProcFlags & REQ_SPELL_PHASE_PROC_FLAG_MASK)
2154 LOG_ERROR("sql.sql", "`spell_proc` table entry for SpellId {} doesn't have `SpellPhaseMask` value defined, but it's required for defined `ProcFlags` value, proc will not be triggered", spellId);
2156 LOG_ERROR("sql.sql", "`spell_proc` table entry for SpellId {} has wrong `SpellPhaseMask` set: {}", spellId, procEntry.SpellPhaseMask);
2157 if (procEntry.SpellPhaseMask && !(procEntry.ProcFlags & REQ_SPELL_PHASE_PROC_FLAG_MASK))
2158 LOG_ERROR("sql.sql", "`spell_proc` table entry for SpellId {} has `SpellPhaseMask` value defined, but it won't be used for defined `ProcFlags` value", spellId);
2159 if (procEntry.HitMask & ~PROC_HIT_MASK_ALL)
2160 LOG_ERROR("sql.sql", "`spell_proc` table entry for SpellId {} has wrong `HitMask` set: {}", spellId, procEntry.HitMask);
2161 // HitMask is valid for: TAKEN procs, or DONE procs at any phase (CAST phase has pre-calculated crit for travel-time spells)
2162 if (procEntry.HitMask && !(procEntry.ProcFlags & TAKEN_HIT_PROC_FLAG_MASK || procEntry.ProcFlags & DONE_HIT_PROC_FLAG_MASK))
2163 LOG_ERROR("sql.sql", "`spell_proc` table entry for SpellId {} has `HitMask` value defined, but it won't be used for defined `ProcFlags` and `SpellPhaseMask` values", spellId);
2164 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
2165 if ((procEntry.DisableEffectsMask & (1u << i)) && !spellInfo->Effects[i].IsAura())
2166 LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId {} has DisableEffectsMask with effect {}, but effect {} is not an aura effect", spellId, static_cast<uint32>(i), static_cast<uint32>(i));
2167 if (procEntry.AttributesMask & PROC_ATTR_REQ_SPELLMOD)
2168 {
2169 bool found = false;
2170 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
2171 {
2172 if (!spellInfo->Effects[i].IsAura())
2173 continue;
2174
2175 if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_ADD_PCT_MODIFIER || spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_ADD_FLAT_MODIFIER
2176 || spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_SPELL_CRIT_CHANCE || spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL)
2177 {
2178 found = true;
2179 break;
2180 }
2181 }
2182
2183 if (!found)
2184 LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId {} has Attribute PROC_ATTR_REQ_SPELLMOD, but spell has no spell mods. Proc will not be triggered", spellId);
2185 }
2186
2187 mSpellProcMap[spellInfo->Id] = procEntry;
2188
2189 if (allRanks)
2190 spellInfo = spellInfo->GetNextRankSpell();
2191 else
2192 break;
2193 }
2194 ++count;
2195 } while (result->NextRow());
2196
2197 LOG_INFO("server.loading", ">> Loaded {} spell proc conditions and data in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2198 LOG_INFO("server.loading", " ");
2199
2200 // Generate default procs for spells with proc flags but no explicit spell_proc entry
2201 // This ensures backward compatibility and covers spells that rely on DBC data
2202 LOG_INFO("server.loading", "Generating spell proc data from SpellMap...");
2203 count = 0;
2204 oldMSTime = getMSTime();
2205
2206 for (SpellInfo const* spellInfo : mSpellInfoMap)
2207 {
2208 if (!spellInfo)
2209 continue;
2210
2211 // Skip if already has explicit entry
2212 if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end())
2213 continue;
2214
2215 // Check if spell has any trigger aura effects
2216 bool found = false, addTriggerFlag = false;
2217 uint32 procSpellTypeMask = PROC_SPELL_TYPE_NONE;
2218 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
2219 {
2220 if (!spellInfo->Effects[i].IsEffect())
2221 continue;
2222
2223 uint32 auraName = spellInfo->Effects[i].ApplyAuraName;
2224 if (!auraName)
2225 continue;
2226
2227 if (!isTriggerAura[auraName])
2228 continue;
2229
2230 found = true;
2231 procSpellTypeMask |= spellTypeMask[auraName];
2232
2233 if (!addTriggerFlag && isAlwaysTriggeredAura[auraName])
2234 addTriggerFlag = true;
2235
2236 // Many proc auras with taken procFlag mask don't have
2237 // attribute "can proc with triggered" — they should
2238 // proc nevertheless (e.g. mage armor spells with
2239 // judgement)
2240 if (!addTriggerFlag
2241 && (spellInfo->ProcFlags & TAKEN_HIT_PROC_FLAG_MASK))
2242 {
2243 switch (auraName)
2244 {
2247 addTriggerFlag = true;
2248 break;
2249 default:
2250 break;
2251 }
2252 }
2253 }
2254
2255 if (!found)
2256 continue;
2257
2258 // Skip if no proc flags in DBC
2259 if (!spellInfo->ProcFlags)
2260 continue;
2261
2262 // Generate default proc entry from DBC data
2263 SpellProcEntry procEntry;
2264 procEntry.SchoolMask = 0;
2265 procEntry.SpellFamilyMask[0] = 0;
2266 procEntry.SpellFamilyMask[1] = 0;
2267 procEntry.SpellFamilyMask[2] = 0;
2268 for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
2269 if (spellInfo->Effects[i].IsEffect() && isTriggerAura[spellInfo->Effects[i].ApplyAuraName])
2270 procEntry.SpellFamilyMask |= spellInfo->Effects[i].SpellClassMask;
2271
2272 if (procEntry.SpellFamilyMask)
2273 procEntry.SpellFamilyName = spellInfo->SpellFamilyName;
2274 else
2275 procEntry.SpellFamilyName = 0;
2276
2277 procEntry.ProcFlags = spellInfo->ProcFlags;
2278 procEntry.SpellTypeMask = procSpellTypeMask;
2280 procEntry.HitMask = PROC_HIT_NONE; // uses default proc @see SpellMgr::CanSpellTriggerProcOnEvent
2281
2282 // Reflect auras should only proc off reflects
2283 for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
2284 {
2285 if (spellInfo->Effects[i].IsAura(SPELL_AURA_REFLECT_SPELLS) || spellInfo->Effects[i].IsAura(SPELL_AURA_REFLECT_SPELLS_SCHOOL))
2286 {
2287 procEntry.HitMask = PROC_HIT_REFLECT;
2288 break;
2289 }
2290 }
2291
2292 procEntry.AttributesMask = 0;
2293 if (spellInfo->ProcFlags & PROC_FLAG_KILL)
2295 if (addTriggerFlag)
2297
2298 // Modifier auras with charges should require spellmod validation
2299 if (spellInfo->ProcCharges)
2300 {
2301 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
2302 {
2303 if (spellInfo->Effects[i].IsAura(SPELL_AURA_ADD_FLAT_MODIFIER) ||
2304 spellInfo->Effects[i].IsAura(SPELL_AURA_ADD_PCT_MODIFIER))
2305 {
2307 break;
2308 }
2309 }
2310 }
2311
2312 // Calculate DisableEffectsMask for effects that shouldn't trigger procs
2313 uint32 nonProcMask = 0;
2314 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
2315 {
2316 if (!spellInfo->Effects[i].IsAura())
2317 continue;
2318 if (!isTriggerAura[spellInfo->Effects[i].ApplyAuraName])
2319 nonProcMask |= 1u << i;
2320 }
2321 procEntry.DisableEffectsMask = nonProcMask;
2322
2323 procEntry.ProcsPerMinute = 0;
2324 procEntry.Chance = static_cast<float>(spellInfo->ProcChance);
2325 procEntry.Cooldown = Milliseconds::zero();
2326 procEntry.Charges = spellInfo->ProcCharges;
2327
2328 mSpellProcMap[spellInfo->Id] = procEntry;
2329 ++count;
2330 }
2331
2332 LOG_INFO("server.loading", ">> Generated spell proc data for {} spells in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2333 LOG_INFO("server.loading", " ");
2334}
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:27
@ SPELL_SCHOOL_MASK_ALL
Definition SharedDefines.h:303
@ SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL
Definition SpellAuraDefines.h:134
@ SPELL_AURA_REFLECT_SPELLS
Definition SpellAuraDefines.h:91
@ SPELL_AURA_MOD_SPELL_CRIT_CHANCE
Definition SpellAuraDefines.h:120
@ SPELL_AURA_PROC_TRIGGER_DAMAGE
Definition SpellAuraDefines.h:106
@ SPELL_AURA_REFLECT_SPELLS_SCHOOL
Definition SpellAuraDefines.h:137
static bool isAlwaysTriggeredAura[TOTAL_AURAS]
Definition SpellMgr.cpp:1978
static uint32 spellTypeMask[TOTAL_AURAS]
Definition SpellMgr.cpp:1979
static bool isTriggerAura[TOTAL_AURAS]
Definition SpellMgr.cpp:1977
@ PROC_HIT_NONE
Definition SpellMgr.h:256
@ PROC_HIT_MASK_ALL
Definition SpellMgr.h:271
@ PROC_HIT_REFLECT
Definition SpellMgr.h:268
@ PROC_ATTR_TRIGGERED_CAN_PROC
Definition SpellMgr.h:277
@ PROC_ATTR_REQ_SPELLMOD
Definition SpellMgr.h:279
@ PROC_SPELL_TYPE_NONE
Definition SpellMgr.h:238
@ PROC_SPELL_TYPE_MASK_ALL
Definition SpellMgr.h:242
@ PROC_SPELL_PHASE_HIT
Definition SpellMgr.h:249
@ PROC_SPELL_PHASE_MASK_ALL
Definition SpellMgr.h:251
SpellInfo const * GetFirstRankSpell() const
Definition SpellInfo.cpp:2948
uint32 ProcCharges
Definition SpellInfo.h:381
uint32 ProcFlags
Definition SpellInfo.h:379
uint32 ProcChance
Definition SpellInfo.h:380
Definition SpellMgr.h:286
uint32 SpellFamilyName
Definition SpellMgr.h:288
float ProcsPerMinute
Definition SpellMgr.h:296
Milliseconds Cooldown
Definition SpellMgr.h:298
uint32 Charges
Definition SpellMgr.h:299
uint32 AttributesMask
Definition SpellMgr.h:294
flag96 SpellFamilyMask
Definition SpellMgr.h:289
uint32 HitMask
Definition SpellMgr.h:293
uint32 SpellTypeMask
Definition SpellMgr.h:291
uint32 ProcFlags
Definition SpellMgr.h:290
uint32 SpellPhaseMask
Definition SpellMgr.h:292
uint32 SchoolMask
Definition SpellMgr.h:287
uint32 DisableEffectsMask
Definition SpellMgr.h:295
float Chance
Definition SpellMgr.h:297

References SpellProcEntry::AttributesMask, SpellProcEntry::Chance, SpellProcEntry::Charges, SpellProcEntry::Cooldown, SpellProcEntry::DisableEffectsMask, DONE_HIT_PROC_FLAG_MASK, SpellInfo::Effects, Field::Get(), SpellInfo::GetFirstRankSpell(), getMSTime(), GetMSTimeDiffToNow(), SpellInfo::GetNextRankSpell(), GetSpellInfo(), SpellProcEntry::HitMask, SpellInfo::Id, isAlwaysTriggeredAura, isTriggerAura, LOG_ERROR, LOG_INFO, LOG_WARN, MAX_SPELL_EFFECTS, mSpellInfoMap, mSpellProcMap, PERIODIC_PROC_FLAG_MASK, PROC_ATTR_REQ_EXP_OR_HONOR, PROC_ATTR_REQ_SPELLMOD, PROC_ATTR_TRIGGERED_CAN_PROC, PROC_FLAG_KILL, PROC_HIT_MASK_ALL, PROC_HIT_NONE, PROC_HIT_REFLECT, PROC_SPELL_PHASE_HIT, PROC_SPELL_PHASE_MASK_ALL, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_TYPE_NONE, SpellInfo::ProcChance, SpellInfo::ProcCharges, SpellInfo::ProcFlags, SpellProcEntry::ProcFlags, SpellProcEntry::ProcsPerMinute, REQ_SPELL_PHASE_PROC_FLAG_MASK, SpellProcEntry::SchoolMask, SPELL_AURA_ADD_FLAT_MODIFIER, SPELL_AURA_ADD_PCT_MODIFIER, SPELL_AURA_MOD_SPELL_CRIT_CHANCE, SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, SPELL_AURA_PROC_TRIGGER_DAMAGE, SPELL_AURA_PROC_TRIGGER_SPELL, SPELL_AURA_REFLECT_SPELLS, SPELL_AURA_REFLECT_SPELLS_SCHOOL, SPELL_PROC_FLAG_MASK, SPELL_SCHOOL_MASK_ALL, SpellProcEntry::SpellFamilyMask, SpellProcEntry::SpellFamilyName, SpellProcEntry::SpellPhaseMask, spellTypeMask, SpellProcEntry::SpellTypeMask, TAKEN_HIT_PROC_FLAG_MASK, and WorldDatabase.

◆ LoadSpellRanks()

void SpellMgr::LoadSpellRanks ( )
1292{
1293 // cleanup data and load spell ranks for talents from dbc
1295
1296 uint32 oldMSTime = getMSTime();
1297
1298 // 0 1 2
1299 QueryResult result = WorldDatabase.Query("SELECT first_spell_id, spell_id, `rank` from spell_ranks ORDER BY first_spell_id, `rank`");
1300
1301 if (!result)
1302 {
1303 LOG_WARN("server.loading", ">> Loaded 0 spell rank records. DB table `spell_ranks` is empty.");
1304 LOG_INFO("server.loading", " ");
1305 return;
1306 }
1307
1308 uint32 count = 0;
1309 bool finished = false;
1310
1311 do
1312 {
1313 // spellid, rank
1314 std::list < std::pair < int32, int32 > > rankChain;
1315 int32 currentSpell = -1;
1316 int32 lastSpell = -1;
1317
1318 // fill one chain
1319 while (currentSpell == lastSpell && !finished)
1320 {
1321 Field* fields = result->Fetch();
1322
1323 currentSpell = fields[0].Get<uint32>();
1324 if (lastSpell == -1)
1325 lastSpell = currentSpell;
1326 uint32 spell_id = fields[1].Get<uint32>();
1327 uint32 rank = fields[2].Get<uint8>();
1328
1329 // don't drop the row if we're moving to the next rank
1330 if (currentSpell == lastSpell)
1331 {
1332 rankChain.push_back(std::make_pair(spell_id, rank));
1333 if (!result->NextRow())
1334 finished = true;
1335 }
1336 else
1337 break;
1338 }
1339 // check if chain is made with valid first spell
1340 SpellInfo const* first = GetSpellInfo(lastSpell);
1341 if (!first)
1342 {
1343 LOG_ERROR("sql.sql", "Spell rank identifier(first_spell_id) {} listed in `spell_ranks` does not exist!", lastSpell);
1344 continue;
1345 }
1346 // check if chain is long enough
1347 if (rankChain.size() < 2)
1348 {
1349 LOG_ERROR("sql.sql", "There is only 1 spell rank for identifier(first_spell_id) {} in `spell_ranks`, entry is not needed!", lastSpell);
1350 continue;
1351 }
1352 int32 curRank = 0;
1353 bool valid = true;
1354 // check spells in chain
1355 for (std::list<std::pair<int32, int32> >::iterator itr = rankChain.begin(); itr != rankChain.end(); ++itr)
1356 {
1357 SpellInfo const* spell = GetSpellInfo(itr->first);
1358 if (!spell)
1359 {
1360 LOG_ERROR("sql.sql", "Spell {} (rank {}) listed in `spell_ranks` for chain {} does not exist!", itr->first, itr->second, lastSpell);
1361 valid = false;
1362 break;
1363 }
1364 ++curRank;
1365 if (itr->second != curRank)
1366 {
1367 LOG_ERROR("sql.sql", "Spell {} (rank {}) listed in `spell_ranks` for chain {} does not have proper rank value(should be {})!", itr->first, itr->second, lastSpell, curRank);
1368 valid = false;
1369 break;
1370 }
1371 }
1372 if (!valid)
1373 continue;
1374 int32 prevRank = 0;
1375 // insert the chain
1376 std::list<std::pair<int32, int32> >::iterator itr = rankChain.begin();
1377 do
1378 {
1379 ++count;
1380 int32 addedSpell = itr->first;
1381 mSpellChains[addedSpell].first = GetSpellInfo(lastSpell);
1382 mSpellChains[addedSpell].last = GetSpellInfo(rankChain.back().first);
1383 mSpellChains[addedSpell].rank = itr->second;
1384 mSpellChains[addedSpell].prev = GetSpellInfo(prevRank);
1385 mSpellInfoMap[addedSpell]->ChainEntry = &mSpellChains[addedSpell];
1386 prevRank = addedSpell;
1387 ++itr;
1388 if (itr == rankChain.end())
1389 {
1390 mSpellChains[addedSpell].next = nullptr;
1391 break;
1392 }
1393 else
1394 mSpellChains[addedSpell].next = GetSpellInfo(itr->first);
1395 } while (true);
1396 } while (!finished);
1397
1398 LOG_INFO("server.loading", ">> Loaded {} spell rank records in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
1399 LOG_INFO("server.loading", " ");
1400}
void LoadSpellTalentRanks()
Definition SpellMgr.cpp:1230

References Field::Get(), getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), LoadSpellTalentRanks(), LOG_ERROR, LOG_INFO, LOG_WARN, mSpellChains, mSpellInfoMap, and WorldDatabase.

◆ LoadSpellRequired()

void SpellMgr::LoadSpellRequired ( )
1403{
1404 uint32 oldMSTime = getMSTime();
1405
1406 mSpellsReqSpell.clear(); // need for reload case
1407 mSpellReq.clear(); // need for reload case
1408
1409 // 0 1
1410 QueryResult result = WorldDatabase.Query("SELECT spell_id, req_spell from spell_required");
1411
1412 if (!result)
1413 {
1414 LOG_WARN("server.loading", ">> Loaded 0 spell required records. DB table `spell_required` is empty.");
1415 LOG_INFO("server.loading", " ");
1416 return;
1417 }
1418
1419 uint32 count = 0;
1420 do
1421 {
1422 Field* fields = result->Fetch();
1423
1424 uint32 spellId = fields[0].Get<uint32>();
1425 uint32 spellReq = fields[1].Get<uint32>();
1426
1427 // check if chain is made with valid first spell
1428 SpellInfo const* spellInfo = GetSpellInfo(spellId);
1429 if (!spellInfo)
1430 {
1431 LOG_ERROR("sql.sql", "spell_id {} in `spell_required` table is not found in dbcs, skipped", spellId);
1432 continue;
1433 }
1434
1435 SpellInfo const* reqSpellInfo = GetSpellInfo(spellReq);
1436 if (!reqSpellInfo)
1437 {
1438 LOG_ERROR("sql.sql", "req_spell {} in `spell_required` table is not found in dbcs, skipped", spellReq);
1439 continue;
1440 }
1441
1442 if (GetFirstSpellInChain(spellId) == GetFirstSpellInChain(spellReq))
1443 {
1444 LOG_ERROR("sql.sql", "req_spell {} and spell_id {} in `spell_required` table are ranks of the same spell, entry not needed, skipped", spellReq, spellId);
1445 continue;
1446 }
1447
1448 if (IsSpellRequiringSpell(spellId, spellReq))
1449 {
1450 LOG_ERROR("sql.sql", "duplicated entry of req_spell {} and spell_id {} in `spell_required`, skipped", spellReq, spellId);
1451 continue;
1452 }
1453
1454 mSpellReq.insert (std::pair<uint32, uint32>(spellId, spellReq));
1455 mSpellsReqSpell.insert (std::pair<uint32, uint32>(spellReq, spellId));
1456 ++count;
1457
1458 // xinef: fill additionalTalentInfo data, currently Blessing of Sanctuary only
1459 if (GetTalentSpellCost(spellReq) > 0)
1460 mTalentSpellAdditionalSet.insert(spellId);
1461 } while (result->NextRow());
1462
1463 LOG_INFO("server.loading", ">> Loaded {} Spell Required Records in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
1464 LOG_INFO("server.loading", " ");
1465}
uint32 GetTalentSpellCost(uint32 spellId)
Definition DBCStores.cpp:703
bool IsSpellRequiringSpell(uint32 spellid, uint32 req_spellid) const
Definition SpellMgr.cpp:667

References Field::Get(), GetFirstSpellInChain(), getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), GetTalentSpellCost(), IsSpellRequiringSpell(), LOG_ERROR, LOG_INFO, LOG_WARN, mSpellReq, mSpellsReqSpell, mTalentSpellAdditionalSet, and WorldDatabase.

◆ LoadSpellSpecificAndAuraState()

void SpellMgr::LoadSpellSpecificAndAuraState ( )
3154{
3155 uint32 oldMSTime = getMSTime();
3156
3157 SpellInfo* spellInfo = nullptr;
3158 for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
3159 {
3160 spellInfo = mSpellInfoMap[i];
3161 if (!spellInfo)
3162 continue;
3163 spellInfo->_spellSpecific = spellInfo->LoadSpellSpecific();
3164 spellInfo->_auraState = spellInfo->LoadAuraState();
3165 }
3166
3167 LOG_INFO("server.loading", ">> Loaded Spell Specific And Aura State in {} ms", GetMSTimeDiffToNow(oldMSTime));
3168 LOG_INFO("server.loading", " ");
3169}
SpellSpecificType LoadSpellSpecific() const
Definition SpellInfo.cpp:2095
AuraStateType LoadAuraState() const
Definition SpellInfo.cpp:2013
AuraStateType _auraState
Definition SpellInfo.h:422
SpellSpecificType _spellSpecific
Definition SpellInfo.h:423

References SpellInfo::_auraState, SpellInfo::_spellSpecific, getMSTime(), GetMSTimeDiffToNow(), GetSpellInfoStoreSize(), SpellInfo::LoadAuraState(), SpellInfo::LoadSpellSpecific(), LOG_INFO, and mSpellInfoMap.

◆ LoadSpellTalentRanks()

void SpellMgr::LoadSpellTalentRanks ( )
1231{
1232 // cleanup core data before reload - remove reference to ChainNode from SpellInfo
1234
1235 for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
1236 {
1237 TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
1238 if (!talentInfo)
1239 continue;
1240
1241 SpellInfo const* lastSpell = nullptr;
1242 for (uint8 rank = MAX_TALENT_RANK - 1; rank > 0; --rank)
1243 {
1244 if (talentInfo->RankID[rank])
1245 {
1246 lastSpell = GetSpellInfo(talentInfo->RankID[rank]);
1247 break;
1248 }
1249 }
1250
1251 if (!lastSpell)
1252 continue;
1253
1254 SpellInfo const* firstSpell = GetSpellInfo(talentInfo->RankID[0]);
1255 if (!firstSpell)
1256 {
1257 LOG_ERROR("sql.sql", "SpellMgr::LoadSpellTalentRanks: First Rank Spell {} for TalentEntry {} does not exist.", talentInfo->RankID[0], i);
1258 continue;
1259 }
1260
1261 SpellInfo const* prevSpell = nullptr;
1262 for (uint8 rank = 0; rank < MAX_TALENT_RANK; ++rank)
1263 {
1264 uint32 spellId = talentInfo->RankID[rank];
1265 if (!spellId)
1266 break;
1267
1268 SpellInfo const* currentSpell = GetSpellInfo(spellId);
1269 if (!currentSpell)
1270 {
1271 LOG_ERROR("sql.sql", "SpellMgr::LoadSpellTalentRanks: Spell {} (Rank: {}) for TalentEntry {} does not exist.", spellId, rank + 1, i);
1272 break;
1273 }
1274
1275 SpellChainNode node;
1276 node.first = firstSpell;
1277 node.last = lastSpell;
1278 node.rank = rank + 1;
1279
1280 node.prev = prevSpell;
1281 node.next = node.rank < MAX_TALENT_RANK ? GetSpellInfo(talentInfo->RankID[node.rank]) : nullptr;
1282
1283 mSpellChains[spellId] = node;
1284 mSpellInfoMap[spellId]->ChainEntry = &mSpellChains[spellId];
1285
1286 prevSpell = currentSpell;
1287 }
1288 }
1289}
void UnloadSpellInfoChains()
Definition SpellMgr.cpp:1222
SpellInfo const * last
Definition SpellMgr.h:557
SpellInfo const * next
Definition SpellMgr.h:555
uint8 rank
Definition SpellMgr.h:558
SpellInfo const * first
Definition SpellMgr.h:556
SpellInfo const * prev
Definition SpellMgr.h:554

References SpellChainNode::first, GetSpellInfo(), SpellChainNode::last, LOG_ERROR, MAX_TALENT_RANK, mSpellChains, mSpellInfoMap, SpellChainNode::next, SpellChainNode::prev, SpellChainNode::rank, TalentEntry::RankID, sTalentStore, and UnloadSpellInfoChains().

Referenced by LoadSpellRanks().

◆ LoadSpellTargetPositions()

void SpellMgr::LoadSpellTargetPositions ( )
1521{
1522 uint32 oldMSTime = getMSTime();
1523
1524 mSpellTargetPositions.clear(); // need for reload case
1525
1526 // 0 1 2 3 4 5 6
1527 QueryResult result = WorldDatabase.Query("SELECT ID, EffectIndex, MapID, PositionX, PositionY, PositionZ, Orientation FROM spell_target_position");
1528
1529 if (!result)
1530 {
1531 LOG_WARN("server.loading", ">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty.");
1532 LOG_INFO("server.loading", " ");
1533 return;
1534 }
1535
1536 uint32 count = 0;
1537 do
1538 {
1539 Field* fields = result->Fetch();
1540
1541 uint32 Spell_ID = fields[0].Get<uint32>();
1542
1543 SpellEffIndex effIndex = SpellEffIndex(fields[1].Get<uint8>());
1544
1546
1547 st.target_mapId = fields[2].Get<uint16>();
1548 st.target_X = fields[3].Get<float>();
1549 st.target_Y = fields[4].Get<float>();
1550 st.target_Z = fields[5].Get<float>();
1551 st.target_Orientation = fields[6].Get<float>();
1552
1553 MapEntry const* mapEntry = sMapStore.LookupEntry(st.target_mapId);
1554 if (!mapEntry)
1555 {
1556 LOG_ERROR("sql.sql", "Spell (Id: {}, effIndex: {}) target map (ID: {}) does not exist in `Map.dbc`.", Spell_ID, effIndex, st.target_mapId);
1557 continue;
1558 }
1559
1560 if (st.target_X == 0 && st.target_Y == 0 && st.target_Z == 0)
1561 {
1562 LOG_ERROR("sql.sql", "Spell (Id: {}, effIndex: {}) target coordinates not provided.", Spell_ID, effIndex);
1563 continue;
1564 }
1565
1566 SpellInfo const* spellInfo = GetSpellInfo(Spell_ID);
1567 if (!spellInfo)
1568 {
1569 LOG_ERROR("sql.sql", "Spell (ID:{}) listed in `spell_target_position` does not exist.", Spell_ID);
1570 continue;
1571 }
1572
1573 if (spellInfo->Effects[effIndex].TargetA.GetTarget() == TARGET_DEST_DB || spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DB)
1574 {
1575 std::pair<uint32, SpellEffIndex> key = std::make_pair(Spell_ID, effIndex);
1576 mSpellTargetPositions[key] = st;
1577 ++count;
1578 }
1579 else
1580 {
1581 LOG_ERROR("sql.sql", "Spell (Id: {}, effIndex: {}) listed in `spell_target_position` does not have target TARGET_DEST_DB (17).", Spell_ID, effIndex);
1582 continue;
1583 }
1584 } while (result->NextRow());
1585
1586 /*
1587 // Check all spells
1588 for (uint32 i = 1; i < GetSpellInfoStoreSize; ++i)
1589 {
1590 SpellInfo const* spellInfo = GetSpellInfo(i);
1591 if (!spellInfo)
1592 continue;
1593
1594 bool found = false;
1595 for (int j = 0; j < MAX_SPELL_EFFECTS; ++j)
1596 {
1597 switch (spellInfo->Effects[j].TargetA)
1598 {
1599 case TARGET_DEST_DB:
1600 found = true;
1601 break;
1602 }
1603 if (found)
1604 break;
1605 switch (spellInfo->Effects[j].TargetB)
1606 {
1607 case TARGET_DEST_DB:
1608 found = true;
1609 break;
1610 }
1611 if (found)
1612 break;
1613 }
1614 if (found)
1615 {
1616 if (!GetSpellTargetPosition(i))
1617 LOG_DEBUG("spells.aura", "Spell (ID: {}) does not have record in `spell_target_position`", i);
1618 }
1619 }*/
1620
1621 LOG_INFO("server.loading", ">> Loaded {} Spell Teleport Coordinates in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
1622 LOG_INFO("server.loading", " ");
1623}
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
SpellEffIndex
Definition SharedDefines.h:30
Definition DBCStructure.h:1361
Definition SpellMgr.h:388
float target_Z
Definition SpellMgr.h:392
uint32 target_mapId
Definition SpellMgr.h:389
float target_Y
Definition SpellMgr.h:391
float target_Orientation
Definition SpellMgr.h:393
float target_X
Definition SpellMgr.h:390

References SpellInfo::Effects, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), LOG_ERROR, LOG_INFO, LOG_WARN, mSpellTargetPositions, sMapStore, TARGET_DEST_DB, SpellTargetPosition::target_mapId, SpellTargetPosition::target_Orientation, SpellTargetPosition::target_X, SpellTargetPosition::target_Y, SpellTargetPosition::target_Z, and WorldDatabase.

◆ LoadSpellThreats()

void SpellMgr::LoadSpellThreats ( )
2378{
2379 uint32 oldMSTime = getMSTime();
2380
2381 mSpellThreatMap.clear(); // need for reload case
2382
2383 // 0 1 2 3
2384 QueryResult result = WorldDatabase.Query("SELECT entry, flatMod, pctMod, apPctMod FROM spell_threat");
2385 if (!result)
2386 {
2387 LOG_WARN("server.loading", ">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty.");
2388 LOG_INFO("server.loading", " ");
2389 return;
2390 }
2391
2392 uint32 count = 0;
2393 do
2394 {
2395 Field* fields = result->Fetch();
2396
2397 uint32 entry = fields[0].Get<uint32>();
2398
2399 if (!GetSpellInfo(entry))
2400 {
2401 LOG_ERROR("sql.sql", "Spell {} listed in `spell_threat` does not exist", entry);
2402 continue;
2403 }
2404
2405 SpellThreatEntry ste;
2406 ste.flatMod = fields[1].Get<int32>();
2407 ste.pctMod = fields[2].Get<float>();
2408 ste.apPctMod = fields[3].Get<float>();
2409
2410 mSpellThreatMap[entry] = ste;
2411 ++count;
2412 } while (result->NextRow());
2413
2414 LOG_INFO("server.loading", ">> Loaded {} SpellThreatEntries in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2415 LOG_INFO("server.loading", " ");
2416}
Definition SpellMgr.h:377
int32 flatMod
Definition SpellMgr.h:378
float apPctMod
Definition SpellMgr.h:380
float pctMod
Definition SpellMgr.h:379

References SpellThreatEntry::apPctMod, SpellThreatEntry::flatMod, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), LOG_ERROR, LOG_INFO, LOG_WARN, mSpellThreatMap, SpellThreatEntry::pctMod, and WorldDatabase.

◆ SetSpellDifficultyId()

void SpellMgr::SetSpellDifficultyId ( uint32  spellId,
uint32  id 
)
534{
535 mSpellDifficultySearcherMap[spellId] = id;
536}

References mSpellDifficultySearcherMap.

◆ UnloadSpellInfoChains()

void SpellMgr::UnloadSpellInfoChains ( )
1223{
1224 for (SpellChainMap::iterator itr = mSpellChains.begin(); itr != mSpellChains.end(); ++itr)
1225 mSpellInfoMap[itr->first]->ChainEntry = nullptr;
1226
1227 mSpellChains.clear();
1228}

References mSpellChains, and mSpellInfoMap.

Referenced by LoadSpellTalentRanks().

◆ UnloadSpellInfoImplicitTargetConditionLists()

void SpellMgr::UnloadSpellInfoImplicitTargetConditionLists ( )
3145{
3146 for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
3147 {
3148 if (mSpellInfoMap[i])
3149 mSpellInfoMap[i]->_UnloadImplicitTargetConditionLists();
3150 }
3151}

References GetSpellInfoStoreSize(), and mSpellInfoMap.

◆ UnloadSpellInfoStore()

void SpellMgr::UnloadSpellInfoStore ( )
3137{
3138 for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
3139 delete mSpellInfoMap[i];
3140
3141 mSpellInfoMap.clear();
3142}

References GetSpellInfoStoreSize(), and mSpellInfoMap.

Referenced by LoadSpellInfoStore(), and ~SpellMgr().

Member Data Documentation

◆ mCreatureImmunities

CreatureImmunitiesMap SpellMgr::mCreatureImmunities
private

◆ mEnchantCustomAttr

EnchantCustomAttribute SpellMgr::mEnchantCustomAttr
private

◆ mPetDefaultSpellsMap

PetDefaultSpellsMap SpellMgr::mPetDefaultSpellsMap
private

◆ mPetLevelupSpellMap

PetLevelupSpellMap SpellMgr::mPetLevelupSpellMap
private

◆ mSkillLineAbilityMap

SkillLineAbilityMap SpellMgr::mSkillLineAbilityMap
private

◆ mSpellAreaForAreaMap

SpellAreaForAreaMap SpellMgr::mSpellAreaForAreaMap
private

◆ mSpellAreaForAuraMap

SpellAreaForAuraMap SpellMgr::mSpellAreaForAuraMap
private

◆ mSpellAreaForQuestEndMap

SpellAreaForQuestMap SpellMgr::mSpellAreaForQuestEndMap
private

◆ mSpellAreaForQuestMap

SpellAreaForQuestMap SpellMgr::mSpellAreaForQuestMap
private

◆ mSpellAreaMap

SpellAreaMap SpellMgr::mSpellAreaMap
private

◆ mSpellBonusMap

SpellBonusMap SpellMgr::mSpellBonusMap
private

◆ mSpellChains

◆ mSpellCones

SpellConeMap SpellMgr::mSpellCones
private

Referenced by GetSpellCone(), and LoadSpellCones().

◆ mSpellCooldownOverrideMap

SpellCooldownOverrideMap SpellMgr::mSpellCooldownOverrideMap
private

◆ mSpellDifficultySearcherMap

SpellDifficultySearcherMap SpellMgr::mSpellDifficultySearcherMap
private

◆ mSpellEnchantProcEventMap

SpellEnchantProcEventMap SpellMgr::mSpellEnchantProcEventMap
private

◆ mSpellGroupSpell

SpellGroupSpellMap SpellMgr::mSpellGroupSpell
private

◆ mSpellGroupStack

◆ mSpellInfoMap

◆ mSpellLearnSkills

SpellLearnSkillMap SpellMgr::mSpellLearnSkills
private

◆ mSpellLinkedMap

SpellLinkedMap SpellMgr::mSpellLinkedMap
private

Referenced by GetSpellLinked(), and LoadSpellLinked().

◆ mSpellMixologyMap

SpellMixologyMap SpellMgr::mSpellMixologyMap
private

◆ mSpellPetAuraMap

SpellPetAuraMap SpellMgr::mSpellPetAuraMap
private

Referenced by GetPetAura(), and LoadSpellPetAuras().

◆ mSpellProcMap

SpellProcMap SpellMgr::mSpellProcMap
private

◆ mSpellReq

SpellRequiredMap SpellMgr::mSpellReq
private

◆ mSpellSameEffectSharedMisc

SameEffectStackSharedMiscMap SpellMgr::mSpellSameEffectSharedMisc
private

◆ mSpellSameEffectStack

SameEffectStackMap SpellMgr::mSpellSameEffectStack
private

◆ mSpellSpellGroup

SpellSpellGroupMap SpellMgr::mSpellSpellGroup
private

◆ mSpellsReqSpell

SpellsRequiringSpellMap SpellMgr::mSpellsReqSpell
private

◆ mSpellTargetPositions

SpellTargetPositionMap SpellMgr::mSpellTargetPositions
private

◆ mSpellThreatMap

SpellThreatMap SpellMgr::mSpellThreatMap
private

◆ mTalentSpellAdditionalSet

TalentAdditionalSet SpellMgr::mTalentSpellAdditionalSet
private

The documentation for this class was generated from the following files: