TrinityCore
spell_druid.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_DRUID and SPELLFAMILY_GENERIC spells used by druid players.
20 * Ordered alphabetically using scriptname.
21 * Scriptnames of files in this file should be prefixed with "spell_dru_".
22 */
23
24#include "ScriptMgr.h"
25#include "CellImpl.h"
26#include "Containers.h"
27#include "DB2Stores.h"
28#include "GridNotifiersImpl.h"
29#include "ObjectAccessor.h"
30#include "Player.h"
31#include "Spell.h"
32#include "SpellAuraEffects.h"
33#include "SpellHistory.h"
34#include "SpellMgr.h"
35#include "SpellScript.h"
36
38{
126
127// 774 - Rejuvenation
128// 155777 - Rejuvenation (Germination)
130{
131 bool Validate(SpellInfo const* /*spellInfo*/) override
132 {
134 }
135
137 {
138 Unit* caster = GetCaster();
139 if (!caster || !caster->HasAura(SPELL_DRUID_ABUNDANCE))
140 return;
141
142 // Note: caster only casts Abundance when first applied on the target, otherwise that given stack is refreshed.
143 if (mode & AURA_EFFECT_HANDLE_REAL)
144 caster->CastSpell(caster, SPELL_DRUID_ABUNDANCE_EFFECT, CastSpellExtraArgs().SetTriggeringAura(aurEff));
145 else if (Aura* abundanceAura = caster->GetAura(SPELL_DRUID_ABUNDANCE_EFFECT))
146 abundanceAura->RefreshDuration();
147 }
148
149 void HandleOnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
150 {
151 Unit* caster = GetCaster();
152 if (!caster)
153 return;
154
155 if (Aura* abundanceEffect = caster->GetAura(SPELL_DRUID_ABUNDANCE_EFFECT))
156 abundanceEffect->ModStackAmount(-1);
157 }
158
159 void Register() override
160 {
163 }
164};
165
167{
168protected:
169 bool Validate(SpellInfo const* /*spellInfo*/) override
170 {
172 }
173
175 {
176 // Change into cat form
179 }
180
181 void Register() override
182 {
184 }
185
186 virtual bool ToCatForm() const = 0;
187
190};
191
192// 22812 - Barkskin
194{
195 bool Validate(SpellInfo const* /*spellInfo*/) override
196 {
198 }
199
200 void HandlePeriodic(AuraEffect const* /*aurEff*/)
201 {
202 Unit* target = GetTarget();
204 target->CastSpell(target, SPELL_DRUID_BRAMBLES_DAMAGE_AURA, true);
205 }
206
207 void Register() override
208 {
210 }
211};
212
213// 50334 - Berserk
215{
216 bool Validate(SpellInfo const* spellInfo) override
217 {
219 return false;
220
222 }
223
225 {
229 }
230
231 void Register() override
232 {
235 }
236
237protected:
238 bool ToCatForm() const override { return false; }
239};
240
241// 203953 - Brambles - SPELL_DRUID_BRAMBLES_PASSIVE
243{
244 bool Validate(SpellInfo const* /*spellInfo*/) override
245 {
247 }
248
249 void HandleAbsorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& /*absorbAmount*/)
250 {
251 // Prevent Removal
253 }
254
255 void HandleAfterAbsorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
256 {
257 // reflect back damage to the attacker
258 Unit* target = GetTarget();
259 if (Unit* attacker = dmgInfo.GetAttacker())
261 }
262
263 void Register() override
264 {
267 }
268};
269
270// 155835 - Bristling Fur
272{
273 bool Validate(SpellInfo const* /*spellInfo*/) override
274 {
276 }
277
278 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
279 {
280 // BristlingFurRage = 100 * Damage / MaxHealth.
281 if (DamageInfo* damageInfo = eventInfo.GetDamageInfo())
282 {
283 Unit* target = GetTarget();
284 uint32 rage = target->GetMaxPower(POWER_RAGE) * (float)damageInfo->GetDamage() / (float)target->GetMaxHealth();
285 if (rage > 0)
287 }
288 }
289
290 void Register() override
291 {
293 }
294};
295
296// 768 - CatForm - SPELL_DRUID_CAT_FORM
298{
299 bool Validate(SpellInfo const* /*spellInfo*/) override
300 {
302 }
303
304 void HandleAfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
305 {
307 }
308
309 void Register() override
310 {
312 }
313};
314
315// 774 - Rejuvenation
316// 155777 - Rejuventation (Germination)
318{
319 bool Validate(SpellInfo const* /*spellInfo*/) override
320 {
323 }
324
325 void HandleOnTick(AuraEffect const* aurEff) const
326 {
327 Unit* caster = GetCaster();
328 if (!caster)
329 return;
330
331 Unit* target = GetTarget();
332 if (AuraEffect const* cultivationEffect = caster->GetAuraEffect(SPELL_DRUID_CULTIVATION, EFFECT_0))
333 if (target->HealthBelowPct(cultivationEffect->GetAmount()))
334 caster->CastSpell(target, SPELL_DRUID_CULTIVATION_HEAL, CastSpellExtraArgs().SetTriggeringAura(aurEff));
335 }
336
337 void Register() override
338 {
340 }
341};
342
343// 1850 - Dash
345{
346 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
347 {
348 // do not set speed if not in cat form
349 if (GetUnitOwner()->GetShapeshiftForm() != FORM_CAT_FORM)
350 amount = 0;
351 }
352
353 void Register() override
354 {
356 }
357};
358
359// 203974 - Earthwarden
361{
362 bool Validate(SpellInfo const* /*spellInfo*/) override
363 {
365 }
366
367 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
368 {
369 Unit* target = GetTarget();
370 target->CastSpell(target, SPELL_DRUID_EARTHWARDEN_AURA, true);
371 }
372
373 void Register() override
374 {
376 }
377};
378
380{
381public:
382 static void SetSpellCount(Unit* unitOwner, uint32 spellId, uint32 amount)
383 {
384 Aura* aura = unitOwner->GetAura(spellId);
385 if (!aura)
386 unitOwner->CastSpell(unitOwner, spellId, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellMod(SPELLVALUE_AURA_STACK, amount));
387 else
388 aura->SetStackAmount(amount);
389 }
390};
391
392// 48517 Eclipse (Solar) + 48518 Eclipse (Lunar)
394{
395 bool Validate(SpellInfo const* /*spellInfo*/) override
396 {
398 }
399
400 void HandleRemoved(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
401 {
403 if (!auraEffDummy)
404 return;
405
408 }
409
410 void Register() override
411 {
413 }
414};
415
416// 79577 - Eclipse - SPELL_DRUID_ECLIPSE_DUMMY
418{
420 {
421 public:
422 InitializeEclipseCountersEvent(Unit* owner, uint32 count) : BasicEvent(), _owner(owner), _count(count) { }
423
424 bool Execute(uint64, uint32) override
425 {
428 return true;
429 }
430
431 private:
434 };
435
436 bool Validate(SpellInfo const* /*spellInfo*/) override
437 {
440 }
441
442 void HandleProc(ProcEventInfo& eventInfo)
443 {
444 if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
445 {
446 if (spellInfo->SpellFamilyFlags & flag128(0x4, 0x0, 0x0, 0x0)) // Starfire
448 else if (spellInfo->SpellFamilyFlags & flag128(0x1, 0x0, 0x0, 0x0)) // Wrath
450 }
451 }
452
453 void HandleApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
454 {
455 // counters are applied with a delay
457 }
458
459 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
460 {
463 }
464
465 void OnOwnerOutOfCombat(bool isNowInCombat)
466 {
467 if (!isNowInCombat)
469 }
470
471 void Register() override
472 {
477 }
478
479private:
480 void OnSpellCast(uint32 cntSpellId, uint32 otherCntSpellId, uint32 eclipseAuraSpellId)
481 {
482 Unit* target = GetTarget();
483 if (Aura* aura = target->GetAura(cntSpellId))
484 {
485 uint32 remaining = aura->GetStackAmount();
486 if (remaining == 0)
487 return;
488
489 if (remaining > 1)
490 aura->SetStackAmount(remaining - 1);
491 else
492 {
493 // cast eclipse
494 target->CastSpell(target, eclipseAuraSpellId, TRIGGERED_FULL_MASK);
495
496 // Remove stacks from other one as well
497 // reset remaining power on other spellId
498 target->RemoveAura(cntSpellId);
499 target->RemoveAura(otherCntSpellId);
500 }
501 }
502 }
503};
504
505// 329910 - Eclipse out of combat - SPELL_DRUID_ECLIPSE_OOC
507{
508 bool Validate(SpellInfo const* /*spellInfo*/) override
509 {
511 }
512
513 void Tick(AuraEffect const* /*aurEff*/)
514 {
515 Unit* owner = GetTarget();
516 AuraEffect const* auraEffDummy = owner->GetAuraEffect(SPELL_DRUID_ECLIPSE_DUMMY, EFFECT_0);
517 if (!auraEffDummy)
518 return;
519
521 {
522 // Restore 2 stacks to each spell when out of combat
525 }
526 }
527
528 void Register() override
529 {
531 }
532};
533
534// 145205 - Efflorescence
536{
537 void RemoveOldAreaTrigger(SpellEffIndex /*effIndex*/) const
538 {
539 // if caster has any Efflorescence areatrigger, we remove it.
541 }
542
544 {
545 for (SpellLogEffectGenericVictimParams const& summonedObject : GetSpell()->GetExecuteLogEffectTargets(SPELL_EFFECT_SUMMON, &SpellLogEffect::GenericVictimTargets))
546 if (Unit* summon = ObjectAccessor::GetCreature(*GetCaster(), summonedObject.Victim))
547 summon->CastSpell(summon, SPELL_DRUID_EFFLORESCENCE_AURA,
548 CastSpellExtraArgs().SetTriggeringSpell(GetSpell()));
549 }
550
551 void Register() override
552 {
555 }
556};
557
558// 81262 - Efflorescence (Dummy)
560{
561 bool Validate(SpellInfo const* /*spellInfo*/) override
562 {
564 }
565
566 void HandlePeriodicDummy(AuraEffect const* /*aurEff*/) const
567 {
568 Unit* target = GetTarget();
569 Unit* summoner = target->GetOwner();
570 if (!summoner)
571 return;
572
574 }
575
576 void Register() override
577 {
579 }
580};
581
582// 81269 - Efflorescence (Heal)
584{
585 void FilterTargets(std::list<WorldObject*>& targets) const
586 {
587 // Efflorescence became a smart heal which prioritizes players and their pets in their group before any unit outside their group.
589 }
590
591 void Register() override
592 {
594 }
595};
596
597// 392124 - Embrace of the Dream
599{
600 bool Validate(SpellInfo const* spellInfo) override
601 {
603 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } });
604 }
605
606 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& /*eventInfo*/) const
607 {
608 return roll_chance_i(GetEffectInfo(EFFECT_2).CalcValue(GetCaster()));
609 }
610
611 void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo) const
612 {
615 .SetTriggeringAura(aurEff)
616 .SetTriggeringSpell(eventInfo.GetProcSpell()));
617 }
618
619 void Register() override
620 {
623 }
624};
625
626// 392146 - Embrace of the Dream (Selector)
628{
629 bool Validate(SpellInfo const* /*spellInfo*/) override
630 {
631 return ValidateSpellInfo
632 ({
637 });
638 }
639
640 void FilterTargets(std::list<WorldObject*>& targets) const
641 {
642 targets.remove_if([&](WorldObject const* target)
643 {
644 Unit const* unitTarget = target->ToUnit();
645 return !unitTarget || !unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, flag128(0x50, 0, 0, 0), GetCaster()->GetGUID());
646 });
647 }
648
649 void HandleEffect(SpellEffIndex /*effIndex*/) const
650 {
653 .SetTriggeringSpell(GetSpell()));
654 }
655
656 void Register() override
657 {
660 }
661};
662
663// 339 - Entangling Roots
664// 102359 - Mass Entanglement
666{
667 bool Validate(SpellInfo const* /*spellInfo*/) override
668 {
670 }
671
673 {
675 target = nullptr;
676 }
677
678 void HandleCuriousBramblepatchAOE(std::list<WorldObject*>& targets)
679 {
681 targets.clear();
682 }
683
684 void Register() override
685 {
689 }
690};
691
693{
694 bool Validate(SpellInfo const* /*spellInfo*/) override
695 {
697 }
698
699 bool CheckProc(ProcEventInfo& eventInfo)
700 {
701 if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
702 {
703 // dont subtract dmg caused by roots from dmg required to break root
704 if (spellInfo->Id == SPELL_DRUID_ENTANGLING_ROOTS || spellInfo->Id == SPELL_DRUID_MASS_ENTANGLEMENT)
705 return false;
706 }
707 return true;
708 }
709
710 void Register() override
711 {
713 }
714};
715
716// 22568 - Ferocious Bite
718{
719 bool Validate(SpellInfo const* /*spellInfo*/) override
720 {
722 }
723
725 {
726 int32 newValue = int32(float(GetEffectValue()) * _damageMultiplier);
727 SetEffectValue(newValue);
728 }
729
731 {
732 int32 newValue = int32(float(GetHitDamage()) * (1.0f + _damageMultiplier));
733 SetHitDamage(newValue);
734 }
735
737 {
738 Unit* caster = GetCaster();
739
740 int32 maxExtraConsumedPower = GetEffectValue();
741
743 {
744 float multiplier = 1.0f + float(auraEffect->GetAmount()) / 100.0f;
745 maxExtraConsumedPower = int32(float(maxExtraConsumedPower) * multiplier);
746 SetEffectValue(maxExtraConsumedPower);
747 }
748
749 _damageMultiplier = std::min<float>(caster->GetPower(POWER_ENERGY), maxExtraConsumedPower) / maxExtraConsumedPower;
750 }
751
752 void Register() override
753 {
757 }
758
759private:
760 float _damageMultiplier = 0.0f;
761};
762
763// 37336 - Druid Forms Trinket
765{
766 bool Validate(SpellInfo const* /*spellInfo*/) override
767 {
768 return ValidateSpellInfo(
769 {
775 });
776 }
777
778 bool CheckProc(ProcEventInfo& eventInfo)
779 {
780 Unit* target = eventInfo.GetActor();
781
782 switch (target->GetShapeshiftForm())
783 {
784 case FORM_BEAR_FORM:
786 case FORM_CAT_FORM:
788 case FORM_NONE:
790 return true;
791 default:
792 break;
793 }
794
795 return false;
796 }
797
798 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
799 {
801 Unit* target = eventInfo.GetActor();
802 uint32 triggerspell = 0;
803
804 switch (target->GetShapeshiftForm())
805 {
806 case FORM_BEAR_FORM:
808 triggerspell = SPELL_DRUID_FORMS_TRINKET_BEAR;
809 break;
810 case FORM_CAT_FORM:
811 triggerspell = SPELL_DRUID_FORMS_TRINKET_CAT;
812 break;
815 break;
816 case FORM_NONE:
817 triggerspell = SPELL_DRUID_FORMS_TRINKET_NONE;
818 break;
820 triggerspell = SPELL_DRUID_FORMS_TRINKET_TREE;
821 break;
822 default:
823 return;
824 }
825
826 target->CastSpell(target, triggerspell, aurEff);
827 }
828
829 void Register() override
830 {
833 }
834};
835
836// 203964 - Galactic Guardian
838{
839 bool Validate(SpellInfo const* /*spellInfo*/) override
840 {
842 }
843
844 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
845 {
846 if (DamageInfo* damageInfo = eventInfo.GetDamageInfo())
847 {
848 Unit* target = GetTarget();
849
850 // free automatic moonfire on target
851 target->CastSpell(damageInfo->GetVictim(), SPELL_DRUID_MOONFIRE_DAMAGE, true);
852
853 // Cast aura
854 target->CastSpell(damageInfo->GetVictim(), SPELL_DRUID_GALACTIC_GUARDIAN_AURA, true);
855 }
856 }
857
858 void Register() override
859 {
861 }
862};
863
864// 774 - Rejuvenation
866{
867 bool Validate(SpellInfo const* /*spellInfo*/) override
868 {
870 }
871
873 {
874 Unit* caster = GetCaster();
875
876 // Germination talent.
877 if (caster->HasAura(SPELL_DRUID_GERMINATION))
878 {
879 Unit* unitTarget = target->ToUnit();
880 Aura* rejuvenationAura = unitTarget->GetAura(SPELL_DRUID_REJUVENATION, caster->GetGUID());
881 Aura* germinationAura = unitTarget->GetAura(SPELL_DRUID_REJUVENATION_GERMINATION, caster->GetGUID());
882
883 // if target doesn't have Rejuventation, cast passes through.
884 if (!rejuvenationAura)
885 return;
886
887 // if target has Rejuvenation, but not Germination, or Germination has lower remaining duration than Rejuvenation, then cast Germination
888 if (germinationAura && germinationAura->GetDuration() >= rejuvenationAura->GetDuration())
889 return;
890
893 .SetTriggeringSpell(GetSpell()));
894
895 // prevent aura refresh (but cast must still happen to consume mana)
896 target = nullptr;
897 }
898 }
899
900 void Register() override
901 {
903 }
904};
905
906// 24858 - Moonkin Form
908{
909 bool Validate(SpellInfo const* /*spell*/) override
910 {
912 }
913
914 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
915 {
916 Unit* target = GetTarget();
918 target->CastSpell(target, SPELL_DRUID_GLYPH_OF_STARS_VISUAL, true);
919 }
920
921 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
922 {
924 }
925
926 void Register() override
927 {
930 }
931};
932
933// 210706 - Gore
935{
936 bool Validate(SpellInfo const* /*spellInfo*/) override
937 {
939 }
940
941 bool CheckEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
942 {
943 return roll_chance_i(aurEff->GetAmount());
944 }
945
946 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& /*procInfo*/)
947 {
948 Unit* owner = GetTarget();
949 owner->CastSpell(owner, SPELL_DRUID_GORE_PROC);
951 }
952
953 void Register() override
954 {
957 }
958};
959
960// 99 - Incapacitating Roar
962{
963protected:
964 bool ToCatForm() const override { return false; }
965};
966
967// 29166 - Innervate
969{
971 {
973 if (!target)
975
977 if (!spec || spec->GetRole() != ChrSpecializationRole::Healer)
979
980 return SPELL_CAST_OK;
981 }
982
984 {
985 Unit* caster = GetCaster();
986 if (caster != GetHitUnit())
987 if (AuraEffect const* innervateR2 = caster->GetAuraEffect(SPELL_DRUID_INNERVATE_RANK_2, EFFECT_0))
988 caster->CastSpell(caster, SPELL_DRUID_INNERVATE,
990 .SetTriggeringSpell(GetSpell())
991 .AddSpellMod(SPELLVALUE_BASE_POINT0, -innervateR2->GetAmount()));
992
993 }
994
995 void Register() override
996 {
999 }
1000};
1001
1002// 117679 - Incarnation (Passive)
1004{
1005 bool Validate(SpellInfo const* /*spellInfo*/) override
1006 {
1008 }
1009
1010 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
1011 {
1013 }
1014
1015 void Register() override
1016 {
1018 }
1019};
1020
1021// 33891 - Incarnation: Tree of Life (Talent, Shapeshift)
1023{
1024 bool Validate(SpellInfo const* /*spellInfo*/) override
1025 {
1027 }
1028
1029 void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
1030 {
1033 }
1034
1035 void Register() override
1036 {
1038 }
1039};
1040
1041// 740 - Tranquility
1043{
1044 bool Validate(SpellInfo const* spellInfo) override
1045 {
1047 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_4 } })
1050 }
1051
1052 void PreventEffect(WorldObject*& target) const
1053 {
1054 // Note: Inner Peace talent.
1056 target = nullptr;
1057 }
1058
1059 void Register() override
1060 {
1063 }
1064};
1065
1066// 40442 - Druid Tier 6 Trinket
1068{
1069 bool Validate(SpellInfo const* /*spellInfo*/) override
1070 {
1071 return ValidateSpellInfo(
1072 {
1076 });
1077 }
1078
1079 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1080 {
1082 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1083 if (!spellInfo)
1084 return;
1085
1086 uint32 spellId;
1087 int32 chance;
1088
1089 // Starfire
1090 if (spellInfo->SpellFamilyFlags[0] & 0x00000004)
1091 {
1093 chance = 25;
1094 }
1095 // Rejuvenation
1096 else if (spellInfo->SpellFamilyFlags[0] & 0x00000010)
1097 {
1099 chance = 25;
1100 }
1101 // Mangle (Bear) and Mangle (Cat)
1102 else if (spellInfo->SpellFamilyFlags[1] & 0x00000440)
1103 {
1105 chance = 40;
1106 }
1107 else
1108 return;
1109
1110 if (roll_chance_i(chance))
1111 eventInfo.GetActor()->CastSpell(nullptr, spellId, aurEff);
1112 }
1113
1114 void Register() override
1115 {
1117 }
1118};
1119
1120// 33763 - Lifebloom
1122{
1123 bool Validate(SpellInfo const* /*spell*/) override
1124 {
1126 }
1127
1128 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1129 {
1130 // Final heal only on duration end
1131 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE || GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL)
1133 }
1134
1135 void Register() override
1136 {
1138 }
1139};
1140
1141// 155580 - Lunar Inspiration
1143{
1144 bool Validate(SpellInfo const* /*spell*/) override
1145 {
1147 }
1148
1149 void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1150 {
1152 }
1153
1154 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1155 {
1157 }
1158
1159 void Register() override
1160 {
1163 }
1164};
1165
1166// 392315 - Luxuriant Soil
1168{
1169 bool Validate(SpellInfo const* /*spellInfo*/) override
1170 {
1172 }
1173
1174 static bool CheckProc(AuraEffect const* aurEff, ProcEventInfo const& /*eventInfo*/)
1175 {
1176 return roll_chance_i(aurEff->GetAmount());
1177 }
1178
1179 void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
1180 {
1181 Unit* rejuvCaster = GetTarget();
1182
1183 // let's use the ProcSpell's max. range.
1184 float spellRange = eventInfo.GetSpellInfo()->GetMaxRange();
1185
1186 std::vector<Unit*> targetList;
1187 Trinity::WorldObjectSpellAreaTargetCheck check(spellRange, rejuvCaster, rejuvCaster, rejuvCaster, eventInfo.GetSpellInfo(), TARGET_CHECK_ALLY, nullptr, TARGET_OBJECT_TYPE_UNIT);
1188 Trinity::UnitListSearcher searcher(rejuvCaster, targetList, check);
1189 Cell::VisitAllObjects(rejuvCaster, searcher, spellRange);
1190
1191 if (targetList.empty())
1192 return;
1193
1195 }
1196
1197 void Register() override
1198 {
1201 }
1202};
1203
1204// 8921 - Moonfire
1206{
1207 bool Validate(SpellInfo const* /*spellInfo*/) override
1208 {
1210 }
1211
1212 void HandleOnHit(SpellEffIndex /*effIndex*/)
1213 {
1215 }
1216
1217 void Register() override
1218 {
1220 }
1221};
1222
1223// 16864 - Omen of Clarity
1225{
1226 bool Validate(SpellInfo const* /*spellInfo*/) override
1227 {
1229 }
1230
1231 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
1232 {
1233 Unit* target = GetTarget();
1235 target->CastSpell(nullptr, SPELL_DRUID_BALANCE_T10_BONUS_PROC, true);
1236 }
1237
1238 void Register() override
1239 {
1241 }
1242};
1243
1244// 392303 - Power of the Archdruid
1246{
1247 bool Validate(SpellInfo const* /*spellInfo*/) override
1248 {
1250 }
1251
1252 static bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo)
1253 {
1255 }
1256
1257 static void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo)
1258 {
1259 Unit* druid = eventInfo.GetActor();
1260 Unit const* procTarget = eventInfo.GetActionTarget();
1261
1262 // range is EFFECT_0's BasePoints.
1263 float spellRange = aurEff->GetAmount();
1264
1265 std::vector<Unit*> targetList;
1266 Trinity::WorldObjectSpellAreaTargetCheck checker(spellRange, procTarget, druid, druid, eventInfo.GetSpellInfo(), TARGET_CHECK_ALLY, nullptr, TARGET_OBJECT_TYPE_UNIT);
1267 Trinity::UnitListSearcher searcher(procTarget, targetList, checker);
1268 Cell::VisitAllObjects(procTarget, searcher, spellRange);
1269 std::erase(targetList, procTarget);
1270
1271 if (targetList.empty())
1272 return;
1273
1274 AuraEffect const* powerOfTheArchdruidEffect = druid->GetAuraEffect(SPELL_DRUID_POWER_OF_THE_ARCHDRUID, EFFECT_0);
1275
1276 // max. targets is SPELL_DRUID_POWER_OF_THE_ARCHDRUID's EFFECT_0 BasePoints.
1277 int32 maxTargets = powerOfTheArchdruidEffect->GetAmount();
1278
1279 Trinity::Containers::RandomResize(targetList, maxTargets);
1280
1281 for (Unit* chosenTarget : targetList)
1282 druid->CastSpell(chosenTarget, eventInfo.GetProcSpell()->GetSpellInfo()->Id, aurEff);
1283 }
1284
1285 void Register() override
1286 {
1289 }
1290};
1291
1292// 5215 - Prowl
1294{
1295protected:
1296 bool ToCatForm() const override { return true; }
1297};
1298
1299// 1079 - Rip
1301{
1302 bool Load() override
1303 {
1304 Unit* caster = GetCaster();
1305 return caster && caster->GetTypeId() == TYPEID_PLAYER;
1306 }
1307
1308 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
1309 {
1310 canBeRecalculated = false;
1311
1312 if (Unit* caster = GetCaster())
1313 {
1314 // 0.01 * $AP * cp
1315 int32 cp = caster->GetPower(POWER_COMBO_POINTS);
1316
1317 // Idol of Feral Shadows. Can't be handled as SpellMod due its dependency from CPs
1318 if (AuraEffect const* auraEffIdolOfFeralShadows = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_FERAL_SHADOWS, EFFECT_0))
1319 amount += cp * auraEffIdolOfFeralShadows->GetAmount();
1320 // Idol of Worship. Can't be handled as SpellMod due its dependency from CPs
1321 else if (AuraEffect const* auraEffIdolOfWorship = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_WORSHIP, EFFECT_0))
1322 amount += cp * auraEffIdolOfWorship->GetAmount();
1323
1324 amount += int32(CalculatePct(caster->GetTotalAttackPowerValue(BASE_ATTACK), cp));
1325 }
1326 }
1327
1328 void Register() override
1329 {
1331 }
1332};
1333
1334// 52610 - Savage Roar
1336{
1338 {
1339 Unit* caster = GetCaster();
1340 if (caster->GetShapeshiftForm() != FORM_CAT_FORM)
1342
1343 return SPELL_CAST_OK;
1344 }
1345
1346 void Register() override
1347 {
1349 }
1350};
1351
1353{
1354 bool Validate(SpellInfo const* /*spell*/) override
1355 {
1357 }
1358
1359 void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
1360 {
1361 Unit* target = GetTarget();
1363 .SetOriginalCaster(GetCasterGUID()));
1364 }
1365
1366 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1367 {
1369 }
1370
1371 void Register() override
1372 {
1375 }
1376};
1377
1378// 164815 - Sunfire
1379// 164812 - Moonfire
1381{
1382 bool Validate(SpellInfo const* /*spellInfo*/) override
1383 {
1385 }
1386
1387 void OnTick(AuraEffect const* /*aurEff*/)
1388 {
1389 if (Unit* caster = GetCaster())
1390 if (AuraEffect const* shootingStars = caster->GetAuraEffect(SPELL_DRUID_SHOOTING_STARS, EFFECT_0))
1391 if (roll_chance_i(shootingStars->GetAmount()))
1392 caster->CastSpell(GetTarget(), SPELL_DRUID_SHOOTING_STARS_DAMAGE, true);
1393 }
1394
1395 void Register() override
1396 {
1398 }
1399};
1400
1401// 106839 - Skull Bash
1403{
1404 bool Validate(SpellInfo const* /*spellInfo*/) override
1405 {
1407 }
1408
1409 void HandleDummy(SpellEffIndex /*effIndex*/)
1410 {
1413 }
1414
1415 void Register() override
1416 {
1418 }
1419};
1420
1421// 81269 - Efflorescence (Heal)
1423{
1424 bool Validate(SpellInfo const* /*spellInfo*/) override
1425 {
1427 }
1428
1429 void HandleOnHit(SpellEffIndex /*effIndex*/) const
1430 {
1433 }
1434
1435 void Register() override
1436 {
1438 }
1439};
1440
1441// 106898 - Stampeding Roar
1443{
1444protected:
1445 bool ToCatForm() const override { return false; }
1446};
1447
1448// 50286 - Starfall (Dummy)
1450{
1451 void FilterTargets(std::list<WorldObject*>& targets)
1452 {
1454 }
1455
1456 void HandleDummy(SpellEffIndex /*effIndex*/)
1457 {
1458 Unit* caster = GetCaster();
1459 // Shapeshifting into an animal form or mounting cancels the effect
1460 if (caster->GetCreatureType() == CREATURE_TYPE_BEAST || caster->IsMounted())
1461 {
1462 if (SpellInfo const* spellInfo = GetTriggeringSpell())
1463 caster->RemoveAurasDueToSpell(spellInfo->Id);
1464 return;
1465 }
1466
1467 // Any effect which causes you to lose control of your character will supress the starfall effect.
1469 return;
1470
1471 caster->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
1472 }
1473
1474 void Register() override
1475 {
1478 }
1479};
1480
1481// 340694 - Sudden Ambush
1482// 384667 - Sudden Ambush
1484{
1485 bool CheckProc(AuraEffect const* aurEff, ProcEventInfo& procInfo)
1486 {
1487 Spell const* procSpell = procInfo.GetProcSpell();
1488 if (!procSpell)
1489 return false;
1490
1492 if (!comboPoints)
1493 return false;
1494
1495 return roll_chance_i(*comboPoints * aurEff->GetAmount());
1496 }
1497
1498 void Register() override
1499 {
1501 }
1502};
1503
1504// 93402 - Sunfire
1506{
1507 void HandleOnHit(SpellEffIndex /*effIndex*/)
1508 {
1510 }
1511
1512 void Register() override
1513 {
1515 }
1516};
1517
1518// 61336 - Survival Instincts
1520{
1521 bool Validate(SpellInfo const* /*spell*/) override
1522 {
1524 }
1525
1526 void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1527 {
1529 }
1530
1531 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1532 {
1534 }
1535
1536 void Register() override
1537 {
1540 }
1541};
1542
1543// 40121 - Swift Flight Form (Passive)
1545{
1546 bool Load() override
1547 {
1548 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1549 }
1550
1551 void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
1552 {
1553 if (Player* caster = GetCaster()->ToPlayer())
1554 if (caster->GetSkillValue(SKILL_RIDING) >= 375)
1555 amount = 310;
1556 }
1557
1558 void Register() override
1559 {
1561 }
1562};
1563
1564// 28744 - Regrowth
1566{
1567 bool Validate(SpellInfo const* /*spellInfo*/) override
1568 {
1570 }
1571
1572 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1573 {
1575 eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_BLESSING_OF_THE_CLAW, aurEff);
1576 }
1577
1578 void Register() override
1579 {
1581 }
1582};
1583
1584// 28719 - Healing Touch
1586{
1587 bool Validate(SpellInfo const* /*spellInfo*/) override
1588 {
1590 }
1591
1592 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1593 {
1595 Spell const* spell = eventInfo.GetProcSpell();
1596 if (!spell)
1597 return;
1598
1599 Unit* caster = eventInfo.GetActor();
1600 std::vector<SpellPowerCost> const& costs = spell->GetPowerCost();
1601 auto m = std::find_if(costs.begin(), costs.end(), [](SpellPowerCost const& cost) { return cost.Power == POWER_MANA; });
1602 if (m == costs.end())
1603 return;
1604
1605 int32 amount = CalculatePct(m->Amount, aurEff->GetAmount());
1606 CastSpellExtraArgs args(aurEff);
1607 args.AddSpellBP0(amount);
1608 caster->CastSpell(nullptr, SPELL_DRUID_EXHILARATE, args);
1609 }
1610
1611 void Register() override
1612 {
1614 }
1615};
1616
1617// 37288 - Mana Restore
1618// 37295 - Mana Restore
1620{
1621 bool Validate(SpellInfo const* /*spellInfo*/) override
1622 {
1624 }
1625
1626 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1627 {
1629 eventInfo.GetActor()->CastSpell(nullptr, SPELL_DRUID_INFUSION, aurEff);
1630 }
1631
1632 void Register() override
1633 {
1635 }
1636};
1637
1638// 70723 - Item - Druid T10 Balance 4P Bonus
1640{
1641 bool Validate(SpellInfo const* /*spellInfo*/) override
1642 {
1644 }
1645
1646 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1647 {
1649
1650 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
1651 if (!damageInfo || !damageInfo->GetDamage())
1652 return;
1653
1654 Unit* caster = eventInfo.GetActor();
1655 Unit* target = eventInfo.GetProcTarget();
1656
1657 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_DRUID_LANGUISH, GetCastDifficulty());
1658 int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
1659
1660 ASSERT(spellInfo->GetMaxTicks() > 0);
1661 amount /= spellInfo->GetMaxTicks();
1662
1663 CastSpellExtraArgs args(aurEff);
1664 args.AddSpellMod(SPELLVALUE_BASE_POINT0, amount);
1665 caster->CastSpell(target, SPELL_DRUID_LANGUISH, args);
1666 }
1667
1668 void Register() override
1669 {
1671 }
1672};
1673
1674// 70691 - Item T10 Restoration 4P Bonus
1676{
1677 bool Load() override
1678 {
1679 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1680 }
1681
1682 void FilterTargets(std::list<WorldObject*>& targets)
1683 {
1684 if (!GetCaster()->ToPlayer()->GetGroup())
1685 {
1686 targets.clear();
1687 targets.push_back(GetCaster());
1688 }
1689 else
1690 {
1691 targets.remove(GetExplTargetUnit());
1692 std::list<Unit*> tempTargets;
1693 for (std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
1694 if ((*itr)->GetTypeId() == TYPEID_PLAYER && GetCaster()->IsInRaidWith((*itr)->ToUnit()))
1695 tempTargets.push_back((*itr)->ToUnit());
1696
1697 if (tempTargets.empty())
1698 {
1699 targets.clear();
1701 return;
1702 }
1703
1705 targets.clear();
1706 targets.push_back(target);
1707 }
1708 }
1709
1710 void Register() override
1711 {
1713 }
1714};
1715
1716// 70664 - Druid T10 Restoration 4P Bonus (Rejuvenation)
1718{
1719 bool Validate(SpellInfo const* /*spellInfo*/) override
1720 {
1722 }
1723
1724 bool CheckProc(ProcEventInfo& eventInfo)
1725 {
1726 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1727 if (!spellInfo || spellInfo->Id == SPELL_DRUID_REJUVENATION_T10_PROC)
1728 return false;
1729
1730 HealInfo* healInfo = eventInfo.GetHealInfo();
1731 if (!healInfo || !healInfo->GetHeal())
1732 return false;
1733
1734 Player* caster = eventInfo.GetActor()->ToPlayer();
1735 if (!caster)
1736 return false;
1737
1738 return caster->GetGroup() || caster != eventInfo.GetProcTarget();
1739 }
1740
1741 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1742 {
1744
1745 CastSpellExtraArgs args(aurEff);
1747 eventInfo.GetActor()->CastSpell(nullptr, SPELL_DRUID_REJUVENATION_T10_PROC, args);
1748 }
1749
1750 void Register() override
1751 {
1754 }
1755};
1756
1757// 77758 - Thrash
1759{
1760 bool Validate(SpellInfo const* /*spellInfo*/) override
1761 {
1763 }
1764
1766 {
1767 if (Unit* hitUnit = GetHitUnit())
1768 {
1769 Unit* caster = GetCaster();
1770
1772 }
1773 }
1774
1775 void Register() override
1776 {
1778 }
1779};
1780
1781// 192090 - Thrash (Aura) - SPELL_DRUID_THRASH_BEAR_AURA
1783{
1784 bool Validate(SpellInfo const* /*spellInfo*/) override
1785 {
1787 }
1788
1789 void HandlePeriodic(AuraEffect const* /*aurEff*/)
1790 {
1791 if (Unit* caster = GetCaster())
1792 if (caster->HasAura(SPELL_DRUID_BLOOD_FRENZY_AURA))
1793 caster->CastSpell(caster, SPELL_DRUID_BLOOD_FRENZY_RAGE_GAIN, true);
1794 }
1795
1796 void Register() override
1797 {
1799 }
1800};
1801
1802// 1066 - Aquatic Form
1803// 33943 - Flight Form
1804// 40120 - Swift Flight Form
1805// 165961 - Stag Form
1807{
1808 bool Validate(SpellInfo const* /*spellInfo*/) override
1809 {
1811 }
1812
1813 bool Load() override
1814 {
1815 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1816 }
1817
1818 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1819 {
1820 // If it stays 0, it removes Travel Form dummy in AfterRemove.
1821 triggeredSpellId = 0;
1822
1823 // We should only handle aura interrupts.
1824 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_INTERRUPT)
1825 return;
1826
1827 // Check what form is appropriate
1829
1830 // If chosen form is current aura, just don't remove it.
1833 }
1834
1835 void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
1836 {
1838 return;
1839
1840 Player* player = GetTarget()->ToPlayer();
1841
1842 if (triggeredSpellId) // Apply new form
1843 player->CastSpell(player, triggeredSpellId, aurEff);
1844 else // If not set, simply remove Travel Form dummy
1846 }
1847
1848 void Register() override
1849 {
1852 }
1853
1854public:
1855 static uint32 GetFormSpellId(Player const* player, Difficulty difficulty, bool requiresOutdoor)
1856 {
1857 // Check what form is appropriate
1858 if (player->HasSpell(SPELL_DRUID_FORM_AQUATIC_PASSIVE) && player->IsInWater()) // Aquatic form
1860
1861 if (!player->IsInCombat() && player->GetSkillValue(SKILL_RIDING) >= 225 && CheckLocationForForm(player, difficulty, requiresOutdoor, SPELL_DRUID_FORM_FLIGHT) == SPELL_CAST_OK) // Flight form
1863
1864 if (!player->IsInWater() && CheckLocationForForm(player, difficulty, requiresOutdoor, SPELL_DRUID_FORM_STAG) == SPELL_CAST_OK) // Stag form
1865 return SPELL_DRUID_FORM_STAG;
1866
1867 return 0;
1868 }
1869
1870private:
1871 static SpellCastResult CheckLocationForForm(Player const* targetPlayer, Difficulty difficulty, bool requireOutdoors, uint32 spell_id)
1872 {
1873 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id, difficulty);
1874
1875 if (requireOutdoors && !targetPlayer->IsOutdoors())
1877
1878 return spellInfo->CheckLocation(targetPlayer->GetMapId(), targetPlayer->GetZoneId(), targetPlayer->GetAreaId(), targetPlayer);
1879 }
1880
1882};
1883
1884// 783 - Travel Form (dummy)
1886{
1887 bool Validate(SpellInfo const* /*spellInfo*/) override
1888 {
1890 }
1891
1893 {
1894 Player* player = GetCaster()->ToPlayer();
1895 if (!player)
1897
1899
1900 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetCastDifficulty());
1901 return spellInfo->CheckLocation(player->GetMapId(), player->GetZoneId(), player->GetAreaId(), player);
1902 }
1903
1904 void Register() override
1905 {
1907 }
1908};
1909
1911{
1912 bool Validate(SpellInfo const* /*spellInfo*/) override
1913 {
1915 }
1916
1917 bool Load() override
1918 {
1919 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1920 }
1921
1922 void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
1923 {
1924 Player* player = GetTarget()->ToPlayer();
1925
1926 // Outdoor check already passed - Travel Form (dummy) has SPELL_ATTR0_OUTDOORS_ONLY attribute.
1927 uint32 triggeredSpellId = spell_dru_travel_form::GetFormSpellId(player, GetCastDifficulty(), false);
1928
1929 player->CastSpell(player, triggeredSpellId, aurEff);
1930 }
1931
1932 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1933 {
1934 // No need to check remove mode, it's safe for auras to remove each other in AfterRemove hook.
1939 }
1940
1941 void Register() override
1942 {
1945 }
1946};
1947
1948// 252216 - Tiger Dash
1950{
1951protected:
1952 bool ToCatForm() const override { return true; }
1953};
1954
1955// 252216 - Tiger Dash (Aura)
1957{
1958 void HandlePeriodic(AuraEffect const* aurEff)
1959 {
1960 if (AuraEffect* effRunSpeed = GetEffect(EFFECT_0))
1961 {
1962 int32 reduction = aurEff->GetAmount();
1963 effRunSpeed->ChangeAmount(effRunSpeed->GetAmount() - reduction);
1964 }
1965 }
1966
1967 void Register() override
1968 {
1970 }
1971};
1972
1973// 48438 - Wild Growth
1975{
1976 bool Validate(SpellInfo const* spellInfo) override
1977 {
1978 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 }, { SPELL_DRUID_TREE_OF_LIFE, EFFECT_2 } });
1979 }
1980
1981 void FilterTargets(std::list<WorldObject*>& targets) const
1982 {
1983 Unit* caster = GetCaster();
1984 int32 maxTargets = GetEffectInfo(EFFECT_1).CalcValue(caster);
1985
1986 if (AuraEffect const* treeOfLife = caster->GetAuraEffect(SPELL_DRUID_TREE_OF_LIFE, EFFECT_2))
1987 maxTargets += treeOfLife->GetAmount();
1988
1989 // Note: Wild Growth became a smart heal which prioritizes players and their pets in their group before any unit outside their group.
1990 Trinity::SelectRandomInjuredTargets(targets, maxTargets, true, caster);
1991 }
1992
1993 void Register() override
1994 {
1996 }
1997};
1998
2000{
2001 bool Validate(SpellInfo const* /*spellInfo*/) override
2002 {
2004 }
2005
2007 {
2008 Unit* caster = GetCaster();
2009 if (!caster)
2010 return;
2011
2012 // calculate from base damage, not from aurEff->GetAmount() (already modified)
2013 float damage = caster->CalculateSpellDamage(GetUnitOwner(), aurEff->GetSpellEffectInfo());
2014
2015 // Wild Growth = first tick gains a 6% bonus, reduced by 2% each tick
2016 float reduction = 2.f;
2018 reduction -= CalculatePct(reduction, bonus->GetAmount());
2019 reduction *= (aurEff->GetTickNumber() - 1);
2020
2021 AddPct(damage, 6.f - reduction);
2022 aurEff->SetAmount(int32(damage));
2023 }
2024
2025 void Register() override
2026 {
2028 }
2029};
2030
2031// 145108 - Ysera's Gift
2033{
2034 bool Validate(SpellInfo const* /*spellInfo*/) override
2035 {
2036 return ValidateSpellInfo
2037 ({
2040 });
2041 }
2042
2044 {
2045 int32 healAmount = int32(GetTarget()->CountPctFromMaxHealth(aurEff->GetAmount()));
2046
2047 if (!GetTarget()->IsFullHealth())
2049 else
2051 }
2052
2053 void Register() override
2054 {
2056 }
2057};
2058
2059// 145110 - Ysera's Gift (heal)
2061{
2062 void SelectTargets(std::list<WorldObject*>& targets)
2063 {
2064 Trinity::SelectRandomInjuredTargets(targets, 1, true);
2065 }
2066
2067 void Register() override
2068 {
2070 }
2071};
2072
2074{
2137}
Difficulty
Definition: DBCEnums.h:873
int32_t int32
Definition: Define.h:138
uint64_t uint64
Definition: Define.h:141
uint32_t uint32
Definition: Define.h:142
#define ASSERT
Definition: Errors.h:68
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
bool roll_chance_i(int chance)
Definition: Random.h:59
#define RegisterSpellAndAuraScriptPair(script_1, script_2)
Definition: ScriptMgr.h:1371
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_3
Definition: SharedDefines.h:33
@ EFFECT_1
Definition: SharedDefines.h:31
@ EFFECT_0
Definition: SharedDefines.h:30
@ EFFECT_4
Definition: SharedDefines.h:34
@ EFFECT_2
Definition: SharedDefines.h:32
@ TARGET_UNIT_DEST_AREA_ALLY
@ TARGET_UNIT_DEST_AREA_ENEMY
@ TARGET_UNIT_TARGET_ALLY
@ TARGET_UNIT_CASTER_AREA_RAID
@ TARGET_UNIT_TARGET_ENEMY
@ TARGET_UNIT_CASTER
@ CREATURE_TYPE_BEAST
@ SPELL_EFFECT_CREATE_AREATRIGGER
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_POWER_BURN
@ SPELL_EFFECT_HEAL
@ SPELL_EFFECT_SUMMON
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ BASE_ATTACK
@ POWER_RAGE
@ POWER_ENERGY
@ POWER_COMBO_POINTS
SpellCastResult
@ SPELL_FAILED_CUSTOM_ERROR
@ SPELL_FAILED_DONT_REPORT
@ SPELL_FAILED_ONLY_SHAPESHIFT
@ SPELL_FAILED_BAD_TARGETS
@ SPELL_FAILED_ONLY_OUTDOORS
@ SPELL_CAST_OK
@ SPELLFAMILY_DRUID
@ SKILL_RIDING
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_BY_EXPIRE
@ AURA_REMOVE_BY_ENEMY_SPELL
@ AURA_REMOVE_BY_INTERRUPT
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_MOD_SHAPESHIFT
@ SPELL_AURA_ADD_PCT_MODIFIER
@ SPELL_AURA_MOD_INCREASE_SPEED
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
@ SPELL_AURA_IGNORE_SPELL_COOLDOWN
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_OVERRIDE_CLASS_SCRIPTS
@ SPELL_AURA_MECHANIC_IMMUNITY_MASK
ShapeshiftForm
@ FORM_BEAR_FORM
@ FORM_DIRE_BEAR_FORM
@ FORM_MOONKIN_FORM
@ FORM_TREE_OF_LIFE
@ FORM_CAT_FORM
@ FORM_NONE
@ 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_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_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_BASE_POINT0
Definition: SpellDefines.h:196
@ TARGET_CHECK_ALLY
Definition: SpellInfo.h:85
@ TARGET_OBJECT_TYPE_UNIT
Definition: SpellInfo.h:69
#define sSpellMgr
Definition: SpellMgr.h:849
#define AuraProcFn(F)
Definition: SpellScript.h:2150
#define SpellObjectTargetSelectFn(F, I, N)
Definition: SpellScript.h:869
#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 AuraEffectUpdatePeriodicFn(F, I, N)
Definition: SpellScript.h:2052
#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 AuraCheckProcFn(F)
Definition: SpellScript.h:2130
#define SpellHitFn(F)
Definition: SpellScript.h:854
#define AuraEnterLeaveCombatFn(F)
Definition: SpellScript.h:2166
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:2040
@ UNIT_STATE_CONTROLLED
Definition: Unit.h:295
T AddPct(T &base, U pct)
Definition: Util.h:85
T CalculatePct(T base, U pct)
Definition: Util.h:72
uint32 GetTickNumber() const
SpellEffectInfo const & GetSpellEffectInfo() const
void SetAmount(int32 amount)
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
HookList< EffectAbsorbHandler > AfterEffectAbsorb
Definition: SpellScript.h:2096
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Definition: SpellScript.h:2057
Unit * GetCaster() const
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
Definition: SpellScript.h:2051
HookList< EnterLeaveCombatHandler > OnEnterLeaveCombat
Definition: SpellScript.h:2165
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
AuraEffect * GetEffect(uint8 effIndex) const
HookList< EffectAbsorbHandler > OnEffectAbsorb
Definition: SpellScript.h:2089
Unit * GetTarget() const
ObjectGuid GetCasterGUID() const
Difficulty GetCastDifficulty() const
HookList< CheckProcHandler > DoCheckProc
Definition: SpellScript.h:2129
HookList< EffectApplyHandler > OnEffectRemove
Definition: SpellScript.h:2035
HookList< EffectProcHandler > OnEffectProc
Definition: SpellScript.h:2155
Unit * GetUnitOwner() const
HookList< AuraProcHandler > OnProc
Definition: SpellScript.h:2145
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:2024
void SetStackAmount(uint8 num)
int32 GetDuration() const
Definition: SpellAuras.h:173
Unit * GetAttacker() const
Definition: Unit.h:440
uint32 GetDamage() const
Definition: Unit.h:446
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
TypeID GetTypeId() const
Definition: Object.h:173
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
static Player * ToPlayer(Object *o)
Definition: Object.h:213
uint16 GetSkillValue(uint32 skill) const
Definition: Player.cpp:6052
bool HasSpell(uint32 spell) const override
Definition: Player.cpp:3792
Group * GetGroup(Optional< uint8 > partyIndex)
Definition: Player.h:2606
ChrSpecializationEntry const * GetPrimarySpecializationEntry() const
Definition: Player.cpp:29827
HealInfo * GetHealInfo() const
Definition: Unit.h:506
Unit * GetActionTarget() const
Definition: Unit.h:494
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
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
bool IsAura() const
Definition: SpellInfo.cpp:461
void ResetCooldown(uint32 spellId, bool update=false)
uint32 GetMaxTicks() const
Definition: SpellInfo.cpp:3823
float GetMaxRange(bool positive=false, WorldObject *caster=nullptr, Spell *spell=nullptr) const
Definition: SpellInfo.cpp:3768
uint32 const Id
Definition: SpellInfo.h:325
SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const *player=nullptr) const
Definition: SpellInfo.cpp:1995
flag128 SpellFamilyFlags
Definition: SpellInfo.h:409
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition: SpellInfo.h:577
uint32 m_scriptSpellId
Definition: SpellScript.h:134
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< CastHandler > AfterCast
Definition: SpellScript.h:824
HookList< CheckCastHandler > OnCheckCast
Definition: SpellScript.h:829
void SetEffectValue(int32 value)
int32 GetHitDamage() const
Unit * GetCaster() const
HookList< HitHandler > OnHit
Definition: SpellScript.h:850
SpellInfo const * GetTriggeringSpell() const
Unit * GetHitUnit() const
int32 GetEffectValue() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
HookList< ObjectTargetSelectHandler > OnObjectTargetSelect
Definition: SpellScript.h:868
HookList< CastHandler > BeforeCast
Definition: SpellScript.h:820
Spell * GetSpell() const
Definition: SpellScript.h:987
void FinishCast(SpellCastResult result, int32 *param1=nullptr, int32 *param2=nullptr)
HookList< EffectHandler > OnEffectLaunchTarget
Definition: SpellScript.h:838
Difficulty GetCastDifficulty() const
void SetHitDamage(int32 damage)
HookList< EffectHandler > OnEffectLaunch
Definition: SpellScript.h:837
Unit * GetExplTargetUnit() const
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
Definition: Spell.h:255
SpellInfo const * GetSpellInfo() const
Definition: Spell.h:650
Optional< int32 > GetPowerTypeCostAmount(Powers power) const
Definition: Spell.cpp:7958
std::vector< SpellPowerCost > const & GetPowerCost() const
Definition: Spell.h:652
Definition: Unit.h:627
void RemoveAreaTrigger(uint32 spellId)
Definition: Unit.cpp:5345
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3608
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3685
ShapeshiftForm GetShapeshiftForm() const
Definition: Unit.h:1463
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition: Unit.cpp:4464
int32 GetMaxPower(Powers power) const
Definition: Unit.cpp:9410
uint32 GetCreatureType() const
Definition: Unit.cpp:8880
bool HealthBelowPct(int32 pct) const
Definition: Unit.h:780
uint64 GetMaxHealth() const
Definition: Unit.h:777
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
Definition: Unit.cpp:4634
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4560
bool IsInWater() const
Definition: Unit.cpp:3186
bool IsMounted() const
Definition: Unit.h:898
int32 GetPower(Powers power) const
Definition: Unit.cpp:9401
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
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 RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
bool IsInCombat() const
Definition: Unit.h:1043
constexpr uint32 GetMapId() const
Definition: Position.h:201
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
Unit * GetOwner() const
Definition: Object.cpp:2229
bool IsOutdoors() const
Definition: Object.h:549
int32 CalculateSpellDamage(Unit const *target, SpellEffectInfo const &spellEffectInfo, int32 const *basePoints=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
Definition: Object.cpp:2297
EventProcessor m_Events
Definition: Object.h:777
uint32 GetAreaId() const
Definition: Object.h:546
uint32 GetZoneId() const
Definition: Object.h:545
void HandleOnApplyOrReapply(AuraEffect const *aurEff, AuraEffectHandleModes mode) const
void HandleOnRemove(AuraEffect const *, AuraEffectHandleModes) const
bool Validate(SpellInfo const *) override
void Register() override
void Register() override
bool Validate(SpellInfo const *) override
void HandlePeriodic(AuraEffect const *)
ShapeshiftForm GetShapeshiftForm() const
uint32 GetShapeshiftFormSpell() const
virtual bool ToCatForm() const =0
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *spellInfo) override
void Register() override
bool ToCatForm() const override
void HandleAbsorb(AuraEffect *, DamageInfo &, uint32 &)
bool Validate(SpellInfo const *) override
void Register() override
void HandleAfterAbsorb(AuraEffect *, DamageInfo &dmgInfo, uint32 &absorbAmount)
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void Register() override
void HandleAfterRemove(AuraEffect const *, AuraEffectHandleModes)
void Register() override
bool Validate(SpellInfo const *) override
void HandleOnTick(AuraEffect const *aurEff) const
bool Validate(SpellInfo const *) override
void Register() override
void Register() override
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
bool Validate(SpellInfo const *) override
void Register() override
void HandleProc(AuraEffect *, ProcEventInfo &)
bool Validate(SpellInfo const *) override
void Register() override
void HandleRemoved(AuraEffect const *, AuraEffectHandleModes)
static void SetSpellCount(Unit *unitOwner, uint32 spellId, uint32 amount)
void HandleApply(AuraEffect const *aurEff, AuraEffectHandleModes)
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void OnOwnerOutOfCombat(bool isNowInCombat)
void HandleProc(ProcEventInfo &eventInfo)
void OnSpellCast(uint32 cntSpellId, uint32 otherCntSpellId, uint32 eclipseAuraSpellId)
bool Validate(SpellInfo const *) override
void Register() override
void Register() override
void Tick(AuraEffect const *)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandlePeriodicDummy(AuraEffect const *) const
void FilterTargets(std::list< WorldObject * > &targets) const
void Register() override
void RemoveOldAreaTrigger(SpellEffIndex) const
bool Validate(SpellInfo const *) override
void HandleEffect(SpellEffIndex) const
void FilterTargets(std::list< WorldObject * > &targets) const
void HandleProc(AuraEffect const *aurEff, ProcEventInfo const &eventInfo) const
bool Validate(SpellInfo const *spellInfo) override
bool CheckProc(AuraEffect const *, ProcEventInfo const &) const
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleCuriousBramblepatch(WorldObject *&target)
bool Validate(SpellInfo const *) override
void HandleCuriousBramblepatchAOE(std::list< WorldObject * > &targets)
void HandleLaunchTarget(SpellEffIndex)
void HandleHitTargetBurn(SpellEffIndex)
void HandleHitTargetDmg(SpellEffIndex)
bool Validate(SpellInfo const *) override
void Register() override
void Register() override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void PickRejuvenationVariant(WorldObject *&target) const
void Register() override
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void Register() override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool CheckEffectProc(AuraEffect const *aurEff, ProcEventInfo &)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *, ProcEventInfo &)
void Register() override
bool ToCatForm() const override
bool Validate(SpellInfo const *) override
void AfterApply(AuraEffect const *, AuraEffectHandleModes) const
void OnRemove(AuraEffect const *, AuraEffectHandleModes) const
bool Validate(SpellInfo const *) override
void Register() override
bool Validate(SpellInfo const *spellInfo) override
void Register() override
void PreventEffect(WorldObject *&target) const
SpellCastResult CheckCast()
void Register() override
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void Register() override
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *, ProcEventInfo const &eventInfo) const
static bool CheckProc(AuraEffect const *aurEff, ProcEventInfo const &)
void Register() override
bool Validate(SpellInfo const *) override
void Register() override
void HandleOnHit(SpellEffIndex)
void HandleProc(AuraEffect *, ProcEventInfo &)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
static void HandleProc(AuraEffect const *aurEff, ProcEventInfo const &eventInfo)
static bool CheckProc(AuraEffect const *, ProcEventInfo const &eventInfo)
bool ToCatForm() const override
void CalculateAmount(AuraEffect const *, int32 &amount, bool &canBeRecalculated)
void Register() override
bool Load() override
void AfterApply(AuraEffect const *aurEff, AuraEffectHandleModes)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void Register() override
SpellCastResult CheckCast()
bool Validate(SpellInfo const *) override
void OnTick(AuraEffect const *)
void Register() override
void Register() override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleOnHit(SpellEffIndex) const
bool ToCatForm() const override
void HandleDummy(SpellEffIndex)
void Register() override
void FilterTargets(std::list< WorldObject * > &targets)
bool CheckProc(AuraEffect const *aurEff, ProcEventInfo &procInfo)
void Register() override
void HandleOnHit(SpellEffIndex)
void Register() override
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
void FilterTargets(std::list< WorldObject * > &targets)
void Register() override
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void Register() override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void Register() override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void Register() override
void HandlePeriodic(AuraEffect const *)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleOnHitTarget(SpellEffIndex)
void Register() override
void HandlePeriodic(AuraEffect const *aurEff)
bool ToCatForm() const override
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
void OnApply(AuraEffect const *aurEff, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
SpellCastResult CheckCast()
bool Validate(SpellInfo const *) override
static SpellCastResult CheckLocationForForm(Player const *targetPlayer, Difficulty difficulty, bool requireOutdoors, uint32 spell_id)
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Load() override
static uint32 GetFormSpellId(Player const *player, Difficulty difficulty, bool requiresOutdoor)
void Register() override
void AfterRemove(AuraEffect const *aurEff, AuraEffectHandleModes)
void HandleTickUpdate(AuraEffect *aurEff)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *spellInfo) override
void FilterTargets(std::list< WorldObject * > &targets) const
void Register() override
void SelectTargets(std::list< WorldObject * > &targets)
void Register() override
bool Validate(SpellInfo const *) override
void HandleEffectPeriodic(AuraEffect const *aurEff)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:109
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:67
void SelectRandomInjuredTargets(std::list< WorldObject * > &targets, size_t maxTargets, bool prioritizePlayers, Unit const *prioritizeGroupMembersOf)
Definition: Spell.cpp:9306
void AddSC_druid_spell_scripts()
DruidSpells
Definition: spell_druid.cpp:38
@ SPELL_DRUID_SPRING_BLOSSOMS
@ SPELL_DRUID_THRASH_BEAR_AURA
@ SPELL_DRUID_BRAMBLES_REFLECT
Definition: spell_druid.cpp:52
@ SPELL_DRUID_SHOOTING_STARS
@ SPELL_DRUID_BLESSING_OF_CENARIUS
Definition: spell_druid.cpp:44
@ SPELL_DRUID_CULTIVATION_HEAL
Definition: spell_druid.cpp:56
@ SPELL_DRUID_BLESSING_OF_ELUNE
Definition: spell_druid.cpp:45
@ SPELL_DRUID_GLYPH_OF_STARS_VISUAL
Definition: spell_druid.cpp:84
@ SPELL_DRUID_MASS_ENTANGLEMENT
@ SPELL_DRUID_FORM_AQUATIC_PASSIVE
Definition: spell_druid.cpp:71
@ SPELL_DRUID_BLESSING_OF_THE_CLAW
Definition: spell_druid.cpp:47
@ SPELL_DRUID_BLOOD_FRENZY_RAGE_GAIN
Definition: spell_druid.cpp:49
@ SPELL_DRUID_POWER_OF_THE_ARCHDRUID
@ SPELL_DRUID_MANGLE
Definition: spell_druid.cpp:99
@ SPELL_DRUID_BLESSING_OF_REMULOS
Definition: spell_druid.cpp:46
@ SPELL_DRUID_EFFLORESCENCE_HEAL
Definition: spell_druid.cpp:66
@ SPELL_DRUID_FORMS_TRINKET_BEAR
Definition: spell_druid.cpp:76
@ SPELL_DRUID_SUNFIRE_DAMAGE
@ SPELL_DRUID_INCARNATION_TREE_OF_LIFE
Definition: spell_druid.cpp:91
@ SPELL_DRUID_MOONFIRE_DAMAGE
@ SPELL_DRUID_EARTHWARDEN_AURA
Definition: spell_druid.cpp:58
@ SPELL_DRUID_GORE_PROC
Definition: spell_druid.cpp:85
@ SPELL_DRUID_EMBRACE_OF_THE_DREAM_EFFECT
Definition: spell_druid.cpp:67
@ SPELL_DRUID_FORMS_TRINKET_CAT
Definition: spell_druid.cpp:77
@ SPELL_DRUID_ECLIPSE_LUNAR_SPELL_CNT
Definition: spell_druid.cpp:61
@ SPELL_DRUID_CULTIVATION
Definition: spell_druid.cpp:55
@ SPELL_DRUID_EXHILARATE
Definition: spell_druid.cpp:70
@ SPELL_DRUID_REJUVENATION_T10_PROC
@ SPELL_DRUID_FORM_AQUATIC
Definition: spell_druid.cpp:72
@ SPELL_DRUID_INCARNATION
Definition: spell_druid.cpp:89
@ SPELL_DRUID_BALANCE_T10_BONUS_PROC
Definition: spell_druid.cpp:42
@ SPELL_DRUID_PROWL
@ SPELL_DRUID_ECLIPSE_LUNAR_AURA
Definition: spell_druid.cpp:60
@ SPELL_DRUID_BEAR_FORM
Definition: spell_druid.cpp:43
@ SPELL_DRUID_THRASH_CAT
@ SPELL_DRUID_REGROWTH
@ SPELL_DRUID_SHOOTING_STARS_DAMAGE
@ SPELL_DRUID_GROWL
Definition: spell_druid.cpp:86
@ SPELL_DRUID_SAVAGE_ROAR
@ SPELL_DRUID_LIFEBLOOM_FINAL_HEAL
Definition: spell_druid.cpp:97
@ SPELL_DRUID_FORM_FLIGHT
Definition: spell_druid.cpp:73
@ SPELL_DRUID_BRISTLING_FUR_GAIN_RAGE
Definition: spell_druid.cpp:53
@ SPELL_DRUID_REJUVENATION
@ SPELL_DRUID_BRAMBLES_PASSIVE
Definition: spell_druid.cpp:51
@ SPELL_DRUID_REJUVENATION_GERMINATION
@ SPELL_DRUID_BRAMBLES_DAMAGE_AURA
Definition: spell_druid.cpp:50
@ SPELL_DRUID_YSERAS_GIFT_HEAL_PARTY
@ SPELL_DRUID_SURVIVAL_INSTINCTS
@ SPELL_DRUID_GLYPH_OF_STARS
Definition: spell_druid.cpp:83
@ SPELL_DRUID_ABUNDANCE_EFFECT
Definition: spell_druid.cpp:40
@ SPELL_DRUID_YSERAS_GIFT_HEAL_SELF
@ SPELL_DRUID_THRASH_BEAR
@ SPELL_DRUID_IDOL_OF_FERAL_SHADOWS
Definition: spell_druid.cpp:87
@ SPELL_DRUID_INNER_PEACE
Definition: spell_druid.cpp:92
@ SPELL_DRUID_BLOOD_FRENZY_AURA
Definition: spell_druid.cpp:48
@ SPELL_DRUID_INFUSION
Definition: spell_druid.cpp:95
@ SPELL_DRUID_IDOL_OF_WORSHIP
Definition: spell_druid.cpp:88
@ SPELL_DRUID_FORM_STAG
Definition: spell_druid.cpp:74
@ SPELL_DRUID_FORMS_TRINKET_NONE
Definition: spell_druid.cpp:79
@ SPELL_DRUID_INNERVATE_RANK_2
Definition: spell_druid.cpp:94
@ SPELL_DRUID_GERMINATION
Definition: spell_druid.cpp:82
@ SPELL_DRUID_FORMS_TRINKET_MOONKIN
Definition: spell_druid.cpp:78
@ SPELL_DRUID_LUNAR_INSPIRATION_OVERRIDE
Definition: spell_druid.cpp:98
@ SPELL_DRUID_INNERVATE
Definition: spell_druid.cpp:93
@ SPELL_DRUID_EFFLORESCENCE_AURA
Definition: spell_druid.cpp:65
@ SPELL_DRUID_FORM_SWIFT_FLIGHT
Definition: spell_druid.cpp:75
@ SPELL_DRUID_SKULL_BASH_CHARGE
@ SPELL_DRUID_BALANCE_T10_BONUS
Definition: spell_druid.cpp:41
@ SPELL_DRUID_ECLIPSE_DUMMY
Definition: spell_druid.cpp:59
@ SPELL_DRUID_ECLIPSE_SOLAR_AURA
Definition: spell_druid.cpp:63
@ SPELL_DRUID_SKULL_BASH_INTERRUPT
@ SPELL_DRUID_FORMS_TRINKET_TREE
Definition: spell_druid.cpp:80
@ SPELL_DRUID_GALACTIC_GUARDIAN_AURA
Definition: spell_druid.cpp:81
@ SPELL_DRUID_CURIOUS_BRAMBLEPATCH
Definition: spell_druid.cpp:57
@ SPELL_DRUID_LANGUISH
Definition: spell_druid.cpp:96
@ SPELL_DRUID_TREE_OF_LIFE
@ SPELL_DRUID_INCARNATION_KING_OF_THE_JUNGLE
Definition: spell_druid.cpp:90
@ SPELL_DRUID_SPRING_BLOSSOMS_HEAL
@ SPELL_DRUID_ECLIPSE_SOLAR_SPELL_CNT
Definition: spell_druid.cpp:64
@ SPELL_DRUID_ENTANGLING_ROOTS
Definition: spell_druid.cpp:69
@ SPELL_DRUID_ECLIPSE_OOC
Definition: spell_druid.cpp:62
@ SPELL_DRUID_ABUNDANCE
Definition: spell_druid.cpp:39
@ SPELL_DRUID_EMBRACE_OF_THE_DREAM_HEAL
Definition: spell_druid.cpp:68
@ SPELL_DRUID_CAT_FORM
Definition: spell_druid.cpp:54
@ SPELL_DRUID_RESTORATION_T10_2P_BONUS
@ SPELL_DRUID_TRAVEL_FORM
CastSpellExtraArgs & AddSpellBP0(int32 val)
Definition: SpellDefines.h:475
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:474
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:203
ChrSpecializationRole GetRole() const
Definition: DB2Structure.h:873
Optional< std::vector< SpellLogEffectGenericVictimParams > > GenericVictimTargets
Definition: Spell.h:212