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

#include "SpellMgr.h"

Public Member Functions

uint32 GetSpellDifficultyId (uint32 spellId) const
 
void SetSpellDifficultyId (uint32 spellId, uint32 id)
 
uint32 GetSpellIdForDifficulty (uint32 spellId, Unit const *caster) const
 
SpellInfo const * GetSpellForDifficultyFromSpell (SpellInfo const *spell, Unit 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
 
SpellRequiredMapBounds 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
 
SpellTargetPosition const * GetSpellTargetPosition (uint32 spell_id, SpellEffIndex effIndex) const
 
uint32 GetSpellGroup (uint32 spellid) const
 
SpellGroupSpecialFlags GetSpellGroupSpecialFlags (uint32 spell_id) const
 
SpellGroupStackFlags GetGroupStackFlags (uint32 groupid) const
 
SpellGroupStackFlags CheckSpellGroupStackRules (SpellInfo const *spellInfo1, SpellInfo const *spellInfo2, bool remove, bool areaAura) const
 
void GetSetOfSpellsInSpellGroupWithFlag (uint32 group_id, SpellGroupSpecialFlags flag, std::set< uint32 > &availableElixirs) const
 
SpellProcEventEntry const * GetSpellProcEvent (uint32 spellId) const
 
bool IsSpellProcEventCanTriggeredBy (SpellInfo const *spellProto, SpellProcEventEntry const *spellProcEvent, uint32 EventProcFlag, ProcEventInfo const &eventInfo, bool active) 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
 
const std::vector< int32 > * 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
 
void UnloadSpellInfoChains ()
 
void LoadSpellTalentRanks ()
 
void LoadSpellRanks ()
 
void LoadSpellRequired ()
 
void LoadSpellLearnSkills ()
 
void LoadSpellTargetPositions ()
 
void LoadSpellGroups ()
 
void LoadSpellGroupStackRules ()
 
void LoadSpellProcEvents ()
 
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 UnloadSpellInfoStore ()
 
void UnloadSpellInfoImplicitTargetConditionLists ()
 
void LoadSpellInfoCustomAttributes ()
 
void LoadSpellInfoCorrections ()
 
void LoadSpellSpecificAndAuraState ()
 

Static Public Member Functions

static SpellMgrinstance ()
 
static bool ComputeIsSpellValid (SpellInfo const *spellInfo, bool msg=true)
 Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book, etc. More...
 
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
 
SpellGroupMap mSpellGroupMap
 
SpellGroupStackMap mSpellGroupStackMap
 
SpellProcEventMap mSpellProcEventMap
 
SpellProcMap mSpellProcMap
 
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
 
TalentAdditionalSet mTalentSpellAdditionalSet
 

Detailed Description

Constructor & Destructor Documentation

◆ SpellMgr()

SpellMgr::SpellMgr ( )
private
356{
357}

◆ ~SpellMgr()

SpellMgr::~SpellMgr ( )
private
360{
362}
void UnloadSpellInfoStore()
Definition: SpellMgr.cpp:2728

References UnloadSpellInfoStore().

Member Function Documentation

◆ _GetSpellInfo()

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

References GetSpellInfoStoreSize(), and mSpellInfoMap.

Referenced by LoadSpellInfoCustomAttributes().

◆ AssertSpellInfo()

SpellInfo const * SpellMgr::AssertSpellInfo ( uint32  spellId) const
inline
712 {
713 ASSERT(spellId < GetSpellInfoStoreSize());
714 SpellInfo const* spellInfo = mSpellInfoMap[spellId];
715 ASSERT(spellInfo);
716 return spellInfo;
717 }
#define ASSERT
Definition: Errors.h:68
Definition: SpellInfo.h:314

References ASSERT, GetSpellInfoStoreSize(), and mSpellInfoMap.

◆ CanSpellTriggerProcOnEvent()

bool SpellMgr::CanSpellTriggerProcOnEvent ( SpellProcEntry const &  procEntry,
ProcEventInfo eventInfo 
) const
899{
900 // proc type doesn't match
901 if (!(eventInfo.GetTypeMask() & procEntry.ProcFlags))
902 return false;
903
904 // check XP or honor target requirement
905 if (procEntry.AttributesMask & PROC_ATTR_REQ_EXP_OR_HONOR)
906 if (Player* actor = eventInfo.GetActor()->ToPlayer())
907 if (eventInfo.GetActionTarget() && !actor->isHonorOrXPTarget(eventInfo.GetActionTarget()))
908 return false;
909
910 // always trigger for these types
912 return true;
913
914 // check school mask (if set) for other trigger types
915 if (procEntry.SchoolMask && !(eventInfo.GetSchoolMask() & procEntry.SchoolMask))
916 return false;
917
918 // check spell family name/flags (if set) for spells
920 {
921 if (procEntry.SpellFamilyName && (procEntry.SpellFamilyName != eventInfo.GetSpellInfo()->SpellFamilyName))
922 return false;
923
924 if (procEntry.SpellFamilyMask && !(procEntry.SpellFamilyMask & eventInfo.GetSpellInfo()->SpellFamilyFlags))
925 return false;
926 }
927
928 // check spell type mask (if set)
930 {
931 if (procEntry.SpellTypeMask && !(eventInfo.GetSpellTypeMask() & procEntry.SpellTypeMask))
932 return false;
933 }
934
935 // check spell phase mask
937 {
938 if (!(eventInfo.GetSpellPhaseMask() & procEntry.SpellPhaseMask))
939 return false;
940 }
941
942 // check hit mask (on taken hit or on done hit, but not on spell cast phase)
943 if ((eventInfo.GetTypeMask() & TAKEN_HIT_PROC_FLAG_MASK) || ((eventInfo.GetTypeMask() & DONE_HIT_PROC_FLAG_MASK) && !(eventInfo.GetSpellPhaseMask() & PROC_SPELL_PHASE_CAST)))
944 {
945 uint32 hitMask = procEntry.HitMask;
946 // get default values if hit mask not set
947 if (!hitMask)
948 {
949 // for taken procs allow normal + critical hits by default
950 if (eventInfo.GetTypeMask() & TAKEN_HIT_PROC_FLAG_MASK)
952 // for done procs allow normal + critical + absorbs by default
953 else
955 }
956 if (!(eventInfo.GetHitMask() & hitMask))
957 return false;
958 }
959
960 return true;
961}
std::uint32_t uint32
Definition: Define.h:108
@ PROC_HIT_ABSORB
Definition: SpellMgr.h:262
@ PROC_HIT_CRITICAL
Definition: SpellMgr.h:253
@ PROC_HIT_NORMAL
Definition: SpellMgr.h:252
@ PROC_ATTR_REQ_EXP_OR_HONOR
Definition: SpellMgr.h:271
@ PROC_SPELL_PHASE_CAST
Definition: SpellMgr.h:243
@ TAKEN_HIT_PROC_FLAG_MASK
Definition: SpellMgr.h:173
@ PERIODIC_PROC_FLAG_MASK
Definition: SpellMgr.h:165
@ PROC_FLAG_KILLED
Definition: SpellMgr.h:107
@ PROC_FLAG_DEATH
Definition: SpellMgr.h:143
@ REQ_SPELL_PHASE_PROC_FLAG_MASK
Definition: SpellMgr.h:179
@ PROC_FLAG_KILL
Definition: SpellMgr.h:108
@ SPELL_PROC_FLAG_MASK
Definition: SpellMgr.h:156
@ DONE_HIT_PROC_FLAG_MASK
Definition: SpellMgr.h:167
@ PROC_FLAG_DONE_TRAP_ACTIVATION
Definition: SpellMgr.h:138
Player * ToPlayer()
Definition: Object.h:195
Definition: Player.h:1046
uint32 GetHitMask() const
Definition: Unit.h:864
SpellSchoolMask GetSchoolMask() const
Definition: Unit.h:866
Unit * GetActionTarget() const
Definition: Unit.h:859
uint32 GetSpellTypeMask() const
Definition: Unit.h:862
uint32 GetTypeMask() const
Definition: Unit.h:861
SpellInfo const * GetSpellInfo() const
Definition: Unit.cpp:186
Unit * GetActor()
Definition: Unit.h:858
uint32 GetSpellPhaseMask() const
Definition: Unit.h:863
flag96 SpellFamilyFlags
Definition: SpellInfo.h:386
uint32 SpellFamilyName
Definition: SpellInfo.h:385

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, PERIODIC_PROC_FLAG_MASK, PROC_ATTR_REQ_EXP_OR_HONOR, PROC_FLAG_DEATH, PROC_FLAG_DONE_TRAP_ACTIVATION, 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, SpellInfo::SpellFamilyFlags, SpellProcEntry::SpellFamilyMask, SpellInfo::SpellFamilyName, SpellProcEntry::SpellFamilyName, SpellProcEntry::SpellPhaseMask, SpellProcEntry::SpellTypeMask, TAKEN_HIT_PROC_FLAG_MASK, and Object::ToPlayer().

◆ CheckSpellGroupStackRules()

SpellGroupStackFlags SpellMgr::CheckSpellGroupStackRules ( SpellInfo const *  spellInfo1,
SpellInfo const *  spellInfo2,
bool  remove,
bool  areaAura 
) const
682{
683 uint32 spellid_1 = spellInfo1->GetFirstRankSpell()->Id;
684 uint32 spellid_2 = spellInfo2->GetFirstRankSpell()->Id;
685
686 uint32 groupId = GetSpellGroup(spellid_1);
687
689
690 // xinef: dunno why i added this
691 if (spellid_1 == spellid_2 && remove && !areaAura)
692 {
694 {
696 }
697
699 }
700
701 if (groupId > 0 && groupId == GetSpellGroup(spellid_2))
702 {
705 // xinef: first flags are used for elixir stacking rules
707 {
708 if (flag1 & flag2)
710 }
711 // xinef: check only flag1 (new spell)
716
717 return SpellGroupStackFlags(GetGroupStackFlags(groupId) | additionFlag);
718 }
719
721}
SpellGroupStackFlags
Definition: SpellMgr.h:349
@ SPELL_GROUP_STACK_FLAG_EXCLUSIVE
Definition: SpellMgr.h:351
@ SPELL_GROUP_STACK_FLAG_FORCED_WEAKEST
Definition: SpellMgr.h:360
@ SPELL_GROUP_STACK_FLAG_FORCED_STRONGEST
Definition: SpellMgr.h:359
@ SPELL_GROUP_STACK_FLAG_NONE
Definition: SpellMgr.h:350
@ SPELL_GROUP_STACK_FLAG_NEVER_STACK
Definition: SpellMgr.h:354
SpellGroupSpecialFlags
Definition: SpellMgr.h:327
@ SPELL_GROUP_SPECIAL_FLAG_FORCED_STRONGEST
Definition: SpellMgr.h:334
@ SPELL_GROUP_SPECIAL_FLAG_SAME_SPELL_CHECK
Definition: SpellMgr.h:341
@ SPELL_GROUP_SPECIAL_FLAG_STACK_EXCLUSIVE_MAX
Definition: SpellMgr.h:333
uint32 GetSpellGroup(uint32 spellid) const
Definition: SpellMgr.cpp:661
SpellGroupStackFlags GetGroupStackFlags(uint32 groupid) const
Definition: SpellMgr.cpp:652
SpellGroupSpecialFlags GetSpellGroupSpecialFlags(uint32 spell_id) const
Definition: SpellMgr.cpp:671

References SpellInfo::GetFirstRankSpell(), GetGroupStackFlags(), GetSpellGroup(), GetSpellGroupSpecialFlags(), SpellInfo::Id, SPELL_GROUP_SPECIAL_FLAG_FORCED_STRONGEST, SPELL_GROUP_SPECIAL_FLAG_SAME_SPELL_CHECK, SPELL_GROUP_SPECIAL_FLAG_STACK_EXCLUSIVE_MAX, SPELL_GROUP_STACK_FLAG_EXCLUSIVE, SPELL_GROUP_STACK_FLAG_FORCED_STRONGEST, SPELL_GROUP_STACK_FLAG_FORCED_WEAKEST, SPELL_GROUP_STACK_FLAG_NEVER_STACK, and SPELL_GROUP_STACK_FLAG_NONE.

◆ CheckSpellInfo()

SpellInfo const * SpellMgr::CheckSpellInfo ( uint32  spellId) const
inline
720 {
721 if (spellId >= GetSpellInfoStoreSize())
722 {
723 LOG_ERROR("server", "spellId {} is not lower than GetSpellInfoStoreSize() ({})", spellId, GetSpellInfoStoreSize());
724 return nullptr;
725 }
726 SpellInfo const* spellInfo = mSpellInfoMap[spellId];
727 if (!spellInfo)
728 {
729 LOG_ERROR("server", "spellId {} has invalid spellInfo", spellId);
730 return nullptr;
731 }
732 return spellInfo;
733 }
#define LOG_ERROR(filterType__,...)
Definition: Log.h:159

References GetSpellInfoStoreSize(), LOG_ERROR, and mSpellInfoMap.

◆ CheckSpellValid()

bool SpellMgr::CheckSpellValid ( SpellInfo const *  spellInfo,
uint32  spellId,
bool  isTalent 
)
static
461{
462 if (!spellInfo)
463 {
465 LOG_ERROR("spells", "Player::{}: Non-existed in SpellStore spell #{} request.", (isTalent ? "AddTalent" : "addSpell"), spellId);
466 return false;
467 }
468
469 if (!IsSpellValid(spellInfo))
470 {
472 LOG_ERROR("spells", "Player::{}: Broken spell #{} learning not allowed.", (isTalent ? "AddTalent" : "addSpell"), spellId);
473 return false;
474 }
475
476 return true;
477}
void DeleteSpellFromAllPlayers(uint32 spellId)
Definition: SpellMgr.cpp:449
static bool IsSpellValid(SpellInfo const *spellInfo)
Definition: SpellMgr.cpp:442

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.

372{
373 // not exist
374 if (!spellInfo)
375 return false;
376
377 bool need_check_reagents = false;
378
379 // check effects
380 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
381 {
382 switch (spellInfo->Effects[i].Effect)
383 {
384 case 0:
385 continue;
386
387 // craft spell for crafting non-existed item (break client recipes list show)
390 {
391 if (spellInfo->Effects[i].ItemType == 0)
392 {
393 // skip auto-loot crafting spells, its not need explicit item info (but have special fake items sometime)
394 if (!spellInfo->IsLootCrafting())
395 {
396 if (msg)
397 LOG_ERROR("sql.sql", "Craft spell {} not have create item entry.", spellInfo->Id);
398 return false;
399 }
400 }
401 // also possible IsLootCrafting case but fake item must exist anyway
402 else if (!sObjectMgr->GetItemTemplate(spellInfo->Effects[i].ItemType))
403 {
404 if (msg)
405 LOG_ERROR("sql.sql", "Craft spell {} create not-exist in DB item (Entry: {}) and then...", spellInfo->Id, spellInfo->Effects[i].ItemType);
406 return false;
407 }
408
409 need_check_reagents = true;
410 break;
411 }
413 {
414 SpellInfo const* spellInfo2 = sSpellMgr->GetSpellInfo(spellInfo->Effects[i].TriggerSpell);
415 if (!ComputeIsSpellValid(spellInfo2, msg))
416 {
417 if (msg)
418 LOG_ERROR("sql.sql", "Spell {} learn to invalid spell {}, and then...", spellInfo->Id, spellInfo->Effects[i].TriggerSpell);
419 return false;
420 }
421 break;
422 }
423 }
424 }
425
426 if (need_check_reagents)
427 {
428 for (uint8 j = 0; j < MAX_SPELL_REAGENTS; ++j)
429 {
430 if (spellInfo->Reagent[j] > 0 && !sObjectMgr->GetItemTemplate(spellInfo->Reagent[j]))
431 {
432 if (msg)
433 LOG_ERROR("sql.sql", "Craft spell {} have not-exist reagent in DB item (Entry: {}) and then...", spellInfo->Id, spellInfo->Reagent[j]);
434 return false;
435 }
436 }
437 }
438
439 return true;
440}
std::uint8_t uint8
Definition: Define.h:110
#define sObjectMgr
Definition: ObjectMgr.h:1606
#define sSpellMgr
Definition: SpellMgr.h:803
#define MAX_SPELL_REAGENTS
Definition: DBCStructure.h:1598
#define MAX_SPELL_EFFECTS
Definition: DBCStructure.h:1596
@ SPELL_EFFECT_CREATE_ITEM_2
Definition: SharedDefines.h:907
@ SPELL_EFFECT_LEARN_SPELL
Definition: SharedDefines.h:786
@ SPELL_EFFECT_CREATE_ITEM
Definition: SharedDefines.h:774
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:371

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 ObjectMgr::AddSpellToTrainer(), ComputeIsSpellValid(), ObjectMgr::InitializeSpellInfoPrecomputedData(), and ObjectMgr::LoadQuests().

◆ GetFirstSpellInChain()

uint32 SpellMgr::GetFirstSpellInChain ( uint32  spell_id) const
556{
557 if (SpellChainNode const* node = GetSpellChainNode(spell_id))
558 return node->first->Id;
559
560 return spell_id;
561}
Definition: SpellMgr.h:547
SpellChainNode const * GetSpellChainNode(uint32 spell_id) const
Definition: SpellMgr.cpp:546

References GetSpellChainNode().

Referenced by GetSpellBonusData(), GetSpellGroup(), GetSpellGroupSpecialFlags(), GetSpellThreatEntry(), and LoadSpellRequired().

◆ GetGroupStackFlags()

SpellGroupStackFlags SpellMgr::GetGroupStackFlags ( uint32  groupid) const
653{
654 SpellGroupStackMap::const_iterator itr = mSpellGroupStackMap.find(groupid);
655 if (itr != mSpellGroupStackMap.end())
656 return itr->second;
657
659}
SpellGroupStackMap mSpellGroupStackMap
Definition: SpellMgr.h:781

References mSpellGroupStackMap, and SPELL_GROUP_STACK_FLAG_NONE.

Referenced by CheckSpellGroupStackRules().

◆ GetLastSpellInChain()

uint32 SpellMgr::GetLastSpellInChain ( uint32  spell_id) const
564{
565 if (SpellChainNode const* node = GetSpellChainNode(spell_id))
566 return node->last->Id;
567
568 return spell_id;
569}

References GetSpellChainNode().

◆ GetNextSpellInChain()

uint32 SpellMgr::GetNextSpellInChain ( uint32  spell_id) const
572{
573 if (SpellChainNode const* node = GetSpellChainNode(spell_id))
574 if (node->next)
575 return node->next->Id;
576
577 return 0;
578}

References GetSpellChainNode().

◆ GetPetAura()

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

References mSpellPetAuraMap.

◆ GetPetDefaultSpellsEntry()

PetDefaultSpellsEntry const * SpellMgr::GetPetDefaultSpellsEntry ( int32  id) const
1046{
1047 PetDefaultSpellsMap::const_iterator itr = mPetDefaultSpellsMap.find(id);
1048 if (itr != mPetDefaultSpellsMap.end())
1049 return &itr->second;
1050 return nullptr;
1051}
PetDefaultSpellsMap mPetDefaultSpellsMap
Definition: SpellMgr.h:798

References mPetDefaultSpellsMap.

◆ GetPetLevelupSpellList()

PetLevelupSpellSet const * SpellMgr::GetPetLevelupSpellList ( uint32  petFamily) const
1037{
1038 PetLevelupSpellMap::const_iterator itr = mPetLevelupSpellMap.find(petFamily);
1039 if (itr != mPetLevelupSpellMap.end())
1040 return &itr->second;
1041 else
1042 return nullptr;
1043}
PetLevelupSpellMap mPetLevelupSpellMap
Definition: SpellMgr.h:797

References mPetLevelupSpellMap.

◆ GetPrevSpellInChain()

uint32 SpellMgr::GetPrevSpellInChain ( uint32  spell_id) const
581{
582 if (SpellChainNode const* node = GetSpellChainNode(spell_id))
583 if (node->prev)
584 return node->prev->Id;
585
586 return 0;
587}

References GetSpellChainNode().

◆ GetSetOfSpellsInSpellGroupWithFlag()

void SpellMgr::GetSetOfSpellsInSpellGroupWithFlag ( uint32  group_id,
SpellGroupSpecialFlags  flag,
std::set< uint32 > &  availableElixirs 
) const
724{
725 for (SpellGroupMap::const_iterator itr = mSpellGroupMap.begin(); itr != mSpellGroupMap.end(); ++itr)
726 if (itr->second.groupId == group_id && itr->second.specialFlags == flag)
727 availableElixirs.insert(itr->first); // insert spell id
728}
SpellGroupMap mSpellGroupMap
Definition: SpellMgr.h:780

References mSpellGroupMap.

◆ GetSkillLineAbilityMapBounds()

SkillLineAbilityMapBounds SpellMgr::GetSkillLineAbilityMapBounds ( uint32  spell_id) const
1004{
1005 return mSkillLineAbilityMap.equal_range(spell_id);
1006}
SkillLineAbilityMap mSkillLineAbilityMap
Definition: SpellMgr.h:796

References mSkillLineAbilityMap.

◆ GetSpellAreaForAreaMapBounds()

SpellAreaForAreaMapBounds SpellMgr::GetSpellAreaForAreaMapBounds ( uint32  area_id) const
1074{
1075 return mSpellAreaForAreaMap.equal_range(area_id);
1076}
SpellAreaForAreaMap mSpellAreaForAreaMap
Definition: SpellMgr.h:795

References mSpellAreaForAreaMap.

◆ GetSpellAreaForAuraMapBounds()

SpellAreaForAuraMapBounds SpellMgr::GetSpellAreaForAuraMapBounds ( uint32  spell_id) const
1069{
1070 return mSpellAreaForAuraMap.equal_range(spell_id);
1071}
SpellAreaForAuraMap mSpellAreaForAuraMap
Definition: SpellMgr.h:794

References mSpellAreaForAuraMap.

Referenced by LoadSpellAreas().

◆ GetSpellAreaForQuestEndMapBounds()

SpellAreaForQuestMapBounds SpellMgr::GetSpellAreaForQuestEndMapBounds ( uint32  quest_id) const
1064{
1065 return mSpellAreaForQuestEndMap.equal_range(quest_id);
1066}
SpellAreaForQuestMap mSpellAreaForQuestEndMap
Definition: SpellMgr.h:793

References mSpellAreaForQuestEndMap.

◆ GetSpellAreaForQuestMapBounds()

SpellAreaForQuestMapBounds SpellMgr::GetSpellAreaForQuestMapBounds ( uint32  quest_id) const
1059{
1060 return mSpellAreaForQuestMap.equal_range(quest_id);
1061}
SpellAreaForQuestMap mSpellAreaForQuestMap
Definition: SpellMgr.h:792

References mSpellAreaForQuestMap.

◆ GetSpellAreaMapBounds()

SpellAreaMapBounds SpellMgr::GetSpellAreaMapBounds ( uint32  spell_id) const
1054{
1055 return mSpellAreaMap.equal_range(spell_id);
1056}
SpellAreaMap mSpellAreaMap
Definition: SpellMgr.h:791

References mSpellAreaMap.

Referenced by LoadSpellAreas().

◆ GetSpellBonusData()

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

References GetFirstSpellInChain(), and mSpellBonusMap.

◆ GetSpellChainNode()

SpellChainNode const * SpellMgr::GetSpellChainNode ( uint32  spell_id) const
547{
548 SpellChainMap::const_iterator itr = mSpellChains.find(spell_id);
549 if (itr == mSpellChains.end())
550 return nullptr;
551
552 return &itr->second;
553}
SpellChainMap mSpellChains
Definition: SpellMgr.h:775

References mSpellChains.

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

◆ GetSpellDifficultyId()

uint32 SpellMgr::GetSpellDifficultyId ( uint32  spellId) const
480{
481 SpellDifficultySearcherMap::const_iterator i = mSpellDifficultySearcherMap.find(spellId);
482 return i == mSpellDifficultySearcherMap.end() ? 0 : (*i).second;
483}
SpellDifficultySearcherMap mSpellDifficultySearcherMap
Definition: SpellMgr.h:774

References mSpellDifficultySearcherMap.

Referenced by GetSpellIdForDifficulty().

◆ GetSpellEnchantProcEvent()

SpellEnchantProcEntry const * SpellMgr::GetSpellEnchantProcEvent ( uint32  enchId) const
1018{
1019 SpellEnchantProcEventMap::const_iterator itr = mSpellEnchantProcEventMap.find(enchId);
1020 if (itr != mSpellEnchantProcEventMap.end())
1021 return &itr->second;
1022 return nullptr;
1023}
SpellEnchantProcEventMap mSpellEnchantProcEventMap
Definition: SpellMgr.h:789

References mSpellEnchantProcEventMap.

◆ GetSpellForDifficultyFromSpell()

SpellInfo const * SpellMgr::GetSpellForDifficultyFromSpell ( SpellInfo const *  spell,
Unit const *  caster 
) const
533{
534 uint32 newSpellId = GetSpellIdForDifficulty(spell->Id, caster);
535 SpellInfo const* newSpell = GetSpellInfo(newSpellId);
536 if (!newSpell)
537 {
538 LOG_DEBUG("spells.aura", "SpellMgr::GetSpellForDifficultyFromSpell: spell {} not found. Check spelldifficulty_dbc!", newSpellId);
539 return spell;
540 }
541
542 LOG_DEBUG("spells.aura", "SpellMgr::GetSpellForDifficultyFromSpell: Spell id for instance mode is {} (original {})", newSpell->Id, spell->Id);
543 return newSpell;
544}
#define LOG_DEBUG(filterType__,...)
Definition: Log.h:171
uint32 Id
Definition: SpellInfo.h:318
uint32 GetSpellIdForDifficulty(uint32 spellId, Unit const *caster) const
Definition: SpellMgr.cpp:490
SpellInfo const * GetSpellInfo(uint32 spellId) const
Definition: SpellMgr.h:709

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

◆ GetSpellGroup()

uint32 SpellMgr::GetSpellGroup ( uint32  spellid) const
662{
663 uint32 first_rank = GetFirstSpellInChain(spell_id);
664 SpellGroupMap::const_iterator itr = mSpellGroupMap.find(first_rank);
665 if (itr != mSpellGroupMap.end())
666 return itr->second.groupId;
667
668 return 0;
669}

References GetFirstSpellInChain(), and mSpellGroupMap.

Referenced by CheckSpellGroupStackRules().

◆ GetSpellGroupSpecialFlags()

SpellGroupSpecialFlags SpellMgr::GetSpellGroupSpecialFlags ( uint32  spell_id) const
672{
673 uint32 first_rank = GetFirstSpellInChain(spell_id);
674 SpellGroupMap::const_iterator itr = mSpellGroupMap.find(first_rank);
675 if (itr != mSpellGroupMap.end())
676 return itr->second.specialFlags;
677
679}
@ SPELL_GROUP_SPECIAL_FLAG_NONE
Definition: SpellMgr.h:328

References GetFirstSpellInChain(), mSpellGroupMap, and SPELL_GROUP_SPECIAL_FLAG_NONE.

Referenced by CheckSpellGroupStackRules().

◆ GetSpellIdForDifficulty()

uint32 SpellMgr::GetSpellIdForDifficulty ( uint32  spellId,
Unit const *  caster 
) const
491{
492 if (!GetSpellInfo(spellId))
493 return spellId;
494
495 if (!caster || !caster->GetMap() || !caster->GetMap()->IsDungeon())
496 return spellId;
497
498 uint32 mode = uint32(caster->GetMap()->GetSpawnMode());
499 if (mode >= MAX_DIFFICULTY)
500 {
501 LOG_ERROR("spells", "SpellMgr::GetSpellIdForDifficulty: Incorrect Difficulty for spell {}.", spellId);
502 return spellId; //return source spell
503 }
504
505 uint32 difficultyId = GetSpellDifficultyId(spellId);
506 if (!difficultyId)
507 return spellId; //return source spell, it has only REGULAR_DIFFICULTY
508
509 SpellDifficultyEntry const* difficultyEntry = sSpellDifficultyStore.LookupEntry(difficultyId);
510 if (!difficultyEntry)
511 {
512 LOG_DEBUG("spells.aura", "SpellMgr::GetSpellIdForDifficulty: SpellDifficultyEntry not found for spell {}. This should never happen.", spellId);
513 return spellId; //return source spell
514 }
515
516 if (difficultyEntry->SpellID[mode] <= 0 && mode > DUNGEON_DIFFICULTY_HEROIC)
517 {
518 LOG_DEBUG("spells.aura", "SpellMgr::GetSpellIdForDifficulty: spell {} mode {} spell is nullptr, using mode {}", spellId, mode, mode - 2);
519 mode -= 2;
520 }
521
522 if (difficultyEntry->SpellID[mode] <= 0)
523 {
524 LOG_ERROR("sql.sql", "SpellMgr::GetSpellIdForDifficulty: spell {} mode {} spell is 0. Check spelldifficulty_dbc!", spellId, mode);
525 return spellId;
526 }
527
528 LOG_DEBUG("spells.aura", "SpellMgr::GetSpellIdForDifficulty: spellid for spell {} in mode {} is {}", spellId, mode, difficultyEntry->SpellID[mode]);
529 return uint32(difficultyEntry->SpellID[mode]);
530}
DBCStorage< SpellDifficultyEntry > sSpellDifficultyStore(SpellDifficultyfmt)
@ DUNGEON_DIFFICULTY_HEROIC
Definition: DBCEnums.h:275
#define MAX_DIFFICULTY
Definition: DBCEnums.h:288
uint32 GetSpellDifficultyId(uint32 spellId) const
Definition: SpellMgr.cpp:479
Definition: DBCStructure.h:1733
int32 SpellID[MAX_DIFFICULTY]
Definition: DBCStructure.h:1735

References DUNGEON_DIFFICULTY_HEROIC, WorldObject::GetMap(), Map::GetSpawnMode(), GetSpellDifficultyId(), GetSpellInfo(), 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
636{
637 SpellLearnSkillMap::const_iterator itr = mSpellLearnSkills.find(spell_id);
638 if (itr != mSpellLearnSkills.end())
639 return &itr->second;
640 else
641 return nullptr;
642}
SpellLearnSkillMap mSpellLearnSkills
Definition: SpellMgr.h:778

References mSpellLearnSkills.

◆ GetSpellLinked()

const std::vector< int32 > * SpellMgr::GetSpellLinked ( int32  spell_id) const
1031{
1032 SpellLinkedMap::const_iterator itr = mSpellLinkedMap.find(spell_id);
1033 return itr != mSpellLinkedMap.end() ? &(itr->second) : nullptr;
1034}
SpellLinkedMap mSpellLinkedMap
Definition: SpellMgr.h:788

References mSpellLinkedMap.

◆ GetSpellMixologyBonus()

float SpellMgr::GetSpellMixologyBonus ( uint32  spellId) const
995{
996 SpellMixologyMap::const_iterator itr = mSpellMixologyMap.find(spellId);
997 if (itr == mSpellMixologyMap.end())
998 return 30.0f;
999
1000 return itr->second;
1001}
SpellMixologyMap mSpellMixologyMap
Definition: SpellMgr.h:786

References mSpellMixologyMap.

◆ GetSpellProcEntry()

SpellProcEntry const * SpellMgr::GetSpellProcEntry ( uint32  spellId) const
891{
892 SpellProcMap::const_iterator itr = mSpellProcMap.find(spellId);
893 if (itr != mSpellProcMap.end())
894 return &itr->second;
895 return nullptr;
896}
SpellProcMap mSpellProcMap
Definition: SpellMgr.h:783

References mSpellProcMap.

◆ GetSpellProcEvent()

SpellProcEventEntry const * SpellMgr::GetSpellProcEvent ( uint32  spellId) const
731{
732 SpellProcEventMap::const_iterator itr = mSpellProcEventMap.find(spellId);
733 if (itr != mSpellProcEventMap.end())
734 return &itr->second;
735 return nullptr;
736}
SpellProcEventMap mSpellProcEventMap
Definition: SpellMgr.h:782

References mSpellProcEventMap.

◆ GetSpellRank()

uint8 SpellMgr::GetSpellRank ( uint32  spell_id) const
590{
591 if (SpellChainNode const* node = GetSpellChainNode(spell_id))
592 return node->rank;
593
594 return 0;
595}

References GetSpellChainNode().

◆ GetSpellsRequiredForSpellBounds()

SpellRequiredMapBounds SpellMgr::GetSpellsRequiredForSpellBounds ( uint32  spell_id) const
610{
611 return mSpellReq.equal_range(spell_id);
612}
SpellRequiredMap mSpellReq
Definition: SpellMgr.h:777

References mSpellReq.

◆ GetSpellsRequiringSpellBounds()

SpellsRequiringSpellMapBounds SpellMgr::GetSpellsRequiringSpellBounds ( uint32  spell_id) const
615{
616 return mSpellsReqSpell.equal_range(spell_id);
617}
SpellsRequiringSpellMap mSpellsReqSpell
Definition: SpellMgr.h:776

References mSpellsReqSpell.

Referenced by IsSpellRequiringSpell().

◆ GetSpellTargetPosition()

SpellTargetPosition const * SpellMgr::GetSpellTargetPosition ( uint32  spell_id,
SpellEffIndex  effIndex 
) const
645{
646 SpellTargetPositionMap::const_iterator itr = mSpellTargetPositions.find(std::make_pair(spell_id, effIndex));
647 if (itr != mSpellTargetPositions.end())
648 return &itr->second;
649 return nullptr;
650}
SpellTargetPositionMap mSpellTargetPositions
Definition: SpellMgr.h:779

References mSpellTargetPositions.

◆ GetSpellThreatEntry()

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

References GetFirstSpellInChain(), and mSpellThreatMap.

◆ GetSpellWithRank()

uint32 SpellMgr::GetSpellWithRank ( uint32  spell_id,
uint32  rank,
bool  strict = false 
) const
598{
599 if (SpellChainNode const* node = GetSpellChainNode(spell_id))
600 {
601 if (rank != node->rank)
602 return GetSpellWithRank(node->rank < rank ? node->next->Id : node->prev->Id, rank, strict);
603 }
604 else if (strict && rank > 1)
605 return 0;
606 return spell_id;
607}
uint32 GetSpellWithRank(uint32 spell_id, uint32 rank, bool strict=false) const
Definition: SpellMgr.cpp:597

References GetSpellChainNode(), and GetSpellWithRank().

Referenced by GetSpellWithRank().

◆ instance()

SpellMgr * SpellMgr::instance ( )
static
365{
366 static SpellMgr instance;
367 return &instance;
368}
Definition: SpellMgr.h:623
static SpellMgr * instance()
Definition: SpellMgr.cpp:364

References instance().

Referenced by instance().

◆ IsAdditionalTalentSpell()

bool SpellMgr::IsAdditionalTalentSpell ( uint32  spellId) const
631{
632 return mTalentSpellAdditionalSet.find(spellId) != mTalentSpellAdditionalSet.end();
633}
TalentAdditionalSet mTalentSpellAdditionalSet
Definition: SpellMgr.h:800

References mTalentSpellAdditionalSet.

◆ IsArenaAllowedEnchancment()

bool SpellMgr::IsArenaAllowedEnchancment ( uint32  ench_id) const
1026{
1027 return mEnchantCustomAttr[ench_id];
1028}
EnchantCustomAttribute mEnchantCustomAttr
Definition: SpellMgr.h:790

References mEnchantCustomAttr.

◆ IsSpellProcEventCanTriggeredBy()

bool SpellMgr::IsSpellProcEventCanTriggeredBy ( SpellInfo const *  spellProto,
SpellProcEventEntry const *  spellProcEvent,
uint32  EventProcFlag,
ProcEventInfo const &  eventInfo,
bool  active 
) const

no aura with only PROC_FLAG_DONE_PERIODIC and spellFamilyName == 0 can proc from a HOT.

Aura must have positive procflags for a HOT to proc

Aura must have negative or neutral(PROC_FLAG_DONE_PERIODIC only) procflags for a DOT to proc

No aura that only has PROC_FLAG_TAKEN_PERIODIC can proc from a HOT.

Aura must have positive procflags for a HOT to proc

Aura must have negative or neutral(PROC_FLAG_TAKEN_PERIODIC only) procflags for a DOT to proc

739{
740 // No extra req need
741 uint32 procEvent_procEx = PROC_EX_NONE;
742 uint32 procEvent_procPhase = PROC_SPELL_PHASE_HIT;
743
744 uint32 procFlags = eventInfo.GetTypeMask();
745 uint32 procExtra = eventInfo.GetHitMask();
746 uint32 procPhase = eventInfo.GetSpellPhaseMask();
747 SpellInfo const* procSpellInfo = eventInfo.GetSpellInfo();
748
749 // check prockFlags for condition
750 if ((procFlags & EventProcFlag) == 0)
751 return false;
752
753 // Xinef: Always trigger for this, including TAKEN_DAMAGE
755 return true;
756
757 bool hasFamilyMask = false;
758
759 if (procFlags & PROC_FLAG_DONE_PERIODIC)
760 {
761 if (procExtra & PROC_EX_INTERNAL_HOT)
762 {
763 if (EventProcFlag == PROC_FLAG_DONE_PERIODIC)
764 {
766 if (!spellProto->SpellFamilyName)
767 return false;
768 }
771 return false;
772 }
774 else if (EventProcFlag != PROC_FLAG_DONE_PERIODIC)
776 return false;
777 }
778
779 if (procFlags & PROC_FLAG_TAKEN_PERIODIC)
780 {
781 if (procExtra & PROC_EX_INTERNAL_HOT)
782 {
784 if (EventProcFlag == PROC_FLAG_TAKEN_PERIODIC)
785 return false;
788 return false;
789 }
791 else if (EventProcFlag != PROC_FLAG_TAKEN_PERIODIC)
793 return false;
794 }
795
796 // Trap casts are active by default
797 if (procFlags & PROC_FLAG_DONE_TRAP_ACTIVATION)
798 active = true;
799
800 if (spellProcEvent) // Exist event data
801 {
802 // Store extra req
803 procEvent_procEx = spellProcEvent->procEx;
804 procEvent_procPhase = spellProcEvent->procPhase;
805
806 // For melee triggers
807 if (!procSpellInfo)
808 {
809 // Check (if set) for school (melee attack have Normal school)
810 if (spellProcEvent->schoolMask && (spellProcEvent->schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0)
811 return false;
812 }
813 else // For spells need check school/spell family/family mask
814 {
815 // Check (if set) for school
816 if (spellProcEvent->schoolMask && (spellProcEvent->schoolMask & procSpellInfo->SchoolMask) == 0)
817 return false;
818
819 // Check (if set) for spellFamilyName
820 if (spellProcEvent->spellFamilyName && (spellProcEvent->spellFamilyName != procSpellInfo->SpellFamilyName))
821 return false;
822
823 // spellFamilyName is Ok need check for spellFamilyMask if present
824 if (spellProcEvent->spellFamilyMask)
825 {
826 if (!(spellProcEvent->spellFamilyMask & procSpellInfo->SpellFamilyFlags))
827 return false;
828 hasFamilyMask = true;
829 // Some spells are not considered as active even with have spellfamilyflags
830 if (!(procEvent_procEx & PROC_EX_ONLY_ACTIVE_SPELL))
831 active = true;
832 }
833
834 // Check tick numbers
835 if (procEvent_procEx & PROC_EX_ONLY_FIRST_TICK)
836 {
837 if (Spell const* procSpell = eventInfo.GetProcSpell())
838 {
839 if (procSpell->GetTriggeredByAuraTickNumber() > 1)
840 {
841 return false;
842 }
843 }
844 }
845 }
846 }
847
848 if (procExtra & (PROC_EX_INTERNAL_REQ_FAMILY))
849 {
850 if (!hasFamilyMask)
851 return false;
852 }
853
854 if (!(procEvent_procPhase & procPhase))
855 {
856 return false;
857 }
858
859 // Check for extra req (if none) and hit/crit
860 if (procEvent_procEx == PROC_EX_NONE)
861 {
862 // No extra req, so can trigger only for hit/crit - spell has to be active
863 if ((procExtra & (PROC_EX_NORMAL_HIT | PROC_EX_CRITICAL_HIT)) && active)
864 return true;
865 }
866 else // Passive spells hits here only if resist/reflect/immune/evade
867 {
868 if (procExtra & AURA_SPELL_PROC_EX_MASK)
869 {
870 // if spell marked as procing only from not active spells
871 if (active && procEvent_procEx & PROC_EX_NOT_ACTIVE_SPELL)
872 return false;
873 // if spell marked as procing only from active spells
874 if (!active && procEvent_procEx & PROC_EX_ONLY_ACTIVE_SPELL)
875 return false;
876 // Exist req for PROC_EX_EX_TRIGGER_ALWAYS
877 if (procEvent_procEx & PROC_EX_EX_TRIGGER_ALWAYS)
878 return true;
879 // PROC_EX_NOT_ACTIVE_SPELL and PROC_EX_ONLY_ACTIVE_SPELL flags handle: if passed checks before
880 if ((procExtra & (PROC_EX_NORMAL_HIT | PROC_EX_CRITICAL_HIT)) && ((procEvent_procEx & (AURA_SPELL_PROC_EX_MASK)) == 0))
881 return true;
882 }
883 // Check Extra Requirement like (hit/crit/miss/resist/parry/dodge/block/immune/reflect/absorb and other)
884 if (procEvent_procEx & procExtra)
885 return true;
886 }
887 return false;
888}
#define AURA_SPELL_PROC_EX_MASK
Definition: SpellMgr.h:225
@ PROC_EX_NONE
Definition: SpellMgr.h:193
@ PROC_EX_CRITICAL_HIT
Definition: SpellMgr.h:195
@ PROC_EX_NORMAL_HIT
Definition: SpellMgr.h:194
@ PROC_EX_INTERNAL_HOT
Definition: SpellMgr.h:220
@ PROC_EX_ONLY_ACTIVE_SPELL
Definition: SpellMgr.h:212
@ PROC_EX_ONLY_FIRST_TICK
Definition: SpellMgr.h:215
@ PROC_EX_EX_TRIGGER_ALWAYS
Definition: SpellMgr.h:210
@ PROC_EX_NOT_ACTIVE_SPELL
Definition: SpellMgr.h:209
@ PROC_EX_INTERNAL_REQ_FAMILY
Definition: SpellMgr.h:222
@ PROC_SPELL_PHASE_HIT
Definition: SpellMgr.h:244
@ PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS
Definition: SpellMgr.h:128
@ PROC_FLAG_DONE_PERIODIC
Definition: SpellMgr.h:134
@ PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS
Definition: SpellMgr.h:122
@ PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG
Definition: SpellMgr.h:132
@ PROC_FLAG_TAKEN_PERIODIC
Definition: SpellMgr.h:135
@ PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG
Definition: SpellMgr.h:126
@ PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG
Definition: SpellMgr.h:125
@ PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS
Definition: SpellMgr.h:129
@ PROC_FLAG_TAKEN_DAMAGE
Definition: SpellMgr.h:137
@ PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS
Definition: SpellMgr.h:123
@ PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG
Definition: SpellMgr.h:131
@ SPELL_SCHOOL_MASK_NORMAL
Definition: SharedDefines.h:269
Definition: Spell.h:284
uint32 SchoolMask
Definition: SpellInfo.h:390

References AURA_SPELL_PROC_EX_MASK, ProcEventInfo::GetHitMask(), ProcEventInfo::GetProcSpell(), ProcEventInfo::GetSpellInfo(), ProcEventInfo::GetSpellPhaseMask(), ProcEventInfo::GetTypeMask(), PROC_EX_CRITICAL_HIT, PROC_EX_EX_TRIGGER_ALWAYS, PROC_EX_INTERNAL_HOT, PROC_EX_INTERNAL_REQ_FAMILY, PROC_EX_NONE, PROC_EX_NORMAL_HIT, PROC_EX_NOT_ACTIVE_SPELL, PROC_EX_ONLY_ACTIVE_SPELL, PROC_EX_ONLY_FIRST_TICK, PROC_FLAG_DEATH, PROC_FLAG_DONE_PERIODIC, PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG, PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS, PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG, PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS, PROC_FLAG_DONE_TRAP_ACTIVATION, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_FLAG_TAKEN_DAMAGE, PROC_FLAG_TAKEN_PERIODIC, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS, PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG, PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS, PROC_SPELL_PHASE_HIT, SpellProcEventEntry::procEx, SpellProcEventEntry::procPhase, SpellInfo::SchoolMask, SpellProcEventEntry::schoolMask, SPELL_SCHOOL_MASK_NORMAL, SpellInfo::SpellFamilyFlags, SpellProcEventEntry::spellFamilyMask, SpellInfo::SpellFamilyName, and SpellProcEventEntry::spellFamilyName.

◆ IsSpellRequiringSpell()

bool SpellMgr::IsSpellRequiringSpell ( uint32  spellid,
uint32  req_spellid 
) const
620{
621 SpellsRequiringSpellMapBounds spellsRequiringSpell = GetSpellsRequiringSpellBounds(req_spellid);
622 for (SpellsRequiringSpellMap::const_iterator itr = spellsRequiringSpell.first; itr != spellsRequiringSpell.second; ++itr)
623 {
624 if (itr->second == spellid)
625 return true;
626 }
627 return false;
628}
std::pair< SpellsRequiringSpellMap::const_iterator, SpellsRequiringSpellMap::const_iterator > SpellsRequiringSpellMapBounds
Definition: SpellMgr.h:563
SpellsRequiringSpellMapBounds GetSpellsRequiringSpellBounds(uint32 spell_id) const
Definition: SpellMgr.cpp:614

References GetSpellsRequiringSpellBounds().

Referenced by LoadSpellRequired().

◆ IsSpellValid()

◆ LoadEnchantCustomAttr()

void SpellMgr::LoadEnchantCustomAttr ( )
2166{
2167 uint32 oldMSTime = getMSTime();
2168
2169 uint32 size = sSpellItemEnchantmentStore.GetNumRows();
2170 mEnchantCustomAttr.resize(size);
2171
2172 for (uint32 i = 0; i < size; ++i)
2173 mEnchantCustomAttr[i] = 0;
2174
2175 uint32 count = 0;
2176 for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
2177 {
2178 SpellInfo const* spellInfo = GetSpellInfo(i);
2179 if (!spellInfo)
2180 continue;
2181
2182 // TODO: find a better check
2183 // Xinef: commented second part, fixes warlock enchants like firestone, spellstone
2184 if (!spellInfo->HasAttribute(SPELL_ATTR2_ENCHANT_OWN_ITEM_ONLY)/* || !spellInfo->HasAttribute(SPELL_ATTR0_NOT_SHAPESHIFTED)*/)
2185 continue;
2186
2187 for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
2188 {
2189 if (spellInfo->Effects[j].Effect == SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY)
2190 {
2191 uint32 enchId = spellInfo->Effects[j].MiscValue;
2192 SpellItemEnchantmentEntry const* ench = sSpellItemEnchantmentStore.LookupEntry(enchId);
2193 if (!ench)
2194 continue;
2195 mEnchantCustomAttr[enchId] = true;
2196 ++count;
2197 break;
2198 }
2199 }
2200 }
2201
2202 LOG_INFO("server.loading", ">> Loaded {} Custom Enchant Attributes in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2203 LOG_INFO("server.loading", " ");
2204}
#define LOG_INFO(filterType__,...)
Definition: Log.h:167
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:131
uint32 getMSTime()
Definition: Timer.h:103
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
@ SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY
Definition: SharedDefines.h:804
@ SPELL_ATTR2_ENCHANT_OWN_ITEM_ONLY
Definition: SharedDefines.h:441
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:412
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
Definition: SpellInfo.h:391
Definition: DBCStructure.h:1803

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 ( )
2409{
2410 uint32 oldMSTime = getMSTime();
2411
2412 mPetDefaultSpellsMap.clear();
2413
2414 uint32 countCreature = 0;
2415 uint32 countData = 0;
2416
2417 CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates();
2418 for (CreatureTemplateContainer::const_iterator itr = ctc->begin(); itr != ctc->end(); ++itr)
2419 {
2420 if (!itr->second.PetSpellDataId)
2421 continue;
2422
2423 // for creature with PetSpellDataId get default pet spells from dbc
2424 CreatureSpellDataEntry const* spellDataEntry = sCreatureSpellDataStore.LookupEntry(itr->second.PetSpellDataId);
2425 if (!spellDataEntry)
2426 continue;
2427
2428 int32 petSpellsId = -int32(itr->second.PetSpellDataId);
2429 PetDefaultSpellsEntry petDefSpells;
2430 for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
2431 petDefSpells.spellid[j] = spellDataEntry->spellId[j];
2432
2433 if (LoadPetDefaultSpells_helper(&itr->second, petDefSpells))
2434 {
2435 mPetDefaultSpellsMap[petSpellsId] = petDefSpells;
2436 ++countData;
2437 }
2438 }
2439
2440 LOG_INFO("server.loading", ">> Loaded Addition Spells For {} Pet Spell Data Entries in {} ms", countData, GetMSTimeDiffToNow(oldMSTime));
2441 LOG_INFO("server.loading", " ");
2442
2443 LOG_INFO("server.loading", "Loading Summonable Creature Templates...");
2444 oldMSTime = getMSTime();
2445
2446 // different summon spells
2447 for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
2448 {
2449 SpellInfo const* spellEntry = GetSpellInfo(i);
2450 if (!spellEntry)
2451 continue;
2452
2453 for (uint8 k = 0; k < MAX_SPELL_EFFECTS; ++k)
2454 {
2455 if (spellEntry->Effects[k].Effect == SPELL_EFFECT_SUMMON || spellEntry->Effects[k].Effect == SPELL_EFFECT_SUMMON_PET)
2456 {
2457 uint32 creature_id = spellEntry->Effects[k].MiscValue;
2458 CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creature_id);
2459 if (!cInfo)
2460 continue;
2461
2462 // already loaded
2463 if (cInfo->PetSpellDataId)
2464 continue;
2465
2466 // for creature without PetSpellDataId get default pet spells from creature_template
2467 int32 petSpellsId = cInfo->Entry;
2468 if (mPetDefaultSpellsMap.find(cInfo->Entry) != mPetDefaultSpellsMap.end())
2469 continue;
2470
2471 PetDefaultSpellsEntry petDefSpells;
2472 for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
2473 petDefSpells.spellid[j] = cInfo->spells[j];
2474
2475 if (LoadPetDefaultSpells_helper(cInfo, petDefSpells))
2476 {
2477 mPetDefaultSpellsMap[petSpellsId] = petDefSpells;
2478 ++countCreature;
2479 }
2480 }
2481 }
2482 }
2483
2484 LOG_INFO("server.loading", ">> Loaded {} Summonable Creature emplates in {} ms", countCreature, GetMSTimeDiffToNow(oldMSTime));
2485 LOG_INFO("server.loading", " ");
2486}
std::int32_t int32
Definition: Define.h:104
DBCStorage< CreatureSpellDataEntry > sCreatureSpellDataStore(CreatureSpellDatafmt)
std::unordered_map< uint32, CreatureTemplate > CreatureTemplateContainer
Definition: CreatureData.h:281
bool LoadPetDefaultSpells_helper(CreatureTemplate const *cInfo, PetDefaultSpellsEntry &petDefSpells)
Definition: SpellMgr.cpp:2360
#define MAX_CREATURE_SPELL_DATA_SLOT
Definition: DBCStructure.h:798
@ SPELL_EFFECT_SUMMON_PET
Definition: SharedDefines.h:806
@ SPELL_EFFECT_SUMMON
Definition: SharedDefines.h:778
Definition: CreatureData.h:176
uint32 Entry
Definition: CreatureData.h:177
uint32 spells[MAX_CREATURE_SPELLS]
Definition: CreatureData.h:221
uint32 PetSpellDataId
Definition: CreatureData.h:222
Definition: SpellMgr.h:585
uint32 spellid[MAX_CREATURE_SPELL_DATA_SLOT]
Definition: SpellMgr.h:586
Definition: DBCStructure.h:801
uint32 spellId[MAX_CREATURE_SPELL_DATA_SLOT]
Definition: DBCStructure.h:803

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 ( )
2304{
2305 uint32 oldMSTime = getMSTime();
2306
2307 mPetLevelupSpellMap.clear(); // need for reload case
2308
2309 uint32 count = 0;
2310 uint32 family_count = 0;
2311
2312 for (uint32 i = 0; i < sCreatureFamilyStore.GetNumRows(); ++i)
2313 {
2314 CreatureFamilyEntry const* creatureFamily = sCreatureFamilyStore.LookupEntry(i);
2315 if (!creatureFamily) // not exist
2316 continue;
2317
2318 for (uint8 j = 0; j < 2; ++j)
2319 {
2320 if (!creatureFamily->skillLine[j])
2321 continue;
2322
2323 for (uint32 k = 0; k < sSkillLineAbilityStore.GetNumRows(); ++k)
2324 {
2325 SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(k);
2326 if (!skillLine)
2327 continue;
2328
2329 //if (skillLine->skillId != creatureFamily->skillLine[0] &&
2330 // (!creatureFamily->skillLine[1] || skillLine->skillId != creatureFamily->skillLine[1]))
2331 // continue;
2332
2333 if (skillLine->SkillLine != creatureFamily->skillLine[j])
2334 continue;
2335
2337 continue;
2338
2339 SpellInfo const* spell = GetSpellInfo(skillLine->Spell);
2340 if (!spell) // not exist or triggered or talent
2341 continue;
2342
2343 if (!spell->SpellLevel)
2344 continue;
2345
2346 PetLevelupSpellSet& spellSet = mPetLevelupSpellMap[creatureFamily->ID];
2347 if (spellSet.empty())
2348 ++family_count;
2349
2350 spellSet.insert(PetLevelupSpellSet::value_type(spell->SpellLevel, spell->Id));
2351 ++count;
2352 }
2353 }
2354 }
2355
2356 LOG_INFO("server.loading", ">> Loaded {} Pet Levelup And Default Spells For {} Families in {} ms", count, family_count, GetMSTimeDiffToNow(oldMSTime));
2357 LOG_INFO("server.loading", " ");
2358}
DBCStorage< CreatureFamilyEntry > sCreatureFamilyStore(CreatureFamilyfmt)
DBCStorage< SkillLineAbilityEntry > sSkillLineAbilityStore(SkillLineAbilityfmt)
std::multimap< uint32, uint32 > PetLevelupSpellSet
Definition: SpellMgr.h:579
@ SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN
Definition: DBCEnums.h:366
uint32 SpellLevel
Definition: SpellInfo.h:358
Definition: DBCStructure.h:754
uint32 ID
Definition: DBCStructure.h:755
uint32 skillLine[2]
Definition: DBCStructure.h:760
Definition: DBCStructure.h:1557
uint32 SkillLine
Definition: DBCStructure.h:1559
uint32 Spell
Definition: DBCStructure.h:1560
uint32 AcquireMethod
Definition: DBCStructure.h:1567

References SkillLineAbilityEntry::AcquireMethod, getMSTime(), GetMSTimeDiffToNow(), GetSpellInfo(), SpellInfo::Id, CreatureFamilyEntry::ID, LOG_INFO, mPetLevelupSpellMap, sCreatureFamilyStore, SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN, CreatureFamilyEntry::skillLine, SkillLineAbilityEntry::SkillLine, SkillLineAbilityEntry::Spell, SpellInfo::SpellLevel, and sSkillLineAbilityStore.

◆ LoadSkillLineAbilityMap()

void SpellMgr::LoadSkillLineAbilityMap ( )
2081{
2082 uint32 oldMSTime = getMSTime();
2083
2084 mSkillLineAbilityMap.clear();
2085
2086 uint32 count = 0;
2087
2088 for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i)
2089 {
2090 SkillLineAbilityEntry const* SkillInfo = sSkillLineAbilityStore.LookupEntry(i);
2091 if (!SkillInfo)
2092 continue;
2093
2094 mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->Spell, SkillInfo));
2095 ++count;
2096 }
2097
2098 LOG_INFO("server.loading", ">> Loaded {} SkillLineAbility MultiMap Data in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2099 LOG_INFO("server.loading", " ");
2100}

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

