TrinityCore
spell_priest.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_PRIEST and SPELLFAMILY_GENERIC spells used by priest players.
20 * Ordered alphabetically using scriptname.
21 * Scriptnames of files in this file should be prefixed with "spell_pri_".
22 */
23
24#include "ScriptMgr.h"
25#include "AreaTriggerAI.h"
26#include "Containers.h"
27#include "G3DPosition.hpp"
28#include "GridNotifiers.h"
29#include "ListUtils.h"
30#include "Log.h"
31#include "MoveSplineInitArgs.h"
32#include "ObjectAccessor.h"
33#include "PathGenerator.h"
34#include "Player.h"
35#include "SpellAuraEffects.h"
36#include "SpellHistory.h"
37#include "SpellMgr.h"
38#include "SpellScript.h"
39#include "TaskScheduler.h"
40#include "TemporarySummon.h"
41
43{
197
199{
203
205{
210
212{
213 public:
214 explicit RaidCheck(Unit const* caster) : _caster(caster) { }
215
216 bool operator()(WorldObject* obj) const
217 {
218 if (Unit* target = obj->ToUnit())
219 return !_caster->IsInRaidWith(target);
220
221 return true;
222 }
223
224 private:
225 Unit const* _caster;
226};
227
228// 121536 - Angelic Feather talent
230{
231 bool Validate(SpellInfo const* /*spellInfo*/) override
232 {
234 }
235
237 {
238 Position destPos = GetHitDest()->GetPosition();
239 float radius = GetEffectInfo().CalcRadius();
240
241 // Caster is prioritary
242 if (GetCaster()->IsWithinDist2d(&destPos, radius))
243 {
245 }
246 else
247 {
252 }
253 }
254
255 void Register() override
256 {
258 }
259};
260
261// Angelic Feather areatrigger - created by SPELL_PRIEST_ANGELIC_FEATHER_AREATRIGGER
263{
265
266 // Called when the AreaTrigger has just been initialized, just before added to map
267 void OnInitialize() override
268 {
269 if (Unit* caster = at->GetCaster())
270 {
271 std::vector<AreaTrigger*> areaTriggers = caster->GetAreaTriggers(SPELL_PRIEST_ANGELIC_FEATHER_AREATRIGGER);
272
273 if (areaTriggers.size() >= 3)
274 areaTriggers.front()->SetDuration(0);
275 }
276 }
277
278 void OnUnitEnter(Unit* unit) override
279 {
280 if (Unit* caster = at->GetCaster())
281 {
282 if (caster->IsFriendlyTo(unit))
283 {
284 // If target already has aura, increase duration to max 130% of initial duration
285 caster->CastSpell(unit, SPELL_PRIEST_ANGELIC_FEATHER_AURA, true);
286 at->SetDuration(0);
287 }
288 }
289 }
290};
291
292// 391387 - Answered Prayers
294{
295 bool Validate(SpellInfo const* spellInfo) override
296 {
298 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
299 }
300
301 void HandleOnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) const
302 {
303 Milliseconds extraDuration = 0ms;
304 if (AuraEffect const* durationEffect = GetEffect(EFFECT_1))
305 extraDuration = Seconds(durationEffect->GetAmount());
306
307 Unit* target = eventInfo.GetActor();
308
309 Aura* answeredPrayers = target->GetAura(SPELL_PRIEST_ANSWERED_PRAYERS);
310
311 // Note: if caster has no aura, we must cast it first.
312 if (!answeredPrayers)
314 else
315 {
316 // Note: there's no BaseValue dummy that we can use as reference, so we hardcode the increasing stack value.
317 answeredPrayers->ModStackAmount(1);
318
319 // Note: if current stacks match max. stacks, trigger Apotheosis.
320 if (answeredPrayers->GetStackAmount() != aurEff->GetAmount())
321 return;
322
323 answeredPrayers->Remove();
324
325 if (Aura* apotheosis = GetTarget()->GetAura(SPELL_PRIEST_APOTHEOSIS))
326 {
327 apotheosis->SetDuration(apotheosis->GetDuration() + extraDuration.count());
328 apotheosis->SetMaxDuration(apotheosis->GetMaxDuration() + extraDuration.count());
329 }
330 else
331 target->CastSpell(target, SPELL_PRIEST_APOTHEOSIS,
333 .AddSpellMod(SPELLVALUE_DURATION, extraDuration.count()));
334 }
335 }
336
337 void Register() override
338 {
340 }
341};
342
343// 26169 - Oracle Healing Bonus
345{
346 bool Validate(SpellInfo const* /*spellInfo*/) override
347 {
349 }
350
351 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
352 {
354 Unit* caster = eventInfo.GetActor();
355 if (caster == eventInfo.GetProcTarget())
356 return;
357
358 HealInfo* healInfo = eventInfo.GetHealInfo();
359 if (!healInfo || !healInfo->GetHeal())
360 return;
361
362 CastSpellExtraArgs args(aurEff);
363 args.AddSpellBP0(CalculatePct(static_cast<int32>(healInfo->GetHeal()), 10));
364 caster->CastSpell(caster, SPELL_PRIEST_ORACULAR_HEAL, args);
365 }
366
367 void Register() override
368 {
370 }
371};
372
373// 81749 - Atonement
375{
376 bool Validate(SpellInfo const* spellInfo) override
377 {
380 }
381
382 static bool CheckProc(ProcEventInfo const& eventInfo)
383 {
384 return eventInfo.GetDamageInfo() != nullptr;
385 }
386
387 void HandleOnProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo)
388 {
389 TriggerAtonementHealOnTargets(aurEff, eventInfo);
390 }
391
392 void Register() override
393 {
396 }
397
398 std::vector<ObjectGuid> _appliedAtonements;
399
400public:
401 void AddAtonementTarget(ObjectGuid const& target)
402 {
403 _appliedAtonements.push_back(target);
404
406 }
407
409 {
410 std::erase(_appliedAtonements, target);
411
413 }
414
415 std::vector<ObjectGuid> const& GetAtonementTargets() const
416 {
417 return _appliedAtonements;
418 }
419
421 {
422 SpellInfo const* TriggeredBy = nullptr;
424 };
425
426 void TriggerAtonementHealOnTargets(AuraEffect const* atonementEffect, ProcEventInfo const& eventInfo)
427 {
428 Unit* priest = GetUnitOwner();
429 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
431
432 // Note: atonementEffect holds the correct amount since we passed the effect in the AuraScript that calls this method.
433 args.AddSpellMod(SPELLVALUE_BASE_POINT0, CalculatePct(damageInfo->GetDamage(), atonementEffect->GetAmount()));
434
436 .TriggeredBy = eventInfo.GetSpellInfo(),
437 .DamageSchoolMask = eventInfo.GetDamageInfo()->GetSchoolMask() });
438
439 float distanceLimit = GetEffectInfo(EFFECT_1).CalcValue();
440
441 std::erase_if(_appliedAtonements, [priest, distanceLimit, &args](ObjectGuid const& targetGuid)
442 {
443 if (Unit* target = ObjectAccessor::GetUnit(*priest, targetGuid))
444 {
445 if (target->IsInDist2d(priest, distanceLimit))
446 priest->CastSpell(target, SPELL_PRIEST_ATONEMENT_HEAL, args);
447
448 return false;
449 }
450
451 return true;
452 });
453 }
454
456 {
457 // Note: the damage dimish starts at the 6th application as of 10.0.5.
458 constexpr std::array<float, 20> damageByStack = { 40.0f, 40.0f, 40.0f, 40.0f, 40.0f, 35.0f, 30.0f, 25.0f, 20.0f, 15.0f, 11.0f, 8.0f, 5.0f, 4.0f, 3.0f, 2.5f, 2.0f, 1.5f, 1.25f, 1.0f };
459
460 for (SpellEffIndex effectIndex : { EFFECT_0, EFFECT_1, EFFECT_2 })
461 if (AuraEffect* sinOfTheMany = GetUnitOwner()->GetAuraEffect(SPELL_PRIEST_SINS_OF_THE_MANY, effectIndex))
462 sinOfTheMany->ChangeAmount(damageByStack[std::min(_appliedAtonements.size(), damageByStack.size() - 1)]);
463 }
464};
465
466// 81751 - Atonement (Heal)
468{
469 bool Validate(SpellInfo const* /*spellInfo*/) override
470 {
472 }
473
474 void CalculateHealingBonus(Unit const* /*victim*/, int32 const& /*healing*/, int32 const& /*flatMod*/, float& pctMod) const
475 {
476 spell_pri_atonement::TriggerArgs const* args = std::any_cast<spell_pri_atonement::TriggerArgs>(&GetSpell()->m_customArg);
477 if (!args || !(args->DamageSchoolMask & SPELL_SCHOOL_MASK_SHADOW))
478 return;
479
480 if (AuraEffect* const abyssalReverieEffect = GetCaster()->GetAuraEffect(SPELL_PRIEST_ABYSSAL_REVERIE, EFFECT_0))
481 AddPct(pctMod, abyssalReverieEffect->GetAmount());
482 }
483
484 void Register() override
485 {
487 }
488};
489
490// 17 - Power Word: Shield
491// 139 - Renew
492// 2061 - Flash Heal
493// 194509 - Power Word: Radiance
495{
496 bool Validate(SpellInfo const* /*spellInfo*/) override
497 {
498 return ValidateSpellInfo
499 ({
506 }) && ValidateSpellEffect({
509 });
510 }
511
512 bool Load() override
513 {
514 Unit* caster = GetCaster();
515 if (!caster->HasAura(SPELL_PRIEST_ATONEMENT))
516 return false;
517
518 // only apply Trinity if the Priest has both Trinity and Atonement and the triggering spell is Power Word: Shield.
519 if (caster->HasAura(SPELL_PRIEST_TRINITY))
520 {
522 return false;
523
525 }
526
527 return true;
528 }
529
530 void HandleOnHitTarget() const
531 {
532 Unit* caster = GetCaster();
533 Unit* target = GetHitUnit();
534
537
538 switch (GetSpellInfo()->Id)
539 {
541 if (AuraEffect const* indemnity = caster->GetAuraEffect(SPELL_PRIEST_INDEMNITY, EFFECT_0))
543 (Seconds(indemnity->GetAmount())
545 caster, &GetSpell()->GetPowerCost()))).count());
546 break;
548 // Power Word: Radiance applies Atonement at 60 % (without modifiers) of its total duration.
550 break;
551 default:
552 break;
553 }
554
555 caster->CastSpell(target, _effectSpellId, args);
556 }
557
558 void Register() override
559 {
561 }
562
564};
565
566// 194384 - Atonement (Buff), 214206 - Atonement [Trinity] (Buff)
568{
569 bool Validate(SpellInfo const* /*spellInfo*/) override
570 {
572 }
573
574 void HandleOnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
575 {
576 RegisterHelper<&spell_pri_atonement::AddAtonementTarget>();
577 }
578
579 void HandleOnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
580 {
581 RegisterHelper<&spell_pri_atonement::RemoveAtonementTarget>();
582 }
583
584 template<void(spell_pri_atonement::*func)(ObjectGuid const&)>
586 {
587 if (Unit* caster = GetCaster())
588 if (Aura* atonement = caster->GetAura(SPELL_PRIEST_ATONEMENT))
589 if (spell_pri_atonement* script = atonement->GetScript<spell_pri_atonement>())
590 (script->*func)(GetTarget()->GetGUID());
591 }
592
593 void Register() override
594 {
597 }
598};
599
600// 195178 - Atonement (Passive)
602{
603 bool Validate(SpellInfo const* /*spellInfo*/) override
604 {
606 }
607
608 static bool CheckProc(ProcEventInfo const& eventInfo)
609 {
610 return eventInfo.GetDamageInfo() != nullptr;
611 }
612
613 void HandleOnProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
614 {
615 Unit* target = GetTarget();
616 Unit* summoner = target->GetOwner();
617 if (!summoner)
618 return;
619
620 if (AuraEffect const* atonementEffect = summoner->GetAuraEffect(SPELL_PRIEST_ATONEMENT, EFFECT_0))
621 if (spell_pri_atonement* script = atonementEffect->GetBase()->GetScript<spell_pri_atonement>())
622 script->TriggerAtonementHealOnTargets(atonementEffect, eventInfo);
623 }
624
625 void Register() override
626 {
628 }
629};
630
631// 33110 - Prayer of Mending (Heal)
633{
634 bool Validate(SpellInfo const* /*spellInfo*/) override
635 {
638 }
639
640 void HandleEffectHitTarget(SpellEffIndex /*effIndex*/) const
641 {
642 if (AuraEffect const* benediction = GetCaster()->GetAuraEffect(SPELL_PRIEST_BENEDICTION, EFFECT_0))
643 if (roll_chance_i(benediction->GetAmount()))
645 }
646
647 void Register() override
648 {
650 }
651};
652
653// 215768 - Blaze of Light
655{
656 bool Validate(SpellInfo const* /*spellInfo*/) override
657 {
658 return ValidateSpellInfo(
659 {
662 });
663 }
664
665 void HandleProc(ProcEventInfo& eventInfo)
666 {
667 Unit* procTarget = eventInfo.GetProcTarget();
668 if (!procTarget)
669 return;
670
671 if (GetTarget()->IsValidAttackTarget(procTarget))
673 else
675 }
676
677 void Register() override
678 {
680 }
681};
682
683// 204883 - Circle of Healing
685{
686 bool Validate(SpellInfo const* spellInfo) override
687 {
688 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
689 }
690
691 void FilterTargets(std::list<WorldObject*>& targets)
692 {
693 // Note: we must remove one since target is always chosen.
694 uint32 const maxTargets = uint32(GetSpellInfo()->GetEffect(EFFECT_1).CalcValue(GetCaster()) - 1);
695
696 Trinity::SelectRandomInjuredTargets(targets, maxTargets, true);
697
698 if (Unit* explicitTarget = GetExplTargetUnit())
699 targets.push_front(explicitTarget);
700 }
701
702 void Register() override
703 {
705 }
706};
707
708// 17 - Power Word: Shield
710{
711 bool Validate(SpellInfo const* /*spellInfo*/) override
712 {
713 return ValidateSpellInfo
714 ({
719 }
720
721 void HandleOnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
722 {
723 Unit* caster = GetCaster();
724 if (!caster)
725 return;
726
727 // Crystalline Reflection Heal
731 }
732
733 void HandleAfterAbsorb(AuraEffect const* /*aurEff*/, DamageInfo const& dmgInfo, uint32 const& absorbAmount) const
734 {
735 Unit* caster = GetCaster();
736 if (!caster)
737 return;
738
740 if (!auraEff)
741 return;
742
743 Unit* attacker = dmgInfo.GetAttacker();
744 if (!attacker)
745 return;
746
748 args.AddSpellMod(SPELLVALUE_BASE_POINT0, CalculatePct(absorbAmount, auraEff->GetAmount()));
750 }
751
752 void Register() override
753 {
756 }
757};
758
759// 8092 - Mind Blast
761{
762 bool Validate(SpellInfo const* /*spellInfo*/) override
763 {
765 }
766
767 void HandleEffectHit(SpellEffIndex /*effIndex*/) const
768 {
770 if (!aurEff)
771 return;
772
773 if (roll_chance_i(aurEff->GetAmount()))
775 }
776
777 void Register() override
778 {
780 }
781};
782
784{
785Unit* GetSummon(Unit const* owner)
786{
787 for (Unit* summon : owner->m_Controlled)
788 if (summon->GetEntry() == NPC_PRIEST_DIVINE_IMAGE)
789 return summon;
790
791 return nullptr;
792}
793
795{
796 switch (spellId)
797 {
828 default:
829 break;
830 }
831
832 return {};
833}
834
835void Trigger(AuraEffect const* aurEff, ProcEventInfo const& eventInfo)
836{
837 Unit* target = eventInfo.GetActor();
838 if (!target)
839 return;
840
841 Unit* divineImage = GetSummon(target);
842 if (!divineImage)
843 return;
844
845 Optional<uint32> spellId = GetSpellToCast(eventInfo.GetSpellInfo()->Id);
846 if (!spellId)
847 return;
848
849 divineImage->CastSpell(SpellCastTargets(eventInfo.GetProcSpell()->m_targets), *spellId, aurEff);
850}
851}
852
853// 392988 - Divine Image
855{
856 bool Validate(SpellInfo const* /*spellInfo*/) override
857 {
858 return ValidateSpellInfo
859 ({
863 });
864 }
865
866 static void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo)
867 {
868 Unit* target = eventInfo.GetActor();
869 if (!target)
870 return;
871
872 // Note: if target has an active Divine Image, we should empower it rather than summoning a new one.
873 if (Unit* divineImage = DivineImageHelpers::GetSummon(target))
874 {
875 // Note: Divine Image now teleports near the target when they cast a Holy Word spell if the Divine Image is further than 15 yards away (Patch 10.1.0).
876 if (target->GetDistance(divineImage) > 15.0f)
877 divineImage->NearTeleportTo(target->GetRandomNearPosition(3.0f));
878
879 if (TempSummon* tempSummon = divineImage->ToTempSummon())
880 tempSummon->RefreshTimer();
881
882 divineImage->CastSpell(divineImage, SPELL_PRIEST_DIVINE_IMAGE_EMPOWER, eventInfo.GetProcSpell());
883 }
884 else
885 {
887 .SetTriggeringAura(aurEff)
888 .SetTriggeringSpell(eventInfo.GetProcSpell())
890
891 // Note: Divine Image triggers a cast immediately based on the Holy Word cast.
892 DivineImageHelpers::Trigger(aurEff, eventInfo);
893 }
894
896 .SetTriggeringAura(aurEff)
897 .SetTriggeringSpell(eventInfo.GetProcSpell())
899 }
900
901 void Register() override
902 {
904 }
905};
906
907// 405216 - Divine Image (Spell Cast Check)
909{
910 bool Validate(SpellInfo const* /*spellInfo*/) override
911 {
912 return ValidateSpellInfo
913 ({
943 });
944 }
945
946 static bool CheckProc(ProcEventInfo const& eventInfo)
947 {
948 return DivineImageHelpers::GetSummon(eventInfo.GetActor()) != nullptr;
949 }
950
951 void HandleAfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
952 {
954 }
955
956 void Register() override
957 {
961 }
962};
963
964// 405963 Divine Image
965// 409387 Divine Image
967{
968 void TrackStackApplicationTime(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
969 {
970 GetUnitOwner()->m_Events.AddEventAtOffset([spelId = GetId(), owner = GetUnitOwner()]
971 {
972 owner->RemoveAuraFromStack(spelId);
974 }
975
976 void Register() override
977 {
979 }
980};
981
982// 33110 - Prayer of Mending (Heal)
984{
985 bool Validate(SpellInfo const* /*spellInfo*/) override
986 {
989 }
990
991 void CalculateHealingBonus(Unit const* victim, int32& /*healing*/, int32& /*flatMod*/, float& pctMod) const
992 {
993 if (AuraEffect const* divineServiceEffect = GetCaster()->GetAuraEffect(SPELL_PRIEST_DIVINE_SERVICE, EFFECT_0))
994 if (Aura const* prayerOfMending = victim->GetAura(SPELL_PRIEST_PRAYER_OF_MENDING_AURA, GetCaster()->GetGUID()))
995 AddPct(pctMod, int32(divineServiceEffect->GetAmount() * prayerOfMending->GetStackAmount()));
996 }
997
998 void Register() override
999 {
1001 }
1002};
1003
1004// 122121 - Divine Star (Shadow)
1006{
1008 {
1009 Unit* caster = GetCaster();
1010
1011 if (caster->GetPowerType() != GetEffectInfo().MiscValue)
1012 PreventHitDefaultEffect(effIndex);
1013 }
1014
1015 void Register() override
1016 {
1018 }
1019};
1020
1021// 110744 - Divine Star (Holy)
1022// 122121 - Divine Star (Shadow)
1024{
1026
1027 void OnInitialize() override
1028 {
1029 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(at->GetSpellId(), DIFFICULTY_NONE);
1030 if (!spellInfo)
1031 return;
1032
1033 if (spellInfo->GetEffects().size() <= EFFECT_1)
1034 return;
1035
1036 Unit* caster = at->GetCaster();
1037 if (!caster)
1038 return;
1039
1041
1042 // Note: max. distance at which the Divine Star can travel to is EFFECT_1's BasePoints yards.
1043 _maxTravelDistance = float(spellInfo->GetEffect(EFFECT_1).CalcValue(caster));
1044
1047
1048 PathGenerator firstPath(at);
1049 firstPath.CalculatePath(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ(), false);
1050
1051 G3D::Vector3 const& endPoint = firstPath.GetPath().back();
1052
1053 // Note: it takes 1000ms to reach EFFECT_1's BasePoints yards, so it takes (1000 / EFFECT_1's BasePoints)ms to run 1 yard.
1054 at->InitSplines(firstPath.GetPath(), at->GetDistance(endPoint.x, endPoint.y, endPoint.z) * float(1000 / _maxTravelDistance));
1055 }
1056
1057 void OnUpdate(uint32 diff) override
1058 {
1059 _scheduler.Update(diff);
1060 }
1061
1062 void OnUnitEnter(Unit* unit) override
1063 {
1064 HandleUnitEnterExit(unit);
1065 }
1066
1067 void OnUnitExit(Unit* unit) override
1068 {
1069 // Note: this ensures any unit receives a second hit if they happen to be inside the AT when Divine Star starts its return path.
1070 HandleUnitEnterExit(unit);
1071 }
1072
1074 {
1075 Unit* caster = at->GetCaster();
1076 if (!caster)
1077 return;
1078
1079 if (std::find(_affectedUnits.begin(), _affectedUnits.end(), unit->GetGUID()) != _affectedUnits.end())
1080 return;
1081
1083
1084 if (caster->IsValidAttackTarget(unit))
1086 TriggerFlags);
1087 else if (caster->IsValidAssistTarget(unit))
1089 TriggerFlags);
1090
1091 _affectedUnits.push_back(unit->GetGUID());
1092 }
1093
1094 void OnDestinationReached() override
1095 {
1096 Unit* caster = at->GetCaster();
1097 if (!caster)
1098 return;
1099
1101 {
1102 _affectedUnits.clear();
1103
1105 }
1106 else
1107 at->Remove();
1108 }
1109
1111 {
1112 _scheduler.Schedule(0ms, [this](TaskContext task)
1113 {
1114 Unit* caster = at->GetCaster();
1115 if (!caster)
1116 return;
1117
1119
1120 Movement::PointsArray returnSplinePoints;
1121
1122 returnSplinePoints.push_back(PositionToVector3(at));
1123 returnSplinePoints.push_back(PositionToVector3(at));
1124 returnSplinePoints.push_back(PositionToVector3(caster));
1125 returnSplinePoints.push_back(PositionToVector3(caster));
1126
1127 at->InitSplines(returnSplinePoints, uint32(at->GetDistance(caster) / _maxTravelDistance * 1000));
1128
1129 task.Repeat(250ms);
1130 });
1131 }
1132
1133private:
1136 std::vector<ObjectGuid> _affectedUnits;
1138};
1139
1140// 391339 - Empowered Renew
1142{
1143 bool Validate(SpellInfo const* /*spellInfo*/) override
1144 {
1147 && sSpellMgr->AssertSpellInfo(SPELL_PRIEST_RENEW, DIFFICULTY_NONE)->GetEffect(EFFECT_0).IsAura(SPELL_AURA_PERIODIC_HEAL);
1148 }
1149
1150 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1151 {
1152 Unit* caster = eventInfo.GetActor();
1153 Unit* target = eventInfo.GetProcTarget();
1154
1155 SpellInfo const* renewSpellInfo = sSpellMgr->AssertSpellInfo(SPELL_PRIEST_RENEW, GetCastDifficulty());
1156 SpellEffectInfo const& renewEffect = renewSpellInfo->GetEffect(EFFECT_0);
1157 int32 estimatedTotalHeal = AuraEffect::CalculateEstimatedfTotalPeriodicAmount(caster, target, renewSpellInfo, renewEffect, renewEffect.CalcValue(caster), 1);
1158 int32 healAmount = CalculatePct(estimatedTotalHeal, aurEff->GetAmount());
1159
1160 caster->CastSpell(target, SPELL_PRIEST_EMPOWERED_RENEW_HEAL, CastSpellExtraArgs(aurEff).AddSpellBP0(healAmount));
1161 }
1162
1163 void Register() override
1164 {
1166 }
1167};
1168
1169// 414553 - Epiphany
1171{
1172 bool Validate(SpellInfo const* /*spellInfo*/) override
1173 {
1175 }
1176
1177 static bool CheckProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
1178 {
1179 return roll_chance_i(aurEff->GetAmount());
1180 }
1181
1182 void HandleOnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) const
1183 {
1184 Unit* target = GetTarget();
1185
1187
1188 target->CastSpell(target, SPELL_PRIEST_EPIPHANY_HIGHLIGHT, aurEff);
1189 }
1190
1191 void Register() override
1192 {
1195 }
1196};
1197
1198// 415673 - Essence Devourer (Heal)
1199// 415676 - Essence Devourer (Heal)
1201{
1202 static void FilterTargets(std::list<WorldObject*>& targets)
1203 {
1204 Trinity::SelectRandomInjuredTargets(targets, 1, true);
1205 }
1206
1207 void Register() override
1208 {
1210 }
1211};
1212
1213// 246287 - Evangelism
1215{
1216 bool Validate(SpellInfo const* /*spellInfo*/) override
1217 {
1218 return ValidateSpellInfo
1219 ({
1223 });
1224 }
1225
1226 void HandleScriptEffect(SpellEffIndex /*effIndex*/) const
1227 {
1228 Unit* caster = GetCaster();
1229 Unit* target = GetHitUnit();
1230
1231 Aura* atonementAura = caster->HasAura(SPELL_PRIEST_TRINITY)
1232 ? target->GetAura(SPELL_PRIEST_TRINITY_EFFECT, caster->GetGUID())
1233 : target->GetAura(SPELL_PRIEST_ATONEMENT_EFFECT, caster->GetGUID());
1234 if (!atonementAura)
1235 return;
1236
1237 Milliseconds extraDuration = Seconds(GetEffectValue());
1238
1239 atonementAura->SetDuration(atonementAura->GetDuration() + extraDuration.count());
1240 atonementAura->SetMaxDuration(atonementAura->GetDuration() + extraDuration.count());
1241 }
1242
1243 void Register() override
1244 {
1246 }
1247};
1248
1249// 33110 - Prayer of Mending (Heal)
1251{
1252 bool Validate(SpellInfo const* /*spellInfo*/) override
1253 {
1255 }
1256
1257 void CalculateHealingBonus(Unit* /*victim*/, int32& /*healing*/, int32& /*flatMod*/, float& pctMod) const
1258 {
1259 if (AuraEffect const* focusedMendingEffect = GetCaster()->GetAuraEffect(SPELL_PRIEST_FOCUSED_MENDING, EFFECT_0))
1260 {
1261 bool const* isEmpoweredByFocusedMending = std::any_cast<bool>(&GetSpell()->m_customArg);
1262
1263 if (isEmpoweredByFocusedMending && *isEmpoweredByFocusedMending)
1264 AddPct(pctMod, focusedMendingEffect->GetAmount());
1265 }
1266 }
1267
1268 void Register() override
1269 {
1271 }
1272};
1273
1274// 390615 - From Darkness Comes Light (Talent)
1276{
1277 void HandleEffectProc(AuraEffect* aurEff, ProcEventInfo& /*eventInfo*/)
1278 {
1280 }
1281
1282 void Register() override
1283 {
1285 }
1286};
1287
1288// 47788 - Guardian Spirit
1290{
1292
1293 bool Validate(SpellInfo const* spellInfo) override
1294 {
1296 }
1297
1298 bool Load() override
1299 {
1301 return true;
1302 }
1303
1304 void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
1305 {
1306 // Set absorbtion amount to unlimited
1307 amount = -1;
1308 }
1309
1310 void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
1311 {
1312 Unit* target = GetTarget();
1313 if (dmgInfo.GetDamage() < target->GetHealth())
1314 return;
1315
1316 int32 healAmount = int32(target->CountPctFromMaxHealth(healPct));
1317 // remove the aura now, we don't want 40% healing bonus
1320 args.AddSpellBP0(healAmount);
1321 target->CastSpell(target, SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL, args);
1322 absorbAmount = dmgInfo.GetDamage();
1323 }
1324
1325 void Register() override
1326 {
1329 }
1330};
1331
1332// 421558 - Heaven's Wrath
1334{
1335 bool Validate(SpellInfo const* /*spellInfo*/) override
1336 {
1338 }
1339
1340 bool CheckProc(ProcEventInfo const& eventInfo) const
1341 {
1343 }
1344
1345 void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo) const
1346 {
1347 Unit* caster = eventInfo.GetActor();
1348 if (!caster)
1349 return;
1350
1351 int32 cdReduction = aurEff->GetAmount();
1353 }
1354
1355 void Register() override
1356 {
1358 }
1359};
1360
1361// 120644 - Halo (Shadow)
1363{
1365 {
1366 Unit* caster = GetCaster();
1367
1368 if (caster->GetPowerType() != GetEffectInfo().MiscValue)
1369 PreventHitDefaultEffect(effIndex);
1370 }
1371
1372 void Register() override
1373 {
1375 }
1376};
1377
1378// 120517 - Halo (Holy)
1379// 120644 - Halo (Shadow)
1381{
1382 areatrigger_pri_halo(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) {}
1383
1384 void OnUnitEnter(Unit* unit) override
1385 {
1386 if (Unit* caster = at->GetCaster())
1387 {
1388 if (caster->IsValidAttackTarget(unit))
1391 else if (caster->IsValidAssistTarget(unit))
1394 }
1395 }
1396};
1397
1398// 391154 - Holy Mending
1400{
1401 bool Validate(SpellInfo const* /*spellInfo*/) override
1402 {
1404 }
1405
1406 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo& procInfo)
1407 {
1408 return procInfo.GetProcTarget()->HasAura(SPELL_PRIEST_RENEW, procInfo.GetActor()->GetGUID());
1409 }
1410
1411 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1412 {
1414 }
1415
1416 void Register() override
1417 {
1420 }
1421};
1422
1423// 63733 - Holy Words
1425{
1426 bool Validate(SpellInfo const* /*spellInfo*/) override
1427 {
1428 return ValidateSpellInfo(
1429 {
1438 }) && ValidateSpellEffect(
1439 {
1443 });
1444 }
1445
1446 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
1447 {
1448 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1449 if (!spellInfo)
1450 return;
1451
1452 uint32 targetSpellId;
1453 SpellEffIndex cdReductionEffIndex;
1454 switch (spellInfo->Id)
1455 {
1456 case SPELL_PRIEST_HEAL:
1457 case SPELL_PRIEST_FLASH_HEAL: // reduce Holy Word: Serenity cd by 6 seconds
1458 targetSpellId = SPELL_PRIEST_HOLY_WORD_SERENITY;
1459 cdReductionEffIndex = EFFECT_1;
1460 // cdReduction = sSpellMgr->GetSpellInfo(SPELL_PRIEST_HOLY_WORD_SERENITY, GetCastDifficulty())->GetEffect(EFFECT_1)->CalcValue(player);
1461 break;
1462 case SPELL_PRIEST_PRAYER_OF_HEALING: // reduce Holy Word: Sanctify cd by 6 seconds
1463 targetSpellId = SPELL_PRIEST_HOLY_WORD_SANCTIFY;
1464 cdReductionEffIndex = EFFECT_2;
1465 break;
1466 case SPELL_PRIEST_RENEW: // reuce Holy Word: Sanctify cd by 2 seconds
1467 targetSpellId = SPELL_PRIEST_HOLY_WORD_SANCTIFY;
1468 cdReductionEffIndex = EFFECT_3;
1469 break;
1470 case SPELL_PRIEST_SMITE: // reduce Holy Word: Chastise cd by 4 seconds
1471 targetSpellId = SPELL_PRIEST_HOLY_WORD_CHASTISE;
1472 cdReductionEffIndex = EFFECT_1;
1473 break;
1474 default:
1475 TC_LOG_WARN("spells.priest", "HolyWords aura has been proced by an unknown spell: {}", GetSpellInfo()->Id);
1476 return;
1477 }
1478
1479 SpellInfo const* targetSpellInfo = sSpellMgr->AssertSpellInfo(targetSpellId, GetCastDifficulty());
1480 int32 cdReduction = targetSpellInfo->GetEffect(cdReductionEffIndex).CalcValue(GetTarget());
1481 GetTarget()->GetSpellHistory()->ModifyCooldown(targetSpellInfo, Seconds(-cdReduction), true);
1482 }
1483
1484 void Register() override
1485 {
1487 }
1488};
1489
1490// 265202 - Holy Word: Salvation
1492{
1493 bool Validate(SpellInfo const* spellInfo) override
1494 {
1495 return ValidateSpellInfo
1496 ({
1499 }) && ValidateSpellEffect({
1501 { spellInfo->Id, EFFECT_1 }
1503 }
1504
1505 bool Load() override
1506 {
1509 return true;
1510 }
1511
1512 void HandleApplyBuffs(SpellEffIndex /*effIndex*/) const
1513 {
1514 Unit* caster = GetCaster();
1515 Unit* target = GetHitUnit();
1516
1517 CastSpellExtraArgs args;
1519
1520 // amount of Prayer of Mending is SPELL_PRIEST_HOLY_WORD_SALVATION's EFFECT_1.
1522
1524 args.AddSpellMod(SPELLVALUE_BASE_POINT0, basePoints);
1525 caster->CastSpell(target, SPELL_PRIEST_PRAYER_OF_MENDING_AURA, args);
1526
1527 // a full duration Renew is triggered.
1528 caster->CastSpell(target, SPELL_PRIEST_RENEW, CastSpellExtraArgs(TRIGGERED_FULL_MASK).SetTriggeringSpell(GetSpell()));
1529 }
1530
1531 void Register() override
1532 {
1534 }
1535
1536 SpellInfo const* _spellInfoHeal = nullptr;
1538};
1539
1540// 2050 - Holy Word: Serenity
1541// 34861 - Holy Word: Sanctify
1543{
1544 bool Validate(SpellInfo const* /*spellInfo*/) override
1545 {
1548 }
1549
1550 bool Load() override
1551 {
1553 }
1554
1555 void ReduceCooldown() const
1556 {
1557 // cooldown reduced by SPELL_PRIEST_HOLY_WORD_SALVATION's Seconds(EFFECT_2).
1558 int32 cooldownReduction = sSpellMgr->AssertSpellInfo(SPELL_PRIEST_HOLY_WORD_SALVATION, GetCastDifficulty())->GetEffect(EFFECT_2).CalcValue(GetCaster());
1559
1561 }
1562
1563 void Register() override
1564 {
1566 }
1567};
1568
1569// 40438 - Priest Tier 6 Trinket
1571{
1572 bool Validate(SpellInfo const* /*spellInfo*/) override
1573 {
1575 }
1576
1577 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
1578 {
1580 Unit* caster = eventInfo.GetActor();
1581 if (eventInfo.GetSpellTypeMask() & PROC_SPELL_TYPE_HEAL)
1582 caster->CastSpell(nullptr, SPELL_PRIEST_DIVINE_BLESSING, true);
1583
1584 if (eventInfo.GetSpellTypeMask() & PROC_SPELL_TYPE_DAMAGE)
1585 caster->CastSpell(nullptr, SPELL_PRIEST_DIVINE_WRATH, true);
1586 }
1587
1588 void Register() override
1589 {
1591 }
1592};
1593
1594// 92833 - Leap of Faith
1596{
1597 bool Validate(SpellInfo const* /*spellInfo*/) override
1598 {
1600 }
1601
1603 {
1604 Position destPos = GetHitDest()->GetPosition();
1605
1606 SpellCastTargets targets;
1607 targets.SetDst(destPos);
1608 targets.SetUnitTarget(GetCaster());
1609 GetHitUnit()->CastSpell(std::move(targets), GetEffectValue(), GetCastDifficulty());
1610 }
1611
1612 void Register() override
1613 {
1615 }
1616};
1617
1618// 1706 - Levitate
1620{
1621 bool Validate(SpellInfo const* /*spellInfo*/) override
1622 {
1624 }
1625
1626 void HandleDummy(SpellEffIndex /*effIndex*/)
1627 {
1629 }
1630
1631 void Register() override
1632 {
1634 }
1635};
1636
1637// 373178 - Light's Wrath
1639{
1640 bool Validate(SpellInfo const* spellInfo) override
1641 {
1642 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
1643 }
1644
1645 void OnPrecast() override
1646 {
1647 Aura const* atonement = GetCaster()->GetAura(SPELL_PRIEST_ATONEMENT);
1648 if (!atonement)
1649 return;
1650
1651 spell_pri_atonement const* script = atonement->GetScript<spell_pri_atonement>();
1652 if (!script)
1653 return;
1654
1655 for (ObjectGuid const& atonementTarget : script->GetAtonementTargets())
1656 {
1657 if (Unit* target = ObjectAccessor::GetUnit(*GetCaster(), atonementTarget))
1658 {
1659 target->CancelSpellMissiles(SPELL_PRIEST_LIGHTS_WRATH_VISUAL, false, false);
1661 }
1662 }
1663 }
1664
1665 void CalculateDamageBonus(Unit const* /*victim*/, int32 const& /*damage*/, int32 const& /*flatMod*/, float& pctMod) const
1666 {
1667 Aura const* atonement = GetCaster()->GetAura(SPELL_PRIEST_ATONEMENT);
1668 if (!atonement)
1669 return;
1670
1671 // Atonement size may have changed when missile hits, we need to take an updated count of Atonement applications.
1672 if (spell_pri_atonement const* script = atonement->GetScript<spell_pri_atonement>())
1673 AddPct(pctMod, GetEffectInfo(EFFECT_1).CalcValue(GetCaster()) * script->GetAtonementTargets().size());
1674 }
1675
1676 void Register() override
1677 {
1679 }
1680};
1681
1682// 205369 - Mind Bomb
1684{
1685 bool Validate(SpellInfo const* /*spellInfo*/) override
1686 {
1688 }
1689
1690 void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1691 {
1692 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH || GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
1693 if (Unit* caster = GetCaster())
1694 caster->CastSpell(GetTarget()->GetPosition(), SPELL_PRIEST_MIND_BOMB_STUN, true);
1695 }
1696
1697 void Register() override
1698 {
1700 }
1701};
1702
1703// 390686 - Painful Punishment
1705{
1706 bool Validate(SpellInfo const* /*spellInfo*/) override
1707 {
1708 return ValidateSpellInfo
1709 ({
1712 });
1713 }
1714
1716 {
1717 Unit* caster = eventInfo.GetActor();
1718 Unit* target = eventInfo.GetActionTarget();
1719 if (!caster || !target)
1720 return;
1721
1722 int32 additionalDuration = aurEff->GetAmount();
1723
1724 if (Aura* shadowWordPain = target->GetOwnedAura(SPELL_PRIEST_SHADOW_WORD_PAIN, caster->GetGUID()))
1725 shadowWordPain->SetDuration(shadowWordPain->GetDuration() + additionalDuration);
1726
1727 if (Aura* purgeTheWicked = target->GetOwnedAura(SPELL_PRIEST_PURGE_THE_WICKED_PERIODIC, caster->GetGUID()))
1728 purgeTheWicked->SetDuration(purgeTheWicked->GetDuration() + additionalDuration);
1729 }
1730
1731 void Register() override
1732 {
1734 }
1735};
1736
1737// 372991 - Pain Transformation
1738// Triggered by 33206 - Pain Suppression
1740{
1741 bool Validate(SpellInfo const* /*spellInfo*/) override
1742 {
1743 return ValidateSpellInfo
1744 ({
1749 });
1750 }
1751
1752 bool Load() override
1753 {
1755 }
1756
1757 void HandleHit(SpellEffIndex /*effIndex*/) const
1758 {
1761
1764 }
1765
1766 void Register() override
1767 {
1769 }
1770};
1771
1772// 47540 - Penance
1773// 400169 - Dark Reprimand
1775{
1776public:
1777 spell_pri_penance(uint32 damageSpellId, uint32 healingSpellId) : _damageSpellId(damageSpellId), _healingSpellId(healingSpellId)
1778 {
1779 }
1780
1781 bool Validate(SpellInfo const* /*spellInfo*/) override
1782 {
1784 }
1785
1787 {
1788 Unit* caster = GetCaster();
1789
1790 if (Unit* target = GetExplTargetUnit())
1791 {
1792 if (!caster->IsFriendlyTo(target))
1793 {
1794 if (!caster->IsValidAttackTarget(target))
1796
1797 if (!caster->isInFront(target))
1799 }
1800 }
1801
1802 return SPELL_CAST_OK;
1803 }
1804
1805 void HandleDummy(SpellEffIndex /*effIndex*/)
1806 {
1807 Unit* caster = GetCaster();
1808
1809 if (Unit* target = GetHitUnit())
1810 {
1811 if (caster->IsFriendlyTo(target))
1813 .SetTriggeringSpell(GetSpell()));
1814 else
1816 .SetTriggeringSpell(GetSpell()));
1817 }
1818 }
1819
1820 void Register() override
1821 {
1824 }
1825
1826private:
1829};
1830
1831// 47758 - Penance (Channel Damage), 47757 - Penance (Channel Healing)
1832// 373129 - Dark Reprimand (Channel Damage), 400171 - Dark Reprimand (Channel Healing)
1834{
1835 bool Validate(SpellInfo const* /*spellInfo*/) override
1836 {
1838 }
1839
1840 void HandleOnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1841 {
1842 if (Unit* caster = GetCaster())
1843 caster->RemoveAura(SPELL_PRIEST_POWER_OF_THE_DARK_SIDE);
1844 }
1845
1846 void Register() override
1847 {
1849 }
1850};
1851
1852// 114239 - Phantasm
1854{
1856 {
1858 }
1859
1860 void Register() override
1861 {
1863 }
1864};
1865
1866// 262484 - Power Leech (Passive for Shadowfiend)
1867// 284621 - Power Leech (Passive for Mindbender)
1869{
1870 bool Validate(SpellInfo const* /*spellInfo*/) override
1871 {
1872 return ValidateSpellInfo
1873 ({
1881 })
1883 ({
1888 });
1889 }
1890
1891 static bool CheckProc(ProcEventInfo const& eventInfo)
1892 {
1893 return eventInfo.GetDamageInfo() != nullptr;
1894 }
1895
1896 void HandleOnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) const
1897 {
1898 Unit* target = GetTarget();
1899 Player* summoner = Object::ToPlayer(target->GetOwner());
1900 if (!summoner)
1901 return;
1902
1903 SpellInfo const* spellInfo = nullptr;
1904 int32 divisor = 1;
1905
1907 {
1908 if (target->GetEntry() == NPC_PRIEST_SHADOWFIEND)
1909 {
1910 // Note: divisor is 100 because effect value is 5 and its supposed to restore 0.5%
1912 divisor = 10;
1913 }
1914 else
1915 {
1916 // Note: divisor is 100 because effect value is 20 and its supposed to restore 0.2%
1918 divisor = 100;
1919 }
1920 }
1921 else
1922 spellInfo = sSpellMgr->AssertSpellInfo(target->GetEntry() == NPC_PRIEST_SHADOWFIEND
1925
1926 target->CastSpell(summoner, spellInfo->Id, CastSpellExtraArgs(aurEff)
1927 .AddSpellMod(SPELLVALUE_BASE_POINT0, spellInfo->GetEffect(EFFECT_0).CalcValue() / divisor));
1928
1929 // Note: Essence Devourer talent.
1932 }
1933
1934 void Register() override
1935 {
1938 }
1939};
1940
1941// 198069 - Power of the Dark Side
1943{
1944 bool Validate(SpellInfo const* /*spellInfo*/) override
1945 {
1947 }
1948
1949 void HandleOnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1950 {
1951 if (Unit* caster = GetCaster())
1952 caster->CastSpell(caster, SPELL_PRIEST_POWER_OF_THE_DARK_SIDE_TINT, true);
1953 }
1954
1955 void HandleOnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1956 {
1957 if (Unit* caster = GetCaster())
1958 caster->RemoveAura(SPELL_PRIEST_POWER_OF_THE_DARK_SIDE_TINT);
1959 }
1960
1961 void Register() override
1962 {
1965 }
1966};
1967
1968// 47666 - Penance (Damage)
1969// 373130 - Dark Reprimand (Damage)
1971{
1972 bool Validate(SpellInfo const* /*spellInfo*/) override
1973 {
1975 }
1976
1977 void CalculateDamageBonus(Unit* /*victim*/, int32& /*damage*/, int32& /*flatMod*/, float& pctMod) const
1978 {
1979 if (AuraEffect* powerOfTheDarkSide = GetCaster()->GetAuraEffect(SPELL_PRIEST_POWER_OF_THE_DARK_SIDE, EFFECT_0))
1980 AddPct(pctMod, powerOfTheDarkSide->GetAmount());
1981 }
1982
1983 void Register() override
1984 {
1986 }
1987};
1988
1989// 47750 - Penance (Healing)
1990// 400187 - Dark Reprimand (Healing)
1992{
1993 bool Validate(SpellInfo const* /*spellInfo*/) override
1994 {
1996 }
1997
1998 void CalculateHealingBonus(Unit* /*victim*/, int32& /*healing*/, int32& /*flatMod*/, float& pctMod) const
1999 {
2000 if (AuraEffect* powerOfTheDarkSide = GetCaster()->GetAuraEffect(SPELL_PRIEST_POWER_OF_THE_DARK_SIDE, EFFECT_0))
2001 AddPct(pctMod, powerOfTheDarkSide->GetAmount());
2002 }
2003
2004 void Register() override
2005 {
2007 }
2008};
2009
2010// 194509 - Power Word: Radiance
2012{
2013 bool Validate(SpellInfo const* /*spellInfo*/) override
2014 {
2016 }
2017
2018 void FilterTargets(std::list<WorldObject*>& targets)
2019 {
2020 Unit* explTarget = GetExplTargetUnit();
2021
2022 // we must add one since explicit target is always chosen.
2023 uint32 maxTargets = GetEffectInfo(EFFECT_2).CalcValue(GetCaster()) + 1;
2024
2025 if (targets.size() > maxTargets)
2026 {
2027 // priority is: a) no Atonement b) injured c) anything else (excluding explicit target which is always added).
2028 targets.sort([this, explTarget](WorldObject* lhs, WorldObject* rhs)
2029 {
2030 if (lhs == explTarget) // explTarget > anything: always true
2031 return true;
2032 if (rhs == explTarget) // anything > explTarget: always false
2033 return false;
2034
2035 return MakeSortTuple(lhs) > MakeSortTuple(rhs);
2036 });
2037
2038 targets.resize(maxTargets);
2039 }
2040
2041 for (WorldObject* target : targets)
2042 {
2043 if (target == explTarget)
2044 continue;
2045
2046 _visualTargets.push_back(target->GetGUID());
2047 }
2048 }
2049
2050 void HandleEffectHitTarget(SpellEffIndex /*effIndex*/) const
2051 {
2052 for (ObjectGuid const& guid : _visualTargets)
2053 if (Unit* target = ObjectAccessor::GetUnit(*GetHitUnit(), guid))
2055 }
2056
2057 void Register() override
2058 {
2061 }
2062
2063private:
2064 std::tuple<bool, bool> MakeSortTuple(WorldObject* obj) const
2065 {
2066 return std::make_tuple(IsUnitWithNoAtonement(obj), IsUnitInjured(obj));
2067 }
2068
2069 // Returns true if obj is a unit but has no atonement
2071 {
2072 Unit* unit = obj->ToUnit();
2073 return unit && !unit->HasAura(SPELL_PRIEST_ATONEMENT_EFFECT, GetCaster()->GetGUID());
2074 }
2075
2076 // Returns true if obj is a unit and is injured
2077 static bool IsUnitInjured(WorldObject* obj)
2078 {
2079 Unit* unit = obj->ToUnit();
2080 return unit && !unit->IsFullHealth();
2081 }
2082
2083 std::vector<ObjectGuid> _visualTargets;
2084};
2085
2086// 17 - Power Word: Shield
2088{
2089 bool Validate(SpellInfo const* /*spellInfo*/) override
2090 {
2091 return ValidateSpellInfo
2092 ({
2100 }) && ValidateSpellEffect({
2105 });
2106 }
2107
2108 void CalculateAmount(AuraEffect const* auraEffect, int32& amount, bool& canBeRecalculated) const
2109 {
2110 canBeRecalculated = false;
2111
2112 if (Unit* caster = GetCaster())
2113 {
2114 float modifiedAmount = caster->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()) * 3.36f;
2115
2116 if (Player* player = caster->ToPlayer())
2117 {
2118 AddPct(modifiedAmount, player->GetRatingBonusValue(CR_VERSATILITY_DAMAGE_DONE));
2119
2120 // Mastery: Grace (TBD: move into DoEffectCalcDamageAndHealing hook with a new SpellScript and AuraScript).
2121 if (AuraEffect const* masteryGraceEffect = caster->GetAuraEffect(SPELL_PRIEST_MASTERY_GRACE, EFFECT_0))
2123 AddPct(modifiedAmount, masteryGraceEffect->GetAmount());
2124
2125 switch (player->GetPrimarySpecialization())
2126 {
2128 modifiedAmount *= 1.37f;
2129 break;
2131 modifiedAmount *= 1.25f;
2132 if (caster->HasAura(SPELL_PVP_RULES_ENABLED_HARDCODED))
2133 modifiedAmount *= 0.8f;
2134 break;
2135 default:
2136 break;
2137 }
2138 }
2139
2140 float critChanceDone = caster->SpellCritChanceDone(nullptr, auraEffect, GetSpellInfo()->GetSchoolMask(), GetSpellInfo()->GetAttackType());
2141 float critChanceTaken = GetUnitOwner()->SpellCritChanceTaken(caster, nullptr, auraEffect, GetSpellInfo()->GetSchoolMask(), critChanceDone, GetSpellInfo()->GetAttackType());
2142
2143 if (roll_chance_f(critChanceTaken))
2144 {
2145 modifiedAmount *= 2;
2146
2147 // Divine Aegis
2148 if (AuraEffect const* divineEff = caster->GetAuraEffect(SPELL_PRIEST_DIVINE_AEGIS, EFFECT_1))
2149 AddPct(modifiedAmount, divineEff->GetAmount());
2150 }
2151
2152 // Rapture talent (TBD: move into DoEffectCalcDamageAndHealing hook).
2153 if (AuraEffect const* raptureEffect = caster->GetAuraEffect(SPELL_PRIEST_RAPTURE, EFFECT_1))
2154 AddPct(modifiedAmount, raptureEffect->GetAmount());
2155
2156 // Benevolence talent
2157 if (AuraEffect const* benevolenceEffect = caster->GetAuraEffect(SPELL_PRIEST_BENEVOLENCE, EFFECT_0))
2158 AddPct(modifiedAmount, benevolenceEffect->GetAmount());
2159
2160 amount = modifiedAmount;
2161 }
2162 }
2163
2164 void HandleOnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
2165 {
2166 Unit* caster = GetCaster();
2167 if (!caster)
2168 return;
2169
2170 // Note: Strength of Soul PvP talent.
2173 }
2174
2175 void HandleOnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
2176 {
2178
2179 // Note: Shield Discipline talent.
2180 if (Unit* caster = GetCaster())
2181 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL && caster->HasAura(SPELL_PRIEST_SHIELD_DISCIPLINE))
2182 caster->CastSpell(caster, SPELL_PRIEST_SHIELD_DISCIPLINE_EFFECT, aurEff);
2183 }
2184
2185 void Register() override
2186 {
2190 }
2191};
2192
2193// 47515 - Divine Aegis
2195{
2196 bool Validate(SpellInfo const* /*spellInfo*/) override
2197 {
2199 }
2200
2201 bool CheckProc(ProcEventInfo const& eventInfo) const
2202 {
2203 return eventInfo.GetHealInfo() != nullptr;
2204 }
2205
2206 void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo) const
2207 {
2208 Unit* caster = eventInfo.GetActor();
2209 if (!caster)
2210 return;
2211
2212 int32 aegisAmount = CalculatePct(eventInfo.GetHealInfo()->GetHeal(), aurEff->GetAmount());
2213
2214 CastSpellExtraArgs args(aurEff);
2216 args.AddSpellMod(SPELLVALUE_BASE_POINT0, aegisAmount);
2217 caster->CastSpell(eventInfo.GetProcTarget(), SPELL_PRIEST_DIVINE_AEGIS_ABSORB, args);
2218 }
2219
2220 void Register() override
2221 {
2223 }
2224};
2225
2226// 129250 - Power Word: Solace
2228{
2229 bool Validate(SpellInfo const* /*spellInfo*/) override
2230 {
2232 }
2233
2234 void RestoreMana(SpellEffIndex /*effIndex*/)
2235 {
2238 .AddSpellMod(SPELLVALUE_BASE_POINT0, GetEffectValue() / 100));
2239 }
2240
2241 void Register() override
2242 {
2244 }
2245};
2246
2247// Base class used by various Prayer of Mending spells
2249{
2250public:
2251 bool Validate(SpellInfo const* /*spellInfo*/) override
2252 {
2255 }
2256
2257 bool Load() override
2258 {
2261 return true;
2262 }
2263
2264 void CastPrayerOfMendingAura(Unit* caster, Unit* target, Unit* visualSender, uint8 stack, bool firstCast) const
2265 {
2266 CastSpellExtraArgs args;
2269
2270 // Note: this line's purpose is to show the correct amount in Points field in SMSG_AURA_UPDATE.
2272 args.AddSpellMod(SPELLVALUE_BASE_POINT0, basePoints);
2273
2274 // Note: Focused Mending talent.
2275 args.SetCustomArg(firstCast);
2276
2277 caster->CastSpell(target, SPELL_PRIEST_PRAYER_OF_MENDING_AURA, args);
2278
2279 // Note: the visualSender is the priest if it is first cast or the aura holder when the aura triggers.
2280 visualSender->SendPlaySpellVisual(target, SPELL_VISUAL_PRIEST_PRAYER_OF_MENDING, 0, 0, 40.0f);
2281 }
2282
2283protected:
2284 SpellInfo const* _spellInfoHeal = nullptr;
2286};
2287
2288// 33076 - Prayer of Mending (Dummy)
2290{
2291 bool Validate(SpellInfo const* /*spellInfo*/) override
2292 {
2293 return ValidateSpellInfo
2294 ({
2298 });
2299 }
2300
2301 void HandleEffectDummy(SpellEffIndex /*effIndex*/) const
2302 {
2303 Unit* caster = GetCaster();
2304 Unit* target = GetHitUnit();
2305
2306 // Note: we need to increase BasePoints by 1 since it's 4 as default. Also HACKFIX, we shouldn't reduce it by 1 if the target has the aura already.
2307 uint8 stackAmount = target->HasAura(SPELL_PRIEST_PRAYER_OF_MENDING_AURA, caster->GetGUID()) ? GetEffectValue() : GetEffectValue() + 1;
2308
2309 CastPrayerOfMendingAura(caster, target, caster, stackAmount, true);
2310
2311 // Note: Epiphany talent.
2312 if (caster->HasAura(SPELL_PRIEST_EPIPHANY))
2314 }
2315
2316 void Register() override
2317 {
2319 }
2320};
2321
2322// 41635 - Prayer of Mending (Aura)
2324{
2325 bool Validate(SpellInfo const* /*spellInfo*/) override
2326 {
2329 }
2330
2331 void HandleHeal(AuraEffect const* aurEff, ProcEventInfo const& /*eventInfo*/)
2332 {
2333 // Note: caster is the priest who cast the spell and target is current holder of the aura.
2334 Unit* target = GetTarget();
2335
2336 if (Unit* caster = GetCaster())
2337 {
2338 CastSpellExtraArgs args(aurEff);
2340
2341 caster->CastSpell(target, SPELL_PRIEST_PRAYER_OF_MENDING_HEAL, args);
2342
2343 // Note: jump is only executed if higher than 1 stack.
2344 int32 stackAmount = GetStackAmount();
2345 if (stackAmount > 1)
2346 {
2347 args.OriginalCaster = caster->GetGUID();
2348
2349 int32 newStackAmount = stackAmount - 1;
2350 if (AuraEffect* sayYourPrayers = caster->GetAuraEffect(SPELL_PRIEST_SAY_YOUR_PRAYERS, EFFECT_0))
2351 if (roll_chance_i(sayYourPrayers->GetAmount()))
2352 ++newStackAmount;
2353
2354 args.AddSpellMod(SPELLVALUE_BASE_POINT0, newStackAmount);
2355
2356 target->CastSpell(target, SPELL_PRIEST_PRAYER_OF_MENDING_JUMP, args);
2357 }
2358
2359 Remove();
2360 }
2361 }
2362
2363 void Register() override
2364 {
2366 }
2367
2368public:
2369 void SetEmpoweredByFocusedMending(bool isEmpowered)
2370 {
2371 _isEmpoweredByFocusedMending = isEmpowered;
2372 }
2373
2374private:
2376};
2377
2379{
2380 void HandleEffectDummy(SpellEffIndex /*effIndex*/) const
2381 {
2382 Aura* aura = GetHitAura();
2383 if (!aura)
2384 return;
2385
2387 if (!script)
2388 return;
2389
2390 if (bool const* isEmpoweredByFocusedMending = std::any_cast<bool>(&GetSpell()->m_customArg))
2391 script->SetEmpoweredByFocusedMending(isEmpoweredByFocusedMending);
2392 }
2393
2394 void Register() override
2395 {
2397 }
2398};
2399
2400// 155793 - Prayer of Mending (Jump)
2402{
2403 static void FilterTargets(std::list<WorldObject*>& targets)
2404 {
2405 // Note: priority list is a) players b) non-player units. Also, this spell became smartheal in WoD.
2406 Trinity::SelectRandomInjuredTargets(targets, 1, true);
2407 }
2408
2409 void HandleJump(SpellEffIndex /*effIndex*/) const
2410 {
2411 if (Unit* origCaster = GetOriginalCaster())
2412 CastPrayerOfMendingAura(origCaster, GetHitUnit(), GetCaster(), GetEffectValue(), false);
2413 }
2414
2415 void Register() override
2416 {
2419 }
2420};
2421
2422// 193063 - Protective Light (Aura)
2424{
2425 bool CheckEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
2426 {
2427 return eventInfo.GetProcTarget() == GetCaster();
2428 }
2429
2430 void HandleEffectProc(AuraEffect* aurEff, ProcEventInfo& /*eventInfo*/)
2431 {
2433 }
2434
2435 void Register() override
2436 {
2439 }
2440};
2441
2442// 405554 - Priest Holy 10.1 Class Set 2pc
2444{
2445 bool Validate(SpellInfo const* /*spellInfo*/) override
2446 {
2449 }
2450
2451 static bool CheckProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
2452 {
2453 return roll_chance_i(aurEff->GetAmount());
2454 }
2455
2456 void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo) const
2457 {
2458 CastSpellExtraArgs args(aurEff);
2459 args.SetTriggeringSpell(eventInfo.GetProcSpell());
2461
2463 }
2464
2465 void Register() override
2466 {
2469 }
2470};
2471
2472// 411097 - Priest Holy 10.1 Class Set 2pc (Chooser)
2474{
2475 bool Validate(SpellInfo const* /*spellInfo*/) override
2476 {
2478 }
2479
2480 static void FilterTargets(std::list<WorldObject*>& targets)
2481 {
2482 Trinity::SelectRandomInjuredTargets(targets, 1, true);
2483 }
2484
2485 void HandleEffectDummy(SpellEffIndex /*effIndex*/) const
2486 {
2487 Unit* caster = GetCaster();
2488 Unit* target = GetHitUnit();
2489
2490 // Note: we need to increase BasePoints by 1 since it's 4 as default. Also HACKFIX, we shouldn't reduce it by 1 if the target has the aura already.
2491 uint8 stackAmount = target->HasAura(SPELL_PRIEST_PRAYER_OF_MENDING_AURA, caster->GetGUID()) ? GetEffectValue() : GetEffectValue() + 1;
2492
2493 CastPrayerOfMendingAura(caster, target, caster, stackAmount, true);
2494 }
2495
2496 void Register() override
2497 {
2500 }
2501};
2502
2503// 155793 - Prayer of Mending (Jump)
2505{
2506 bool Validate(SpellInfo const* /*spellInfo*/) override
2507 {
2509 }
2510
2511 void HandleEffectDummy(SpellEffIndex /*effIndex*/) const
2512 {
2515 }
2516
2517 void Register() override
2518 {
2520 }
2521};
2522
2523// 41635 - Prayer of Mending (Aura)
2525{
2526 bool Validate(SpellInfo const* /*spellInfo*/) override
2527 {
2529 }
2530
2531 void HandleOnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
2532 {
2533 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
2534 return;
2535
2538 }
2539
2540 void Register() override
2541 {
2543 }
2544};
2545
2546// 204197 - Purge the Wicked
2547// Called by Penance - 47540, Dark Reprimand - 400169
2549{
2550 bool Validate(SpellInfo const* /*spellInfo*/) override
2551 {
2552 return ValidateSpellInfo
2553 ({
2556 });
2557 }
2558
2559 void HandleDummy(SpellEffIndex /*effIndex*/)
2560 {
2561 Unit* caster = GetCaster();
2562 Unit* target = GetHitUnit();
2563
2566 }
2567
2568 void Register() override
2569 {
2571 }
2572};
2573
2574// 204215 - Purge the Wicked
2576{
2577 bool Validate(SpellInfo const* /*spellInfo*/) override
2578 {
2581 }
2582
2583 void FilterTargets(std::list<WorldObject*>& targets)
2584 {
2585 Unit* caster = GetCaster();
2586 Unit* explTarget = GetExplTargetUnit();
2587
2588 targets.remove_if([&](WorldObject* object) -> bool
2589 {
2590 // Note: we must remove any non-unit target, the explicit target and any other target that may be under any crowd control aura.
2591 Unit* target = object->ToUnit();
2592 return !target || target == explTarget || target->HasBreakableByDamageCrowdControlAura();
2593 });
2594
2595 if (targets.empty())
2596 return;
2597
2598 // Note: there's no SPELL_EFFECT_DUMMY with BasePoints 1 in any of the spells related to use as reference so we hardcode the value.
2599 uint32 spreadCount = 1;
2600
2601 // Note: we must sort our list of targets whose priority is 1) aura, 2) distance, and 3) duration.
2602 targets.sort([&](WorldObject const* lhs, WorldObject const* rhs) -> bool
2603 {
2604 Unit const* targetA = lhs->ToUnit();
2605 Unit const* targetB = rhs->ToUnit();
2606
2607 Aura* auraA = targetA->GetAura(SPELL_PRIEST_PURGE_THE_WICKED_PERIODIC, caster->GetGUID());
2608 Aura* auraB = targetB->GetAura(SPELL_PRIEST_PURGE_THE_WICKED_PERIODIC, caster->GetGUID());
2609
2610 if (!auraA)
2611 {
2612 if (auraB)
2613 return true;
2614 return explTarget->GetExactDist(targetA) < explTarget->GetExactDist(targetB);
2615 }
2616 if (!auraB)
2617 return false;
2618
2619 return auraA->GetDuration() < auraB->GetDuration();
2620 });
2621
2622 // Note: Revel in Purity talent.
2624 spreadCount += sSpellMgr->AssertSpellInfo(SPELL_PRIEST_REVEL_IN_PURITY, DIFFICULTY_NONE)->GetEffect(EFFECT_1).CalcValue(GetCaster());
2625
2626 if (targets.size() > spreadCount)
2627 targets.resize(spreadCount);
2628 }
2629
2630 void HandleDummy(SpellEffIndex /*effIndex*/)
2631 {
2632 Unit* caster = GetCaster();
2633 Unit* target = GetHitUnit();
2634
2636 }
2637
2638 void Register() override
2639 {
2642 }
2643};
2644
2645// 47536 - Rapture
2647{
2648 bool Validate(SpellInfo const* /*spellInfo*/) override
2649 {
2651 }
2652
2654 {
2656 }
2657
2659 {
2660 Unit* caster = GetCaster();
2661
2662 if (Unit* target = ObjectAccessor::GetUnit(*caster, _raptureTarget))
2665 .SetTriggeringSpell(GetSpell()));
2666 }
2667
2668 void Register() override
2669 {
2672 }
2673
2674private:
2676};
2677
2678// 8092 - Mind Blast
2680{
2681 bool Validate(SpellInfo const* /*spellInfo*/) override
2682 {
2683 return ValidateSpellInfo
2684 ({
2687 });
2688 }
2689
2691 {
2694 }
2695
2696 void Register() override
2697 {
2699 }
2700};
2701
2702// 280391 - Sins of the Many
2704{
2705 bool Validate(SpellInfo const* /*spellInfo*/) override
2706 {
2708 }
2709
2710 void HandleOnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
2711 {
2713 }
2714
2715 void HandleOnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
2716 {
2718 }
2719
2720 void Register() override
2721 {
2724 }
2725};
2726
2727// 20711 - Spirit of Redemption
2729{
2730 bool Validate(SpellInfo const* /*spellInfo*/) override
2731 {
2733 }
2734
2735 void HandleAbsorb(AuraEffect const* aurEff, DamageInfo const& /*dmgInfo*/, uint32 const& /*absorbAmount*/) const
2736 {
2737 Unit* target = GetTarget();
2738 target->CastSpell(target, SPELL_PRIEST_SPIRIT_OF_REDEMPTION, aurEff);
2739 target->SetFullHealth();
2740 }
2741
2742 void Register() override
2743 {
2745 }
2746};
2747
2748// 314867 - Shadow Covenant
2750{
2751 bool Validate(SpellInfo const* spellInfo) override
2752 {
2753 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } });
2754 }
2755
2756 void FilterTargets(std::list<WorldObject*>& targets) const
2757 {
2758 // remove explicit target (will be readded later)
2760
2761 // we must remove one since explicit target is always added.
2762 uint32 maxTargets = uint32(GetEffectInfo(EFFECT_2).CalcValue(GetCaster()) - 1);
2763
2764 Trinity::SelectRandomInjuredTargets(targets, maxTargets, true);
2765
2766 if (Unit* explicitTarget = GetExplTargetUnit())
2767 targets.push_front(explicitTarget);
2768 }
2769
2770 void Register() override
2771 {
2773 }
2774};
2775
2776// 186263 - Shadow Mend
2778{
2779 bool Validate(SpellInfo const* /*spellInfo*/) override
2780 {
2781 return ValidateSpellInfo
2782 ({
2789 });
2790 }
2791
2793 {
2794 if (Unit* target = GetHitUnit())
2795 {
2796 Unit* caster = GetCaster();
2797
2798 int32 periodicAmount = GetHitHeal() / 20;
2799 int32 damageForAuraRemoveAmount = periodicAmount * 10;
2800
2801 // Handle Masochism talent
2802 if (caster->HasAura(SPELL_PRIEST_MASOCHISM_TALENT) && caster->GetGUID() == target->GetGUID())
2804 else if (target->IsInCombat() && periodicAmount)
2805 {
2808 args.AddSpellMod(SPELLVALUE_BASE_POINT0, periodicAmount);
2809 args.AddSpellMod(SPELLVALUE_BASE_POINT1, damageForAuraRemoveAmount);
2811 }
2812 }
2813 }
2814
2815 void Register() override
2816 {
2818 }
2819};
2820
2821// 187464 - Shadow Mend (Damage)
2823{
2824 bool Validate(SpellInfo const* /*spellInfo*/) override
2825 {
2827 }
2828
2829 void HandleDummyTick(AuraEffect const* aurEff)
2830 {
2833 args.SetTriggeringAura(aurEff);
2836 }
2837
2838 bool CheckProc(ProcEventInfo& eventInfo)
2839 {
2840 return eventInfo.GetDamageInfo() != nullptr;
2841 }
2842
2843 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2844 {
2845 int32 newAmount = aurEff->GetAmount() - eventInfo.GetDamageInfo()->GetDamage();
2846
2847 aurEff->ChangeAmount(newAmount);
2848 if (newAmount < 0)
2849 Remove();
2850 }
2851
2852 void Register() override
2853 {
2857 }
2858};
2859
2860// 109186 - Surge of Light
2862{
2863 bool Validate(SpellInfo const* /*spellInfo*/) override
2864 {
2865 return ValidateSpellInfo
2866 ({
2869 });
2870 }
2871
2872 bool CheckProc(ProcEventInfo& eventInfo)
2873 {
2874 if (eventInfo.GetSpellInfo()->Id == SPELL_PRIEST_SMITE)
2875 return true;
2876
2878 return eventInfo.GetHealInfo();
2879
2880 return false;
2881 }
2882
2883 void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
2884 {
2885 if (roll_chance_i(aurEff->GetAmount()))
2887 }
2888
2889 void Register() override
2890 {
2893 }
2894};
2895
2896// 28809 - Greater Heal
2898{
2899 bool Validate(SpellInfo const* /*spellInfo*/) override
2900 {
2902 }
2903
2904 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2905 {
2907 eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_PRIEST_ARMOR_OF_FAITH, aurEff);
2908 }
2909
2910 void Register() override
2911 {
2913 }
2914};
2915
2916// 37594 - Greater Heal Refund
2918{
2919 bool Validate(SpellInfo const* /*spellInfo*/) override
2920 {
2922 }
2923
2924 bool CheckProc(ProcEventInfo& eventInfo)
2925 {
2926 if (HealInfo* healInfo = eventInfo.GetHealInfo())
2927 if (Unit* healTarget = healInfo->GetTarget())
2928 if (healInfo->GetEffectiveHeal())
2929 if (healTarget->GetHealth() >= healTarget->GetMaxHealth())
2930 return true;
2931
2932 return false;
2933 }
2934
2935 void HandleProc(AuraEffect* aurEff, ProcEventInfo& /*eventInfo*/)
2936 {
2939 }
2940
2941 void Register() override
2942 {
2945 }
2946};
2947
2948// 70770 - Item - Priest T10 Healer 2P Bonus
2950{
2951 bool Validate(SpellInfo const* /*spellInfo*/) override
2952 {
2954 }
2955
2956 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2957 {
2959
2960 HealInfo* healInfo = eventInfo.GetHealInfo();
2961 if (!healInfo || !healInfo->GetHeal())
2962 return;
2963
2964 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_PRIEST_BLESSED_HEALING, GetCastDifficulty());
2965 int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), aurEff->GetAmount());
2966
2967 ASSERT(spellInfo->GetMaxTicks() > 0);
2968 amount /= spellInfo->GetMaxTicks();
2969
2970 Unit* caster = eventInfo.GetActor();
2971 Unit* target = eventInfo.GetProcTarget();
2972
2973 CastSpellExtraArgs args(aurEff);
2974 args.AddSpellBP0(amount);
2975 caster->CastSpell(target, SPELL_PRIEST_BLESSED_HEALING, args);
2976 }
2977
2978 void Register() override
2979 {
2981 }
2982};
2983
2984// 200128 - Trail of Light
2986{
2987 bool Validate(SpellInfo const* /*spellInfo*/) override
2988 {
2990 }
2991
2992 bool CheckProc(ProcEventInfo& eventInfo)
2993 {
2994 if (_healQueue.empty() || _healQueue.back() != eventInfo.GetActionTarget()->GetGUID())
2995 _healQueue.push(eventInfo.GetActionTarget()->GetGUID());
2996
2997 if (_healQueue.size() > 2)
2998 _healQueue.pop();
2999
3000 if (_healQueue.size() == 2)
3001 return true;
3002
3003 return false;
3004 }
3005
3006 void HandleOnProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
3007 {
3008 Unit* caster = GetTarget();
3009 Unit* oldTarget = ObjectAccessor::GetUnit(*caster, _healQueue.front());
3010 if (!oldTarget)
3011 return;
3012
3013 // Note: old target may not be friendly anymore due to charm and faction change effects.
3014 if (!caster->IsValidAssistTarget(oldTarget))
3015 return;
3016
3017 SpellInfo const* healSpellInfo = sSpellMgr->GetSpellInfo(SPELL_PRIEST_TRAIL_OF_LIGHT_HEAL, DIFFICULTY_NONE);
3018 if (!healSpellInfo)
3019 return;
3020
3021 // Note: distance may be greater than the heal's spell range.
3022 if (!caster->IsWithinDist(oldTarget, healSpellInfo->GetMaxRange(true, caster)))
3023 return;
3024
3025 uint32 healAmount = CalculatePct(eventInfo.GetHealInfo()->GetHeal(), aurEff->GetAmount());
3026
3027 caster->CastSpell(oldTarget, SPELL_PRIEST_TRAIL_OF_LIGHT_HEAL, CastSpellExtraArgs(aurEff).AddSpellBP0(healAmount));
3028 }
3029
3030 void Register() override
3031 {
3034 }
3035
3036private:
3037 std::queue<ObjectGuid> _healQueue;
3038};
3039
3040// 390693 - Train of Thought
3041// Called by Flash Heal, Renew, Smite
3043{
3044 bool Validate(SpellInfo const* /*spellInfo*/) override
3045 {
3046 return ValidateSpellInfo
3047 ({
3050 });
3051 }
3052
3053 bool CheckEffect0(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
3054 {
3055 // Renew & Flash Heal
3056 return eventInfo.GetSpellInfo()->IsAffected(SPELLFAMILY_PRIEST, { 0x840 });
3057 }
3058
3059 bool CheckEffect1(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
3060 {
3061 // Smite
3062 return eventInfo.GetSpellInfo()->IsAffected(SPELLFAMILY_PRIEST, { 0x80 });
3063 }
3064
3065 void ReducePowerWordShieldCooldown(AuraEffect const* aurEff, ProcEventInfo const& /*eventInfo*/) const
3066 {
3068 }
3069
3070 void ReducePenanceCooldown(AuraEffect const* aurEff, ProcEventInfo const& /*eventInfo*/) const
3071 {
3073 }
3074
3075 void Register() override
3076 {
3081 }
3082};
3083
3084// 109142 - Twist of Fate (Shadow)
3085// 265259 - Twist of Fate (Discipline)
3087{
3088 bool CheckProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
3089 {
3090 return eventInfo.GetProcTarget()->GetHealthPct() < aurEff->GetAmount();
3091 }
3092
3093 void Register() override
3094 {
3096 }
3097};
3098
3099// 15286 - Vampiric Embrace
3101{
3102 bool Validate(SpellInfo const* /*spellInfo*/) override
3103 {
3105 }
3106
3107 bool CheckProc(ProcEventInfo& eventInfo)
3108 {
3109 // Not proc from Mind Sear
3110 return !(eventInfo.GetDamageInfo()->GetSpellInfo()->SpellFamilyFlags[1] & 0x80000);
3111 }
3112
3114 {
3116 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
3117 if (!damageInfo || !damageInfo->GetDamage())
3118 return;
3119
3120 int32 selfHeal = int32(CalculatePct(damageInfo->GetDamage(), aurEff->GetAmount()));
3121 int32 teamHeal = selfHeal / 2;
3122
3123 CastSpellExtraArgs args(aurEff);
3124 args.AddSpellMod(SPELLVALUE_BASE_POINT0, teamHeal);
3125 args.AddSpellMod(SPELLVALUE_BASE_POINT1, selfHeal);
3127 }
3128
3129 void Register() override
3130 {
3133 }
3134};
3135
3136// 15290 - Vampiric Embrace (heal)
3138{
3139 void FilterTargets(std::list<WorldObject*>& unitList)
3140 {
3141 unitList.remove(GetCaster());
3142 }
3143
3144 void Register() override
3145 {
3147 }
3148};
3149
3150// 34914 - Vampiric Touch
3152{
3153 bool Validate(SpellInfo const* /*spellInfo*/) override
3154 {
3156 }
3157
3158 void HandleDispel(DispelInfo* dispelInfo)
3159 {
3160 if (Unit* caster = GetCaster())
3161 caster->CastSpell(dispelInfo->GetDispeller(), SPELL_PRIEST_SIN_AND_PUNISHMENT, true);
3162 }
3163
3164 void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
3165 {
3166 if (Unit* caster = GetCaster())
3167 if (caster->HasAura(SPELL_PRIEST_MISERY))
3168 caster->CastSpell(GetTarget(), SPELL_PRIEST_SHADOW_WORD_PAIN, true);
3169 }
3170
3171 void Register() override
3172 {
3175 }
3176};
3177
3179{
3260}
@ DIFFICULTY_NONE
Definition: DBCEnums.h:874
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:32
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:29
#define ASSERT
Definition: Errors.h:68
#define TC_LOG_WARN(filterType__,...)
Definition: Log.h:162
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
bool roll_chance_f(float chance)
Definition: Random.h:53
bool roll_chance_i(int chance)
Definition: Random.h:59
if(posix_memalign(&__mallocedMemory, __align, __size)) return NULL
#define RegisterSpellAndAuraScriptPair(script_1, script_2)
Definition: ScriptMgr.h:1371
#define RegisterAreaTriggerAI(ai_name)
Definition: ScriptMgr.h:1416
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
#define RegisterSpellScriptWithArgs(spell_script, script_name,...)
Definition: ScriptMgr.h:1368
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_3
Definition: SharedDefines.h:33
@ EFFECT_1
Definition: SharedDefines.h:31
@ EFFECT_0
Definition: SharedDefines.h:30
@ EFFECT_2
Definition: SharedDefines.h:32
@ TARGET_UNIT_DEST_AREA_ALLY
@ TARGET_UNIT_CASTER_AREA_PARTY
@ TARGET_UNIT_DEST_AREA_ENEMY
@ TARGET_UNIT_SRC_AREA_ALLY
@ TARGET_UNIT_DEST_AREA_ENTRY
SpellSchoolMask
@ SPELL_SCHOOL_MASK_SHADOW
@ SPELL_SCHOOL_MASK_NONE
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_HEAL
@ SPELL_EFFECT_ENERGIZE
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ SPELL_EFFECT_APPLY_AURA
SpellCastResult
@ SPELL_FAILED_UNIT_NOT_INFRONT
@ SPELL_FAILED_BAD_TARGETS
@ SPELL_CAST_OK
@ SPELLFAMILY_PRIEST
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_BY_DEATH
@ AURA_REMOVE_BY_EXPIRE
@ AURA_REMOVE_BY_ENEMY_SPELL
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_DUMMY
@ SPELL_AURA_ADD_FLAT_MODIFIER_BY_SPELL_LABEL
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_PERIODIC_DUMMY
TriggerCastFlags
Definition: SpellDefines.h:245
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:266
@ TRIGGERED_IGNORE_POWER_AND_REAGENT_COST
Will ignore power and reagent cost.
Definition: SpellDefines.h:249
@ TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD
Will ignore Spell and Category cooldowns.
Definition: SpellDefines.h:248
@ TRIGGERED_CAST_DIRECTLY
In Spell::prepare, will be cast directly without setting containers for executed spell.
Definition: SpellDefines.h:254
@ TRIGGERED_IGNORE_CAST_IN_PROGRESS
Will not check if a current cast is in progress.
Definition: SpellDefines.h:252
@ TRIGGERED_IGNORE_GCD
Will ignore GCD.
Definition: SpellDefines.h:247
@ TRIGGERED_DISALLOW_PROC_EVENTS
Disallows proc events from triggered spell (default)
Definition: SpellDefines.h:259
@ TRIGGERED_DONT_REPORT_CAST_ERROR
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition: SpellDefines.h:265
@ SPELLVALUE_AURA_STACK
Definition: SpellDefines.h:231
@ SPELLVALUE_DURATION_PCT
Definition: SpellDefines.h:233
@ SPELLVALUE_BASE_POINT1
Definition: SpellDefines.h:197
@ SPELLVALUE_BASE_POINT0
Definition: SpellDefines.h:196
@ SPELLVALUE_DURATION
Definition: SpellDefines.h:234
#define sSpellMgr
Definition: SpellMgr.h:849
@ PROC_SPELL_TYPE_HEAL
Definition: SpellMgr.h:253
@ PROC_SPELL_TYPE_DAMAGE
Definition: SpellMgr.h:252
#define AuraProcFn(F)
Definition: SpellScript.h:2150
#define SpellCheckCastFn(F)
Definition: SpellScript.h:830
#define AuraEffectProcFn(F, I, N)
Definition: SpellScript.h:2160
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define AuraEffectCalcAmountFn(F, I, N)
Definition: SpellScript.h:2058
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
#define AuraCheckEffectProcFn(F, I, N)
Definition: SpellScript.h:2136
#define SpellCalcDamageFn(F)
Definition: SpellScript.h:879
#define SpellCastFn(F)
Definition: SpellScript.h:825
#define AuraEffectAbsorbFn(F, I)
Definition: SpellScript.h:2090
#define AuraEffectApplyFn(F, I, N, M)
Definition: SpellScript.h:2029
#define AuraEffectAbsorbOverkillFn(F, I)
Definition: SpellScript.h:2091
#define AuraCheckProcFn(F)
Definition: SpellScript.h:2130
#define SpellHitFn(F)
Definition: SpellScript.h:854
#define SPELL_AURA_ANY
Definition: SpellScript.h:59
#define SpellCalcHealingFn(F)
Definition: SpellScript.h:884
#define AuraDispelFn(F)
Definition: SpellScript.h:2018
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:2040
@ HEAL
Definition: UnitDefines.h:135
@ CR_VERSATILITY_DAMAGE_DONE
Definition: Unit.h:339
T AddPct(T &base, U pct)
Definition: Util.h:85
T CalculatePct(T base, U pct)
Definition: Util.h:72
AreaTrigger *const at
Definition: AreaTriggerAI.h:33
uint32 GetSpellId() const
Definition: AreaTrigger.h:99
void InitSplines(std::vector< G3D::Vector3 > splinePoints, uint32 timeToTarget)
void SetDuration(int32 newDuration)
Unit * GetCaster() const
static float CalculateEstimatedfTotalPeriodicAmount(Unit *caster, Unit *target, SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, float amount, uint8 stack)
void ChangeAmount(int32 newAmount, bool mark=true, bool onStackOrReapply=false, AuraEffect const *triggeredBy=nullptr)
int32 GetAmount() const
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
Definition: SpellScript.h:2039
HookList< CheckEffectProcHandler > DoCheckEffectProc
Definition: SpellScript.h:2135
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2045
SpellInfo const * GetSpellInfo() const
HookList< EffectApplyHandler > AfterEffectApply
Definition: SpellScript.h:2028
int32 GetMaxDuration() const
HookList< EffectAbsorbHandler > AfterEffectAbsorb
Definition: SpellScript.h:2096
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Definition: SpellScript.h:2057
Unit * GetCaster() const
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
AuraEffect * GetEffect(uint8 effIndex) const
HookList< EffectAbsorbHandler > OnEffectAbsorb
Definition: SpellScript.h:2089
Aura * GetAura() const
Unit * GetTarget() const
ObjectGuid GetCasterGUID() const
Difficulty GetCastDifficulty() const
HookList< CheckProcHandler > DoCheckProc
Definition: SpellScript.h:2129
HookList< EffectApplyHandler > OnEffectRemove
Definition: SpellScript.h:2035
HookList< AuraDispelHandler > AfterDispel
Definition: SpellScript.h:2017
void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
HookList< EffectProcHandler > OnEffectProc
Definition: SpellScript.h:2155
Unit * GetUnitOwner() const
HookList< AuraProcHandler > OnProc
Definition: SpellScript.h:2145
uint8 GetStackAmount() const
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:2024
uint32 GetId() const
int32 GetDuration() const
Definition: SpellAuras.h:173
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, bool resetPeriodicTimer=true)
int32 CalcMaxDuration() const
Definition: SpellAuras.h:170
void SetDuration(int32 duration, bool withMods=false)
Definition: SpellAuras.cpp:892
uint8 GetStackAmount() const
Definition: SpellAuras.h:189
void SetMaxDuration(int32 duration)
Definition: SpellAuras.h:169
Script * GetScript() const
Definition: SpellAuras.h:301
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
Unit * GetAttacker() const
Definition: Unit.h:440
SpellInfo const * GetSpellInfo() const
Definition: Unit.h:442
SpellSchoolMask GetSchoolMask() const
Definition: Unit.h:443
uint32 GetDamage() const
Definition: Unit.h:446
WorldObject * GetDispeller() const
Definition: Unit.h:390
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
Definition: Unit.h:456
uint32 GetHeal() const
Definition: Unit.h:476
static Unit * ToUnit(Object *o)
Definition: Object.h:225
Player * ToPlayer()
Definition: Object.h:215
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
static Player * ToPlayer(Object *o)
Definition: Object.h:213
Movement::PointsArray const & GetPath() const
Definition: PathGenerator.h:81
bool CalculatePath(float destX, float destY, float destZ, bool forceDest=false)
ChrSpecialization GetPrimarySpecialization() const
Definition: Player.h:1841
HealInfo * GetHealInfo() const
Definition: Unit.h:506
Unit * GetActionTarget() const
Definition: Unit.h:494
ProcFlagsSpellType GetSpellTypeMask() const
Definition: Unit.h:498
Spell const * GetProcSpell() const
Definition: Unit.h:508
SpellInfo const * GetSpellInfo() const
Definition: Unit.cpp:280
DamageInfo * GetDamageInfo() const
Definition: Unit.h:505
Unit * GetProcTarget() const
Definition: Unit.h:495
Unit * GetActor() const
Definition: Unit.h:493
Unit const * _caster
RaidCheck(Unit const *caster)
bool operator()(WorldObject *obj) const
void SetDst(float x, float y, float z, float orientation, uint32 mapId=MAPID_INVALID)
Definition: Spell.cpp:373
void SetUnitTarget(Unit *target)
Definition: Spell.cpp:226
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
Definition: SpellInfo.cpp:495
float CalcRadius(WorldObject *caster=nullptr, SpellTargetIndex targetIndex=SpellTargetIndex::TargetA, Spell *=nullptr) const
Definition: SpellInfo.cpp:673
SpellImplicitTargetInfo TargetB
Definition: SpellInfo.h:232
void ResetCooldown(uint32 spellId, bool update=false)
void ModifyCooldown(uint32 spellId, Duration cooldownMod, bool withoutCategoryCooldown=false)
Targets GetTarget() const
Definition: SpellInfo.cpp:132
uint32 GetMaxTicks() const
Definition: SpellInfo.cpp:3823
bool IsAffected(uint32 familyName, flag128 const &familyFlags) const
Definition: SpellInfo.cpp:1795
float GetMaxRange(bool positive=false, WorldObject *caster=nullptr, Spell *spell=nullptr) const
Definition: SpellInfo.cpp:3768
uint32 const Id
Definition: SpellInfo.h:325
flag128 SpellFamilyFlags
Definition: SpellInfo.h:409
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition: SpellInfo.h:577
std::vector< SpellEffectInfo > const & GetEffects() const
Definition: SpellInfo.h:576
uint32 SpellFamilyName
Definition: SpellInfo.h:408
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
static bool ValidateSpellEffect(std::initializer_list< std::pair< uint32, SpellEffIndex > > effects)
Definition: SpellScript.h:173
HookList< DamageAndHealingCalcHandler > CalcDamage
Definition: SpellScript.h:878
HookList< CastHandler > AfterCast
Definition: SpellScript.h:824
WorldLocation * GetHitDest() const
HookList< CheckCastHandler > OnCheckCast
Definition: SpellScript.h:829
Unit * GetCaster() const
HookList< HitHandler > AfterHit
Definition: SpellScript.h:852
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:839
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
int32 GetEffectValue() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
Aura * GetHitAura(bool dynObjAura=false) const
Spell * GetSpell() const
Definition: SpellScript.h:987
WorldObject * GetExplTargetWorldObject() const
Difficulty GetCastDifficulty() const
int32 GetHitHeal() const
HookList< EffectHandler > OnEffectLaunch
Definition: SpellScript.h:837
HookList< DamageAndHealingCalcHandler > CalcHealing
Definition: SpellScript.h:883
Unit * GetExplTargetUnit() const
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
Unit * GetOriginalCaster() const
SpellCastTargets m_targets
Definition: Spell.h:607
TaskContext & Repeat(std::chrono::duration< Rep, Period > duration)
TaskScheduler & Schedule(std::chrono::duration< Rep, Period > time, task_handler_t task)
TaskScheduler & Update(success_t const &callback=nullptr)
Definition: Unit.h:627
float GetHealthPct() const
Definition: Unit.h:784
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3685
void SetFullHealth()
Definition: Unit.h:790
bool HasBreakableByDamageCrowdControlAura(Unit *excludeCasterChannel=nullptr) const
Definition: Unit.cpp:734
Aura * GetOwnedAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, Aura *except=nullptr) const
Definition: Unit.cpp:3669
Powers GetPowerType() const
Definition: Unit.h:799
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition: Unit.cpp:4464
bool IsFullHealth() const
Definition: Unit.h:779
TempSummon * ToTempSummon()
Definition: Unit.h:1756
ControlList m_Controlled
Definition: Unit.h:1211
virtual bool HasSpell(uint32) const
Definition: Unit.h:1069
void SendPlaySpellVisual(Unit *target, uint32 spellVisualId, uint16 missReason, uint16 reflectStatus, float travelSpeed, bool speedAsTime=false, float launchDelay=0.0f)
Definition: Unit.cpp:11674
float SpellCritChanceTaken(Unit const *caster, Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, float doneChance, WeaponAttackType attackType=BASE_ATTACK) const
Definition: Unit.cpp:6985
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4560
uint64 GetHealth() const
Definition: Unit.h:776
void NearTeleportTo(Position const &pos, bool casting=false)
Definition: Unit.cpp:12327
uint64 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:785
bool IsInRaidWith(Unit const *unit) const
Definition: Unit.cpp:11546
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4664
SpellHistory * GetSpellHistory()
Definition: Unit.h:1457
void RemoveMovementImpairingAuras(bool withRoot)
Definition: Unit.cpp:4154
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
int32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, int32 healamount, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, uint32 stack=1, Spell *spell=nullptr, AuraEffect const *aurEff=nullptr) const
Definition: Unit.cpp:7138
ObjectGuid GetTarget() const
Definition: Unit.h:1759
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
bool IsValidAttackTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
Definition: Object.cpp:2991
void MovePositionToFirstCollision(Position &pos, float dist, float angle)
Definition: Object.cpp:3482
Unit * GetOwner() const
Definition: Object.cpp:2229
bool isInFront(WorldObject const *target, float arc=float(M_PI)) const
Definition: Object.cpp:1321
Position GetRandomNearPosition(float radius)
Definition: Object.cpp:3423
bool IsValidAssistTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
Definition: Object.cpp:3144
EventProcessor m_Events
Definition: Object.h:777
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1078
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition: Object.cpp:1142
bool IsFriendlyTo(WorldObject const *target) const
Definition: Object.cpp:2865
void CalculateHealingBonus(Unit const *, int32 const &, int32 const &, float &pctMod) const
bool Validate(SpellInfo const *) override
void HandleEffectDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleOnProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo) const
bool Validate(SpellInfo const *spellInfo) override
bool Validate(SpellInfo const *) override
void Register() override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void HandleOnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleOnApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleOnProc(AuraEffect const *, ProcEventInfo const &eventInfo) const
static bool CheckProc(ProcEventInfo const &eventInfo)
bool Validate(SpellInfo const *) override
void AddAtonementTarget(ObjectGuid const &target)
void UpdateSinsOfTheManyValue() const
void TriggerAtonementHealOnTargets(AuraEffect const *atonementEffect, ProcEventInfo const &eventInfo)
void RemoveAtonementTarget(ObjectGuid const &target)
std::vector< ObjectGuid > const & GetAtonementTargets() const
void HandleOnProc(AuraEffect const *aurEff, ProcEventInfo const &eventInfo)
static bool CheckProc(ProcEventInfo const &eventInfo)
void Register() override
std::vector< ObjectGuid > _appliedAtonements
bool Validate(SpellInfo const *spellInfo) override
void Register() override
bool Validate(SpellInfo const *) override
void HandleEffectHitTarget(SpellEffIndex) const
void HandleProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void Register() override
bool Validate(SpellInfo const *spellInfo) override
void FilterTargets(std::list< WorldObject * > &targets)
void HandleAfterAbsorb(AuraEffect const *, DamageInfo const &dmgInfo, uint32 const &absorbAmount) const
bool Validate(SpellInfo const *) override
void HandleOnApply(AuraEffect const *aurEff, AuraEffectHandleModes) const
bool Validate(SpellInfo const *) override
void HandleEffectHit(SpellEffIndex) const
void Register() override
bool CheckProc(ProcEventInfo const &eventInfo) const
void HandleProc(AuraEffect const *aurEff, ProcEventInfo const &eventInfo) const
bool Validate(SpellInfo const *) override
static bool CheckProc(ProcEventInfo const &eventInfo)
void HandleAfterRemove(AuraEffect const *, AuraEffectHandleModes) const
bool Validate(SpellInfo const *) override
void TrackStackApplicationTime(AuraEffect const *, AuraEffectHandleModes) const
bool Validate(SpellInfo const *) override
static void HandleProc(AuraEffect const *aurEff, ProcEventInfo const &eventInfo)
void Register() override
void Register() override
bool Validate(SpellInfo const *) override
void CalculateHealingBonus(Unit const *victim, int32 &, int32 &, float &pctMod) const
void HandleHitTarget(SpellEffIndex effIndex)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleOnProc(AuraEffect const *aurEff, ProcEventInfo &) const
void Register() override
bool Validate(SpellInfo const *) override
static bool CheckProc(AuraEffect const *aurEff, ProcEventInfo &)
static void FilterTargets(std::list< WorldObject * > &targets)
void HandleScriptEffect(SpellEffIndex) const
void Register() override
bool Validate(SpellInfo const *) override
void CalculateHealingBonus(Unit *, int32 &, int32 &, float &pctMod) const
bool Validate(SpellInfo const *) override
void HandleEffectProc(AuraEffect *aurEff, ProcEventInfo &)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
void Absorb(AuraEffect *, DamageInfo &dmgInfo, uint32 &absorbAmount)
bool Validate(SpellInfo const *spellInfo) override
void HandleHitTarget(SpellEffIndex effIndex)
void Register() override
void HandleEffectProc(AuraEffect const *aurEff, ProcEventInfo const &eventInfo) const
bool CheckProc(ProcEventInfo const &eventInfo) const
void Register() override
bool Validate(SpellInfo const *) override
void HandleEffectDummy(SpellEffIndex) const
bool Validate(SpellInfo const *) override
static void FilterTargets(std::list< WorldObject * > &targets)
static bool CheckProc(AuraEffect const *aurEff, ProcEventInfo &)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo const &eventInfo) const
void HandleOnRemove(AuraEffect const *aurEff, AuraEffectHandleModes) const
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleEffectDummy(SpellEffIndex) const
bool CheckProc(AuraEffect const *, ProcEventInfo &procInfo)
bool Validate(SpellInfo const *) override
void Register() override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
SpellEffectInfo const * _healEffectDummy
SpellInfo const * _spellInfoHeal
bool Validate(SpellInfo const *spellInfo) override
void HandleApplyBuffs(SpellEffIndex) const
bool Validate(SpellInfo const *) override
void Register() override
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
void Register() override
bool Validate(SpellInfo const *) override
void CalculateDamageBonus(Unit const *, int32 const &, int32 const &, float &pctMod) const
void OnPrecast() override
bool Validate(SpellInfo const *spellInfo) override
void Register() override
void Register() override
void RemoveEffect(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleHit(SpellEffIndex) const
bool Validate(SpellInfo const *) override
void HandleEffectProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void HandleOnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
spell_pri_penance(uint32 damageSpellId, uint32 healingSpellId)
void HandleDummy(SpellEffIndex)
void Register() override
SpellCastResult CheckCast()
bool Validate(SpellInfo const *) override
void HandleEffectHit(SpellEffIndex)
void Register() override
static bool CheckProc(ProcEventInfo const &eventInfo)
void HandleOnProc(AuraEffect const *aurEff, ProcEventInfo &) const
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void CalculateDamageBonus(Unit *, int32 &, int32 &, float &pctMod) const
void CalculateHealingBonus(Unit *, int32 &, int32 &, float &pctMod) const
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleOnApply(AuraEffect const *, AuraEffectHandleModes)
void HandleOnRemove(AuraEffect const *, AuraEffectHandleModes)
static bool IsUnitInjured(WorldObject *obj)
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
std::tuple< bool, bool > MakeSortTuple(WorldObject *obj) const
void HandleEffectHitTarget(SpellEffIndex) const
bool IsUnitWithNoAtonement(WorldObject *obj) const
std::vector< ObjectGuid > _visualTargets
void CalculateAmount(AuraEffect const *auraEffect, int32 &amount, bool &canBeRecalculated) const
void HandleOnRemove(AuraEffect const *aurEff, AuraEffectHandleModes) const
void HandleOnApply(AuraEffect const *aurEff, AuraEffectHandleModes) const
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void RestoreMana(SpellEffIndex)
bool Validate(SpellInfo const *) override
void CastPrayerOfMendingAura(Unit *caster, Unit *target, Unit *visualSender, uint8 stack, bool firstCast) const
bool Validate(SpellInfo const *) override
void HandleHeal(AuraEffect const *aurEff, ProcEventInfo const &)
void SetEmpoweredByFocusedMending(bool isEmpowered)
void HandleEffectDummy(SpellEffIndex) const
bool Validate(SpellInfo const *) override
void HandleJump(SpellEffIndex) const
static void FilterTargets(std::list< WorldObject * > &targets)
void HandleEffectDummy(SpellEffIndex) const
void HandleEffectProc(AuraEffect *aurEff, ProcEventInfo &)
bool CheckEffectProc(AuraEffect const *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
void Register() override
bool Validate(SpellInfo const *) override
void HandleEffectDummy(SpellEffIndex)
ObjectGuid _raptureTarget
void Register() override
void HandleEffectHitTarget(SpellEffIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *spellInfo) override
void FilterTargets(std::list< WorldObject * > &targets) const
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
void HandleDummyTick(AuraEffect const *aurEff)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void Register() override
bool Validate(SpellInfo const *) override
void HandleOnApply(AuraEffect const *, AuraEffectHandleModes)
void HandleOnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleAbsorb(AuraEffect const *aurEff, DamageInfo const &, uint32 const &) const
bool Validate(SpellInfo const *) override
void HandleEffectProc(AuraEffect const *aurEff, ProcEventInfo &)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void Register() override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleOnProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
std::queue< ObjectGuid > _healQueue
bool CheckEffect1(AuraEffect const *, ProcEventInfo const &eventInfo) const
bool CheckEffect0(AuraEffect const *, ProcEventInfo const &eventInfo) const
void ReducePenanceCooldown(AuraEffect const *aurEff, ProcEventInfo const &) const
bool Validate(SpellInfo const *) override
void ReducePowerWordShieldCooldown(AuraEffect const *aurEff, ProcEventInfo const &) const
bool CheckProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
void Register() override
void FilterTargets(std::list< WorldObject * > &unitList)
void HandleEffectProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleApplyEffect(AuraEffect const *, AuraEffectHandleModes)
void HandleDispel(DispelInfo *dispelInfo)
void Trigger(AuraEffect const *aurEff, ProcEventInfo const &eventInfo)
Unit * GetSummon(Unit const *owner)
Optional< uint32 > GetSpellToCast(uint32 spellId)
std::vector< Vector3 > PointsArray
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
std::list< T, Alloc >::iterator RemoveUnique(std::list< T, Alloc > &list, T const &value)
Definition: ListUtils.h:27
void SelectRandomInjuredTargets(std::list< WorldObject * > &targets, size_t maxTargets, bool prioritizePlayers, Unit const *prioritizeGroupMembersOf)
Definition: Spell.cpp:9306
PriestSpells
Definition: pet_priest.cpp:30
PriestSummons
@ NPC_PRIEST_DIVINE_IMAGE
@ NPC_PRIEST_MINDBENDER
@ NPC_PRIEST_SHADOWFIEND
void AddSC_priest_spell_scripts()
@ SPELL_PRIEST_PENANCE_HEALING
@ SPELL_PRIEST_LEVITATE_EFFECT
@ SPELL_PRIEST_DIVINE_BLESSING
@ SPELL_PRIEST_POWER_OF_THE_DARK_SIDE
@ SPELL_PRIEST_DAZZLING_LIGHT
@ SPELL_PRIEST_MINDBENDER_SHADOW
@ SPELL_PRIEST_HOLY_10_1_CLASS_SET_2P_CHOOSER
@ SPELL_PRIEST_MASTERY_GRACE
@ SPELL_PRIEST_POWER_LEECH_MINDBENDER_INSANITY
@ SPELL_PRIEST_LIGHT_ERUPTION
@ SPELL_PRIEST_HOLY_10_1_CLASS_SET_4P_EFFECT
@ SPELL_PRIEST_HALO_HOLY
@ SPELL_PRIEST_ABYSSAL_REVERIE
@ SPELL_PRIEST_ULTIMATE_PENITENCE_DAMAGE
@ SPELL_PRIEST_BLAZE_OF_LIGHT_DECREASE
@ SPELL_PRIEST_DIVINE_HYMN_HEAL
@ SPELL_PRIEST_DARK_REPRIMAND_CHANNEL_HEALING
@ SPELL_PRIEST_TRAIL_OF_LIGHT_HEAL
@ SPELL_PRIEST_HOLY_WORD_SERENITY
@ SPELL_PRIEST_SURGE_OF_LIGHT_EFFECT
@ SPELL_PRIEST_CRYSTALLINE_REFLECTION_HEAL
@ SPELL_PRIEST_DARK_REPRIMAND_CHANNEL_DAMAGE
@ SPELL_PRIEST_ANGELIC_FEATHER_AURA
@ SPELL_PRIEST_POWER_WORD_SHIELD
@ SPELL_PRIEST_PENANCE_DAMAGE
@ SPELL_PRIEST_ARMOR_OF_FAITH
@ SPELL_PRIEST_ATONEMENT_HEAL
@ SPELL_PRIEST_BODY_AND_SOUL_SPEED
@ SPELL_PRIEST_HOLY_10_1_CLASS_SET_4P
@ SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL
@ SPELL_PRIEST_PENANCE_CHANNEL_DAMAGE
@ SPELL_PRIEST_BLAZE_OF_LIGHT
@ SPELL_PRIEST_PRAYER_OF_MENDING_AURA
@ SPELL_PRIEST_FOCUSED_MENDING
@ SPELL_PRIEST_POWER_LEECH_MINDBENDER_MANA
@ SPELL_PRIEST_DIVINE_STAR_SHADOW_HEAL
@ SPELL_PRIEST_DARK_INDULGENCE
@ SPELL_PRIEST_MINDBENDER_DISC
@ SPELL_PRIEST_HOLY_NOVA
@ SPELL_PRIEST_REVEL_IN_PURITY
@ SPELL_PRIEST_SMITE
@ SPELL_PRIEST_DARK_REPRIMAND_DAMAGE
@ SPELL_PRIEST_POWER_WORD_SOLACE_ENERGIZE
@ SPELL_PRIEST_HALO_SHADOW_HEAL
@ SPELL_PRIEST_EPIPHANY
@ SPELL_PRIEST_SHIELD_DISCIPLINE
@ SPELL_PRIEST_PENANCE_CHANNEL_HEALING
@ SPELL_PRIEST_MASOCHISM_TALENT
@ SPELL_PRIEST_PENANCE
@ SPELL_PRIEST_THE_PENITENT_AURA
@ SPELL_PRIEST_DIVINE_AEGIS
@ SPELL_PRIEST_VOID_SHIELD
@ SPELL_PRIEST_MINDGAMES
@ SPELL_PRIEST_BENEVOLENCE
@ SPELL_PRIEST_EMPOWERED_RENEW_HEAL
@ SPELL_PRIEST_PRAYER_OF_HEALING
@ SPELL_PRIEST_MINDGAMES_VENTHYR
@ SPELL_PRIEST_DARK_REPRIMAND
@ SPELL_PRIEST_GREATER_HEAL
@ SPELL_PRIEST_EPIPHANY_HIGHLIGHT
@ SPELL_PRIEST_HOLY_FIRE
@ SPELL_PRIEST_PROTECTIVE_LIGHT_AURA
@ SPELL_PRIEST_HOLY_WORD_SANCTIFY
@ SPELL_PRIEST_ANGELIC_FEATHER_AREATRIGGER
@ SPELL_PRIEST_PRAYER_OF_MENDING
@ SPELL_PRIEST_FLASH_HEAL
@ SPELL_PRIEST_MIND_BOMB_STUN
@ SPELL_PRIEST_PURGE_THE_WICKED_PERIODIC
@ SPELL_PRIEST_POWER_OF_THE_DARK_SIDE_TINT
@ SPELL_PRIEST_SHADOW_WORD_PAIN
@ SPELL_PRIEST_CRYSTALLINE_REFLECTION
@ SPELL_PRIEST_ESSENCE_DEVOURER
@ SPELL_PRIEST_PAIN_TRANSFORMATION
@ SPELL_PRIEST_ORACULAR_HEAL
@ SPELL_PRIEST_MISERY
@ SPELL_PRIEST_PRAYER_OF_MENDING_HEAL
@ SPELL_PRIEST_LIGHTS_WRATH_VISUAL
@ SPELL_PRIEST_VAMPIRIC_EMBRACE_HEAL
@ SPELL_PRIEST_HALO_SHADOW_DAMAGE
@ SPELL_PRIEST_DIVINE_AEGIS_ABSORB
@ SPELL_PRIEST_DIVINE_STAR_HOLY_DAMAGE
@ SPELL_PRIEST_DARK_REPRIMAND_HEALING
@ SPELL_PRIEST_ATONEMENT_EFFECT
@ SPELL_PRIEST_HOLY_MENDING_HEAL
@ SPELL_PRIEST_PAIN_TRANSFORMATION_HEAL
@ SPELL_PRIEST_DIVINE_STAR_SHADOW_DAMAGE
@ SPELL_PRIEST_POWER_WORD_LIFE
@ SPELL_PRIEST_DIVINE_WRATH
@ SPELL_PRIEST_BLESSED_LIGHT
@ SPELL_PRIEST_DIVINE_STAR_HOLY
@ SPELL_PRIEST_DIVINE_IMAGE_EMPOWER_STACK
@ SPELL_PRIEST_SEARING_LIGHT
@ SPELL_PRIEST_ULTIMATE_PENITENCE_HEAL
@ SPELL_PRIEST_POWER_LEECH_SHADOWFIEND_MANA
@ SPELL_PRIEST_POWER_WORD_RADIANCE
@ SPELL_PRIEST_DIVINE_IMAGE_SUMMON
@ SPELL_PRIEST_DIVINE_IMAGE_EMPOWER
@ SPELL_PRIEST_DIVINE_SERVICE
@ SPELL_PRIEST_MASOCHISM_PERIODIC_HEAL
@ SPELL_PRIEST_INDEMNITY
@ SPELL_PRIEST_SCHISM
@ SPELL_PRIEST_WEAKENED_SOUL
@ SPELL_PRIEST_SPIRIT_OF_REDEMPTION
@ SPELL_PRIEST_TRINITY
@ SPELL_PRIEST_HEAL
@ SPELL_PRIEST_HALO_HOLY_DAMAGE
@ SPELL_PRIEST_SURGE_OF_LIGHT
@ SPELL_PRIEST_STRENGTH_OF_SOUL
@ SPELL_PRIEST_ANSWERED_PRAYERS
@ SPELL_PRIEST_HOLY_WORD_CHASTISE
@ SPELL_PVP_RULES_ENABLED_HARDCODED
@ SPELL_PRIEST_PURGE_THE_WICKED_DUMMY
@ SPELL_PRIEST_TRANQUIL_LIGHT
@ SPELL_PRIEST_SHIELD_DISCIPLINE_EFFECT
@ SPELL_PRIEST_RENEW
@ SPELL_PRIEST_HALO_HOLY_HEAL
@ SPELL_PRIEST_CRYSTALLINE_REFLECTION_REFLECT
@ SPELL_PRIEST_HEAVENS_WRATH
@ SPELL_PRIEST_HALO_SHADOW
@ SPELL_PRIEST_CIRCLE_OF_HEALING
@ SPELL_PRIEST_PRAYER_OF_MENDING_JUMP
@ SPELL_PRIEST_APOTHEOSIS
@ SPELL_PRIEST_POWER_LEECH_SHADOWFIEND_INSANITY
@ SPELL_PRIEST_ATONEMENT
@ SPELL_PRIEST_SINS_OF_THE_MANY
@ SPELL_PRIEST_ESSENCE_DEVOURER_MINDBENDER_HEAL
@ SPELL_PRIEST_HEALING_LIGHT
@ SPELL_PRIEST_DIVINE_STAR_SHADOW
@ SPELL_PRIEST_BLAZE_OF_LIGHT_INCREASE
@ SPELL_PRIEST_RENEWED_HOPE
@ SPELL_PRIEST_SAY_YOUR_PRAYERS
@ SPELL_PRIEST_ITEM_EFFICIENCY
@ SPELL_PRIEST_SHADOW_WORD_DEATH
@ SPELL_PRIEST_SHADOW_MEND_PERIODIC_DUMMY
@ SPELL_PRIEST_ULTIMATE_PENITENCE
@ SPELL_PRIEST_BLESSED_HEALING
@ SPELL_PRIEST_TRINITY_EFFECT
@ SPELL_PRIEST_BENEDICTION
@ SPELL_PRIEST_ESSENCE_DEVOURER_SHADOWFIEND_HEAL
@ SPELL_PRIEST_SCHISM_AURA
@ SPELL_PRIEST_RENEWED_HOPE_EFFECT
@ SPELL_PRIEST_SHADOW_MEND_DAMAGE
@ SPELL_PRIEST_VOID_SHIELD_EFFECT
@ SPELL_PRIEST_RAPTURE
@ SPELL_PRIEST_BODY_AND_SOUL
@ SPELL_PRIEST_STRENGTH_OF_SOUL_EFFECT
@ SPELL_PRIEST_LEAP_OF_FAITH_EFFECT
@ SPELL_PRIEST_PURGE_THE_WICKED
@ SPELL_PRIEST_HOLY_WORD_SALVATION
@ SPELL_PRIEST_FROM_DARKNESS_COMES_LIGHT_AURA
@ SPELL_PRIEST_SIN_AND_PUNISHMENT
@ SPELL_PRIEST_DIVINE_STAR_HOLY_HEAL
PriestSpellVisuals
@ SPELL_VISUAL_PRIEST_POWER_WORD_RADIANCE
@ SPELL_VISUAL_PRIEST_PRAYER_OF_MENDING
CastSpellExtraArgs & SetTriggeringSpell(Spell const *triggeringSpell)
Definition: Spell.cpp:9403
Difficulty CastDifficulty
Definition: SpellDefines.h:483
TriggerCastFlags TriggerFlags
Definition: SpellDefines.h:478
CastSpellExtraArgs & SetOriginalCaster(ObjectGuid const &guid)
Definition: SpellDefines.h:471
CastSpellExtraArgs & SetTriggerFlags(TriggerCastFlags flag)
Definition: SpellDefines.h:467
CastSpellExtraArgs & AddSpellBP0(int32 val)
Definition: SpellDefines.h:475
CastSpellExtraArgs & SetCustomArg(std::any customArg)
Definition: SpellDefines.h:476
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:474
ObjectGuid OriginalCaster
Definition: SpellDefines.h:482
CastSpellExtraArgs & SetTriggeringAura(AuraEffect const *triggeringAura)
Definition: Spell.cpp:9414
constexpr float GetPositionX() const
Definition: Position.h:76
constexpr float GetPositionY() const
Definition: Position.h:77
float GetExactDist(float x, float y, float z) const
Definition: Position.h:118
constexpr void GetPosition(float &x, float &y) const
Definition: Position.h:81
constexpr float GetPositionZ() const
Definition: Position.h:78
areatrigger_pri_angelic_feather(AreaTrigger *areatrigger)
void OnUnitEnter(Unit *unit) override
void OnUnitExit(Unit *unit) override
void OnUnitEnter(Unit *unit) override
void OnDestinationReached() override
void OnUpdate(uint32 diff) override
void HandleUnitEnterExit(Unit *unit)
std::vector< ObjectGuid > _affectedUnits
areatrigger_pri_divine_star(AreaTrigger *areatrigger)
void OnUnitEnter(Unit *unit) override
areatrigger_pri_halo(AreaTrigger *areatrigger)