TrinityCore
Loading...
Searching...
No Matches
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 "Containers.h"
26#include "GameTime.h"
27#include "Optional.h"
28#include "Player.h"
29#include "SpellAuraEffects.h"
30#include "SpellHistory.h"
31#include "SpellMgr.h"
32#include "SpellScript.h"
33
35{
97};
98
103
104// 22812 - Barkskin
124
125// 1178 - Bear Form (Passive)
126// 9635 - Dire Bear Form (Passive)
128{
130
131 bool Validate(SpellInfo const* /*spellInfo*/) override
132 {
133 return ValidateSpellInfo(
134 {
137 });
138 }
139
140 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
141 {
143 return;
144
145 int32 mod = 0;
146 switch (GetId())
147 {
149 mod = -27;
150 break;
152 mod = -16;
153 break;
154 default:
155 return;
156 }
157 amount += mod;
158 }
159
164};
165
166// 50334 - Berserk
168{
170
171 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
172 {
173 // Remove cooldown on Mangle (bear)
174 GetTarget()->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
175 {
176 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
177 return spellInfo && spellInfo->GetCategory() == SPELL_CATEGORY_MANGLE_BEAR;
178 }, true);
179 }
180
185};
186
187// -1850 - Dash
189{
191
192 void CalculateAmount(AuraEffect const* /*aurEff*/, int32 &amount, bool & /*canBeRecalculated*/)
193 {
194 // do not set speed if not in cat form
195 if (GetUnitOwner()->GetShapeshiftForm() != FORM_CAT)
196 amount = 0;
197 }
198
203};
204
205// -48516 - Eclipse
207{
209
210 bool Validate(SpellInfo const* /*spellInfo*/) override
211 {
212 return ValidateSpellInfo(
213 {
216 });
217 }
218
219 bool CheckProc(ProcEventInfo& eventInfo)
220 {
222 return false;
223
224 return true;
225 }
226
227 bool CheckSolar(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
228 {
229 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
230 if (!spellInfo || !(spellInfo->SpellFamilyFlags[0] & 4)) // Starfire
231 return false;
232
234 }
235
236 bool CheckLunar(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
237 {
238 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
239 if (!spellInfo || !(spellInfo->SpellFamilyFlags[0] & 1)) // Wrath
240 return false;
241
242 // Reduced lunar proc chance (60% of normal)
243 if (!roll_chance_i(60))
244 return false;
245
247 }
248
249 void ProcSolar(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
250 {
252
254 eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_SOLAR_PROC, aurEff);
255 }
256
257 void ProcLunar(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
258 {
260
262 eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_LUNAR_PROC, aurEff);
263 }
264
275
276 TimePoint _lunarProcCooldownEnd = std::chrono::steady_clock::time_point::min();
277 TimePoint _solarProcCooldownEnd = std::chrono::steady_clock::time_point::min();
278};
279
280// 5229 - Enrage
282{
284
295
297 {
298 // Recalculate modifies the list while we're iterating through it, so let's copy it instead
300 std::vector<AuraEffect*> aurEffs(auras.begin(), auras.end());
301
302 for (AuraEffect* aurEff : aurEffs)
303 {
304 SpellInfo const* spellInfo = aurEff->GetSpellInfo();
305 // Dire- / Bear Form (Passive)
306 if (spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && spellInfo->SpellFamilyFlags & flag96(0x0, 0x0, 0x2))
307 aurEff->RecalculateAmount();
308 }
309 }
310
311 void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
312 {
313 Unit* target = GetTarget();
315 {
317 args.AddSpellBP0(aurEff->GetAmount());
318 target->CastSpell(target, SPELL_DRUID_ENRAGE_MOD_DAMAGE, args);
319 }
320
321 // Item - Druid T10 Feral 4P Bonus
323 target->CastSpell(target, SPELL_DRUID_ENRAGED_DEFENSE, true);
324
326 }
327
335
341};
342
343// 37336 - Druid Forms Trinket
345{
347
359
360 bool CheckProc(ProcEventInfo& eventInfo)
361 {
362 Unit* target = eventInfo.GetActor();
363
364 switch (target->GetShapeshiftForm())
365 {
366 case FORM_BEAR:
367 case FORM_DIREBEAR:
368 case FORM_CAT:
369 case FORM_MOONKIN:
370 case FORM_NONE:
371 case FORM_TREE:
372 return true;
373 default:
374 break;
375 }
376
377 return false;
378 }
379
380 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
381 {
383 Unit* target = eventInfo.GetActor();
384 uint32 triggerspell = 0;
385
386 switch (target->GetShapeshiftForm())
387 {
388 case FORM_BEAR:
389 case FORM_DIREBEAR:
390 triggerspell = SPELL_DRUID_FORMS_TRINKET_BEAR;
391 break;
392 case FORM_CAT:
393 triggerspell = SPELL_DRUID_FORMS_TRINKET_CAT;
394 break;
395 case FORM_MOONKIN:
397 break;
398 case FORM_NONE:
399 triggerspell = SPELL_DRUID_FORMS_TRINKET_NONE;
400 break;
401 case FORM_TREE:
402 triggerspell = SPELL_DRUID_FORMS_TRINKET_TREE;
403 break;
404 default:
405 return;
406 }
407
408 target->CastSpell(target, triggerspell, aurEff);
409 }
410
416};
417
418// -33943 - Flight Form
437
438// 22842 - Frenzied Regeneration
440{
442
443 bool Validate(SpellInfo const* /*spellInfo*/) override
444 {
446 }
447
448 void PeriodicTick(AuraEffect const* aurEff)
449 {
450 // Converts up to 10 rage per second into health for $d. Each point of rage is converted into ${$m2/10}.1% of max health.
451 if (GetTarget()->GetPowerType() != POWER_RAGE)
452 return;
453
455 // Nothing to do
456 if (!rage)
457 return;
458
459 int32 const mod = std::min(static_cast<int32>(rage), 100);
460 int32 const regen = CalculatePct(GetTarget()->GetMaxHealth(), GetTarget()->CalculateSpellDamage(GetEffectInfo(EFFECT_1)) * mod / 100.f);
461 CastSpellExtraArgs args(aurEff);
462 args.AddSpellBP0(regen);
464 GetTarget()->SetPower(POWER_RAGE, rage - mod);
465 }
466
471};
472
473// 63057 - Glyph of Barkskin
475{
477
478 bool Validate(SpellInfo const* /*spellInfo*/) override
479 {
481 }
482
483 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
484 {
486 eventInfo.GetActor()->CastSpell(nullptr, SPELL_DRUID_BARKSKIN_01, aurEff);
487 }
488
493};
494
495// 54832 - Glyph of Innervate
497{
499
500 bool Validate(SpellInfo const* /*spellInfo*/) override
501 {
503 }
504
505 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
506 {
508
509 Unit* caster = eventInfo.GetActor();
510 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_DRUID_GLYPH_OF_INNERVATE_REGEN);
511 int32 amount = CalculatePct(static_cast<int32>(caster->GetCreatePowerValue(POWER_MANA)), aurEff->GetAmount());
512
513 ASSERT(spellInfo->GetMaxTicks() > 0);
514 amount /= spellInfo->GetMaxTicks();
515
516 CastSpellExtraArgs args(aurEff);
517 args.AddSpellBP0(amount);
518 caster->CastSpell(nullptr, SPELL_DRUID_GLYPH_OF_INNERVATE_REGEN, args);
519 }
520
525};
526
527// 54821 - Glyph of Rake
529{
531
532 bool Validate(SpellInfo const* /*spellInfo*/) override
533 {
535 }
536
537 bool CheckProc(ProcEventInfo& eventInfo)
538 {
539 return eventInfo.GetActionTarget()->IsCreature();
540 }
541
542 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
543 {
546 }
547
553};
554
555// 54754 - Glyph of Rejuvenation
557{
559
560 bool Validate(SpellInfo const* /*spellInfo*/) override
561 {
563 }
564
565 bool CheckProc(ProcEventInfo& eventInfo)
566 {
567 if (!eventInfo.GetActionTarget()->HealthBelowPct(50))
568 return false;
569
570 HealInfo* healInfo = eventInfo.GetHealInfo();
571 return healInfo && healInfo->GetHeal();
572 }
573
574 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
575 {
577
578 CastSpellExtraArgs args(aurEff);
579 args.AddSpellBP0(CalculatePct(eventInfo.GetHealInfo()->GetHeal(), aurEff->GetAmount()));
581 }
582
588};
589
590// 54815 - Glyph of Shred
592{
594
595 bool Validate(SpellInfo const* /*spellInfo*/) override
596 {
597 return ValidateSpellInfo(
598 {
601 });
602 }
603
604 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
605 {
607
608 Unit* caster = eventInfo.GetActor();
609 // try to find spell Rip on the target
610 if (AuraEffect const* rip = eventInfo.GetActionTarget()->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00800000, 0x0, 0x0, caster->GetGUID()))
611 {
612 // Rip's max duration, note: spells which modifies Rip's duration also counted like Glyph of Rip
613 uint32 countMin = rip->GetBase()->GetMaxDuration();
614
615 // just Rip's max duration without other spells
616 uint32 countMax = rip->GetSpellInfo()->GetMaxDuration();
617
618 // add possible auras' and Glyph of Shred's max duration
619 countMax += 3 * aurEff->GetAmount() * IN_MILLISECONDS; // Glyph of Shred -> +6 seconds
620 countMax += caster->HasAura(SPELL_DRUID_GLYPH_OF_RIP) ? 4 * IN_MILLISECONDS : 0; // Glyph of Rip -> +4 seconds
621 countMax += caster->HasAura(SPELL_DRUID_RIP_DURATION_LACERATE_DMG) ? 4 * IN_MILLISECONDS : 0; // T7 set bonus -> +4 seconds
622
623 // if min < max -> that means caster didn't cast 3 shred yet
624 // so set Rip's duration and max duration
625 if (countMin < countMax)
626 {
627 rip->GetBase()->SetDuration(rip->GetBase()->GetDuration() + aurEff->GetAmount() * IN_MILLISECONDS);
628 rip->GetBase()->SetMaxDuration(countMin + aurEff->GetAmount() * IN_MILLISECONDS);
629 }
630 }
631 }
632
637};
638
639// 54846 - Glyph of Starfire
641{
643
644 bool Validate(SpellInfo const* /*spellInfo*/) override
645 {
647 }
648
650 {
651 Unit* caster = GetCaster();
652 if (Unit* unitTarget = GetHitUnit())
653 {
654 if (AuraEffect const* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00000002, 0, 0, caster->GetGUID()))
655 {
656 Aura* aura = aurEff->GetBase();
657
658 uint32 countMin = aura->GetMaxDuration();
659 uint32 countMax = aura->GetSpellInfo()->GetMaxDuration() + 9000;
661 countMax += 3000;
663 countMax += 3000;
664
665 if (countMin < countMax)
666 {
667 aura->SetDuration(uint32(aura->GetDuration() + 3000));
668 aura->SetMaxDuration(countMin + 3000);
669 }
670 }
671 }
672 }
673
678};
679
680// 54845 - Glyph of Starfire
701
702// 34246 - Idol of the Emerald Queen
703// 60779 - Idol of Lush Moss
705{
707
708 void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
709 {
710 if (!spellMod)
711 {
712 spellMod = new SpellModifier(GetAura());
713 spellMod->op = SPELLMOD_DOT;
714 spellMod->type = SPELLMOD_FLAT;
715 spellMod->spellId = GetId();
716 spellMod->mask = aurEff->GetSpellEffectInfo().SpellClassMask;
717 }
718 spellMod->value = aurEff->GetAmount() / 7;
719 }
720
725};
726
727// 29166 - Innervate
729{
731
732 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
733 {
734 if (!aurEff->GetTotalTicks())
735 {
736 amount = 0;
737 return;
738 }
739
740 if (Unit* caster = GetCaster())
741 amount = int32(CalculatePct(caster->GetCreatePowerValue(POWER_MANA), amount) / aurEff->GetTotalTicks());
742 else
743 amount = 0;
744 }
745
750};
751
752// -5570 - Insect Swarm
754{
756
757 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
758 {
759 if (!aurEff->GetTotalTicks())
760 return;
761
762 if (Unit* caster = GetCaster())
763 if (AuraEffect const* relicAurEff = caster->GetAuraEffect(SPELL_DRUID_ITEM_T8_BALANCE_RELIC, EFFECT_0))
764 amount += relicAurEff->GetAmount() / aurEff->GetTotalTicks();
765 }
766
771};
772
773// 24932 - Leader of the Pack
775{
777
787
788 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
789 {
791 if (!aurEff->GetAmount())
792 return;
793
794 Unit* caster = eventInfo.GetActor();
796 return;
797
798 CastSpellExtraArgs args(aurEff);
799 args.AddSpellBP0(caster->CountPctFromMaxHealth(aurEff->GetAmount()));
801
802 // Because of how proc system works, we can't store proc cd on db, it would be applied to entire aura
803 // so aura could only proc once per 6 seconds, independently of caster
805
806 // only proc on self
807 if (aurEff->GetCasterGUID() != caster->GetGUID())
808 return;
809
811 ASSERT(impLotpMana);
812
813 CastSpellExtraArgs args2(aurEff);
815 caster->CastSpell(nullptr, SPELL_DRUID_IMP_LEADER_OF_THE_PACK_MANA, args2);
816 }
817
822};
823
824// -33763 - Lifebloom
826{
828
829 bool Validate(SpellInfo const* /*spell*/) override
830 {
831 return ValidateSpellInfo(
832 {
835 });
836 }
837
838 void OnRemoveEffect(Unit* target, AuraEffect const* aurEff, uint32 stack)
839 {
840 int32 healAmount = aurEff->GetAmount();
841 if (Unit* caster = GetCaster())
842 {
843 // restore mana
844 CastSpellExtraArgs args(aurEff);
846 args.AddSpellBP0(CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2);
847 caster->CastSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, args);
848 }
849
850 CastSpellExtraArgs args(aurEff);
852 args.AddSpellBP0(healAmount);
853 target->CastSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, args);
854 }
855
856 void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
857 {
858 // Final heal only on duration end
859 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
860 return;
861
862 // final heal
864 }
865
866 void HandleDispel(DispelInfo* dispelInfo)
867 {
868 if (Unit* target = GetUnitOwner())
869 if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
870 OnRemoveEffect(target, aurEff, dispelInfo->GetRemovedCharges()); // final heal
871 }
872
878};
879
880// -48496 - Living Seed
882{
884
885 bool Validate(SpellInfo const* /*spellInfo*/) override
886 {
888 }
889
890 bool CheckProc(ProcEventInfo& eventInfo)
891 {
892 HealInfo* healInfo = eventInfo.GetHealInfo();
893 return healInfo && healInfo->GetHeal();
894 }
895
896 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
897 {
899
900 CastSpellExtraArgs args(aurEff);
901 args.AddSpellBP0(CalculatePct(eventInfo.GetHealInfo()->GetHeal(), aurEff->GetAmount()));
903 }
904
910};
911
912// 48504 - Living Seed (Proc)
914{
916
917 bool Validate(SpellInfo const* /*spellInfo*/) override
918 {
920 }
921
922 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
923 {
925 CastSpellExtraArgs args(aurEff);
926 args.AddSpellBP0(aurEff->GetAmount());
928 }
929
934};
935
936// 69366 - Moonkin Form passive
938{
940
941public:
946
947private:
949
950 bool Load() override
951 {
953 return true;
954 }
955
956 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
957 {
958 // Set absorbtion amount to unlimited
959 amount = -1;
960 }
961
962 void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
963 {
964 // reduces all damage taken while Stunned in Moonkin Form
965 if (GetTarget()->HasUnitFlag(UNIT_FLAG_STUNNED) &&
966 GetTarget()->HasAuraWithMechanic(1 << MECHANIC_STUN))
967 absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
968 }
969
975};
976
977// 50464 - Nourish
979{
981
982 void HandleHeal(SpellEffIndex /*effIndex*/)
983 {
984 Unit* caster = GetCaster();
985
986 // Glyph of Nourish
988 {
989 uint32 auraCount = 0;
990 int32 heal = GetHitHeal();
991
993 for (AuraEffect const* hot : periodicHeals)
994 {
995 if (caster->GetGUID() == hot->GetCasterGUID())
996 ++auraCount;
997 }
998
999 AddPct(heal, aurEff->GetAmount() * auraCount);
1000 SetHitHeal(heal);
1001 }
1002 }
1003
1008};
1009
1010// -33872 - Nurturing Instinct
1039
1040// 16864 - Omen of Clarity
1042{
1044
1045 bool Validate(SpellInfo const* /*spellInfo*/) override
1046 {
1047 return ValidateSpellInfo(
1048 {
1051 });
1052 }
1053
1054 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
1055 {
1056 Unit* target = GetTarget();
1058 target->CastSpell(nullptr, SPELL_DRUID_BALANCE_T10_BONUS_PROC, aurEff);
1059 }
1060
1065};
1066
1067// 48391 - Owlkin Frenzy
1069{
1071
1072 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
1073 {
1074 amount = CalculatePct(GetUnitOwner()->GetCreatePowerValue(POWER_MANA), amount);
1075 }
1076
1081};
1082
1083// -16972 - Predatory Strikes
1100
1101// -33851 - Primal Tenacity
1103{
1105
1106public:
1108 {
1109 absorbPct = 0;
1110 }
1111
1112private:
1114
1115 bool Load() override
1116 {
1118 return true;
1119 }
1120
1121 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
1122 {
1123 // Set absorbtion amount to unlimited
1124 amount = -1;
1125 }
1126
1127 void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
1128 {
1129 // reduces all damage taken while Stunned in Cat Form
1130 if (GetTarget()->GetShapeshiftForm() == FORM_CAT && GetTarget()->HasUnitFlag(UNIT_FLAG_STUNNED) &&
1131 GetTarget()->HasAuraWithMechanic(1 << MECHANIC_STUN))
1132 absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
1133 }
1134
1140};
1141
1142// -48539 - Revitalize
1144{
1146
1157
1158 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1159 {
1161 if (!roll_chance_i(aurEff->GetAmount()))
1162 return;
1163
1164 Unit* target = eventInfo.GetActionTarget();
1165 uint32 spellId;
1166
1167 switch (target->GetPowerType())
1168 {
1169 case POWER_MANA:
1171 break;
1172 case POWER_RAGE:
1174 break;
1175 case POWER_ENERGY:
1177 break;
1178 case POWER_RUNIC_POWER:
1180 break;
1181 default:
1182 return;
1183 }
1184
1185 eventInfo.GetActor()->CastSpell(target, spellId, aurEff);
1186 }
1187
1192};
1193
1194// -1079 - Rip
1196{
1198
1199 bool Load() override
1200 {
1201 Unit* caster = GetCaster();
1202 return caster && GetCaster()->GetTypeId() == TYPEID_PLAYER;
1203 }
1204
1205 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
1206 {
1207 canBeRecalculated = false;
1208
1209 if (Unit* caster = GetCaster())
1210 {
1211 // 0.01 * $AP * cp
1212 uint8 cp = caster->ToPlayer()->GetComboPoints();
1213
1214 // Idol of Feral Shadows. Can't be handled as SpellMod due its dependency from CPs
1215 if (AuraEffect const* auraEffIdolOfFeralShadows = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_FERAL_SHADOWS, EFFECT_0))
1216 amount += cp * auraEffIdolOfFeralShadows->GetAmount();
1217 // Idol of Worship. Can't be handled as SpellMod due its dependency from CPs
1218 else if (AuraEffect const* auraEffIdolOfWorship = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_WORSHIP, EFFECT_0))
1219 amount += cp * auraEffIdolOfWorship->GetAmount();
1220
1221 amount += int32(CalculatePct(caster->GetTotalAttackPowerValue(BASE_ATTACK), cp));
1222 }
1223 }
1224
1229};
1230
1231// 62600 - Savage Defense
1233{
1235
1236 bool Validate(SpellInfo const* spellInfo) override
1237 {
1238 return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
1239 }
1240
1241 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1242 {
1244 Unit* caster = eventInfo.GetActor();
1245 CastSpellExtraArgs args(aurEff);
1247 caster->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, args);
1248 }
1249
1254};
1255
1256// 52610 - Savage Roar
1258{
1260
1262 {
1263 Unit* caster = GetCaster();
1264 if (caster->GetShapeshiftForm() != FORM_CAT)
1266
1267 return SPELL_CAST_OK;
1268 }
1269
1274};
1275
1302
1303// -50294 - Starfall (AOE)
1305{
1307
1308 void FilterTargets(std::list<WorldObject*>& targets)
1309 {
1310 targets.remove(GetExplTargetUnit());
1311 }
1312
1317};
1318
1319// -50286 - Starfall (Dummy)
1321{
1323
1324 void FilterTargets(std::list<WorldObject*>& targets)
1325 {
1327 }
1328
1329 void HandleDummy(SpellEffIndex /*effIndex*/)
1330 {
1331 Unit* caster = GetCaster();
1332 // Shapeshifting into an animal form or mounting cancels the effect
1333 if (caster->GetCreatureType() == CREATURE_TYPE_BEAST || caster->IsMounted())
1334 {
1335 if (SpellInfo const* spellInfo = GetTriggeringSpell())
1336 caster->RemoveAurasDueToSpell(spellInfo->Id);
1337 return;
1338 }
1339
1340 // Any effect which causes you to lose control of your character will supress the starfall effect.
1342 return;
1343
1344 caster->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
1345 }
1346
1352};
1353
1354// 61336 - Survival Instincts
1356{
1358
1360 {
1361 Unit* caster = GetCaster();
1362 if (!caster->IsInFeralForm())
1364
1365 return SPELL_CAST_OK;
1366 }
1367
1372};
1373
1402
1403// 40121 - Swift Flight Form (Passive)
1405{
1407
1408 bool Load() override
1409 {
1410 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1411 }
1412
1413 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
1414 {
1415 if (Player* caster = GetCaster()->ToPlayer())
1416 if (caster->Has310Flyer(false))
1417 amount = 310;
1418 }
1419
1424};
1425
1426// -5217 - Tiger's Fury
1428{
1430
1431 void OnHit()
1432 {
1433 if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_DRUID_KING_OF_THE_JUNGLE, EFFECT_1))
1434 {
1436 args.AddSpellBP0(aurEff->GetAmount());
1438 }
1439 }
1440
1441 void Register() override
1442 {
1444 }
1445};
1446
1447// -61391 - Typhoon
1449{
1451
1453 {
1454 // Glyph of Typhoon
1456 PreventHitDefaultEffect(effIndex);
1457 }
1458
1463};
1464
1465// 28716 - Rejuvenation
1467{
1469
1470 bool Validate(SpellInfo const* /*spellInfo*/) override
1471 {
1472 return ValidateSpellInfo(
1473 {
1477 });
1478 }
1479
1480 bool CheckProc(ProcEventInfo& /*eventInfo*/)
1481 {
1482 if (!roll_chance_i(50))
1483 return false;
1484 return true;
1485 }
1486
1487 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1488 {
1490 Unit* target = eventInfo.GetActionTarget();
1491 uint32 spellId;
1492
1493 switch (target->GetPowerType())
1494 {
1495 case POWER_MANA:
1497 break;
1498 case POWER_RAGE:
1500 break;
1501 case POWER_ENERGY:
1503 break;
1504 default:
1505 return;
1506 }
1507
1508 eventInfo.GetActor()->CastSpell(target, spellId, aurEff);
1509 }
1510
1516};
1517
1518// 28744 - Regrowth
1520{
1522
1523 bool Validate(SpellInfo const* /*spellInfo*/) override
1524 {
1526 }
1527
1528 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1529 {
1531 eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), SPELL_DRUID_BLESSING_OF_THE_CLAW, aurEff);
1532 }
1533
1538};
1539
1540// 28719 - Healing Touch
1542{
1544
1545 bool Validate(SpellInfo const* /*spellInfo*/) override
1546 {
1548 }
1549
1550 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1551 {
1553 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1554 if (!spellInfo)
1555 return;
1556
1557 Unit* caster = eventInfo.GetActor();
1558 int32 amount = CalculatePct(spellInfo->CalcPowerCost(caster, spellInfo->GetSchoolMask()), aurEff->GetAmount());
1559 CastSpellExtraArgs args(aurEff);
1560 args.AddSpellBP0(amount);
1561 caster->CastSpell(nullptr, SPELL_DRUID_EXHILARATE, args);
1562 }
1563
1568};
1569
1570// 37288 - Mana Restore
1571// 37295 - Mana Restore
1573{
1575
1576 bool Validate(SpellInfo const* /*spellInfo*/) override
1577 {
1579 }
1580
1581 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1582 {
1584 eventInfo.GetActor()->CastSpell(nullptr, SPELL_DRUID_INFUSION, aurEff);
1585 }
1586
1591};
1592
1593// 40442 - Druid Tier 6 Trinket
1595{
1597
1598 bool Validate(SpellInfo const* /*spellInfo*/) override
1599 {
1600 return ValidateSpellInfo(
1601 {
1605 });
1606 }
1607
1608 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1609 {
1611 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1612 if (!spellInfo)
1613 return;
1614
1615 uint32 spellId;
1616 int32 chance;
1617
1618 // Starfire
1619 if (spellInfo->SpellFamilyFlags[0] & 0x00000004)
1620 {
1622 chance = 25;
1623 }
1624 // Rejuvenation
1625 else if (spellInfo->SpellFamilyFlags[0] & 0x00000010)
1626 {
1628 chance = 25;
1629 }
1630 // Mangle (Bear) and Mangle (Cat)
1631 else if (spellInfo->SpellFamilyFlags[1] & 0x00000440)
1632 {
1634 chance = 40;
1635 } else
1636 return;
1637
1638 if (roll_chance_i(chance))
1639 eventInfo.GetActor()->CastSpell(nullptr, spellId, aurEff);
1640 }
1641
1646};
1647
1648// 67353 - T9 Feral Relic (Idol of Mutilation)
1650{
1652
1653 bool Validate(SpellInfo const* /*spellInfo*/) override
1654 {
1655 return ValidateSpellInfo(
1656 {
1659 });
1660 }
1661
1662 bool CheckProc(ProcEventInfo& eventInfo)
1663 {
1664 Unit* target = eventInfo.GetActor();
1665
1666 switch (target->GetShapeshiftForm())
1667 {
1668 case FORM_BEAR:
1669 case FORM_DIREBEAR:
1670 case FORM_CAT:
1671 return true;
1672 default:
1673 break;
1674 }
1675
1676 return false;
1677 }
1678
1679 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1680 {
1682 uint32 triggerspell = 0;
1683
1684 Unit* target = eventInfo.GetActor();
1685
1686 switch (target->GetShapeshiftForm())
1687 {
1688 case FORM_BEAR:
1689 case FORM_DIREBEAR:
1690 triggerspell = SPELL_DRUID_T9_FERAL_RELIC_BEAR;
1691 break;
1692 case FORM_CAT:
1693 triggerspell = SPELL_DRUID_T9_FERAL_RELIC_CAT;
1694 break;
1695 default:
1696 return;
1697 }
1698
1699 target->CastSpell(target, triggerspell, aurEff);
1700 }
1701
1707};
1708
1709// 70723 - Item - Druid T10 Balance 4P Bonus
1711{
1713
1714 bool Validate(SpellInfo const* /*spellInfo*/) override
1715 {
1717 }
1718
1719 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1720 {
1722
1723 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
1724 if (!damageInfo || !damageInfo->GetDamage())
1725 return;
1726
1727 Unit* caster = eventInfo.GetActor();
1728 Unit* target = eventInfo.GetActionTarget();
1729
1730 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_DRUID_LANGUISH);
1731 int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
1732
1733 ASSERT(spellInfo->GetMaxTicks() > 0);
1734 amount /= spellInfo->GetMaxTicks();
1735
1736 CastSpellExtraArgs args(aurEff);
1737 args.AddSpellBP0(amount);
1738 caster->CastSpell(target, SPELL_DRUID_LANGUISH, args);
1739 }
1740
1745};
1746
1747// 70691 - Item T10 Restoration 4P Bonus
1749{
1751
1752 bool Load() override
1753 {
1754 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1755 }
1756
1757 void FilterTargets(std::list<WorldObject*>& targets)
1758 {
1759 if (!GetCaster()->ToPlayer()->GetGroup())
1760 {
1761 targets.clear();
1762 targets.push_back(GetCaster());
1763 } else
1764 {
1765 targets.remove(GetExplTargetUnit());
1766 std::list<Unit*> tempTargets;
1767 for (std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
1768 if ((*itr)->GetTypeId() == TYPEID_PLAYER && GetCaster()->IsInRaidWith((*itr)->ToUnit()))
1769 tempTargets.push_back((*itr)->ToUnit());
1770
1771 if (tempTargets.empty())
1772 {
1773 targets.clear();
1775 return;
1776 }
1777
1779 targets.clear();
1780 targets.push_back(target);
1781 }
1782 }
1783
1788};
1789
1790// 70664 - Druid T10 Restoration 4P Bonus (Rejuvenation)
1792{
1794
1795 bool Validate(SpellInfo const* /*spellInfo*/) override
1796 {
1798 }
1799
1800 bool CheckProc(ProcEventInfo& eventInfo)
1801 {
1802 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1803 if (!spellInfo || spellInfo->Id == SPELL_DRUID_REJUVENATION_T10_PROC)
1804 return false;
1805
1806 HealInfo* healInfo = eventInfo.GetHealInfo();
1807 if (!healInfo || !healInfo->GetHeal())
1808 return false;
1809
1810 Player* caster = eventInfo.GetActor()->ToPlayer();
1811 if (!caster)
1812 return false;
1813
1814 return caster->GetGroup() || caster != eventInfo.GetActionTarget();
1815 }
1816
1817 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
1818 {
1820
1821 CastSpellExtraArgs args(aurEff);
1822 args.AddSpellBP0(eventInfo.GetHealInfo()->GetHeal());
1823 eventInfo.GetActor()->CastSpell(nullptr, SPELL_DRUID_REJUVENATION_T10_PROC, args);
1824 }
1825
1831};
1832
1834{
1835public:
1836 explicit RaidCheck(Unit const* caster) : _caster(caster)
1837 {}
1838
1839 bool operator()(WorldObject* obj) const
1840 {
1841 if (Unit* target = obj->ToUnit())
1842 return !_caster->IsInRaidWith(target);
1843
1844 return true;
1845 }
1846
1847private:
1849};
1850
1851// -48438 - Wild Growth
1853{
1855
1856 bool Validate(SpellInfo const* spellInfo) override
1857 {
1858 if (spellInfo->GetEffect(EFFECT_2).IsEffect() || spellInfo->GetEffect(EFFECT_2).CalcValue() <= 0)
1859 return false;
1860 return true;
1861 }
1862
1863 void FilterTargets(std::list<WorldObject*>& targets)
1864 {
1865 targets.remove_if(RaidCheck(GetCaster()));
1866
1867 uint32 const maxTargets = uint32(GetEffectInfo(EFFECT_2).CalcValue(GetCaster()));
1868
1869 if (targets.size() > maxTargets)
1870 {
1871 targets.sort(Trinity::HealthPctOrderPred());
1872 targets.resize(maxTargets);
1873 }
1874
1875 _targets = targets;
1876 }
1877
1878 void SetTargets(std::list<WorldObject*>& targets)
1879 {
1880 targets = _targets;
1881 }
1882
1888
1889 std::list<WorldObject*> _targets;
1890};
1891
1893{
1895
1896 bool Validate(SpellInfo const* /*spellInfo*/) override
1897 {
1899 }
1900
1901 void SetTickHeal(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
1902 {
1903 // includes caster bonuses already
1904 _baseTick = amount;
1905 if (Unit* caster = GetCaster())
1906 if (AuraEffect const* bonus = caster->GetAuraEffect(SPELL_DRUID_RESTORATION_T10_2P_BONUS, EFFECT_0))
1907 AddPct(_baseReduction, -bonus->GetAmount());
1908 }
1909
1911 {
1912 // Wild Growth = first tick gains a 6% bonus, reduced by 2% each tick
1913 float reduction = _baseReduction;
1914 reduction *= (aurEff->GetTickNumber() - 1);
1915
1916 float const bonus = 6.f - reduction;
1917 int32 const amount = int32(_baseTick + CalculatePct(_baseTick, bonus));
1918 aurEff->SetAmount(amount);
1919 }
1920
1926
1927 float _baseTick = 0.f;
1928 float _baseReduction = 2.f;
1929};
1930
1932{
1983}
@ IN_MILLISECONDS
Definition Common.h:35
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
std::chrono::steady_clock::time_point TimePoint
time_point shorthand typedefs
Definition Duration.h:36
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:27
#define ASSERT
Definition Errors.h:68
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
@ SPELLMOD_FLAT
Definition Player.h:122
bool roll_chance_i(int chance)
Definition Random.h:59
#define RegisterSpellAndAuraScriptPair(script_1, script_2)
Definition ScriptMgr.h:1130
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ EFFECT_2
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_HEAL
@ SPELL_EFFECT_KNOCK_BACK
@ TARGET_UNIT_DEST_AREA_ALLY
@ TARGET_UNIT_DEST_AREA_ENEMY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ CREATURE_TYPE_BEAST
@ BASE_ATTACK
@ MECHANIC_STUN
@ SPELLFAMILY_DRUID
@ POWER_RAGE
@ POWER_RUNIC_POWER
@ POWER_ENERGY
@ POWER_MANA
#define EFFECT_ALL
SpellCastResult
@ SPELL_FAILED_DONT_REPORT
@ SPELL_FAILED_ONLY_SHAPESHIFT
@ SPELL_FAILED_NOT_SHAPESHIFT
@ SPELL_CAST_OK
@ AURA_REMOVE_BY_EXPIRE
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_MOD_INCREASE_SPEED
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_ADD_FLAT_MODIFIER
@ SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
@ SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_PERIODIC_ENERGIZE
@ SPELL_AURA_MOD_BASE_RESISTANCE_PCT
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_OVERRIDE_CLASS_SCRIPTS
@ FORM_DIREBEAR
@ FORM_MOONKIN
@ FORM_NONE
@ FORM_CAT
@ FORM_TREE
@ FORM_BEAR
@ SPELLMOD_DOT
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
#define sSpellMgr
Definition SpellMgr.h:738
#define SpellCheckCastFn(F)
#define AuraEffectProcFn(F, I, N)
#define SpellEffectFn(F, I, N)
#define AuraEffectCalcAmountFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraCheckEffectProcFn(F, I, N)
#define AuraEffectUpdatePeriodicFn(F, I, N)
#define AuraEffectAbsorbFn(F, I)
#define AuraEffectApplyFn(F, I, N, M)
#define AuraCheckProcFn(F)
#define SpellHitFn(F)
#define AuraEffectCalcSpellModFn(F, I, N)
#define AuraDispelFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
@ UNIT_FLAG_STUNNED
@ UNIT_STATE_CONTROLLED
Definition Unit.h:260
T AddPct(T &base, U pct)
Definition Util.h:77
T CalculatePct(T base, U pct)
Definition Util.h:71
uint32 GetTickNumber() const
SpellInfo const * GetSpellInfo() const
SpellEffectInfo const & GetSpellEffectInfo() const
void SetAmount(int32 amount)
uint32 GetTotalTicks() const
ObjectGuid GetCasterGUID() const
int32 GetAmount() const
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
HookList< CheckEffectProcHandler > DoCheckEffectProc
HookList< EffectPeriodicHandler > OnEffectPeriodic
SpellInfo const * GetSpellInfo() const
HookList< EffectApplyHandler > AfterEffectApply
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Unit * GetCaster() const
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
HookList< EffectCalcSpellModHandler > DoEffectCalcSpellMod
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
AuraEffect * GetEffect(uint8 effIndex) const
HookList< EffectAbsorbHandler > OnEffectAbsorb
Aura * GetAura() const
Unit * GetTarget() const
ObjectGuid GetCasterGUID() const
HookList< CheckProcHandler > DoCheckProc
HookList< AuraDispelHandler > AfterDispel
HookList< EffectProcHandler > OnEffectProc
Unit * GetUnitOwner() const
uint8 GetStackAmount() const
uint32 GetId() const
int32 GetMaxDuration() const
Definition SpellAuras.h:143
int32 GetDuration() const
Definition SpellAuras.h:148
void SetDuration(int32 duration, bool withMods=false)
SpellInfo const * GetSpellInfo() const
Definition SpellAuras.h:115
void SetMaxDuration(int32 duration)
Definition SpellAuras.h:144
uint32 GetDamage() const
Definition Unit.h:464
uint8 GetRemovedCharges() const
Definition Unit.h:406
uint32 GetHeal() const
Definition Unit.h:492
static Unit * ToUnit(Object *o)
Definition Object.h:192
TypeID GetTypeId() const
Definition Object.h:93
bool IsCreature() const
Definition Object.h:185
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
static Player * ToPlayer(Object *o)
Definition Object.h:180
Group * GetGroup()
Definition Player.h:2171
HealInfo * GetHealInfo() const
Definition Unit.h:520
Unit * GetActionTarget() const
Definition Unit.h:509
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:268
Unit * GetActor()
Definition Unit.h:508
DamageInfo * GetDamageInfo() const
Definition Unit.h:519
Unit const * _caster
RaidCheck(Unit const *caster)
bool operator()(WorldObject *obj) const
uint32 TriggerSpell
Definition SpellInfo.h:228
flag96 SpellClassMask
Definition SpellInfo.h:229
bool IsEffect() const
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr) const
void AddCooldown(uint32 spellId, uint32 itemId, std::chrono::duration< Type, Period > cooldownDuration)
bool HasCooldown(SpellInfo const *spellInfo, uint32 itemId=0, bool ignoreCategoryCooldown=false) const
void ResetCooldowns(Predicate predicate, bool update=false)
uint32 GetMaxTicks() const
uint32 GetCategory() const
flag96 SpellFamilyFlags
Definition SpellInfo.h:357
uint32 Id
Definition SpellInfo.h:289
uint8 GetRank() const
int32 GetMaxDuration() const
SpellSchoolMask GetSchoolMask() const
int32 CalcPowerCost(WorldObject const *caster, SpellSchoolMask schoolMask, Spell *spell=nullptr) const
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:483
uint32 SpellFamilyName
Definition SpellInfo.h:356
HookList< CheckCastHandler > OnCheckCast
Unit * GetCaster() const
HookList< HitHandler > AfterHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
SpellInfo const * GetTriggeringSpell() const
Unit * GetHitUnit() const
int32 GetEffectValue() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
int32 GetHitHeal() const
void SetHitHeal(int32 heal)
Unit * GetExplTargetUnit() const
void FinishCast(SpellCastResult result, uint32 *param1=nullptr, uint32 *param2=nullptr)
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition Unit.h:769
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1384
ShapeshiftForm GetShapeshiftForm() const
Definition Unit.h:1490
bool IsInDisallowedMountForm() const
Definition Unit.cpp:8975
Powers GetPowerType() const
Definition Unit.h:931
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4359
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
uint32 GetCreatureType() const
Definition Unit.cpp:8940
bool HealthBelowPct(int32 pct) const
Definition Unit.h:917
uint32 GetMaxPower(Powers power) const
Definition Unit.h:936
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool force=false)
Definition Unit.cpp:9421
AuraEffect * GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4373
bool IsMounted() const
Definition Unit.h:1013
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
bool IsInRaidWith(Unit const *unit) const
Definition Unit.cpp:11892
bool IsInFeralForm() const
Definition Unit.cpp:8969
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:922
SpellHistory * GetSpellHistory()
Definition Unit.h:1484
uint32 GetPower(Powers power) const
Definition Unit.h:934
std::list< AuraEffect * > AuraEffectList
Definition Unit.h:787
uint32 GetCreatePowerValue(Powers power) const
Definition Unit.cpp:9487
float GetTotalAttackPowerValue(WeaponAttackType attType) const
Definition Unit.cpp:9312
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition Util.h:412
void Register() override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_barkskin)
bool Validate(SpellInfo const *) override
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
PrepareAuraScript(spell_dru_bear_form_passive)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_dru_berserk)
void Register() override
PrepareAuraScript(spell_dru_dash)
void Register() override
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
TimePoint _solarProcCooldownEnd
bool CheckProc(ProcEventInfo &eventInfo)
TimePoint _lunarProcCooldownEnd
void Register() override
void ProcSolar(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_eclipse)
bool CheckLunar(AuraEffect const *, ProcEventInfo &eventInfo)
void ProcLunar(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool CheckSolar(AuraEffect const *, ProcEventInfo &eventInfo)
void HandleApply(AuraEffect const *, AuraEffectHandleModes)
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void RecalculateBaseArmor()
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_enrage)
void Register() override
void Register() override
SpellCastResult CheckCast()
PrepareSpellScript(spell_dru_flight_form)
void Register() override
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_forms_trinket)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_frenzied_regeneration)
void PeriodicTick(AuraEffect const *aurEff)
PrepareAuraScript(spell_dru_glyph_of_barkskin)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_glyph_of_innervate)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_glyph_of_rake)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
void Register() override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_glyph_of_rejuvenation)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_glyph_of_shred)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_glyph_of_starfire_dummy)
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex)
PrepareSpellScript(spell_dru_glyph_of_starfire)
bool Validate(SpellInfo const *) override
void HandleEffectCalcSpellMod(AuraEffect const *aurEff, SpellModifier *&spellMod)
PrepareAuraScript(spell_dru_idol_lifebloom)
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &)
void Register() override
PrepareAuraScript(spell_dru_innervate)
PrepareAuraScript(spell_dru_insect_swarm)
void Register() override
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_item_t6_trinket)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_leader_of_the_pack)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
void HandleDispel(DispelInfo *dispelInfo)
PrepareAuraScript(spell_dru_lifebloom)
bool Validate(SpellInfo const *) override
void OnRemoveEffect(Unit *target, AuraEffect const *aurEff, uint32 stack)
void Register() override
void AfterRemove(AuraEffect const *aurEff, AuraEffectHandleModes)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &)
PrepareAuraScript(spell_dru_living_seed_proc)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_living_seed)
bool Validate(SpellInfo const *) override
void Register() override
PrepareAuraScript(spell_dru_moonkin_form_passive)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
void Absorb(AuraEffect *, DamageInfo &dmgInfo, uint32 &absorbAmount)
PrepareSpellScript(spell_dru_nourish)
void HandleHeal(SpellEffIndex)
void Register() override
PrepareAuraScript(spell_dru_nurturing_instinct)
bool Validate(SpellInfo const *) override
void AfterApply(AuraEffect const *aurEff, AuraEffectHandleModes)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_dru_omen_of_clarity)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &)
PrepareAuraScript(spell_dru_owlkin_frenzy)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
PrepareAuraScript(spell_dru_predatory_strikes)
void UpdateAmount(AuraEffect const *, AuraEffectHandleModes)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
PrepareAuraScript(spell_dru_primal_tenacity)
void Absorb(AuraEffect *, DamageInfo &dmgInfo, uint32 &absorbAmount)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_revitalize)
void Register() override
void CalculateAmount(AuraEffect const *, int32 &amount, bool &canBeRecalculated)
void Register() override
bool Load() override
PrepareAuraScript(spell_dru_rip)
PrepareAuraScript(spell_dru_savage_defense)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *spellInfo) override
void AfterApply(AuraEffect const *aurEff, AuraEffectHandleModes)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_savage_roar_aura)
void Register() override
SpellCastResult CheckCast()
PrepareSpellScript(spell_dru_savage_roar)
PrepareSpellScript(spell_dru_starfall_aoe)
void Register() override
void FilterTargets(std::list< WorldObject * > &targets)
PrepareSpellScript(spell_dru_starfall_dummy)
void HandleDummy(SpellEffIndex)
void FilterTargets(std::list< WorldObject * > &targets)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_dru_survival_instincts_aura)
bool Validate(SpellInfo const *) override
void AfterApply(AuraEffect const *aurEff, AuraEffectHandleModes)
PrepareSpellScript(spell_dru_survival_instincts)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
PrepareAuraScript(spell_dru_swift_flight_passive)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_t10_balance_4p_bonus)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_t10_restoration_4p_bonus_dummy)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
PrepareSpellScript(spell_dru_t10_restoration_4p_bonus)
void FilterTargets(std::list< WorldObject * > &targets)
bool CheckProc(ProcEventInfo &)
void Register() override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_t3_2p_bonus)
bool Validate(SpellInfo const *) override
void Register() override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_t3_6p_bonus)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_dru_t3_8p_bonus)
void Register() override
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void Register() override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_t4_2p_bonus)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
PrepareAuraScript(spell_dru_t9_feral_relic)
PrepareSpellScript(spell_dru_tiger_s_fury)
void Register() override
void Register() override
PrepareSpellScript(spell_dru_typhoon)
void HandleKnockBack(SpellEffIndex effIndex)
void SetTickHeal(AuraEffect const *, int32 &amount, bool &)
PrepareAuraScript(spell_dru_wild_growth_aura)
void HandleTickUpdate(AuraEffect *aurEff)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_dru_wild_growth)
bool Validate(SpellInfo const *spellInfo) override
void SetTargets(std::list< WorldObject * > &targets)
std::list< WorldObject * > _targets
void Register() override
void FilterTargets(std::list< WorldObject * > &targets)
TimePoint Now()
Current chrono steady_clock time point.
Definition GameTime.cpp:57
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition Containers.h:108
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:66
void AddSC_druid_spell_scripts()
@ SPELL_CATEGORY_MANGLE_BEAR
DruidSpells
@ SPELL_DRUID_GLYPH_OF_REJUVENATION_HEAL
@ SPELL_DRUID_ITEM_T8_BALANCE_RELIC
@ SPELL_DRUID_BLESSING_OF_CENARIUS
@ SPELL_DRUID_BLESSING_OF_ELUNE
@ SPELL_DRUID_LIFEBLOOM_ENERGIZE
@ SPELL_DRUID_KING_OF_THE_JUNGLE
@ SPELL_DRUID_GLYPH_OF_RAKE_TRIGGERED
@ SPELL_DRUID_REVITALIZE_ENERGIZE_MANA
@ SPELL_DRUID_BLESSING_OF_THE_CLAW
@ SPELL_DRUID_NURTURING_INSTINCT_R1
@ SPELL_DRUID_REVITALIZE_ENERGIZE_RP
@ SPELL_DRUID_LIVING_SEED_PROC
@ SPELL_DRUID_BLESSING_OF_REMULOS
@ SPELL_DRUID_FORMS_TRINKET_BEAR
@ SPELL_DRUID_FRENZIED_REGENERATION_HEAL
@ SPELL_DRUID_RIP_DURATION_LACERATE_DMG
@ SPELL_DRUID_REVITALIZE_ENERGIZE_ENERGY
@ SPELL_DRUID_DIRE_BEAR_FORM_PASSIVE
@ SPELL_DRUID_BARKSKIN_01
@ SPELL_DRUID_LIVING_SEED_HEAL
@ SPELL_DRUID_FORMS_TRINKET_CAT
@ SPELL_DRUID_T9_FERAL_RELIC_CAT
@ SPELL_DRUID_IMP_LEADER_OF_THE_PACK_HEAL
@ SPELL_DRUID_EXHILARATE
@ SPELL_DRUID_REJUVENATION_T10_PROC
@ SPELL_DRUID_GLYPH_OF_INNERVATE_REGEN
@ SPELL_DRUID_T9_FERAL_RELIC_BEAR
@ SPELL_DRUID_BALANCE_T10_BONUS_PROC
@ SPELL_DRUID_ECLIPSE_SOLAR_PROC
@ SPELL_DRUID_ENRAGED_DEFENSE
@ SPELL_DRUID_SAVAGE_ROAR
@ SPELL_DRUID_LIFEBLOOM_FINAL_HEAL
@ SPELL_DRUID_ITEM_T10_FERAL_4P_BONUS
@ SPELL_DRUID_T3_PROC_ENERGIZE_MANA
@ SPELL_DRUID_INCREASED_MOONFIRE_DURATION
@ SPELL_DRUID_SURVIVAL_INSTINCTS
@ SPELL_DRUID_BEAR_FORM_PASSIVE
@ SPELL_DRUID_T3_PROC_ENERGIZE_RAGE
@ SPELL_DRUID_ECLIPSE_LUNAR_PROC
@ SPELL_DRUID_IMP_LEADER_OF_THE_PACK_R1
@ SPELL_DRUID_GLYPH_OF_RIP
@ SPELL_DRUID_IDOL_OF_FERAL_SHADOWS
@ SPELL_DRUID_INFUSION
@ SPELL_DRUID_IDOL_OF_WORSHIP
@ SPELL_DRUID_REVITALIZE_ENERGIZE_RAGE
@ SPELL_DRUID_FORMS_TRINKET_NONE
@ SPELL_DRUID_GLYPH_OF_TYPHOON
@ SPELL_DRUID_T3_PROC_ENERGIZE_ENERGY
@ SPELL_DRUID_FORMS_TRINKET_MOONKIN
@ SPELL_DRUID_IMP_LEADER_OF_THE_PACK_MANA
@ SPELL_DRUID_BALANCE_T10_BONUS
@ SPELL_DRUID_FORMS_TRINKET_TREE
@ SPELL_DRUID_ENRAGE
@ SPELL_DRUID_TIGER_S_FURY_ENERGIZE
@ SPELL_DRUID_LANGUISH
@ SPELL_DRUID_NURTURING_INSTINCT_R2
@ SPELL_DRUID_GLYPH_OF_STARFIRE_SCRIPT
@ SPELL_DRUID_GLYPH_OF_NOURISH
@ SPELL_DRUID_NATURES_SPLENDOR
@ SPELL_DRUID_ENRAGE_MOD_DAMAGE
@ SPELL_DRUID_RESTORATION_T10_2P_BONUS
CastSpellExtraArgs & AddSpellBP0(int32 val)
ObjectGuid OriginalCaster
SpellModOp op
Definition Player.h:168
SpellModType type
Definition Player.h:169
int32 value
Definition Player.h:171
uint32 spellId
Definition Player.h:173
flag96 mask
Definition Player.h:172
MiscSpells