◆ LoadSpellAreas()

void SpellMgr::LoadSpellAreas ( )
2489{
2490 uint32 oldMSTime = getMSTime();
2491
2492 mSpellAreaMap.clear(); // need for reload case
2493 mSpellAreaForQuestMap.clear();
2495 mSpellAreaForAuraMap.clear();
2496
2497 // 0 1 2 3 4 5 6 7 8 9
2498 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");
2499
2500 if (!result)
2501 {
2502 LOG_WARN("server.loading", ">> Loaded 0 spell area requirements. DB table `spell_area` is empty.");
2503 LOG_INFO("server.loading", " ");
2504 return;
2505 }
2506
2507 uint32 count = 0;
2508 do
2509 {
2510 Field* fields = result->Fetch();
2511
2512 uint32 spell = fields[0].Get<uint32>();
2513 SpellArea spellArea;
2514 spellArea.spellId = spell;
2515 spellArea.areaId = fields[1].Get<uint32>();
2516 spellArea.questStart = fields[2].Get<uint32>();
2517 spellArea.questStartStatus = fields[3].Get<uint32>();
2518 spellArea.questEndStatus = fields[4].Get<uint32>();
2519 spellArea.questEnd = fields[5].Get<uint32>();
2520 spellArea.auraSpell = fields[6].Get<int32>();
2521 spellArea.raceMask = fields[7].Get<uint32>();
2522 spellArea.gender = Gender(fields[8].Get<uint8>());
2523 spellArea.autocast = fields[9].Get<bool>();
2524
2525 if (SpellInfo const* spellInfo = GetSpellInfo(spell))
2526 {
2527 if (spellArea.autocast)
2528 const_cast<SpellInfo*>(spellInfo)->Attributes |= SPELL_ATTR0_NO_AURA_CANCEL;
2529 }
2530 else
2531 {
2532 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` does not exist", spell);
2533 continue;
2534 }
2535
2536 {
2537 bool ok = true;
2538 SpellAreaMapBounds sa_bounds = GetSpellAreaMapBounds(spellArea.spellId);
2539 for (SpellAreaMap::const_iterator itr = sa_bounds.first; itr != sa_bounds.second; ++itr)
2540 {
2541 if (spellArea.spellId != itr->second.spellId)
2542 continue;
2543 if (spellArea.areaId != itr->second.areaId)
2544 continue;
2545 if (spellArea.questStart != itr->second.questStart)
2546 continue;
2547 if (spellArea.auraSpell != itr->second.auraSpell)
2548 continue;
2549 if ((spellArea.raceMask & itr->second.raceMask) == 0)
2550 continue;
2551 if (spellArea.gender != itr->second.gender)
2552 continue;
2553
2554 // duplicate by requirements
2555 ok = false;
2556 break;
2557 }
2558
2559 if (!ok)
2560 {
2561 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` already listed with similar requirements.", spell);
2562 continue;
2563 }
2564 }
2565
2566 if (spellArea.areaId && !sAreaTableStore.LookupEntry(spellArea.areaId))
2567 {
2568 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have wrong area ({}) requirement", spell, spellArea.areaId);
2569 continue;
2570 }
2571
2572 if (spellArea.questStart && !sObjectMgr->GetQuestTemplate(spellArea.questStart))
2573 {
2574 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have wrong start quest ({}) requirement", spell, spellArea.questStart);
2575 continue;
2576 }
2577
2578 if (spellArea.questEnd)
2579 {
2580 if (!sObjectMgr->GetQuestTemplate(spellArea.questEnd))
2581 {
2582 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have wrong end quest ({}) requirement", spell, spellArea.questEnd);
2583 continue;
2584 }
2585 }
2586
2587 if (spellArea.auraSpell)
2588 {
2589 SpellInfo const* spellInfo = GetSpellInfo(std::abs(spellArea.auraSpell));
2590 if (!spellInfo)
2591 {
2592 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have wrong aura spell ({}) requirement", spell, std::abs(spellArea.auraSpell));
2593 continue;
2594 }
2595
2596 if (uint32(std::abs(spellArea.auraSpell)) == spellArea.spellId)
2597 {
2598 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have aura spell ({}) requirement for itself", spell, std::abs(spellArea.auraSpell));
2599 continue;
2600 }
2601
2602 // not allow autocast chains by auraSpell field (but allow use as alternative if not present)
2603 if (spellArea.autocast && spellArea.auraSpell > 0)
2604 {
2605 bool chain = false;
2606 SpellAreaForAuraMapBounds saBound = GetSpellAreaForAuraMapBounds(spellArea.spellId);
2607 for (SpellAreaForAuraMap::const_iterator itr = saBound.first; itr != saBound.second; ++itr)
2608 {
2609 if (itr->second->autocast && itr->second->auraSpell > 0)
2610 {
2611 chain = true;
2612 break;
2613 }
2614 }
2615
2616 if (chain)
2617 {
2618 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have aura spell ({}) requirement that itself autocast from aura", spell, spellArea.auraSpell);
2619 continue;
2620 }
2621
2622 SpellAreaMapBounds saBound2 = GetSpellAreaMapBounds(spellArea.auraSpell);
2623 for (SpellAreaMap::const_iterator itr2 = saBound2.first; itr2 != saBound2.second; ++itr2)
2624 {
2625 if (itr2->second.autocast && itr2->second.auraSpell > 0)
2626 {
2627 chain = true;
2628 break;
2629 }
2630 }
2631
2632 if (chain)
2633 {
2634 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have aura spell ({}) requirement that itself autocast from aura", spell, spellArea.auraSpell);
2635 continue;
2636 }
2637 }
2638 }
2639
2640 if (spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE) == 0)
2641 {
2642 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have wrong race mask ({}) requirement", spell, spellArea.raceMask);
2643 continue;
2644 }
2645
2646 if (spellArea.gender != GENDER_NONE && spellArea.gender != GENDER_FEMALE && spellArea.gender != GENDER_MALE)
2647 {
2648 LOG_ERROR("sql.sql", "Spell {} listed in `spell_area` have wrong gender ({}) requirement", spell, spellArea.gender);
2649 continue;
2650 }
2651
2652 SpellArea const* sa = &mSpellAreaMap.insert(SpellAreaMap::value_type(spell, spellArea))->second;
2653
2654 // for search by current zone/subzone at zone/subzone change
2655 if (spellArea.areaId)
2656 mSpellAreaForAreaMap.insert(SpellAreaForAreaMap::value_type(spellArea.areaId, sa));
2657
2658 // for search at quest start/reward
2659 if (spellArea.questStart)
2660 mSpellAreaForQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart, sa));
2661
2662 // for search at quest start/reward
2663 if (spellArea.questEnd)
2664 mSpellAreaForQuestEndMap.insert(SpellAreaForQuestMap::value_type(spellArea.questEnd, sa));
2665
2666 // for search at aura apply
2667 if (spellArea.auraSpell)
2668 mSpellAreaForAuraMap.insert(SpellAreaForAuraMap::value_type(std::abs(spellArea.auraSpell), sa));
2669
2670 ++count;
2671 } while (result->NextRow());
2672
2673 if (sWorld->getIntConfig(CONFIG_ICC_BUFF_HORDE) > 0)
2674 {
2675 LOG_INFO("server.loading", ">> Using ICC Buff Horde: {}", sWorld->getIntConfig(CONFIG_ICC_BUFF_HORDE));
2676 SpellArea spellAreaICCBuffHorde = { sWorld->getIntConfig(CONFIG_ICC_BUFF_HORDE), ICC_AREA, 0, 0, 0, ICC_RACEMASK_HORDE, Gender(2), 64, 11, 1 };
2677 SpellArea const* saICCBuffHorde = &mSpellAreaMap.insert(SpellAreaMap::value_type(sWorld->getIntConfig(CONFIG_ICC_BUFF_HORDE), spellAreaICCBuffHorde))->second;
2678 mSpellAreaForAreaMap.insert(SpellAreaForAreaMap::value_type(ICC_AREA, saICCBuffHorde));
2679 ++count;
2680 }
2681 else
2682 LOG_INFO("server.loading", ">> ICC Buff Horde: disabled");
2683
2684 if (sWorld->getIntConfig(CONFIG_ICC_BUFF_ALLIANCE) > 0)
2685 {
2686 LOG_INFO("server.loading", ">> Using ICC Buff Alliance: {}", sWorld->getIntConfig(CONFIG_ICC_BUFF_ALLIANCE));
2687 SpellArea spellAreaICCBuffAlliance = { sWorld->getIntConfig(CONFIG_ICC_BUFF_ALLIANCE), ICC_AREA, 0, 0, 0, ICC_RACEMASK_ALLIANCE, Gender(2), 64, 11, 1 };
2688 SpellArea const* saICCBuffAlliance = &mSpellAreaMap.insert(SpellAreaMap::value_type(sWorld->getIntConfig(CONFIG_ICC_BUFF_ALLIANCE), spellAreaICCBuffAlliance))->second;
2689 mSpellAreaForAreaMap.insert(SpellAreaForAreaMap::value_type(ICC_AREA, saICCBuffAlliance));
2690 ++count;
2691 }
2692 else
2693 LOG_INFO("server.loading", ">> ICC Buff Alliance: disabled");
2694
2695 LOG_INFO("server.loading", ">> Loaded {} Spell Area Requirements in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2696 LOG_INFO("server.loading", " ");
2697}
#define LOG_WARN(filterType__,...)
Definition: Log.h:163
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
std::shared_ptr< ResultSet > QueryResult
Definition: DatabaseEnvFwd.h:28
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTableEntryfmt)
std::pair< SpellAreaMap::const_iterator, SpellAreaMap::const_iterator > SpellAreaMapBounds
Definition: SpellMgr.h:540
@ ICC_RACEMASK_HORDE
Definition: SpellMgr.h:515
@ ICC_AREA
Definition: SpellMgr.h:514
@ ICC_RACEMASK_ALLIANCE
Definition: SpellMgr.h:516
std::pair< SpellAreaForAuraMap::const_iterator, SpellAreaForAuraMap::const_iterator > SpellAreaForAuraMapBounds
Definition: SpellMgr.h:542
@ CONFIG_ICC_BUFF_ALLIANCE
Definition: IWorld.h:377
@ CONFIG_ICC_BUFF_HORDE
Definition: IWorld.h:376
Gender
Definition: SharedDefines.h:59
@ GENDER_MALE
Definition: SharedDefines.h:60
@ GENDER_FEMALE
Definition: SharedDefines.h:61
@ GENDER_NONE
Definition: SharedDefines.h:62
@ SPELL_ATTR0_NO_AURA_CANCEL
Definition: SharedDefines.h:385
#define RACEMASK_ALL_PLAYABLE
Definition: SharedDefines.h:96
#define sWorld
Definition: World.h:458
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: SpellMgr.h:520
uint32 spellId
Definition: SpellMgr.h:521
SpellAreaMapBounds GetSpellAreaMapBounds(uint32 spell_id) const
Definition: SpellMgr.cpp:1053
SpellAreaForAuraMapBounds GetSpellAreaForAuraMapBounds(uint32 spell_id) const
Definition: SpellMgr.cpp:1068

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, RACEMASK_ALL_PLAYABLE, sAreaTableStore, sObjectMgr, SPELL_ATTR0_NO_AURA_CANCEL, SpellArea::spellId, sWorld, and WorldDatabase.

