TrinityCore
spell_generic.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_GENERIC which cannot be included in AI script file
20 * of creature using it or can't be bound to any player class.
21 * Ordered alphabetically using scriptname.
22 * Scriptnames of files in this file should be prefixed with "spell_gen_"
23 */
24
25#include "ScriptMgr.h"
26#include "Battleground.h"
27#include "BattlePetMgr.h"
28#include "CellImpl.h"
29#include "CommonPredicates.h"
30#include "Containers.h"
31#include "CreatureAI.h"
32#include "DB2Stores.h"
33#include "GameTime.h"
34#include "GridNotifiersImpl.h"
35#include "Item.h"
36#include "Log.h"
37#include "MotionMaster.h"
38#include "NPCPackets.h"
39#include "ObjectMgr.h"
40#include "Pet.h"
41#include "ReputationMgr.h"
42#include "SkillDiscovery.h"
43#include "SpellAuraEffects.h"
44#include "SpellHistory.h"
45#include "SpellMgr.h"
46#include "SpellPackets.h"
47#include "SpellScript.h"
48#include "Vehicle.h"
49#include "WorldStateMgr.h"
50
52{
54
55 bool Load() override
56 {
57 // Max absorb stored in 1 dummy effect
59 return true;
60 }
61
62 void Absorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
63 {
64 absorbAmount = std::min(limit, absorbAmount);
65 }
66
67 void Register() override
68 {
70 }
71};
72
73// 28764 - Adaptive Warding (Frostfire Regalia Set)
75{
81};
82
84{
85 bool Validate(SpellInfo const* /*spellInfo*/) override
86 {
87 return ValidateSpellInfo(
88 {
94 });
95 }
96
97 bool CheckProc(ProcEventInfo& eventInfo)
98 {
99 if (!eventInfo.GetSpellInfo())
100 return false;
101
102 // find Mage Armor
103 if (!GetTarget()->GetAuraEffect(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT, SPELLFAMILY_MAGE, flag128(0x10000000, 0x0, 0x0)))
104 return false;
105
106 switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
107 {
110 return false;
111 default:
112 break;
113 }
114 return true;
115 }
116
117 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
118 {
120
121 uint32 spellId = 0;
122 switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
123 {
126 break;
129 break;
132 break;
135 break;
138 break;
139 default:
140 return;
141 }
142 GetTarget()->CastSpell(GetTarget(), spellId, aurEff);
143 }
144
145 void Register() override
146 {
149 }
150};
151
153{
155 {
156 if (!GetCastItem())
158 return SPELL_CAST_OK;
159 }
160
161 void Register() override
162 {
164 }
165};
166
168{
172
173// 46221 - Animal Blood
175{
176 bool Validate(SpellInfo const* /*spellInfo*/) override
177 {
179 }
180
181 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
182 {
183 // Remove all auras with spell id 46221, except the one currently being applied
184 while (Aura* aur = GetUnitOwner()->GetOwnedAura(SPELL_ANIMAL_BLOOD, ObjectGuid::Empty, ObjectGuid::Empty, 0, GetAura()))
186 }
187
188 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
189 {
190 if (Unit* owner = GetUnitOwner())
191 owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true);
192 }
193
194 void Register() override
195 {
198 }
199};
200
201// 63471 - Spawn Blood Pool
203{
205 {
206 Unit* caster = GetCaster();
207 Position summonPos = caster->GetPosition();
208 LiquidData liquidStatus;
209 if (caster->GetMap()->GetLiquidStatus(caster->GetPhaseShift(), caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), {}, &liquidStatus, caster->GetCollisionHeight()))
210 summonPos.m_positionZ = liquidStatus.level;
211 dest.Relocate(summonPos);
212 }
213
214 void Register() override
215 {
217 }
218};
219
220// 430 Drink
221// 431 Drink
222// 432 Drink
223// 1133 Drink
224// 1135 Drink
225// 1137 Drink
226// 10250 Drink
227// 22734 Drink
228// 27089 Drink
229// 34291 Drink
230// 43182 Drink
231// 43183 Drink
232// 46755 Drink
233// 49472 Drink Coffee
234// 57073 Drink
235// 61830 Drink
236// 72623 Drink
238{
239 bool Load() override
240 {
241 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
242 }
243
244 bool Validate(SpellInfo const* spellInfo) override
245 {
246 if (!ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) || !spellInfo->GetEffect(EFFECT_0).IsAura(SPELL_AURA_MOD_POWER_REGEN))
247 {
248 TC_LOG_ERROR("spells", "Aura {} structure has been changed - first aura is no longer SPELL_AURA_MOD_POWER_REGEN", GetId());
249 return false;
250 }
251
252 return true;
253 }
254
255 void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& /*amplitude*/)
256 {
257 // Get SPELL_AURA_MOD_POWER_REGEN aura from spell
259 if (!regen)
260 return;
261
262 // default case - not in arena
263 if (!GetCaster()->ToPlayer()->InArena())
264 isPeriodic = false;
265 }
266
267 void CalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
268 {
270 if (!regen)
271 return;
272
273 // default case - not in arena
274 if (!GetCaster()->ToPlayer()->InArena())
275 regen->ChangeAmount(amount);
276 }
277
279 {
281 if (!regen)
282 return;
283
284 // **********************************************
285 // This feature used only in arenas
286 // **********************************************
287 // Here need increase mana regen per tick (6 second rule)
288 // on 0 tick - 0 (handled in 2 second)
289 // on 1 tick - 166% (handled in 4 second)
290 // on 2 tick - 133% (handled in 6 second)
291
292 // Apply bonus for 1 - 4 tick
293 switch (aurEff->GetTickNumber())
294 {
295 case 1: // 0%
296 regen->ChangeAmount(0);
297 break;
298 case 2: // 166%
299 regen->ChangeAmount(aurEff->GetAmount() * 5 / 3);
300 break;
301 case 3: // 133%
302 regen->ChangeAmount(aurEff->GetAmount() * 4 / 3);
303 break;
304 default: // 100% - normal regen
305 regen->ChangeAmount(aurEff->GetAmount());
306 // No need to update after 4th tick
307 aurEff->SetPeriodic(false);
308 break;
309 }
310 }
311
312 void Register() override
313 {
317 }
318};
319
320// 28313 - Aura of Fear
322{
323 bool Validate(SpellInfo const* spellInfo) override
324 {
325 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) && ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
326 }
327
328 void PeriodicTick(AuraEffect const* aurEff)
329 {
332 return;
333
334 GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, true);
335 }
336
337 void Register() override
338 {
340 }
341};
342
344{
345 bool CheckAreaTarget(Unit* target)
346 {
347 switch (target->GetEntry())
348 {
349 // alliance
350 case 14762: // Dun Baldar North Marshal
351 case 14763: // Dun Baldar South Marshal
352 case 14764: // Icewing Marshal
353 case 14765: // Stonehearth Marshal
354 case 11948: // Vandar Stormspike
355 // horde
356 case 14772: // East Frostwolf Warmaster
357 case 14776: // Tower Point Warmaster
358 case 14773: // Iceblood Warmaster
359 case 14777: // West Frostwolf Warmaster
360 case 11946: // Drek'thar
361 return true;
362 default:
363 return false;
364 }
365 }
366
367 void Register() override
368 {
370 }
371};
372
374{
377
379{
380 bool Validate(SpellInfo const* /*spellInfo*/) override
381 {
383 }
384
386 {
387 if (Unit* target = GetExplTargetUnit())
388 {
389 if (target->HasAura(SPELL_RECENTLY_BANDAGED))
391 }
392 return SPELL_CAST_OK;
393 }
394
396 {
397 if (Unit* target = GetHitUnit())
399 }
400
401 void Register() override
402 {
405 }
406};
407
408// 193970 - Mercenary Shapeshift
410{
411 using OtherFactionRacePriorityList = std::array<Races, 3>;
412
413 inline static std::unordered_map<Races, OtherFactionRacePriorityList> const RaceInfo =
414 {
416 { RACE_ORC, { RACE_DWARF } },
426 { RACE_WORGEN, { RACE_TROLL } },
437 { RACE_VULPERA, { RACE_MECHAGNOME, RACE_DARK_IRON_DWARF /*guessed, for shamans*/ } },
440 };
441
442 inline static std::unordered_map<Races, std::array<uint32, 2>> const RaceDisplayIds =
443 {
444 { RACE_HUMAN, { 55239, 55238 } },
445 { RACE_ORC, { 55257, 55256 } },
446 { RACE_DWARF, { 55241, 55240 } },
447 { RACE_NIGHTELF, { 55243, 55242 } },
448 { RACE_UNDEAD_PLAYER, { 55259, 55258 } },
449 { RACE_TAUREN, { 55261, 55260 } },
450 { RACE_GNOME, { 55245, 55244 } },
451 { RACE_TROLL, { 55263, 55262 } },
452 { RACE_GOBLIN, { 55267, 57244 } },
453 { RACE_BLOODELF, { 55265, 55264 } },
454 { RACE_DRAENEI, { 55247, 55246 } },
455 { RACE_WORGEN, { 55255, 55254 } },
456 { RACE_PANDAREN_NEUTRAL, { 55253, 55252 } }, // not verified, might be swapped with RACE_PANDAREN_HORDE
457 { RACE_PANDAREN_ALLIANCE, { 55249, 55248 } },
458 { RACE_PANDAREN_HORDE, { 55251, 55250 } },
459 { RACE_NIGHTBORNE, { 82375, 82376 } },
460 { RACE_HIGHMOUNTAIN_TAUREN, { 82377, 82378 } },
461 { RACE_VOID_ELF, { 82371, 82372 } },
462 { RACE_LIGHTFORGED_DRAENEI, { 82373, 82374 } },
463 { RACE_ZANDALARI_TROLL, { 88417, 88416 } },
464 { RACE_KUL_TIRAN, { 88414, 88413 } },
465 { RACE_DARK_IRON_DWARF, { 88409, 88408 } },
466 { RACE_VULPERA, { 94999, 95001 } },
467 { RACE_MAGHAR_ORC, { 88420, 88410 } },
468 { RACE_MECHAGNOME, { 94998, 95000 } },
469 };
470
471 inline static std::vector<uint32> RacialSkills;
472
473 static Races GetReplacementRace(Races nativeRace, Classes playerClass)
474 {
476 for (Races race : *otherRaces)
477 if (sObjectMgr->GetPlayerInfo(race, playerClass))
478 return race;
479
480 return RACE_NONE;
481 }
482
484 {
485 if (std::array<uint32, 2> const* displayIds = Trinity::Containers::MapGetValuePtr(RaceDisplayIds, race))
486 return (*displayIds)[gender];
487
488 return 0;
489 }
490
491 bool Validate(SpellInfo const* /*spellInfo*/) override
492 {
493 for (auto const& [race, otherRaces] : RaceInfo)
494 {
495 if (!sChrRacesStore.LookupEntry(race))
496 return false;
497
498 for (Races otherRace : otherRaces)
499 if (!sChrRacesStore.LookupEntry(otherRace))
500 return false;
501 }
502
503 for (auto const& [race, displayIds] : RaceDisplayIds)
504 {
505 if (!sChrRacesStore.LookupEntry(race))
506 return false;
507
508 for (uint32 displayId : displayIds)
509 if (!sCreatureDisplayInfoStore.LookupEntry(displayId))
510 return false;
511 }
512
513 RacialSkills.clear();
514 for (SkillLineEntry const* skillLine : sSkillLineStore)
515 if (skillLine->GetFlags().HasFlag(SkillLineFlags::RacialForThePurposeOfTemporaryRaceChange))
516 RacialSkills.push_back(skillLine->ID);
517
518 return true;
519 }
520
521 void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode)
522 {
523 Unit* owner = GetUnitOwner();
524 Races otherFactionRace = GetReplacementRace(Races(owner->GetRace()), Classes(owner->GetClass()));
525 if (otherFactionRace == RACE_NONE)
526 return;
527
528 if (uint32 displayId = GetDisplayIdForRace(otherFactionRace, owner->GetNativeGender()))
529 owner->SetDisplayId(displayId);
530
531 if (mode & AURA_EFFECT_HANDLE_REAL)
532 UpdateRacials(Races(owner->GetRace()), otherFactionRace);
533 }
534
535 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
536 {
537 Unit* owner = GetUnitOwner();
538 Races otherFactionRace = GetReplacementRace(Races(owner->GetRace()), Classes(owner->GetClass()));
539 if (otherFactionRace == RACE_NONE)
540 return;
541
542 UpdateRacials(otherFactionRace, Races(owner->GetRace()));
543 }
544
545 void UpdateRacials(Races oldRace, Races newRace)
546 {
547 Player* player = GetUnitOwner()->ToPlayer();
548 if (!player)
549 return;
550
551 for (uint32 racialSkillId : RacialSkills)
552 {
553 if (sDB2Manager.GetSkillRaceClassInfo(racialSkillId, oldRace, player->GetClass()))
554 if (std::vector<SkillLineAbilityEntry const*> const* skillLineAbilities = sDB2Manager.GetSkillLineAbilitiesBySkill(racialSkillId))
555 for (SkillLineAbilityEntry const* ability : *skillLineAbilities)
556 player->RemoveSpell(ability->Spell, false, false);
557
558 if (sDB2Manager.GetSkillRaceClassInfo(racialSkillId, newRace, player->GetClass()))
559 player->LearnSkillRewardedSpells(racialSkillId, player->GetMaxSkillValueForLevel(), newRace);
560 }
561 }
562
563 void Register() override
564 {
567 }
568};
569
570// Blood Reserve - 64568
572{
576
578{
579 bool Validate(SpellInfo const* /*spellInfo*/) override
580 {
582 }
583
584 bool CheckProc(ProcEventInfo& eventInfo)
585 {
586 if (Unit* caster = eventInfo.GetActionTarget())
587 if (caster->HealthBelowPct(35))
588 return true;
589
590 return false;
591 }
592
593 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
594 {
596
597 Unit* caster = eventInfo.GetActionTarget();
598 CastSpellExtraArgs args(aurEff);
599 args.AddSpellBP0(aurEff->GetAmount());
600 caster->CastSpell(caster, SPELL_GEN_BLOOD_RESERVE_HEAL, args);
602 }
603
604 void Register() override
605 {
608 }
609};
610
612{
615 SPELL_ON_GUARD = 62972
617
619{
620 void HandleScript(SpellEffIndex /*effIndex*/)
621 {
622 if (Player* target = GetHitPlayer())
623 {
624 Aura const* aura = GetHitAura();
625 if (!(aura && aura->GetStackAmount() == 3))
626 return;
627
628 target->CastSpell(target, SPELL_FOAM_SWORD_DEFEAT, true);
629 target->RemoveAurasDueToSpell(SPELL_BONKED);
630
631 if (Aura const* auraOnGuard = target->GetAura(SPELL_ON_GUARD))
632 if (Item* item = target->GetItemByGuid(auraOnGuard->GetCastItemGUID()))
633 target->DestroyItemCount(item->GetEntry(), 1, true);
634 }
635 }
636
637 void Register() override
638 {
640 }
641};
642
643/* DOCUMENTATION: Break-Shield spells
644 Break-Shield spells can be classified in three groups:
645
646 - Spells on vehicle bar used by players:
647 + EFFECT_0: SCRIPT_EFFECT
648 + EFFECT_1: NONE
649 + EFFECT_2: NONE
650 - Spells cast by players triggered by script:
651 + EFFECT_0: SCHOOL_DAMAGE
652 + EFFECT_1: SCRIPT_EFFECT
653 + EFFECT_2: FORCE_CAST
654 - Spells cast by NPCs on players:
655 + EFFECT_0: SCHOOL_DAMAGE
656 + EFFECT_1: SCRIPT_EFFECT
657 + EFFECT_2: NONE
658
659 In the following script we handle the SCRIPT_EFFECT for effIndex EFFECT_0 and EFFECT_1.
660 - When handling EFFECT_0 we're in the "Spells on vehicle bar used by players" case
661 and we'll trigger "Spells cast by players triggered by script"
662 - When handling EFFECT_1 we're in the "Spells cast by players triggered by script"
663 or "Spells cast by NPCs on players" so we'll search for the first defend layer and drop it.
664*/
665
667{
670
671 SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS = 62575, // Also on ToC5 mounts
675
677{
678 bool Validate(SpellInfo const* /*spellInfo*/) override
679 {
680 return ValidateSpellInfo({ 62552, 62719, 64100, 66482 });
681 }
682
684 {
685 Unit* target = GetHitUnit();
686
687 switch (effIndex)
688 {
689 case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
690 {
691 uint32 spellId;
692
693 switch (GetSpellInfo()->Id)
694 {
698 break;
701 break;
702 default:
703 return;
704 }
705
706 if (Unit* rider = GetCaster()->GetCharmer())
707 rider->CastSpell(target, spellId, false);
708 else
709 GetCaster()->CastSpell(target, spellId, false);
710 break;
711 }
712 case EFFECT_1: // On damaging spells, for removing a defend layer
713 {
714 Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
715 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
716 {
717 if (Aura* aura = itr->second->GetBase())
718 {
719 if (aura->GetId() == 62552 || aura->GetId() == 62719 || aura->GetId() == 64100 || aura->GetId() == 66482)
720 {
721 aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
722 // Remove dummys from rider (Necessary for updating visual shields)
723 if (Unit* rider = target->GetCharmer())
724 if (Aura* defend = rider->GetAura(aura->GetId()))
725 defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
726 break;
727 }
728 }
729 }
730 break;
731 }
732 default:
733 break;
734 }
735 }
736
737 void Register() override
738 {
740 }
741};
742
743// 48750 - Burning Depths Necrolyte Image
745{
746 bool Validate(SpellInfo const* spellInfo) override
747 {
748 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } })
749 && ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_2).CalcValue()) });
750 }
751
752 void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
753 {
754 if (Unit* caster = GetCaster())
755 caster->CastSpell(GetTarget(), uint32(GetEffectInfo(EFFECT_2).CalcValue()));
756 }
757
758 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
759 {
761 }
762
763 void Register() override
764 {
767 }
768};
769
771{
774
776{
777 bool Validate(SpellInfo const* /*spellInfo*/) override
778 {
780 }
781
783 {
784 Unit* caster = GetCaster();
785 float max_range = GetSpellInfo()->GetMaxRange(false);
786 WorldObject* result = nullptr;
787 // search for nearby enemy corpse in range
790 Cell::VisitWorldObjects(caster, searcher, max_range);
791 if (!result)
792 Cell::VisitGridObjects(caster, searcher, max_range);
793 if (!result)
795 return SPELL_CAST_OK;
796 }
797
798 void HandleDummy(SpellEffIndex /*effIndex*/)
799 {
801 }
802
803 void Register() override
804 {
807 }
808};
809
810// 66020 Chains of Ice
812{
814 {
815 // Get 0 effect aura
817 if (!slow)
818 return;
819
820 int32 newAmount = std::min<int32>(slow->GetAmount() + aurEff->GetAmount(), 0);
821 slow->ChangeAmount(newAmount);
822 }
823
824 void Register() override
825 {
827 }
828};
829
831{
832 SPELL_CHAOS_BLAST = 37675
834
836{
837 bool Validate(SpellInfo const* /*spellInfo*/) override
838 {
840 }
841
842 void HandleDummy(SpellEffIndex /* effIndex */)
843 {
844 int32 basepoints0 = 100;
845 Unit* caster = GetCaster();
846 if (Unit* target = GetHitUnit())
847 {
849 args.AddSpellBP0(basepoints0);
850 caster->CastSpell(target, SPELL_CHAOS_BLAST, args);
851 }
852 }
853
854 void Register() override
855 {
857 }
858};
859
860// 28471 - ClearAll
862{
863 void HandleScript(SpellEffIndex /*effIndex*/)
864 {
865 Unit* caster = GetCaster();
866 caster->RemoveAllAurasOnDeath();
867 }
868
869 void Register() override
870 {
872 }
873};
874
876{
879
881{
883 {
884 PreventHitDefaultEffect(effIndex);
886 }
887
888 void Register() override
889 {
891 {
894 }
895 else
896 {
899 }
900 }
901};
902
904{
908
911
914
916{
918 {
919 PreventHitDefaultEffect(effIndex);
921 }
922
923 void Register() override
924 {
926 }
927};
928
930{
931 bool Validate(SpellInfo const* /*spellInfo*/) override
932 {
933 return ValidateSpellInfo(
934 {
941 });
942 }
943
944 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
945 {
946 Unit* caster = GetCaster();
947 Unit* target = GetTarget();
948 if (!caster)
949 return;
950
951 switch (GetSpellInfo()->Id)
952 {
956 {
957 prevItem = target->GetVirtualItemId(0);
958
959 if (Player* player = caster->ToPlayer())
960 {
961 if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
962 target->SetVirtualItem(0, mainItem->GetEntry());
963 }
964 else
965 target->SetVirtualItem(0, caster->GetVirtualItemId(0));
966 break;
967 }
970 {
971 prevItem = target->GetVirtualItemId(1);
972
973 if (Player* player = caster->ToPlayer())
974 {
975 if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
976 target->SetVirtualItem(1, offItem->GetEntry());
977 }
978 else
979 target->SetVirtualItem(1, caster->GetVirtualItemId(1));
980 break;
981 }
983 {
984 prevItem = target->GetVirtualItemId(2);
985
986 if (Player* player = caster->ToPlayer())
987 {
988 if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
989 target->SetVirtualItem(2, rangedItem->GetEntry());
990 }
991 else
992 target->SetVirtualItem(2, caster->GetVirtualItemId(2));
993 break;
994 }
995 default:
996 break;
997 }
998 }
999
1000 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1001 {
1002 Unit* target = GetTarget();
1003
1004 switch (GetSpellInfo()->Id)
1005 {
1009 target->SetVirtualItem(0, prevItem);
1010 break;
1013 target->SetVirtualItem(1, prevItem);
1014 break;
1016 target->SetVirtualItem(2, prevItem);
1017 break;
1018 default:
1019 break;
1020 }
1021 }
1022
1023 void Register() override
1024 {
1027 }
1028
1030};
1031
1033{
1034public:
1036
1038 {
1039 if (!_damagePct)
1041
1042 SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(_damagePct));
1043 }
1044
1045 void Register() override
1046 {
1048 }
1049
1050private:
1052};
1053
1054// 28865 - Consumption
1055// 64208 - Consumption
1057{
1058 void CalculateDamage(Unit const* /*victim*/, int32& damage, int32& /*flatMod*/, float& /*pctMod*/) const
1059 {
1060 if (SpellInfo const* createdBySpell = sSpellMgr->GetSpellInfo(GetCaster()->m_unitData->CreatedBySpell, GetCastDifficulty()))
1061 damage = createdBySpell->GetEffect(EFFECT_1).CalcValue();
1062 }
1063
1064 void Register() override
1065 {
1067 }
1068};
1069
1070// 63845 - Create Lance
1072{
1076
1078{
1079 bool Validate(SpellInfo const* /*spellInfo*/) override
1080 {
1081 return ValidateSpellInfo(
1082 {
1085 });
1086 }
1087
1089 {
1090 PreventHitDefaultEffect(effIndex);
1091
1092 if (Player* target = GetHitPlayer())
1093 {
1094 if (target->GetTeam() == ALLIANCE)
1096 else
1098 }
1099 }
1100
1101 void Register() override
1102 {
1104 }
1105};
1106
1108{
1112
1117
1119{
1120 bool Validate(SpellInfo const* spellInfo) override
1121 {
1122 switch (spellInfo->Id)
1123 {
1125 return ValidateSpellInfo(
1126 {
1129 });
1131 return ValidateSpellInfo(
1132 {
1135 });
1136 default:
1137 break;
1138 }
1139
1140 return false;
1141 }
1142
1143 void HandleScript(SpellEffIndex /*effIndex*/)
1144 {
1145 if (Player* player = GetHitPlayer())
1146 {
1147 uint8 gender = player->GetNativeGender();
1148
1149 uint32 spellId = GetSpellInfo()->Id;
1150
1151 switch (spellId)
1152 {
1155 break;
1158 break;
1159 default:
1160 break;
1161 }
1162
1163 GetCaster()->CastSpell(player, spellId, true);
1164 }
1165 }
1166
1167 void Register() override
1168 {
1170 }
1171};
1172
1174{
1176 {
1177 if (Aura* aur = GetHitAura())
1178 aur->SetStackAmount(static_cast<uint8>(GetSpellInfo()->StackAmount));
1179 }
1180
1181 void Register() override
1182 {
1184 }
1185};
1186
1188{
1189protected:
1191
1192 bool CheckProc(ProcEventInfo& eventInfo)
1193 {
1194 return (eventInfo.GetSpellInfo() == GetSpellInfo());
1195 }
1196
1197 void Decay(ProcEventInfo& /*eventInfo*/)
1198 {
1200 ModStackAmount(-1);
1201 }
1202
1203 void Register() override
1204 {
1207 }
1208};
1209
1211{
1212 // found in sniffs, there is no duration entry we can possibly use
1213 AURA_DURATION = 12600
1215
1216// 32065 - Fungal Decay
1218{
1219 void ModDuration(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1220 {
1221 // only on actual reapply, not on stack decay
1222 if (GetDuration() == GetMaxDuration())
1223 {
1226 }
1227 }
1228
1229 void Register() override
1230 {
1233 }
1234};
1235
1236// 36659 - Tail Sting
1238{
1239};
1240
1242{
1245 SPELL_VISUAL_SHIELD_3 = 63132
1247
1249{
1250 bool Validate(SpellInfo const* /*spellInfo*/) override
1251 {
1252 return ValidateSpellInfo(
1253 {
1257 });
1258 }
1259
1261 {
1262 if (GetCaster())
1263 {
1264 Unit* target = GetTarget();
1265
1266 for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
1268
1269 target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, aurEff);
1270 }
1271 else
1273 }
1274
1275 void RemoveVisualShields(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1276 {
1277 for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
1279 }
1280
1282 {
1283 if (Unit* caster = GetCaster())
1284 if (TempSummon* vehicle = caster->ToTempSummon())
1285 if (Unit* rider = vehicle->GetSummonerUnit())
1286 rider->RemoveAurasDueToSpell(GetId());
1287 }
1288
1289 void Register() override
1290 {
1291 /*
1292 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(m_scriptSpellId, DIFFICULTY_NONE);
1293
1294 // 6.x effects removed
1295
1296 // Defend spells cast by NPCs (add visuals)
1297 if (spell->GetEffect(EFFECT_0)->ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
1298 {
1299 AfterEffectApply += AuraEffectApplyFn(spell_gen_defend::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
1300 OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend::RemoveVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
1301 }
1302
1303 // Remove Defend spell from player when he dismounts
1304 if (spell->GetEffect(EFFECT_2)->ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
1305 OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
1306
1307 // Defend spells cast by players (add/remove visuals)
1308 if (spell->GetEffect(EFFECT_1)->ApplyAuraName == SPELL_AURA_DUMMY)
1309 {
1310 AfterEffectApply += AuraEffectApplyFn(spell_gen_defend::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
1311 OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend::RemoveVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
1312 }
1313 */
1314 }
1315};
1316
1318{
1319 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1320 {
1321 if (Creature* target = GetTarget()->ToCreature())
1322 target->DespawnOrUnsummon();
1323 }
1324
1325 void Register() override
1326 {
1328 }
1329};
1330
1333{
1334 bool Load() override
1335 {
1336 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1337 }
1338
1339 void HandleDummy(SpellEffIndex /*effIndex*/)
1340 {
1343 }
1344
1345 void Register() override
1346 {
1348 }
1349};
1350
1352{
1353 void HandleDespawn(SpellEffIndex /*effIndex*/)
1354 {
1356 if (Creature* target = GetHitCreature())
1357 target->DespawnOrUnsummon();
1358 }
1359
1360 void Register() override
1361 {
1363 }
1364};
1365
1367{
1369};
1370
1371// 70769 Divine Storm!
1373{
1374 bool Load() override
1375 {
1376 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1377 }
1378
1379 bool Validate(SpellInfo const* /*spellInfo*/) override
1380 {
1382 }
1383
1384 void HandleScript(SpellEffIndex /*effIndex*/)
1385 {
1387 }
1388
1389 void Register() override
1390 {
1392 }
1393};
1394
1396{
1397 void HandleScript(SpellEffIndex /*effIndex*/)
1398 {
1399 // Here the target is the water spout and determines the position where the player is knocked from
1400 if (Unit* target = GetHitUnit())
1401 {
1402 if (Player* player = GetCaster()->ToPlayer())
1403 {
1404 float horizontalSpeed = 20.0f + (40.0f - GetCaster()->GetDistance(target));
1405 float verticalSpeed = 8.0f;
1406 // This method relies on the Dalaran Sewer map disposition and Water Spout position
1407 // What we do is knock the player from a position exactly behind him and at the end of the pipe
1408 player->KnockbackFrom(target->GetPosition(), horizontalSpeed, verticalSpeed);
1409 }
1410 }
1411 }
1412
1413 void Register() override
1414 {
1416 }
1417};
1418
1419// 50051 - Ethereal Pet Aura
1421{
1423
1426
1432
1433// 50051 - Ethereal Pet Aura
1435{
1436 bool CheckProc(ProcEventInfo& eventInfo)
1437 {
1438 uint32 levelDiff = std::abs(GetTarget()->GetLevel() - eventInfo.GetProcTarget()->GetLevel());
1439 return levelDiff <= 9;
1440 }
1441
1442 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
1443 {
1445
1446 std::list<TempSummon*> minionList;
1448 for (Creature* minion : minionList)
1449 {
1450 if (minion->IsAIEnabled())
1451 {
1452 minion->AI()->Talk(SAY_STEAL_ESSENCE);
1453 minion->CastSpell(eventInfo.GetProcTarget(), SPELL_STEAL_ESSENCE_VISUAL);
1454 }
1455 }
1456 }
1457
1458 void Register() override
1459 {
1462 }
1463};
1464
1465// 50052 - Ethereal Pet onSummon
1467{
1468 bool Validate(SpellInfo const* /*spellInfo*/) override
1469 {
1471 }
1472
1474 {
1475 Unit* target = GetHitUnit();
1476 target->CastSpell(target, SPELL_PROC_TRIGGER_ON_KILL_AURA, true);
1477 }
1478
1479 void Register() override
1480 {
1482 }
1483};
1484
1485// 50055 - Ethereal Pet Aura Remove
1487{
1488 bool Validate(SpellInfo const* /*spellInfo*/) override
1489 {
1491 }
1492
1494 {
1496 }
1497
1498 void Register() override
1499 {
1501 }
1502};
1503
1504// 50101 - Ethereal Pet OnKill Steal Essence
1506{
1507 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1508 {
1509 if (Unit* caster = GetCaster())
1510 {
1511 caster->CastSpell(caster, SPELL_CREATE_TOKEN, true);
1512 if (Creature* soulTrader = caster->ToCreature())
1513 soulTrader->AI()->Talk(SAY_CREATE_TOKEN);
1514 }
1515 }
1516
1517 void Register() override
1518 {
1520 }
1521};
1522
1524{
1530
1535
1542
1543/* 57337 - Great Feast
1544 57397 - Fish Feast
1545 58466 - Gigantic Feast
1546 58475 - Small Feast
1547 66477 - Bountiful Feast */
1549{
1550 bool Validate(SpellInfo const* /*spellInfo*/) override
1551 {
1552 return ValidateSpellInfo(
1553 {
1558
1564 });
1565 }
1566
1567 void HandleScript(SpellEffIndex /*effIndex*/)
1568 {
1569 Unit* target = GetHitUnit();
1570
1571 switch (GetSpellInfo()->Id)
1572 {
1573 case SPELL_GREAT_FEAST:
1574 target->CastSpell(target, SPELL_FEAST_FOOD);
1575 target->CastSpell(target, SPELL_FEAST_DRINK);
1577 break;
1578 case SPELL_FISH_FEAST:
1579 target->CastSpell(target, SPELL_FEAST_FOOD);
1580 target->CastSpell(target, SPELL_FEAST_DRINK);
1581 target->CastSpell(target, SPELL_FISH_FEAST_REFRESHMENT);
1582 break;
1584 target->CastSpell(target, SPELL_FEAST_FOOD);
1585 target->CastSpell(target, SPELL_FEAST_DRINK);
1587 break;
1588 case SPELL_SMALL_FEAST:
1589 target->CastSpell(target, SPELL_FEAST_FOOD);
1590 target->CastSpell(target, SPELL_FEAST_DRINK);
1592 break;
1595 target->CastSpell(target, SPELL_BOUNTIFUL_FEAST_DRINK);
1596 target->CastSpell(target, SPELL_BOUNTIFUL_FEAST_FOOD);
1597 break;
1598 default:
1599 break;
1600 }
1601 }
1602
1603 void Register() override
1604 {
1606 }
1607};
1608
1609/*
1610There are only 3 possible flags Feign Death auras can apply: UNIT_DYNFLAG_DEAD, UNIT_FLAG2_FEIGN_DEATH
1611and UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT. Some auras can apply only 2 flags
1612
1613spell_gen_feign_death_all_flags applies all 3 flags
1614spell_gen_feign_death_all_flags_uninteractible applies all 3 flags and additionally sets UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_UNINTERACTIBLE
1615spell_gen_feign_death_no_dyn_flag applies no UNIT_DYNFLAG_DEAD (does not make the creature appear dead)
1616spell_gen_feign_death_no_prevent_emotes applies no UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
1617
1618REACT_PASSIVE should be handled directly in scripts since not all creatures should be passive. Otherwise
1619creature will be not able to aggro or execute MoveInLineOfSight events. Removing may cause more issues
1620than already exists
1621*/
1622
1624{
1625 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1626 {
1627 Unit* target = GetTarget();
1631
1632 if (Creature* creature = target->ToCreature())
1633 creature->SetReactState(REACT_PASSIVE);
1634 }
1635
1636 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1637 {
1638 Unit* target = GetTarget();
1642
1643 if (Creature* creature = target->ToCreature())
1644 creature->InitializeReactState();
1645 }
1646
1647 void Register() override
1648 {
1651 }
1652};
1653
1655{
1656 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1657 {
1658 Unit* target = GetTarget();
1662 target->SetImmuneToAll(true);
1663 target->SetUninteractible(true);
1664
1665 if (Creature* creature = target->ToCreature())
1666 creature->SetReactState(REACT_PASSIVE);
1667 }
1668
1669 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1670 {
1671 Unit* target = GetTarget();
1675 target->SetImmuneToAll(false);
1676 target->SetUninteractible(false);
1677
1678 if (Creature* creature = target->ToCreature())
1679 creature->InitializeReactState();
1680 }
1681
1682 void Register() override
1683 {
1686 }
1687};
1688
1689// 35357 - Spawn Feign Death
1690// 51329 - Feign Death
1692{
1693 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1694 {
1695 Unit* target = GetTarget();
1698
1699 if (Creature* creature = target->ToCreature())
1700 creature->SetReactState(REACT_PASSIVE);
1701 }
1702
1703 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1704 {
1705 Unit* target = GetTarget();
1708
1709 if (Creature* creature = target->ToCreature())
1710 creature->InitializeReactState();
1711 }
1712
1713 void Register() override
1714 {
1717 }
1718};
1719
1720// 58951 - Permanent Feign Death
1722{
1723 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1724 {
1725 Unit* target = GetTarget();
1728
1729 if (Creature* creature = target->ToCreature())
1730 creature->SetReactState(REACT_PASSIVE);
1731 }
1732
1733 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1734 {
1735 Unit* target = GetTarget();
1738
1739 if (Creature* creature = target->ToCreature())
1740 creature->InitializeReactState();
1741 }
1742
1743 void Register() override
1744 {
1747 }
1748};
1749
1751{
1754 SPELL_EXHAUSTION = 35492
1756
1757// 35491 - Furious Rage
1759{
1760 bool Validate(SpellInfo const* /*spellInfo*/) override
1761 {
1762 return ValidateSpellInfo({ SPELL_EXHAUSTION }) &&
1765 }
1766
1767 void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1768 {
1769 Unit* target = GetTarget();
1770 target->Unit::TextEmote(EMOTE_FURIOUS_RAGE, target, false);
1771 }
1772
1773 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1774 {
1775 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
1776 return;
1777
1778 Unit* target = GetTarget();
1779 target->Unit::TextEmote(EMOTE_EXHAUSTED, target, false);
1780 target->CastSpell(target, SPELL_EXHAUSTION, true);
1781 }
1782
1783 void Register() override
1784 {
1787 }
1788};
1789
1790// 46642 - 5,000 Gold
1792{
1793 void HandleScript(SpellEffIndex /*effIndex*/)
1794 {
1795 if (Player* target = GetHitPlayer())
1796 target->ModifyMoney(5000 * GOLD);
1797 }
1798
1799 void Register() override
1800 {
1802 }
1803};
1804
1806{
1810
1811// 131474 - Fishing
1813{
1814 bool Validate(SpellInfo const* /*spellInfo*/) override
1815 {
1817 }
1818
1819 bool Load() override
1820 {
1821 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1822 }
1823
1825 {
1826 PreventHitDefaultEffect(effIndex);
1827 uint32 spellId;
1829 if (!mainHand || mainHand->GetTemplate()->GetClass() != ITEM_CLASS_WEAPON || mainHand->GetTemplate()->GetSubClass() != ITEM_SUBCLASS_WEAPON_FISHING_POLE)
1831 else
1832 spellId = SPELL_FISHING_WITH_POLE;
1833
1834 GetCaster()->CastSpell(GetCaster(), spellId, false);
1835 }
1836
1837 void Register() override
1838 {
1840 }
1841};
1842
1844{
1849
1851{
1852 bool Validate(SpellInfo const* /*spellInfo*/) override
1853 {
1854 return ValidateSpellInfo(
1855 {
1859 });
1860 }
1861
1862 void HandleDummy(SpellEffIndex /* effIndex */)
1863 {
1864 Unit* caster = GetCaster();
1865 int32 r = irand(0, 119);
1866 if (r < 20) // Transporter Malfunction - 1/6 polymorph
1868 else if (r < 100) // Evil Twin - 4/6 evil twin
1869 caster->CastSpell(caster, SPELL_TRANSPORTER_EVIL_TWIN, true);
1870 else // Transporter Malfunction - 1/6 miss the target
1871 caster->CastSpell(caster, SPELL_TRANSPORTER_MALFUNCTION_MISS, true);
1872 }
1873
1874 void Register() override
1875 {
1877 }
1878};
1879
1880// 28880 - Warrior
1881// 59542 - Paladin
1882// 59543 - Hunter
1883// 59544 - Priest
1884// 59545 - Death Knight
1885// 59547 - Shaman
1886// 59548 - Mage
1887// 121093 - Monk
1889{
1890 bool Validate(SpellInfo const* spellInfo) override
1891 {
1892 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
1893 }
1894
1895 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
1896 {
1897 if (!GetCaster() || !aurEff->GetTotalTicks())
1898 return;
1899
1900 float healPct = GetEffectInfo(EFFECT_1).CalcValue() / 100.0f;
1901 float heal = healPct * GetCaster()->GetMaxHealth();
1902 int32 healTick = std::floor(heal / aurEff->GetTotalTicks());
1903 amount += healTick;
1904 }
1905
1906 void Register() override
1907 {
1909 }
1910};
1911
1913{
1917
1919{
1920 bool Validate(SpellInfo const* /*spellInfo*/) override
1921 {
1922 return ValidateSpellInfo(
1923 {
1926 });
1927 }
1928
1929 void HandleDummy(SpellEffIndex /* effIndex */)
1930 {
1932 }
1933
1934 void Register() override
1935 {
1937 }
1938};
1939
1940// 69641 - Gryphon/Wyvern Pet - Mounting Check Aura
1942{
1943 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
1944 {
1945 Unit* target = GetTarget();
1946 Unit* owner = target->GetOwner();
1947
1948 if (!owner)
1949 return;
1950
1951 if (owner->IsMounted())
1952 target->SetDisableGravity(true);
1953 else
1954 target->SetDisableGravity(false);
1955 }
1956
1957 void Register() override
1958 {
1960 }
1961};
1962
1963/* 9204 - Hate to Zero (Melee)
1964 20538 - Hate to Zero (AoE)
1965 26569 - Hate to Zero (AoE)
1966 26637 - Hate to Zero (AoE, Unique)
1967 37326 - Hate to Zero (AoE)
1968 40410 - Hate to Zero (Should be added, AoE)
1969 40467 - Hate to Zero (Should be added, AoE)
1970 41582 - Hate to Zero (Should be added, Melee) */
1972{
1973 void HandleDummy(SpellEffIndex /*effIndex*/)
1974 {
1975 if (GetCaster()->CanHaveThreatList())
1977 }
1978
1979 void Register() override
1980 {
1982 }
1983};
1984
1985// This spell is used by both player and creature, but currently works only if used by player
1986// 63984 - Hate to Zero
1988{
1989 void HandleDummy(SpellEffIndex /*effIndex*/)
1990 {
1991 if (Unit* target = GetHitUnit())
1992 if (target->CanHaveThreatList())
1993 target->GetThreatManager().ModifyThreatByPercent(GetCaster(), -100);
1994 }
1995
1996 void Register() override
1997 {
1999 }
2000};
2001
2002// 19707 - Hate to 50%
2004{
2005 void HandleDummy(SpellEffIndex /*effIndex*/)
2006 {
2007 if (GetCaster()->CanHaveThreatList())
2009 }
2010
2011 void Register() override
2012 {
2014 }
2015};
2016
2017// 26886 - Hate to 75%
2019{
2020 void HandleDummy(SpellEffIndex /*effIndex*/)
2021 {
2022 if (GetCaster()->CanHaveThreatList())
2024 }
2025
2026 void Register() override
2027 {
2029 }
2030};
2031
2033{
2036
2037// 32748 - Deadly Throw Interrupt
2038// 44835 - Maim Interrupt
2040{
2041 bool Validate(SpellInfo const* /*spellInfo*/) override
2042 {
2044 }
2045
2046 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2047 {
2050 }
2051
2052 void Register() override
2053 {
2055 }
2056};
2057
2059{
2060 void HandleDummy(SpellEffIndex /*effIndex*/)
2061 {
2062 if (GetHitUnit()->IsInRaidWith(GetCaster()))
2063 GetCaster()->CastSpell(GetCaster(), GetEffectValue() + 1, true); // raid buff
2064 else
2065 GetCaster()->CastSpell(GetHitUnit(), GetEffectValue(), true); // single-target buff
2066 }
2067
2068 void Register() override
2069 {
2071 }
2072};
2073
2075{
2082
2084{
2085public:
2087
2088private:
2089 bool Validate(SpellInfo const* /*spellInfo*/) override
2090 {
2091 return ValidateSpellInfo({ _spellId });
2092 }
2093
2094 void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
2095 {
2096 // final heal only on duration end or dispel
2097 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
2098 return;
2099
2100 // final heal
2101 GetTarget()->CastSpell(GetTarget(), _spellId, CastSpellExtraArgs(aurEff).SetOriginalCaster(GetCasterGUID()));
2102 }
2103
2104 void Register() override
2105 {
2107 }
2108
2110};
2111
2112/* DOCUMENTATION: Charge spells
2113 Charge spells can be classified in four groups:
2114
2115 - Spells on vehicle bar used by players:
2116 + EFFECT_0: SCRIPT_EFFECT
2117 + EFFECT_1: TRIGGER_SPELL
2118 + EFFECT_2: NONE
2119 - Spells cast by player's mounts triggered by script:
2120 + EFFECT_0: CHARGE
2121 + EFFECT_1: TRIGGER_SPELL
2122 + EFFECT_2: APPLY_AURA
2123 - Spells cast by players on the target triggered by script:
2124 + EFFECT_0: SCHOOL_DAMAGE
2125 + EFFECT_1: SCRIPT_EFFECT
2126 + EFFECT_2: NONE
2127 - Spells cast by NPCs on players:
2128 + EFFECT_0: SCHOOL_DAMAGE
2129 + EFFECT_1: CHARGE
2130 + EFFECT_2: SCRIPT_EFFECT
2131
2132 In the following script we handle the SCRIPT_EFFECT and CHARGE
2133 - When handling SCRIPT_EFFECT:
2134 + EFFECT_0: Corresponds to "Spells on vehicle bar used by players" and we make player's mount cast
2135 the charge effect on the current target ("Spells cast by player's mounts triggered by script").
2136 + EFFECT_1 and EFFECT_2: Triggered when "Spells cast by player's mounts triggered by script" hits target,
2137 corresponding to "Spells cast by players on the target triggered by script" and "Spells cast by
2138 NPCs on players" and we check Defend layers and drop a charge of the first found.
2139 - When handling CHARGE:
2140 + Only launched for "Spells cast by player's mounts triggered by script", makes the player cast the
2141 damaging spell on target with a small chance of failing it.
2142*/
2143
2145{
2149
2155
2158
2160};
2161
2163{
2164 bool Validate(SpellInfo const* /*spellInfo*/) override
2165 {
2166 return ValidateSpellInfo({ 62552, 62719, 64100, 66482 });
2167 }
2168
2170 {
2171 Unit* target = GetHitUnit();
2172
2173 switch (effIndex)
2174 {
2175 case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
2176 {
2177 uint32 spellId;
2178
2179 switch (GetSpellInfo()->Id)
2180 {
2183 break;
2186 break;
2187 default:
2188 return;
2189 }
2190
2191 // If target isn't a training dummy there's a chance of failing the charge
2192 if (!target->IsCharmedOwnedByPlayerOrPlayer() && roll_chance_f(12.5f))
2193 spellId = SPELL_CHARGE_MISS_EFFECT;
2194
2195 if (Unit* vehicle = GetCaster()->GetVehicleBase())
2196 vehicle->CastSpell(target, spellId, false);
2197 else
2198 GetCaster()->CastSpell(target, spellId, false);
2199 break;
2200 }
2201 case EFFECT_1: // On damaging spells, for removing a defend layer
2202 case EFFECT_2:
2203 {
2204 Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
2205 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
2206 {
2207 if (Aura* aura = itr->second->GetBase())
2208 {
2209 if (aura->GetId() == 62552 || aura->GetId() == 62719 || aura->GetId() == 64100 || aura->GetId() == 66482)
2210 {
2211 aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
2212 // Remove dummys from rider (Necessary for updating visual shields)
2213 if (Unit* rider = target->GetCharmer())
2214 if (Aura* defend = rider->GetAura(aura->GetId()))
2215 defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
2216 break;
2217 }
2218 }
2219 }
2220 break;
2221 }
2222 default:
2223 break;
2224 }
2225 }
2226
2228 {
2229 uint32 spellId;
2230
2231 switch (GetSpellInfo()->Id)
2232 {
2234 spellId = SPELL_CHARGE_DAMAGE_8K5;
2235 break;
2238 spellId = SPELL_CHARGE_DAMAGE_20K;
2239 break;
2242 spellId = SPELL_CHARGE_DAMAGE_45K;
2243 break;
2244 default:
2245 return;
2246 }
2247
2248 if (Unit* rider = GetCaster()->GetCharmer())
2249 rider->CastSpell(GetHitUnit(), spellId, false);
2250 else
2251 GetCaster()->CastSpell(GetHitUnit(), spellId, false);
2252 }
2253
2254 void Register() override
2255 {
2256 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(m_scriptSpellId, DIFFICULTY_NONE);
2257
2260
2263 }
2264};
2265
2267{
2268 SPELL_FALL_DOWN = 6869
2270
2271// 6870 Moss Covered Feet
2272// 31399 Moss Covered Feet
2274{
2275 bool Validate(SpellInfo const* /*spellInfo*/) override
2276 {
2278 }
2279
2280 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2281 {
2283 eventInfo.GetActionTarget()->CastSpell(nullptr, SPELL_FALL_DOWN, aurEff);
2284 }
2285
2286 void Register() override
2287 {
2289 }
2290};
2291
2293{
2296
2297// 28702 - Netherbloom
2299{
2300 bool Validate(SpellInfo const* /*spellInfo*/) override
2301 {
2302 for (uint8 i = 0; i < 5; ++i)
2304 return false;
2305
2306 return true;
2307 }
2308
2310 {
2311 PreventHitDefaultEffect(effIndex);
2312
2313 if (Unit* target = GetHitUnit())
2314 {
2315 // 25% chance of casting a random buff
2316 if (roll_chance_i(75))
2317 return;
2318
2319 // triggered spells are 28703 to 28707
2320 // Note: some sources say, that there was the possibility of
2321 // receiving a debuff. However, this seems to be removed by a patch.
2322
2323 // don't overwrite an existing aura
2324 for (uint8 i = 0; i < 5; ++i)
2325 if (target->HasAura(SPELL_NETHERBLOOM_POLLEN_1 + i))
2326 return;
2327
2328 target->CastSpell(target, SPELL_NETHERBLOOM_POLLEN_1 + urand(0, 4), true);
2329 }
2330 }
2331
2332 void Register() override
2333 {
2335 }
2336};
2337
2339{
2342
2343// 28720 - Nightmare Vine
2345{
2346 bool Validate(SpellInfo const* /*spellInfo*/) override
2347 {
2349 }
2350
2352 {
2353 PreventHitDefaultEffect(effIndex);
2354
2355 if (Unit* target = GetHitUnit())
2356 {
2357 // 25% chance of casting Nightmare Pollen
2358 if (roll_chance_i(25))
2359 target->CastSpell(target, SPELL_NIGHTMARE_POLLEN, true);
2360 }
2361 }
2362
2363 void Register() override
2364 {
2366 }
2367};
2368
2369// 27746 - Nitrous Boost
2371{
2372 void PeriodicTick(AuraEffect const* /*aurEff*/)
2373 {
2375
2376 if (GetCaster() && GetTarget()->GetPower(POWER_MANA) >= 10)
2378 else
2379 Remove();
2380 }
2381
2382 void Register() override
2383 {
2385 }
2386};
2387
2389{
2397
2398// 27539 - Obsidian Armor
2400{
2401 bool Validate(SpellInfo const* /*spellInfo*/) override
2402 {
2403 return ValidateSpellInfo(
2404 {
2411 });
2412 }
2413
2414 bool CheckProc(ProcEventInfo& eventInfo)
2415 {
2416 if (!eventInfo.GetSpellInfo())
2417 return false;
2418
2420 return false;
2421
2422 return true;
2423 }
2424
2425 void OnProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2426 {
2428
2429 uint32 spellId = 0;
2430 switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
2431 {
2432 case SPELL_SCHOOL_HOLY:
2434 break;
2435 case SPELL_SCHOOL_FIRE:
2437 break;
2440 break;
2441 case SPELL_SCHOOL_FROST:
2443 break;
2446 break;
2449 break;
2450 default:
2451 return;
2452 }
2453 GetTarget()->CastSpell(GetTarget(), spellId, aurEff);
2454 }
2455
2456 void Register() override
2457 {
2460 }
2461};
2462
2464{
2465 bool Validate(SpellInfo const* spellInfo) override
2466 {
2467 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
2468 }
2469
2470 bool Load() override
2471 {
2472 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2473 }
2474
2475 void HandleDummy(SpellEffIndex /*effIndex*/)
2476 {
2477 Player* player = GetCaster()->ToPlayer();
2478 uint32 factionId = GetEffectInfo().CalcValue();
2479 int32 repChange = GetEffectInfo(EFFECT_1).CalcValue();
2480
2481 FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
2482 if (!factionEntry)
2483 return;
2484
2485 // Set rep to baserep + basepoints (expecting spillover for oposite faction -> become hated)
2486 // Not when player already has equal or higher rep with this faction
2487 if (player->GetReputationMgr().GetReputation(factionEntry) < repChange)
2488 player->GetReputationMgr().SetReputation(factionEntry, repChange);
2489
2490 // EFFECT_INDEX_2 most likely update at war state, we already handle this in SetReputation
2491 }
2492
2493 void Register() override
2494 {
2496 }
2497};
2498
2500{
2505
2507{
2508 bool Validate(SpellInfo const* /*spellInfo*/) override
2509 {
2510 return ValidateSpellInfo(
2511 {
2515 });
2516 }
2517
2518 void HandleScript(SpellEffIndex /*effIndex*/)
2519 {
2520 Unit* caster = GetCaster();
2521 if (Player* target = GetHitPlayer())
2522 {
2523 uint8 gender = target->GetNativeGender();
2524 if (!gender)
2525 caster->CastSpell(target, SPELL_ORC_DISGUISE_MALE, true);
2526 else
2527 caster->CastSpell(target, SPELL_ORC_DISGUISE_FEMALE, true);
2528 }
2529 }
2530
2531 void Register() override
2532 {
2534 }
2535};
2536
2538{
2539 SPELL_PARALYSIS = 35202
2541
2542// 35201 - Paralytic Poison
2544{
2545 bool Validate(SpellInfo const* /*spellInfo*/) override
2546 {
2548 }
2549
2550 void HandleStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
2551 {
2552 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
2553 return;
2554
2555 GetTarget()->CastSpell(nullptr, SPELL_PARALYSIS, aurEff);
2556 }
2557
2558 void Register() override
2559 {
2561 }
2562};
2563
2565{
2566 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
2567 {
2568 Unit* target = GetTarget();
2570 }
2571
2572 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
2573 {
2574 Unit* target = GetTarget();
2576 }
2577
2578 void Register() override
2579 {
2582 }
2583};
2584
2586{
2587 bool Validate(SpellInfo const* spellInfo) override
2588 {
2589 return sBroadcastTextStore.HasRecord(uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()));
2590 }
2591
2592 void HandleScript(SpellEffIndex /*effIndex*/)
2593 {
2594 // Note: target here is always player; caster here is gameobject, creature or player (self cast)
2595 if (Unit* target = GetHitUnit())
2596 target->Unit::Say(uint32(GetEffectValue()), target);
2597 }
2598
2599 void Register() override
2600 {
2602 }
2603};
2604
2606{
2607 bool CheckProc(ProcEventInfo& eventInfo)
2608 {
2609 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
2610 if (!damageInfo || !damageInfo->GetDamage())
2611 return false;
2612
2614
2615 if (eventInfo.GetActionTarget()->HealthBelowPctDamaged(pct, damageInfo->GetDamage()))
2616 return true;
2617
2618 return false;
2619 }
2620
2621 void Register() override
2622 {
2624 }
2625};
2626
2628{
2629 void HandleChargeDrop(ProcEventInfo& /*eventInfo*/)
2630 {
2632 }
2633
2634 void Register() override
2635 {
2637 }
2638};
2639
2641{
2644};
2645
2646// 45472 Parachute
2648{
2649 bool Validate(SpellInfo const* /*spellInfo*/) override
2650 {
2651 return ValidateSpellInfo(
2652 {
2655 });
2656 }
2657
2658 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
2659 {
2660 if (Player* target = GetTarget()->ToPlayer())
2661 if (target->IsFalling())
2662 {
2663 target->RemoveAurasDueToSpell(SPELL_PARACHUTE);
2664 target->CastSpell(target, SPELL_PARACHUTE_BUFF, true);
2665 }
2666 }
2667
2668 void Register() override
2669 {
2671 }
2672};
2673
2675{
2678 NPC_IMP = 416
2680
2682{
2683 bool Load() override
2684 {
2685 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2686 }
2687
2688 void HandleScript(SpellEffIndex /*effIndex*/)
2689 {
2690 Player* player = GetCaster()->ToPlayer();
2691 if (player->GetLastPetNumber())
2692 {
2693 PetType newPetType = (player->GetClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
2694 Pet* newPet = new Pet(player, newPetType);
2695 if (newPet->LoadPetFromDB(player, 0, player->GetLastPetNumber(), true))
2696 {
2697 // revive the pet if it is dead
2698 if (newPet->getDeathState() != ALIVE && newPet->getDeathState() != JUST_RESPAWNED)
2700
2701 newPet->SetFullHealth();
2702 newPet->SetFullPower(newPet->GetPowerType());
2703
2704 switch (newPet->GetEntry())
2705 {
2706 case NPC_DOOMGUARD:
2707 case NPC_INFERNAL:
2708 newPet->SetEntry(NPC_IMP);
2709 break;
2710 default:
2711 break;
2712 }
2713 }
2714 else
2715 delete newPet;
2716 }
2717 }
2718
2719 void Register() override
2720 {
2722 }
2723};
2724
2725// 36553 - PetWait
2727{
2728 void HandleScript(SpellEffIndex /*effIndex*/)
2729 {
2732 }
2733
2734 void Register() override
2735 {
2737 }
2738};
2739
2741{
2744
2746{
2747 bool Load() override
2748 {
2749 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2750 }
2751
2753 {
2754 Player* player = GetCaster()->ToPlayer();
2755
2756 if (HasDiscoveredAllSpells(GetSpellInfo()->Id, player))
2757 {
2760 }
2761
2762 return SPELL_CAST_OK;
2763 }
2764
2765 void HandleScript(SpellEffIndex /*effIndex*/)
2766 {
2767 Player* caster = GetCaster()->ToPlayer();
2768 uint32 spellId = GetSpellInfo()->Id;
2769
2770 // Learn random explicit discovery recipe (if any)
2771 // Players will now learn 3 recipes the very first time they perform Northrend Inscription Research (3.3.0 patch notes)
2772 if (spellId == SPELL_NORTHREND_INSCRIPTION_RESEARCH && !HasDiscoveredAnySpell(spellId, caster))
2773 for (int i = 0; i < 2; ++i)
2774 if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
2775 caster->LearnSpell(discoveredSpellId, false);
2776
2777 if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
2778 caster->LearnSpell(discoveredSpellId, false);
2779 }
2780
2781 void Register() override
2782 {
2785 }
2786};
2787
2789{
2793
2795{
2797 {
2798 Player* caster = GetCaster()->ToPlayer();
2799
2800 switch (caster->GetEffectiveTeam())
2801 {
2802 case ALLIANCE:
2804 break;
2805 case HORDE:
2807 break;
2808 default:
2809 break;
2810 }
2811 }
2812
2813 void Register() override
2814 {
2816 }
2817};
2818
2820{
2821 void HandleScript(SpellEffIndex /*effIndex*/)
2822 {
2823 if (Unit* target = GetHitUnit())
2824 {
2825 target->RemoveAurasByType(SPELL_AURA_FLY);
2826 target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
2827 }
2828 }
2829
2830 void Register() override
2831 {
2833 }
2834};
2835
2836// 20589 - Escape artist
2838{
2840 {
2842 }
2843
2844 void Register() override
2845 {
2847 }
2848};
2849
2850// 23493 - Restoration
2851// 24379 - Restoration
2853{
2854 void PeriodicTick(AuraEffect const* /*aurEff*/)
2855 {
2857
2858 Unit* target = GetTarget();
2859 if (!target)
2860 return;
2861
2862 int32 heal = target->CountPctFromMaxHealth(10);
2863 HealInfo healInfo(target, target, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
2864 target->HealBySpell(healInfo);
2865
2867 if (int32 mana = target->GetMaxPower(POWER_MANA))
2868 {
2869 mana /= 10;
2870 target->EnergizeBySpell(target, GetSpellInfo(), mana, POWER_MANA);
2871 }
2872 }
2873
2874 void Register() override
2875 {
2877 }
2878};
2879
2880// 38772 Grievous Wound
2881// 43937 Grievous Wound
2882// 62331 Impale
2883// 62418 Impale
2885{
2886 bool Validate(SpellInfo const* spellInfo) override
2887 {
2888 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
2889 }
2890
2891 void PeriodicTick(AuraEffect const* /*aurEff*/)
2892 {
2893 // they apply damage so no need to check for ticks here
2894
2895 if (GetTarget()->HealthAbovePct(GetEffectInfo(EFFECT_1).CalcValue()))
2896 {
2899 }
2900 }
2901
2902 void Register() override
2903 {
2905 }
2906};
2907
2908// 31956 Grievous Wound
2909// 38801 Grievous Wound
2910// 43093 Grievous Throw
2911// 58517 Grievous Wound
2912// 59262 Grievous Wound
2914{
2915 void PeriodicTick(AuraEffect const* aurEff)
2916 {
2917 // if it has only periodic effect, allow 1 tick
2918 bool onlyEffect = GetSpellInfo()->GetEffects().size() == 1;
2919 if (onlyEffect && aurEff->GetTickNumber() <= 1)
2920 return;
2921
2922 if (GetTarget()->IsFullHealth())
2923 {
2926 }
2927 }
2928
2929 void Register() override
2930 {
2932 }
2933};
2934
2935// 70292 - Glacial Strike
2936// 71316 - Glacial Strike
2938{
2939 void PeriodicTick(AuraEffect const* /*aurEff*/)
2940 {
2941 // they apply damage so no need to check for ticks here
2942
2943 if (GetTarget()->IsFullHealth())
2944 {
2947 }
2948 }
2949
2950 void Register() override
2951 {
2953 }
2954};
2955
2957{
2961
2963{
2964public:
2965 bool operator()(WorldObject* obj) const
2966 {
2967 if (Unit* target = obj->ToUnit())
2968 return target->GetPowerType() != POWER_MANA;
2969
2970 return true;
2971 }
2972};
2973
2975{
2976 void RemoveInvalidTargets(std::list<WorldObject*>& targets)
2977 {
2978 // In arenas Replenishment may only affect the caster
2979 if (Player* caster = GetCaster()->ToPlayer())
2980 {
2981 if (caster->InArena())
2982 {
2983 targets.clear();
2984 targets.push_back(caster);
2985 return;
2986 }
2987 }
2988
2989 targets.remove_if(ReplenishmentCheck());
2990
2991 uint8 const maxTargets = 10;
2992
2993 if (targets.size() > maxTargets)
2994 {
2996 targets.resize(maxTargets);
2997 }
2998 }
2999
3000 void Register() override
3001 {
3003 }
3004};
3005
3007{
3008 bool Load() override
3009 {
3010 return GetUnitOwner()->GetPowerType() == POWER_MANA;
3011 }
3012
3013 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
3014 {
3015 switch (GetSpellInfo()->Id)
3016 {
3018 amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f;
3019 break;
3021 amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f;
3022 break;
3023 default:
3024 break;
3025 }
3026 }
3027
3028 void Register() override
3029 {
3031 }
3032};
3033
3035{
3036 SPELL_ALTERED_FORM = 97709
3038
3040{
3041 bool Validate(SpellInfo const* /*spell*/) override
3042 {
3044 }
3045
3046 bool Load() override
3047 {
3048 // Definitely not a good thing, but currently the only way to do something at cast start
3049 // Should be replaced as soon as possible with a new hook: BeforeCastStart
3051 return false;
3052 }
3053
3054 void Register() override
3055 {
3056 }
3057};
3058
3060{
3061 bool Validate(SpellInfo const* /*spell*/) override
3062 {
3064 return false;
3065 return true;
3066 }
3067
3068 void HandleMount(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
3069 {
3070 Unit* target = GetTarget();
3072
3073 target->Mount(DISPLAYID_HIDDEN_MOUNT, 0, 0);
3074
3075 // cast speed aura
3076 if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(aurEff->GetAmount()))
3077 target->CastSpell(target, mountCapability->ModSpellAuraID, TRIGGERED_FULL_MASK);
3078 }
3079
3080 void Register() override
3081 {
3083 }
3084};
3085
3087{
3089 {
3090 if (GetCaster()->IsInCombat())
3091 {
3094 }
3095
3096 // Player cannot transform to human form if he is forced to be worgen for some reason (Darkflight)
3098 if (std::distance(alteredFormAuras.begin(), alteredFormAuras.end()) > 1)
3099 {
3102 }
3103
3104 return SPELL_CAST_OK;
3105 }
3106
3108 {
3109 Unit* target = GetHitUnit();
3110 PreventHitDefaultEffect(effIndex);
3113 else // Basepoints 1 for this aura control whether to trigger transform transition animation or not.
3115 }
3116
3117 void Register() override
3118 {
3121 }
3122};
3123
3125{
3127 {
3129 }
3130
3131 void Register() override
3132 {
3134 }
3135};
3136
3138{
3141
3143{
3144 bool Validate(SpellInfo const* /*spellInfo*/) override
3145 {
3147 }
3148
3149 bool Load() override
3150 {
3151 return GetGObjCaster()->GetOwnerGUID().IsPlayer();
3152 }
3153
3155 {
3156 if (Unit* owner = GetGObjCaster()->GetOwner())
3157 if (GameObject* go = GetHitGObj())
3158 if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING)
3159 owner->CastSpell(nullptr, SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT, true);
3160 }
3161
3162 void Register() override
3163 {
3165 }
3166};
3167
3169
3171{
3172 void HandleDummy(SpellEffIndex /*effIndex*/)
3173 {
3174 if (roll_chance_i(40))
3176 }
3177
3178 void Register() override
3179 {
3181 }
3182};
3183
3185{
3186 bool Load() override
3187 {
3189 }
3190
3191 void HandleDummy(SpellEffIndex /* effIndex */)
3192 {
3193 Player* originalCaster = GetOriginalCaster()->ToPlayer();
3194 if (Unit* target = GetHitUnit())
3195 {
3197 spiritHealerConfirm.Npc = target->GetGUID();
3199 spiritHealerConfirm.Success = true;
3200 originalCaster->SendDirectMessage(spiritHealerConfirm.Write());
3201 }
3202 }
3203
3204 void Register() override
3205 {
3207 }
3208};
3209
3211{
3212 SPELL_LANCE_EQUIPPED = 62853
3214
3216{
3217 bool Validate(SpellInfo const* /*spellInfo*/) override
3218 {
3220 }
3221
3223 {
3224 if (GetCaster()->IsInDisallowedMountForm())
3226
3228 {
3231 }
3232
3233 return SPELL_CAST_OK;
3234 }
3235
3236 void Register() override
3237 {
3239 }
3240};
3241
3242// 41213, 43416, 69222, 73076 - Throw Shield
3244{
3246 {
3247 PreventHitDefaultEffect(effIndex);
3249 }
3250
3251 void Register() override
3252 {
3254 }
3255};
3256
3258{
3260 SPELL_MOUNTED_DUEL = 62875
3262
3264{
3265 bool Validate(SpellInfo const* /*spellInfo*/) override
3266 {
3267 return ValidateSpellInfo(
3268 {
3271 });
3272 }
3273
3275 {
3276 if (Unit* rider = GetCaster()->GetCharmer())
3277 {
3278 if (Player* playerTarget = GetHitPlayer())
3279 {
3280 if (playerTarget->HasAura(SPELL_ON_TOURNAMENT_MOUNT) && playerTarget->GetVehicleBase())
3281 rider->CastSpell(playerTarget, SPELL_MOUNTED_DUEL, true);
3282 }
3283 else if (Unit* unitTarget = GetHitUnit())
3284 {
3285 if (unitTarget->GetCharmer() && unitTarget->GetCharmer()->GetTypeId() == TYPEID_PLAYER && unitTarget->GetCharmer()->HasAura(SPELL_ON_TOURNAMENT_MOUNT))
3286 rider->CastSpell(unitTarget->GetCharmer(), SPELL_MOUNTED_DUEL, true);
3287 }
3288 }
3289 }
3290
3291 void Register() override
3292 {
3294 }
3295};
3296
3298{
3299 bool Load() override
3300 {
3301 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
3302 }
3303
3304 void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
3305 {
3306 if (Unit* caster = GetCaster())
3307 if (!caster->GetVehicleBase())
3308 caster->RemoveAurasDueToSpell(GetId());
3309 }
3310
3311 void Register() override
3312 {
3314 }
3315};
3316
3318{
3320
3324
3326{
3327 void HandleScript(SpellEffIndex /* effIndex */)
3328 {
3329 Unit* target = GetHitUnit();
3330 if (target->GetTypeId() != TYPEID_PLAYER)
3331 return;
3332
3333 // return from top
3334 if (target->ToPlayer()->GetAreaId() == AREA_VIOLET_CITADEL_SPIRE)
3335 target->CastSpell(target, SPELL_TELEPORT_SPIRE_DOWN, true);
3336 // teleport atop
3337 else
3338 target->CastSpell(target, SPELL_TELEPORT_SPIRE_UP, true);
3339 }
3340
3341 void Register() override
3342 {
3344 }
3345};
3346
3348{
3349 bool Validate(SpellInfo const* spellInfo) override
3350 {
3351 return ValidateSpellInfo({ spellInfo->ExcludeCasterAuraSpell });
3352 }
3353
3355 {
3356 // Blizz seems to just apply aura without bothering to cast
3357 GetCaster()->AddAura(GetSpellInfo()->ExcludeCasterAuraSpell, GetCaster());
3358 }
3359
3360 void Register() override
3361 {
3363 }
3364};
3365
3367{
3368 bool Validate(SpellInfo const* spellInfo) override
3369 {
3370 return ValidateSpellInfo({ spellInfo->ExcludeTargetAuraSpell });
3371 }
3372
3374 {
3375 if (Unit* target = GetHitUnit())
3376 // Blizz seems to just apply aura without bothering to cast
3377 GetCaster()->AddAura(GetSpellInfo()->ExcludeTargetAuraSpell, target);
3378 }
3379
3380 void Register() override
3381 {
3383 }
3384};
3385
3387{
3391
3392template <uint32 TriggeredSpellId>
3394{
3395 bool Validate(SpellInfo const* /*spellInfo*/) override
3396 {
3397 return ValidateSpellInfo({ TriggeredSpellId });
3398 }
3399
3401 {
3402 /*
3403 * @workaround: PendingCast flag normally means 'triggered' spell, however
3404 * if the spell is cast triggered, the core won't send SMSG_SPELL_GO packet
3405 * so client never registers the cooldown (see Spell::IsNeedSendToClient)
3406 *
3407 * ServerToClient: SMSG_SPELL_GO (0x0132) Length: 42 ConnIdx: 0 Time: 07/19/2010 02:32:35.000 Number: 362675
3408 * Caster GUID: Full: Player
3409 * Caster Unit GUID: Full: Player
3410 * Cast Count: 0
3411 * Spell ID: 72752 (72752)
3412 * Cast Flags: PendingCast, Unknown3, Unknown7 (265)
3413 * Time: 3901468825
3414 * Hit Count: 1
3415 * [0] Hit GUID: Player
3416 * Miss Count: 0
3417 * Target Flags: Unit (2)
3418 * Target GUID: 0x0
3419 */
3420
3421 // Spell flags need further research, until then just cast not triggered
3422 GetCaster()->CastSpell(nullptr, TriggeredSpellId, false);
3423 }
3424
3425 void Register() override
3426 {
3428 }
3429};
3430
3432{
3435
3437{
3438 void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
3439 {
3440 // store stack apply times, so we can pop them while they expire
3442 Unit* target = GetTarget();
3443
3444 // on stack 15 cast the achievement crediting spell
3445 if (GetStackAmount() >= 15)
3446 target->CastSpell(target, SPELL_TURKEY_VENGEANCE, CastSpellExtraArgs(aurEff)
3447 .SetOriginalCaster(GetCasterGUID()));
3448 }
3449
3450 void OnPeriodic(AuraEffect const* /*aurEff*/)
3451 {
3452 int32 removeCount = 0;
3453
3454 // pop expired times off of the stack
3455 while (!_applyTimes.empty() && _applyTimes.front() + GetMaxDuration() < GameTime::GetGameTimeMS())
3456 {
3457 _applyTimes.pop_front();
3458 removeCount++;
3459 }
3460
3461 if (removeCount)
3463 }
3464
3465 void Register() override
3466 {
3469 }
3470
3471 std::list<uint32> _applyTimes;
3472};
3473
3475{
3482
3484{
3485 void HandleScript(SpellEffIndex /*effIndex*/)
3486 {
3487 if (Player* player = GetHitPlayer())
3488 {
3490 // player can only have one of these items
3491 for (uint8 i = 0; i < 5; ++i)
3492 {
3493 if (player->HasItemCount(itemId[i], 1, true))
3494 return;
3495 }
3496
3497 CreateItem(itemId[urand(0, 4)], ItemContext::NONE);
3498 }
3499 }
3500
3501 void Register() override
3502 {
3504 }
3505};
3506
3508{
3511
3512// 52723 - Vampiric Touch
3513// 60501 - Vampiric Touch
3515{
3516 bool Validate(SpellInfo const* /*spellInfo*/) override
3517 {
3519 }
3520
3521 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
3522 {
3524 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
3525 if (!damageInfo || !damageInfo->GetDamage())
3526 return;
3527
3528 Unit* caster = eventInfo.GetActor();
3529 CastSpellExtraArgs args(aurEff);
3530 args.AddSpellBP0(damageInfo->GetDamage() / 2);
3531 caster->CastSpell(caster, SPELL_VAMPIRIC_TOUCH_HEAL, args);
3532 }
3533
3534 void Register() override
3535 {
3537 }
3538};
3539
3541{
3542 SPELL_GEAR_SCALING = 66668
3544
3546{
3547 bool Load() override
3548 {
3549 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
3550 }
3551
3552 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
3553 {
3554 Unit* caster = GetCaster();
3555 float factor;
3556 uint16 baseItemLevel;
3557
3559 switch (GetId())
3560 {
3561 case SPELL_GEAR_SCALING:
3562 factor = 1.0f;
3563 baseItemLevel = 205;
3564 break;
3565 default:
3566 factor = 1.0f;
3567 baseItemLevel = 170;
3568 break;
3569 }
3570
3571 float avgILvl = caster->ToPlayer()->GetAverageItemLevel();
3572 if (avgILvl < baseItemLevel)
3573 return;
3574
3575 amount = uint16((avgILvl - baseItemLevel) * factor);
3576 }
3577
3578 void Register() override
3579 {
3583 }
3584};
3585
3587{
3591
3593{
3594 void HandleDummy(SpellEffIndex /* effIndex */)
3595 {
3596 if (Creature* vendor = GetCaster()->ToCreature())
3597 if (vendor->GetEntry() == NPC_AMPHITHEATER_VENDOR)
3598 vendor->AI()->Talk(SAY_AMPHITHEATER_VENDOR);
3599 }
3600
3601 void Register() override
3602 {
3604 }
3605};
3606
3608{
3610 {
3611 if (!GetSpellInfo()->CheckTargetCreatureType(GetCaster()))
3613 return SPELL_CAST_OK;
3614 }
3615
3616 void Register() override
3617 {
3619 }
3620};
3621
3623{
3626
3628{
3629 bool Validate(SpellInfo const* /*spellInfo*/) override
3630 {
3632 }
3633
3634 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
3635 {
3638 }
3639
3640 void Register() override
3641 {
3643 }
3644};
3645
3647{
3648 bool Validate(SpellInfo const* spellInfo) override
3649 {
3650 return sBroadcastTextStore.HasRecord(uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()));
3651 }
3652
3653 void HandleScript(SpellEffIndex /*effIndex*/)
3654 {
3655 if (TempSummon* casterSummon = GetCaster()->ToTempSummon())
3656 if (Player* target = casterSummon->GetSummonerUnit()->ToPlayer())
3657 casterSummon->Unit::Whisper(uint32(GetEffectValue()), target, false);
3658 }
3659
3660 void Register() override
3661 {
3663 }
3664};
3665
3667{
3672
3673// BasePoints of spells is ID of npc_text used to group texts, it's not implemented so texts are grouped the old way
3674// 50037 - Mystery of the Infinite: Future You's Whisper to Controller - Random
3675// 50287 - Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random
3676// 60709 - MOTI, Redux: Past You's Whisper to Controller - Random
3678{
3679public:
3681
3682private:
3683 void HandleScript(SpellEffIndex /*effIndex*/)
3684 {
3685 // Same for all spells
3686 if (!roll_chance_i(20))
3687 return;
3688
3689 if (Creature* target = GetHitCreature())
3690 if (TempSummon* targetSummon = target->ToTempSummon())
3691 if (Player* player = targetSummon->GetSummonerUnit()->ToPlayer())
3692 targetSummon->AI()->Talk(_text, player);
3693 }
3694
3695 void Register() override
3696 {
3698 }
3699
3701};
3702
3704{
3706 {
3707 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3708 vehicle->RemoveAllPassengers();
3709 }
3710
3711 void Register() override
3712 {
3714 }
3715};
3716
3718{
3719 bool Validate(SpellInfo const* spellInfo) override
3720 {
3721 if (!ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }))
3722 return false;
3723 if (spellInfo->GetEffect(EFFECT_0).CalcValue() < 1)
3724 return false;
3725 return true;
3726 }
3727
3729 {
3730 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3731 {
3732 if (Unit* passenger = vehicle->GetPassenger(GetEffectValue() - 1))
3733 passenger->ExitVehicle();
3734 }
3735 }
3736
3737 void Register() override
3738 {
3740 }
3741};
3742
3744{
3745public:
3747
3748private:
3750
3752 {
3753 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3754 {
3755 if (Unit* passenger = vehicle->GetPassenger(_seatId))
3756 passenger->ExitVehicle();
3757 }
3758 }
3759
3760 void Register() override
3761 {
3763 }
3764};
3765
3767{
3768 SPELL_GM_FREEZE = 9454
3770
3772{
3773 bool Validate(SpellInfo const* /*spellInfo*/) override
3774 {
3776 }
3777
3778 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
3779 {
3780 // Do what was done before to the target in HandleFreezeCommand
3781 if (Player* player = GetTarget()->ToPlayer())
3782 {
3783 // stop combat + make player unattackable + duel stop + stop some spells
3784 player->SetFaction(FACTION_FRIENDLY);
3785 player->CombatStop();
3786 if (player->IsNonMeleeSpellCast(true))
3787 player->InterruptNonMeleeSpells(true);
3788 player->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
3789
3790 // if player class = hunter || warlock remove pet if alive
3791 if ((player->GetClass() == CLASS_HUNTER) || (player->GetClass() == CLASS_WARLOCK))
3792 {
3793 if (Pet* pet = player->GetPet())
3794 {
3795 pet->SavePetToDB(PET_SAVE_AS_CURRENT);
3796 // not let dismiss dead pet
3797 if (pet->IsAlive())
3798 player->RemovePet(pet, PET_SAVE_NOT_IN_SLOT);
3799 }
3800 }
3801 }
3802 }
3803
3804 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
3805 {
3806 // Do what was done before to the target in HandleUnfreezeCommand
3807 if (Player* player = GetTarget()->ToPlayer())
3808 {
3809 // Reset player faction + allow combat + allow duels
3810 player->SetFactionForRace(player->GetRace());
3811 player->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
3812 // save player
3813 player->SaveToDB();
3814 }
3815 }
3816
3817 void Register() override
3818 {
3821 }
3822};
3823
3825{
3827 {
3828 Creature* target = GetHitCreature();
3829 if (!target)
3830 return;
3831
3834 }
3835
3836 void Register() override
3837 {
3839 }
3840};
3841
3843{
3845 // Flasks
3862 // Elixirs
3929
3931{
3932 bool Validate(SpellInfo const* spellInfo) override
3933 {
3934 return ValidateSpellInfo({ SPELL_MIXOLOGY }) && ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } });
3935 }
3936
3937 bool Load() override
3938 {
3939 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
3940 }
3941
3942 void SetBonusValueForEffect(SpellEffIndex effIndex, int32 value, AuraEffect const* aurEff)
3943 {
3944 if (aurEff->GetEffIndex() == uint32(effIndex))
3945 bonus = value;
3946 }
3947
3948 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
3949 {
3950 if (GetCaster()->HasAura(SPELL_MIXOLOGY) && GetCaster()->HasSpell(GetEffectInfo(EFFECT_0).TriggerSpell))
3951 {
3952 switch (GetId())
3953 {
3956 bonus = amount;
3957 break;
3961 bonus = CalculatePct(amount, 80);
3962 break;
3978 bonus = CalculatePct(amount, 50);
3979 break;
3981 bonus = 280;
3982 break;
3984 bonus = 200;
3985 break;
3988 bonus = 140;
3989 break;
3991 bonus = 100;
3992 break;
3994 bonus = 82;
3995 break;
3997 bonus = 70;
3998 break;
4000 bonus = 50;
4001 break;
4003 bonus = 47;
4004 break;
4005 case SPELL_WRATH_ELIXIR:
4006 bonus = 32;
4007 break;
4011 bonus = 29;
4012 break;
4014 bonus = 27;
4015 break;
4020 bonus = 23;
4021 break;
4033 bonus = 20;
4034 break;
4036 bonus = 17;
4037 break;
4040 bonus = 15;
4041 break;
4043 bonus = 13;
4044 break;
4046 bonus = 12;
4047 break;
4050 bonus = 11;
4051 break;
4057 bonus = 10;
4058 break;
4060 bonus = 9;
4061 break;
4063 case SPELL_GURUS_ELIXIR:
4064 bonus = 8;
4065 break;
4069 bonus = 6;
4070 break;
4075 bonus = 5;
4076 break;
4079 bonus = 4;
4080 break;
4082 bonus = -10;
4083 break;
4085 SetBonusValueForEffect(EFFECT_0, 13, aurEff);
4086 SetBonusValueForEffect(EFFECT_1, 13, aurEff);
4087 SetBonusValueForEffect(EFFECT_2, 8, aurEff);
4088 break;
4090 SetBonusValueForEffect(EFFECT_0, 160, aurEff);
4091 break;
4093 SetBonusValueForEffect(EFFECT_0, 116, aurEff);
4094 SetBonusValueForEffect(EFFECT_1, 6, aurEff);
4095 break;
4097 SetBonusValueForEffect(EFFECT_0, 40, aurEff);
4098 SetBonusValueForEffect(EFFECT_1, 40, aurEff);
4099 break;
4101 SetBonusValueForEffect(EFFECT_0, 210, aurEff);
4102 SetBonusValueForEffect(EFFECT_1, 5, aurEff);
4103 break;
4105 SetBonusValueForEffect(EFFECT_0, 19, aurEff);
4106 SetBonusValueForEffect(EFFECT_1, 19, aurEff);
4107 SetBonusValueForEffect(EFFECT_2, 5, aurEff);
4108 break;
4110 SetBonusValueForEffect(EFFECT_0, 5, aurEff);
4111 break;
4112 default:
4113 TC_LOG_ERROR("spells", "SpellId {} couldn't be processed in spell_gen_mixology_bonus", GetId());
4114 break;
4115 }
4116 amount += bonus;
4117 }
4118 }
4119
4121
4122 void Register() override
4123 {
4125 }
4126};
4127
4129{
4132
4134{
4135 void HandleScript(SpellEffIndex /*effIndex*/)
4136 {
4137 if (Player* target = GetHitPlayer())
4138 {
4139 Aura const* aura = GetHitAura();
4140 if (!aura || aura->GetStackAmount() < 10)
4141 return;
4142
4143 target->CastSpell(target, SPELL_LANDMINE_KNOCKBACK_ACHIEVEMENT, true);
4144 }
4145 }
4146
4147 void Register() override
4148 {
4150 }
4151};
4152
4153// 34098 - ClearAllDebuffs
4155{
4156 void HandleScript(SpellEffIndex /*effIndex*/)
4157 {
4158 if (Unit* target = GetHitUnit())
4159 {
4160 target->RemoveOwnedAuras([](Aura const* aura)
4161 {
4162 SpellInfo const* spellInfo = aura->GetSpellInfo();
4163 return !spellInfo->IsPositive() && !spellInfo->IsPassive();
4164 });
4165 }
4166 }
4167
4168 void Register() override
4169 {
4171 }
4172};
4173
4175{
4177 MOUNT_PONY = 29736
4179
4181{
4182 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
4183 {
4184 Unit* caster = GetCaster();
4185 if (!caster)
4186 return;
4187 Player* owner = caster->GetOwner()->ToPlayer();
4188 if (!owner || !owner->HasAchieved(ACHIEV_PONY_UP))
4189 return;
4190
4191 if (owner->IsMounted())
4192 {
4193 caster->Mount(MOUNT_PONY);
4194 caster->SetSpeedRate(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
4195 }
4196 else if (caster->IsMounted())
4197 {
4198 caster->Dismount();
4199 caster->SetSpeedRate(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
4200 }
4201 }
4202
4203 void Register() override
4204 {
4206 }
4207};
4208
4210{
4216
4217// 40350 - Corrupting Plague
4219{
4220public:
4221 CorruptingPlagueSearcher(Unit* obj, float distance) : _unit(obj), _distance(distance) { }
4222
4223 bool operator()(Unit* u) const
4224 {
4225 if (_unit->GetDistance2d(u) < _distance &&
4228 return true;
4229
4230 return false;
4231 }
4232
4233private:
4236};
4237
4238// 40349 - Corrupting Plague
4240{
4241 bool Validate(SpellInfo const* /*spellInfo*/) override
4242 {
4244 }
4245
4246 void OnPeriodic(AuraEffect const* /*aurEff*/)
4247 {
4248 Unit* owner = GetTarget();
4249
4250 std::list<Creature*> targets;
4251 CorruptingPlagueSearcher creature_check(owner, 15.0f);
4252 Trinity::CreatureListSearcher<CorruptingPlagueSearcher> creature_searcher(owner, targets, creature_check);
4253 Cell::VisitGridObjects(owner, creature_searcher, 15.0f);
4254
4255 if (!targets.empty())
4256 return;
4257
4259 }
4260
4261 void Register() override
4262 {
4264 }
4265};
4266
4268{
4270 SPELL_STASIS_FIELD = 40307
4272
4273// 40307 - Stasis Field
4275{
4276public:
4277 StasisFieldSearcher(Unit* obj, float distance) : _unit(obj), _distance(distance) { }
4278
4279 bool operator()(Unit* u) const
4280 {
4281 if (_unit->GetDistance2d(u) < _distance &&
4284 return true;
4285
4286 return false;
4287 }
4288
4289private:
4292};
4293
4294// 40306 - Stasis Field
4296{
4297 bool Validate(SpellInfo const* /*spellInfo*/) override
4298 {
4300 }
4301
4302 void OnPeriodic(AuraEffect const* /*aurEff*/)
4303 {
4304 Unit* owner = GetTarget();
4305
4306 std::list<Creature*> targets;
4307 StasisFieldSearcher creature_check(owner, 15.0f);
4308 Trinity::CreatureListSearcher<StasisFieldSearcher> creature_searcher(owner, targets, creature_check);
4309 Cell::VisitGridObjects(owner, creature_searcher, 15.0f);
4310
4311 if (!targets.empty())
4312 return;
4313
4315 }
4316
4317 void Register() override
4318 {
4320 }
4321};
4322
4324{
4327
4329{
4330 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
4331 {
4333 }
4334
4335 void Register() override
4336 {
4338 }
4339};
4340
4342{
4349
4350// 34779 - Freezing Circle
4352{
4353 bool Validate(SpellInfo const* /*spellInfo*/) override
4354 {
4355 return ValidateSpellInfo(
4356 {
4361 });
4362 }
4363
4364 void HandleDamage(SpellEffIndex /*effIndex*/)
4365 {
4366 Unit* caster = GetCaster();
4367 uint32 spellId = 0;
4368 Map* map = caster->GetMap();
4369
4370 if (map->IsDungeon())
4372 else
4374
4375 if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetCastDifficulty()))
4376 if (!spellInfo->GetEffects().empty())
4377 SetHitDamage(spellInfo->GetEffect(EFFECT_0).CalcValue());
4378 }
4379
4380 void Register() override
4381 {
4383 }
4384};
4385
4386// Used for some spells cast by vehicles or charmed creatures that do not send a cooldown event on their own
4388{
4390 {
4391 Unit* caster = GetCaster();
4392 if (Player* owner = caster->GetCharmerOrOwnerPlayerOrPlayerItself())
4393 {
4395 spellCooldown.Caster = owner->GetGUID();
4396 spellCooldown.Flags = SPELL_COOLDOWN_FLAG_NONE;
4397 spellCooldown.SpellCooldowns.emplace_back(GetSpellInfo()->Id, GetSpellInfo()->RecoveryTime);
4398 owner->SendDirectMessage(spellCooldown.Write());
4399 }
4400 }
4401
4402 void Register() override
4403 {
4405 }
4406};
4407
4409{
4413
4415{
4416 bool Validate(SpellInfo const* /*spellInfo*/) override
4417 {
4419 }
4420 void HandleScript(SpellEffIndex /*effIndex*/)
4421 {
4422 int32 bp = GetEffectValue();
4423 Unit* target = GetHitUnit();
4425 args.AddSpellBP0(bp);
4426 target->CastSpell(target, SPELL_CANNON_BLAST_DAMAGE, args);
4427 }
4428
4429 void Register() override
4430 {
4432 }
4433};
4434
4435// 37751 - Submerged
4437{
4439 {
4440 if (Creature* target = GetHitCreature())
4441 target->SetStandState(UNIT_STAND_STATE_SUBMERGED);
4442 }
4443
4444 void Register() override
4445 {
4447 }
4448};
4449
4450// 169869 - Transformation Sickness
4452{
4453 void HandleScript(SpellEffIndex /*effIndex*/)
4454 {
4455 if (Unit* target = GetHitUnit())
4456 target->SetHealth(target->CountPctFromMaxHealth(25));
4457 }
4458
4459 void Register() override
4460 {
4462 }
4463};
4464
4465// 189491 - Summon Towering Infernal.
4467{
4468 void HandleDummy(SpellEffIndex /* effIndex */)
4469 {
4471 }
4472
4473 void Register() override
4474 {
4476 }
4477};
4478
4480{
4484
4486{
4487 public:
4488 bool operator()(WorldObject* target) const
4489 {
4490 if (Unit* unit = target->ToUnit())
4491 return unit->GetPowerType() != POWER_MANA;
4492 return false;
4493 }
4494};
4495
4497{
4498 void FilterTargets(std::list<WorldObject*>& targets)
4499 {
4500 targets.remove_if(MarkTargetHellfireFilter());
4501 }
4502
4503 void Register() override
4504 {
4506 }
4507};
4508
4510{
4511 bool Validate(SpellInfo const* /*spell*/) override
4512 {
4514 }
4515
4516 void OnPeriodic(AuraEffect const* aurEff)
4517 {
4518 Unit* target = GetTarget();
4519
4520 if (target->GetPower(POWER_MANA) == 0)
4521 {
4522 target->CastSpell(target, SPELL_MARK_OF_KAZROGAL_DAMAGE_HELLFIRE, aurEff);
4523 // Remove aura
4524 SetDuration(0);
4525 }
4526 }
4527
4528 void Register() override
4529 {
4531 }
4532};
4533
4535{
4536 void HandleDummy(SpellEffIndex /* effIndex */)
4537 {
4539 }
4540
4541 void Register() override
4542 {
4544 }
4545};
4546
4548{
4550 SPELL_IMPATIENT_MIND = 187213
4552
4553// 99947 - Face Rage
4555{
4556 bool Validate(SpellInfo const* spellInfo) override
4557 {
4559 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } });
4560 }
4561
4562 void OnRemove(AuraEffect const* /*effect*/, AuraEffectHandleModes /*mode*/)
4563 {
4565 }
4566
4567 void Register() override
4568 {
4570 }
4571};
4572
4573// 187213 - Impatient Mind
4575{
4576 bool Validate(SpellInfo const* /*spell*/) override
4577 {
4579 }
4580
4581 void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
4582 {
4584 }
4585
4586 void Register() override
4587 {
4589 }
4590};
4591
4592// 209352 - Boost 2.0 [Paladin+Priest] - Watch for Shield
4594{
4595 static constexpr uint32 SPELL_POWER_WORD_SHIELD = 17;
4596 static constexpr uint32 SPELL_DIVINE_SHIELD = 642;
4597
4598 bool Validate(SpellInfo const* /*spellInfo*/) override
4599 {
4601 }
4602
4603 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo& procInfo)
4604 {
4605 SpellInfo const* spellInfo = procInfo.GetSpellInfo();
4606 return spellInfo && (spellInfo->Id == SPELL_POWER_WORD_SHIELD || spellInfo->Id == SPELL_DIVINE_SHIELD);
4607 }
4608
4609 void Register() override
4610 {
4612 }
4613};
4614
4615// 269083 - Enlisted
4616// 282559 - Enlisted
4618{
4619 void CalcWarModeBonus(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
4620 {
4621 Player* target = GetUnitOwner()->ToPlayer();
4622 if (!target)
4623 return;
4624
4625 switch (target->GetTeamId())
4626 {
4627 case TEAM_ALLIANCE:
4628 amount = sWorldStateMgr->GetValue(WS_WAR_MODE_ALLIANCE_BUFF_VALUE, target->GetMap());
4629 break;
4630 case TEAM_HORDE:
4631 amount = sWorldStateMgr->GetValue(WS_WAR_MODE_HORDE_BUFF_VALUE, target->GetMap());
4632 break;
4633 default:
4634 break;
4635 }
4636 }
4637
4638 void Register() override
4639 {
4640 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(m_scriptSpellId, DIFFICULTY_NONE);
4641
4642 if (spellInfo->HasAura(SPELL_AURA_MOD_XP_PCT))
4644
4645 if (spellInfo->HasAura(SPELL_AURA_MOD_XP_QUEST_PCT))
4647
4650
4651 if (spellInfo->HasAura(SPELL_AURA_MOD_MONEY_GAIN))
4653
4654 if (spellInfo->HasAura(SPELL_AURA_MOD_ANIMA_GAIN))
4656
4657 if (spellInfo->HasAura(SPELL_AURA_DUMMY))
4659 }
4660};
4661
4663{
4666
4669
4670 NPC_NAZGRIM = 161706,
4674};
4675
4677{
4678 BindLocation(uint32 mapId, float x, float y, float z, float o, uint32 areaId)
4679 : Loc(mapId, x, y, z, o), AreaId(areaId) { }
4682};
4683
4684BindLocation const StormwindInnLoc(0, -8868.1f, 675.82f, 97.9f, 5.164778709411621093f, 5148);
4685BindLocation const OrgrimmarInnLoc(1, 1573.18f, -4441.62f, 16.06f, 1.818284034729003906f, 8618);
4686
4688{
4689 bool Validate(SpellInfo const* /*spell*/) override
4690 {
4691 return ValidateSpellInfo(
4692 {
4695 });
4696 }
4697
4698 void HandleDummy(SpellEffIndex /*effIndex*/)
4699 {
4700 Player* player = GetHitUnit()->ToPlayer();
4701 if (!player)
4702 return;
4703
4705 return;
4706
4707 BindLocation bindLoc = player->GetTeam() == ALLIANCE ? StormwindInnLoc : OrgrimmarInnLoc;
4708 player->SetHomebind(bindLoc.Loc, bindLoc.AreaId);
4709 player->SendBindPointUpdate();
4710 player->SendPlayerBound(player->GetGUID(), bindLoc.AreaId);
4711
4713 }
4714
4715 void Register() override
4716 {
4718 }
4719};
4720
4722{
4723 void HandleDummy(SpellEffIndex /*effIndex*/)
4724 {
4725 if (!GetCaster())
4726 return;
4727
4728 Player* player = GetCaster()->ToPlayer();
4729 if (!player)
4730 return;
4731
4732 if (Creature* nazgrim = GetHitUnit()->FindNearestCreature(NPC_NAZGRIM, 10.0f))
4733 nazgrim->HandleEmoteCommand(EMOTE_ONESHOT_POINT, player);
4734 if (Creature* trollbane = GetHitUnit()->FindNearestCreature(NPC_TROLLBANE, 10.0f))
4735 trollbane->HandleEmoteCommand(EMOTE_ONESHOT_POINT, player);
4736 if (Creature* whitemane = GetHitUnit()->FindNearestCreature(NPC_WHITEMANE, 10.0f))
4737 whitemane->HandleEmoteCommand(EMOTE_ONESHOT_POINT, player);
4738
4739 // @TODO: spawntracking - show death gate for casting player
4740 }
4741
4742 void Register() override
4743 {
4745 }
4746};
4747
4748// 118301 - Summon Battle Pet
4750{
4752 {
4753 uint32 creatureId = uint32(GetSpellValue()->EffectBasePoints[effIndex]);
4754 if (sObjectMgr->GetCreatureTemplate(creatureId))
4755 {
4756 PreventHitDefaultEffect(effIndex);
4757
4758 Unit* caster = GetCaster();
4759 SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetEffectInfo().MiscValueB));
4760 Milliseconds duration = Milliseconds(GetSpellInfo()->CalcDuration(caster));
4761 Position pos = GetHitDest()->GetPosition();
4762
4763 if (Creature* summon = caster->GetMap()->SummonCreature(creatureId, pos, properties, duration, caster, GetSpellInfo()->Id))
4764 summon->SetImmuneToAll(true);
4765 }
4766 }
4767
4768 void Register() override
4769 {
4771 }
4772};
4773
4774// 132334 - Trainer Heal Cooldown (SERVERSIDE)
4776{
4777 bool Validate(SpellInfo const* /*spellInfo*/) override
4778 {
4780 }
4781
4782 bool Load() override
4783 {
4784 return GetUnitOwner()->IsPlayer();
4785 }
4786
4788 {
4789 Player* target = GetUnitOwner()->ToPlayer();
4790 SpellInfo const* reviveBattlePetSpellInfo = sSpellMgr->AssertSpellInfo(BattlePets::SPELL_REVIVE_BATTLE_PETS, DIFFICULTY_NONE);
4791
4793 {
4794 Milliseconds expectedCooldown = Milliseconds(GetAura()->GetMaxDuration());
4795 SpellHistory::Duration remainingCooldown = target->GetSpellHistory()->GetRemainingCategoryCooldown(reviveBattlePetSpellInfo);
4796 if (remainingCooldown > SpellHistory::Duration::zero())
4797 {
4798 if (remainingCooldown < expectedCooldown)
4799 target->GetSpellHistory()->ModifyCooldown(reviveBattlePetSpellInfo, expectedCooldown - remainingCooldown);
4800 }
4801 else
4802 {
4803 target->GetSpellHistory()->StartCooldown(reviveBattlePetSpellInfo, 0, nullptr, false, expectedCooldown);
4804 }
4805 }
4806 }
4807
4808 void Register() override
4809 {
4811 }
4812};
4813
4814// 45313 - Anchor Here
4816{
4817 void HandleScript(SpellEffIndex /*effIndex*/)
4818 {
4819 if (Creature* creature = GetHitCreature())
4820 creature->SetHomePosition(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation());
4821 }
4822
4823 void Register() override
4824 {
4826 }
4827};
4828
4829// 147066 - (Serverside/Non-DB2) Generic - Mount Check Aura
4831{
4832 void OnPeriodic(AuraEffect const* /*aurEff*/)
4833 {
4834 Unit* target = GetTarget();
4835 uint32 mountDisplayId = 0;
4836
4837 TempSummon* tempSummon = target->ToTempSummon();
4838 if (!tempSummon)
4839 return;
4840
4841 Player const* summoner = Object::ToPlayer(tempSummon->GetSummoner());
4842 if (!summoner)
4843 return;
4844
4845 if (summoner->IsMounted() && (!summoner->IsInCombat() || summoner->IsFlying()))
4846 {
4847 if (CreatureSummonedData const* summonedData = sObjectMgr->GetCreatureSummonedData(tempSummon->GetEntry()))
4848 {
4849 if (summoner->IsFlying() && summonedData->FlyingMountDisplayID)
4850 mountDisplayId = *summonedData->FlyingMountDisplayID;
4851 else if (summonedData->GroundMountDisplayID)
4852 mountDisplayId = *summonedData->GroundMountDisplayID;
4853 }
4854 }
4855
4856 if (mountDisplayId != target->GetMountDisplayId())
4857 target->SetMountDisplayId(mountDisplayId);
4858 }
4859
4860 void Register() override
4861 {
4863 }
4864};
4865
4867{
4873
4874// 274738 - Ancestral Call (Mag'har Orc Racial)
4876{
4877 bool Validate(SpellInfo const* /*spell*/) override
4878 {
4879 return ValidateSpellInfo(
4880 {
4885 });
4886 }
4887
4889
4891 {
4892 Unit* caster = GetCaster();
4894
4895 caster->CastSpell(caster, spellId, true);
4896 }
4897
4898 void Register() override
4899 {
4901 }
4902};
4903
4904// 83477 - Eject Passengers 3-8
4906{
4908 {
4909 Vehicle* vehicle = GetHitUnit()->GetVehicleKit();
4910 if (!vehicle)
4911 return;
4912
4913 for (uint8 i = 2; i < 8; i++)
4914 {
4915 if (Unit* passenger = vehicle->GetPassenger(i))
4916 passenger->ExitVehicle();
4917 }
4918 }
4919
4920 void Register() override
4921 {
4923 }
4924};
4925
4926// 83781 - Reverse Cast Ride Vehicle
4928{
4930 {
4931 GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->GetEffect(effIndex).CalcValue(), true);
4932 }
4933
4934 void Register() override
4935 {
4937 }
4938};
4939
4940// Note: this spell unsummons any creature owned by the caster. Set appropriate target conditions on the DB.
4941// 84065 - Despawn All Summons
4942// 83935 - Despawn All Summons
4943// 160938 - Despawn All Summons (Garrison Intro Only)
4945{
4947 {
4948 if (Unit* caster = GetCaster())
4949 {
4950 Creature* target = GetHitCreature();
4951
4952 if (target->GetOwner() == caster)
4953 target->DespawnOrUnsummon();
4954 }
4955 }
4956
4957 void Register() override
4958 {
4960 }
4961};
4962
4964{
4977
4978// 8613 - Skinning
4980{
4981 bool Validate(SpellInfo const* /*spell*/) override
4982 {
4983 return ValidateSpellInfo(
4984 {
4994 });
4995 }
4996
4998 {
4999 Player* player = GetCaster()->ToPlayer();
5000 if (!player)
5001 return;
5002
5003 ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(GetHitUnit()->GetContentTuning());
5004 if (!contentTuning)
5005 return;
5006
5007 uint32 skinningSkill = player->GetProfessionSkillForExp(SKILL_SKINNING, contentTuning->ExpansionID);
5008 if (!skinningSkill)
5009 return;
5010
5011 // Autolearning missing skinning skill (Dragonflight)
5012 auto getSkinningLearningSpellBySkill = [&]() -> uint32
5013 {
5014 switch (skinningSkill)
5015 {
5024 case SKILL_CLASSIC_SKINNING: // Trainer only
5025 case SKILL_LEGION_SKINNING: // Quest only
5026 default: break;
5027 }
5028
5029 return 0;
5030 };
5031
5032 if (!player->HasSkill(skinningSkill))
5033 if (uint32 spellId = getSkinningLearningSpellBySkill())
5034 player->CastSpell(nullptr, spellId, true);
5035 }
5036
5037 void Register() override
5038 {
5040 }
5041};
5042
5044{
5045 SPELL_SHAMAN_SATED = 57724, // Bloodlust
5046 SPELL_SHAMAN_EXHAUSTION = 57723, // Heroism, Drums
5050};
5051
5052// 2825 - Bloodlust
5053// 32182 - Heroism
5054// 80353 - Time Warp
5055// 264667 - Primal Rage
5056// 390386 - Fury of the Aspects
5057// 146555 - Drums of Rage
5058// 178207 - Drums of Fury
5059// 230935 - Drums of the Mountain
5060// 256740 - Drums of the Maelstrom
5061// 309658 - Drums of Deathly Ferocity
5062// 381301 - Feral Hide Drums
5064{
5065public:
5066 spell_gen_bloodlust(uint32 exhaustionSpellId) : _exhaustionSpellId(exhaustionSpellId) { }
5067
5068 bool Validate(SpellInfo const* /*spellInfo*/) override
5069 {
5070 return ValidateSpellInfo(
5071 {
5077 });
5078 }
5079
5080 void FilterTargets(std::list<WorldObject*>& targets)
5081 {
5082 targets.remove_if([](WorldObject* target) -> bool
5083 {
5084 Unit* unit = target->ToUnit();
5085 if (!unit)
5086 return true;
5087
5088 return unit->HasAura(SPELL_SHAMAN_SATED)
5093 });
5094 }
5095
5096 void HandleHit(SpellEffIndex /*effIndex*/)
5097 {
5098 Unit* target = GetHitUnit();
5099 target->CastSpell(target, _exhaustionSpellId, true);
5100 }
5101
5102 void Register() override
5103 {
5107 }
5108
5109private:
5111};
5112
5113// AoE resurrections by spirit guides
5114// 22012 - Spirit Heal
5116{
5117 void FilterTargets(std::list<WorldObject*>& targets)
5118 {
5119 Unit* caster = GetCaster();
5120 targets.remove_if([caster](WorldObject* target) -> bool
5121 {
5122 if (Player* playerTarget = target->ToPlayer())
5123 return !playerTarget->CanAcceptAreaSpiritHealFrom(caster);
5124
5125 return true;
5126 });
5127 }
5128
5129 void Register() override
5130 {
5132 }
5133};
5134
5135// Personal resurrections in battlegrounds
5136// 156758 - Spirit Heal
5138{
5139 static constexpr uint32 SPELL_SPIRIT_HEAL_EFFECT = 156763;
5140
5141 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
5142 {
5143 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
5144 return;
5145
5146 Player* targetPlayer = GetTarget()->ToPlayer();
5147 if (!targetPlayer)
5148 return;
5149
5150 Unit* caster = GetCaster();
5151 if (!caster)
5152 return;
5153
5154 if (targetPlayer->CanAcceptAreaSpiritHealFrom(caster))
5155 caster->CastSpell(targetPlayer, SPELL_SPIRIT_HEAL_EFFECT);
5156 }
5157
5158 void Register() override
5159 {
5161 }
5162};
5163
5165{
5166public:
5168
5169 bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) override
5170 {
5171 if (_caster->GetChannelSpellId() == 0)
5173
5174 return true;
5175 }
5176
5177private:
5179};
5180
5181// 22011 - Spirit Heal Channel
5183{
5184 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
5185 {
5186 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
5187 return;
5188
5189 Unit* target = GetTarget();
5191 }
5192
5193 void Register() override
5194 {
5196 }
5197};
5198
5199// 2584 - Waiting to Resurrect
5201{
5202 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
5203 {
5204 Player* targetPlayer = GetTarget()->ToPlayer();
5205 if (!targetPlayer)
5206 return;
5207
5208 targetPlayer->SetAreaSpiritHealer(nullptr);
5209 }
5210
5211 void Register() override
5212 {
5214 }
5215};
5216
5218{
5227 SPELL_EVOKER_REWIND = 363534
5229
5231{
5232float GetBonusMultiplier(Unit const* unit, uint32 spellId)
5233{
5234 // Note: if caster is not in a raid setting, is in PvP or while in arena combat with 5 or less allied players.
5235 if (!unit->GetMap()->IsRaid() || !unit->GetMap()->IsBattleground())
5236 {
5237 uint32 bonusSpellId = 0;
5238 SpellEffIndex effIndex = EFFECT_0;
5239 switch (spellId)
5240 {
5242 bonusSpellId = SPELL_DRUID_TRANQUILITY;
5243 effIndex = EFFECT_2;
5244 break;
5246 bonusSpellId = SPELL_PRIEST_DIVINE_HYMN;
5247 effIndex = EFFECT_1;
5248 break;
5250 bonusSpellId = spellId;
5251 effIndex = EFFECT_1;
5252 break;
5254 bonusSpellId = SPELL_SHAMAN_HEALING_TIDE_TOTEM;
5255 effIndex = EFFECT_2;
5256 break;
5257 case SPELL_MONK_REVIVAL:
5258 bonusSpellId = spellId;
5259 effIndex = EFFECT_4;
5260 break;
5262 bonusSpellId = spellId;
5263 effIndex = EFFECT_3;
5264 break;
5265 default:
5266 return 0.0f;
5267 }
5268
5269 if (AuraEffect* const healingIncreaseEffect = unit->GetAuraEffect(bonusSpellId, effIndex))
5270 return healingIncreaseEffect->GetAmount();
5271
5272 return sSpellMgr->AssertSpellInfo(bonusSpellId, DIFFICULTY_NONE)->GetEffect(effIndex).CalcValue(unit);
5273 }
5274
5275 return 0.0f;
5276}
5277}
5278
5279// 157982 - Tranquility (Heal)
5280// 64844 - Divine Hymn (Heal)
5281// 114942 - Healing Tide (Heal)
5282// 115310 - Revival (Heal)
5284{
5285 bool Validate(SpellInfo const* /*spellInfo*/) override
5286 {
5287 return ValidateSpellEffect
5288 ({
5293 });
5294 }
5295
5296 void CalculateHealingBonus(Unit* /*victim*/, int32& /*healing*/, int32& /*flatMod*/, float& pctMod) const
5297 {
5299 }
5300
5301 void Register() override
5302 {
5304 }
5305};
5306
5307// 157982 - Tranquility (Heal)
5308// 271466 - Luminous Barrier (Absorb)
5309// 363534 - Rewind (Heal)
5311{
5312 bool Validate(SpellInfo const* /*spellInfo*/) override
5313 {
5314 return ValidateSpellEffect
5315 ({
5319 });
5320 }
5321
5322 void CalculateHealingBonus(AuraEffect const* /*aurEff*/, Unit* /*victim*/, int32& /*damageOrHealing*/, int32& /*flatMod*/, float& pctMod) const
5323 {
5324 if (Unit const* caster = GetCaster())
5326 }
5327
5328 void Register() override
5329 {
5331 }
5332};
5333
5334// 50230 - Random Aggro (Taunt)
5336{
5337 bool Validate(SpellInfo const* spellInfo) override
5338 {
5339 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) && ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_0).BasePoints) });
5340 }
5341
5342 void SelectRandomTarget(std::list<WorldObject*>& targets)
5343 {
5344 if (targets.empty())
5345 return;
5346
5348 }
5349
5351 {
5352 GetHitUnit()->CastSpell(GetCaster(), static_cast<uint32>(GetSpellInfo()->GetEffect(effIndex).BasePoints), CastSpellExtraArgs(TRIGGERED_FULL_MASK));
5353 }
5354
5355 void Register() override
5356 {
5359 }
5360};
5361
5363{
5376 RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_break_shield");
5377 RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_tournament_counterattack");
5387 RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_default_count_pct_from_max_hp");
5388 RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_50pct_count_pct_from_max_hp", 50);
5390 RegisterSpellScriptWithArgs(spell_gen_dalaran_disguise, "spell_gen_sunreaver_disguise");
5391 RegisterSpellScriptWithArgs(spell_gen_dalaran_disguise, "spell_gen_silver_covenant_disguise");
5420 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pal_blessing_of_kings");
5421 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pal_blessing_of_might");
5422 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_dru_mark_of_the_wild");
5423 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pri_power_word_fortitude");
5424 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pri_shadow_protection");
5442 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_soul_harvesters_charm");
5443 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_commendation_of_kaelthas");
5444 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_corpse_tongue_coin");
5445 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_corpse_tongue_coin_heroic");
5446 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_petrified_twilight_scale");
5447 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_petrified_twilight_scale_heroic");
5458 // Running Wild
5462 /* */
5486 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_future_you_whisper_to_controller_random", WHISPER_FUTURE_YOU);
5487 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_wyrmrest_defender_whisper_to_controller_random", WHISPER_DEFENDER);
5488 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_past_you_whisper_to_controller_random", WHISPER_PAST_YOU);
5491 RegisterSpellScriptWithArgs(spell_gen_eject_passenger_with_seatId, "spell_gen_eject_passenger_1", 0);
5492 RegisterSpellScriptWithArgs(spell_gen_eject_passenger_with_seatId, "spell_gen_eject_passenger_3", 2);
5538}
@ SPELL_SPIRIT_HEAL_CHANNEL_AOE
Definition: Battleground.h:101
DB2Storage< SkillLineEntry > sSkillLineStore("SkillLine.db2", &SkillLineLoadInfo::Instance)
DB2Storage< SummonPropertiesEntry > sSummonPropertiesStore("SummonProperties.db2", &SummonPropertiesLoadInfo::Instance)
DB2Storage< BroadcastTextEntry > sBroadcastTextStore("BroadcastText.db2", &BroadcastTextLoadInfo::Instance)
DB2Storage< ChrRacesEntry > sChrRacesStore("ChrRaces.db2", &ChrRacesLoadInfo::Instance)
DB2Storage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore("CreatureDisplayInfo.db2", &CreatureDisplayInfoLoadInfo::Instance)
DB2Storage< ContentTuningEntry > sContentTuningStore("ContentTuning.db2", &ContentTuningLoadInfo::Instance)
DB2Storage< MountCapabilityEntry > sMountCapabilityStore("MountCapability.db2", &MountCapabilityLoadInfo::Instance)
DB2Storage< FactionEntry > sFactionStore("Faction.db2", &FactionLoadInfo::Instance)
#define sDB2Manager
Definition: DB2Stores.h:538
@ RacialForThePurposeOfTemporaryRaceChange
@ DIFFICULTY_NONE
Definition: DBCEnums.h:874
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint64_t uint64
Definition: Define.h:141
uint16_t uint16
Definition: Define.h:143
uint32_t uint32
Definition: Define.h:142
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:29
@ ITEM_CLASS_WEAPON
Definition: ItemTemplate.h:422
@ ITEM_SUBCLASS_WEAPON_FISHING_POLE
Definition: ItemTemplate.h:500
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:165
@ TYPEID_UNIT
Definition: ObjectGuid.h:40
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
#define sObjectMgr
Definition: ObjectMgr.h:1946
PetType
Definition: PetDefines.h:30
@ SUMMON_PET
Definition: PetDefines.h:31
@ HUNTER_PET
Definition: PetDefines.h:32
@ PET_SAVE_NOT_IN_SLOT
Definition: PetDefines.h:48
@ PET_SAVE_AS_CURRENT
Definition: PetDefines.h:43
@ EQUIPMENT_SLOT_MAINHAND
Definition: Player.h:646
@ EQUIPMENT_SLOT_OFFHAND
Definition: Player.h:647
#define INVENTORY_SLOT_BAG_0
Definition: Player.h:625
@ QUEST_STATUS_NONE
Definition: QuestDef.h:142
Races
Definition: RaceMask.h:26
@ RACE_DARK_IRON_DWARF
Definition: RaceMask.h:61
@ RACE_TROLL
Definition: RaceMask.h:35
@ RACE_UNDEAD_PLAYER
Definition: RaceMask.h:32
@ RACE_PANDAREN_NEUTRAL
Definition: RaceMask.h:51
@ RACE_ORC
Definition: RaceMask.h:29
@ RACE_LIGHTFORGED_DRAENEI
Definition: RaceMask.h:57
@ RACE_NONE
Definition: RaceMask.h:27
@ RACE_DRAENEI
Definition: RaceMask.h:38
@ RACE_NIGHTBORNE
Definition: RaceMask.h:54
@ RACE_HIGHMOUNTAIN_TAUREN
Definition: RaceMask.h:55
@ RACE_ZANDALARI_TROLL
Definition: RaceMask.h:58
@ RACE_VOID_ELF
Definition: RaceMask.h:56
@ RACE_NIGHTELF
Definition: RaceMask.h:31
@ RACE_BLOODELF
Definition: RaceMask.h:37
@ RACE_DWARF
Definition: RaceMask.h:30
@ RACE_GNOME
Definition: RaceMask.h:34
@ RACE_GOBLIN
Definition: RaceMask.h:36
@ RACE_KUL_TIRAN
Definition: RaceMask.h:59
@ RACE_HUMAN
Definition: RaceMask.h:28
@ RACE_WORGEN
Definition: RaceMask.h:49
@ RACE_PANDAREN_ALLIANCE
Definition: RaceMask.h:52
@ RACE_VULPERA
Definition: RaceMask.h:62
@ RACE_MECHAGNOME
Definition: RaceMask.h:64
@ RACE_MAGHAR_ORC
Definition: RaceMask.h:63
@ RACE_PANDAREN_HORDE
Definition: RaceMask.h:53
@ RACE_TAUREN
Definition: RaceMask.h:33
int32 irand(int32 min, int32 max)
Definition: Random.cpp:35
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
bool roll_chance_f(float chance)
Definition: Random.h:53
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
#define RegisterSpellScriptWithArgs(spell_script, script_name,...)
Definition: ScriptMgr.h:1368
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_3
Definition: SharedDefines.h:33
@ EFFECT_1
Definition: SharedDefines.h:31
@ EFFECT_0
Definition: SharedDefines.h:30
@ EFFECT_4
Definition: SharedDefines.h:34
@ EFFECT_2
Definition: SharedDefines.h:32
#define EFFECT_FIRST_FOUND
Definition: SharedDefines.h:71
Classes
@ CLASS_HUNTER
@ CLASS_WARLOCK
@ GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING
Gender
@ GENDER_FEMALE
@ TARGET_UNIT_DEST_AREA_ALLY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ TARGET_UNIT_CASTER_AREA_RAID
@ TARGET_DEST_CASTER
Emote
@ EMOTE_ONESHOT_POINT
@ EMOTE_ONESHOT_EXCLAMATION
@ EMOTE_ONESHOT_APPLAUD
@ EMOTE_ONESHOT_CHEER
@ EMOTE_STATE_NONE
SpellSchools GetFirstSchoolInMask(SpellSchoolMask mask)
@ TEAM_ALLIANCE
@ TEAM_HORDE
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_SUMMON
@ SPELL_EFFECT_CHARGE
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ SPELL_EFFECT_GAMEOBJECT_DAMAGE
@ SPELL_EFFECT_SKINNING
@ SPELL_EFFECT_APPLY_AURA
@ SPELL_CUSTOM_ERROR_NOTHING_TO_DISCOVER
@ SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED
@ SPELL_CUSTOM_ERROR_CANT_TRANSFORM
@ ALLIANCE
@ HORDE
@ POWER_MANA
@ GOLD
SpellCastResult
@ SPELL_FAILED_CUSTOM_ERROR
@ SPELL_FAILED_DONT_REPORT
@ SPELL_FAILED_TARGET_AURASTATE
@ SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW
@ SPELL_CAST_OK
@ SPELL_FAILED_NO_EDIBLE_CORPSES
@ FACTION_FRIENDLY
#define EFFECT_ALL
Definition: SharedDefines.h:72
@ SPELLFAMILY_MAGE
AreaId
@ SPELL_SCHOOL_SHADOW
@ SPELL_SCHOOL_NORMAL
@ SPELL_SCHOOL_NATURE
@ SPELL_SCHOOL_FROST
@ SPELL_SCHOOL_ARCANE
@ SPELL_SCHOOL_FIRE
@ SPELL_SCHOOL_HOLY
@ WS_WAR_MODE_HORDE_BUFF_VALUE
@ WS_WAR_MODE_ALLIANCE_BUFF_VALUE
@ SKILL_DRAGON_ISLES_SKINNING
@ SKILL_CATACLYSM_SKINNING
@ SKILL_KUL_TIRAN_SKINNING
@ SKILL_PANDARIA_SKINNING
@ SKILL_DRAENOR_SKINNING
@ SKILL_CLASSIC_SKINNING
@ SKILL_OUTLAND_SKINNING
@ SKILL_LEGION_SKINNING
@ SKILL_SKINNING
@ SKILL_SHADOWLANDS_SKINNING
@ SKILL_NORTHREND_SKINNING
uint32 GetExplicitDiscoverySpell(uint32 spellId, Player *player)
bool HasDiscoveredAllSpells(uint32 spellId, Player *player)
bool HasDiscoveredAnySpell(uint32 spellId, Player *player)
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_BY_EXPIRE
@ AURA_REMOVE_BY_ENEMY_SPELL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_MOD_SHAPESHIFT
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_MOD_POWER_REGEN
@ SPELL_AURA_WORGEN_ALTERED_FORM
@ SPELL_AURA_MOD_XP_PCT
@ SPELL_AURA_MOD_XP_QUEST_PCT
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
@ SPELL_AURA_DUMMY
@ SPELL_AURA_FLY
@ SPELL_AURA_MOD_HEALING_PCT
@ SPELL_AURA_MOD_MANA_REGEN_INTERRUPT
@ SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
@ SPELL_AURA_MOUNTED
@ SPELL_AURA_MOD_ANIMA_GAIN
@ SPELL_AURA_MOD_MONEY_GAIN
@ SPELL_AURA_MOD_DECREASE_SPEED
@ SPELL_AURA_TRANSFORM
@ SPELL_AURA_PERIODIC_ENERGIZE
@ SPELL_AURA_POWER_BURN
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_AURA_MOD_CURRENCY_GAIN_FROM_SOURCE
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT
@ SPELL_AURA_MOD_STUN
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:266
@ SPELLVALUE_BASE_POINT0
Definition: SpellDefines.h:196
@ SPELL_COOLDOWN_FLAG_NONE
Definition: SpellHistory.h:39
@ TARGET_CHECK_ENEMY
Definition: SpellInfo.h:84
@ TARGET_OBJECT_TYPE_CORPSE_ENEMY
Definition: SpellInfo.h:76
#define sSpellMgr
Definition: SpellMgr.h:849
#define AuraProcFn(F)
Definition: SpellScript.h:2150
#define SpellCheckCastFn(F)
Definition: SpellScript.h:830
#define AuraEffectProcFn(F, I, N)
Definition: SpellScript.h:2160
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define AuraEffectCalcAmountFn(F, I, N)
Definition: SpellScript.h:2058
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
#define AuraCheckEffectProcFn(F, I, N)
Definition: SpellScript.h:2136
#define AuraEffectUpdatePeriodicFn(F, I, N)
Definition: SpellScript.h:2052
#define AuraEffectCalcHealingFn(F, I, N)
Definition: SpellScript.h:2084
#define SpellCalcDamageFn(F)
Definition: SpellScript.h:879
#define SpellCastFn(F)
Definition: SpellScript.h:825
#define SpellDestinationTargetSelectFn(F, I, N)
Definition: SpellScript.h:874
#define AuraEffectAbsorbFn(F, I)
Definition: SpellScript.h:2090
#define SPELL_EFFECT_ANY
Definition: SpellScript.h:58
#define AuraEffectCalcPeriodicFn(F, I, N)
Definition: SpellScript.h:2064
#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 SPELL_AURA_ANY
Definition: SpellScript.h:59
#define SpellCalcHealingFn(F)
Definition: SpellScript.h:884
#define AuraCheckAreaTargetFn(F)
Definition: SpellScript.h:2008
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:2040
@ MOVE_RUN
Definition: UnitDefines.h:118
@ UNIT_FLAG2_FEIGN_DEATH
Definition: UnitDefines.h:194
@ REACT_PASSIVE
Definition: UnitDefines.h:506
@ UNIT_STAND_STATE_SUBMERGED
Definition: UnitDefines.h:51
@ UNIT_STAND_STATE_STAND
Definition: UnitDefines.h:42
@ UNIT_FLAG3_FAKE_DEAD
Definition: UnitDefines.h:259
@ UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
Definition: UnitDefines.h:173
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:145
@ ALIVE
Definition: Unit.h:246
@ JUST_RESPAWNED
Definition: Unit.h:250
#define DISPLAYID_HIDDEN_MOUNT
Definition: Unit.h:39
T AddPct(T &base, U pct)
Definition: Util.h:85
T CalculatePct(T base, U pct)
Definition: Util.h:72
#define sWorldStateMgr
Definition: WorldStateMgr.h:50
uint32 GetTickNumber() const
SpellEffIndex GetEffIndex() const
SpellEffectInfo const & GetSpellEffectInfo() const
void ChangeAmount(int32 newAmount, bool mark=true, bool onStackOrReapply=false, AuraEffect const *triggeredBy=nullptr)
void SetPeriodic(bool isPeriodic)
uint32 GetTotalTicks() const
int32 GetAmount() const
HookList< EffectCalcDamageAndHealingHandler > DoEffectCalcDamageAndHealing
Definition: SpellScript.h:2082
void PreventDefaultAction()
void SetMaxDuration(int32 duration)
HookList< EffectCalcPeriodicHandler > DoEffectCalcPeriodic
Definition: SpellScript.h:2063
AuraApplication const * GetTargetApplication() const
int32 GetDuration() const
HookList< EffectApplyHandler > AfterEffectRemove
Definition: SpellScript.h:2039
HookList< CheckEffectProcHandler > DoCheckEffectProc
Definition: SpellScript.h:2135
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2045
SpellInfo const * GetSpellInfo() const
HookList< EffectApplyHandler > AfterEffectApply
Definition: SpellScript.h:2028
int32 GetMaxDuration() const
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Definition: SpellScript.h:2057
Unit * GetCaster() const
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
Definition: SpellScript.h:2051
void SetDuration(int32 duration, bool withMods=false)
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
HookList< EffectAbsorbHandler > OnEffectAbsorb
Definition: SpellScript.h:2089
Aura * GetAura() const
HookList< CheckAreaTargetHandler > DoCheckAreaTarget
Definition: SpellScript.h:2007
Unit * GetTarget() const
ObjectGuid GetCasterGUID() const
HookList< CheckProcHandler > DoCheckProc
Definition: SpellScript.h:2129
HookList< EffectApplyHandler > OnEffectRemove
Definition: SpellScript.h:2035
void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
HookList< EffectProcHandler > OnEffectProc
Definition: SpellScript.h:2155
Unit * GetUnitOwner() const
HookList< AuraProcHandler > OnProc
Definition: SpellScript.h:2145
uint8 GetStackAmount() const
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:2024
uint32 GetId() const
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
AuraEffect * GetEffect(uint32 index) const
Definition: SpellAuras.cpp:529
uint8 GetStackAmount() const
Definition: SpellAuras.h:189
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
bool operator()(Unit *u) const
CorruptingPlagueSearcher(Unit *obj, float distance)
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Definition: Creature.cpp:2415
uint32 GetDamage() const
Definition: Unit.h:446
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
ObjectGuid GetOwnerGUID() const override
Definition: GameObject.h:242
Definition: Unit.h:456
Definition: Item.h:170
ItemTemplate const * GetTemplate() const
Definition: Item.cpp:1141
Definition: Map.h:189
bool IsDungeon() const
Definition: Map.cpp:3238
ZLiquidStatus GetLiquidStatus(PhaseShift const &phaseShift, float x, float y, float z, Optional< map_liquidHeaderTypeFlags > ReqLiquidType={}, LiquidData *data=nullptr, float collisionHeight=2.03128f)
Definition: Map.cpp:1726
bool IsBattleground() const
Definition: Map.cpp:3330
bool IsRaid() const
Definition: Map.cpp:3248
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, Milliseconds duration=0ms, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty, SmoothPhasingInfo const *smoothPhasingInfo=nullptr)
Definition: Object.cpp:1836
uint32 GetId() const
Definition: Map.cpp:3228
bool IsHeroic() const
Definition: Map.cpp:3282
bool operator()(WorldObject *target) const
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
bool IsPlayer() const
Definition: ObjectGuid.h:326
static Creature * ToCreature(Object *o)
Definition: Object.h:219
bool IsPlayer() const
Definition: Object.h:212
static Unit * ToUnit(Object *o)
Definition: Object.h:225
Player * ToPlayer()
Definition: Object.h:215
TypeID GetTypeId() const
Definition: Object.h:173
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
void SetEntry(uint32 entry)
Definition: Object.h:162
static Player * ToPlayer(Object *o)
Definition: Object.h:213
Definition: Pet.h:40
bool LoadPetFromDB(Player *owner, uint32 petEntry, uint32 petnumber, bool current, Optional< PetSaveMode > forcedSlot={})
Definition: Pet.cpp:205
void setDeathState(DeathState s) override
Definition: Pet.cpp:599
void LearnSpell(uint32 spell_id, bool dependent, int32 fromSkill=0, bool suppressMessaging=false, Optional< int32 > traitDefinitionId={})
Definition: Player.cpp:3216
void SendPlayerBound(ObjectGuid const &binderGuid, uint32 areaId) const
Definition: Player.cpp:17607
void SendBindPointUpdate() const
Definition: Player.cpp:17598
void SendDirectMessage(WorldPacket const *data) const
Definition: Player.cpp:6324
bool HasAchieved(uint32 achievementId) const
Definition: Player.cpp:26751
WorldSession * GetSession() const
Definition: Player.h:2101
Item * GetItemByPos(uint16 pos) const
Definition: Player.cpp:9582
bool HasSkill(uint32 skill) const
Definition: Player.cpp:6031
TeamId GetTeamId() const
Definition: Player.h:2236
bool CanAcceptAreaSpiritHealFrom(Unit *spiritHealer) const
Definition: Player.h:2868
uint32 GetLastPetNumber() const
Definition: Player.h:2596
uint32 GetProfessionSkillForExp(uint32 skill, int32 expansion) const
Definition: Player.cpp:6005
void RemoveSpell(uint32 spell_id, bool disabled=false, bool learn_low_rank=true, bool suppressMessaging=false)
Definition: Player.cpp:3260
float GetAverageItemLevel() const
Definition: Player.cpp:29020
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: Player.cpp:16050
void SetAreaSpiritHealer(Creature *creature)
Definition: Player.cpp:30130
void SetHomebind(WorldLocation const &loc, uint32 areaId)
Definition: Player.cpp:17581
Team GetEffectiveTeam() const
Definition: Player.h:2239
ReputationMgr & GetReputationMgr()
Definition: Player.h:2251
Team GetTeam() const
Definition: Player.h:2235
void LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue, Races race)
Definition: Player.cpp:24694
SpellSchoolMask GetSchoolMask() const
Definition: Unit.cpp:291
Unit * GetActionTarget() const
Definition: Unit.h:494
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
RecastSpiritHealChannelEvent(Unit *caster)
bool Execute(uint64, uint32) override
bool operator()(WorldObject *obj) const
int32 GetReputation(uint32 faction_id) const
bool SetReputation(FactionEntry const *factionEntry, int32 standing)
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
uint32 TriggerSpell
Definition: SpellInfo.h:237
bool IsAura() const
Definition: SpellInfo.cpp:461
bool IsEffect() const
Definition: SpellInfo.cpp:451
Duration GetRemainingCategoryCooldown(uint32 categoryId) const
void ResetCooldown(uint32 spellId, bool update=false)
void ModifyCooldown(uint32 spellId, Duration cooldownMod, bool withoutCategoryCooldown=false)
Milliseconds Duration
Definition: SpellHistory.h:50
void StartCooldown(SpellInfo const *spellInfo, uint32 itemId, Spell *spell=nullptr, bool onHold=false, Optional< Duration > forcedCooldown={})
uint32 ExcludeTargetAuraSpell
Definition: SpellInfo.h:360
float GetMaxRange(bool positive=false, WorldObject *caster=nullptr, Spell *spell=nullptr) const
Definition: SpellInfo.cpp:3768
bool HasEffect(SpellEffectName effect) const
Definition: SpellInfo.cpp:1391
uint32 const Id
Definition: SpellInfo.h:325
bool IsPassive() const
Definition: SpellInfo.cpp:1592
uint32 StackAmount
Definition: SpellInfo.h:390
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition: SpellInfo.h:577
std::vector< SpellEffectInfo > const & GetEffects() const
Definition: SpellInfo.h:576
bool IsPositive() const
Definition: SpellInfo.cpp:1709
uint32 ExcludeCasterAuraSpell
Definition: SpellInfo.h:359
bool HasAura(AuraType aura) const
Definition: SpellInfo.cpp:1400
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< DamageAndHealingCalcHandler > CalcDamage
Definition: SpellScript.h:878
HookList< CastHandler > AfterCast
Definition: SpellScript.h:824
WorldLocation * GetHitDest() const
HookList< CheckCastHandler > OnCheckCast
Definition: SpellScript.h:829
Creature * GetHitCreature() const
Player * GetHitPlayer() const
int32 GetHitDamage() const
Unit * GetCaster() const
HookList< HitHandler > AfterHit
Definition: SpellScript.h:852
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
Definition: SpellScript.h:873
void CreateItem(uint32 itemId, ItemContext context)
HookList< HitHandler > OnHit
Definition: SpellScript.h:850
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:839
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
SpellValue const * GetSpellValue() const
int32 GetEffectValue() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
Item * GetCastItem() const
HookList< CastHandler > OnCast
Definition: SpellScript.h:822
Aura * GetHitAura(bool dynObjAura=false) const
void SetCustomCastResultMessage(SpellCustomErrors result)
Difficulty GetCastDifficulty() const
void SetHitDamage(int32 damage)
HookList< DamageAndHealingCalcHandler > CalcHealing
Definition: SpellScript.h:883
GameObject * GetGObjCaster() const
Unit * GetExplTargetUnit() const
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
Unit * GetOriginalCaster() const
GameObject * GetHitGObj() const
StasisFieldSearcher(Unit *obj, float distance)
bool operator()(Unit *u) const
WorldObject * GetSummoner() const
void ModifyThreatByPercent(Unit *target, int32 percent)
Binary predicate for sorting Units based on percent value of a power.
Definition: Unit.h:627
uint32 GetChannelSpellId() const
Definition: Unit.h:1402
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition: Unit.cpp:8280
void SetImmuneToAll(bool apply, bool keepCombat)
Definition: Unit.cpp:8088
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3608
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3812
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1321
void SetVirtualItem(uint32 slot, uint32 itemId, uint16 appearanceModId=0, uint16 itemVisual=0)
Definition: Unit.cpp:13604
void SetUnitFlag3(UnitFlags3 flags)
Definition: Unit.h:843
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3685
void SetFullHealth()
Definition: Unit.h:790
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
Definition: Unit.cpp:10100
void EnergizeBySpell(Unit *victim, SpellInfo const *spellInfo, int32 damage, Powers powerType)
Definition: Unit.cpp:6613
ThreatManager & GetThreatManager()
Definition: Unit.h:1063
uint8 GetClass() const
Definition: Unit.h:752
uint32 GetMountDisplayId() const
Definition: Unit.h:899
float GetCollisionHeight() const override
Definition: Unit.cpp:13733
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition: Unit.h:637
Unit * GetCharmer() const
Definition: Unit.h:1188
std::forward_list< AuraEffect * > AuraEffectList
Definition: Unit.h:644
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
Powers GetPowerType() const
Definition: Unit.h:799
void Dismount()
Definition: Unit.cpp:7920
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:11618
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition: Unit.cpp:4464
void SetUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:838
int32 GetMaxPower(Powers power) const
Definition: Unit.cpp:9410
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
Definition: Unit.cpp:6591
void RemoveAllAurasOnDeath()
Definition: Unit.cpp:4333
TempSummon * ToTempSummon()
Definition: Unit.h:1756
void RemoveUnitFlag3(UnitFlags3 flags)
Definition: Unit.h:844
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition: Unit.cpp:12725
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition: Unit.cpp:7887
bool IsCharmedOwnedByPlayerOrPlayer() const
Definition: Unit.h:1196
virtual Gender GetNativeGender() const
Definition: Unit.h:757
uint32 GetVirtualItemId(uint32 slot) const
Definition: Unit.cpp:13588
uint64 GetMaxHealth() const
Definition: Unit.h:777
uint16 GetMaxSkillValueForLevel(Unit const *target=nullptr) const
Definition: Unit.h:917
void RemoveUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:839
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4674
void GetAllMinionsByEntry(std::list< TempSummon * > &Minions, uint32 entry)
Definition: Unit.cpp:6235
void SetFullPower(Powers power)
Definition: Unit.h:812
bool IsMounted() const
Definition: Unit.h:898
float GetSpeedRate(UnitMoveType mtype) const
Definition: Unit.h:1644
int32 GetPower(Powers power) const
Definition: Unit.cpp:9401
uint64 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:785
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition: Unit.cpp:8525
DeathState getDeathState() const
Definition: Unit.h:1167
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 HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
Definition: Unit.cpp:1598
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:781
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:833
bool IsFlying() const
Definition: Unit.h:1735
AuraApplicationMap & GetAppliedAuras()
Definition: Unit.h:1274
void RemoveMovementImpairingAuras(bool withRoot)
Definition: Unit.cpp:4154
Vehicle * GetVehicleKit() const
Definition: Unit.h:1711
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
uint8 GetLevel() const
Definition: Unit.h:746
void SetMountDisplayId(uint32 mountDisplayId)
Definition: Unit.h:900
uint8 GetRace() const
Definition: Unit.h:749
virtual void SetDisplayId(uint32 displayId, bool setNative=false)
Definition: Unit.cpp:10148
bool IsInCombat() const
Definition: Unit.h:1043
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:834
Unit * GetPassenger(int8 seatId) const
Gets a passenger on specified seat.
Definition: Vehicle.cpp:291
Map * GetMap() const
Definition: Object.h:624
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
PhaseShift & GetPhaseShift()
Definition: Object.h:523
Unit * GetOwner() const
Definition: Object.cpp:2229
float GetDistance2d(WorldObject const *obj) const
Definition: Object.cpp:1096
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition: Object.cpp:2252
EventProcessor m_Events
Definition: Object.h:777
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1078
uint32 GetAreaId() const
Definition: Object.h:546
WorldPacket const * Write() override
Definition: NPCPackets.cpp:94
WorldPacket const * Write() override
std::vector< SpellCooldownStruct > SpellCooldowns
Definition: SpellPackets.h:584
BattlePets::BattlePetMgr * GetBattlePetMgr() const
void Register() override
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *) override
void OnPeriodic(AuraEffect const *)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex)
bool CheckProc(ProcEventInfo &eventInfo)
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex)
void Register() override
void HandleDamage(SpellEffIndex)
bool Validate(SpellInfo const *) override
void Register() override
void HandleScript(SpellEffIndex)
void Absorb(AuraEffect *, DamageInfo &, uint32 &absorbAmount)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
static constexpr uint32 AncestralCallBuffs[]
void HandleScript(SpellEffIndex)
void Register() override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void Register() override
void CalcAmount(AuraEffect const *, int32 &amount, bool &)
void Register() override
bool Validate(SpellInfo const *spellInfo) override
bool Load() override
void CalcPeriodic(AuraEffect const *, bool &isPeriodic, int32 &)
void UpdatePeriodic(AuraEffect *aurEff)
bool Validate(SpellInfo const *spellInfo) override
void Register() override
void PeriodicTick(AuraEffect const *aurEff)
bool CheckAreaTarget(Unit *target)
bool Validate(SpellInfo const *) override
SpellCastResult CheckCast()
void Register() override
void UpdateRacials(Races oldRace, Races newRace)
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
static uint32 GetDisplayIdForRace(Races race, Gender gender)
void HandleApply(AuraEffect const *, AuraEffectHandleModes mode)
std::array< Races, 3 > OtherFactionRacePriorityList
static std::vector< uint32 > RacialSkills
static std::unordered_map< Races, OtherFactionRacePriorityList > const RaceInfo
static std::unordered_map< Races, std::array< uint32, 2 > > const RaceDisplayIds
static Races GetReplacementRace(Races nativeRace, Classes playerClass)
bool Validate(SpellInfo const *) override
void Register() override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
spell_gen_bloodlust(uint32 exhaustionSpellId)
void HandleHit(SpellEffIndex)
void Register() override
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
void Register() override
bool CheckProc(AuraEffect const *, ProcEventInfo &procInfo)
void HandleScriptEffect(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
void Register() override
void HandleApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *spellInfo) override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void Register() override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
SpellCastResult CheckIfCorpseNear()
void Register() override
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
void UpdatePeriodic(AuraEffect *aurEff)
void Register() override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
void Register() override
void HandleScript(SpellEffIndex)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex effIndex)
void Register() override
void HandleScriptEffect(SpellEffIndex effIndex)
void Register() override
void Register() override
void CalculateDamage(Unit const *, int32 &damage, int32 &, float &) const
spell_gen_count_pct_from_max_hp(int32 damagePct=0)
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex effIndex)
void Register() override
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *spellInfo) override
void Register() override
bool CheckProc(ProcEventInfo &eventInfo)
void ModDuration(AuraEffect const *, AuraEffectHandleModes)
void RemoveDummyFromDriver(AuraEffect const *, AuraEffectHandleModes)
void Register() override
bool Validate(SpellInfo const *) override
void RemoveVisualShields(AuraEffect const *, AuraEffectHandleModes)
void RefreshVisualShields(AuraEffect const *aurEff, AuraEffectHandleModes)
void Register() override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleDummy(SpellEffIndex)
void Register() override
void HandleDespawn(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
void EjectPassenger(SpellEffIndex)
bool Validate(SpellInfo const *spellInfo) override
void HandleScriptEffect(SpellEffIndex)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *spellInfo) override
void Register() override
void Register() override
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
bool Load() override
void HandleDummy(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
void Register() override
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void Register() override
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &)
bool Validate(SpellInfo const *spellInfo) override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void Register() override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
void HandleEffectPeriodic(AuraEffect const *)
void HandleDummy(SpellEffIndex)
void Register() override
void Register() override
void HandleDummy(SpellEffIndex)
void Register() override
void HandleDummy(SpellEffIndex)
void OnRemove(AuraEffect const *effect, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void Register() override
bool Validate(SpellInfo const *) override
spell_gen_lifebloom(uint32 spellId)
void Register() override
void AfterRemove(AuraEffect const *aurEff, AuraEffectHandleModes)
void CalculateHealingBonus(AuraEffect const *, Unit *, int32 &, int32 &, float &pctMod) const
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void CalculateHealingBonus(Unit *, int32 &, int32 &, float &pctMod) const
void OnPeriodic(AuraEffect const *aurEff)
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
void SetBonusValueForEffect(SpellEffIndex effIndex, int32 value, AuraEffect const *aurEff)
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &)
bool Validate(SpellInfo const *spellInfo) override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void OnPeriodic(AuraEffect const *)
void HandleScriptEffect(SpellEffIndex effIndex)
void HandleChargeEffect(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
void Register() override
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex effIndex)
void PeriodicTick(AuraEffect const *)
bool CheckProc(ProcEventInfo &eventInfo)
void OnProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *spellInfo) override
bool Validate(SpellInfo const *) override
void Register() override
void HandleScript(SpellEffIndex)
void Register() override
void HandleEffectPeriodic(AuraEffect const *)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleStun(AuraEffect const *aurEff, AuraEffectHandleModes)
void Register() override
void HandleScript(SpellEffIndex)
void Register() override
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *spellInfo) override
void HandleScript(SpellEffIndex)
void Register() override
void HandleEffectPeriodic(AuraEffect const *)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool CheckProc(ProcEventInfo &eventInfo)
void HandleChargeDrop(ProcEventInfo &)
void HandleScript(SpellEffIndex)
SpellCastResult CheckRequirement()
void Register() override
bool Validate(SpellInfo const *spellInfo) override
void HandleTauntEffect(SpellEffIndex effIndex)
void SelectRandomTarget(std::list< WorldObject * > &targets)
void HandleScript(SpellEffIndex)
void HandleScriptEffect(SpellEffIndex)
void PeriodicTick(AuraEffect const *)
void PeriodicTick(AuraEffect const *aurEff)
void PeriodicTick(AuraEffect const *)
bool Validate(SpellInfo const *spellInfo) override
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
void RemoveInvalidTargets(std::list< WorldObject * > &targets)
void PeriodicTick(AuraEffect const *)
void Register() override
void HandleMount(AuraEffect const *aurEff, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void Register() override
bool Validate(SpellInfo const *) override
void AchievementCredit(SpellEffIndex)
void HandleSkinningEffect(SpellEffIndex)
void Register() override
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
static constexpr uint32 SPELL_SPIRIT_HEAL_EFFECT
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleDummy(SpellEffIndex)
void Register() override
void HandleScript(SpellEffIndex)
void Register() override
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *) override
void Register() override
void HandleScript(SpellEffIndex)
void HandleScriptEffect(SpellEffIndex effIndex)
void Register() override
void HandleScriptEffect(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleApplyEffect(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void UpdateReviveBattlePetCooldown(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *spellInfo) override
bool Validate(SpellInfo const *spellInfo) override
std::list< uint32 > _applyTimes
void OnApply(AuraEffect const *aurEff, AuraEffectHandleModes)
void OnPeriodic(AuraEffect const *)
void Register() override
void HandleTransform(SpellEffIndex effIndex)
SpellCastResult CheckCast()
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
void HandleDummy(SpellEffIndex)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void CalcWarModeBonus(AuraEffect const *, int32 &amount, bool &)
void Register() override
SpellCastResult CheckCast()
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *spellInfo) override
bool Validate(SpellInfo const *) override
void SetDest(SpellDestination &dest)
void Register() override
void OnPeriodic(AuraEffect const *)
bool Validate(SpellInfo const *) override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleSummon(SpellEffIndex effIndex)
@ SPELL_REVIVE_BATTLE_PETS
Definition: BattlePetMgr.h:37
uint32 GetGameTimeMS()
Definition: GameTime.cpp:49
float GetBonusMultiplier(Unit const *unit, uint32 spellId)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:109
auto MapGetValuePtr(M &map, typename M::key_type const &key)
Definition: MapUtils.h:29
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:67
StasisFieldEntrys
@ NPC_DAGGERTAIL_LIZARD
@ SPELL_STASIS_FIELD
SkinningLearningSpell
@ SPELL_SHADOWLANDS_SKINNING
@ SPELL_DRAENOR_SKINNING
@ SPELL_OUTLAND_SKINNING
@ SPELL_PANDARIA_SKINNING
@ SPELL_LEGION_SKINNING
@ SPELL_ZANDALARI_SKINNING
@ SPELL_CATACLYSM_SKINNING
@ SPELL_NORTHREND_SKINNING
@ SPELL_CLASSIC_SKINNING
@ SPELL_KUL_TIRAN_SKINNING
@ SPELL_DRAGON_ISLES_SKINNING
VampiricTouch
@ SPELL_VAMPIRIC_TOUCH_HEAL
SeaforiumSpells
@ SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT
FungalDecay
@ AURA_DURATION
Interrupt
@ SPELL_GEN_THROW_INTERRUPT
PvPTrinketTriggeredSpells
@ SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER
@ SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF
BloodlustExhaustionSpell
@ SPELL_EVOKER_EXHAUSTION
@ SPELL_SHAMAN_SATED
@ SPELL_HUNTER_FATIGUED
@ SPELL_MAGE_TEMPORAL_DISPLACEMENT
@ SPELL_SHAMAN_EXHAUSTION
KazrogalHellfireMark
@ SPELL_MARK_OF_KAZROGAL_DAMAGE_HELLFIRE
@ SPELL_MARK_OF_KAZROGAL_HELLFIRE
FoamSword
@ ITEM_FOAM_SWORD_RED
@ ITEM_FOAM_SWORD_PINK
@ ITEM_FOAM_SWORD_YELLOW
@ ITEM_FOAM_SWORD_GREEN
@ ITEM_FOAM_SWORD_BLUE
SiegeTankControl
@ SPELL_SIEGE_TANK_CONTROL
Replenishment
@ SPELL_INFINITE_REPLENISHMENT
@ SPELL_REPLENISHMENT
TransporterBackfires
@ SPELL_TRANSPORTER_EVIL_TWIN
@ SPELL_TRANSPORTER_MALFUNCTION_MISS
@ SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH
RequiredMixologySpells
@ SPELL_ELIXIR_OF_MIGHTY_FORTITUDE
@ SPELL_FLASK_OF_THE_FROST_WYRM
@ SPELL_ELIXIR_OF_GREATER_FIREPOWER
@ SPELL_ELIXIR_OF_SAGES
@ SPELL_MIGHTY_TROLLS_BLOOD_ELIXIR
@ SPELL_WEAK_TROLLS_BLOOD_ELIXIR
@ SPELL_ONSLAUGHT_ELIXIR
@ SPELL_ELIXIR_OF_DEADLY_STRIKES
@ SPELL_ELIXIR_OF_MAJOR_MAGEBLOOD
@ SPELL_ELIXIR_OF_OGRES_STRENGTH
@ SPELL_SHADOWPOWER_ELIXIR
@ SPELL_LESSER_FLASK_OF_RESISTANCE
@ SPELL_ELIXIR_OF_GREATER_DEFENSE
@ SPELL_FLASK_OF_BLINDING_LIGHT
@ SPELL_ELIXIR_OF_SPIRIT
@ SPELL_FLASK_OF_STONEBLOOD
@ SPELL_ELIXIR_OF_MAJOR_DEFENSE
@ SPELL_ARCANE_ELIXIR
@ SPELL_ELIXIR_OF_DEFENSE
@ SPELL_LESSER_FLASK_OF_TOUGHNESS
@ SPELL_ELIXIR_OF_WISDOM
@ SPELL_ELIXIR_OF_MAJOR_STRENGTH
@ SPELL_ELIXIR_OF_MINOR_FORTITUDE
@ SPELL_ELIXIR_OF_FORTITUDE
@ SPELL_ELIXIR_OF_AGILITY
@ SPELL_ELIXIR_OF_SUPERIOR_DEFENSE
@ SPELL_FLASK_OF_SUPREME_POWER
@ SPELL_FLASK_OF_FORTIFICATION
@ SPELL_ELIXIR_OF_DRAENIC_WISDOM
@ SPELL_ELIXIR_OF_HEALING_POWER
@ SPELL_ELIXIR_OF_MIGHTY_STRENGTH
@ SPELL_ELIXIR_OF_MIGHTY_MAGEBLOOD
@ SPELL_ELIXIR_OF_MAJOR_FROST_POWER
@ SPELL_ELIXIR_OF_FIREPOWER
@ SPELL_WRATH_ELIXIR
@ SPELL_MIXOLOGY
@ SPELL_ELIXIR_OF_PROTECTION
@ SPELL_FLASK_OF_CHROMATIC_RESISTANCE
@ SPELL_MAGEBLOOD_ELIXIR
@ SPELL_ELIXIR_OF_MAJOR_AGILITY
@ SPELL_FLASK_OF_RELENTLESS_ASSAULT
@ SPELL_ELIXIR_OF_MIGHTY_DEFENSE
@ SPELL_GURUS_ELIXIR
@ SPELL_ELIXIR_OF_GREATER_AGILITY
@ SPELL_FLASK_OF_THE_TITANS
@ SPELL_STRONG_TROLLS_BLOOD_ELIXIR
@ SPELL_FLASK_OF_PURE_MOJO
@ SPELL_ELIXIR_OF_LIGHTNING_SPEED
@ SPELL_FLASK_OF_PURE_DEATH
@ SPELL_ELIXIR_OF_LESSER_AGILITY
@ SPELL_ADEPTS_ELIXIR
@ SPELL_FLASK_OF_ENDLESS_RAGE
@ SPELL_ELIXIR_OF_MIGHTY_TOUGHTS
@ SPELL_ELIXIR_OF_SHADOW_POWER
@ SPELL_ELIXIR_OF_GREATER_INTELLECT
@ SPELL_FLASK_OF_MIGHTY_RESTORATION
@ SPELL_ELIXIR_OF_GIANTS
@ SPELL_ELIXIR_OF_IRONSKIN
@ SPELL_ELIXIR_OF_GIANTH_GROWTH
@ SPELL_ELIXIR_OF_MINOR_AGILITY
@ SPELL_ELIXIR_OF_MINOR_DEFENSE
@ SPELL_ELIXIR_OF_ARMOR_PIERCING
@ SPELL_FEL_STRENGTH_ELIXIR
@ SPELL_ELIXIR_OF_DEMONSLAYING
@ SPELL_ELIXIR_OF_MINOR_ACCURACY
@ SPELL_ELIXIR_OF_EXPERTISE
@ SPELL_ELIXIR_OF_MAJOR_SHADOW_POWER
@ SPELL_ELIXIR_OF_MIGHTY_AGILITY
@ SPELL_ELIXIR_OF_MAJOR_FIREPOWER
@ SPELL_MAJOR_TROLLS_BLLOOD_ELIXIR
@ SPELL_ELIXIR_OF_LIONS_STRENGTH
@ SPELL_ELIXIR_OF_MAJOR_FORTITUDE
@ SPELL_EARTHEN_ELIXIR
@ SPELL_ELIXIR_OF_FROST_POWER
@ SPELL_FLASK_OF_DISTILLED_WISDOM
@ SPELL_ELIXIR_OF_MASTERY
@ SPELL_ELIXIR_OF_THE_MONGOOSE
@ SPELL_ELIXIR_OF_ACCURACY
@ SPELL_FLASK_OF_CHROMATIC_WONDER
@ SPELL_ELIXIR_OF_BRUTE_FORCE
@ SPELL_ELIXIR_OF_EMPOWERMENT
@ SPELL_GREATER_ARCANE_ELIXIR
WhisperToControllerTexts
@ WHISPER_FUTURE_YOU
@ WHISPER_PAST_YOU
@ WHISPER_DEFENDER
VehicleScaling
@ SPELL_GEAR_SCALING
@ SPELL_GREAT_FEAST
@ SPELL_SMALL_FEAST
@ SPELL_FEAST_FOOD
@ SPELL_BOUNTIFUL_FEAST_FOOD
@ SPELL_FISH_FEAST_REFRESHMENT
@ SPELL_BOUNTIFUL_FEAST_REFRESHMENT
@ SPELL_GREAT_FEAST_REFRESHMENT
@ SPELL_SMALL_FEAST_REFRESHMENT
@ SPELL_GIGANTIC_FEAST
@ SPELL_GIGANTIC_FEAST_REFRESHMENT
@ SPELL_FEAST_DRINK
@ SPELL_BOUNTIFUL_FEAST_DRINK
@ SPELL_BOUNTIFUL_FEAST
@ SPELL_FISH_FEAST
EtherealPet
@ SPELL_PROC_TRIGGER_ON_KILL_AURA
@ SPELL_ETHEREAL_PET_AURA
@ SAY_CREATE_TOKEN
@ SPELL_CREATE_TOKEN
@ NPC_ETHEREAL_SOUL_TRADER
@ SAY_STEAL_ESSENCE
@ SPELL_STEAL_ESSENCE_VISUAL
DalaranDisguiseSpells
@ SPELL_SUNREAVER_DISGUISE_MALE
@ SPELL_SUNREAVER_DISGUISE_TRIGGER
@ SPELL_SILVER_COVENANT_DISGUISE_FEMALE
@ SPELL_SILVER_COVENANT_DISGUISE_MALE
@ SPELL_SUNREAVER_DISGUISE_FEMALE
@ SPELL_SILVER_COVENANT_DISGUISE_TRIGGER
PonySpells
@ MOUNT_PONY
@ ACHIEV_PONY_UP
Teleporting
@ SPELL_TELEPORT_SPIRE_UP
@ SPELL_TELEPORT_SPIRE_DOWN
@ AREA_VIOLET_CITADEL_SPIRE
BloodReserve
@ SPELL_GEN_BLOOD_RESERVE_AURA
@ SPELL_GEN_BLOOD_RESERVE_HEAL
CannonBlast
@ SPELL_CANNON_BLAST
@ SPELL_CANNON_BLAST_DAMAGE
FishingSpells
@ SPELL_FISHING_WITH_POLE
@ SPELL_FISHING_NO_FISHING_POLE
ChargeSpells
@ SPELL_CHARGE_CHARGING_EFFECT_8K5
@ SPELL_CHARGE_CHARGING_EFFECT_20K_2
@ SPELL_CHARGE_TRIGGER_FACTION_MOUNTS
@ SPELL_CHARGE_TRIGGER_TRIAL_CHAMPION
@ SPELL_CHARGE_DAMAGE_45K
@ SPELL_CHARGE_MISS_EFFECT
@ SPELL_CHARGE_CHARGING_EFFECT_20K_1
@ SPELL_CHARGE_DAMAGE_8K5
@ SPELL_CHARGE_CHARGING_EFFECT_45K_1
@ SPELL_CHARGE_DAMAGE_20K
@ SPELL_CHARGE_CHARGING_EFFECT_45K_2
ChaosBlast
@ SPELL_CHAOS_BLAST
GenericBandage
@ SPELL_RECENTLY_BANDAGED
AuraProcRemoveSpells
@ SPELL_IMPATIENT_MIND
@ SPELL_FACE_RAGE
WhisperGulchYoggSaronWhisper
@ SPELL_YOGG_SARON_WHISPER_DUMMY
AdaptiveWarding
@ SPELL_GEN_ADAPTIVE_WARDING_ARCANE
@ SPELL_GEN_ADAPTIVE_WARDING_FIRE
@ SPELL_GEN_ADAPTIVE_WARDING_NATURE
@ SPELL_GEN_ADAPTIVE_WARDING_FROST
@ SPELL_GEN_ADAPTIVE_WARDING_SHADOW
MajorHealingCooldownSpell
@ SPELL_PRIEST_DIVINE_HYMN_HEAL
@ SPELL_DRUID_TRANQUILITY
@ SPELL_SHAMAN_HEALING_TIDE_TOTEM_HEAL
@ SPELL_EVOKER_REWIND
@ SPELL_SHAMAN_HEALING_TIDE_TOTEM
@ SPELL_PRIEST_LUMINOUS_BARRIER
@ SPELL_DRUID_TRANQUILITY_HEAL
@ SPELL_PRIEST_DIVINE_HYMN
@ SPELL_MONK_REVIVAL
RunningWildMountIds
@ SPELL_ALTERED_FORM
DefenderOfAzerothData
@ NPC_TROLLBANE
@ QUEST_DEFENDER_OF_AZEROTH_HORDE
@ QUEST_DEFENDER_OF_AZEROTH_ALLIANCE
@ NPC_MOGRAINE
@ SPELL_DEATH_GATE_TELEPORT_STORMWIND
@ SPELL_DEATH_GATE_TELEPORT_ORGRIMMAR
@ NPC_NAZGRIM
@ NPC_WHITEMANE
OrcDisguiseSpells
@ SPELL_ORC_DISGUISE_FEMALE
@ SPELL_ORC_DISGUISE_MALE
@ SPELL_ORC_DISGUISE_TRIGGER
ProfessionResearch
@ SPELL_NORTHREND_INSCRIPTION_RESEARCH
GMFreeze
@ SPELL_GM_FREEZE
GnomishTransporter
@ SPELL_TRANSPORTER_FAILURE
@ SPELL_TRANSPORTER_SUCCESS
@ SPELL_NIGHTMARE_FIGMENT_MIRROR_IMAGE
FuriousRage
@ EMOTE_EXHAUSTED
@ EMOTE_FURIOUS_RAGE
@ SPELL_EXHAUSTION
Netherbloom
@ SPELL_NETHERBLOOM_POLLEN_1
FreezingCircleMisc
@ SPELL_FREEZING_CIRCLE_PIT_OF_SARON_HEROIC
@ SPELL_FREEZING_CIRCLE
@ SPELL_FREEZING_CIRCLE_PIT_OF_SARON_NORMAL
@ MAP_ID_BLOOD_IN_THE_SNOW_SCENARIO
@ SPELL_FREEZING_CIRCLE_SCENARIO
ObsidianArmor
@ SPELL_GEN_OBSIDIAN_ARMOR_HOLY
@ SPELL_GEN_OBSIDIAN_ARMOR_FIRE
@ SPELL_GEN_OBSIDIAN_ARMOR_ARCANE
@ SPELL_GEN_OBSIDIAN_ARMOR_FROST
@ SPELL_GEN_OBSIDIAN_ARMOR_SHADOW
@ SPELL_GEN_OBSIDIAN_ARMOR_NATURE
VendorBarkTrigger
@ NPC_AMPHITHEATER_VENDOR
@ SAY_AMPHITHEATER_VENDOR
LandmineKnockbackAchievement
@ SPELL_LANDMINE_KNOCKBACK_ACHIEVEMENT
CloneWeaponSpells
@ SPELL_COPY_OFFHAND_2_AURA
@ SPELL_COPY_WEAPON_3_AURA
@ SPELL_COPY_OFFHAND_AURA
@ SPELL_COPY_WEAPON_AURA
@ SPELL_COPY_WEAPON_2_AURA
@ SPELL_COPY_RANGED_AURA
CorruptinPlagueEntrys
@ NPC_AETHER_RAY
@ NPC_SHARD_HIDE_BOAR
@ SPELL_CORRUPTING_PLAGUE
@ NPC_APEXIS_FLAYER
static Emote const EmoteArray[]
TrinketSpells
@ SPELL_PVP_TRINKET_ALLIANCE
@ SPELL_PVP_TRINKET_HORDE
MossCoveredFeet
@ SPELL_FALL_DOWN
CreateLanceSpells
@ SPELL_CREATE_LANCE_ALLIANCE
@ SPELL_CREATE_LANCE_HORDE
BindLocation const OrgrimmarInnLoc(1, 1573.18f, -4441.62f, 16.06f, 1.818284034729003906f, 8618)
DivineStormSpell
@ SPELL_DIVINE_STORM
void AddSC_generic_spell_scripts()
FriendOrFowl
@ SPELL_TURKEY_VENGEANCE
PetSummoned
@ NPC_DOOMGUARD
@ NPC_INFERNAL
@ NPC_IMP
GenericLifebloom
@ SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL
@ SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL
@ SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL
@ SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL
@ SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL
DefendVisuals
@ SPELL_VISUAL_SHIELD_2
@ SPELL_VISUAL_SHIELD_3
@ SPELL_VISUAL_SHIELD_1
TournamentMountsSpells
@ SPELL_LANCE_EQUIPPED
BindLocation const StormwindInnLoc(0, -8868.1f, 675.82f, 97.9f, 5.164778709411621093f, 5148)
AnimalBloodPoolSpell
@ SPELL_ANIMAL_BLOOD
@ SPELL_SPAWN_BLOOD_POOL
Bonked
@ SPELL_BONKED
@ SPELL_FOAM_SWORD_DEFEAT
@ SPELL_ON_GUARD
ParachuteSpells
@ SPELL_PARACHUTE
@ SPELL_PARACHUTE_BUFF
CannibalizeSpells
@ SPELL_CANNIBALIZE_TRIGGERED
NightmareVine
@ SPELL_NIGHTMARE_POLLEN
BreakShieldSpells
@ SPELL_BREAK_SHIELD_DAMAGE_10K
@ SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS
@ SPELL_BREAK_SHIELD_TRIGGER_UNK
@ SPELL_BREAK_SHIELD_DAMAGE_2K
@ SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE
ParalyticPoison
@ SPELL_PARALYSIS
MountedDuelSpells
@ SPELL_MOUNTED_DUEL
@ SPELL_ON_TOURNAMENT_MOUNT
AncestralCallSpells
@ SPELL_MIGHT_OF_THE_BLACKROCK
@ SPELL_RICTUS_OF_THE_LAUGHING_SKULL
@ SPELL_FEROCITY_OF_THE_FROSTWOLF
@ SPELL_ZEAL_OF_THE_BURNING_BLADE
BindLocation(uint32 mapId, float x, float y, float z, float o, uint32 areaId)
WorldLocation Loc
CastSpellExtraArgs & AddSpellBP0(int32 val)
Definition: SpellDefines.h:475
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:179
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:191
uint32 GetSubClass() const
Definition: ItemTemplate.h:778
uint32 GetClass() const
Definition: ItemTemplate.h:777
float level
Definition: MapDefines.h:141
constexpr float GetPositionX() const
Definition: Position.h:76
float m_positionZ
Definition: Position.h:55
constexpr float GetPositionY() const
Definition: Position.h:77
constexpr void GetPosition(float &x, float &y) const
Definition: Position.h:81
constexpr float GetPositionZ() const
Definition: Position.h:78
void Relocate(Position const &pos)
Definition: Spell.cpp:111