TrinityCore
Loading...
Searching...
No Matches
spell_paladin.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_PALADIN and SPELLFAMILY_GENERIC spells used by paladin players.
20 * Ordered alphabetically using scriptname.
21 * Scriptnames of files in this file should be prefixed with "spell_pal_".
22 */
23
24#include "ScriptMgr.h"
25#include "Containers.h"
26#include "GameTime.h"
27#include "Group.h"
28#include "Player.h"
29#include "Random.h"
30#include "SpellAuraEffects.h"
31#include "SpellHistory.h"
32#include "SpellMgr.h"
33#include "SpellScript.h"
34
36{
40
45
50
56
60
62
66
68
73
76
78
80
83
85
89
94
97
101
103
105
113
118
123
125
128
132
138
144
145// -31850 - Ardent Defender
147{
149
152
153 enum Spell
154 {
156 };
157
158 bool Validate(SpellInfo const* /*spellInfo*/) override
159 {
161 }
162
163 bool Load() override
164 {
167 return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
168 }
169
170 void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
171 {
172 // Set absorbtion amount to unlimited
173 amount = -1;
174 }
175
176 void Absorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
177 {
178 Unit* victim = GetTarget();
179 int32 remainingHealth = victim->GetHealth() - dmgInfo.GetDamage();
180 uint32 allowedHealth = victim->CountPctFromMaxHealth(35);
181 // If damage kills us
182 if (remainingHealth <= 0 && !victim->GetSpellHistory()->HasCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL))
183 {
184 // Cast healing spell, completely avoid damage
185 absorbAmount = dmgInfo.GetDamage();
186
187 float defenseSkillValue = victim->GetDefenseSkillValue();
188 // Max heal when defense skill denies critical hits from raid bosses
189 // Formula: max defense at level + 140 (rating from gear)
190 float reqDefForMaxHeal = victim->GetMaxSkillValueForLevel() + 140.0f;
191 float defenseFactor = std::min(1.0f, defenseSkillValue / reqDefForMaxHeal);
192
193 CastSpellExtraArgs args(aurEff);
194 args.AddSpellBP0(victim->CountPctFromMaxHealth(lroundf(_healPct * defenseFactor)));
195 victim->CastSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, args);
196 victim->GetSpellHistory()->AddCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, std::chrono::minutes(2));
197 }
198 else if (remainingHealth < int32(allowedHealth))
199 {
200 // Reduce damage that brings us under 35% (or full damage if we are already under 35%) by x%
201 uint32 damageToReduce = (victim->GetHealth() < allowedHealth)
202 ? dmgInfo.GetDamage()
203 : allowedHealth - remainingHealth;
204 absorbAmount = CalculatePct(damageToReduce, _absorbPct);
205 }
206 }
207
213};
214
215// 31821 - Aura Mastery
241
242// 64364 - Aura Mastery Immune
262
263// 31884 - Avenging Wrath
265{
267
278
279 void HandleApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
280 {
281 Unit* target = GetTarget();
283 {
284 CastSpellExtraArgs args(sanctifiedWrathAurEff);
285 args.AddSpellMod(SPELLVALUE_BASE_POINT0, sanctifiedWrathAurEff->GetAmount())
286 .AddSpellMod(SPELLVALUE_BASE_POINT1, sanctifiedWrathAurEff->GetAmount());
287 target->CastSpell(target, SPELL_PALADIN_SANCTIFIED_WRATH, args);
288 }
289
290 target->CastSpell(nullptr, SPELL_PALADIN_AVENGING_WRATH_MARKER, aurEff);
291
292 // Blizz seems to just apply aura without bothering to cast
294 }
295
300
306};
307
308// 53563 - Beacon of Light
310{
312
313 bool Validate(SpellInfo const* spellInfo) override
314 {
315 return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
316 }
317
318 void PeriodicTick(AuraEffect const* aurEff)
319 {
321
322 // area aura owner casts the spell
323 GetAura()->GetUnitOwner()->CastSpell(GetTarget(), aurEff->GetSpellEffectInfo().TriggerSpell, { aurEff, GetAura()->GetUnitOwner()->GetGUID() });
324 }
325
330};
331
332// 37877 - Blessing of Faith
334{
336
347
348 void HandleDummy(SpellEffIndex /*effIndex*/)
349 {
350 if (Unit* unitTarget = GetHitUnit())
351 {
352 uint32 spell_id = 0;
353 switch (unitTarget->GetClass())
354 {
355 case CLASS_DRUID:
357 break;
358 case CLASS_PALADIN:
360 break;
361 case CLASS_PRIEST:
363 break;
364 case CLASS_SHAMAN:
366 break;
367 default:
368 return; // ignore for non-healing classes
369 }
370 Unit* caster = GetCaster();
371 caster->CastSpell(caster, spell_id, true);
372 }
373 }
374
379};
380
381// 20911 - Blessing of Sanctuary
382// 25899 - Greater Blessing of Sanctuary
384{
386
387 bool Validate(SpellInfo const* /*spellInfo*/) override
388 {
389 return ValidateSpellInfo(
390 {
393 });
394 }
395
396 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
397 {
398 Unit* target = GetTarget();
399 if (Unit* caster = GetCaster())
400 caster->CastSpell(target, SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF, true);
401 }
402
403 void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
404 {
405 Unit* target = GetTarget();
407 }
408
409 bool CheckProc(ProcEventInfo& /*eventInfo*/)
410 {
411 return GetTarget()->GetPowerType() == POWER_MANA;
412 }
413
419
427};
428
429// -31871 - Divine Purpose
451
452// 64205 - Divine Sacrifice
454{
456
459
460 bool Load() override
461 {
462 if (Unit* caster = GetCaster())
463 {
464 if (caster->GetTypeId() == TYPEID_PLAYER)
465 {
466 if (caster->ToPlayer()->GetGroup())
467 groupSize = caster->ToPlayer()->GetGroup()->GetMembersCount();
468 else
469 groupSize = 1;
470 }
471 else
472 return false;
473
474 remainingAmount = (caster->CountPctFromMaxHealth(GetEffectInfo(EFFECT_2).CalcValue(caster)) * groupSize);
476 return true;
477 }
478 return false;
479 }
480
481 void Split(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& splitAmount)
482 {
483 // break when splitted everything it could, or if the casters hp drops below 20%
484 if (remainingAmount >= splitAmount)
485 remainingAmount -= splitAmount;
486 else
487 {
488 splitAmount = remainingAmount;
489 Remove();
490 return;
491 }
492
493 if (Unit* caster = GetCaster())
494 if (caster->HealthBelowPct(minHpPct))
495 Remove();
496 }
497
502};
503
504// 53385 - Divine Storm
506{
508
510
511 bool Validate(SpellInfo const* /*spellInfo*/) override
512 {
514 }
515
516 bool Load() override
517 {
519 return true;
520 }
521
523 {
524 Unit* caster = GetCaster();
527 caster->CastSpell(caster, SPELL_PALADIN_DIVINE_STORM_DUMMY, args);
528 }
529
534};
535
536// 54171 - Divine Storm (Dummy)
569
570// 33695 - Exorcism and Holy Wrath Damage
572{
574
575 void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
576 {
577 if (!spellMod)
578 {
579 spellMod = new SpellModifier(aurEff->GetBase());
580 spellMod->op = SPELLMOD_DAMAGE;
581 spellMod->type = SPELLMOD_FLAT;
582 spellMod->spellId = GetId();
583 spellMod->mask[1] = 0x200002;
584 }
585
586 spellMod->value = aurEff->GetAmount();
587 }
588
593};
594
595// -9799 - Eye for an Eye
597{
599
600 bool Validate(SpellInfo const* /*spellInfo*/) override
601 {
603 }
604
605 bool CheckProc(ProcEventInfo& eventInfo)
606 {
607 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
608 return damageInfo && damageInfo->GetDamage();
609 }
610
611 void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
612 {
614
615 // return damage % to attacker but < 50% own total health
616 int32 damage = std::min(CalculatePct(static_cast<int32>(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()), static_cast<int32>(eventInfo.GetActionTarget()->GetMaxHealth()) / 2);
617 CastSpellExtraArgs args(aurEff);
618 args.AddSpellBP0(damage);
620 }
621
627};
628
629// 54939 - Glyph of Divinity
631{
633
634 bool Validate(SpellInfo const* /*spellInfo*/) override
635 {
637 }
638
639 void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
640 {
641 // Lay on Hands (Rank 1) does not have mana effect
642 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
643 if (!spellInfo || !spellInfo->GetEffect(EFFECT_1).IsEffect(SPELL_EFFECT_ENERGIZE))
644 return;
645
646 Unit* caster = eventInfo.GetActor();
647 if (caster == eventInfo.GetActionTarget())
648 return;
649
650 CastSpellExtraArgs args(aurEff);
652 caster->CastSpell(nullptr, SPELL_PALADIN_GLYPH_OF_DIVINITY_PROC, args);
653 }
654
659};
660
661// 54968 - Glyph of Holy Light
663{
665
666 void FilterTargets(std::list<WorldObject*>& targets)
667 {
668 uint32 const maxTargets = GetSpellInfo()->MaxAffectedTargets;
669
670 targets.remove(GetCaster());
671 if (targets.size() > maxTargets)
672 {
673 targets.sort(Trinity::HealthPctOrderPred());
674 targets.resize(maxTargets);
675 }
676 }
677
682};
683
684// 54937 - Glyph of Holy Light (dummy aura)
686{
688
689 bool Validate(SpellInfo const* /*spellInfo*/) override
690 {
692 }
693
694 bool CheckProc(ProcEventInfo& eventInfo)
695 {
696 HealInfo* healInfo = eventInfo.GetHealInfo();
697 return healInfo && healInfo->GetHeal();
698 }
699
700 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
701 {
703
704 HealInfo* healInfo = eventInfo.GetHealInfo();
705
706 uint32 basePoints = healInfo->GetSpellInfo()->GetEffect(EFFECT_0).BasePoints + healInfo->GetSpellInfo()->GetEffect(EFFECT_0).DieSides;
707 uint32 healAmount;
708 if (healInfo->GetEffectiveHeal() >= basePoints)
709 healAmount = healInfo->GetEffectiveHeal();
710 else
711 healAmount = healInfo->GetHeal();
712
713 CastSpellExtraArgs args(aurEff);
714 args.AddSpellBP0(CalculatePct(healAmount, aurEff->GetAmount()));
716 }
717
723};
724
725// 63521 - Guarded by The Light
727{
729
730 bool Validate(SpellInfo const* /*spellInfo*/) override
731 {
733 }
734
736 {
737 // Divine Plea
738 if (Aura* aura = GetCaster()->GetAura(SPELL_PALADIN_DIVINE_PLEA))
739 aura->RefreshDuration();
740 }
741
746};
747
748// 6940 - Hand of Sacrifice
750{
752
754
755 bool Load() override
756 {
757 if (Unit* caster = GetCaster())
758 {
759 remainingAmount = caster->GetMaxHealth();
760 return true;
761 }
762 return false;
763 }
764
765 void Split(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& splitAmount)
766 {
767 if (remainingAmount >= splitAmount)
768 remainingAmount -= splitAmount;
769 else
770 {
771 splitAmount = remainingAmount;
772 Remove();
773 }
774 }
775
780};
781
782// 1038 - Hand of Salvation
784{
786
787 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
788 {
789 if (Unit* caster = GetCaster())
790 {
791 // Glyph of Salvation
792 if (caster->GetGUID() == GetUnitOwner()->GetGUID())
793 if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_PALADIN_GLYPH_OF_SALVATION, EFFECT_0))
794 amount -= aurEff->GetAmount();
795 }
796 }
797
802};
803
804// -20335 - Heart of the Crusader
806{
808
809 bool Validate(SpellInfo const* /*spellInfo*/) override
810 {
812 }
813
814 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
815 {
817
818 uint32 spellId = sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HEART_OF_THE_CRUSADER_EFF_R1, GetSpellInfo()->GetRank());
819 eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), spellId, aurEff);
820 }
821
826};
827
828// -20473 - Holy Shock
830{
832
833 bool Validate(SpellInfo const* spellInfo) override
834 {
835 SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_SHOCK_R1);
836 if (!firstRankSpellInfo)
837 return false;
838
839 // can't use other spell than holy shock due to spell_ranks dependency
840 if (!spellInfo->IsRankOf(firstRankSpellInfo))
841 return false;
842
843 uint8 rank = spellInfo->GetRank();
844 if (!sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank, true))
845 return false;
846
847 return true;
848 }
849
850 void HandleDummy(SpellEffIndex /*effIndex*/)
851 {
852 Unit* caster = GetCaster();
853 if (Unit* unitTarget = GetHitUnit())
854 {
855 uint8 rank = GetSpellInfo()->GetRank();
856 if (caster->IsFriendlyTo(unitTarget))
857 caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank), true);
858 else
859 caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank), true);
860 }
861 }
862
864 {
865 Unit* caster = GetCaster();
866 if (Unit* target = GetExplTargetUnit())
867 {
868 if (!caster->IsFriendlyTo(target))
869 {
870 if (!caster->IsValidAttackTarget(target))
872
873 if (!caster->isInFront(target))
875 }
876 }
877 else
879 return SPELL_CAST_OK;
880 }
881
887};
888
889// -20210 - Illumination
891{
893
894 bool Validate(SpellInfo const* /*spellInfo*/) override
895 {
896 return ValidateSpellInfo(
897 {
901 });
902 }
903
904 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
905 {
907
908 // this script is valid only for the Holy Shock procs of illumination
909 if (eventInfo.GetHealInfo() && eventInfo.GetHealInfo()->GetSpellInfo())
910 {
911 SpellInfo const* originalSpell = nullptr;
912
913 // if proc comes from the Holy Shock heal, need to get mana cost of original spell - else it's the original heal itself
914 if (eventInfo.GetHealInfo()->GetSpellInfo()->SpellFamilyFlags[1] & 0x00010000)
915 originalSpell = sSpellMgr->GetSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1, eventInfo.GetHealInfo()->GetSpellInfo()->GetRank()));
916 else
917 originalSpell = eventInfo.GetHealInfo()->GetSpellInfo();
918
919 if (originalSpell && aurEff->GetSpellInfo())
920 {
921 Unit* target = eventInfo.GetActor(); // Paladin is the target of the energize
922 uint32 bp = CalculatePct(originalSpell->CalcPowerCost(target, originalSpell->GetSchoolMask()), aurEff->GetSpellInfo()->GetEffect(EFFECT_1).CalcValue());
923 CastSpellExtraArgs args(aurEff);
924 args.AddSpellBP0(bp);
925 target->CastSpell(target, SPELL_PALADIN_ILLUMINATION_ENERGIZE, args);
926 }
927 }
928 }
929
934};
935
936// 498 - Divine Protection
937// 642 - Divine Shield
938// -1022 - Hand of Protection
940{
942
943 bool Validate(SpellInfo const* /*spellInfo*/) override
944 {
945 return ValidateSpellInfo(
946 {
950 });
951 }
952
954 {
955 Unit* caster = GetCaster();
956
957 // for HoP
958 Unit* target = GetExplTargetUnit();
959 if (!target)
960 target = caster;
961
962 // "Cannot be used within $61987d. of using Avenging Wrath."
965
966 return SPELL_CAST_OK;
967 }
968
970 {
971 if (Unit* target = GetHitUnit())
972 {
973 // Blizz seems to just apply aura without bothering to cast
977 }
978 }
979
985};
986
987// Maybe this is incorrect
988// These spells should always be cast on login, regardless of whether the player has the talent or not
989
990// -20254 - Improved Concentration Aura
991// -20138 - Improved Devotion Aura
992// 31869 - Sanctified Retribution
993// -53379 - Swift Retribution
995{
997
998public:
1000
1001 bool Validate(SpellInfo const* /*spellInfo*/) override
1002 {
1003 return ValidateSpellInfo(
1004 {
1005 _spellId,
1008 });
1009 }
1010
1011 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1012 {
1013 Unit* target = GetTarget();
1014 GetTarget()->RemoveOwnedAura(_spellId, GetCasterGUID()); // need to remove to reapply spellmods
1015 target->CastSpell(target, _spellId, true);
1016 }
1017
1018 void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1019 {
1020 uint32 spellId = GetSpellInfo()->GetFirstRankSpell()->Id;
1021
1024 return;
1025
1027 }
1028
1034
1035private:
1037};
1038
1039// -20234 - Improved Lay on Hands
1041{
1043
1044 bool Validate(SpellInfo const* spellInfo) override
1045 {
1046 return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
1047 }
1048
1049 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1050 {
1052 eventInfo.GetActionTarget()->CastSpell(eventInfo.GetActionTarget(), aurEff->GetSpellEffectInfo().TriggerSpell, { aurEff, GetTarget()->GetGUID() });
1053 }
1054
1059};
1060
1061// -53569 - Infusion of Light
1063{
1065
1066 bool Validate(SpellInfo const* /*spellInfo*/) override
1067 {
1068 return ValidateSpellInfo(
1069 {
1073 });
1074 }
1075
1076 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1077 {
1078 if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
1079 {
1080 // Flash of Light HoT on Flash of Light when Sacred Shield active
1081 if (spellInfo->SpellFamilyFlags[0] & 0x40000000 && spellInfo->SpellIconID == 242)
1082 {
1084
1085 HealInfo* healInfo = eventInfo.GetHealInfo();
1086 if (!healInfo || !healInfo->GetHeal())
1087 return;
1088
1089 Unit* procTarget = eventInfo.GetActionTarget();
1090 if (procTarget && procTarget->HasAura(SPELL_PALADIN_SACRED_SHIELD))
1091 {
1092 Unit* target = GetTarget();
1093 int32 duration = sSpellMgr->AssertSpellInfo(SPELL_PALADIN_FLASH_OF_LIGHT_PROC)->GetMaxDuration() / 1000;
1095 ASSERT(duration > 0);
1096
1097 int32 bp0 = CalculatePct(healInfo->GetHeal() / duration, pct);
1098
1099 // Item - Paladin T9 Holy 4P Bonus
1100 if (AuraEffect const* bonus = target->GetAuraEffect(SPELL_PALADIN_T9_HOLY_4P_BONUS, 0))
1101 AddPct(bp0, bonus->GetAmount());
1102
1103 CastSpellExtraArgs args(aurEff);
1104 args.AddSpellBP0(bp0);
1105 target->CastSpell(procTarget, SPELL_PALADIN_FLASH_OF_LIGHT_PROC, args);
1106 }
1107 }
1108 // but should not proc on non-critical Holy Shocks
1109 else if ((spellInfo->SpellFamilyFlags[0] & 0x200000 || spellInfo->SpellFamilyFlags[1] & 0x10000) && !(eventInfo.GetHitMask() & PROC_HIT_CRITICAL))
1111 }
1112 }
1113
1118};
1119
1120// 37705 - Healing Discount
1141
1142// 40470 - Paladin Tier 6 Trinket
1144{
1146
1147 bool Validate(SpellInfo const* /*spellInfo*/) override
1148 {
1149 return ValidateSpellInfo(
1150 {
1153 });
1154 }
1155
1156 bool CheckProc(ProcEventInfo& eventInfo)
1157 {
1158 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1159 if (!spellInfo)
1160 return false;
1161
1162 // Holy Light & Flash of Light
1163 if (spellInfo->SpellFamilyFlags[0] & 0xC0000000)
1164 {
1165 if (!roll_chance_i(15))
1166 return false;
1167
1169 return true;
1170 }
1171 // Judgements
1172 else if (spellInfo->SpellFamilyFlags[0] & 0x00800000)
1173 {
1174 if (!roll_chance_i(50))
1175 return false;
1176
1178 return true;
1179 }
1180
1181 return false;
1182 }
1183
1184 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1185 {
1187 eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), _triggeredSpellId, aurEff);
1188 }
1189
1195
1197};
1198
1199// 53407 - Judgement of Justice
1200// 20271 - Judgement of Light
1201// 53408 - Judgement of Wisdom
1203{
1205
1206public:
1208
1209private:
1210 bool Validate(SpellInfo const* /*spellInfo*/) override
1211 {
1212 return ValidateSpellInfo(
1213 {
1215 _spellId
1216 });
1217 }
1218
1220 {
1222
1223 // some seals have SPELL_AURA_DUMMY in EFFECT_2
1225 for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
1226 {
1227 if ((*i)->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_SEAL && (*i)->GetEffIndex() == EFFECT_2)
1228 {
1229 if (sSpellMgr->GetSpellInfo((*i)->GetAmount()))
1230 {
1231 spellId2 = (*i)->GetAmount();
1232 break;
1233 }
1234 }
1235 }
1236
1238 GetCaster()->CastSpell(GetHitUnit(), spellId2, true);
1239 }
1240
1245
1247};
1248
1249// 20425 - Judgement of Command
1265
1266// 20185 - Judgement of Light
1268{
1270
1271 bool Validate(SpellInfo const* /*spellInfo*/) override
1272 {
1274 }
1275
1276 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1277 {
1279
1280 Unit* caster = eventInfo.GetActor();
1281
1282 CastSpellExtraArgs args(aurEff);
1284 args.AddSpellBP0(caster->CountPctFromMaxHealth(aurEff->GetAmount()));
1285 caster->CastSpell(nullptr, SPELL_PALADIN_JUDGEMENT_OF_LIGHT_HEAL, args);
1286 }
1287
1292};
1293
1294// 20186 - Judgement of Wisdom
1296{
1298
1299 bool Validate(SpellInfo const* /*spellInfo*/) override
1300 {
1302 }
1303
1304 bool CheckProc(ProcEventInfo& eventInfo)
1305 {
1306 return eventInfo.GetActor()->GetPowerType() == POWER_MANA;
1307 }
1308
1309 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1310 {
1312
1313 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_PALADIN_JUDGEMENT_OF_WISDOM_MANA);
1314
1315 Unit* caster = eventInfo.GetActor();
1316 int32 const amount = CalculatePct(static_cast<int32>(caster->GetCreateMana()), spellInfo->GetEffect(EFFECT_0).CalcValue());
1317 CastSpellExtraArgs args(aurEff);
1319 args.AddSpellBP0(amount);
1320 caster->CastSpell(nullptr, spellInfo->Id, args);
1321 }
1322
1328};
1329
1330// -53695 - Judgements of the Just
1351
1352// -31876 - Judgements of the Wise
1354{
1356
1357 bool Validate(SpellInfo const* /*spellInfo*/) override
1358 {
1359 return ValidateSpellInfo(
1360 {
1363 });
1364 }
1365
1366 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1367 {
1369
1370 Unit* caster = eventInfo.GetActor();
1371 caster->CastSpell(nullptr, SPELL_PALADIN_JUDGEMENTS_OF_THE_WISE_MANA, aurEff);
1372 caster->CastSpell(nullptr, SPELL_REPLENISHMENT, aurEff);
1373 }
1374
1379};
1380
1381// -633 - Lay on Hands
1383{
1385
1386 bool Validate(SpellInfo const* /*spell*/) override
1387 {
1388 return ValidateSpellInfo(
1389 {
1393 });
1394 }
1395
1397 {
1398 Unit* caster = GetCaster();
1399 if (Unit* target = GetExplTargetUnit())
1400 if (caster == target)
1401 if (target->HasAura(SPELL_PALADIN_FORBEARANCE) || target->HasAura(SPELL_PALADIN_AVENGING_WRATH_MARKER) || target->HasAura(SPELL_PALADIN_IMMUNE_SHIELD_MARKER))
1403
1404 return SPELL_CAST_OK;
1405 }
1406
1408 {
1409 Unit* caster = GetCaster();
1410 if (caster == GetHitUnit())
1411 {
1412 caster->CastSpell(caster, SPELL_PALADIN_FORBEARANCE, true);
1413 caster->CastSpell(caster, SPELL_PALADIN_AVENGING_WRATH_MARKER, true);
1414 caster->CastSpell(caster, SPELL_PALADIN_IMMUNE_SHIELD_MARKER, true);
1415 }
1416 }
1417
1423};
1424
1425// 53651 - Light's Beacon - Beacon of Light
1427{
1429
1441
1442 bool CheckProc(ProcEventInfo& eventInfo)
1443 {
1444 if (GetTarget()->HasAura(SPELL_PALADIN_BEACON_OF_LIGHT, eventInfo.GetActor()->GetGUID()))
1445 return false;
1446 return true;
1447 }
1448
1449 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1450 {
1452
1453 SpellInfo const* procSpell = eventInfo.GetSpellInfo();
1454 if (!procSpell)
1455 return;
1456
1457 HealInfo* healInfo = eventInfo.GetHealInfo();
1458 if (!healInfo || !healInfo->GetHeal())
1459 return;
1460
1462 uint32 heal = CalculatePct(healInfo->GetHeal(), aurEff->GetAmount());
1463
1464 Unit* beaconTarget = GetCaster();
1465 if (!beaconTarget || !beaconTarget->HasAura(SPELL_PALADIN_BEACON_OF_LIGHT, eventInfo.GetActor()->GetGUID()))
1466 return;
1467
1471 CastSpellExtraArgs args(aurEff);
1472 args.AddSpellBP0(heal);
1473 eventInfo.GetActor()->CastSpell(beaconTarget, healSpellId, args);
1474 }
1475
1481};
1482
1483// 31789 - Righteous Defense
1485{
1487
1488 bool Validate(SpellInfo const* /*spellInfo*/) override
1489 {
1491 }
1492
1494 {
1495 Unit* caster = GetCaster();
1496 if (caster->GetTypeId() != TYPEID_PLAYER)
1498
1499 if (Unit* target = GetExplTargetUnit())
1500 {
1501 if (!target->IsFriendlyTo(caster) || target == caster || target->getAttackers().empty())
1503 }
1504 else
1506
1507 return SPELL_CAST_OK;
1508 }
1509
1510 void HandleDummy(SpellEffIndex /*effIndex*/)
1511 {
1512 if (Unit* target = GetHitUnit())
1513 {
1514 auto const& attackers = target->getAttackers();
1515
1516 std::vector<Unit*> list(attackers.cbegin(), attackers.cend());
1518
1519 for (Unit* attacker : list)
1521 }
1522 }
1523
1529};
1530
1531// -53380 - Righteous Vengeance
1533{
1535
1536 bool Validate(SpellInfo const* /*spellInfo*/) override
1537 {
1539 }
1540
1541 bool CheckProc(ProcEventInfo& eventInfo)
1542 {
1543 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
1544 return damageInfo && damageInfo->GetDamage();
1545 }
1546
1547 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1548 {
1550
1551 Unit* caster = eventInfo.GetActor();
1552 Unit* target = eventInfo.GetActionTarget();
1553
1554 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_PALADIN_RIGHTEOUS_VENGEANCE_DAMAGE);
1555 int32 amount = CalculatePct(static_cast<int32>(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount());
1556
1557 ASSERT(spellInfo->GetMaxTicks() > 0);
1558 amount /= spellInfo->GetMaxTicks();
1559
1560 CastSpellExtraArgs args(aurEff);
1561 args.AddSpellBP0(amount);
1563 }
1564
1570};
1571
1572// 58597 - Sacred Shield
1574{
1576
1577 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
1578 {
1579 if (Unit* caster = GetCaster())
1580 {
1581 // +75.00% from sp bonus
1582 float bonus = CalculatePct(caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask()), 75.0f);
1583
1584 // Divine Guardian is only applied at the spell healing bonus because it was already applied to the base value in CalculateSpellDamage
1585 bonus = caster->ApplyEffectModifiers(GetSpellInfo(), aurEff->GetEffIndex(), bonus);
1586 bonus *= caster->CalculateSpellpowerCoefficientLevelPenalty(GetSpellInfo());
1587
1588 amount += int32(bonus);
1589
1590 // Arena - Dampening
1591 if (AuraEffect const* auraEffArenaDampening = caster->GetAuraEffect(SPELL_GENERIC_ARENA_DAMPENING, EFFECT_0))
1592 AddPct(amount, auraEffArenaDampening->GetAmount());
1593 // Battleground - Dampening
1594 else if (AuraEffect const* auraEffBattlegroudDampening = caster->GetAuraEffect(SPELL_GENERIC_BATTLEGROUND_DAMPENING, EFFECT_0))
1595 AddPct(amount, auraEffBattlegroudDampening->GetAmount());
1596
1597 // ICC buff
1598 if (AuraEffect const* auraStrengthOfWrynn = caster->GetAuraEffect(SPELL_AURA_MOD_HEALING_DONE_PERCENT, SPELLFAMILY_GENERIC, SPELL_ICON_ID_STRENGTH_OF_WRYNN, EFFECT_2))
1599 AddPct(amount, auraStrengthOfWrynn->GetAmount());
1600 else if (AuraEffect const* auraHellscreamsWarsong = caster->GetAuraEffect(SPELL_AURA_MOD_HEALING_DONE_PERCENT, SPELLFAMILY_GENERIC, SPELL_ICON_ID_HELLSCREAM_WARSONG, EFFECT_2))
1601 AddPct(amount, auraHellscreamsWarsong->GetAmount());
1602 }
1603 }
1604
1609};
1610
1611// 53601 - Sacred Shield (dummy)
1613{
1615
1616 bool Validate(SpellInfo const* /*spellInfo*/) override
1617 {
1618 return ValidateSpellInfo(
1619 {
1622 });
1623 }
1624
1625 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1626 {
1628
1629 Unit* caster = GetCaster();
1630 if (!caster)
1631 return;
1632
1633 TimePoint now = GameTime::Now();
1634 if (_cooldownEnd > now)
1635 return;
1636
1637 Seconds cooldown(aurEff->GetAmount());
1638 if (AuraEffect const* bonus = caster->GetAuraEffect(SPELL_PALADIN_T8_HOLY_4P_BONUS, EFFECT_0, caster->GetGUID()))
1639 cooldown = Seconds(bonus->GetAmount());
1640
1641 _cooldownEnd = now + cooldown;
1643 }
1644
1649
1650 // Cooldown tracking can't be done in DB because of T8 bonus
1651 TimePoint _cooldownEnd = std::chrono::steady_clock::time_point::min();
1652};
1653
1654// 20154, 21084 - Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage)
1656{
1658
1659 bool Validate(SpellInfo const* /*spellInfo*/) override
1660 {
1662 }
1663
1664 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1665 {
1667
1668 Unit* victim = eventInfo.GetActionTarget();
1669
1672
1675
1676 float mws = GetTarget()->GetAttackTime(BASE_ATTACK);
1677 mws /= 1000.0f;
1678
1679 int32 bp = std::lroundf(mws * (0.022f * ap + 0.044f * sph));
1680 CastSpellExtraArgs args(aurEff);
1681 args.AddSpellBP0(bp);
1682 eventInfo.GetActor()->CastSpell(victim, SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS, args);
1683 }
1684
1689};
1690
1691// 31801 - Seal of Vengeance
1692// 53736 - Seal of Corruption
1693template <uint32 DoTSpellId, uint32 DamageSpellId>
1695{
1696 public:
1697 spell_pal_seal_of_vengeance(char const* ScriptName) : SpellScriptLoader(ScriptName) { }
1698
1699 template <uint32 DoTSpell, uint32 DamageSpell>
1701 {
1703
1704 bool Validate(SpellInfo const* /*spellInfo*/) override
1705 {
1706 return ValidateSpellInfo(
1707 {
1708 DoTSpell,
1709 DamageSpell
1710 });
1711 }
1712
1713 /*
1714 When an auto-attack lands (does not dodge/parry/miss) that can proc a seal the of the following things happen independently of each other (see 2 roll system).
1715
1716 1) A "hidden strike" which uses melee combat mechanics occurs. If it lands it refreshes/stacks SoV DoT. Only white swings can trigger a refresh or stack. (This hidden strike mechanic can also proc things like berserking..)
1717 2) A weapon damage based proc will occur if you used a special (CS/DS/judge) or if you have a 5 stack (from auto attacks). This attack can not be avoided.
1718
1719 Remember #2 happens regardless of #1 landing, it just requires the initial attack (autos, cs, etc) to land.
1720
1721 Stack Number % of Weapon Damage % with SotP
1722 0 0% 0%
1723 1 6.6% 7.6%
1724 2 13.2% 15.2%
1725 3 19.8% 22.8%
1726 4 26.4% 30.4%
1727 5 33% 38%
1728 */
1729
1730 void HandleApplyDoT(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1731 {
1733
1734 if (!(eventInfo.GetTypeMask() & PROC_FLAG_DONE_MELEE_AUTO_ATTACK))
1735 {
1736 // Patch 3.2.0 Notes: Only auto-attacks and Hammer of the Righteous can place the debuff on the paladin's current target(s).
1737 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1738 if (!spellInfo || spellInfo->SpellIconID != PALADIN_ICON_ID_HAMMER_OF_THE_RIGHTEOUS)
1739 return;
1740 }
1741
1742 // don't cast triggered, spell already has SPELL_ATTR4_CAN_CAST_WHILE_CASTING attr
1743 eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), DoTSpell, CastSpellExtraArgs(TRIGGERED_DONT_RESET_PERIODIC_TIMER).SetTriggeringAura(aurEff));
1744 }
1745
1746 void HandleSeal(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1747 {
1749
1750 Unit* caster = eventInfo.GetActor();
1751 Unit* target = eventInfo.GetActionTarget();
1752
1753 // get current aura on target, if any
1754 AuraEffect const* sealDot = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PALADIN, 0x00000000, 0x00000800, 0x00000000, caster->GetGUID());
1755 if (!sealDot)
1756 return;
1757
1758 uint8 const stacks = sealDot->GetBase()->GetStackAmount();
1759 uint8 const maxStacks = sealDot->GetSpellInfo()->StackAmount;
1760
1761 if (stacks < maxStacks && !(eventInfo.GetTypeMask() & PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS))
1762 return;
1763
1764 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(DamageSpell);
1765 int32 amount = spellInfo->GetEffect(EFFECT_0).CalcValue();
1766 amount *= stacks;
1767 amount /= maxStacks;
1768
1769 CastSpellExtraArgs args(aurEff);
1770 args.AddSpellBP0(amount);
1771 caster->CastSpell(target, DamageSpell, args);
1772 }
1773
1779 };
1780
1785};
1786
1787// 20375 - Seal of Command
1788// 20154 - Seal of Righteousness
1789// 21084 - Seal of Righteousness
1790// 31801 - Seal of Vengeance
1791// 31892 - Seal of Blood
1792// 33127 - Seal of Command
1793// 38008 - Seal of Blood
1794// 41459 - Seal of Blood
1795// 53720 - Seal of the Martyr
1796// 53736 - Seal of Corruption
1798{
1800
1801 // Effect 2 is used by Judgement code, we prevent the proc to avoid console logging of unknown spell trigger
1802 bool CheckDummyProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
1803 {
1804 return false;
1805 }
1806
1807 void Register() override
1808 {
1809 if (m_scriptSpellId == 20154)
1810 return; // another console log prevention hack - first "rank" of Seal of Righteousness doesn't have the judgement effect
1811
1813 }
1814};
1815
1816// -31785 - Spiritual Attunement
1818{
1820
1821 bool Validate(SpellInfo const* /*spellInfo*/) override
1822 {
1824 }
1825
1826 bool CheckProc(ProcEventInfo& eventInfo)
1827 {
1828 // "when healed by other friendly targets' spells"
1829 if (eventInfo.GetActor() == eventInfo.GetActionTarget())
1830 return false;
1831
1832 return eventInfo.GetHealInfo() && eventInfo.GetHealInfo()->GetEffectiveHeal();
1833 }
1834
1835 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1836 {
1838 HealInfo* healInfo = eventInfo.GetHealInfo();
1839 int32 amount = CalculatePct(static_cast<int32>(healInfo->GetEffectiveHeal()), aurEff->GetAmount());
1840
1841 CastSpellExtraArgs args(aurEff);
1842 args.AddSpellBP0(amount);
1844 }
1845
1851};
1852
1853// -53501 - Sheath of Light
1855{
1857
1858 bool Validate(SpellInfo const* /*spellInfo*/) override
1859 {
1861 }
1862
1863 bool CheckProc(ProcEventInfo& eventInfo)
1864 {
1865 HealInfo* healInfo = eventInfo.GetHealInfo();
1866 return healInfo && healInfo->GetEffectiveHeal();
1867 }
1868
1869 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1870 {
1872
1873 Unit* caster = eventInfo.GetActor();
1874 Unit* target = eventInfo.GetActionTarget();
1875
1876 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_PALADIN_SHEATH_OF_LIGHT_HEAL);
1877 int32 amount = CalculatePct(static_cast<int32>(eventInfo.GetHealInfo()->GetEffectiveHeal()), aurEff->GetAmount());
1878
1879 ASSERT(spellInfo->GetMaxTicks() > 0);
1880 amount /= spellInfo->GetMaxTicks();
1881
1882 CastSpellExtraArgs args(aurEff);
1883 args.AddSpellBP0(amount);
1884 caster->CastSpell(target, SPELL_PALADIN_SHEATH_OF_LIGHT_HEAL, args);
1885 }
1886
1892};
1893
1894// 28789 - Holy Power
1896{
1898
1909
1910 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1911 {
1913
1914 uint32 spellId;
1915 Unit* caster = eventInfo.GetActor();
1916 Unit* target = eventInfo.GetActionTarget();
1917
1918 switch (target->GetClass())
1919 {
1920 case CLASS_PALADIN:
1921 case CLASS_PRIEST:
1922 case CLASS_SHAMAN:
1923 case CLASS_DRUID:
1925 break;
1926 case CLASS_MAGE:
1927 case CLASS_WARLOCK:
1929 break;
1930 case CLASS_HUNTER:
1931 case CLASS_ROGUE:
1933 break;
1934 case CLASS_WARRIOR:
1936 break;
1937 default:
1938 return;
1939 }
1940
1941 caster->CastSpell(target, spellId, aurEff);
1942 }
1943
1948};
1949
1950// 64890 - Item - Paladin T8 Holy 2P Bonus
1952{
1954
1955 bool Validate(SpellInfo const* /*spellInfo*/) override
1956 {
1958 }
1959
1960 bool CheckProc(ProcEventInfo& eventInfo)
1961 {
1962 HealInfo* healInfo = eventInfo.GetHealInfo();
1963 return healInfo && healInfo->GetHeal();
1964 }
1965
1966 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1967 {
1969
1970 Unit* caster = eventInfo.GetActor();
1971 Unit* target = eventInfo.GetActionTarget();
1972
1973 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_PALADIN_HOLY_MENDING);
1974 int32 amount = CalculatePct(static_cast<int32>(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount());
1975
1976 ASSERT(spellInfo->GetMaxTicks() > 0);
1977 amount /= spellInfo->GetMaxTicks();
1978
1979 CastSpellExtraArgs args(aurEff);
1980 args.AddSpellBP0(amount);
1981 caster->CastSpell(target, SPELL_PALADIN_HOLY_MENDING, args);
1982 }
1983
1989};
1990
1992{
2046}
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
std::chrono::steady_clock::time_point TimePoint
time_point shorthand typedefs
Definition Duration.h:36
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:27
#define ASSERT
Definition Errors.h:68
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
@ SPELLMOD_FLAT
Definition Player.h:122
bool roll_chance_i(int chance)
Definition Random.h:59
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
#define RegisterSpellScriptWithArgs(spell_script, script_name,...)
Definition ScriptMgr.h:1127
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ EFFECT_2
#define EFFECT_FIRST_FOUND
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_ENERGIZE
@ TARGET_UNIT_DEST_AREA_ALLY
@ TARGET_UNIT_CASTER_AREA_RAID
@ SPELL_SCHOOL_MASK_HOLY
@ BASE_ATTACK
@ CLASS_HUNTER
@ CLASS_DRUID
@ CLASS_SHAMAN
@ CLASS_PRIEST
@ CLASS_WARRIOR
@ CLASS_WARLOCK
@ CLASS_MAGE
@ CLASS_PALADIN
@ CLASS_ROGUE
@ MECHANIC_STUN
@ SPELLFAMILY_GENERIC
@ SPELLFAMILY_PALADIN
@ POWER_MANA
SpellCastResult
@ SPELL_FAILED_UNIT_NOT_INFRONT
@ SPELL_FAILED_DONT_REPORT
@ SPELL_FAILED_TARGET_AURASTATE
@ SPELL_FAILED_BAD_TARGETS
@ SPELL_CAST_OK
@ AURA_REMOVE_BY_ENEMY_SPELL
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_ADD_PCT_MODIFIER
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_MOD_HEALING_DONE_PERCENT
@ SPELL_AURA_ADD_FLAT_MODIFIER
@ SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
@ SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
@ SPELL_AURA_MOD_DAMAGE_TAKEN
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELLMOD_DAMAGE
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ TRIGGERED_DONT_RESET_PERIODIC_TIMER
Will ignore caster aura restrictions or requirements.
@ SPELLVALUE_BASE_POINT1
@ SPELLVALUE_BASE_POINT0
@ SPELL_SPECIFIC_SEAL
Definition SpellInfo.h:115
@ PROC_HIT_CRITICAL
Definition SpellMgr.h:221
#define sSpellMgr
Definition SpellMgr.h:738
@ PROC_FLAG_DONE_MELEE_AUTO_ATTACK
Definition SpellMgr.h:118
@ PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS
Definition SpellMgr.h:121
#define SpellCheckCastFn(F)
#define AuraEffectProcFn(F, I, N)
#define SpellEffectFn(F, I, N)
#define AuraEffectCalcAmountFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraCheckEffectProcFn(F, I, N)
#define AuraEffectAbsorbFn(F, I)
#define AuraEffectApplyFn(F, I, N, M)
#define AuraEffectSplitFn(F, I)
#define AuraCheckProcFn(F)
#define SpellHitFn(F)
#define AuraEffectCalcSpellModFn(F, I, N)
#define AuraCheckAreaTargetFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
T AddPct(T &base, U pct)
Definition Util.h:77
T CalculatePct(T base, U pct)
Definition Util.h:71
SpellInfo const * GetSpellInfo() const
SpellEffIndex GetEffIndex() const
SpellEffectInfo const & GetSpellEffectInfo() const
Aura * GetBase() const
int32 GetAmount() const
void PreventDefaultAction()
HookList< EffectApplyHandler > AfterEffectRemove
HookList< CheckEffectProcHandler > DoCheckEffectProc
HookList< EffectPeriodicHandler > OnEffectPeriodic
SpellInfo const * GetSpellInfo() const
HookList< EffectApplyHandler > AfterEffectApply
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Unit * GetCaster() const
HookList< EffectCalcSpellModHandler > DoEffectCalcSpellMod
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
HookList< EffectAbsorbHandler > OnEffectAbsorb
Aura * GetAura() const
HookList< CheckAreaTargetHandler > DoCheckAreaTarget
Unit * GetTarget() const
ObjectGuid GetCasterGUID() const
HookList< CheckProcHandler > DoCheckProc
void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
HookList< EffectProcHandler > OnEffectProc
Unit * GetUnitOwner() const
HookList< AuraProcHandler > OnProc
HookList< EffectSplitHandler > OnEffectSplit
uint32 GetId() const
Unit * GetUnitOwner() const
Definition SpellAuras.h:122
uint8 GetStackAmount() const
Definition SpellAuras.h:164
uint32 GetDamage() const
Definition Unit.h:464
uint32 GetEffectiveHeal() const
Definition Unit.h:493
SpellInfo const * GetSpellInfo() const
Definition Unit.h:495
uint32 GetHeal() const
Definition Unit.h:492
TypeID GetTypeId() const
Definition Object.h:93
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
uint32 GetHitMask() const
Definition Unit.h:514
HealInfo * GetHealInfo() const
Definition Unit.h:520
Unit * GetActionTarget() const
Definition Unit.h:509
uint32 GetTypeMask() const
Definition Unit.h:511
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
bool IsEffect() const
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr) const
void AddCooldown(uint32 spellId, uint32 itemId, std::chrono::duration< Type, Period > cooldownDuration)
bool IsRankOf(SpellInfo const *spellInfo) const
uint32 GetMaxTicks() const
SpellInfo const * GetFirstRankSpell() const
flag96 SpellFamilyFlags
Definition SpellInfo.h:357
uint32 StackAmount
Definition SpellInfo.h:340
uint32 Id
Definition SpellInfo.h:289
uint8 GetRank() const
SpellSchoolMask GetSchoolMask() const
int32 CalcPowerCost(WorldObject const *caster, SpellSchoolMask schoolMask, Spell *spell=nullptr) const
uint32 MaxAffectedTargets
Definition SpellInfo.h:355
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:483
uint32 SpellIconID
Definition SpellInfo.h:349
HookList< CheckCastHandler > OnCheckCast
int32 GetHitDamage() const
Unit * GetCaster() const
HookList< HitHandler > AfterHit
Unit * GetHitUnit() const
int32 GetEffectValue() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Unit * GetExplTargetUnit() const
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition Spell.h:152
Definition Unit.h:769
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3561
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1384
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3638
uint8 GetClass() const
Definition Unit.h:895
uint32 GetDefenseSkillValue(Unit const *target=nullptr) const
Definition Unit.cpp:2557
Powers GetPowerType() const
Definition Unit.h:931
uint32 GetMaxHealth() const
Definition Unit.h:914
Aura * AddAura(uint32 spellId, Unit *target)
Definition Unit.cpp:11964
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4359
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
int32 GetTotalAuraModifierByMiscMask(AuraType auraType, uint32 misc_mask) const
Definition Unit.cpp:4812
void RemoveAurasWithMechanic(uint32 mechanicMaskToRemove, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, uint32 exceptSpellId=0, bool withEffectMechanics=false)
Definition Unit.cpp:4077
uint32 GetHealth() const
Definition Unit.h:913
AttackerSet const & getAttackers() const
Definition Unit.h:857
AuraEffect * GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4373
uint32 GetAttackTime(WeaponAttackType att) const
Definition Unit.cpp:8471
int32 GetTotalAuraModifier(AuraType auraType) const
Definition Unit.cpp:4792
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:922
SpellHistory * GetSpellHistory()
Definition Unit.h:1484
std::list< AuraEffect * > AuraEffectList
Definition Unit.h:787
uint32 GetCreateMana() const
Definition Unit.h:1452
int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const
Definition Unit.cpp:6987
float GetTotalAttackPowerValue(WeaponAttackType attType) const
Definition Unit.cpp:9312
uint32 GetMaxSkillValueForLevel(Unit const *target=nullptr) const
Definition Unit.h:1019
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
bool IsValidAttackTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
Definition Object.cpp:2856
bool isInFront(WorldObject const *target, float arc=float(M_PI)) const
Definition Object.cpp:1366
bool IsFriendlyTo(WorldObject const *target) const
Definition Object.cpp:2801
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
uint32 m_scriptSpellId
PrepareAuraScript(spell_pal_ardent_defender)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
bool Validate(SpellInfo const *) override
void Absorb(AuraEffect *aurEff, DamageInfo &dmgInfo, uint32 &absorbAmount)
PrepareAuraScript(spell_pal_aura_mastery_immune)
bool CheckAreaTarget(Unit *target)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
void HandleEffectRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_pal_aura_mastery)
void HandleApply(AuraEffect const *aurEff, AuraEffectHandleModes)
PrepareAuraScript(spell_pal_avenging_wrath)
bool Validate(SpellInfo const *) override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *spellInfo) override
void PeriodicTick(AuraEffect const *aurEff)
PrepareAuraScript(spell_pal_beacon_of_light)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_pal_blessing_of_faith)
void HandleDummy(SpellEffIndex)
bool CheckProc(ProcEventInfo &)
PrepareAuraScript(spell_pal_blessing_of_sanctuary)
void HandleEffectRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool CheckProc(AuraEffect const *aurEff, ProcEventInfo &)
PrepareAuraScript(spell_pal_divine_purpose)
void HandleProc(AuraEffect const *, ProcEventInfo &eventInfo)
void Split(AuraEffect *, DamageInfo &, uint32 &splitAmount)
PrepareAuraScript(spell_pal_divine_sacrifice)
bool Validate(SpellInfo const *) override
void CountTargets(std::list< WorldObject * > &targetList)
PrepareSpellScript(spell_pal_divine_storm_dummy)
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_pal_divine_storm)
void HandleEffectCalcSpellMod(AuraEffect const *aurEff, SpellModifier *&spellMod)
PrepareAuraScript(spell_pal_exorcism_and_holy_wrath_damage)
PrepareAuraScript(spell_pal_eye_for_an_eye)
void OnProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void OnProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_pal_glyph_of_divinity)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_pal_glyph_of_holy_light_dummy)
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_pal_glyph_of_holy_light)
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex)
PrepareSpellScript(spell_pal_guarded_by_the_light)
PrepareAuraScript(spell_pal_hand_of_sacrifice)
void Split(AuraEffect *, DamageInfo &, uint32 &splitAmount)
PrepareAuraScript(spell_pal_hand_of_salvation)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_pal_heart_of_the_crusader)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
SpellCastResult CheckCast()
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *spellInfo) override
void Register() override
PrepareSpellScript(spell_pal_holy_shock)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_pal_illumination)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareSpellScript(spell_pal_immunities)
void Register() override
SpellCastResult CheckCast()
bool Validate(SpellInfo const *) override
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_pal_improved_aura)
spell_pal_improved_aura(uint32 spellId)
bool Validate(SpellInfo const *) override
void HandleEffectRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_pal_improved_lay_of_hands)
bool Validate(SpellInfo const *spellInfo) override
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_pal_infusion_of_light)
PrepareAuraScript(spell_pal_item_healing_discount)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_pal_item_t6_trinket)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareSpellScript(spell_pal_judgement_of_command)
PrepareAuraScript(spell_pal_judgement_of_light_heal)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_pal_judgement_of_wisdom_mana)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
PrepareSpellScript(spell_pal_judgement)
bool Validate(SpellInfo const *) override
spell_pal_judgement(uint32 spellId)
void Register() override
void HandleScriptEffect(SpellEffIndex)
void OnProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_pal_judgements_of_the_just)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_pal_judgements_of_the_wise)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_pal_lay_on_hands)
SpellCastResult CheckCast()
PrepareAuraScript(spell_pal_light_s_beacon)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_pal_righteous_defense)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_pal_righteous_vengeance)
bool CheckProc(ProcEventInfo &eventInfo)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_pal_sacred_shield_dummy)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_pal_sacred_shield)
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_pal_seal_of_righteousness)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
void HandleApplyDoT(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
void HandleSeal(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
spell_pal_seal_of_vengeance(char const *ScriptName)
AuraScript * GetAuraScript() const override
void Register() override
bool CheckDummyProc(AuraEffect const *, ProcEventInfo &)
PrepareAuraScript(spell_pal_seals)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
PrepareAuraScript(spell_pal_sheath_of_light)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
PrepareAuraScript(spell_pal_spiritual_attunement)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_pal_t3_6p_bonus)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_pal_t8_2p_bonus)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
TimePoint Now()
Current chrono steady_clock time point.
Definition GameTime.cpp:57
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:66
PaladinSpells
@ SPELL_PALADIN_SEAL_OF_VENGEANCE_DAMAGE
@ SPELL_PALADIN_HOLY_POWER_MP5
@ SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE
@ SPELL_PALADIN_BEACON_OF_LIGHT_HEAL_3
@ SPELL_PALADIN_AURA_MASTERY_IMMUNE
@ SPELL_PALADIN_HOLY_SHOCK_R1_HEALING
@ SPELL_PALADIN_HOLY_MENDING
@ SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA
@ SPELL_PALADIN_GLYPH_OF_HOLY_LIGHT_HEAL
@ SPELL_PALADIN_HOLY_POWER_ARMOR
@ SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1
@ SPELL_PALADIN_JUDGEMENT_OF_WISDOM_MANA
@ SPELL_PALADIN_SANCTIFIED_WRATH
@ SPELL_PALADIN_HOLY_POWER_SPELL_POWER
@ SPELL_PALADIN_AVENGING_WRATH_MARKER
@ SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF
@ SPELL_PALADIN_T9_HOLY_4P_BONUS
@ SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE
@ SPELL_GENERIC_ARENA_DAMPENING
@ SPELL_PALADIN_GLYPH_OF_DIVINITY_PROC
@ SPELL_PALADIN_IMPROVED_CONCENTRACTION_AURA
@ SPELL_PALADIN_FLASH_OF_LIGHT_PROC
@ SPELL_PALADIN_HEART_OF_THE_CRUSADER_EFF_R1
@ SPELL_PALADIN_JUDGEMENTS_OF_THE_JUST_PROC
@ SPELL_PALADIN_BLESSING_OF_LOWER_CITY_SHAMAN
@ SPELL_PALADIN_JUDGEMENT_DAMAGE
@ SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS
@ SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN
@ SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID
@ SPELL_PALADIN_ILLUMINATION_ENERGIZE
@ SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT
@ SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1
@ SPELL_PALADIN_DIVINE_PLEA
@ SPELL_PALADIN_SACRED_SHIELD
@ SPELL_PALADIN_BEACON_OF_LIGHT_HEAL_1
@ SPELL_PALADIN_SHEATH_OF_LIGHT_HEAL
@ SPELL_PALADIN_CONCENTRACTION_AURA
@ SPELL_PALADIN_FORBEARANCE
@ SPELL_PALADIN_HOLY_VENGEANCE
@ SPELL_PALADIN_ENDURING_LIGHT
@ SPELL_PALADIN_T8_HOLY_4P_BONUS
@ SPELL_PALADIN_BEACON_OF_LIGHT_HEAL_2
@ SPELL_PALADIN_BLOOD_CORRUPTION
@ SPELL_PALADIN_IMMUNE_SHIELD_MARKER
@ SPELL_PALADIN_ITEM_HEALING_TRANCE
@ SPELL_PALADIN_SWIFT_RETRIBUTION_R1
@ SPELL_PALADIN_BLESSING_OF_SANCTUARY_ENERGIZE
@ SPELL_PALADIN_HOLY_POWER_ATTACK_POWER
@ SPELL_PALADIN_DIVINE_STORM_DUMMY
@ SPELL_PALADIN_IMPROVED_DEVOTION_AURA
@ SPELL_PALADIN_JUDGEMENT_OF_JUSTICE
@ SPELL_PALADIN_SEAL_OF_CORRUPTION_DAMAGE
@ SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PRIEST
@ SPELL_REPLENISHMENT
@ SPELL_PALADIN_SPIRITUAL_ATTUNEMENT_MANA
@ SPELL_PALADIN_JUDGEMENT_OF_LIGHT
@ SPELL_PALADIN_GLYPH_OF_SALVATION
@ SPELL_PALADIN_DIVINE_STORM_HEAL
@ SPELL_PALADIN_SACRED_SHIELD_TRIGGER
@ SPELL_PALADIN_DIVINE_STORM
@ SPELL_PALADIN_JUDGEMENT_OF_WISDOM
@ SPELL_PALADIN_BEACON_OF_LIGHT
@ SPELL_PALADIN_ENDURING_JUDGEMENT
@ SPELL_PALADIN_RIGHTEOUS_VENGEANCE_DAMAGE
@ SPELL_PALADIN_HOLY_LIGHT
@ SPELL_PALADIN_JUDGEMENTS_OF_THE_WISE_MANA
@ SPELL_GENERIC_BATTLEGROUND_DAMPENING
@ SPELL_PALADIN_HOLY_SHOCK_R1
@ SPELL_PALADIN_JUDGEMENT_OF_LIGHT_HEAL
void AddSC_paladin_spell_scripts()
MiscSpellIcons
@ SPELL_ICON_ID_HELLSCREAM_WARSONG
@ SPELL_ICON_ID_STRENGTH_OF_WRYNN
PaladinSpellIcons
@ PALADIN_ICON_ID_RETRIBUTION_AURA
@ PALADIN_ICON_ID_HAMMER_OF_THE_RIGHTEOUS
CastSpellExtraArgs & AddSpellBP0(int32 val)
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
ObjectGuid OriginalCaster
SpellModOp op
Definition Player.h:168
SpellModType type
Definition Player.h:169
int32 value
Definition Player.h:171
uint32 spellId
Definition Player.h:173
flag96 mask
Definition Player.h:172