◆ LoadSpellBonuses()

void SpellMgr::LoadSpellBonuses ( )
1963{
1964 uint32 oldMSTime = getMSTime();
1965
1966 mSpellBonusMap.clear(); // need for reload case
1967
1968 // 0 1 2 3 4
1969 QueryResult result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data");
1970 if (!result)
1971 {
1972 LOG_WARN("server.loading", ">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty.");
1973 LOG_INFO("server.loading", " ");
1974 return;
1975 }
1976
1977 uint32 count = 0;
1978 do
1979 {
1980 Field* fields = result->Fetch();
1981 uint32 entry = fields[0].Get<uint32>();
1982
1983 SpellInfo const* spell = GetSpellInfo(entry);
1984 if (!spell)
1985 {
1986 LOG_ERROR("sql.sql", "Spell {} listed in `spell_bonus_data` does not exist", entry);
1987 continue;
1988 }
1989
1990 SpellBonusEntry& sbe = mSpellBonusMap[entry];
1991 sbe.direct_damage = fields[1].Get<float>();
1992 sbe.dot_damage = fields[2].Get<float>();
1993 sbe.ap_bonus = fields[3].Get<float>();
1994 sbe.ap_dot_bonus = fields[4].Get<float>();
1995
1996 ++count;
1997 } while (result->NextRow());
1998
1999 LOG_INFO("server.loading", ">> Loaded {} Extra Spell Bonus Data in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2000 LOG_INFO("server.loading", " ");
2001}
Definition: SpellMgr.h:317
float ap_dot_bonus
Definition: SpellMgr.h:321
float dot_damage
Definition: SpellMgr.h:319
float ap_bonus
Definition: SpellMgr.h:320
float direct_damage
Definition: SpellMgr.h:318

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.

◆ LoadSpellEnchantProcData()

void SpellMgr::LoadSpellEnchantProcData ( )
2207{
2208 uint32 oldMSTime = getMSTime();
2209
2210 mSpellEnchantProcEventMap.clear(); // need for reload case
2211
2212 // 0 1 2 3
2213 QueryResult result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data");
2214 if (!result)
2215 {
2216 LOG_WARN("server.loading", ">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty.");
2217 LOG_INFO("server.loading", " ");
2218 return;
2219 }
2220
2221 uint32 count = 0;
2222 do
2223 {
2224 Field* fields = result->Fetch();
2225
2226 uint32 enchantId = fields[0].Get<uint32>();
2227
2228 SpellItemEnchantmentEntry const* ench = sSpellItemEnchantmentStore.LookupEntry(enchantId);
2229 if (!ench)
2230 {
2231 LOG_ERROR("sql.sql", "Enchancment {} listed in `spell_enchant_proc_data` does not exist", enchantId);
2232 continue;
2233 }
2234
2236
2237 spe.customChance = fields[1].Get<uint32>();
2238 spe.PPMChance = fields[2].Get<float>();
2239 spe.procEx = fields[3].Get<uint32>();
2240
2241 mSpellEnchantProcEventMap[enchantId] = spe;
2242
2243 ++count;
2244 } while (result->NextRow());
2245
2246 LOG_INFO("server.loading", ">> Loaded {} Enchant Proc Data Definitions in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
2247 LOG_INFO("server.loading", " ");
2248}
Definition: SpellMgr.h:308
uint32 procEx
Definition: SpellMgr.h:311
uint32 customChance
Definition: SpellMgr.h:309
float PPMChance
Definition: SpellMgr.h:310

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

◆ LoadSpellGroups()

void SpellMgr::LoadSpellGroups ( )
1626{
1627 uint32 oldMSTime = getMSTime();
1628
1629 mSpellGroupMap.clear(); // need for reload case
1630
1631 // 0 1 2
1632 QueryResult result = WorldDatabase.Query("SELECT id, spell_id, special_flag FROM spell_group");
1633 if (!result)
1634 {
1635 LOG_WARN("server.loading", ">> Loaded 0 spell group definitions. DB table `spell_group` is empty.");
1636 LOG_INFO("server.loading", " ");
1637 return;
1638 }
1639
1640 uint32 count = 0;
1641 do
1642 {
1643 Field* fields = result->Fetch();
1644
1645 uint32 group_id = fields[0].Get<uint32>();
1646 int32 spell_id = fields[1].Get<uint32>();
1647 SpellGroupSpecialFlags specialFlag = (SpellGroupSpecialFlags)fields[2].Get<uint32>();
1648 SpellInfo const* spellInfo = GetSpellInfo(spell_id);
1649
1650 if (!spellInfo)
1651 {
1652 LOG_ERROR("sql.sql", "Spell {} listed in `spell_group` does not exist", spell_id);
1653 continue;
1654 }
1655 else if (spellInfo->GetRank() > 1)
1656 {
1657 LOG_ERROR("sql.sql", "Spell {} listed in `spell_group` is not first rank of spell", spell_id);
1658 continue;
1659 }
1660
1661 if (mSpellGroupMap.find(spell_id) != mSpellGroupMap.end())
1662 {
1663 LOG_ERROR("sql.sql", "Spell {} listed in `spell_group` has more than one group", spell_id);
1664 continue;
1665 }
1666
1667 if (specialFlag >= SPELL_GROUP_SPECIAL_FLAG_MAX)
1668 {
1669 LOG_ERROR("sql.sql", "Spell {} listed in `spell_group` has invalid special flag!", spell_id);
1670 continue;
1671 }
1672
1673 SpellStackInfo ssi;
1674 ssi.groupId = group_id;
1675 ssi.specialFlags = specialFlag;
1676 mSpellGroupMap[spell_id] = ssi;
1677
1678 ++count;
1679 } while (result->NextRow());
1680
1681 LOG_INFO("server.loading", ">> Loaded {} Spell Group Definitions in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
1682 LOG_INFO("server.loading", " ");
1683}
@ SPELL_GROUP_SPECIAL_FLAG_MAX
Definition: SpellMgr.h:343
uint8 GetRank() const
Definition: SpellInfo.cpp:2474
Definition: SpellMgr.h:369
SpellGroupSpecialFlags specialFlags
Definition: SpellMgr.h:371
uint32 groupId
Definition: SpellMgr.h:370

References Field::Get(), getMSTime(), GetMSTimeDiffToNow(), SpellInfo::GetRank(), GetSpellInfo(), SpellStackInfo::groupId, LOG_ERROR, LOG_INFO, LOG_WARN, mSpellGroupMap, SpellStackInfo::specialFlags, SPELL_GROUP_SPECIAL_FLAG_MAX, and WorldDatabase.

◆ LoadSpellGroupStackRules()

void SpellMgr::LoadSpellGroupStackRules ( )
1686{
1687 uint32 oldMSTime = getMSTime();
1688
1689 mSpellGroupStackMap.clear(); // need for reload case
1690
1691 // 0 1
1692 QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules");
1693 if (!result)
1694 {
1695 LOG_WARN("server.loading", ">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty.");
1696 LOG_INFO("server.loading", " ");
1697 return;
1698 }
1699
1700 uint32 count = 0;
1701 do
1702 {
1703 Field* fields = result->Fetch();
1704
1705 uint32 group_id = fields[0].Get<uint32>();
1706 uint8 stack_rule = fields[1].Get<int8>();
1707 if (stack_rule >= SPELL_GROUP_STACK_FLAG_MAX)
1708 {
1709 LOG_ERROR("sql.sql", "SpellGroupStackRule {} listed in `spell_group_stack_rules` does not exist", stack_rule);
1710 continue;
1711 }
1712
1713 bool present = false;
1714 for (SpellGroupMap::const_iterator itr = mSpellGroupMap.begin(); itr != mSpellGroupMap.end(); ++itr)
1715 if (itr->second.groupId == group_id)
1716 {
1717 present = true;
1718 break;
1719 }
1720
1721 if (!present)
1722 {
1723 LOG_ERROR("sql.sql", "SpellGroup id {} listed in `spell_group_stack_rules` does not exist", group_id);
1724 continue;
1725 }
1726
1727 mSpellGroupStackMap[group_id] = (SpellGroupStackFlags)stack_rule;
1728
1729 ++count;
1730 } while (result->NextRow());
1731
1732 LOG_INFO("server.loading", ">> Loaded {} Spell Group Stack Rules in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
1733 LOG_INFO("server.loading", " ");
1734}
std::int8_t int8
Definition: Define.h:106
@ SPELL_GROUP_STACK_FLAG_MAX
Definition: SpellMgr.h:356

References Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_ERROR, LOG_INFO, LOG_WARN, mSpellGroupMap, mSpellGroupStackMap, SPELL_GROUP_STACK_FLAG_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 // Elixir of Minor Fortitude
61 ApplySpellFix({ 2378 }, [](SpellInfo* spellInfo)
62 {
63 spellInfo->ManaCost = 0;
64 spellInfo->ManaPerSecond = 0;
65 });
66
67 // Elixir of Detect Undead
68 ApplySpellFix({ 11389 }, [](SpellInfo* spellInfo)
69 {
70 spellInfo->PowerType = POWER_MANA;
71 spellInfo->ManaCost = 0;
72 spellInfo->ManaPerSecond = 0;
73 });
74
75 // Evergrove Druid Transform Crow
76 ApplySpellFix({ 38776 }, [](SpellInfo* spellInfo)
77 {
78 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(4); // 120 seconds
79 });
80
82 63026, // Force Cast (HACK: Target shouldn't be changed)
83 63137 // Force Cast (HACK: Target shouldn't be changed; summon position should be untied from spell destination)
84 }, [](SpellInfo* spellInfo)
85 {
86 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB);
87 });
88
90 53096, // Quetz'lun's Judgment
91 70743, // AoD Special
92 70614 // AoD Special - Vegard
93 }, [](SpellInfo* spellInfo)
94 {
95 spellInfo->MaxAffectedTargets = 1;
96 });
97
98 // Summon Skeletons
99 ApplySpellFix({ 52611, 52612 }, [](SpellInfo* spellInfo)
100 {
101 spellInfo->Effects[EFFECT_0].MiscValueB = 64;
102 });
103
105 40244, // Simon Game Visual
106 40245, // Simon Game Visual
107 40246, // Simon Game Visual
108 40247, // Simon Game Visual
109 42835 // Spout, remove damage effect, only anim is needed
110 }, [](SpellInfo* spellInfo)
111 {
112 spellInfo->Effects[EFFECT_0].Effect = 0;
113 });
114
116 63665, // Charge (Argent Tournament emote on riders)
117 31298, // Sleep (needs target selection script)
118 2895, // Wrath of Air Totem rank 1 (Aura)
119 68933, // Wrath of Air Totem rank 2 (Aura)
120 29200 // Purify Helboar Meat
121 }, [](SpellInfo* spellInfo)
122 {
123 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
124 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(0);
125 });
126
127 // Howl of Azgalor
128 ApplySpellFix({ 31344 }, [](SpellInfo* spellInfo)
129 {
130 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yards instead of 50000?!
131 });
132
134 42818, // Headless Horseman - Wisp Flight Port
135 42821 // Headless Horseman - Wisp Flight Missile
136 }, [](SpellInfo* spellInfo)
137 {
138 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100 yards
139 });
140
141 // Spirit of Kirith
142 ApplySpellFix({ 10853 }, [](SpellInfo* spellInfo)
143 {
144 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(3); // 1min
145 });
146
147 // Headless Horseman - Start Fire
148 ApplySpellFix({ 42132 }, [](SpellInfo* spellInfo)
149 {
150 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100 yards
151 });
152
153 //They Must Burn Bomb Aura (self)
154 ApplySpellFix({ 36350 }, [](SpellInfo* spellInfo)
155 {
156 spellInfo->Effects[EFFECT_0].TriggerSpell = 36325; // They Must Burn Bomb Drop (DND)
157 });
158
159 // Mana Shield (rank 2)
160 ApplySpellFix({ 8494 }, [](SpellInfo* spellInfo)
161 {
162 spellInfo->ProcChance = 0; // because of bug in dbc
163 });
164
166 63320, // Glyph of Life Tap
167 20335, // Heart of the Crusader
168 20336, // Heart of the Crusader
169 20337, // Heart of the Crusader
170 53228, // Rapid Killing (Rank 1)
171 53232, // Rapid Killing (Rank 2)
172 }, [](SpellInfo* spellInfo)
173 {
174 spellInfo->AttributesEx3 |= SPELL_ATTR3_CAN_PROC_FROM_PROCS; // Entries were not updated after spell effect change, we have to do that manually
175 });
176
178 31347, // Doom
179 41635, // Prayer of Mending
180 39365, // Thundering Storm
181 52124, // Sky Darkener Assault
182 42442, // Vengeance Landing Cannonfire
183 45863, // Cosmetic - Incinerate to Random Target
184 25425, // Shoot
185 45761, // Shoot
186 42611, // Shoot
187 61588, // Blazing Harpoon
188 36327 // Shoot Arcane Explosion Arrow
189 }, [](SpellInfo* spellInfo)
190 {
191 spellInfo->MaxAffectedTargets = 1;
192 });
193
194 // Skartax Purple Beam
195 ApplySpellFix({ 36384 }, [](SpellInfo* spellInfo)
196 {
197 spellInfo->MaxAffectedTargets = 2;
198 });
199
201 37790, // Spread Shot
202 54172, // Divine Storm (heal)
203 66588, // Flaming Spear
204 54171 // Divine Storm
205 }, [](SpellInfo* spellInfo)
206 {
207 spellInfo->MaxAffectedTargets = 3;
208 });
209
210 // Divine Storm (Damage)
211 ApplySpellFix({ 53385 }, [](SpellInfo* spellInfo)
212 {
213 spellInfo->MaxAffectedTargets = 4;
214 });
215
216 // Spitfire Totem
217 ApplySpellFix({ 38296 }, [](SpellInfo* spellInfo)
218 {
219 spellInfo->MaxAffectedTargets = 5;
220 });
221
223 40827, // Sinful Beam
224 40859, // Sinister Beam
225 40860, // Vile Beam
226 40861 // Wicked Beam
227 }, [](SpellInfo* spellInfo)
228 {
229 spellInfo->MaxAffectedTargets = 10;
230 });
231
232 // Unholy Frenzy
233 ApplySpellFix({ 50312 }, [](SpellInfo* spellInfo)
234 {
235 spellInfo->MaxAffectedTargets = 15;
236 });
237
239 17941, // Shadow Trance
240 22008, // Netherwind Focus
241 31834, // Light's Grace
242 34754, // Clearcasting
243 34936, // Backlash
244 48108, // Hot Streak
245 51124, // Killing Machine
246 54741, // Firestarter
247 64823, // Item - Druid T8 Balance 4P Bonus
248 34477, // Misdirection
249 44401, // Missile Barrage
250 18820 // Insight
251 }, [](SpellInfo* spellInfo)
252 {
253 spellInfo->ProcCharges = 1;
254 });
255
256 // Fireball
257 ApplySpellFix({ 57761 }, [](SpellInfo* spellInfo)
258 {
259 spellInfo->ProcCharges = 1;
260 spellInfo->SpellPriority = 50;
261 });
262
263 // Tidal Wave
264 ApplySpellFix({ 53390 }, [](SpellInfo* spellInfo)
265 {
266 spellInfo->ProcCharges = 2;
267 });
268
269 // Oscillation Field
270 ApplySpellFix({ 37408 }, [](SpellInfo* spellInfo)
271 {
272 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
273 });
274
275 // Ascendance (Talisman of Ascendance trinket)
276 ApplySpellFix({ 28200 }, [](SpellInfo* spellInfo)
277 {
278 spellInfo->ProcCharges = 6;
279 });
280
281 // The Eye of Acherus (no spawn in phase 2 in db)
282 ApplySpellFix({ 51852 }, [](SpellInfo* spellInfo)
283 {
284 spellInfo->Effects[EFFECT_0].MiscValue |= 1;
285 });
286
287 // Crafty's Ultra-Advanced Proto-Typical Shortening Blaster
288 ApplySpellFix({ 51912 }, [](SpellInfo* spellInfo)
289 {
290 spellInfo->Effects[EFFECT_0].Amplitude = 3000;
291 });
292
293 // Desecration Arm - 36 instead of 37 - typo?
294 ApplySpellFix({ 29809 }, [](SpellInfo* spellInfo)
295 {
296 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_7_YARDS);
297 });
298
299 // Sic'em
300 ApplySpellFix({ 42767 }, [](SpellInfo* spellInfo)
301 {
302 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_NEARBY_ENTRY);
303 });
304
305 // Master Shapeshifter: missing stance data for forms other than bear - bear version has correct data
306 // To prevent aura staying on target after talent unlearned
307 ApplySpellFix({ 48420 }, [](SpellInfo* spellInfo)
308 {
309 spellInfo->Stances = 1 << (FORM_CAT - 1);
310 });
311
312 ApplySpellFix({ 48421 }, [](SpellInfo* spellInfo)
313 {
314 spellInfo->Stances = 1 << (FORM_MOONKIN - 1);
315 });
316
317 ApplySpellFix({ 48422 }, [](SpellInfo* spellInfo)
318 {
319 spellInfo->Stances = 1 << (FORM_TREE - 1);
320 });
321
322 // Elemental Oath
323 ApplySpellFix({ 51466, 51470 }, [](SpellInfo* spellInfo)
324 {
325 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
326 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
327 spellInfo->Effects[EFFECT_1].MiscValue = SPELLMOD_EFFECT2;
328 spellInfo->Effects[EFFECT_1].SpellClassMask = flag96(0x00000000, 0x00004000, 0x00000000);
329 });
330
331 // Improved Shadowform (Rank 1)
332 ApplySpellFix({ 47569 }, [](SpellInfo* spellInfo)
333 {
334 spellInfo->Attributes &= ~SPELL_ATTR0_NOT_SHAPESHIFTED; // with this spell atrribute aura can be stacked several times
335 });
336
337 // Nether Portal - Perseverence
338 ApplySpellFix({ 30421 }, [](SpellInfo* spellInfo)
339 {
340 spellInfo->Effects[EFFECT_2].BasePoints += 30000;
341 });
342
343 // Natural shapeshifter
344 ApplySpellFix({ 16834, 16835 }, [](SpellInfo* spellInfo)
345 {
346 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21);
347 });
348
349 // Ebon Plague
350 ApplySpellFix({ 51735, 51734, 51726 }, [](SpellInfo* spellInfo)
351 {
352 spellInfo->SpellFamilyFlags[2] = 0x10;
353 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN;
354 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
355 });
356
357 // Parasitic Shadowfiend Passive
358 ApplySpellFix({ 41013 }, [](SpellInfo* spellInfo)
359 {
360 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_DUMMY; // proc debuff, and summon infinite fiends
361 });
362
364 27892, // To Anchor 1
365 27928, // To Anchor 1
366 27935, // To Anchor 1
367 27915, // Anchor to Skulls
368 27931, // Anchor to Skulls
369 27937 // Anchor to Skulls
370 }, [](SpellInfo* spellInfo)
371 {
372 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13);
373 });
374
375 // Wrath of the Plaguebringer
376 ApplySpellFix({ 29214, 54836 }, [](SpellInfo* spellInfo)
377 {
378 // target allys instead of enemies, target A is src_caster, spells with effect like that have ally target
379 // this is the only known exception, probably just wrong data
380 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY);
381 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY);
382 });
383
384 // Wind Shear
385 ApplySpellFix({ 57994 }, [](SpellInfo* spellInfo)
386 {
387 // improper data for EFFECT_1 in 3.3.5 DBC, but is correct in 4.x
388 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_MODIFY_THREAT_PERCENT;
389 spellInfo->Effects[EFFECT_1].BasePoints = -6; // -5%
390 });
391
392 // Improved Devouring Plague
393 ApplySpellFix({ 63675 }, [](SpellInfo* spellInfo)
394 {
395 spellInfo->Effects[EFFECT_0].BonusMultiplier = 0;
396 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
397 });
398
400 8145, // Tremor Totem (instant pulse)
401 6474 // Earthbind Totem (instant pulse)
402 }, [](SpellInfo* spellInfo)
403 {
404 spellInfo->AttributesEx5 |= SPELL_ATTR5_EXTRA_INITIAL_PERIOD;
405 });
406
407 // Marked for Death
408 ApplySpellFix({ 53241, 53243, 53244, 53245, 53246 }, [](SpellInfo* spellInfo)
409 {
410 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(423937, 276955137, 2049);
411 });
412
414 70728, // Exploit Weakness
415 70840 // Devious Minds
416 }, [](SpellInfo* spellInfo)
417 {
418 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
419 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_PET);
420 });
421
422 // Culling The Herd
423 ApplySpellFix({ 70893 }, [](SpellInfo* spellInfo)
424 {
425 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
426 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_MASTER);
427 });
428
429 // Sigil of the Frozen Conscience
430 ApplySpellFix({ 54800 }, [](SpellInfo* spellInfo)
431 {
432 // change class mask to custom extended flags of Icy Touch
433 // this is done because another spell also uses the same SpellFamilyFlags as Icy Touch
434 // SpellFamilyFlags[0] & 0x00000040 in SPELLFAMILY_DEATHKNIGHT is currently unused (3.3.5a)
435 // this needs research on modifier applying rules, does not seem to be in Attributes fields
436 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000040, 0x00000000, 0x00000000);
437 });
438
439 // Idol of the Flourishing Life
440 ApplySpellFix({ 64949 }, [](SpellInfo* spellInfo)
441 {
442 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000000, 0x02000000, 0x00000000);
443 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
444 });
445
447 34231, // Libram of the Lightbringer
448 60792, // Libram of Tolerance
449 64956 // Libram of the Resolute
450 }, [](SpellInfo* spellInfo)
451 {
452 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x80000000, 0x00000000, 0x00000000);
453 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
454 });
455
457 28851, // Libram of Light
458 28853, // Libram of Divinity
459 32403 // Blessed Book of Nagrand
460 }, [](SpellInfo* spellInfo)
461 {
462 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x40000000, 0x00000000, 0x00000000);
463 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
464 });
465
466 // Ride Carpet
467 ApplySpellFix({ 45602 }, [](SpellInfo* spellInfo)
468 {
469 spellInfo->Effects[EFFECT_0].BasePoints = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)"
470 });
471
473 64745, // Item - Death Knight T8 Tank 4P Bonus
474 64936 // Item - Warrior T8 Protection 4P Bonus
475 }, [](SpellInfo* spellInfo)
476 {
477 spellInfo->Effects[EFFECT_0].BasePoints = 100; // 100% chance of procc'ing, not -10% (chance calculated in PrepareTriggersExecutedOnHit)
478 });
479
480 // Easter Lay Noblegarden Egg Aura
481 ApplySpellFix({ 61719 }, [](SpellInfo* spellInfo)
482 {
483 // Interrupt flags copied from aura which this aura is linked with
484 spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE;
485 });
486
487 // Bleh, need to change FamilyFlags :/ (have the same as original aura - bad!)
488 ApplySpellFix({ 63510 }, [](SpellInfo* spellInfo)
489 {
490 spellInfo->SpellFamilyFlags[EFFECT_0] = 0;
491 spellInfo->SpellFamilyFlags[EFFECT_2] = 0x4000000;
492 });
493
494 ApplySpellFix({ 63514 }, [](SpellInfo* spellInfo)
495 {
496 spellInfo->SpellFamilyFlags[EFFECT_0] = 0;
497 spellInfo->SpellFamilyFlags[EFFECT_2] = 0x2000000;
498 });
499
500 ApplySpellFix({ 63531 }, [](SpellInfo* spellInfo)
501 {
502 spellInfo->SpellFamilyFlags[EFFECT_0] = 0;
503 spellInfo->SpellFamilyFlags[EFFECT_2] = 0x8000000;
504 });
505
506 // And affecting spells
508 20138, // Improved Devotion Aura
509 20139,
510 20140
511 }, [](SpellInfo* spellInfo)
512 {
513 spellInfo->Effects[EFFECT_1].SpellClassMask[0] = 0;
514 spellInfo->Effects[EFFECT_1].SpellClassMask[2] = 0x2000000;
515 });
516
518 20254, // Improved concentration aura
519 20255,
520 20256
521 }, [](SpellInfo* spellInfo)
522 {
523 spellInfo->Effects[EFFECT_1].SpellClassMask[0] = 0;
524 spellInfo->Effects[EFFECT_1].SpellClassMask[2] = 0x4000000;
525 spellInfo->Effects[EFFECT_2].SpellClassMask[0] = 0;
526 spellInfo->Effects[EFFECT_2].SpellClassMask[2] = 0x4000000;
527 });
528
530 53379, // Swift Retribution
531 53484,
532 53648
533 }, [](SpellInfo* spellInfo)
534 {
535 spellInfo->Effects[EFFECT_0].SpellClassMask[0] = 0;
536 spellInfo->Effects[EFFECT_0].SpellClassMask[2] = 0x8000000;
537 });
538
539 // Sanctified Retribution
540 ApplySpellFix({ 31869 }, [](SpellInfo* spellInfo)
541 {
542 spellInfo->Effects[EFFECT_0].SpellClassMask[0] = 0;
543 spellInfo->Effects[EFFECT_0].SpellClassMask[2] = 0x8000000;
544 });
545
546 // Seal of Light trigger
547 ApplySpellFix({ 20167 }, [](SpellInfo* spellInfo)
548 {
549 spellInfo->SpellLevel = 0;
550 spellInfo->BaseLevel = 0;
551 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
552 });
553
554 // Light's Beacon, Beacon of Light
555 ApplySpellFix({ 53651 }, [](SpellInfo* spellInfo)
556 {
557 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
558 });
559
560 // Hand of Reckoning
561 ApplySpellFix({ 62124 }, [](SpellInfo* spellInfo)
562 {
563 spellInfo->AttributesEx |= SPELL_ATTR1_NO_REDIRECTION;
564 });
565
566 // Redemption
567 ApplySpellFix({ 7328, 10322, 10324, 20772, 20773, 48949, 48950 }, [](SpellInfo* spellInfo)
568 {
569 spellInfo->SpellFamilyName = SPELLFAMILY_PALADIN;
570 });
571
573 20184, // Judgement of Justice
574 20185, // Judgement of Light
575 20186, // Judgement of Wisdom
576 68055 // Judgements of the Just
577 }, [](SpellInfo* spellInfo)
578 {
579 // hack for seal of light and few spells, judgement consists of few single casts and each of them can proc
580 // some spell, base one has disabled proc flag but those dont have this flag
581 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_CASTER_PROCS;
582 });
583
584 // Blessing of sanctuary stats
585 ApplySpellFix({ 67480 }, [](SpellInfo* spellInfo)
586 {
587 spellInfo->Effects[EFFECT_0].MiscValue = -1;
588 spellInfo->SpellFamilyName = SPELLFAMILY_UNK1; // allows stacking
589 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_DUMMY; // just a marker
590 });
591
592 // Seal of Command trigger
593 ApplySpellFix({ 20424 }, [](SpellInfo* spellInfo)
594 {
595 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_SUPRESS_CASTER_PROCS;
596 });
597
599 54968, // Glyph of Holy Light, Damage Class should be magic
600 53652, // Beacon of Light heal, Damage Class should be magic
601 53654
602 }, [](SpellInfo* spellInfo)
603 {
604 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
605 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
606 });
607
608 // Wild Hunt
609 ApplySpellFix({ 62758, 62762 }, [](SpellInfo* spellInfo)
610 {
611 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AURA;
612 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_DUMMY;
613 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
614 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_DUMMY;
615 });
616
617 // Intervene
618 ApplySpellFix({ 3411 }, [](SpellInfo* spellInfo)
619 {
620 spellInfo->Attributes |= SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT;
621 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
622 });
623
624 // Roar of Sacrifice
625 ApplySpellFix({ 53480 }, [](SpellInfo* spellInfo)
626 {
627 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
628 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_SPLIT_DAMAGE_PCT;
629 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY);
630 spellInfo->Effects[EFFECT_1].DieSides = 1;
631 spellInfo->Effects[EFFECT_1].BasePoints = 19;
632 spellInfo->Effects[EFFECT_1].BasePoints = 127; // all schools
633 });
634
635 // Silencing Shot
636 ApplySpellFix({ 34490, 41084, 42671 }, [](SpellInfo* spellInfo)
637 {
638 spellInfo->Speed = 0.0f;
639 });
640
641 // Monstrous Bite
642 ApplySpellFix({ 54680, 55495, 55496, 55497, 55498, 55499 }, [](SpellInfo* spellInfo)
643 {
644 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
645 });
646
647 // Hunter's Mark
648 ApplySpellFix({ 1130, 14323, 14324, 14325, 53338 }, [](SpellInfo* spellInfo)
649 {
650 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
651 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
652 });
653
654 // Cobra Strikes
655 ApplySpellFix({ 53257 }, [](SpellInfo* spellInfo)
656 {
657 spellInfo->ProcCharges = 2;
658 spellInfo->StackAmount = 0;
659 });
660
661 // Kill Command
662 ApplySpellFix({ 34027 }, [](SpellInfo* spellInfo)
663 {
664 spellInfo->ProcCharges = 0;
665 });
666
667 // Kindred Spirits, damage aura
668 ApplySpellFix({ 57458 }, [](SpellInfo* spellInfo)
669 {
670 spellInfo->AttributesEx4 |= SPELL_ATTR4_ALLOW_ENETRING_ARENA;
671 });
672
673 // Chimera Shot - Serpent trigger
674 ApplySpellFix({ 53353 }, [](SpellInfo* spellInfo)
675 {
676 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
677 });
678
679 // Entrapment trigger
680 ApplySpellFix({ 19185, 64803, 64804 }, [](SpellInfo* spellInfo)
681 {
682 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_TARGET_ENEMY);
683 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_DEST_AREA_ENEMY);
684 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT;
685 });
686
687 // Improved Stings (Rank 2)
688 ApplySpellFix({ 19465 }, [](SpellInfo* spellInfo)
689 {
690 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
691 });
692
693 // Heart of the Phoenix (triggered)
694 ApplySpellFix({ 54114 }, [](SpellInfo* spellInfo)
695 {
696 spellInfo->AttributesEx &= ~SPELL_ATTR1_DISMISS_PET_FIRST;
697 spellInfo->RecoveryTime = 8 * 60 * IN_MILLISECONDS; // prev 600000
698 });
699
700 // Master of Subtlety
701 ApplySpellFix({ 31221, 31222, 31223 }, [](SpellInfo* spellInfo)
702 {
703 spellInfo->SpellFamilyName = SPELLFAMILY_ROGUE;
704 });
705
707 31666, // Master of Subtlety triggers
708 58428 // Overkill
709 }, [](SpellInfo* spellInfo)
710 {
711 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_SCRIPT_EFFECT;
712 });
713
714 // Honor Among Thieves
715 ApplySpellFix({ 51698, 51700, 51701 }, [](SpellInfo* spellInfo)
716 {
717 spellInfo->Effects[EFFECT_0].TriggerSpell = 51699;
718 });
719
721 5171, // Slice and Dice
722 6774, // Slice and Dice
723 1725 // Distract
724 }, [](SpellInfo* spellInfo)
725 {
726 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
727 });
728
729 // Envenom
730 ApplySpellFix({ 32645, 32684, 57992, 57993 }, [](SpellInfo* spellInfo)
731 {
732 spellInfo->Dispel = DISPEL_NONE;
733 });
734
736 64014, // Expedition Base Camp Teleport
737 64032, // Formation Grounds Teleport
738 64028, // Colossal Forge Teleport
739 64031, // Scrapyard Teleport
740 64030, // Antechamber Teleport
741 64029, // Shattered Walkway Teleport
742 64024, // Conservatory Teleport
743 64025, // Halls of Invention Teleport
744 65042 // Prison of Yogg-Saron Teleport
745 }, [](SpellInfo* spellInfo)
746 {
747 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_DEST_DB);
748 });
749
750 // Killing Spree (teleport)
751 ApplySpellFix({ 57840 }, [](SpellInfo* spellInfo)
752 {
753 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100 yards
754 });
755
756 // Killing Spree
757 ApplySpellFix({ 51690 }, [](SpellInfo* spellInfo)
758 {
759 spellInfo->AttributesEx |= SPELL_ATTR1_ALLOW_WHILE_STEALTHED;
760 });
761
762 // Blood Tap visual cd reset
763 ApplySpellFix({ 47804 }, [](SpellInfo* spellInfo)
764 {
765 spellInfo->Effects[EFFECT_2].Effect = 0;
766 spellInfo->Effects[EFFECT_1].Effect = 0;
767 spellInfo->RuneCostID = 442;
768 });
769
770 // Chains of Ice
771 ApplySpellFix({ 45524 }, [](SpellInfo* spellInfo)
772 {
773 spellInfo->Effects[EFFECT_2].Effect = 0;
774 });
775
776 // Impurity
777 ApplySpellFix({ 49220, 49633, 49635, 49636, 49638 }, [](SpellInfo* spellInfo)
778 {
779 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AURA;
780 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_DUMMY;
781 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
782 spellInfo->SpellFamilyName = SPELLFAMILY_DEATHKNIGHT;
783 });
784
785 // Deadly Aggression (Deadly Gladiator's Death Knight Relic, item: 42620)
786 ApplySpellFix({ 60549 }, [](SpellInfo* spellInfo)
787 {
788 spellInfo->Effects[EFFECT_1].Effect = 0;
789 });
790
791 // Magic Suppression
792 ApplySpellFix({ 49224, 49610, 49611 }, [](SpellInfo* spellInfo)
793 {
794 spellInfo->ProcCharges = 0;
795 });
796
797 // Wandering Plague
798 ApplySpellFix({ 50526 }, [](SpellInfo* spellInfo)
799 {
800 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
801 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
802 });
803
804 // Dancing Rune Weapon
805 ApplySpellFix({ 49028 }, [](SpellInfo* spellInfo)
806 {
807 spellInfo->Effects[EFFECT_2].Effect = 0;
808 spellInfo->ProcFlags |= PROC_FLAG_DONE_MELEE_AUTO_ATTACK;
809 });
810
811 // Death and Decay
812 ApplySpellFix({ 52212 }, [](SpellInfo* spellInfo)
813 {
814 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
815 spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_PHASE_SHIFT;
816 });
817
818 // T9 blood plague crit bonus
819 ApplySpellFix({ 67118 }, [](SpellInfo* spellInfo)
820 {
821 spellInfo->Effects[EFFECT_1].Effect = 0;
822 });
823
824 // Pestilence
825 ApplySpellFix({ 50842 }, [](SpellInfo* spellInfo)
826 {
827 spellInfo->Effects[EFFECT_2].TargetA = TARGET_DEST_TARGET_ENEMY;
828 });
829
830 // Horn of Winter, stacking issues
831 ApplySpellFix({ 57330, 57623 }, [](SpellInfo* spellInfo)
832 {
833 spellInfo->Effects[EFFECT_1].TargetA = 0;
834 });
835
836 // Scourge Strike trigger
837 ApplySpellFix({ 70890 }, [](SpellInfo* spellInfo)
838 {
839 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_CASTER_PROCS;
840 });
841
842 // Blood-caked Blade - Blood-caked Strike trigger
843 ApplySpellFix({ 50463 }, [](SpellInfo* spellInfo)
844 {
845 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_CASTER_PROCS;
846 });
847
848 // Blood Gorged
849 ApplySpellFix({ 61274, 61275, 61276, 61277,61278 }, [](SpellInfo* spellInfo)
850 {
851 // ARP affect Death Strike and Rune Strike
852 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x1400011, 0x20000000, 0x0);
853 });
854
855 // Death Grip
856 ApplySpellFix({ 49576, 49560 }, [](SpellInfo* spellInfo)
857 {
858 // remove main grip mechanic, leave only effect one
859 // should fix taunt on bosses and not break the pull protection at the same time (no aura provides immunity to grip mechanic)
860 spellInfo->Mechanic = 0;
861 });
862
863 // Death Grip Jump Dest
864 ApplySpellFix({ 57604 }, [](SpellInfo* spellInfo)
865 {
866 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
867 });
868
869 // Death Pact
870 ApplySpellFix({ 48743 }, [](SpellInfo* spellInfo)
871 {
872 spellInfo->AttributesEx &= ~SPELL_ATTR1_EXCLUDE_CASTER;
873 });
874
875 // Raise Ally (trigger)
876 ApplySpellFix({ 46619 }, [](SpellInfo* spellInfo)
877 {
878 spellInfo->Attributes &= ~SPELL_ATTR0_NO_AURA_CANCEL;
879 });
880
881 // Frost Strike
882 ApplySpellFix({ 49143, 51416, 51417, 51418, 51419, 55268 }, [](SpellInfo* spellInfo)
883 {
884 spellInfo->AttributesEx3 |= SPELL_ATTR3_COMPLETELY_BLOCKED;
885 });
886
887 // Death Knight T10 Tank 2p Bonus
888 ApplySpellFix({ 70650 }, [](SpellInfo* spellInfo)
889 {
890 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_PCT_MODIFIER;
891 });
892
893 ApplySpellFix({ 45297, 45284 }, [](SpellInfo* spellInfo)
894 {
895 spellInfo->CategoryRecoveryTime = 0;
896 spellInfo->RecoveryTime = 0;
897 spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_CASTER_DAMAGE_MODIFIERS;
898 });
899
900 // Improved Earth Shield
901 ApplySpellFix({ 51560, 51561 }, [](SpellInfo* spellInfo)
902 {
903 spellInfo->Effects[EFFECT_1].MiscValue = SPELLMOD_DAMAGE;
904 });
905
906 // Tidal Force
907 ApplySpellFix({ 55166, 55198 }, [](SpellInfo* spellInfo)
908 {
909 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(18);
910 spellInfo->ProcCharges = 0;
911 });
912
913 // Healing Stream Totem
914 ApplySpellFix({ 52042 }, [](SpellInfo* spellInfo)
915 {
916 spellInfo->SpellLevel = 0;
917 spellInfo->BaseLevel = 0;
918 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
919 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(5); // 40yd
920 });
921
922 // Earth Shield
923 ApplySpellFix({ 379 }, [](SpellInfo* spellInfo)
924 {
925 spellInfo->SpellLevel = 0;
926 spellInfo->BaseLevel = 0;
927 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
928 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
929 });
930
931 // Stormstrike
932 ApplySpellFix({ 17364 }, [](SpellInfo* spellInfo)
933 {
934 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
935 });
936
937 // Strength of Earth totem effect
938 ApplySpellFix({ 8076, 8162, 8163, 10441, 25362, 25527, 57621, 58646 }, [](SpellInfo* spellInfo)
939 {
940 spellInfo->Effects[EFFECT_1].RadiusEntry = spellInfo->Effects[EFFECT_0].RadiusEntry;
941 spellInfo->Effects[EFFECT_2].RadiusEntry = spellInfo->Effects[EFFECT_0].RadiusEntry;
942 });
943
944 // Flametongue Totem effect
945 ApplySpellFix({ 52109, 52110, 52111, 52112, 52113, 58651, 58654, 58655 }, [](SpellInfo* spellInfo)
946 {
947 spellInfo->Effects[EFFECT_2].TargetB = spellInfo->Effects[EFFECT_1].TargetB = spellInfo->Effects[EFFECT_0].TargetB = 0;
948 spellInfo->Effects[EFFECT_2].TargetA = spellInfo->Effects[EFFECT_1].TargetA = spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
949 });
950
951 // Sentry Totem
952 ApplySpellFix({ 6495 }, [](SpellInfo* spellInfo)
953 {
954 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(0);
955 });
956
957 // Bind Sight (PT)
958 ApplySpellFix({ 6277 }, [](SpellInfo* spellInfo)
959 {
960 // because it is passive, needs this to be properly removed at death in RemoveAllAurasOnDeath()
961 spellInfo->AttributesEx &= ~SPELL_ATTR1_IS_CHANNELED;
962 spellInfo->Attributes |= SPELL_ATTR0_PASSIVE;
963 spellInfo->AttributesEx7 |= SPELL_ATTR7_DISABLE_AURA_WHILE_DEAD;
964 });
965
966 // Ancestral Awakening Heal
967 ApplySpellFix({ 52752 }, [](SpellInfo* spellInfo)
968 {
969 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
970 });
971
972 // Heroism
973 ApplySpellFix({ 32182 }, [](SpellInfo* spellInfo)
974 {
975 spellInfo->ExcludeTargetAuraSpell = 57723; // Exhaustion
976 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
977 });
978
979 // Bloodlust
980 ApplySpellFix({ 2825 }, [](SpellInfo* spellInfo)
981 {
982 spellInfo->ExcludeTargetAuraSpell = 57724; // Sated
983 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
984 });
985
986 // Improved Succubus
987 ApplySpellFix({ 18754, 18755, 18756 }, [](SpellInfo* spellInfo)
988 {
989 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
990 });
991
992 // Unstable Affliction
993 ApplySpellFix({ 31117 }, [](SpellInfo* spellInfo)
994 {
995 spellInfo->PreventionType = SPELL_PREVENTION_TYPE_NONE;
996 });
997
998 // Shadowflame - trigger
1000 47960, // r1
1001 61291 // r2
1002 }, [](SpellInfo* spellInfo)
1003 {
1004 spellInfo->AttributesEx |= SPELL_ATTR1_NO_REDIRECTION;
1005 });
1006
1007 // Curse of Doom
1008 ApplySpellFix({ 18662 }, [](SpellInfo* spellInfo)
1009 {
1010 // summoned doomguard duration fix
1011 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(6);
1012 });
1013
1014 // Glyph of Voidwalker
1015 ApplySpellFix({ 56247 }, [](SpellInfo* spellInfo)
1016 {
1017 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
1018 spellInfo->Effects[EFFECT_0].MiscValue = SPELLMOD_EFFECT1;
1019 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x8000000, 0, 0);
1020 });
1021
1022 // Everlasting Affliction
1023 ApplySpellFix({ 47201, 47202, 47203, 47204, 47205 }, [](SpellInfo* spellInfo)
1024 {
1025 spellInfo->Effects[EFFECT_1].SpellClassMask[0] |= 2; // add corruption to affected spells
1026 });
1027
1028 // Death's Embrace
1029 ApplySpellFix({ 47198, 47199, 47200 }, [](SpellInfo* spellInfo)
1030 {
1031 spellInfo->Effects[EFFECT_1].SpellClassMask[0] |= 0x4000; // include Drain Soul
1032 });
1033
1034 // Improved Demonic Tactics
1035 ApplySpellFix({ 54347, 54348, 54349 }, [](SpellInfo* spellInfo)
1036 {
1037 spellInfo->Effects[EFFECT_1].Effect = spellInfo->Effects[EFFECT_0].Effect;
1038 spellInfo->Effects[EFFECT_1].ApplyAuraName = spellInfo->Effects[EFFECT_0].ApplyAuraName;
1039 spellInfo->Effects[EFFECT_1].TargetA = spellInfo->Effects[EFFECT_0].TargetA;
1040 spellInfo->Effects[EFFECT_0].MiscValue = SPELLMOD_EFFECT1;
1041 spellInfo->Effects[EFFECT_1].MiscValue = SPELLMOD_EFFECT2;
1042 });
1043
1044 // Rain of Fire (Doomguard)
1045 ApplySpellFix({ 42227 }, [](SpellInfo* spellInfo)
1046 {
1047 spellInfo->Speed = 0.0f;
1048 });
1049
1050 // Ritual Enslavement
1051 ApplySpellFix({ 22987 }, [](SpellInfo* spellInfo)
1052 {
1053 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_MOD_CHARM;
1054 });
1055
1056 // Combustion, make this passive
1057 ApplySpellFix({ 11129 }, [](SpellInfo* spellInfo)
1058 {
1059 spellInfo->Dispel = DISPEL_NONE;
1060 });
1061
1062 // Magic Absorption
1063 ApplySpellFix({ 29441, 29444 }, [](SpellInfo* spellInfo)
1064 {
1065 spellInfo->SpellLevel = 0;
1066 });
1067
1068 // Living Bomb
1069 ApplySpellFix({ 44461, 55361, 55362 }, [](SpellInfo* spellInfo)
1070 {
1071 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
1072 spellInfo->AttributesEx4 |= SPELL_ATTR4_REACTIVE_DAMAGE_PROC;
1073 });
1074
1075 // Evocation
1076 ApplySpellFix({ 12051 }, [](SpellInfo* spellInfo)
1077 {
1078 spellInfo->InterruptFlags |= SPELL_INTERRUPT_FLAG_INTERRUPT;
1079 });
1080
1081 // MI Fireblast, WE Frostbolt, MI Frostbolt
1082 ApplySpellFix({ 59637, 31707, 72898 }, [](SpellInfo* spellInfo)
1083 {
1084 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
1085 });
1086
1087 // Blazing Speed
1088 ApplySpellFix({ 31641, 31642 }, [](SpellInfo* spellInfo)
1089 {
1090 spellInfo->Effects[EFFECT_0].TriggerSpell = 31643;
1091 });
1092
1093 // Summon Water Elemental (permanent)
1094 ApplySpellFix({ 70908 }, [](SpellInfo* spellInfo)
1095 {
1096 // treat it as pet
1097 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_SUMMON_PET;
1098 });
1099
1100 // // Burnout, trigger
1101 ApplySpellFix({ 44450 }, [](SpellInfo* spellInfo)
1102 {
1103 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_POWER_BURN;
1104 });
1105
1106 // Mirror Image - Summon Spells
1107 ApplySpellFix({ 58831, 58833, 58834, 65047 }, [](SpellInfo* spellInfo)
1108 {
1109 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER);
1110 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(0);
1111 });
1112
1113 // Initialize Images (Mirror Image)
1114 ApplySpellFix({ 58836 }, [](SpellInfo* spellInfo)
1115 {
1116 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
1117 });
1118
1119 // Arcane Blast, can't be dispelled
1120 ApplySpellFix({ 36032 }, [](SpellInfo* spellInfo)
1121 {
1122 spellInfo->Attributes |= SPELL_ATTR0_NO_IMMUNITIES;
1123 });
1124
1125 // Chilled (frost armor, ice armor proc)
1126 ApplySpellFix({ 6136, 7321 }, [](SpellInfo* spellInfo)
1127 {
1128 spellInfo->PreventionType = SPELL_PREVENTION_TYPE_NONE;
1129 });
1130
1131 // Mirror Image Frostbolt
1132 ApplySpellFix({ 59638 }, [](SpellInfo* spellInfo)
1133 {
1134 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
1135 spellInfo->SpellFamilyName = SPELLFAMILY_MAGE;
1136 spellInfo->SpellFamilyFlags = flag96(0x20, 0x0, 0x0);
1137 });
1138
1139 // Fingers of Frost
1140 ApplySpellFix({ 44544 }, [](SpellInfo* spellInfo)
1141 {
1142 spellInfo->Dispel = DISPEL_NONE;
1143 spellInfo->AttributesEx4 |= SPELL_ATTR4_CANNOT_BE_STOLEN;
1144 spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(685904631, 1151040, 32);
1145 });
1146
1147 // Fingers of Frost visual buff
1148 ApplySpellFix({ 74396 }, [](SpellInfo* spellInfo)
1149 {
1150 spellInfo->ProcCharges = 2;
1151 spellInfo->StackAmount = 0;
1152 });
1153
1154 // Glyph of blocking
1155 ApplySpellFix({ 58375 }, [](SpellInfo* spellInfo)
1156 {
1157 spellInfo->Effects[EFFECT_0].TriggerSpell = 58374;
1158 });
1159
1160 // Sweeping Strikes stance change
1161 ApplySpellFix({ 12328 }, [](SpellInfo* spellInfo)
1162 {
1163 spellInfo->Attributes |= SPELL_ATTR0_NOT_SHAPESHIFTED;
1164 });
1165
1166 // Damage Shield
1167 ApplySpellFix({ 59653 }, [](SpellInfo* spellInfo)
1168 {
1169 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
1170 spellInfo->SpellLevel = 0;
1171 });
1172
1174 20230, // Retaliation
1175 871, // Shield Wall
1176 1719 // Recklessness
1177 }, [](SpellInfo* spellInfo)
1178 {
1179 // Strange shared cooldown
1180 spellInfo->AttributesEx6 |= SPELL_ATTR6_NO_CATEGORY_COOLDOWN_MODS;
1181 });
1182
1183 // Vigilance
1184 ApplySpellFix({ 50720 }, [](SpellInfo* spellInfo)
1185 {
1186 // fixes bug with empowered renew, single target aura
1187 spellInfo->SpellFamilyName = SPELLFAMILY_WARRIOR;
1188 });
1189
1190 // Sunder Armor - Old Ranks
1191 ApplySpellFix({ 7405, 8380, 11596, 11597, 25225, 47467 }, [](SpellInfo* spellInfo)
1192 {
1193 spellInfo->Effects[EFFECT_0].TriggerSpell = 11971;
1194 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE;
1195 });
1196
1197 // Improved Spell Reflection
1198 ApplySpellFix({ 59725 }, [](SpellInfo* spellInfo)
1199 {
1200 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER_AREA_PARTY);
1201 });
1202
1203 // Hymn of Hope
1204 ApplySpellFix({ 64904 }, [](SpellInfo* spellInfo)
1205 {
1206 // rewrite part of aura system or swap effects...
1207 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT;
1208 spellInfo->Effects[EFFECT_2].Effect = spellInfo->Effects[EFFECT_0].Effect;
1209 spellInfo->Effects[EFFECT_0].Effect = 0;
1210 spellInfo->Effects[EFFECT_2].DieSides = spellInfo->Effects[EFFECT_0].DieSides;
1211 spellInfo->Effects[EFFECT_2].TargetA = spellInfo->Effects[EFFECT_0].TargetB;
1212 spellInfo->Effects[EFFECT_2].RadiusEntry = spellInfo->Effects[EFFECT_0].RadiusEntry;
1213 spellInfo->Effects[EFFECT_2].BasePoints = spellInfo->Effects[EFFECT_0].BasePoints;
1214 });
1215
1216 // Divine Hymn
1217 ApplySpellFix({ 64844 }, [](SpellInfo* spellInfo)
1218 {
1219 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
1220 spellInfo->SpellLevel = 0;
1221 });
1222
1224 14898, // Spiritual Healing affects prayer of mending
1225 15349,
1226 15354,
1227 15355,
1228 15356,
1229 47562, // Divine Providence affects prayer of mending
1230 47564,
1231 47565,
1232 47566,
1233 47567,
1234 47586, // Twin Disciplines affects prayer of mending
1235 47587,
1236 47588,
1237 52802,
1238 52803
1239 }, [](SpellInfo* spellInfo)
1240 {
1241 spellInfo->Effects[EFFECT_0].SpellClassMask[1] |= 0x20; // prayer of mending
1242 });
1243
1244 // Power Infusion
1245 ApplySpellFix({ 10060 }, [](SpellInfo* spellInfo)
1246 {
1247 // hack to fix stacking with arcane power
1248 spellInfo->Effects[EFFECT_2].Effect = SPELL_EFFECT_APPLY_AURA;
1249 spellInfo->Effects[EFFECT_2].ApplyAuraName = SPELL_AURA_ADD_PCT_MODIFIER;
1250 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY);
1251 });
1252
1253 // Lifebloom final bloom
1254 ApplySpellFix({ 33778 }, [](SpellInfo* spellInfo)
1255 {
1256 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
1257 spellInfo->SpellLevel = 0;
1258 spellInfo->SpellFamilyFlags = flag96(0, 0x10, 0);
1259 });
1260
1261 // Owlkin Frenzy
1262 ApplySpellFix({ 48391 }, [](SpellInfo* spellInfo)
1263 {
1264 spellInfo->Attributes |= SPELL_ATTR0_NOT_SHAPESHIFTED;
1265 });
1266
1267 // Item T10 Restoration 4P Bonus
1268 ApplySpellFix({ 70691 }, [](SpellInfo* spellInfo)
1269 {
1270 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
1271 });
1272
1274 770, // Faerie Fire
1275 16857 // Faerie Fire (Feral)
1276 }, [](SpellInfo* spellInfo)
1277 {
1278 spellInfo->AttributesEx &= ~SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS;
1279 });
1280
1281 ApplySpellFix({ 49376 }, [](SpellInfo* spellInfo)
1282 {
1283 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // 3yd
1284 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
1285 });
1286
1287 // Feral Charge - Cat
1288 ApplySpellFix({ 61138, 61132, 50259 }, [](SpellInfo* spellInfo)
1289 {
1290 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
1291 });
1292
1293 // Glyph of Barkskin
1294 ApplySpellFix({ 63058 }, [](SpellInfo* spellInfo)
1295 {
1296 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE;
1297 });
1298
1299 // Resurrection Sickness
1300 ApplySpellFix({ 15007 }, [](SpellInfo* spellInfo)
1301 {
1302 spellInfo->SpellFamilyName = SPELLFAMILY_GENERIC;
1303 });
1304
1305 // Luck of the Draw
1306 ApplySpellFix({ 72221 }, [](SpellInfo* spellInfo)
1307 {
1308 spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CHANGE_MAP;
1309 });
1310
1311 // Bind
1312 ApplySpellFix({ 3286 }, [](SpellInfo* spellInfo)
1313 {
1314 spellInfo->Targets = 0; // neutral innkeepers not friendly?
1315 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
1316 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
1317 });
1318
1319 // Playback Speech
1320 ApplySpellFix({ 74209 }, [](SpellInfo* spellInfo)
1321 {
1322 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(1);
1323 });
1324
1326 2641, // Dismiss Pet
1327 23356 // Taming Lesson
1328 }, [](SpellInfo* spellInfo)
1329 {
1330 // remove creaturetargettype
1331 spellInfo->TargetCreatureType = 0;
1332 });
1333
1334 // Aspect of the Viper
1335 ApplySpellFix({ 34074 }, [](SpellInfo* spellInfo)
1336 {
1337 spellInfo->Effects[EFFECT_2].Effect = SPELL_EFFECT_APPLY_AURA;
1338 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(1);
1339 spellInfo->Effects[EFFECT_2].ApplyAuraName = SPELL_AURA_DUMMY;
1340 });
1341
1342 // Strength of Wrynn
1343 ApplySpellFix({ 60509 }, [](SpellInfo* spellInfo)
1344 {
1345 spellInfo->Effects[EFFECT_2].BasePoints = 1500;
1346 spellInfo->Effects[EFFECT_1].BasePoints = 150;
1347 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_PERIODIC_HEAL;
1348 });
1349
1350 // Winterfin First Responder
1351 ApplySpellFix({ 48739 }, [](SpellInfo* spellInfo)
1352 {
1353 spellInfo->Effects[EFFECT_0].BasePoints = 1;
1354 spellInfo->Effects[EFFECT_0].RealPointsPerLevel = 0;
1355 spellInfo->Effects[EFFECT_0].DieSides = 0;
1356 spellInfo->Effects[EFFECT_0].DamageMultiplier = 0;
1357 spellInfo->Effects[EFFECT_0].BonusMultiplier = 0;
1358 });
1359
1360 // Army of the Dead (trigger npc aura)
1361 ApplySpellFix({ 49099 }, [](SpellInfo* spellInfo)
1362 {
1363 spellInfo->Effects[EFFECT_0].Amplitude = 15000;
1364 });
1365
1366 // Frightening Shout
1367 ApplySpellFix({ 19134 }, [](SpellInfo* spellInfo)
1368 {
1369 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_DUMMY;
1370 });
1371
1372 // Isle of Conquest
1373 ApplySpellFix({ 66551 }, [](SpellInfo* spellInfo)
1374 {
1375 // Teleport in, missing range
1376 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd
1377 });
1378
1379 // A'dal's Song of Battle
1380 ApplySpellFix({ 39953 }, [](SpellInfo* spellInfo)
1381 {
1382 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
1383 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
1384 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
1385 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY);
1386 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY);
1387 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY);
1388 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(367); // 2 Hours
1389 });
1390
1392 57607, // WintergraspCatapult - Spell Plague Barrel - EffectRadiusIndex
1393 57619, // WintergraspDemolisher - Spell Hourl Boulder - EffectRadiusIndex
1394 57610 // Cannon (Siege Turret)
1395 }, [](SpellInfo* spellInfo)
1396 {
1397 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_25_YARDS); // SPELL_EFFECT_WMO_DAMAGE
1398 });
1399
1400 // WintergraspCannon - Spell Fire Cannon - EffectRadiusIndex
1401 ApplySpellFix({ 51422 }, [](SpellInfo* spellInfo)
1402 {
1403 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // SPELL_EFFECT_SCHOOL_DAMAGE
1404 });
1405
1406 // WintergraspDemolisher - Spell Ram - EffectRadiusIndex
1407 ApplySpellFix({ 54107 }, [](SpellInfo* spellInfo)
1408 {
1409 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // SPELL_EFFECT_KNOCK_BACK
1410 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // SPELL_EFFECT_SCHOOL_DAMAGE
1411 spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // SPELL_EFFECT_WEAPON_DAMAGE
1412 });
1413
1414 // WintergraspSiegeEngine - Spell Ram - EffectRadiusIndex
1415 ApplySpellFix({ 51678 }, [](SpellInfo* spellInfo)
1416 {
1417 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // SPELL_EFFECT_KNOCK_BACK
1418 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // SPELL_EFFECT_SCHOOL_DAMAGE
1419 spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS); // SPELL_EFFECT_WEAPON_DAMAGE
1420 });
1421
1422 // WintergraspCatapult - Spell Plague Barrell - Range
1423 ApplySpellFix({ 57606 }, [](SpellInfo* spellInfo)
1424 {
1425 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(164); // "Catapult Range"
1426 });
1427
1428 // Boulder (Demolisher)
1429 ApplySpellFix({ 50999 }, [](SpellInfo* spellInfo)
1430 {
1431 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd
1432 });
1433
1434 // Flame Breath (Catapult)
1435 ApplySpellFix({ 50990 }, [](SpellInfo* spellInfo)
1436 {
1437 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_18_YARDS); // 18yd
1438 });
1439
1440 // Jormungar Bite
1441 ApplySpellFix({ 56103 }, [](SpellInfo* spellInfo)
1442 {
1443 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
1444 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1445 });
1446
1447 // Throw Proximity Bomb
1448 ApplySpellFix({ 34095 }, [](SpellInfo* spellInfo)
1449 {
1450 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_TARGET_ENEMY);
1451 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1452 });
1453
1455 53348, // DEATH KNIGHT SCARLET FIRE ARROW
1456 53117 // BALISTA
1457 }, [](SpellInfo* spellInfo)
1458 {
1459 spellInfo->RecoveryTime = 5000;
1460 spellInfo->CategoryRecoveryTime = 5000;
1461 });
1462
1463 // Teleport To Molten Core
1464 ApplySpellFix({ 25139 }, [](SpellInfo* spellInfo)
1465 {
1466 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD;
1467 });
1468
1469 // Landen Stilwell Transform
1470 ApplySpellFix({ 31310 }, [](SpellInfo* spellInfo)
1471 {
1472 spellInfo->Attributes |= SPELL_ATTR0_PASSIVE;
1473 });
1474
1475 // Shadowstalker Stealth
1476 ApplySpellFix({ 5916 }, [](SpellInfo* spellInfo)
1477 {
1478 spellInfo->Effects[EFFECT_0].RealPointsPerLevel = 5.0f;
1479 });
1480
1481 // Sneak
1482 ApplySpellFix({ 22766 }, [](SpellInfo* spellInfo)
1483 {
1484 spellInfo->Effects[EFFECT_0].RealPointsPerLevel = 5.0f;
1485 });
1486
1487 // Murmur's Touch
1488 ApplySpellFix({ 38794, 33711 }, [](SpellInfo* spellInfo)
1489 {
1490 spellInfo->MaxAffectedTargets = 1;
1491 spellInfo->Effects[EFFECT_0].TriggerSpell = 33760;
1492 });
1493
1494 // Negaton Field
1496 36729, // Normal
1497 38834 // Heroic
1498 }, [](SpellInfo* spellInfo)
1499 {
1500 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
1501 });
1502
1503 // Curse of the Doomsayer NORMAL
1504 ApplySpellFix({ 36173 }, [](SpellInfo* spellInfo)
1505 {
1506 spellInfo->Effects[EFFECT_0].TriggerSpell = 36174; // Currently triggers heroic version...
1507 });
1508
1509 // Crystal Channel
1510 ApplySpellFix({ 34156 }, [](SpellInfo* spellInfo)
1511 {
1512 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(35); // 35yd;
1513 spellInfo->ChannelInterruptFlags |= AURA_INTERRUPT_FLAG_MOVE;
1514 });
1515
1516 // Debris
1517 ApplySpellFix({ 36449 }, [](SpellInfo* spellInfo)
1518 {
1519 spellInfo->Attributes |= SPELL_ATTR0_AURA_IS_DEBUFF;
1520 });
1521
1522 // Soul Channel
1523 ApplySpellFix({ 30531 }, [](SpellInfo* spellInfo)
1524 {
1525 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
1526 });
1527
1528 // Debris Visual
1529 ApplySpellFix({ 30632 }, [](SpellInfo* spellInfo)
1530 {
1531 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_DEST_DYNOBJ_ALLY);
1532 });
1533
1534 // Activate Sunblade Protecto
1535 ApplySpellFix({ 46475, 46476 }, [](SpellInfo* spellInfo)
1536 {
1537 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(14); // 60yd
1538 });
1539
1540 // Break Ice
1541 ApplySpellFix({ 46638 }, [](SpellInfo* spellInfo)
1542 {
1543 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_ONLY_ON_PLAYER; // Obvious fail, it targets gameobject...
1544 });
1545
1546 // Sinister Reflection Clone
1547 ApplySpellFix({ 45785 }, [](SpellInfo* spellInfo)
1548 {
1549 spellInfo->Speed = 0.0f;
1550 });
1551
1552 // Armageddon
1553 ApplySpellFix({ 45909 }, [](SpellInfo* spellInfo)
1554 {
1555 spellInfo->Speed = 8.0f;
1556 });
1557
1558 // Spell Absorption
1559 ApplySpellFix({ 41034 }, [](SpellInfo* spellInfo)
1560 {
1561 spellInfo->Effects[EFFECT_2].Effect = SPELL_EFFECT_APPLY_AURA;
1562 spellInfo->Effects[EFFECT_2].ApplyAuraName = SPELL_AURA_SCHOOL_ABSORB;
1563 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
1564 spellInfo->Effects[EFFECT_2].MiscValue = SPELL_SCHOOL_MASK_MAGIC;
1565 });
1566
1567 // Shared Bonds
1568 ApplySpellFix({ 41363 }, [](SpellInfo* spellInfo)
1569 {
1570 spellInfo->AttributesEx &= ~SPELL_ATTR1_IS_CHANNELED;
1571 });
1572
1574 41485, // Deadly Poison
1575 41487 // Envenom
1576 }, [](SpellInfo* spellInfo)
1577 {
1578 spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_PHASE_SHIFT;
1579 });
1580
1581 // Parasitic Shadowfiend
1582 ApplySpellFix({ 41914 }, [](SpellInfo* spellInfo)
1583 {
1584 spellInfo->Attributes |= SPELL_ATTR0_AURA_IS_DEBUFF;
1585 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
1586 });
1587
1588 // Teleport Maiev
1589 ApplySpellFix({ 41221 }, [](SpellInfo* spellInfo)
1590 {
1591 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 0-50000yd
1592 });
1593
1594 // Watery Grave Explosion
1595 ApplySpellFix({ 37852 }, [](SpellInfo* spellInfo)
1596 {
1597 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALLOW_WHILE_STUNNED;
1598 });
1599
1600 // Amplify Damage
1601 ApplySpellFix({ 39095 }, [](SpellInfo* spellInfo)
1602 {
1603 spellInfo->MaxAffectedTargets = 1;
1604 });
1605
1606 // Energy Feedback
1607 ApplySpellFix({ 44335 }, [](SpellInfo* spellInfo)
1608 {
1609 spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CHANGE_MAP;
1610 });
1611
1613 31984, // Finger of Death
1614 35354 // Hand of Death
1615 }, [](SpellInfo* spellInfo)
1616 {
1617 // Spell doesn't need to ignore invulnerabilities
1618 spellInfo->Attributes = SPELL_ATTR0_IS_ABILITY;
1619 });
1620
1621 // Finger of Death
1622 ApplySpellFix({ 32111 }, [](SpellInfo* spellInfo)
1623 {
1624 spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(0); // We only need the animation, no damage
1625 });
1626
1627 // Flame Breath, catapult spell
1628 ApplySpellFix({ 50989 }, [](SpellInfo* spellInfo)
1629 {
1630 spellInfo->Attributes &= ~SPELL_ATTR0_SCALES_WITH_CREATURE_LEVEL;
1631 });
1632
1633 // Koralon, Flaming Cinder
1634 ApplySpellFix({ 66690 }, [](SpellInfo* spellInfo)
1635 {
1636 // missing radius index
1637 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
1638 spellInfo->MaxAffectedTargets = 1;
1639 });
1640
1641 // Acid Volley
1642 ApplySpellFix({ 54714, 29325 }, [](SpellInfo* spellInfo)
1643 {
1644 spellInfo->MaxAffectedTargets = 1;
1645 });
1646
1647 // Summon Plagued Warrior
1648 ApplySpellFix({ 29237 }, [](SpellInfo* spellInfo)
1649 {
1650 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_DUMMY;
1651 spellInfo->Effects[EFFECT_1].Effect = spellInfo->Effects[EFFECT_2].Effect = 0;
1652 });
1653
1654 // Icebolt
1655 ApplySpellFix({ 28526 }, [](SpellInfo* spellInfo)
1656 {
1657 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
1658 });
1659
1660 // Infected Wound
1661 ApplySpellFix({ 29306 }, [](SpellInfo* spellInfo)
1662 {
1663 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
1664 });
1665
1666 // Hopeless
1667 ApplySpellFix({ 29125 }, [](SpellInfo* spellInfo)
1668 {
1669 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
1670 });
1671
1672 // Jagged Knife
1673 ApplySpellFix({ 55550 }, [](SpellInfo* spellInfo)
1674 {
1675 spellInfo->Attributes |= SPELL_ATTR0_USES_RANGED_SLOT;
1676 });
1677
1678 // Moorabi - Transformation
1679 ApplySpellFix({ 55098 }, [](SpellInfo* spellInfo)
1680 {
1681 spellInfo->InterruptFlags |= SPELL_INTERRUPT_FLAG_INTERRUPT;
1682 });
1683
1685 55521, // Poisoned Spear (Normal)
1686 58967, // Poisoned Spear (Heroic)
1687 55348, // Throw (Normal)
1688 58966 // Throw (Heroic)
1689 }, [](SpellInfo* spellInfo)
1690 {
1691 spellInfo->Attributes |= SPELL_ATTR0_USES_RANGED_SLOT;
1692 });
1693
1694 // Charged Chaotic rift aura, trigger
1695 ApplySpellFix({ 47737 }, [](SpellInfo* spellInfo)
1696 {
1697 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(37); // 50yd
1698 });
1699
1700 // Vanish
1701 ApplySpellFix({ 55964 }, [](SpellInfo* spellInfo)
1702 {
1703 spellInfo->Effects[EFFECT_1].Effect = 0;
1704 spellInfo->Effects[EFFECT_2].Effect = 0;
1705 });
1706
1707 // Trollgore - Summon Drakkari Invader
1708 ApplySpellFix({ 49456, 49457, 49458 }, [](SpellInfo* spellInfo)
1709 {
1710 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB);
1711 });
1712
1714 48278, // Paralyse
1715 47669 // Awaken subboss
1716 }, [](SpellInfo* spellInfo)
1717 {
1718 spellInfo->Effects[0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
1719 spellInfo->Effects[0].TargetB = SpellImplicitTargetInfo();
1720 });
1721
1722 // Flame Breath
1723 ApplySpellFix({ 47592 }, [](SpellInfo* spellInfo)
1724 {
1725 spellInfo->Effects[EFFECT_0].Amplitude = 200;
1726 });
1727
1728 // Skarvald, Charge
1729 ApplySpellFix({ 43651 }, [](SpellInfo* spellInfo)
1730 {
1731 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 0-50000yd
1732 });
1733
1734 // Ingvar the Plunderer, Woe Strike
1735 ApplySpellFix({ 42730 }, [](SpellInfo* spellInfo)
1736 {
1737 spellInfo->Effects[EFFECT_1].TriggerSpell = 42739;
1738 });
1739
1740 ApplySpellFix({ 59735 }, [](SpellInfo* spellInfo)
1741 {
1742 spellInfo->Effects[EFFECT_1].TriggerSpell = 59736;
1743 });
1744
1745 // Ingvar the Plunderer, Ingvar transform
1746 ApplySpellFix({ 42796 }, [](SpellInfo* spellInfo)
1747 {
1748 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD;
1749 });
1750
1752 42772, // Hurl Dagger (Normal)
1753 59685 // Hurl Dagger (Heroic)
1754 }, [](SpellInfo* spellInfo)
1755 {
1756 spellInfo->Attributes |= SPELL_ATTR0_USES_RANGED_SLOT;
1757 });
1758
1759 // Control Crystal Activation
1760 ApplySpellFix({ 57804 }, [](SpellInfo* spellInfo)
1761 {
1762 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(1);
1763 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1764 });
1765
1766 // Destroy Door Seal
1767 ApplySpellFix({ 58040 }, [](SpellInfo* spellInfo)
1768 {
1769 spellInfo->ChannelInterruptFlags &= ~(AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE);
1770 });
1771
1772 // Ichoron, Water Blast
1773 ApplySpellFix({ 54237, 59520 }, [](SpellInfo* spellInfo)
1774 {
1775 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
1776 });
1777
1778 // Krik'thir - Mind Flay
1779 ApplySpellFix({ 52586, 59367 }, [](SpellInfo* spellInfo)
1780 {
1781 spellInfo->ChannelInterruptFlags |= AURA_INTERRUPT_FLAG_MOVE;
1782 });
1783
1784 // Glare of the Tribunal
1785 ApplySpellFix({ 50988, 59870 }, [](SpellInfo* spellInfo)
1786 {
1787 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
1788 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1789 });
1790
1791 // Static Charge
1792 ApplySpellFix({ 50835, 59847 }, [](SpellInfo* spellInfo)
1793 {
1794 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY);
1795 });
1796
1797 // Lava Strike damage
1798 ApplySpellFix({ 57697 }, [](SpellInfo* spellInfo)
1799 {
1800 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
1801 });
1802
1803 // Lava Strike trigger
1804 ApplySpellFix({ 57578 }, [](SpellInfo* spellInfo)
1805 {
1806 spellInfo->MaxAffectedTargets = 1;
1807 });
1808
1809 // Gift of Twilight Shadow/Fire
1810 ApplySpellFix({ 57835, 58766 }, [](SpellInfo* spellInfo)
1811 {
1812 spellInfo->AttributesEx &= ~SPELL_ATTR1_IS_CHANNELED;
1813 });
1814
1815 // Pyrobuffet
1816 ApplySpellFix({ 57557 }, [](SpellInfo* spellInfo)
1817 {
1818 spellInfo->ExcludeTargetAuraSpell = 56911;
1819 });
1820
1821 // Arcane Barrage
1822 ApplySpellFix({ 56397 }, [](SpellInfo* spellInfo)
1823 {
1824 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
1825 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1826 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
1827 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo();
1828 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
1829 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo();
1830 });
1831
1833 55849, // Power Spark (ground +50% dmg aura)
1834 56438, // Arcane Overload (-50% dmg taken) - this is to prevent apply -> unapply -> apply ... dunno whether it's correct
1835 }, [](SpellInfo* spellInfo)
1836 {
1837 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
1838 });
1839
1840 // Vortex (Control Vehicle)
1841 ApplySpellFix({ 56263 }, [](SpellInfo* spellInfo)
1842 {
1843 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
1844 });
1845
1846 // Haste (Nexus Lord, increase run Speed of the disk)
1847 ApplySpellFix({ 57060 }, [](SpellInfo* spellInfo)
1848 {
1849 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_VEHICLE);
1850 });
1851
1852 // Arcane Overload
1853 ApplySpellFix({ 56430 }, [](SpellInfo* spellInfo)
1854 {
1855 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
1856 spellInfo->Effects[EFFECT_0].TriggerSpell = 56429;
1857 });
1858
1859 // Summon Arcane Bomb
1860 ApplySpellFix({ 56429 }, [](SpellInfo* spellInfo)
1861 {
1862 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
1863 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1864 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo();
1865 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo();
1866 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo();
1867 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo();
1868 });
1869
1870 // Destroy Platform Event
1871 ApplySpellFix({ 59099 }, [](SpellInfo* spellInfo)
1872 {
1873 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(22);
1874 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(15);
1875 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(22);
1876 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo(15);
1877 });
1878
1879 // Surge of Power (Phase 3)
1881 57407, // N
1882 }, [](SpellInfo* spellInfo)
1883 {
1884 spellInfo->MaxAffectedTargets = 1;
1885 spellInfo->InterruptFlags = 0;
1886 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS);
1887 spellInfo->AttributesEx4 |= SPELL_ATTR4_ALLOW_CAST_WHILE_CASTING;
1888 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
1889 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY);
1890 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
1891 });
1892
1893 // Surge of Power (Phase 3)
1895 60936 // H
1896 }, [](SpellInfo* spellInfo)
1897 {
1898 spellInfo->MaxAffectedTargets = 3;
1899 spellInfo->InterruptFlags = 0;
1900 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS);
1901 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
1902 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY);
1903 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
1904 });
1905
1906 // Wyrmrest Drake - Life Burst
1907 ApplySpellFix({ 57143 }, [](SpellInfo* spellInfo)
1908 {
1909 spellInfo->Effects[EFFECT_0].Effect = 0;
1910 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo();
1911 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1912 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
1913 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY);
1914 spellInfo->Effects[EFFECT_1].PointsPerComboPoint = 2500;
1915 spellInfo->Effects[EFFECT_1].BasePoints = 2499;
1916 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(1);
1917 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
1918 });
1919
1920 //Alexstrasza - Gift
1921 ApplySpellFix({ 61028 }, [](SpellInfo* spellInfo)
1922 {
1923 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
1924 });
1925
1926 // Vortex (freeze anim)
1927 ApplySpellFix({ 55883 }, [](SpellInfo* spellInfo)
1928 {
1929 spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CHANGE_MAP;
1930 });
1931
1932 // Hurl Pyrite
1933 ApplySpellFix({ 62490 }, [](SpellInfo* spellInfo)
1934 {
1935 spellInfo->Effects[EFFECT_1].Effect = 0;
1936 });
1937
1938 // Ulduar, Mimiron, Magnetic Core (summon)
1939 ApplySpellFix({ 64444 }, [](SpellInfo* spellInfo)
1940 {
1941 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER);
1942 });
1943
1944 // Ulduar, Mimiron, bomb bot explosion
1945 ApplySpellFix({ 63801 }, [](SpellInfo* spellInfo)
1946 {
1947 spellInfo->Effects[EFFECT_1].MiscValue = 17286;
1948 });
1949
1950 // Ulduar, Mimiron, Summon Flames Initial
1951 ApplySpellFix({ 64563 }, [](SpellInfo* spellInfo)
1952 {
1953 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
1954 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
1955 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
1956 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
1957 });
1958
1959 // Ulduar, Mimiron, Flames (damage)
1960 ApplySpellFix({ 64566 }, [](SpellInfo* spellInfo)
1961 {
1962 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
1963 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_NO_CAST_LOG;
1964 });
1965
1966 // Ulduar, Hodir, Starlight
1967 ApplySpellFix({ 62807 }, [](SpellInfo* spellInfo)
1968 {
1969 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_1_YARD); // 1yd
1970 });
1971
1972 // Hodir Shatter Cache
1973 ApplySpellFix({ 62502 }, [](SpellInfo* spellInfo)
1974 {
1975 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
1976 });
1977
1978 // Ulduar, General Vezax, Mark of the Faceless
1979 ApplySpellFix({ 63278 }, [](SpellInfo* spellInfo)
1980 {
1981 spellInfo->Effects[EFFECT_0].Effect = 0;
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->AttributesEx3 |= SPELL_ATTR3_ONLY_ON_PLAYER;
2042 spellInfo->AttributesEx |= SPELL_ATTR1_IMMUNITY_PURGES_EFFECT;
2043 });
2044
2045 // Lightning Orb Charged
2046 ApplySpellFix({ 62186 }, [](SpellInfo* spellInfo)
2047 {
2048 spellInfo->Effects[EFFECT_0].Amplitude = 5000; // Duration 5 secs, amplitude 8 secs...
2049 });
2050
2051 // Lightning Pillar
2052 ApplySpellFix({ 62976 }, [](SpellInfo* spellInfo)
2053 {
2054 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6);
2055 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(28); // 5 seconds, wrong DBC data?
2056 });
2057
2058 // Sif's Blizzard
2059 ApplySpellFix({ 62576, 62602 }, [](SpellInfo* spellInfo)
2060 {
2061 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_8_YARDS); // 8yd
2062 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_8_YARDS); // 8yd
2063 });
2064
2065 // Protective Gaze
2066 ApplySpellFix({ 64175 }, [](SpellInfo* spellInfo)
2067 {
2068 spellInfo->RecoveryTime = 25000;
2069 });
2070
2071 // Shadow Beacon
2072 ApplySpellFix({ 64465 }, [](SpellInfo* spellInfo)
2073 {
2074 spellInfo->Effects[EFFECT_0].TriggerSpell = 64467; // why do they need two script effects :/ (this one has visual effect)
2075 });
2076
2077 // Sanity
2078 ApplySpellFix({ 63050 }, [](SpellInfo* spellInfo)
2079 {
2080 spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_PHASE_SHIFT;
2081 });
2082
2083 // Shadow Nova
2084 ApplySpellFix({ 62714, 65209 }, [](SpellInfo* spellInfo)
2085 {
2086 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
2087 });
2088
2089 // Cosmic Smash (Algalon the Observer)
2090 ApplySpellFix({ 62293 }, [](SpellInfo* spellInfo)
2091 {
2092 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_DEST_CASTER);
2093 });
2094
2095 // Cosmic Smash (Algalon the Observer)
2096 ApplySpellFix({ 62311, 64596 }, [](SpellInfo* spellInfo)
2097 {
2098 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
2099 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
2100 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd
2101 });
2102
2103 // Constellation Phase Effect
2104 ApplySpellFix({ 65509 }, [](SpellInfo* spellInfo)
2105 {
2106 spellInfo->MaxAffectedTargets = 1;
2107 });
2108
2109 // Black Hole
2110 ApplySpellFix({ 62168, 65250, 62169 }, [](SpellInfo* spellInfo)
2111 {
2112 spellInfo->Attributes |= SPELL_ATTR0_AURA_IS_DEBUFF;
2113 });
2114
2115 // Ground Slam
2116 ApplySpellFix({ 62625 }, [](SpellInfo* spellInfo)
2117 {
2118 spellInfo->InterruptFlags |= SPELL_INTERRUPT_FLAG_INTERRUPT;
2119 });
2120
2121 // Onyxia's Lair, Onyxia, Flame Breath (TriggerSpell = 0 and spamming errors in console)
2122 ApplySpellFix({ 18435 }, [](SpellInfo* spellInfo)
2123 {
2124 spellInfo->Effects[EFFECT_1].Effect = 0;
2125 });
2126
2127 // Onyxia's Lair, Onyxia, Create Onyxia Spawner
2128 ApplySpellFix({ 17647 }, [](SpellInfo* spellInfo)
2129 {
2130 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(37);
2131 });
2132
2134 17646, // Onyxia's Lair, Onyxia, Summon Onyxia Whelp
2135 68968 // Onyxia's Lair, Onyxia, Summon Lair Guard
2136 }, [](SpellInfo* spellInfo)
2137 {
2138 spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
2139 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
2140 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd
2141 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(5);
2142 });
2143
2144 // Onyxia's Lair, Onyxia, Eruption
2145 ApplySpellFix({ 17731, 69294 }, [](SpellInfo* spellInfo)
2146 {
2147 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_DUMMY;
2148 spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(3);
2149 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_18_YARDS); // 18yd instead of 13yd to make sure all cracks erupt
2150 });
2151
2152 // Onyxia's Lair, Onyxia, Breath
2154 18576, 18578, 18579, 18580, 18581, 18582, 18583, 18609, 18611, 18612, 18613, 18614, 18615, 18616, 18584,
2155 18585, 18586, 18587, 18588, 18589, 18590, 18591, 18592, 18593, 18594, 18595, 18564, 18565, 18566, 18567,
2156 18568, 18569, 18570, 18571, 18572, 18573, 18574, 18575, 18596, 18597, 18598, 18599, 18600, 18601, 18602,
2157 18603, 18604, 18605, 18606, 18607, 18617, 18619, 18620, 18621, 18622, 18623, 18624, 18625, 18626, 18627,
2158 18628, 18618, 18351, 18352, 18353, 18354, 18355, 18356, 18357, 18358, 18359, 18360, 18361, 17086, 17087,
2159 17088, 17089, 17090, 17091, 17092, 17093, 17094, 17095, 17097, 22267, 22268, 21132, 21133, 21135, 21136,
2160 21137, 21138, 21139
2161 }, [](SpellInfo* spellInfo)
2162 {
2163 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(328); // 250ms
2164 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(1);
2165 if (spellInfo->Effects[EFFECT_1].Effect)
2166 {
2167 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
2168 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_PERIODIC_TRIGGER_SPELL;
2169 spellInfo->Effects[EFFECT_1].Amplitude = ((spellInfo->CastTimeEntry == sSpellCastTimesStore.LookupEntry(170)) ? 50 : 215);
2170 }
2171 });
2172
2174 48760, // Oculus, Teleport to Coldarra DND
2175 49305 // Oculus, Teleport to Boss 1 DND
2176 }, [](SpellInfo* spellInfo)
2177 {
2178 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(25);
2179 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(17);
2180 });
2181
2182 // Oculus, Drake spell Stop Time
2183 ApplySpellFix({ 49838 }, [](SpellInfo* spellInfo)
2184 {
2185 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
2186 spellInfo->ExcludeTargetAuraSpell = 51162; // exclude planar shift
2187 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_150_YARDS);
2188 });
2189
2190 // Oculus, Varos Cloudstrider, Energize Cores
2191 ApplySpellFix({ 61407, 62136, 56251, 54069 }, [](SpellInfo* spellInfo)
2192 {
2193 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CONE_ENTRY);
2194 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2195 });
2196
2197 // Halls of Lightning, Arc Weld
2198 ApplySpellFix({ 59086 }, [](SpellInfo* spellInfo)
2199 {
2200 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(1);
2201 });
2202
2203 // Halls of Lightning, Arcing Burn
2204 ApplySpellFix({ 52671, 59834 }, [](SpellInfo* spellInfo)
2205 {
2206 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
2207 });
2208
2209 // Trial of the Champion, Death's Respite
2210 ApplySpellFix({ 68306 }, [](SpellInfo* spellInfo)
2211 {
2212 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(25);
2213 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(25);
2214 });
2215
2216 // Trial of the Champion, Eadric Achievement (The Faceroller)
2217 ApplySpellFix({ 68197 }, [](SpellInfo* spellInfo)
2218 {
2219 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY);
2220 spellInfo->Attributes |= SPELL_ATTR0_ALLOW_CAST_WHILE_DEAD;
2221 });
2222
2223 // Trial of the Champion, Earth Shield
2224 ApplySpellFix({ 67530 }, [](SpellInfo* spellInfo)
2225 {
2226 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_PROC_TRIGGER_SPELL; // will trigger 67537
2227 });
2228
2229 // Trial of the Champion, Hammer of the Righteous
2230 ApplySpellFix({ 66867 }, [](SpellInfo* spellInfo)
2231 {
2232 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_DUMMY;
2233 });
2234
2235 // Trial of the Champion, Summon Risen Jaeren/Arelas
2236 ApplySpellFix({ 67705, 67715 }, [](SpellInfo* spellInfo)
2237 {
2238 spellInfo->AttributesEx2 |= SPELL_ATTR2_ALLOW_DEAD_TARGET;
2239 });
2240
2241 // Trial of the Champion, Ghoul Explode
2242 ApplySpellFix({ 67751 }, [](SpellInfo* spellInfo)
2243 {
2244 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
2245 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
2246 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS);
2247 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
2248 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
2249 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS);
2250 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
2251 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
2252 spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS);
2253 });
2254
2255 // Trial of the Champion, Desecration
2256 ApplySpellFix({ 67778, 67877 }, [](SpellInfo* spellInfo)
2257 {
2258 spellInfo->Effects[EFFECT_0].TriggerSpell = 68766;
2259 });
2260
2261 // Killing Spree (Off hand damage)
2262 ApplySpellFix({ 57842 }, [](SpellInfo* spellInfo)
2263 {
2264 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(2); // Melee Range
2265 });
2266
2267 // Trial of the Crusader, Jaraxxus Intro spell
2268 ApplySpellFix({ 67888 }, [](SpellInfo* spellInfo)
2269 {
2270 spellInfo->Attributes |= SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT;
2271 spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT;
2272 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
2273 });
2274
2275 // Trial of the Crusader, Lich King Intro spell
2276 ApplySpellFix({ 68193 }, [](SpellInfo* spellInfo)
2277 {
2278 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY);
2279 });
2280
2281 // Trial of the Crusader, Gormok, player vehicle spell, CUSTOM! (default jump to hand, not used)
2282 ApplySpellFix({ 66342 }, [](SpellInfo* spellInfo)
2283 {
2284 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AURA;
2285 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_SET_VEHICLE_ID;
2286 spellInfo->Effects[EFFECT_0].MiscValue = 496;
2287 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21);
2288 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13);
2289 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(25);
2290 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2291 spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_CHANGE_MAP;
2292 });
2293
2294 // Trial of the Crusader, Gormok, Fire Bomb
2295 ApplySpellFix({ 66313 }, [](SpellInfo* spellInfo)
2296 {
2297 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2298 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_DEST_TARGET_ANY);
2299 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2300 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_DEST_TARGET_ANY);
2301 spellInfo->Effects[EFFECT_1].Effect = 0;
2302 });
2303
2304 ApplySpellFix({ 66317 }, [](SpellInfo* spellInfo)
2305 {
2306 spellInfo->Attributes |= SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT;
2307 spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT;
2308 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
2309 });
2310
2311 ApplySpellFix({ 66318 }, [](SpellInfo* spellInfo)
2312 {
2313 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2314 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2315 spellInfo->Speed = 14.0f;
2316 spellInfo->Attributes |= SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT;
2317 spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT;
2318 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
2319 });
2320
2321 ApplySpellFix({ 66320, 67472, 67473, 67475 }, [](SpellInfo* spellInfo)
2322 {
2323 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_2_YARDS);
2324 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_2_YARDS);
2325 });
2326
2327 // Trial of the Crusader, Acidmaw & Dreadscale, Emerge
2328 ApplySpellFix({ 66947 }, [](SpellInfo* spellInfo)
2329 {
2330 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALLOW_WHILE_STUNNED;
2331 });
2332
2333 // Trial of the Crusader, Jaraxxus, Curse of the Nether
2334 ApplySpellFix({ 66211 }, [](SpellInfo* spellInfo)
2335 {
2336 spellInfo->ExcludeTargetAuraSpell = 66209; // exclude Touch of Jaraxxus
2337 });
2338
2339 // Trial of the Crusader, Jaraxxus, Summon Volcano
2340 ApplySpellFix({ 66258, 67901 }, [](SpellInfo* spellInfo)
2341 {
2342 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(85); // summon for 18 seconds, 15 not enough
2343 });
2344
2345 // Trial of the Crusader, Jaraxxus, Spinning Pain Spike
2346 ApplySpellFix({ 66281 }, [](SpellInfo* spellInfo)
2347 {
2348 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_4_YARDS);
2349 });
2350
2351 ApplySpellFix({ 66287 }, [](SpellInfo* spellInfo)
2352 {
2353 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
2354 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_TAUNT;
2355 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_NEARBY_ENTRY);
2356 spellInfo->Effects[EFFECT_2].Effect = SPELL_EFFECT_APPLY_AURA;
2357 spellInfo->Effects[EFFECT_2].ApplyAuraName = SPELL_AURA_MOD_STUN;
2358 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
2359 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(35); // 4 secs
2360 });
2361
2362 // Trial of the Crusader, Jaraxxus, Fel Fireball
2363 ApplySpellFix({ 66532, 66963, 66964, 66965 }, [](SpellInfo* spellInfo)
2364 {
2365 spellInfo->InterruptFlags |= SPELL_INTERRUPT_FLAG_INTERRUPT;
2366 });
2367
2368 // tempfix, make Nether Power not stealable
2369 ApplySpellFix({ 66228, 67106, 67107, 67108 }, [](SpellInfo* spellInfo)
2370 {
2371 spellInfo->AttributesEx4 |= SPELL_ATTR4_CANNOT_BE_STOLEN;
2372 });
2373
2374 // Trial of the Crusader, Faction Champions, Druid - Tranquality
2375 ApplySpellFix({ 66086, 67974, 67975, 67976 }, [](SpellInfo* spellInfo)
2376 {
2377 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AREA_AURA_FRIEND;
2378 });
2379
2380 // Trial of the Crusader, Faction Champions, Shaman - Earth Shield
2381 ApplySpellFix({ 66063 }, [](SpellInfo* spellInfo)
2382 {
2383 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_PROC_TRIGGER_SPELL;
2384 spellInfo->Effects[EFFECT_0].TriggerSpell = 66064;
2385 });
2386
2387 // Trial of the Crusader, Faction Champions, Priest - Mana Burn
2388 ApplySpellFix({ 66100 }, [](SpellInfo* spellInfo)
2389 {
2390 spellInfo->Effects[EFFECT_0].BasePoints = 5;
2391 spellInfo->Effects[EFFECT_0].DieSides = 0;
2392 });
2393
2394 ApplySpellFix({ 68026 }, [](SpellInfo* spellInfo)
2395 {
2396 spellInfo->Effects[EFFECT_0].BasePoints = 8;
2397 spellInfo->Effects[EFFECT_0].DieSides = 0;
2398 });
2399
2400 ApplySpellFix({ 68027 }, [](SpellInfo* spellInfo)
2401 {
2402 spellInfo->Effects[EFFECT_0].BasePoints = 6;
2403 spellInfo->Effects[EFFECT_0].DieSides = 0;
2404 });
2405
2406 ApplySpellFix({ 68028 }, [](SpellInfo* spellInfo)
2407 {
2408 spellInfo->Effects[EFFECT_0].BasePoints = 10;
2409 spellInfo->Effects[EFFECT_0].DieSides = 0;
2410 });
2411
2412 // Trial of the Crusader, Twin Valkyr, Touch of Light/Darkness, Light/Dark Surge
2414 65950 // light 0
2415 }, [](SpellInfo* spellInfo)
2416 {
2417 //spellInfo->EffectApplyAuraName[0] = SPELL_AURA_PERIODIC_DUMMY;
2418 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2419 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2420 spellInfo->Effects[EFFECT_1].Effect = 0;
2421 spellInfo->Effects[EFFECT_2].Effect = 0;
2422 });
2423
2425 65767 // light surge 0
2426 }, [](SpellInfo* spellInfo)
2427 {
2428 spellInfo->ExcludeTargetAuraSpell = 65686;
2429 });
2430
2432 67296 // light 1
2433 }, [](SpellInfo* spellInfo)
2434 {
2435 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2436 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2437 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2438 spellInfo->Effects[EFFECT_1].Effect = 0;
2439 spellInfo->Effects[EFFECT_2].Effect = 0;
2440 });
2441
2443 67274 // light surge 1
2444 }, [](SpellInfo* spellInfo)
2445 {
2446 spellInfo->ExcludeTargetAuraSpell = 67222;
2447 });
2448
2450 67297 // light 2
2451 }, [](SpellInfo* spellInfo)
2452 {
2453 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2454 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2455 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2456 spellInfo->Effects[EFFECT_1].Effect = 0;
2457 spellInfo->Effects[EFFECT_2].Effect = 0;
2458 });
2459
2461 67275 // light surge 2
2462 }, [](SpellInfo* spellInfo)
2463 {
2464 spellInfo->ExcludeTargetAuraSpell = 67223;
2465 });
2466
2468 67298 // light 3
2469 }, [](SpellInfo* spellInfo)
2470 {
2471 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2472 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2473 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2474 spellInfo->Effects[EFFECT_1].Effect = 0;
2475 spellInfo->Effects[EFFECT_2].Effect = 0;
2476 });
2477
2479 67276 // light surge 3
2480 }, [](SpellInfo* spellInfo)
2481 {
2482 spellInfo->ExcludeTargetAuraSpell = 67224;
2483 });
2484
2486 66001 // dark 0
2487 }, [](SpellInfo* spellInfo)
2488 {
2489 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2490 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2491 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2492 spellInfo->Effects[EFFECT_1].Effect = 0;
2493 spellInfo->Effects[EFFECT_2].Effect = 0;
2494 });
2495
2497 65769 // dark surge 0
2498 }, [](SpellInfo* spellInfo)
2499 {
2500 spellInfo->ExcludeTargetAuraSpell = 65684;
2501 });
2502
2504 67281 // dark 1
2505 }, [](SpellInfo* spellInfo)
2506 {
2507 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2508 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2509 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2510 spellInfo->Effects[EFFECT_1].Effect = 0;
2511 spellInfo->Effects[EFFECT_2].Effect = 0;
2512 });
2513
2515 67265 // dark surge 1
2516 }, [](SpellInfo* spellInfo)
2517 {
2518 spellInfo->ExcludeTargetAuraSpell = 67176;
2519 });
2520
2522 67282 // dark 2
2523 }, [](SpellInfo* spellInfo)
2524 {
2525 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2526 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2527 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2528 spellInfo->Effects[EFFECT_1].Effect = 0;
2529 spellInfo->Effects[EFFECT_2].Effect = 0;
2530 });
2531
2533 67266 // dark surge 2
2534 }, [](SpellInfo* spellInfo)
2535 {
2536 spellInfo->ExcludeTargetAuraSpell = 67177;
2537 });
2538
2540 67283 // dark 3
2541 }, [](SpellInfo* spellInfo)
2542 {
2543 //spellInfo->Effects[EFFECT_0].ApplyAuraNames = SPELL_AURA_PERIODIC_DUMMY;
2544 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2545 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2546 spellInfo->Effects[EFFECT_1].Effect = 0;
2547 spellInfo->Effects[EFFECT_2].Effect = 0;
2548 });
2549
2551 67267 // dark surge 3
2552 }, [](SpellInfo* spellInfo)
2553 {
2554 spellInfo->ExcludeTargetAuraSpell = 67178;
2555 });
2556
2557 // Trial of the Crusader, Twin Valkyr, Twin's Pact
2558 ApplySpellFix({ 65875, 67303, 67304, 67305, 65876, 67306, 67307, 67308 }, [](SpellInfo* spellInfo)
2559 {
2560 spellInfo->Effects[EFFECT_1].Effect = 0;
2561 spellInfo->Effects[EFFECT_2].Effect = 0;
2562 });
2563
2564 // Trial of the Crusader, Anub'arak, Emerge
2565 ApplySpellFix({ 65982 }, [](SpellInfo* spellInfo)
2566 {
2567 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALLOW_WHILE_STUNNED;
2568 });
2569
2570 // Trial of the Crusader, Anub'arak, Penetrating Cold
2571 ApplySpellFix({ 66013, 67700, 68509, 68510 }, [](SpellInfo* spellInfo)
2572 {
2573 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
2574 });
2575
2576 // Trial of the Crusader, Anub'arak, Shadow Strike
2577 ApplySpellFix({ 66134 }, [](SpellInfo* spellInfo)
2578 {
2579 spellInfo->InterruptFlags |= SPELL_INTERRUPT_FLAG_INTERRUPT;
2580 spellInfo->Effects[EFFECT_0].Effect = 0;
2581 });
2582
2583 // Trial of the Crusader, Anub'arak, Pursuing Spikes
2584 ApplySpellFix({ 65920, 65922, 65923 }, [](SpellInfo* spellInfo)
2585 {
2586 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_PERIODIC_DUMMY;
2587 //spellInfo->EffectTriggerSpell[0] = 0;
2588 });
2589
2590 // Trial of the Crusader, Anub'arak, Summon Scarab
2591 ApplySpellFix({ 66339 }, [](SpellInfo* spellInfo)
2592 {
2593 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(35);
2594 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(25);
2595 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2596 });
2597
2598 // Trial of the Crusader, Anub'arak, Achievements: The Traitor King
2600 68186, // Anub'arak Scarab Achievement 10
2601 68515 // Anub'arak Scarab Achievement 25
2602 }, [](SpellInfo* spellInfo)
2603 {
2604 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
2605 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY);
2606 spellInfo->Attributes |= SPELL_ATTR0_ALLOW_CAST_WHILE_DEAD;
2607 });
2608
2609 // Trial of the Crusader, Anub'arak, Spider Frenzy
2610 ApplySpellFix({ 66129 }, [](SpellInfo* spellInfo)
2611 {
2612 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
2613 });
2614
2615 // Soul Sickness
2616 ApplySpellFix({ 69131 }, [](SpellInfo* spellInfo)
2617 {
2618 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_PERIODIC_TRIGGER_SPELL;
2619 spellInfo->Effects[EFFECT_0].Amplitude = 8000;
2620 spellInfo->Effects[EFFECT_0].TriggerSpell = 69133;
2621 });
2622
2623 // Phantom Blast
2624 ApplySpellFix({ 68982, 70322 }, [](SpellInfo* spellInfo)
2625 {
2626 spellInfo->InterruptFlags |= SPELL_INTERRUPT_FLAG_INTERRUPT;
2627 });
2628
2629 // Empowered Blizzard
2630 ApplySpellFix({ 70131 }, [](SpellInfo* spellInfo)
2631 {
2632 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
2633 });
2634
2635 // Ice Lance Volley
2636 ApplySpellFix({ 70464 }, [](SpellInfo* spellInfo)
2637 {
2638 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
2639 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
2640 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_70_YARDS);
2641 });
2642
2644 70513, // Multi-Shot
2645 59514 // Shriek of the Highborne
2646 }, [](SpellInfo* spellInfo)
2647 {
2648 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CONE_ENTRY);
2649 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2650 });
2651
2652 // Icicle
2653 ApplySpellFix({ 69428, 69426 }, [](SpellInfo* spellInfo)
2654 {
2655 spellInfo->InterruptFlags = 0;
2656 spellInfo->AuraInterruptFlags = 0;
2657 spellInfo->ChannelInterruptFlags = 0;
2658 });
2659
2660 ApplySpellFix({ 70525, 70639 }, [](SpellInfo* spellInfo)
2661 {
2662 spellInfo->Effects[EFFECT_0].Effect = 0;
2663 spellInfo->Effects[EFFECT_1].Effect = 0;
2664 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
2665 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
2666 spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_500_YARDS); // 500yd
2667 });
2668
2669 // Frost Nova
2670 ApplySpellFix({ 68198 }, [](SpellInfo* spellInfo)
2671 {
2672 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13);
2673 spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
2674 });
2675
2676 // Blight
2677 ApplySpellFix({ 69604, 70286 }, [](SpellInfo* spellInfo)
2678 {
2679 spellInfo->MaxAffectedTargets = 1;
2680 spellInfo->AttributesEx3 |= (SPELL_ATTR3_ALWAYS_HIT | SPELL_ATTR3_ONLY_ON_PLAYER);
2681 });
2682
2683 // Chilling Wave
2684 ApplySpellFix({ 68778, 70333 }, [](SpellInfo* spellInfo)
2685 {
2686 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_TARGET_ENEMY);
2687 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2688 });
2689
2690 ApplySpellFix({ 68786, 70336 }, [](SpellInfo* spellInfo)
2691 {
2692 spellInfo->AttributesEx3 |= (SPELL_ATTR3_ALWAYS_HIT | SPELL_ATTR3_ONLY_ON_PLAYER);
2693 spellInfo->Effects[EFFECT_2].Effect = SPELL_EFFECT_DUMMY;
2694 });
2695
2696 // Pursuit
2697 ApplySpellFix({ 68987 }, [](SpellInfo* spellInfo)
2698 {
2699 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2700 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2701 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2702 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo();
2703 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
2704 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo();
2705 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100yd
2706 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
2707 });
2708
2709 ApplySpellFix({ 69029, 70850 }, [](SpellInfo* spellInfo)
2710 {
2711 spellInfo->Effects[EFFECT_2].Effect = 0;
2712 });
2713
2714 // Explosive Barrage
2715 ApplySpellFix({ 69263 }, [](SpellInfo* spellInfo)
2716 {
2717 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_MOD_STUN;
2718 });
2719
2720 // Overlord's Brand
2721 ApplySpellFix({ 69172 }, [](SpellInfo* spellInfo)
2722 {
2723 spellInfo->ProcFlags = DONE_HIT_PROC_FLAG_MASK & ~PROC_FLAG_DONE_PERIODIC;
2724 spellInfo->ProcChance = 100;
2725 });
2726
2727 // Icy Blast
2728 ApplySpellFix({ 69232 }, [](SpellInfo* spellInfo)
2729 {
2730 spellInfo->Effects[EFFECT_1].TriggerSpell = 69238;
2731 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
2732 });
2733
2734 ApplySpellFix({ 69233, 69646 }, [](SpellInfo* spellInfo)
2735 {
2736 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
2737 });
2738
2739 ApplySpellFix({ 69238, 69628 }, [](SpellInfo* spellInfo)
2740 {
2741 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
2742 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_DEST_DYNOBJ_NONE);
2743 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
2744 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_DEST_DYNOBJ_NONE);
2745 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
2746 });
2747
2748 // Hoarfrost
2749 ApplySpellFix({ 69246, 69245, 69645 }, [](SpellInfo* spellInfo)
2750 {
2751 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
2752 });
2753
2754 // Devour Humanoid
2755 ApplySpellFix({ 69503 }, [](SpellInfo* spellInfo)
2756 {
2757 spellInfo->ChannelInterruptFlags |= 0;
2758 spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_TURNING;
2759 });
2760
2761 // Falric: Defiling Horror
2762 ApplySpellFix({ 72435, 72452 }, [](SpellInfo* spellInfo)
2763 {
2764 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS);
2765 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS);
2766 });
2767
2768 // Frostsworn General - Throw Shield
2769 ApplySpellFix({ 69222, 73076 }, [](SpellInfo* spellInfo)
2770 {
2771 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
2772 });
2773
2774 // Halls of Reflection Clone
2775 ApplySpellFix({ 69828 }, [](SpellInfo* spellInfo)
2776 {
2777 spellInfo->Effects[EFFECT_1].Effect = 0;
2778 spellInfo->Effects[EFFECT_2].Effect = 0;
2779 });
2780
2781 // Summon Ice Wall
2782 ApplySpellFix({ 69768 }, [](SpellInfo* spellInfo)
2783 {
2784 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2785 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALLOW_ACTION_DURING_CHANNEL;
2786 });
2787
2788 ApplySpellFix({ 69767 }, [](SpellInfo* spellInfo)
2789 {
2790 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_TARGET_ANY);
2791 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2792 });
2793
2794 // Essence of the Captured
2795 ApplySpellFix({ 73035, 70719 }, [](SpellInfo* spellInfo)
2796 {
2797 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13);
2798 });
2799
2800 // Achievement Check
2801 ApplySpellFix({ 72830 }, [](SpellInfo* spellInfo)
2802 {
2803 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS);
2804 });
2805
2807 70781, // Light's Hammer Teleport
2808 70856, // Oratory of the Damned Teleport
2809 70857, // Rampart of Skulls Teleport
2810 70858, // Deathbringer's Rise Teleport
2811 70859, // Upper Spire Teleport
2812 70860, // Frozen Throne Teleport
2813 70861 // Sindragosa's Lair Teleport
2814 }, [](SpellInfo* spellInfo)
2815 {
2816 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2817 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2818 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB); // this target is for SPELL_EFFECT_TELEPORT_UNITS
2819 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo();
2820 spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
2821 spellInfo->Effects[EFFECT_2].TargetB = SpellImplicitTargetInfo();
2822 });
2823
2825 70960, // Bone Flurry
2826 71258 // Adrenaline Rush (Ymirjar Battle-Maiden)
2827 }, [](SpellInfo* spellInfo)
2828 {
2829 spellInfo->AttributesEx &= ~SPELL_ATTR1_IS_SELF_CHANNELED;
2830 });
2831
2832 // Saber Lash (Lord Marrowgar)
2833 ApplySpellFix({ 69055, 70814 }, [](SpellInfo* spellInfo)
2834 {
2835 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS); // 5yd
2836 });
2837
2838 // Impaled (Lord Marrowgar)
2839 ApplySpellFix({ 69065 }, [](SpellInfo* spellInfo)
2840 {
2841 spellInfo->Effects[EFFECT_0].Effect = 0; // remove stun so Dispersion can be used
2842 });
2843
2844 // Cold Flame (Lord Marrowgar)
2845 ApplySpellFix({ 72701, 72702, 72703, 72704 }, [](SpellInfo* spellInfo)
2846 {
2847 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
2848 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
2849 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo();
2850 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(9); // 30 secs instead of 12, need him for longer, but will stop his actions after 12 secs
2851 });
2852
2853 ApplySpellFix({ 69138 }, [](SpellInfo* spellInfo)
2854 {
2855 spellInfo->Effects[EFFECT_0].Effect = 0;
2856 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
2857 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(9); // 30 secs instead of 12, need him for longer, but will stop his actions after 12 secs
2858 });
2859
2860 ApplySpellFix({ 69146, 70823, 70824, 70825 }, [](SpellInfo* spellInfo)
2861 {
2862 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // 3yd instead of 5yd
2863 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_NO_CAST_LOG;
2864 });
2865
2866 // Dark Martyrdom (Lady Deathwhisper)
2867 ApplySpellFix({ 70897 }, [](SpellInfo* spellInfo)
2868 {
2869 spellInfo->AttributesEx2 |= SPELL_ATTR2_ALLOW_DEAD_TARGET;
2870 });
2871
2873 69075, // Bone Storm (Lord Marrowgar)
2874 70834, // Bone Storm (Lord Marrowgar)
2875 70835, // Bone Storm (Lord Marrowgar)
2876 70836, // Bone Storm (Lord Marrowgar)
2877 72378, // Blood Nova (Deathbringer Saurfang)
2878 73058, // Blood Nova (Deathbringer Saurfang)
2879 72769, // Scent of Blood (Deathbringer Saurfang)
2880 72385, // Boiling Blood (Deathbringer Saurfang)
2881 72441, // Boiling Blood (Deathbringer Saurfang)
2882 72442, // Boiling Blood (Deathbringer Saurfang)
2883 72443, // Boiling Blood (Deathbringer Saurfang)
2884 71160, // Plague Stench (Stinky)
2885 71161, // Plague Stench (Stinky)
2886 71123, // Decimate (Stinky & Precious)
2887 71464 // Divine Surge (Sister Svalna)
2888 }, [](SpellInfo* spellInfo)
2889 {
2890 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
2891 });
2892
2893 // Shadow's Fate
2894 ApplySpellFix({ 71169 }, [](SpellInfo* spellInfo)
2895 {
2896 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
2897 });
2898
2899 // Lock Players and Tap Chest
2900 ApplySpellFix({ 72347 }, [](SpellInfo* spellInfo)
2901 {
2902 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_SUPRESS_TARGET_PROCS;
2903 });
2904
2905 // Award Reputation - Boss Kill
2906 ApplySpellFix({ 73843, 73844, 73845, 73846 }, [](SpellInfo* spellInfo)
2907 {
2908 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS);
2909 });
2910
2911 // Death Plague (Rotting Frost Giant)
2912 ApplySpellFix({ 72864 }, [](SpellInfo* spellInfo)
2913 {
2914 spellInfo->ExcludeTargetAuraSpell = 0;
2915 });
2916
2917 // Gunship Battle, spell Below Zero
2918 ApplySpellFix({ 69705 }, [](SpellInfo* spellInfo)
2919 {
2920 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
2921 });
2922
2923 // Resistant Skin (Deathbringer Saurfang adds)
2924 ApplySpellFix({ 72723 }, [](SpellInfo* spellInfo)
2925 {
2926 // this spell initially granted Shadow damage immunity, however it was removed but the data was left in client
2927 spellInfo->Effects[EFFECT_2].Effect = 0;
2928 });
2929
2930 // Mark of the Fallen Champion (Deathbringer Saurfang)
2931 ApplySpellFix({ 72255, 72444, 72445, 72446 }, [](SpellInfo* spellInfo)
2932 {
2933 // Patch 3.3.2 (2010-01-02): Deathbringer Saurfang will no longer gain blood power from Mark of the Fallen Champion.
2934 // prevented in script, effect needed for Prayer of Mending
2935 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_SUPRESS_CASTER_PROCS;
2936 });
2937
2938 // Coldflame Jets (Traps after Saurfang)
2939 ApplySpellFix({ 70460 }, [](SpellInfo* spellInfo)
2940 {
2941 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(1); // 10 seconds
2942 });
2943
2945 70461, // Coldflame Jets (Traps after Saurfang)
2946 71289 // Dominate Mind (Lady Deathwhisper)
2947 }, [](SpellInfo* spellInfo)
2948 {
2949 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
2950 });
2951
2952 // Severed Essence (Val'kyr Herald)
2953 ApplySpellFix({ 71906, 71942 }, [](SpellInfo* spellInfo)
2954 {
2955 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
2956 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
2957 spellInfo->Effects[EFFECT_1].Effect = 0;
2958 });
2959
2961 71159, // Awaken Plagued Zombies (Precious)
2962 71302 // Awaken Ymirjar Fallen (Ymirjar Deathbringer)
2963 }, [](SpellInfo* spellInfo)
2964 {
2965 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21);
2966 });
2967
2968 // Blood Prince Council, Invocation of Blood
2969 ApplySpellFix({ 70981, 70982, 70952 }, [](SpellInfo* spellInfo)
2970 {
2971 spellInfo->Effects[EFFECT_0].Effect = 0; // clear share health aura
2972 });
2973
2974 // Ymirjar Frostbinder, Frozen Orb
2975 ApplySpellFix({ 71274 }, [](SpellInfo* spellInfo)
2976 {
2977 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(6);
2978 });
2979
2980 // Ooze Flood (Rotface)
2981 ApplySpellFix({ 69783, 69797, 69799, 69802 }, [](SpellInfo* spellInfo)
2982 {
2983 spellInfo->AttributesEx |= SPELL_ATTR1_EXCLUDE_CASTER;
2984 });
2985
2986 // Volatile Ooze Beam Protection
2987 ApplySpellFix({ 70530 }, [](SpellInfo* spellInfo)
2988 {
2989 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AURA; // blizzard typo, 65 instead of 6, aura itself is defined (dummy)
2990 });
2991
2992 // Professor Putricide, Gaseous Bloat (Orange Ooze Channel)
2993 ApplySpellFix({ 70672, 72455, 72832, 72833 }, [](SpellInfo* spellInfo)
2994 {
2995 // copied attributes from Green Ooze Channel
2996 spellInfo->Attributes |= SPELL_ATTR0_NO_IMMUNITIES;
2997 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
2998 });
2999
3001 71412, // Green Ooze Summon (Professor Putricide)
3002 71415 // Orange Ooze Summon (Professor Putricide)
3003 }, [](SpellInfo* spellInfo)
3004 {
3005 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
3006 });
3007
3009 71621, // Create Concoction (Professor Putricide)
3010 72850,
3011 72851,
3012 72852,
3013 71893, // Guzzle Potions (Professor Putricide)
3014 73120,
3015 73121,
3016 73122
3017 }, [](SpellInfo* spellInfo)
3018 {
3019 spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(15); // 4 sec
3020 });
3021
3022 // Mutated Plague (Professor Putricide)
3023 ApplySpellFix({ 72454, 72464, 72506, 72507 }, [](SpellInfo* spellInfo)
3024 {
3025 spellInfo->AttributesEx4 |= SPELL_ATTR4_NO_CAST_LOG;
3026 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3027 });
3028
3029 // Unbound Plague (Professor Putricide) (needs target selection script)
3030 ApplySpellFix({ 70911, 72854, 72855, 72856 }, [](SpellInfo* spellInfo)
3031 {
3032 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
3033 });
3034
3035 // Mutated Transformation (Professor Putricide)
3036 ApplySpellFix({ 70402, 72511, 72512, 72513 }, [](SpellInfo* spellInfo)
3037 {
3038 spellInfo->AttributesEx2 |= SPELL_ATTR2_CANT_CRIT;
3039 });
3040
3041 // Empowered Flare (Blood Prince Council)
3042 ApplySpellFix({ 71708, 72785, 72786, 72787 }, [](SpellInfo* spellInfo)
3043 {
3044 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
3045 });
3046
3048 71518, // Unholy Infusion Quest Credit (Professor Putricide)
3049 72934, // Blood Infusion Quest Credit (Blood-Queen Lana'thel)
3050 72289 // Frost Infusion Quest Credit (Sindragosa)
3051 }, [](SpellInfo* spellInfo)
3052 {
3053 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // another missing radius
3054 });
3055
3056 // Swarming Shadows
3057 ApplySpellFix({ 71266, 72890 }, [](SpellInfo* spellInfo)
3058 {
3059 spellInfo->AreaGroupId = 0; // originally, these require area 4522, which is... outside of Icecrown Citadel
3060 });
3061
3063 71301, // Summon Dream Portal (Valithria Dreamwalker)
3064 71977 // Summon Nightmare Portal (Valithria Dreamwalker)
3065 }, [](SpellInfo* spellInfo)
3066 {
3067 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
3068 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
3069 });
3070
3071 // Column of Frost (visual marker)
3072 ApplySpellFix({ 70715 }, [](SpellInfo* spellInfo)
3073 {
3074 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(32); // 6 seconds (missing)
3075 });
3076
3077 // Mana Void (periodic aura)
3078 ApplySpellFix({ 71085 }, [](SpellInfo* spellInfo)
3079 {
3080 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(9); // 30 seconds (missing)
3081 });
3082
3083 // Summon Suppressor (needs target selection script)
3084 ApplySpellFix({ 70936 }, [](SpellInfo* spellInfo)
3085 {
3086 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
3087 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
3088 });
3089
3090 // Corruption
3091 ApplySpellFix({ 70602 }, [](SpellInfo* spellInfo)
3092 {
3093 spellInfo->AttributesEx3 |= SPELL_ATTR3_DOT_STACKING_RULE;
3094 });
3095
3097 72706, // Achievement Check (Valithria Dreamwalker)
3098 71357 // Order Whelp
3099 }, [](SpellInfo* spellInfo)
3100 {
3101 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3102 });
3103
3104 // Sindragosa's Fury
3105 ApplySpellFix({ 70598 }, [](SpellInfo* spellInfo)
3106 {
3107 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
3108 });
3109
3110 // Tail Smash (Sindragosa)
3111 ApplySpellFix({ 71077 }, [](SpellInfo* spellInfo)
3112 {
3113 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER_BACK);
3114 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_DEST_AREA_ENEMY);
3115 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER_BACK);
3116 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_DEST_AREA_ENEMY);
3117 });
3118
3119 // Frost Bomb
3120 ApplySpellFix({ 69846 }, [](SpellInfo* spellInfo)
3121 {
3122 spellInfo->Speed = 0.0f; // This spell's summon happens instantly
3123 });
3124
3125 // Mystic Buffet (Sindragosa)
3126 ApplySpellFix({ 70127, 72528, 72529, 72530 }, [](SpellInfo* spellInfo)
3127 {
3128 spellInfo->Effects[EFFECT_1].Effect = 0; // remove obsolete spell effect with no targets
3129 });
3130
3131 // Sindragosa, Frost Aura
3132 ApplySpellFix({ 70084, 71050, 71051, 71052 }, [](SpellInfo* spellInfo)
3133 {
3134 spellInfo->Attributes &= ~SPELL_ATTR0_NO_IMMUNITIES;
3135 });
3136
3137 // Ice Lock
3138 ApplySpellFix({ 71614 }, [](SpellInfo* spellInfo)
3139 {
3140 spellInfo->Mechanic = MECHANIC_STUN;
3141 });
3142
3143 // Lich King, Infest
3144 ApplySpellFix({ 70541, 73779, 73780, 73781 }, [](SpellInfo* spellInfo)
3145 {
3146 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3147 });
3148
3149 // Lich King, Necrotic Plague
3150 ApplySpellFix({ 70337, 73912, 73913, 73914, 70338, 73785, 73786, 73787 }, [](SpellInfo* spellInfo)
3151 {
3152 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
3153 });
3154
3156 69099, // Ice Pulse 10n
3157 73776, // Ice Pulse 25n
3158 73777, // Ice Pulse 10h
3159 73778 // Ice Pulse 25h
3160 }, [](SpellInfo* spellInfo)
3161 {
3162 spellInfo->AttributesEx2 |= SPELL_ATTR2_CANT_CRIT;
3163 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_NO_CAST_LOG;
3164 });
3165
3166 // Fury of Frostmourne
3167 ApplySpellFix({ 72350 }, [](SpellInfo* spellInfo)
3168 {
3169 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3170 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3171 });
3172
3174 72351, // Fury of Frostmourne
3175 72431, // Jump (removes Fury of Frostmourne debuff)
3176 72429, // Mass Resurrection
3177 73159 // Play Movie
3178 }, [](SpellInfo* spellInfo)
3179 {
3180 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3181 });
3182
3183 // Raise Dead
3184 ApplySpellFix({ 72376 }, [](SpellInfo* spellInfo)
3185 {
3186 spellInfo->MaxAffectedTargets = 4;
3187 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3188 });
3189
3190 // Jump
3191 ApplySpellFix({ 71809 }, [](SpellInfo* spellInfo)
3192 {
3193 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(5); // 40yd
3194 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd
3195 spellInfo->Effects[EFFECT_0].MiscValue = 190;
3196 });
3197
3198 // Broken Frostmourne
3199 ApplySpellFix({ 72405 }, [](SpellInfo* spellInfo)
3200 {
3201 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3202 });
3203
3204 // Summon Shadow Trap
3205 ApplySpellFix({ 73540 }, [](SpellInfo* spellInfo)
3206 {
3207 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(3); // 60 seconds
3208 });
3209
3210 // Shadow Trap (visual)
3211 ApplySpellFix({ 73530 }, [](SpellInfo* spellInfo)
3212 {
3213 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(28); // 5 seconds
3214 });
3215
3216 // Shadow Trap
3217 ApplySpellFix({ 73529 }, [](SpellInfo* spellInfo)
3218 {
3219 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd
3220 });
3221
3222 // Shadow Trap (searcher)
3223 ApplySpellFix({ 74282 }, [](SpellInfo* spellInfo)
3224 {
3225 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // 3yd
3226 });
3227
3228 // Raging Spirit Visual
3229 ApplySpellFix({ 69198 }, [](SpellInfo* spellInfo)
3230 {
3231 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd
3232 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3233 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
3234 });
3235
3236 // Defile
3237 ApplySpellFix({ 72762 }, [](SpellInfo* spellInfo)
3238 {
3239 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(559); // 53 seconds
3240 spellInfo->ExcludeCasterAuraSpell = 0;
3241 spellInfo->Attributes |= SPELL_ATTR0_NO_IMMUNITIES;
3243 });
3244
3245 // Defile
3246 ApplySpellFix({ 72743 }, [](SpellInfo* spellInfo)
3247 {
3248 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(22); // 45 seconds
3249 });
3250
3251 ApplySpellFix({ 72754, 73708, 73709, 73710 }, [](SpellInfo* spellInfo)
3252 {
3253 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3254 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3255 });
3256
3257 // Val'kyr Target Search
3258 ApplySpellFix({ 69030 }, [](SpellInfo* spellInfo)
3259 {
3260 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3261 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3262 spellInfo->Attributes |= SPELL_ATTR0_NO_IMMUNITIES;
3263 });
3264
3265 // Harvest Souls
3266 ApplySpellFix({ 73654, 74295, 74296, 74297 }, [](SpellInfo* spellInfo)
3267 {
3268 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3269 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3270 spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3271 });
3272
3273 // Restore Soul
3274 ApplySpellFix({ 72595, 73650 }, [](SpellInfo* spellInfo)
3275 {
3276 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3277 });
3278
3279 // Kill Frostmourne Players
3280 ApplySpellFix({ 75127 }, [](SpellInfo* spellInfo)
3281 {
3282 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3283 });
3284
3285 // Harvest Soul
3286 ApplySpellFix({ 73655 }, [](SpellInfo* spellInfo)
3287 {
3288 spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_MODIFIERS;
3289 });
3290
3291 // Destroy Soul
3292 ApplySpellFix({ 74086 }, [](SpellInfo* spellInfo)
3293 {
3294 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3295 });
3296
3297 // Summon Spirit Bomb
3298 ApplySpellFix({ 74302, 74342 }, [](SpellInfo* spellInfo)
3299 {
3300 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3301 spellInfo->MaxAffectedTargets = 1;
3302 });
3303
3304 // Summon Spirit Bomb
3305 ApplySpellFix({ 74341, 74343 }, [](SpellInfo* spellInfo)
3306 {
3307 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd
3308 spellInfo->MaxAffectedTargets = 3;
3309 });
3310
3311 // Summon Spirit Bomb
3312 ApplySpellFix({ 73579 }, [](SpellInfo* spellInfo)
3313 {
3314 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_25_YARDS); // 25yd
3315 });
3316
3317 // Trigger Vile Spirit (Inside, Heroic)
3318 ApplySpellFix({ 73582 }, [](SpellInfo* spellInfo)
3319 {
3320 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd
3321 });
3322
3323 // Scale Aura (used during Dominate Mind from Lady Deathwhisper)
3324 ApplySpellFix({ 73261 }, [](SpellInfo* spellInfo)
3325 {
3326 spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CHANGE_MAP;
3327 });
3328
3329 // Leap to a Random Location
3330 ApplySpellFix({ 70485 }, [](SpellInfo* spellInfo)
3331 {
3332 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100yd
3333 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS);
3334 spellInfo->Effects[EFFECT_0].MiscValue = 100;
3335 });
3336
3337 // Empowered Blood
3338 ApplySpellFix({ 70227, 70232 }, [](SpellInfo* spellInfo)
3339 {
3340 spellInfo->AreaGroupId = 2452; // Whole icc instead of Crimson Halls only, remove when area calculation is fixed
3341 });
3342
3343 ApplySpellFix({ 74509 }, [](SpellInfo* spellInfo)
3344 {
3345 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS); // 20yd
3346 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS); // 20yd
3347 });
3348
3349 // Rallying Shout
3350 ApplySpellFix({ 75414 }, [](SpellInfo* spellInfo)
3351 {
3352 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS); // 20yd
3353 });
3354
3355 // Barrier Channel
3356 ApplySpellFix({ 76221 }, [](SpellInfo* spellInfo)
3357 {
3358 spellInfo->ChannelInterruptFlags &= ~(AURA_INTERRUPT_FLAG_TURNING | AURA_INTERRUPT_FLAG_MOVE);
3359 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_NEARBY_ENTRY);
3360 });
3361
3362 // Intimidating Roar
3363 ApplySpellFix({ 74384 }, [](SpellInfo* spellInfo)
3364 {
3365 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
3366 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
3367 });
3368
3370 74562, // Fiery Combustion
3371 74792 // Soul Consumption
3372 }, [](SpellInfo* spellInfo)
3373 {
3374 spellInfo->AttributesEx |= SPELL_ATTR1_NO_REDIRECTION;
3375 });
3376
3377 // Combustion
3378 ApplySpellFix({ 75883, 75884 }, [](SpellInfo* spellInfo)
3379 {
3380 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_6_YARDS); // 6yd
3381 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_6_YARDS); // 6yd
3382 });
3383
3384 // Consumption
3385 ApplySpellFix({ 75875, 75876 }, [](SpellInfo* spellInfo)
3386 {
3387 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_6_YARDS); // 6yd
3388 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_6_YARDS); // 6yd
3389 spellInfo->Effects[EFFECT_0].Mechanic = MECHANIC_NONE;
3390 spellInfo->Effects[EFFECT_1].Mechanic = MECHANIC_SNARE;
3391 });
3392
3393 // Soul Consumption
3394 ApplySpellFix({ 74799 }, [](SpellInfo* spellInfo)
3395 {
3396 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_12_YARDS); // 12yd
3397 });
3398
3399 // Twilight Cutter
3400 ApplySpellFix({ 74769, 77844, 77845, 77846 }, [](SpellInfo* spellInfo)
3401 {
3402 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
3403 });
3404
3405 // Twilight Mending
3406 ApplySpellFix({ 75509 }, [](SpellInfo* spellInfo)
3407 {
3408 spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_PHASE_SHIFT;
3409 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3410 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
3411 spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd
3412 });
3413
3414 // Meteor Strike
3415 ApplySpellFix({ 74637 }, [](SpellInfo* spellInfo)
3416 {
3417 spellInfo->Speed = 0;
3418 });
3419
3420 //Blazing Aura
3421 ApplySpellFix({ 75885, 75886 }, [](SpellInfo* spellInfo)
3422 {
3423 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_NO_CAST_LOG;
3424 });
3425
3427 75952, //Meteor Strike
3428 74629 //Combustion Periodic
3429 }, [](SpellInfo* spellInfo)
3430 {
3431 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_NO_CAST_LOG;
3432 });
3433
3434 // Going Bearback
3435 ApplySpellFix({ 54897 }, [](SpellInfo* spellInfo)
3436 {
3437 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_DUMMY;
3438 spellInfo->Effects[EFFECT_1].RadiusEntry = spellInfo->Effects[EFFECT_0].RadiusEntry;
3439 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_DEST_AREA_ENTRY);
3440 });
3441
3442 // Still At It
3443 ApplySpellFix({ 51931, 51932, 51933 }, [](SpellInfo* spellInfo)
3444 {
3445 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(38);
3446 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
3447 });
3448
3449 // Rallying the Troops
3450 ApplySpellFix({ 47394 }, [](SpellInfo* spellInfo)
3451 {
3452 spellInfo->ExcludeTargetAuraSpell = 47394;
3453 });
3454
3455 // A Tangled Skein
3456 ApplySpellFix({ 51165, 51173 }, [](SpellInfo* spellInfo)
3457 {
3458 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
3459 });
3460
3462 69563, // A Cloudlet of Classy Cologne
3463 69445, // A Perfect Puff of Perfume
3464 69489 // Bonbon Blitz
3465 }, [](SpellInfo* spellInfo)
3466 {
3467 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
3468 });
3469
3470 // Control
3471 ApplySpellFix({ 30790 }, [](SpellInfo* spellInfo)
3472 {
3473 spellInfo->Effects[EFFECT_1].MiscValue = 0;
3474 });
3475
3476 // Reclusive Runemaster
3477 ApplySpellFix({ 48028 }, [](SpellInfo* spellInfo)
3478 {
3479 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
3480 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY);
3481 });
3482
3483 // Mastery of
3484 ApplySpellFix({ 65147 }, [](SpellInfo* spellInfo)
3485 {
3486 spellInfo->CategoryEntry = sSpellCategoryStore.LookupEntry(1244);
3487 spellInfo->CategoryRecoveryTime = 1500;
3488 });
3489
3490 // Weakness to Lightning
3491 ApplySpellFix({ 46432 }, [](SpellInfo* spellInfo)
3492 {
3493 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD;
3494 });
3495
3496 // Wrangle Some Aether Rays!
3497 ApplySpellFix({ 40856 }, [](SpellInfo* spellInfo)
3498 {
3499 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(27); // 3000ms
3500 });
3501
3502 // The Black Knight's Orders
3503 ApplySpellFix({ 63163 }, [](SpellInfo* spellInfo)
3504 {
3505 spellInfo->Effects[EFFECT_0].BasePoints = 52390;
3506 });
3507
3508 // The Warp Rifts
3509 ApplySpellFix({ 34888 }, [](SpellInfo* spellInfo)
3510 {
3511 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(5); // 300 secs
3512 });
3513
3514 // The Smallest Creatures
3515 ApplySpellFix({ 38544 }, [](SpellInfo* spellInfo)
3516 {
3517 spellInfo->Effects[EFFECT_0].MiscValueB = 427;
3518 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(1);
3519 spellInfo->Effects[EFFECT_1].Effect = 0;
3520 });
3521
3522 // Ridding the red rocket
3523 ApplySpellFix({ 49177 }, [](SpellInfo* spellInfo)
3524 {
3525 spellInfo->Effects[EFFECT_0].BasePoints = 1; // corrects seat id (points - 1 = seatId)
3526 });
3527
3528 // Jormungar Strike
3529 ApplySpellFix({ 56513 }, [](SpellInfo* spellInfo)
3530 {
3531 spellInfo->RecoveryTime = 2000;
3532 });
3533
3535 37851, // Tag Greater Felfire Diemetradon
3536 37918 // Arcano-pince
3537 }, [](SpellInfo* spellInfo)
3538 {
3539 spellInfo->RecoveryTime = 3000;
3540 });
3541
3543 54997, // Cast Net (tooltip says 10s but sniffs say 6s)
3544 56524 // Acid Breath
3545 }, [](SpellInfo* spellInfo)
3546 {
3547 spellInfo->RecoveryTime = 6000;
3548 });
3549
3551 47911, // EMP
3552 48620, // Wing Buffet
3553 51752 // Stampy's Stompy-Stomp
3554 }, [](SpellInfo* spellInfo)
3555 {
3556 spellInfo->RecoveryTime = 10000;
3557 });
3558
3560 37727, // Touch of Darkness
3561 54996 // Ice Slick (tooltip says 20s but sniffs say 12s)
3562 }, [](SpellInfo* spellInfo)
3563 {
3564 spellInfo->RecoveryTime = 12000;
3565 });
3566
3567 // Signal Helmet to Attack
3568 ApplySpellFix({ 51748 }, [](SpellInfo* spellInfo)
3569 {
3570 spellInfo->RecoveryTime = 15000;
3571 });
3572
3574 51756, // Charge
3575 37919, //Arcano-dismantle
3576 37917 //Arcano-Cloak
3577 }, [](SpellInfo* spellInfo)
3578 {
3579 spellInfo->RecoveryTime = 20000;
3580 });
3581
3582 // Kaw the Mammoth Destroyer
3583 ApplySpellFix({ 46260 }, [](SpellInfo* spellInfo)
3584 {
3585 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3586 });
3587
3588 // That's Abominable
3589 ApplySpellFix({ 59565 }, [](SpellInfo* spellInfo)
3590 {
3591 spellInfo->Effects[EFFECT_0].MiscValueB = 1721; // controlable guardian
3592 });
3593
3594 // Investigate the Blue Recluse (1920)
3595 // Investigate the Alchemist Shop (1960)
3596 ApplySpellFix({ 9095 }, [](SpellInfo* spellInfo)
3597 {
3598 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_DUMMY;
3599 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd
3600 });
3601
3602 // Dragonmaw Race: All parts
3604 40890 // Oldie's Rotten Pumpkin
3605 }, [](SpellInfo* spellInfo)
3606 {
3607 spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
3608 spellInfo->Effects[EFFECT_0].TriggerSpell = 40905;
3609 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
3610 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
3611 });
3612
3613 // Trope's Slime Cannon
3614 ApplySpellFix({ 40909 }, [](SpellInfo* spellInfo)
3615 {
3616 spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
3617 spellInfo->Effects[EFFECT_0].TriggerSpell = 40905;
3618 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
3619 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
3620 });
3621
3622 // Corlok's Skull Barrage
3623 ApplySpellFix({ 40894 }, [](SpellInfo* spellInfo)
3624 {
3625 spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
3626 spellInfo->Effects[EFFECT_0].TriggerSpell = 40900;
3627 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
3628 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
3629 });
3630
3631 // Ichman's Blazing Fireball
3632 ApplySpellFix({ 40928 }, [](SpellInfo* spellInfo)
3633 {
3634 spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
3635 spellInfo->Effects[EFFECT_0].TriggerSpell = 40929;
3636 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
3637 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
3638 });
3639
3640 // Mulverick's Great Balls of Lightning
3641 ApplySpellFix({ 40930 }, [](SpellInfo* spellInfo)
3642 {
3643 spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
3644 spellInfo->Effects[EFFECT_0].TriggerSpell = 40931;
3645 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
3646 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
3647 });
3648
3649 // Sky Shatter
3650 ApplySpellFix({ 40945 }, [](SpellInfo* spellInfo)
3651 {
3652 spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
3653 spellInfo->Effects[EFFECT_0].TriggerSpell = 41064;
3654 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
3655 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
3656 });
3657
3658 // Gauging the Resonant Frequency (10594)
3659 ApplySpellFix({ 37390 }, [](SpellInfo* spellInfo)
3660 {
3661 spellInfo->Effects[EFFECT_0].MiscValueB = 181;
3662 });
3663
3664 // Where in the World is Hemet Nesingwary? (12521)
3665 ApplySpellFix({ 50860 }, [](SpellInfo* spellInfo)
3666 {
3667 spellInfo->Effects[EFFECT_0].BasePoints = 50860;
3668 });
3669
3670 ApplySpellFix({ 50861 }, [](SpellInfo* spellInfo)
3671 {
3672 spellInfo->Effects[EFFECT_0].BasePoints = 0;
3673 });
3674
3675 // Riding Jokkum
3676 ApplySpellFix({ 56606 }, [](SpellInfo* spellInfo)
3677 {
3678 spellInfo->Effects[EFFECT_0].BasePoints = 1;
3679 });
3680
3681 // Blightbeasts be Damned! (12072)
3682 ApplySpellFix({ 47424 }, [](SpellInfo* spellInfo)
3683 {
3684 spellInfo->AuraInterruptFlags &= ~AURA_INTERRUPT_FLAG_NOT_ABOVEWATER;
3685 });
3686
3687 // Dark Horizon (12664), Reunited (12663)
3688 ApplySpellFix({ 52190 }, [](SpellInfo* spellInfo)
3689 {
3690 spellInfo->Effects[EFFECT_0].BasePoints = 52391 - 1;
3691 });
3692
3693 // The Sum is Greater than the Parts (13043) - Chained Grip
3694 ApplySpellFix({ 60540 }, [](SpellInfo* spellInfo)
3695 {
3696 spellInfo->Effects[EFFECT_0].MiscValue = 300;
3697 });
3698
3699 // Not a Bug (13342)
3700 ApplySpellFix({ 60531 }, [](SpellInfo* spellInfo)
3701 {
3702 spellInfo->AttributesEx2 |= SPELL_ATTR2_ALLOW_DEAD_TARGET;
3703 });
3704
3705 // Frankly, It Makes No Sense... (10672)
3706 ApplySpellFix({ 37851 }, [](SpellInfo* spellInfo)
3707 {
3708 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
3709 });
3710
3711 // Honor Challenge (12939)
3712 ApplySpellFix({ 21855 }, [](SpellInfo* spellInfo)
3713 {
3714 spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
3715 });
3716
3717 // Convocation at Zol'Heb (12730)
3718 ApplySpellFix({ 52956 }, [](SpellInfo* spellInfo)
3719 {
3720 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_DEST_AREA_ENTRY);
3721 });
3722
3723 // Mangletooth
3725 7764, // Wisdom of Agamaggan
3726 10767, // Rising Spirit
3727 16610, // Razorhide
3728 16612, // Agamaggan's Strength
3729 16618, // Spirit of the Wind
3730 17013 // Agamaggan's Agility
3731 }, [](SpellInfo* spellInfo)
3732
3733 {
3734 spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
3735 spellInfo->AttributesEx5 |= SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT;
3736 });
3737
3738 //Crushing the Crown
3739 ApplySpellFix({ 71024 }, [](SpellInfo* spellInfo)
3740 {
3741 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DYNOBJ_NONE);
3742 });
3743
3744 // Battle for the Undercity
3746 59892 // Cyclone fall
3747 }, [](SpellInfo* spellInfo)
3748 {
3749 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AREA_AURA_FRIEND;
3750 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd
3751 spellInfo->AttributesEx &= ~SPELL_ATTR0_NO_AURA_CANCEL;
3752 spellInfo->AttributesEx3 |= SPELL_ATTR3_ONLY_ON_PLAYER;
3753 });
3754
3755 // enchant Lightweave Embroidery
3756 ApplySpellFix({ 55637 }, [](SpellInfo* spellInfo)
3757 {
3758 spellInfo->Effects[EFFECT_1].MiscValue = 126;
3759 });
3760
3762 47977, // Magic Broom
3763 65917 // Magic Rooster
3764 }, [](SpellInfo* spellInfo)
3765 {
3766 // First two effects apply auras, which shouldn't be there
3767 // due to NO_TARGET applying aura on current caster (core bug)
3768 // Just wipe effect data, to mimic blizz-behavior
3769 spellInfo->Effects[EFFECT_0].Effect = 0;
3770 spellInfo->Effects[EFFECT_1].Effect = 0;
3771 });
3772
3773 // Titanium Seal of Dalaran, Toss your luck
3774 ApplySpellFix({ 60476 }, [](SpellInfo* spellInfo)
3775 {
3776 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
3777 });
3778
3779 // Mind Amplification Dish, change charm aura
3780 ApplySpellFix({ 26740 }, [](SpellInfo* spellInfo)
3781 {
3782 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_MOD_CHARM;
3783 });
3784
3785 // Persistent Shield
3786 ApplySpellFix({ 26467 }, [](SpellInfo* spellInfo)
3787 {
3788 spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE;
3789 spellInfo->Effects[EFFECT_0].TriggerSpell = 26470;
3790 });
3791
3792 // Deadly Swiftness
3793 ApplySpellFix({ 31255 }, [](SpellInfo* spellInfo)
3794 {
3795 spellInfo->Effects[EFFECT_0].TriggerSpell = 22588;
3796 });
3797
3798 // Black Magic enchant
3799 ApplySpellFix({ 59630 }, [](SpellInfo* spellInfo)
3800 {
3801 spellInfo->Attributes |= SPELL_ATTR0_PASSIVE;
3802 });
3803
3804 // Precious's Ribbon
3805 ApplySpellFix({ 72968 }, [](SpellInfo* spellInfo)
3806 {
3807 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD;
3808 });
3809
3811 71646, // Item - Bauble of True Blood 10m
3812 71607, // Item - Bauble of True Blood 25m
3813 71610, // Item - Althor's Abacus trigger 10m
3814 71641 // Item - Althor's Abacus trigger 25m
3815 }, [](SpellInfo* spellInfo)
3816 {
3817 spellInfo->DmgClass = SPELL_DAMAGE_CLASS_MAGIC;
3818 spellInfo->SpellLevel = 0;
3819 });
3820
3822 6789, // Warlock - Death Coil (Rank 1)
3823 17925, // Warlock - Death Coil (Rank 2)
3824 17926, // Warlock - Death Coil (Rank 3)
3825 27223, // Warlock - Death Coil (Rank 4)
3826 47859, // Warlock - Death Coil (Rank 5)
3827 71838, // Drain Life - Bryntroll Normal
3828 71839 // Drain Life - Bryntroll Heroic
3829 }, [](SpellInfo* spellInfo)
3830 {
3831 spellInfo->AttributesEx2 |= SPELL_ATTR2_CANT_CRIT;
3832 });
3833
3834 // Alchemist's Stone
3835 ApplySpellFix({ 17619 }, [](SpellInfo* spellInfo)
3836 {
3837 spellInfo->AttributesEx3 |= SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD;
3838 });
3839
3840 // Stormchops
3841 ApplySpellFix({ 43730 }, [](SpellInfo* spellInfo)
3842 {
3843 spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(1);
3844 spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo();
3845 });
3846
3847 // Savory Deviate Delight (transformations), allow to mount while transformed
3848 ApplySpellFix({ 8219, 8220, 8221, 8222 }, [](SpellInfo* spellInfo)
3849 {
3850 spellInfo->Attributes &= ~SPELL_ATTR0_NO_IMMUNITIES;
3851 });
3852
3853 // Clamlette Magnifique
3854 ApplySpellFix({ 72623 }, [](SpellInfo* spellInfo)
3855 {
3856 spellInfo->Effects[EFFECT_0].BasePoints = spellInfo->Effects[EFFECT_1].BasePoints;
3857 });
3858
3859 // Compact Harvest Reaper
3860 ApplySpellFix({ 4078 }, [](SpellInfo* spellInfo)
3861 {
3862 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(6); // 10 minutes
3863 });
3864
3865 // Dragon Kite, Tuskarr Kite - Kite String
3866 ApplySpellFix({ 45192 }, [](SpellInfo* spellInfo)
3867 {
3868 spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100yd
3869 });
3870
3871 // Frigid Frostling, Infrigidate
3872 ApplySpellFix({ 74960 }, [](SpellInfo* spellInfo)
3873 {
3874 spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_20_YARDS); // 20yd
3875 });
3876
3877 // Apple Trap
3878 ApplySpellFix({ 43450 }, [](SpellInfo* spellInfo)
3879 {
3880 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY);
3881 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
3882 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_DUMMY;
3883 });
3884
3885 // Dark Iron Attack - spawn mole machine
3886 ApplySpellFix({ 43563 }, [](SpellInfo* spellInfo)
3887 {
3888 spellInfo->Effects[EFFECT_2].Effect = 0; // summon GO's manually
3889 });
3890
3891 // Throw Mug visual
3892 ApplySpellFix({ 42300 }, [](SpellInfo* spellInfo)
3893 {
3894 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
3895 });
3896
3897 // Dark Iron knockback Aura
3898 ApplySpellFix({ 42299 }, [](SpellInfo* spellInfo)
3899 {
3900 spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_DUMMY;
3901 spellInfo->Effects[EFFECT_0].MiscValue = 100;
3902 spellInfo->Effects[EFFECT_0].BasePoints = 79;
3903 });
3904
3905 // Chug and Chuck!
3906 ApplySpellFix({ 42436 }, [](SpellInfo* spellInfo)
3907 {
3908 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_SRC_CASTER);
3909 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY);
3910 spellInfo->MaxAffectedTargets = 0;
3911 spellInfo->ExcludeCasterAuraSpell = 42299;
3912 });
3913
3914 // Catch the Wild Wolpertinger!
3915 ApplySpellFix({ 41621 }, [](SpellInfo* spellInfo)
3916 {
3917 spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_DUMMY;
3918 });
3919
3920 // Brewfest quests
3921 ApplySpellFix({ 47134, 51798 }, [](SpellInfo* spellInfo)
3922 {
3923 spellInfo->Effects[EFFECT_0].Effect = 0;
3924 });
3925
3926 // The Heart of The Storms (12998)
3927 ApplySpellFix({ 43528 }, [](SpellInfo* spellInfo)
3928 {
3929 spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(18);
3930 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(25);
3931 });
3932
3933 // Water splash
3934 ApplySpellFix({ 42348 }, [](SpellInfo* spellInfo)
3935 {
3936 spellInfo->Effects[EFFECT_0].Effect = 0;
3937 });
3938
3939 // Summon Lantersn
3940 ApplySpellFix({ 44255, 44231 }, [](SpellInfo* spellInfo)
3941 {
3942 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
3943 spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
3944 });
3945
3946 // Throw Head Back
3947 ApplySpellFix({ 42401 }, [](SpellInfo* spellInfo)
3948 {
3949 spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(