TrinityCore
Loading...
Searching...
No Matches
spell_mage.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19 * Scripts for spells with SPELLFAMILY_MAGE and SPELLFAMILY_GENERIC spells used by mage players.
20 * Ordered alphabetically using scriptname.
21 * Scriptnames of files in this file should be prefixed with "spell_mage_".
22 */
23
24#include "ScriptMgr.h"
25#include "Creature.h"
26#include "Player.h"
27#include "Random.h"
28#include "SpellAuraEffects.h"
29#include "SpellHistory.h"
30#include "SpellMgr.h"
31#include "SpellScript.h"
32
34{
73};
74
82
83// Incanter's Absorbtion
85{
86 public:
87 bool Validate(SpellInfo const* /*spellInfo*/) override
88 {
89 return ValidateSpellInfo(
90 {
93 });
94 }
95
96 void Trigger(AuraEffect* aurEff, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
97 {
98 Unit* target = GetTarget();
99
101 {
102 int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount());
103 CastSpellExtraArgs args(aurEff);
104 args.AddSpellBP0(bp);
106 }
107 }
108};
109
110// -5143 - Arcane Missiles
112{
114
115 bool Validate(SpellInfo const* /*spellInfo*/) override
116 {
118 }
119
120 void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
121 {
122 Unit* target = GetTarget();
124 target->CastSpell(nullptr, SPELL_MAGE_T10_2P_BONUS_EFFECT, aurEff);
125 }
126
131
132private:
133 bool _canProcT10 = false;
134
135public:
137 {
138 _canProcT10 = true;
139 }
140};
141
142// -31571 - Arcane Potency
144{
146
147 bool Validate(SpellInfo const* /*spellInfo*/) override
148 {
149 return ValidateSpellInfo(
150 {
153 });
154 }
155
156 bool CheckProc(ProcEventInfo& eventInfo)
157 {
158 // due to family mask sharing with brain freeze/missile barrage proc, we need to filter out by icon id
159 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
160 if (!spellInfo || (spellInfo->SpellIconID != SPELL_ICON_MAGE_CLEARCASTING && spellInfo->SpellIconID != SPELL_ICON_MAGE_PRESENCE_OF_MIND))
161 return false;
162
163 return true;
164 }
165
166 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
167 {
169
171 Unit* caster = eventInfo.GetActor();
172 uint32 spellId = triggerSpell[GetSpellInfo()->GetRank() - 1];
173 caster->CastSpell(caster, spellId, aurEff);
174 }
175
181};
182
183// -11113 - Blast Wave
204
205// -31641 - Blazing Speed
207{
209
210 bool Validate(SpellInfo const* /*spellInfo*/) override
211 {
213 }
214
215 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
216 {
218 if (Unit* target = eventInfo.GetActionTarget())
219 target->CastSpell(target, SPELL_MAGE_BLAZING_SPEED, aurEff);
220 }
221
226};
227
228// -54747 - Burning Determination
229// 54748 - Burning Determination
231{
233
234 bool CheckProc(ProcEventInfo& eventInfo)
235 {
236 if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
237 if (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_INTERRUPT) | (1 << MECHANIC_SILENCE)))
238 return true;
239
240 return false;
241 }
242
247};
248
249// -44449 - Burnout
251{
253
254 bool Validate(SpellInfo const* /*spellInfo*/) override
255 {
257 }
258
259 bool CheckProc(ProcEventInfo& eventInfo)
260 {
261 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
262 if (!damageInfo || !damageInfo->GetSpellInfo())
263 return false;
264
265 return true;
266 }
267
268 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
269 {
271
272 int32 mana = eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), eventInfo.GetDamageInfo()->GetSchoolMask());
273 mana = CalculatePct(mana, aurEff->GetAmount());
274
275 CastSpellExtraArgs args(aurEff);
276 args.AddSpellBP0(mana);
278 }
279
285};
286
287// 11958 - Cold Snap
289{
291
292 bool Load() override
293 {
294 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
295 }
296
297 void HandleDummy(SpellEffIndex /*effIndex*/)
298 {
299 GetCaster()->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
300 {
301 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first);
302 return spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (spellInfo->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) &&
303 spellInfo->Id != SPELL_MAGE_COLD_SNAP && spellInfo->GetRecoveryTime() > 0;
304 }, true);
305 }
306
311};
312
313// 11129 - Combustion
315{
317
318 bool Validate(SpellInfo const* /*spellInfo*/) override
319 {
321 }
322
323 bool CheckProc(ProcEventInfo& eventInfo)
324 {
325 // Do not take charges, add a stack of crit buff
326 if (!(eventInfo.GetHitMask() & PROC_HIT_CRITICAL))
327 {
328 eventInfo.GetActor()->CastSpell(nullptr, SPELL_MAGE_COMBUSTION_PROC, true);
329 return false;
330 }
331
332 return true;
333 }
334
339};
340
341// 28682 - Combustion proc
361
362// -31661 - Dragon's Breath
364{
366
367 bool CheckProc(ProcEventInfo& eventInfo)
368 {
369 // Dont proc with Living Bomb explosion
370 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
371 if (spellInfo && spellInfo->SpellIconID == SPELL_ICON_MAGE_LIVING_BOMB && spellInfo->SpellFamilyName == SPELLFAMILY_MAGE)
372 return false;
373 return true;
374 }
375
380};
381
382// -11185 - Improved Blizzard
384{
386
387 bool Validate(SpellInfo const* /*spellInfo*/) override
388 {
390 }
391
392 void HandleChill(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
393 {
395 uint32 triggerSpellId = sSpellMgr->GetSpellWithRank(SPELL_MAGE_CHILLED, GetSpellInfo()->GetRank());
396 eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), triggerSpellId, aurEff);
397 }
398
403};
404
405// 37447 - Improved Mana Gems
406// 61062 - Improved Mana Gems
408{
410
411 bool Validate(SpellInfo const* /*spellInfo*/) override
412 {
414 }
415
416 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
417 {
419 eventInfo.GetActor()->CastSpell(nullptr, SPELL_MAGE_MANA_SURGE, aurEff);
420 }
421
426};
427
428// -31656 - Empowered Fire
430{
432
433 bool Validate(SpellInfo const* /*spellInfo*/) override
434 {
436 }
437
438 bool CheckProc(ProcEventInfo& eventInfo)
439 {
440 if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
441 if (spellInfo->Id == SPELL_MAGE_IGNITE)
442 return true;
443
444 return false;
445 }
446
447 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
448 {
450
451 Unit* target = GetTarget();
452 CastSpellExtraArgs args(aurEff);
453 uint8 percent = sSpellMgr->AssertSpellInfo(SPELL_MAGE_EMPOWERED_FIRE_PROC)->GetEffect(EFFECT_0).CalcValue();
454 args.AddSpellBP0(CalculatePct(target->GetCreateMana(), percent));
455 target->CastSpell(target, SPELL_MAGE_EMPOWERED_FIRE_PROC, args);
456 }
457
463};
464
465// 74396 - Fingers of Frost
492
493// -543 - Fire Ward
494// -6143 - Frost Ward
496{
498
499 bool Validate(SpellInfo const* /*spellInfo*/) override
500 {
501 return ValidateSpellInfo(
502 {
505 });
506 }
507
508 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
509 {
510 canBeRecalculated = false;
511 if (Unit* caster = GetCaster())
512 {
513 // +80.68% from sp bonus
514 float bonus = 0.8068f;
515
516 bonus *= caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask());
517 bonus *= caster->CalculateSpellpowerCoefficientLevelPenalty(GetSpellInfo());
518
519 amount += int32(bonus);
520 }
521 }
522
523 void Absorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
524 {
525 Unit* target = GetTarget();
527 {
528 int32 chance = talentAurEff->GetSpellInfo()->GetEffect(EFFECT_1).CalcValue(); // SPELL_EFFECT_DUMMY with NO_TARGET
529
530 if (roll_chance_i(chance))
531 {
532 int32 bp = dmgInfo.GetDamage();
533 dmgInfo.AbsorbDamage(bp);
534 CastSpellExtraArgs args(aurEff);
535 args.AddSpellBP0(bp);
536 target->CastSpell(target, SPELL_MAGE_FROST_WARDING_TRIGGERED, args);
537 absorbAmount = 0;
539 }
540 }
541 }
542
549};
550
551// -44614 - Frostfire Bolt
578
579// 54646 - Focus Magic
609
610// 48108 - Hot Streak
611// 57761 - Fireball!
613{
615
616 bool Validate(SpellInfo const* /*spellInfo*/) override
617 {
618 return ValidateSpellInfo(
619 {
623 });
624 }
625
626 bool CheckProc(ProcEventInfo& eventInfo)
627 {
628 Unit* caster = eventInfo.GetActor();
629 // Prevent double proc for Arcane missiles
630 if (caster == eventInfo.GetActionTarget())
631 return false;
632
633 // Proc chance is unknown, we'll just use dummy aura amount
634 if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_MAGE_T8_4P_BONUS, EFFECT_0))
635 if (roll_chance_i(aurEff->GetAmount()))
636 return false;
637
638 return true;
639 }
640
641 void HandleProc(ProcEventInfo& eventInfo)
642 {
643 Unit* caster = eventInfo.GetActor();
644
645 if (caster->HasAura(SPELL_MAGE_T10_2P_BONUS))
646 caster->CastSpell(nullptr, SPELL_MAGE_T10_2P_BONUS_EFFECT, true);
647 }
648
654};
655
656// 56375 - Glyph of Polymorph
675
676// 56374 - Glyph of Icy Veins
694
695// 56372 - Glyph of Ice Block
697{
699
700 void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
701 {
703 Unit* caster = eventInfo.GetActor();
704 caster->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
705 {
706 SpellInfo const* cdSpell = sSpellMgr->GetSpellInfo(itr->first);
707 if (!cdSpell || cdSpell->SpellFamilyName != SPELLFAMILY_MAGE
708 || !(cdSpell->SpellFamilyFlags[0] & 0x00000040))
709 return false;
710 return true;
711 }, true);
712 }
713
718};
719
720// -44445 - Hot Streak
722{
724
725 bool Validate(SpellInfo const* /*spellInfo*/) override
726 {
728 }
729
730 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
731 {
733 AuraEffect* counter = GetEffect(EFFECT_1);
734 if (!counter)
735 return;
736
737 // Count spell criticals in a row in second aura
738 if (eventInfo.GetHitMask() & PROC_HIT_CRITICAL)
739 {
740 counter->SetAmount(counter->GetAmount() * 2);
741 if (counter->GetAmount() < 100) // not enough
742 return;
743
744 // roll chance
745 if (!roll_chance_i(aurEff->GetAmount()))
746 return;
747
748 Unit* caster = eventInfo.GetActor();
749 caster->CastSpell(caster, SPELL_MAGE_HOT_STREAK_PROC, aurEff);
750 }
751
752 // reset counter
753 counter->SetAmount(25);
754 }
755
760};
761
762// -11426 - Ice Barrier
764{
766
767 bool Validate(SpellInfo const* /*spellInfo*/) override
768 {
770 }
771
772 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated)
773 {
774 canBeRecalculated = false;
775 if (Unit* caster = GetCaster())
776 {
777 // +80.68% from sp bonus
778 float bonus = 0.8068f;
779
780 bonus *= caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask());
781
782 // Glyph of Ice Barrier: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :)
783 // Glyph of Ice Barrier is only applied at the spell damage bonus because it was already applied to the base value in CalculateSpellDamage
784 bonus = caster->ApplyEffectModifiers(GetSpellInfo(), aurEff->GetEffIndex(), bonus);
785
786 bonus *= caster->CalculateSpellpowerCoefficientLevelPenalty(GetSpellInfo());
787
788 amount += int32(bonus);
789 }
790 }
791
792 void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
793 {
794 // Shattered Barrier
795 // Procs only if removed by damage.
796 if (aurEff->GetAmount() <= 0)
797 if (Unit* caster = GetCaster())
798 if (AuraEffect* dummy = caster->GetDummyAuraEffect(SPELLFAMILY_MAGE, SPELL_ICON_MAGE_SHATTERED_BARRIER, EFFECT_0))
799 if (roll_chance_i(dummy->GetSpellInfo()->ProcChance))
800 caster->CastSpell(GetTarget(), SPELL_MAGE_SHATTERED_BARRIER, aurEff);
801 }
802
809};
810
811// 45438 - Ice Block
813{
815
816 bool Validate(SpellInfo const* spellInfo) override
817 {
818 return ValidateSpellInfo({ spellInfo->ExcludeCasterAuraSpell });
819 }
820
822 {
823 GetCaster()->CastSpell(nullptr, GetSpellInfo()->ExcludeCasterAuraSpell, true);
824 }
825
830};
831
832// -11119 - Ignite
834{
836
837 bool Validate(SpellInfo const* /*spellInfo*/) override
838 {
840 }
841
842 bool CheckProc(ProcEventInfo& eventInfo)
843 {
844 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
845 return damageInfo && damageInfo->GetDamage();
846 }
847
848 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
849 {
851
852 SpellInfo const* igniteDot = sSpellMgr->AssertSpellInfo(SPELL_MAGE_IGNITE);
853 int32 pct = 8 * GetSpellInfo()->GetRank();
854
855 ASSERT(igniteDot->GetMaxTicks() > 0);
856 int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), pct) / igniteDot->GetMaxTicks());
857
858 CastSpellExtraArgs args(aurEff);
859 args.AddSpellBP0(amount);
860 eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), SPELL_MAGE_IGNITE, args);
861 }
862
868};
869
870// -44457 - Living Bomb
872{
874
875 bool Validate(SpellInfo const* spell) override
876 {
877 return ValidateSpellInfo({ static_cast<uint32>(spell->GetEffect(EFFECT_1).CalcValue()) });
878 }
879
880 void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
881 {
883 if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE)
884 return;
885
886 if (Unit* caster = GetCaster())
887 caster->CastSpell(GetTarget(), uint32(aurEff->GetAmount()), aurEff);
888 }
889
894};
895
896// -29441 - Magic Absorption
898{
900
901 bool Validate(SpellInfo const* /*spellInfo*/) override
902 {
904 }
905
906 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
907 {
909
910 Unit* caster = eventInfo.GetActionTarget();
911 CastSpellExtraArgs args(aurEff);
912 args.AddSpellBP0(CalculatePct(caster->GetMaxPower(POWER_MANA), aurEff->GetAmount()));
913 caster->CastSpell(caster, SPELL_MAGE_MAGIC_ABSORPTION_MANA, args);
914 }
915
920};
921
922// -1463 - Mana Shield
924{
926
927 bool Validate(SpellInfo const* spellInfo) override
928 {
931 }
932
933 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
934 {
935 canBeRecalculated = false;
936 if (Unit* caster = GetCaster())
937 {
938 // +80.53% from sp bonus
939 float bonus = 0.8053f;
940
941 bonus *= caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask());
942 bonus *= caster->CalculateSpellpowerCoefficientLevelPenalty(GetSpellInfo());
943
944 amount += int32(bonus);
945 }
946 }
947
948 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
949 {
950 Unit* caster = eventInfo.GetActionTarget();
951 caster->CastSpell(caster, SPELL_MAGE_ARCANE_SURGE, aurEff);
952 }
953
961};
962
963// -29074 - Master of Elements
965{
967
968 bool Validate(SpellInfo const* /*spellInfo*/) override
969 {
971 }
972
973 bool CheckProc(ProcEventInfo& eventInfo)
974 {
975 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
976 if (!damageInfo || !damageInfo->GetSpellInfo())
977 return false;
978
979 return true;
980 }
981
982 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
983 {
985
986 int32 mana = eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), eventInfo.GetDamageInfo()->GetSchoolMask());
987 mana = CalculatePct(mana, aurEff->GetAmount());
988
989 if (mana > 0)
990 {
991 CastSpellExtraArgs args(aurEff);
992 args.AddSpellBP0(mana);
994 }
995 }
996
1002};
1003
1004// 55342 - Mirror Image
1006{
1008
1009 bool Validate(SpellInfo const* spellInfo) override
1010 {
1011 return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_2).TriggerSpell });
1012 }
1013
1014 void PeriodicTick(AuraEffect const* aurEff)
1015 {
1016 // Set name of summons to name of caster
1017 GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, true);
1018 }
1019
1024};
1025
1026// -44404 - Missile Barrage
1028{
1030
1031 bool CheckProc(ProcEventInfo& eventInfo)
1032 {
1033 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1034 if (!spellInfo)
1035 return false;
1036
1037 // Arcane Blast - full chance
1038 if (spellInfo->SpellFamilyFlags[0] & 0x20000000)
1039 return true;
1040
1041 // Rest of spells have half chance
1042 return roll_chance_i(50);
1043 }
1044
1049};
1050
1051// 44401 - Missile Barrage
1053{
1055
1056 bool Validate(SpellInfo const* /*spellInfo*/) override
1057 {
1059 }
1060
1061 bool CheckProc(ProcEventInfo& eventInfo)
1062 {
1063 Unit* caster = eventInfo.GetActor();
1064 // Prevent double proc for Arcane missiles
1065 if (caster == eventInfo.GetActionTarget())
1066 return false;
1067
1068 // Proc chance is unknown, we'll just use dummy aura amount
1069 if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_MAGE_T8_4P_BONUS, EFFECT_0))
1070 if (roll_chance_i(aurEff->GetAmount()))
1071 return false;
1072
1073 return true;
1074 }
1075
1076 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1077 {
1078 Unit* caster = GetTarget();
1079 if (caster->HasAura(SPELL_MAGE_T10_2P_BONUS))
1081 if (spell_mage_arcane_missiles* missiles = aura->GetScript<spell_mage_arcane_missiles>(ScriptName))
1082 missiles->AllowT10Proc();
1083 }
1084
1090
1091public:
1092 static char constexpr const ScriptName[] = "spell_mage_arcane_missiles";
1093};
1094
1096{
1098};
1099
1101// 32826 - Polymorph (Visual)
1103{
1104 public:
1105 spell_mage_polymorph_cast_visual() : SpellScriptLoader("spell_mage_polymorph_visual") { }
1106
1108 {
1110
1111 static const uint32 PolymorphForms[6];
1112
1113 bool Validate(SpellInfo const* /*spellInfo*/) override
1114 {
1116 }
1117
1118 void HandleDummy(SpellEffIndex /*effIndex*/)
1119 {
1120 if (Unit* target = GetCaster()->FindNearestCreature(NPC_AUROSALIA, 30.0f))
1121 if (target->GetTypeId() == TYPEID_UNIT)
1122 target->CastSpell(target, PolymorphForms[urand(0, 5)], true);
1123 }
1124
1129 };
1130
1131 SpellScript* GetSpellScript() const override
1132 {
1134 }
1135};
1136
1146
1147// 31687 - Summon Water Elemental
1149{
1151
1161
1162 void HandleDummy(SpellEffIndex /*effIndex*/)
1163 {
1164 Unit* caster = GetCaster();
1165 // Glyph of Eternal Water
1168 else
1170 }
1171
1176};
1177
1179{
1214}
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
#define ASSERT
Definition Errors.h:68
@ TYPEID_UNIT
Definition ObjectGuid.h:38
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:42
bool roll_chance_i(int chance)
Definition Random.h:59
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ EFFECT_2
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_KNOCK_BACK
@ SPELL_SCHOOL_MASK_FROST
@ MECHANIC_INTERRUPT
@ MECHANIC_SILENCE
@ SPELLFAMILY_MAGE
@ POWER_MANA
AuraRemoveMode
@ AURA_REMOVE_BY_EXPIRE
@ AURA_REMOVE_BY_ENEMY_SPELL
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_MANA_SHIELD
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_HASTE_SPELLS
@ SPELL_AURA_ADD_FLAT_MODIFIER
@ SPELL_AURA_MOD_SPELL_CRIT_CHANCE
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOD_DECREASE_SPEED
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_PERIODIC_LEECH
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_OVERRIDE_CLASS_SCRIPTS
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ PROC_HIT_CRITICAL
Definition SpellMgr.h:221
#define sSpellMgr
Definition SpellMgr.h:738
#define AuraProcFn(F)
#define AuraEffectManaShieldFn(F, I)
#define AuraEffectProcFn(F, I, N)
#define SpellEffectFn(F, I, N)
#define AuraEffectCalcAmountFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraEffectAbsorbFn(F, I)
#define AuraEffectApplyFn(F, I, N, M)
#define AuraCheckProcFn(F)
#define SpellHitFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
T CalculatePct(T base, U pct)
Definition Util.h:71
AuraRemoveMode GetRemoveMode() const
Definition SpellAuras.h:80
SpellEffIndex GetEffIndex() const
SpellEffectInfo const & GetSpellEffectInfo() const
void SetAmount(int32 amount)
int32 GetAmount() const
HookList< EffectManaShieldHandler > AfterEffectManaShield
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectPeriodicHandler > OnEffectPeriodic
SpellInfo const * GetSpellInfo() const
HookList< EffectApplyHandler > AfterEffectApply
HookList< EffectAbsorbHandler > AfterEffectAbsorb
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Unit * GetCaster() const
AuraEffect * GetEffect(uint8 effIndex) const
HookList< EffectAbsorbHandler > OnEffectAbsorb
Unit * GetTarget() const
HookList< CheckProcHandler > DoCheckProc
HookList< EffectProcHandler > OnEffectProc
HookList< AuraProcHandler > OnProc
uint32 GetId() const
void AbsorbDamage(uint32 amount)
Definition Unit.cpp:199
SpellInfo const * GetSpellInfo() const
Definition Unit.h:460
SpellSchoolMask GetSchoolMask() const
Definition Unit.h:461
uint32 GetDamage() const
Definition Unit.h:464
static ObjectGuid const Empty
Definition ObjectGuid.h:140
TypeID GetTypeId() const
Definition Object.h:93
uint32 GetHitMask() const
Definition Unit.h:514
Unit * GetActionTarget() const
Definition Unit.h:509
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:268
Unit * GetActor()
Definition Unit.h:508
DamageInfo * GetDamageInfo() const
Definition Unit.h:519
uint32 TriggerSpell
Definition SpellInfo.h:228
void ResetCooldowns(Predicate predicate, bool update=false)
uint32 GetMaxTicks() const
flag96 SpellFamilyFlags
Definition SpellInfo.h:357
uint32 Id
Definition SpellInfo.h:289
uint8 GetRank() const
uint32 GetRecoveryTime() const
SpellSchoolMask GetSchoolMask() const
int32 CalcPowerCost(WorldObject const *caster, SpellSchoolMask schoolMask, Spell *spell=nullptr) const
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:483
uint32 SpellIconID
Definition SpellInfo.h:349
uint32 ExcludeCasterAuraSpell
Definition SpellInfo.h:314
uint32 SpellFamilyName
Definition SpellInfo.h:356
Unit * GetCaster() const
HookList< HitHandler > AfterHit
HookList< EffectHandler > OnEffectHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
HookList< EffectHandler > OnEffectHitTarget
SpellInfo const * GetSpellInfo() const
Definition Unit.h:769
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3765
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4439
Aura * GetAuraOfRankedSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4457
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4359
bool IsAlive() const
Definition Unit.h:1234
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
uint32 GetMaxPower(Powers power) const
Definition Unit.h:936
AuraEffect * GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4373
void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3800
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
SpellHistory * GetSpellHistory()
Definition Unit.h:1484
uint32 GetCreateMana() const
Definition Unit.h:1452
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
PrepareAuraScript(spell_mage_arcane_missiles)
void OnRemove(AuraEffect const *aurEff, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_mage_arcane_potency)
bool CheckProc(ProcEventInfo &eventInfo)
void HandleKnockBack(SpellEffIndex effIndex)
PrepareSpellScript(spell_mage_blast_wave)
void Register() override
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_mage_blazing_speed)
void Register() override
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_mage_burning_determination)
bool CheckProc(ProcEventInfo &eventInfo)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
void Register() override
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_mage_burnout)
void HandleDummy(SpellEffIndex)
PrepareSpellScript(spell_mage_cold_snap)
void Register() override
bool Load() override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_mage_combustion_proc)
void Register() override
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
PrepareAuraScript(spell_mage_combustion)
bool CheckProc(ProcEventInfo &eventInfo)
PrepareAuraScript(spell_mage_dragon_breath)
void Register() override
PrepareAuraScript(spell_mage_empowered_fire)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
void HandleDummy(AuraEffect const *, ProcEventInfo &eventInfo)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_mage_fingers_of_frost)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &canBeRecalculated)
void Absorb(AuraEffect *aurEff, DamageInfo &dmgInfo, uint32 &absorbAmount)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_mage_fire_frost_ward)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &)
bool CheckProc(ProcEventInfo &)
void Register() override
PrepareAuraScript(spell_mage_focus_magic)
bool Validate(SpellInfo const *) override
void ApplyPermafrost(AuraEffect const *aurEff, AuraEffectHandleModes)
PrepareAuraScript(spell_mage_frostfire_bolt)
void RemovePermafrost(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
void HandleProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_mage_gen_extra_effects)
void HandleProc(AuraEffect const *, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_mage_glyph_of_ice_block)
PrepareAuraScript(spell_mage_glyph_of_icy_veins)
void HandleProc(AuraEffect const *, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_mage_glyph_of_polymorph)
void HandleProc(AuraEffect const *, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_mage_hot_streak)
void Register() override
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void Register() override
void AfterRemove(AuraEffect const *aurEff, AuraEffectHandleModes)
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &canBeRecalculated)
PrepareAuraScript(spell_mage_ice_barrier)
bool Validate(SpellInfo const *spellInfo) override
void Register() override
PrepareSpellScript(spell_mage_ice_block)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
void Register() override
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_mage_ignite)
void Register() override
PrepareAuraScript(spell_mage_imp_blizzard)
bool Validate(SpellInfo const *) override
void HandleChill(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
void Register() override
PrepareAuraScript(spell_mage_imp_mana_gems)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void Trigger(AuraEffect *aurEff, DamageInfo &, uint32 &absorbAmount)
PrepareAuraScript(spell_mage_living_bomb)
void Register() override
void AfterRemove(AuraEffect const *aurEff, AuraEffectHandleModes)
bool Validate(SpellInfo const *spell) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_mage_magic_absorption)
void Register() override
void CalculateAmount(AuraEffect const *, int32 &amount, bool &canBeRecalculated)
bool Validate(SpellInfo const *spellInfo) override
PrepareAuraScript(spell_mage_mana_shield)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_mage_master_of_elements)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
void Register() override
PrepareAuraScript(spell_mage_mirror_image)
void PeriodicTick(AuraEffect const *aurEff)
bool Validate(SpellInfo const *spellInfo) override
bool CheckProc(ProcEventInfo &eventInfo)
PrepareAuraScript(spell_mage_missile_barrage_proc)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
static char constexpr const ScriptName[]
PrepareAuraScript(spell_mage_missile_barrage)
bool CheckProc(ProcEventInfo &eventInfo)
SpellScript * GetSpellScript() const override
PrepareSpellScript(spell_mage_summon_water_elemental)
bool Validate(SpellInfo const *) override
void AddSC_mage_spell_scripts()
MageSpellIcons
@ SPELL_ICON_MAGE_PRESENCE_OF_MIND
@ SPELL_ICON_MAGE_SHATTERED_BARRIER
@ SPELL_ICON_MAGE_CLEARCASTING
@ SPELL_ICON_MAGE_LIVING_BOMB
@ SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY
@ SPELL_MAGE_T10_2P_BONUS
@ SPELL_MAGE_FROST_WARDING_R1
@ SPELL_MAGE_MANA_SURGE
@ SPELL_MAGE_WORGEN_FORM
@ SPELL_MAGE_ARCANE_POTENCY_RANK_1
@ SPELL_MAGE_PERMAFROST_AURA
@ SPELL_MAGE_FINGERS_OF_FROST_AURASTATE_AURA
@ SPELL_MAGE_T8_4P_BONUS
@ SPELL_MAGE_INCANTERS_ABSORBTION_R1
@ SPELL_MAGE_COMBUSTION
@ SPELL_MAGE_ARCANE_SURGE
@ SPELL_MAGE_COLD_SNAP
@ SPELL_MAGE_EMPOWERED_FIRE_PROC
@ SPELL_MAGE_IGNITE
@ SPELL_MAGE_FOCUS_MAGIC_PROC
@ SPELL_MAGE_GIRAFFE_FORM
@ SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE
@ SPELL_MAGE_ARCANE_POTENCY_RANK_2
@ SPELL_MAGE_ARCANE_MISSILES_R1
@ SPELL_MAGE_SHATTERED_BARRIER
@ SPELL_MAGE_BURNOUT
@ SPELL_MAGE_DRAGONHAWK_FORM
@ SPELL_MAGE_SQUIRREL_FORM
@ SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT
@ SPELL_MAGE_T10_2P_BONUS_EFFECT
@ SPELL_MAGE_GLYPH_OF_BLAST_WAVE
@ SPELL_MAGE_COMBUSTION_PROC
@ SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED
@ SPELL_MAGE_SERPENT_FORM
@ SPELL_MAGE_CHILLED
@ SPELL_MAGE_GLYPH_OF_ETERNAL_WATER
@ SPELL_MAGE_MISSILE_BARRAGE
@ SPELL_MAGE_HOT_STREAK_PROC
@ SPELL_MAGE_BLAZING_SPEED
@ SPELL_MAGE_FROST_WARDING_TRIGGERED
@ SPELL_MAGE_SHEEP_FORM
@ SPELL_MAGE_MAGIC_ABSORPTION_MANA
SilvermoonPolymorph
@ NPC_AUROSALIA
CastSpellExtraArgs & AddSpellBP0(int32 val)