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