TrinityCore
Loading...
Searching...
No Matches
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 "AreaTrigger.h"
27#include "AreaTriggerAI.h"
28#include "Battleground.h"
29#include "BattlePetMgr.h"
30#include "CellImpl.h"
31#include "CommonPredicates.h"
32#include "Containers.h"
33#include "CreatureAI.h"
34#include "DB2Stores.h"
35#include "GameTime.h"
36#include "GridNotifiersImpl.h"
37#include "Item.h"
38#include "Log.h"
39#include "MapUtils.h"
40#include "MotionMaster.h"
41#include "NPCPackets.h"
42#include "ObjectMgr.h"
43#include "Pet.h"
44#include "PhasingHandler.h"
45#include "ReputationMgr.h"
46#include "PathGenerator.h"
47#include "SkillDiscovery.h"
48#include "SpellAuraEffects.h"
49#include "SpellHistory.h"
50#include "SpellMgr.h"
51#include "SpellPackets.h"
52#include "SpellScript.h"
53#include "Vehicle.h"
54#include "WorldStateMgr.h"
55
57{
59
60 bool Load() override
61 {
62 // Max absorb stored in 1 dummy effect
64 return true;
65 }
66
67 void Absorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
68 {
69 absorbAmount = std::min(limit, absorbAmount);
70 }
71
76};
77
78// 28764 - Adaptive Warding (Frostfire Regalia Set)
87
89{
101
102 bool CheckProc(ProcEventInfo& eventInfo)
103 {
104 if (!eventInfo.GetSpellInfo())
105 return false;
106
107 // find Mage Armor
108 if (!GetTarget()->GetAuraEffect(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT, SPELLFAMILY_MAGE, flag128(0x10000000, 0x0, 0x0)))
109 return false;
110
111 switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
112 {
115 return false;
116 default:
117 break;
118 }
119 return true;
120 }
121
122 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
123 {
125
126 uint32 spellId = 0;
127 switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
128 {
131 break;
134 break;
137 break;
140 break;
143 break;
144 default:
145 return;
146 }
147 GetTarget()->CastSpell(GetTarget(), spellId, aurEff);
148 }
149
155};
156
171
177
178// 46221 - Animal Blood
180{
181 bool Validate(SpellInfo const* /*spellInfo*/) override
182 {
184 }
185
186 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
187 {
188 // Remove all auras with spell id 46221, except the one currently being applied
189 while (Aura* aur = GetUnitOwner()->GetOwnedAura(SPELL_ANIMAL_BLOOD, ObjectGuid::Empty, ObjectGuid::Empty, 0, GetAura()))
191 }
192
193 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
194 {
195 if (Unit* owner = GetUnitOwner())
196 owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true);
197 }
198
204};
205
206// 63471 - Spawn Blood Pool
208{
210 {
211 Unit* caster = GetCaster();
212 Position summonPos = caster->GetPosition();
213 LiquidData liquidStatus;
214 if (caster->GetMap()->GetLiquidStatus(caster->GetPhaseShift(), caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), {}, &liquidStatus, caster->GetCollisionHeight()))
215 summonPos.m_positionZ = liquidStatus.level;
216 dest.Relocate(summonPos);
217 }
218
223};
224
225// 430 Drink
226// 431 Drink
227// 432 Drink
228// 1133 Drink
229// 1135 Drink
230// 1137 Drink
231// 10250 Drink
232// 22734 Drink
233// 27089 Drink
234// 34291 Drink
235// 43182 Drink
236// 43183 Drink
237// 46755 Drink
238// 49472 Drink Coffee
239// 57073 Drink
240// 61830 Drink
241// 72623 Drink
243{
244 bool Load() override
245 {
246 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
247 }
248
249 bool Validate(SpellInfo const* spellInfo) override
250 {
251 if (!ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) || !spellInfo->GetEffect(EFFECT_0).IsAura(SPELL_AURA_MOD_POWER_REGEN))
252 {
253 TC_LOG_ERROR("spells", "Aura {} structure has been changed - first aura is no longer SPELL_AURA_MOD_POWER_REGEN", GetId());
254 return false;
255 }
256
257 return true;
258 }
259
260 void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& /*amplitude*/)
261 {
262 // Get SPELL_AURA_MOD_POWER_REGEN aura from spell
264 if (!regen)
265 return;
266
267 // default case - not in arena
268 if (!GetCaster()->ToPlayer()->InArena())
269 isPeriodic = false;
270 }
271
272 void CalcAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
273 {
275 if (!regen)
276 return;
277
278 // default case - not in arena
279 if (!GetCaster()->ToPlayer()->InArena())
280 regen->ChangeAmount(amount);
281 }
282
284 {
286 if (!regen)
287 return;
288
289 // **********************************************
290 // This feature used only in arenas
291 // **********************************************
292 // Here need increase mana regen per tick (6 second rule)
293 // on 0 tick - 0 (handled in 2 second)
294 // on 1 tick - 166% (handled in 4 second)
295 // on 2 tick - 133% (handled in 6 second)
296
297 // Apply bonus for 1 - 4 tick
298 switch (aurEff->GetTickNumber())
299 {
300 case 1: // 0%
301 regen->ChangeAmount(0);
302 break;
303 case 2: // 166%
304 regen->ChangeAmount(aurEff->GetAmount() * 5 / 3);
305 break;
306 case 3: // 133%
307 regen->ChangeAmount(aurEff->GetAmount() * 4 / 3);
308 break;
309 default: // 100% - normal regen
310 regen->ChangeAmount(aurEff->GetAmount());
311 // No need to update after 4th tick
312 aurEff->SetPeriodic(false);
313 break;
314 }
315 }
316
323};
324
325// 28313 - Aura of Fear
327{
328 bool Validate(SpellInfo const* spellInfo) override
329 {
330 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) && ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
331 }
332
333 void PeriodicTick(AuraEffect const* aurEff)
334 {
337 return;
338
339 GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, true);
340 }
341
346};
347
349{
350 bool CheckAreaTarget(Unit* target)
351 {
352 switch (target->GetEntry())
353 {
354 // alliance
355 case 14762: // Dun Baldar North Marshal
356 case 14763: // Dun Baldar South Marshal
357 case 14764: // Icewing Marshal
358 case 14765: // Stonehearth Marshal
359 case 11948: // Vandar Stormspike
360 // horde
361 case 14772: // East Frostwolf Warmaster
362 case 14776: // Tower Point Warmaster
363 case 14773: // Iceblood Warmaster
364 case 14777: // West Frostwolf Warmaster
365 case 11946: // Drek'thar
366 return true;
367 default:
368 return false;
369 }
370 }
371
376};
377
382
384{
385 bool Validate(SpellInfo const* /*spellInfo*/) override
386 {
388 }
389
391 {
392 if (Unit* target = GetExplTargetUnit())
393 {
394 if (target->HasAura(SPELL_RECENTLY_BANDAGED))
396 }
397 return SPELL_CAST_OK;
398 }
399
401 {
402 if (Unit* target = GetHitUnit())
404 }
405
411};
412
413// 193970 - Mercenary Shapeshift
415{
416 inline static std::unordered_map<Races, std::array<uint32, 2>> const RaceDisplayIds =
417 {
418 { RACE_HUMAN, { 55239, 55238 } },
419 { RACE_ORC, { 55257, 55256 } },
420 { RACE_DWARF, { 55241, 55240 } },
421 { RACE_NIGHTELF, { 55243, 55242 } },
422 { RACE_UNDEAD_PLAYER, { 55259, 55258 } },
423 { RACE_TAUREN, { 55261, 55260 } },
424 { RACE_GNOME, { 55245, 55244 } },
425 { RACE_TROLL, { 55263, 55262 } },
426 { RACE_GOBLIN, { 55267, 57244 } },
427 { RACE_BLOODELF, { 55265, 55264 } },
428 { RACE_DRAENEI, { 55247, 55246 } },
429 { RACE_WORGEN, { 55255, 55254 } },
430 { RACE_PANDAREN_NEUTRAL, { 55253, 55252 } }, // not verified, might be swapped with RACE_PANDAREN_HORDE
431 { RACE_PANDAREN_ALLIANCE, { 55249, 55248 } },
432 { RACE_PANDAREN_HORDE, { 55251, 55250 } },
433 { RACE_NIGHTBORNE, { 82375, 82376 } },
434 { RACE_HIGHMOUNTAIN_TAUREN, { 82377, 82378 } },
435 { RACE_VOID_ELF, { 82371, 82372 } },
436 { RACE_LIGHTFORGED_DRAENEI, { 82373, 82374 } },
437 { RACE_ZANDALARI_TROLL, { 88417, 88416 } },
438 { RACE_KUL_TIRAN, { 88414, 88413 } },
439 { RACE_DARK_IRON_DWARF, { 88409, 88408 } },
440 { RACE_VULPERA, { 94999, 95001 } },
441 { RACE_MAGHAR_ORC, { 88420, 88410 } },
442 { RACE_MECHAGNOME, { 94998, 95000 } },
443 { RACE_DRACTHYR_ALLIANCE, { 112794, 112793 } },
444 { RACE_DRACTHYR_HORDE, { 112796, 112795 } },
445 { RACE_EARTHEN_DWARF_HORDE, { 118113, 118114 } },
446 { RACE_EARTHEN_DWARF_ALLIANCE, { 118111, 118112 } },
447 { RACE_HARANIR_ALLIANCE, { 140501, 140500 } },
448 { RACE_HARANIR_HORDE, { 140503, 140502 } },
449 };
450
451 inline static std::vector<uint32> RacialSkills;
452
453 static Races GetReplacementRace(Races nativeRace, Classes playerClass)
454 {
455 if (CharBaseInfoEntry const* charBaseInfo = DB2Manager::GetCharBaseInfo(nativeRace, playerClass))
456 if (sObjectMgr->GetPlayerInfo(charBaseInfo->OtherFactionRaceID, playerClass))
457 return Races(charBaseInfo->OtherFactionRaceID);
458
459 return RACE_NONE;
460 }
461
463 {
464 if (std::array<uint32, 2> const* displayIds = Trinity::Containers::MapGetValuePtr(RaceDisplayIds, race))
465 return (*displayIds)[gender];
466
467 return 0;
468 }
469
470 bool Validate(SpellInfo const* /*spellInfo*/) override
471 {
472 for (auto const& [race, displayIds] : RaceDisplayIds)
473 {
474 if (!sChrRacesStore.LookupEntry(race))
475 return false;
476
477 for (uint32 displayId : displayIds)
478 if (!sCreatureDisplayInfoStore.LookupEntry(displayId))
479 return false;
480 }
481
482 RacialSkills.clear();
483 for (SkillLineEntry const* skillLine : sSkillLineStore)
484 if (skillLine->GetFlags().HasFlag(SkillLineFlags::RacialForThePurposeOfTemporaryRaceChange))
485 RacialSkills.push_back(skillLine->ID);
486
487 return true;
488 }
489
490 void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode) const
491 {
492 Unit* owner = GetUnitOwner();
493 Races otherFactionRace = GetReplacementRace(Races(owner->GetRace()), Classes(owner->GetClass()));
494 if (otherFactionRace == RACE_NONE)
495 return;
496
497 if (uint32 displayId = GetDisplayIdForRace(otherFactionRace, owner->GetNativeGender()))
498 owner->SetDisplayId(displayId);
499
500 if (mode & AURA_EFFECT_HANDLE_REAL)
501 UpdateRacials(Races(owner->GetRace()), otherFactionRace);
502 }
503
504 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
505 {
506 Unit* owner = GetUnitOwner();
507 Races otherFactionRace = GetReplacementRace(Races(owner->GetRace()), Classes(owner->GetClass()));
508 if (otherFactionRace == RACE_NONE)
509 return;
510
511 UpdateRacials(otherFactionRace, Races(owner->GetRace()));
512 }
513
514 void UpdateRacials(Races oldRace, Races newRace) const
515 {
516 Player* player = GetUnitOwner()->ToPlayer();
517 if (!player)
518 return;
519
520 for (uint32 racialSkillId : RacialSkills)
521 {
522 if (sDB2Manager.GetSkillRaceClassInfo(racialSkillId, oldRace, player->GetClass()))
523 if (std::vector<SkillLineAbilityEntry const*> const* skillLineAbilities = sDB2Manager.GetSkillLineAbilitiesBySkill(racialSkillId))
524 for (SkillLineAbilityEntry const* ability : *skillLineAbilities)
525 player->RemoveSpell(ability->Spell, false, false);
526
527 if (sDB2Manager.GetSkillRaceClassInfo(racialSkillId, newRace, player->GetClass()))
528 player->LearnSkillRewardedSpells(racialSkillId, player->GetMaxSkillValueForLevel(), newRace);
529 }
530 }
531
537};
538
539// Blood Reserve - 64568
545
547{
548 bool Validate(SpellInfo const* /*spellInfo*/) override
549 {
551 }
552
553 bool CheckProc(ProcEventInfo& eventInfo)
554 {
555 if (Unit* caster = eventInfo.GetActionTarget())
556 if (caster->HealthBelowPct(35))
557 return true;
558
559 return false;
560 }
561
562 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
563 {
565
566 Unit* caster = eventInfo.GetActionTarget();
567 CastSpellExtraArgs args(aurEff);
568 args.AddSpellBP0(aurEff->GetAmount());
569 caster->CastSpell(caster, SPELL_GEN_BLOOD_RESERVE_HEAL, args);
571 }
572
578};
579
586
588{
589 void HandleScript(SpellEffIndex /*effIndex*/)
590 {
591 if (Player* target = GetHitPlayer())
592 {
593 Aura const* aura = GetHitAura();
594 if (!(aura && aura->GetStackAmount() == 3))
595 return;
596
597 target->CastSpell(target, SPELL_FOAM_SWORD_DEFEAT, true);
598 target->RemoveAurasDueToSpell(SPELL_BONKED);
599
600 if (Aura const* auraOnGuard = target->GetAura(SPELL_ON_GUARD))
601 if (Item* item = target->GetItemByGuid(auraOnGuard->GetCastItemGUID()))
602 target->DestroyItemCount(item->GetEntry(), 1, true);
603 }
604 }
605
610};
611
612/* DOCUMENTATION: Break-Shield spells
613 Break-Shield spells can be classified in three groups:
614
615 - Spells on vehicle bar used by players:
616 + EFFECT_0: SCRIPT_EFFECT
617 + EFFECT_1: NONE
618 + EFFECT_2: NONE
619 - Spells cast by players triggered by script:
620 + EFFECT_0: SCHOOL_DAMAGE
621 + EFFECT_1: SCRIPT_EFFECT
622 + EFFECT_2: FORCE_CAST
623 - Spells cast by NPCs on players:
624 + EFFECT_0: SCHOOL_DAMAGE
625 + EFFECT_1: SCRIPT_EFFECT
626 + EFFECT_2: NONE
627
628 In the following script we handle the SCRIPT_EFFECT for effIndex EFFECT_0 and EFFECT_1.
629 - When handling EFFECT_0 we're in the "Spells on vehicle bar used by players" case
630 and we'll trigger "Spells cast by players triggered by script"
631 - When handling EFFECT_1 we're in the "Spells cast by players triggered by script"
632 or "Spells cast by NPCs on players" so we'll search for the first defend layer and drop it.
633*/
634
644
646{
647 bool Validate(SpellInfo const* /*spellInfo*/) override
648 {
649 return ValidateSpellInfo({ 62552, 62719, 64100, 66482 });
650 }
651
653 {
654 Unit* target = GetHitUnit();
655
656 switch (effIndex)
657 {
658 case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
659 {
660 uint32 spellId;
661
662 switch (GetSpellInfo()->Id)
663 {
667 break;
670 break;
671 default:
672 return;
673 }
674
675 if (Unit* rider = GetCaster()->GetCharmer())
676 rider->CastSpell(target, spellId, false);
677 else
678 GetCaster()->CastSpell(target, spellId, false);
679 break;
680 }
681 case EFFECT_1: // On damaging spells, for removing a defend layer
682 {
683 Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
684 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
685 {
686 if (Aura* aura = itr->second->GetBase())
687 {
688 if (aura->GetId() == 62552 || aura->GetId() == 62719 || aura->GetId() == 64100 || aura->GetId() == 66482)
689 {
690 aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
691 // Remove dummys from rider (Necessary for updating visual shields)
692 if (Unit* rider = target->GetCharmer())
693 if (Aura* defend = rider->GetAura(aura->GetId()))
694 defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
695 break;
696 }
697 }
698 }
699 break;
700 }
701 default:
702 break;
703 }
704 }
705
710};
711
712// 48750 - Burning Depths Necrolyte Image
714{
715 bool Validate(SpellInfo const* spellInfo) override
716 {
717 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } })
718 && ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_2).CalcValueAsInt()) });
719 }
720
721 void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
722 {
723 if (Unit* caster = GetCaster())
724 caster->CastSpell(GetTarget(), uint32(GetEffectInfo(EFFECT_2).CalcValueAsInt()));
725 }
726
727 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
728 {
730 }
731
737};
738
740{
741 bool Validate(SpellInfo const* spellInfo) override
742 {
743 return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()) });
744 }
745
750
755};
756
758{
759 bool Validate(SpellInfo const* spellInfo) override
760 {
761 return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()) });
762 }
763
768
773};
774
776{
777 bool Validate(SpellInfo const* spellInfo) override
778 {
779 return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()) });
780 }
781
786
791};
792
797
799{
800 bool Validate(SpellInfo const* /*spellInfo*/) override
801 {
803 }
804
806 {
807 Unit* caster = GetCaster();
808 float max_range = GetSpellInfo()->GetMaxRange(false);
809 WorldObject* result = nullptr;
810 // search for nearby enemy corpse in range
813 Cell::VisitWorldObjects(caster, searcher, max_range);
814 if (!result)
815 Cell::VisitGridObjects(caster, searcher, max_range);
816 if (!result)
818 return SPELL_CAST_OK;
819 }
820
821 void HandleDummy(SpellEffIndex /*effIndex*/)
822 {
824 }
825
831};
832
833// 66020 Chains of Ice
835{
837 {
838 // Get 0 effect aura
840 if (!slow)
841 return;
842
843 SpellEffectValue newAmount = std::min(slow->GetAmount() + aurEff->GetAmount(), 0.0);
844 slow->ChangeAmount(newAmount);
845 }
846
851};
852
853// 28471 - ClearAll
855{
856 void HandleScript(SpellEffIndex /*effIndex*/)
857 {
858 Unit* caster = GetCaster();
859 caster->RemoveAllAurasOnDeath();
860 }
861
866};
867
872
895
907
921
923{
936
937 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
938 {
939 Unit* caster = GetCaster();
940 Unit* target = GetTarget();
941 if (!caster)
942 return;
943
944 switch (GetSpellInfo()->Id)
945 {
949 {
950 prevItem = target->GetVirtualItemId(0);
951
952 if (Player* player = caster->ToPlayer())
953 {
954 if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
955 target->SetVirtualItem(0, mainItem->GetEntry());
956 }
957 else
958 target->SetVirtualItem(0, caster->GetVirtualItemId(0));
959 break;
960 }
963 {
964 prevItem = target->GetVirtualItemId(1);
965
966 if (Player* player = caster->ToPlayer())
967 {
968 if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
969 target->SetVirtualItem(1, offItem->GetEntry());
970 }
971 else
972 target->SetVirtualItem(1, caster->GetVirtualItemId(1));
973 break;
974 }
976 {
977 prevItem = target->GetVirtualItemId(2);
978
979 if (Player* player = caster->ToPlayer())
980 {
981 if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
982 target->SetVirtualItem(2, rangedItem->GetEntry());
983 }
984 else
985 target->SetVirtualItem(2, caster->GetVirtualItemId(2));
986 break;
987 }
988 default:
989 break;
990 }
991 }
992
993 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
994 {
995 Unit* target = GetTarget();
996
997 switch (GetSpellInfo()->Id)
998 {
1002 target->SetVirtualItem(0, prevItem);
1003 break;
1006 target->SetVirtualItem(1, prevItem);
1007 break;
1009 target->SetVirtualItem(2, prevItem);
1010 break;
1011 default:
1012 break;
1013 }
1014 }
1015
1021
1023};
1024
1026{
1027public:
1029
1031 {
1032 if (!_damagePct)
1034
1035 SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(_damagePct));
1036 }
1037
1042
1043private:
1045};
1046
1047// 28865 - Consumption
1048// 64208 - Consumption
1050{
1051 void CalculateDamage(SpellEffectInfo const& /*spellEffectInfo*/, Unit const* /*victim*/, int32& damage, int32& /*flatMod*/, float& /*pctMod*/) const
1052 {
1053 if (SpellInfo const* createdBySpell = sSpellMgr->GetSpellInfo(GetCaster()->m_unitData->CreatedBySpell, GetCastDifficulty()))
1054 damage = createdBySpell->GetEffect(EFFECT_1).CalcValueAsInt();
1055 }
1056
1061};
1062
1063// 63845 - Create Lance
1069
1071{
1072 bool Validate(SpellInfo const* /*spellInfo*/) override
1073 {
1074 return ValidateSpellInfo(
1075 {
1078 });
1079 }
1080
1082 {
1083 PreventHitDefaultEffect(effIndex);
1084
1085 if (Player* target = GetHitPlayer())
1086 {
1087 if (target->GetTeam() == ALLIANCE)
1089 else if (target->GetTeam() == HORDE)
1091 }
1092 }
1093
1098};
1099
1110
1112{
1113 bool Validate(SpellInfo const* spellInfo) override
1114 {
1115 switch (spellInfo->Id)
1116 {
1118 return ValidateSpellInfo(
1119 {
1122 });
1124 return ValidateSpellInfo(
1125 {
1128 });
1129 default:
1130 break;
1131 }
1132
1133 return false;
1134 }
1135
1136 void HandleScript(SpellEffIndex /*effIndex*/)
1137 {
1138 if (Player* player = GetHitPlayer())
1139 {
1140 uint8 gender = player->GetNativeGender();
1141
1142 uint32 spellId = GetSpellInfo()->Id;
1143
1144 switch (spellId)
1145 {
1148 break;
1151 break;
1152 default:
1153 break;
1154 }
1155
1156 GetCaster()->CastSpell(player, spellId, true);
1157 }
1158 }
1159
1164};
1165
1167{
1169 {
1170 if (Aura* aur = GetHitAura())
1171 aur->SetStackAmount(static_cast<uint8>(GetSpellInfo()->StackAmount));
1172 }
1173
1178};
1179
1181{
1182protected:
1184
1185 bool CheckProc(ProcEventInfo& eventInfo)
1186 {
1187 return (eventInfo.GetSpellInfo() == GetSpellInfo());
1188 }
1189
1190 void Decay(ProcEventInfo& /*eventInfo*/)
1191 {
1193 ModStackAmount(-1);
1194 }
1195
1201};
1202
1204{
1205 // found in sniffs, there is no duration entry we can possibly use
1206 AURA_DURATION = 12600
1208
1209// 32065 - Fungal Decay
1228
1229// 36659 - Tail Sting
1233
1240
1242{
1243 bool Validate(SpellInfo const* /*spellInfo*/) override
1244 {
1245 return ValidateSpellInfo(
1246 {
1250 });
1251 }
1252
1254 {
1255 if (GetCaster())
1256 {
1257 Unit* target = GetTarget();
1258
1259 for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
1261
1262 target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, aurEff);
1263 }
1264 else
1266 }
1267
1268 void RemoveVisualShields(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1269 {
1270 for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
1272 }
1273
1275 {
1276 if (Unit* caster = GetCaster())
1277 if (TempSummon* vehicle = caster->ToTempSummon())
1278 if (Unit* rider = vehicle->GetSummonerUnit())
1279 rider->RemoveAurasDueToSpell(GetId());
1280 }
1281
1282 void Register() override
1283 {
1284 /*
1285 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(m_scriptSpellId, DIFFICULTY_NONE);
1286
1287 // 6.x effects removed
1288
1289 // Defend spells cast by NPCs (add visuals)
1290 if (spell->GetEffect(EFFECT_0)->ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
1291 {
1292 AfterEffectApply += AuraEffectApplyFn(spell_gen_defend::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
1293 OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend::RemoveVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
1294 }
1295
1296 // Remove Defend spell from player when he dismounts
1297 if (spell->GetEffect(EFFECT_2)->ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
1298 OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
1299
1300 // Defend spells cast by players (add/remove visuals)
1301 if (spell->GetEffect(EFFECT_1)->ApplyAuraName == SPELL_AURA_DUMMY)
1302 {
1303 AfterEffectApply += AuraEffectApplyFn(spell_gen_defend::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
1304 OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend::RemoveVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
1305 }
1306 */
1307 }
1308};
1309
1311{
1312 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1313 {
1314 if (Creature* target = GetTarget()->ToCreature())
1315 target->DespawnOrUnsummon();
1316 }
1317
1322};
1323
1326{
1327 bool Load() override
1328 {
1329 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1330 }
1331
1332 void HandleDummy(SpellEffIndex /*effIndex*/)
1333 {
1336 }
1337
1342};
1343
1345{
1346 void HandleDespawn(SpellEffIndex /*effIndex*/)
1347 {
1349 if (Creature* target = GetHitCreature())
1350 target->DespawnOrUnsummon();
1351 }
1352
1357};
1358
1363
1364// 70769 Divine Storm!
1366{
1367 bool Load() override
1368 {
1369 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1370 }
1371
1372 bool Validate(SpellInfo const* /*spellInfo*/) override
1373 {
1375 }
1376
1377 void HandleScript(SpellEffIndex /*effIndex*/)
1378 {
1380 }
1381
1386};
1387
1392
1393// 28698 - Dreaming Glory
1395{
1396 bool Validate(SpellInfo const* /*spellInfo*/) override
1397 {
1399 }
1400
1401 void HandleScript(SpellEffIndex /*effIndex*/)
1402 {
1404 }
1405
1410};
1411
1413{
1414 void HandleScript(SpellEffIndex /*effIndex*/)
1415 {
1416 // Here the target is the water spout and determines the position where the player is knocked from
1417 if (Unit* target = GetHitUnit())
1418 {
1419 if (Player* player = GetCaster()->ToPlayer())
1420 {
1421 float horizontalSpeed = 20.0f + (40.0f - GetCaster()->GetDistance(target));
1422 float verticalSpeed = 8.0f;
1423 // This method relies on the Dalaran Sewer map disposition and Water Spout position
1424 // What we do is knock the player from a position exactly behind him and at the end of the pipe
1425 player->KnockbackFrom(target->GetPosition(), horizontalSpeed, verticalSpeed);
1426 }
1427 }
1428 }
1429
1434};
1435
1436// 50051 - Ethereal Pet Aura
1449
1450// 50051 - Ethereal Pet Aura
1452{
1453 bool CheckProc(ProcEventInfo& eventInfo)
1454 {
1455 uint32 levelDiff = std::abs(eventInfo.GetActor()->GetLevel() - eventInfo.GetActionTarget()->GetLevel());
1456 return levelDiff <= 9;
1457 }
1458
1459 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
1460 {
1462
1463 std::list<TempSummon*> minionList;
1465 for (Creature* minion : minionList)
1466 {
1467 if (minion->IsAIEnabled())
1468 {
1469 minion->AI()->Talk(SAY_STEAL_ESSENCE);
1470 minion->CastSpell(eventInfo.GetActionTarget(), SPELL_STEAL_ESSENCE_VISUAL);
1471 }
1472 }
1473 }
1474
1480};
1481
1482// 50052 - Ethereal Pet onSummon
1484{
1485 bool Validate(SpellInfo const* /*spellInfo*/) override
1486 {
1488 }
1489
1491 {
1492 Unit* target = GetHitUnit();
1493 target->CastSpell(target, SPELL_PROC_TRIGGER_ON_KILL_AURA, true);
1494 }
1495
1500};
1501
1502// 50055 - Ethereal Pet Aura Remove
1520
1521// 50101 - Ethereal Pet OnKill Steal Essence
1523{
1524 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1525 {
1526 if (Unit* caster = GetCaster())
1527 {
1528 caster->CastSpell(caster, SPELL_CREATE_TOKEN, true);
1529 if (Creature* soulTrader = caster->ToCreature())
1530 soulTrader->AI()->Talk(SAY_CREATE_TOKEN);
1531 }
1532 }
1533
1538};
1539
1559
1560/* 57337 - Great Feast
1561 57397 - Fish Feast
1562 58466 - Gigantic Feast
1563 58475 - Small Feast
1564 66477 - Bountiful Feast */
1566{
1583
1584 void HandleScript(SpellEffIndex /*effIndex*/)
1585 {
1586 Unit* target = GetHitUnit();
1587
1588 switch (GetSpellInfo()->Id)
1589 {
1590 case SPELL_GREAT_FEAST:
1591 target->CastSpell(target, SPELL_FEAST_FOOD);
1592 target->CastSpell(target, SPELL_FEAST_DRINK);
1594 break;
1595 case SPELL_FISH_FEAST:
1596 target->CastSpell(target, SPELL_FEAST_FOOD);
1597 target->CastSpell(target, SPELL_FEAST_DRINK);
1598 target->CastSpell(target, SPELL_FISH_FEAST_REFRESHMENT);
1599 break;
1601 target->CastSpell(target, SPELL_FEAST_FOOD);
1602 target->CastSpell(target, SPELL_FEAST_DRINK);
1604 break;
1605 case SPELL_SMALL_FEAST:
1606 target->CastSpell(target, SPELL_FEAST_FOOD);
1607 target->CastSpell(target, SPELL_FEAST_DRINK);
1609 break;
1612 target->CastSpell(target, SPELL_BOUNTIFUL_FEAST_DRINK);
1613 target->CastSpell(target, SPELL_BOUNTIFUL_FEAST_FOOD);
1614 break;
1615 default:
1616 break;
1617 }
1618 }
1619
1624};
1625
1626/*
1627There are only 3 possible flags Feign Death auras can apply: UNIT_DYNFLAG_DEAD, UNIT_FLAG2_FEIGN_DEATH
1628and UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT. Some auras can apply only 2 flags
1629
1630spell_gen_feign_death_all_flags applies all 3 flags
1631spell_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
1632spell_gen_feign_death_all_flags_no_uninteractible applies all 3 flags and additionally sets UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC
1633spell_gen_feign_death_no_dyn_flag applies no UNIT_DYNFLAG_DEAD (does not make the creature appear dead)
1634spell_gen_feign_death_no_prevent_emotes applies no UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
1635
1636REACT_PASSIVE should be handled directly in scripts since not all creatures should be passive. Otherwise
1637creature will be not able to aggro or execute MoveInLineOfSight events. Removing may cause more issues
1638than already exists
1639*/
1640
1642{
1643 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1644 {
1645 Unit* target = GetTarget();
1649
1650 if (Creature* creature = target->ToCreature())
1651 creature->SetReactState(REACT_PASSIVE);
1652 }
1653
1654 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1655 {
1656 Unit* target = GetTarget();
1660
1661 if (Creature* creature = target->ToCreature())
1662 creature->InitializeReactState();
1663 }
1664
1670};
1671
1673{
1674 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1675 {
1676 Unit* target = GetTarget();
1680 target->SetImmuneToAll(true);
1681 target->SetUninteractible(true);
1682
1683 if (Creature* creature = target->ToCreature())
1684 creature->SetReactState(REACT_PASSIVE);
1685 }
1686
1687 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1688 {
1689 Unit* target = GetTarget();
1693 target->SetImmuneToAll(false);
1694 target->SetUninteractible(false);
1695
1696 if (Creature* creature = target->ToCreature())
1697 creature->InitializeReactState();
1698 }
1699
1705};
1706
1707// 96733 - Permanent Feign Death (Stun)
1709{
1710 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
1711 {
1712 Unit* target = GetTarget();
1716 target->SetImmuneToAll(true);
1717
1718 if (Creature* creature = target->ToCreature())
1719 creature->SetReactState(REACT_PASSIVE);
1720 }
1721
1722 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
1723 {
1724 Unit* target = GetTarget();
1728 target->SetImmuneToAll(false);
1729
1730 if (Creature* creature = target->ToCreature())
1731 creature->InitializeReactState();
1732 }
1733
1739};
1740
1741// 35357 - Spawn Feign Death
1742// 51329 - Feign Death
1744{
1745 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1746 {
1747 Unit* target = GetTarget();
1750
1751 if (Creature* creature = target->ToCreature())
1752 creature->SetReactState(REACT_PASSIVE);
1753 }
1754
1755 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1756 {
1757 Unit* target = GetTarget();
1760
1761 if (Creature* creature = target->ToCreature())
1762 creature->InitializeReactState();
1763 }
1764
1770};
1771
1772// 58951 - Permanent Feign Death
1774{
1775 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1776 {
1777 Unit* target = GetTarget();
1780
1781 if (Creature* creature = target->ToCreature())
1782 creature->SetReactState(REACT_PASSIVE);
1783 }
1784
1785 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1786 {
1787 Unit* target = GetTarget();
1790
1791 if (Creature* creature = target->ToCreature())
1792 creature->InitializeReactState();
1793 }
1794
1800};
1801
1808
1809// 35491 - Furious Rage
1811{
1812 bool Validate(SpellInfo const* /*spellInfo*/) override
1813 {
1814 return ValidateSpellInfo({ SPELL_EXHAUSTION }) &&
1817 }
1818
1819 void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1820 {
1821 Unit* target = GetTarget();
1822 target->Unit::TextEmote(EMOTE_FURIOUS_RAGE, target, false);
1823 }
1824
1825 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1826 {
1827 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
1828 return;
1829
1830 Unit* target = GetTarget();
1831 target->Unit::TextEmote(EMOTE_EXHAUSTED, target, false);
1832 target->CastSpell(target, SPELL_EXHAUSTION, true);
1833 }
1834
1840};
1841
1842// 46642 - 5,000 Gold
1844{
1845 void HandleScript(SpellEffIndex /*effIndex*/)
1846 {
1847 if (Player* target = GetHitPlayer())
1848 target->ModifyMoney(5000 * GOLD);
1849 }
1850
1855};
1856
1862
1863// 131474 - Fishing
1865{
1866 bool Validate(SpellInfo const* /*spellInfo*/) override
1867 {
1869 }
1870
1871 bool Load() override
1872 {
1873 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1874 }
1875
1877 {
1878 PreventHitDefaultEffect(effIndex);
1879 uint32 spellId;
1881 if (!mainHand || mainHand->GetTemplate()->GetClass() != ITEM_CLASS_WEAPON || mainHand->GetTemplate()->GetSubClass() != ITEM_SUBCLASS_WEAPON_FISHING_POLE)
1883 else
1884 spellId = SPELL_FISHING_WITH_POLE;
1885
1886 GetCaster()->CastSpell(GetCaster(), spellId, false);
1887 }
1888
1893};
1894
1901
1903{
1904 bool Validate(SpellInfo const* /*spellInfo*/) override
1905 {
1906 return ValidateSpellInfo(
1907 {
1911 });
1912 }
1913
1914 void HandleDummy(SpellEffIndex /* effIndex */)
1915 {
1916 Unit* caster = GetCaster();
1917 int32 r = irand(0, 119);
1918 if (r < 20) // Transporter Malfunction - 1/6 polymorph
1920 else if (r < 100) // Evil Twin - 4/6 evil twin
1921 caster->CastSpell(caster, SPELL_TRANSPORTER_EVIL_TWIN, true);
1922 else // Transporter Malfunction - 1/6 miss the target
1923 caster->CastSpell(caster, SPELL_TRANSPORTER_MALFUNCTION_MISS, true);
1924 }
1925
1930};
1931
1932// 28880 - Warrior
1933// 59542 - Paladin
1934// 59543 - Hunter
1935// 59544 - Priest
1936// 59545 - Death Knight
1937// 59547 - Shaman
1938// 59548 - Mage
1939// 121093 - Monk
1941{
1942 bool Validate(SpellInfo const* spellInfo) override
1943 {
1944 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
1945 }
1946
1947 void CalculateAmount(AuraEffect const* aurEff, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
1948 {
1949 if (!GetCaster() || !aurEff->GetTotalTicks())
1950 return;
1951
1952 SpellEffectValue healPct = GetEffectInfo(EFFECT_1).CalcValue() / 100.0;
1953 SpellEffectValue heal = healPct * GetCaster()->GetMaxHealth();
1954 SpellEffectValue healTick = std::floor(heal / aurEff->GetTotalTicks());
1955 amount += healTick;
1956 }
1957
1962};
1963
1969
1971{
1972 bool Validate(SpellInfo const* /*spellInfo*/) override
1973 {
1974 return ValidateSpellInfo(
1975 {
1978 });
1979 }
1980
1985
1990};
1991
1992// 69641 - Gryphon/Wyvern Pet - Mounting Check Aura
1994{
1995 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
1996 {
1997 Unit* target = GetTarget();
1998 Unit* owner = target->GetOwner();
1999
2000 if (!owner)
2001 return;
2002
2003 if (owner->IsMounted())
2004 target->SetDisableGravity(true);
2005 else
2006 target->SetDisableGravity(false);
2007 }
2008
2013};
2014
2015/* 9204 - Hate to Zero (Melee)
2016 20538 - Hate to Zero (AoE)
2017 26569 - Hate to Zero (AoE)
2018 26637 - Hate to Zero (AoE, Unique)
2019 37326 - Hate to Zero (AoE)
2020 40410 - Hate to Zero (Should be added, AoE)
2021 40467 - Hate to Zero (Should be added, AoE)
2022 41582 - Hate to Zero (Should be added, Melee) */
2024{
2025 void HandleDummy(SpellEffIndex /*effIndex*/)
2026 {
2027 if (GetCaster()->CanHaveThreatList())
2029 }
2030
2035};
2036
2037// This spell is used by both player and creature, but currently works only if used by player
2038// 63984 - Hate to Zero
2040{
2041 void HandleDummy(SpellEffIndex /*effIndex*/)
2042 {
2043 if (Unit* target = GetHitUnit())
2044 if (target->CanHaveThreatList())
2045 target->GetThreatManager().ModifyThreatByPercent(GetCaster(), -100);
2046 }
2047
2052};
2053
2054// 19707 - Hate to 50%
2056{
2057 void HandleDummy(SpellEffIndex /*effIndex*/)
2058 {
2059 if (GetCaster()->CanHaveThreatList())
2061 }
2062
2067};
2068
2069// 26886 - Hate to 75%
2071{
2072 void HandleDummy(SpellEffIndex /*effIndex*/)
2073 {
2074 if (GetCaster()->CanHaveThreatList())
2076 }
2077
2082};
2083
2088
2089// 32748 - Deadly Throw Interrupt
2090// 44835 - Maim Interrupt
2092{
2093 bool Validate(SpellInfo const* /*spellInfo*/) override
2094 {
2096 }
2097
2098 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2099 {
2102 }
2103
2108};
2109
2110// To be added: 19633, 20686, 23382, 31389, 32959
2112{
2113public:
2114 explicit spell_gen_knock_away_threat_reduction(int32 threatPercent) : _threatPercent(threatPercent) { }
2115
2116private:
2118
2119 void HandleScript(SpellEffIndex /*effIndex*/)
2120 {
2121 if (GetCaster()->CanHaveThreatList())
2123 }
2124
2129};
2130
2132{
2133 void HandleDummy(SpellEffIndex /*effIndex*/)
2134 {
2135 if (GetHitUnit()->IsInRaidWith(GetCaster()))
2136 GetCaster()->CastSpell(GetCaster(), GetEffectValueAsInt() + 1, true); // raid buff
2137 else
2138 GetCaster()->CastSpell(GetHitUnit(), GetEffectValueAsInt(), true); // single-target buff
2139 }
2140
2145};
2146
2155
2157{
2158public:
2160
2161private:
2162 bool Validate(SpellInfo const* /*spellInfo*/) override
2163 {
2164 return ValidateSpellInfo({ _spellId });
2165 }
2166
2167 void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
2168 {
2169 // final heal only on duration end or dispel
2170 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
2171 return;
2172
2173 // final heal
2174 GetTarget()->CastSpell(GetTarget(), _spellId, CastSpellExtraArgs(aurEff).SetOriginalCaster(GetCasterGUID()));
2175 }
2176
2181
2183};
2184
2185/* DOCUMENTATION: Charge spells
2186 Charge spells can be classified in four groups:
2187
2188 - Spells on vehicle bar used by players:
2189 + EFFECT_0: SCRIPT_EFFECT
2190 + EFFECT_1: TRIGGER_SPELL
2191 + EFFECT_2: NONE
2192 - Spells cast by player's mounts triggered by script:
2193 + EFFECT_0: CHARGE
2194 + EFFECT_1: TRIGGER_SPELL
2195 + EFFECT_2: APPLY_AURA
2196 - Spells cast by players on the target triggered by script:
2197 + EFFECT_0: SCHOOL_DAMAGE
2198 + EFFECT_1: SCRIPT_EFFECT
2199 + EFFECT_2: NONE
2200 - Spells cast by NPCs on players:
2201 + EFFECT_0: SCHOOL_DAMAGE
2202 + EFFECT_1: CHARGE
2203 + EFFECT_2: SCRIPT_EFFECT
2204
2205 In the following script we handle the SCRIPT_EFFECT and CHARGE
2206 - When handling SCRIPT_EFFECT:
2207 + EFFECT_0: Corresponds to "Spells on vehicle bar used by players" and we make player's mount cast
2208 the charge effect on the current target ("Spells cast by player's mounts triggered by script").
2209 + EFFECT_1 and EFFECT_2: Triggered when "Spells cast by player's mounts triggered by script" hits target,
2210 corresponding to "Spells cast by players on the target triggered by script" and "Spells cast by
2211 NPCs on players" and we check Defend layers and drop a charge of the first found.
2212 - When handling CHARGE:
2213 + Only launched for "Spells cast by player's mounts triggered by script", makes the player cast the
2214 damaging spell on target with a small chance of failing it.
2215*/
2216
2234
2236{
2237 bool Validate(SpellInfo const* /*spellInfo*/) override
2238 {
2239 return ValidateSpellInfo({ 62552, 62719, 64100, 66482 });
2240 }
2241
2243 {
2244 Unit* target = GetHitUnit();
2245
2246 switch (effIndex)
2247 {
2248 case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
2249 {
2250 uint32 spellId;
2251
2252 switch (GetSpellInfo()->Id)
2253 {
2256 break;
2259 break;
2260 default:
2261 return;
2262 }
2263
2264 // If target isn't a training dummy there's a chance of failing the charge
2265 if (!target->IsCharmedOwnedByPlayerOrPlayer() && roll_chance(12.5f))
2266 spellId = SPELL_CHARGE_MISS_EFFECT;
2267
2268 if (Unit* vehicle = GetCaster()->GetVehicleBase())
2269 vehicle->CastSpell(target, spellId, false);
2270 else
2271 GetCaster()->CastSpell(target, spellId, false);
2272 break;
2273 }
2274 case EFFECT_1: // On damaging spells, for removing a defend layer
2275 case EFFECT_2:
2276 {
2277 Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
2278 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
2279 {
2280 if (Aura* aura = itr->second->GetBase())
2281 {
2282 if (aura->GetId() == 62552 || aura->GetId() == 62719 || aura->GetId() == 64100 || aura->GetId() == 66482)
2283 {
2284 aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
2285 // Remove dummys from rider (Necessary for updating visual shields)
2286 if (Unit* rider = target->GetCharmer())
2287 if (Aura* defend = rider->GetAura(aura->GetId()))
2288 defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
2289 break;
2290 }
2291 }
2292 }
2293 break;
2294 }
2295 default:
2296 break;
2297 }
2298 }
2299
2301 {
2302 uint32 spellId;
2303
2304 switch (GetSpellInfo()->Id)
2305 {
2307 spellId = SPELL_CHARGE_DAMAGE_8K5;
2308 break;
2311 spellId = SPELL_CHARGE_DAMAGE_20K;
2312 break;
2315 spellId = SPELL_CHARGE_DAMAGE_45K;
2316 break;
2317 default:
2318 return;
2319 }
2320
2321 if (Unit* rider = GetCaster()->GetCharmer())
2322 rider->CastSpell(GetHitUnit(), spellId, false);
2323 else
2324 GetCaster()->CastSpell(GetHitUnit(), spellId, false);
2325 }
2326
2337};
2338
2340{
2341 SPELL_FALL_DOWN = 6869
2343
2344// 6870 Moss Covered Feet
2345// 31399 Moss Covered Feet
2347{
2348 bool Validate(SpellInfo const* /*spellInfo*/) override
2349 {
2351 }
2352
2353 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2354 {
2356 eventInfo.GetActionTarget()->CastSpell(nullptr, SPELL_FALL_DOWN, aurEff);
2357 }
2358
2363};
2364
2369
2370// 28702 - Netherbloom
2372{
2373 bool Validate(SpellInfo const* /*spellInfo*/) override
2374 {
2375 for (uint8 i = 0; i < 5; ++i)
2377 return false;
2378
2379 return true;
2380 }
2381
2383 {
2384 PreventHitDefaultEffect(effIndex);
2385
2386 if (Unit* target = GetHitUnit())
2387 {
2388 // 25% chance of casting a random buff
2389 if (roll_chance(75))
2390 return;
2391
2392 // triggered spells are 28703 to 28707
2393 // Note: some sources say, that there was the possibility of
2394 // receiving a debuff. However, this seems to be removed by a patch.
2395
2396 // don't overwrite an existing aura
2397 for (uint8 i = 0; i < 5; ++i)
2398 if (target->HasAura(SPELL_NETHERBLOOM_POLLEN_1 + i))
2399 return;
2400
2401 target->CastSpell(target, SPELL_NETHERBLOOM_POLLEN_1 + urand(0, 4), true);
2402 }
2403 }
2404
2409};
2410
2415
2416// 28720 - Nightmare Vine
2418{
2419 bool Validate(SpellInfo const* /*spellInfo*/) override
2420 {
2422 }
2423
2425 {
2426 PreventHitDefaultEffect(effIndex);
2427
2428 if (Unit* target = GetHitUnit())
2429 {
2430 // 25% chance of casting Nightmare Pollen
2431 if (roll_chance(25))
2432 target->CastSpell(target, SPELL_NIGHTMARE_POLLEN, true);
2433 }
2434 }
2435
2440};
2441
2442// 27746 - Nitrous Boost
2444{
2445 void PeriodicTick(AuraEffect const* /*aurEff*/)
2446 {
2448
2449 if (GetCaster() && GetTarget()->GetPower(POWER_MANA) >= 10)
2451 else
2452 Remove();
2453 }
2454
2459};
2460
2470
2471// 27539 - Obsidian Armor
2473{
2486
2487 bool CheckProc(ProcEventInfo& eventInfo)
2488 {
2489 if (!eventInfo.GetSpellInfo())
2490 return false;
2491
2493 return false;
2494
2495 return true;
2496 }
2497
2498 void OnProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2499 {
2501
2502 uint32 spellId = 0;
2503 switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
2504 {
2505 case SPELL_SCHOOL_HOLY:
2507 break;
2508 case SPELL_SCHOOL_FIRE:
2510 break;
2513 break;
2514 case SPELL_SCHOOL_FROST:
2516 break;
2519 break;
2522 break;
2523 default:
2524 return;
2525 }
2526 GetTarget()->CastSpell(GetTarget(), spellId, aurEff);
2527 }
2528
2534};
2535
2537{
2538 bool Validate(SpellInfo const* spellInfo) override
2539 {
2540 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
2541 }
2542
2543 bool Load() override
2544 {
2545 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2546 }
2547
2548 void HandleDummy(SpellEffIndex /*effIndex*/)
2549 {
2550 Player* player = GetCaster()->ToPlayer();
2551 uint32 factionId = GetEffectInfo().CalcValueAsInt();
2553
2554 FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
2555 if (!factionEntry)
2556 return;
2557
2558 // Set rep to baserep + basepoints (expecting spillover for oposite faction -> become hated)
2559 // Not when player already has equal or higher rep with this faction
2560 if (player->GetReputationMgr().GetReputation(factionEntry) < repChange)
2561 player->GetReputationMgr().SetReputation(factionEntry, repChange);
2562
2563 // EFFECT_INDEX_2 most likely update at war state, we already handle this in SetReputation
2564 }
2565
2570};
2571
2578
2580{
2581 bool Validate(SpellInfo const* /*spellInfo*/) override
2582 {
2583 return ValidateSpellInfo(
2584 {
2588 });
2589 }
2590
2591 void HandleScript(SpellEffIndex /*effIndex*/)
2592 {
2593 Unit* caster = GetCaster();
2594 if (Player* target = GetHitPlayer())
2595 {
2596 uint8 gender = target->GetNativeGender();
2597 if (!gender)
2598 caster->CastSpell(target, SPELL_ORC_DISGUISE_MALE, true);
2599 else
2600 caster->CastSpell(target, SPELL_ORC_DISGUISE_FEMALE, true);
2601 }
2602 }
2603
2608};
2609
2611{
2612 SPELL_PARALYSIS = 35202
2614
2615// 35201 - Paralytic Poison
2617{
2618 bool Validate(SpellInfo const* /*spellInfo*/) override
2619 {
2621 }
2622
2623 void HandleStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
2624 {
2625 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
2626 return;
2627
2628 GetTarget()->CastSpell(nullptr, SPELL_PARALYSIS, aurEff);
2629 }
2630
2635};
2636
2657
2659{
2660 bool Validate(SpellInfo const* spellInfo) override
2661 {
2662 return sBroadcastTextStore.HasRecord(uint32(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()));
2663 }
2664
2665 void HandleScript(SpellEffIndex /*effIndex*/)
2666 {
2667 // Note: target here is always player; caster here is gameobject, creature or player (self cast)
2668 if (Unit* target = GetHitUnit())
2669 target->Unit::Say(uint32(GetEffectValueAsInt()), target);
2670 }
2671
2676};
2677
2679{
2680 bool CheckProc(ProcEventInfo& eventInfo)
2681 {
2682 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
2683 if (!damageInfo || !damageInfo->GetDamage())
2684 return false;
2685
2687
2688 if (eventInfo.GetActionTarget()->HealthBelowPctDamaged(pct, damageInfo->GetDamage()))
2689 return true;
2690
2691 return false;
2692 }
2693
2698};
2699
2701{
2702 void HandleChargeDrop(ProcEventInfo& /*eventInfo*/)
2703 {
2705 }
2706
2711};
2712
2718
2719// 45472 Parachute
2721{
2722 bool Validate(SpellInfo const* /*spellInfo*/) override
2723 {
2724 return ValidateSpellInfo(
2725 {
2728 });
2729 }
2730
2731 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
2732 {
2733 if (Player* target = GetTarget()->ToPlayer())
2734 if (target->IsFalling())
2735 {
2736 target->RemoveAurasDueToSpell(SPELL_PARACHUTE);
2737 target->CastSpell(target, SPELL_PARACHUTE_BUFF, true);
2738 }
2739 }
2740
2745};
2746
2748{
2751 NPC_IMP = 416
2753
2755{
2756 bool Load() override
2757 {
2758 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2759 }
2760
2761 void HandleScript(SpellEffIndex /*effIndex*/)
2762 {
2763 Player* player = GetCaster()->ToPlayer();
2764 if (player->GetLastPetNumber())
2765 {
2766 PetType newPetType = (player->GetClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
2767 Pet* newPet = new Pet(player, newPetType);
2768 if (newPet->LoadPetFromDB(player, 0, player->GetLastPetNumber(), true))
2769 {
2770 // revive the pet if it is dead
2771 if (newPet->getDeathState() != ALIVE && newPet->getDeathState() != JUST_RESPAWNED)
2773
2774 newPet->SetFullHealth();
2775 newPet->SetFullPower(newPet->GetPowerType());
2776
2777 switch (newPet->GetEntry())
2778 {
2779 case NPC_DOOMGUARD:
2780 case NPC_INFERNAL:
2781 newPet->SetEntry(NPC_IMP);
2782 break;
2783 default:
2784 break;
2785 }
2786 }
2787 else
2788 delete newPet;
2789 }
2790 }
2791
2796};
2797
2798// 36553 - PetWait
2800{
2801 void HandleScript(SpellEffIndex /*effIndex*/)
2802 {
2805 }
2806
2811};
2812
2817
2819{
2820 bool Load() override
2821 {
2822 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2823 }
2824
2826 {
2827 Player* player = GetCaster()->ToPlayer();
2828
2829 if (HasDiscoveredAllSpells(GetSpellInfo()->Id, player))
2830 {
2833 }
2834
2835 return SPELL_CAST_OK;
2836 }
2837
2838 void HandleScript(SpellEffIndex /*effIndex*/)
2839 {
2840 Player* caster = GetCaster()->ToPlayer();
2841 uint32 spellId = GetSpellInfo()->Id;
2842
2843 // Learn random explicit discovery recipe (if any)
2844 // Players will now learn 3 recipes the very first time they perform Northrend Inscription Research (3.3.0 patch notes)
2845 if (spellId == SPELL_NORTHREND_INSCRIPTION_RESEARCH && !HasDiscoveredAnySpell(spellId, caster))
2846 for (int i = 0; i < 2; ++i)
2847 if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
2848 caster->LearnSpell(discoveredSpellId, false);
2849
2850 if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
2851 caster->LearnSpell(discoveredSpellId, false);
2852 }
2853
2859};
2860
2866
2868{
2870 {
2871 Player* caster = GetCaster()->ToPlayer();
2872
2873 switch (caster->GetEffectiveTeam())
2874 {
2875 case ALLIANCE:
2877 break;
2878 case HORDE:
2880 break;
2881 default:
2882 break;
2883 }
2884 }
2885
2890};
2891
2893{
2894 void HandleScript(SpellEffIndex /*effIndex*/)
2895 {
2896 if (Unit* target = GetHitUnit())
2897 {
2898 target->RemoveAurasByType(SPELL_AURA_FLY);
2899 target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
2900 }
2901 }
2902
2907};
2908
2909// 20589 - Escape artist
2922
2923// 23493 - Restoration
2924// 24379 - Restoration
2926{
2927 void PeriodicTick(AuraEffect const* /*aurEff*/)
2928 {
2930
2931 Unit* target = GetTarget();
2932 if (!target)
2933 return;
2934
2935 int32 heal = target->CountPctFromMaxHealth(10);
2936 HealInfo healInfo(target, target, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
2937 target->HealBySpell(healInfo);
2938
2940 if (int32 mana = target->GetMaxPower(POWER_MANA))
2941 {
2942 mana /= 10;
2943 target->EnergizeBySpell(target, GetSpellInfo(), mana, POWER_MANA);
2944 }
2945 }
2946
2951};
2952
2953// 38772 Grievous Wound
2954// 43937 Grievous Wound
2955// 62331 Impale
2956// 62418 Impale
2958{
2959 bool Validate(SpellInfo const* spellInfo) override
2960 {
2961 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
2962 }
2963
2964 void PeriodicTick(AuraEffect const* /*aurEff*/)
2965 {
2966 // they apply damage so no need to check for ticks here
2967
2968 if (GetTarget()->HealthAbovePct(GetEffectInfo(EFFECT_1).CalcValue()))
2969 {
2972 }
2973 }
2974
2979};
2980
2981// 31956 Grievous Wound
2982// 38801 Grievous Wound
2983// 43093 Grievous Throw
2984// 58517 Grievous Wound
2985// 59262 Grievous Wound
2987{
2988 void PeriodicTick(AuraEffect const* aurEff)
2989 {
2990 // if it has only periodic effect, allow 1 tick
2991 bool onlyEffect = GetSpellInfo()->GetEffects().size() == 1;
2992 if (onlyEffect && aurEff->GetTickNumber() <= 1)
2993 return;
2994
2995 if (GetTarget()->IsFullHealth())
2996 {
2999 }
3000 }
3001
3006};
3007
3008// 70292 - Glacial Strike
3009// 71316 - Glacial Strike
3011{
3012 void PeriodicTick(AuraEffect const* /*aurEff*/)
3013 {
3014 // they apply damage so no need to check for ticks here
3015
3016 if (GetTarget()->IsFullHealth())
3017 {
3020 }
3021 }
3022
3027};
3028
3034
3036{
3037public:
3038 bool operator()(WorldObject* obj) const
3039 {
3040 if (Unit* target = obj->ToUnit())
3041 return target->GetPowerType() != POWER_MANA;
3042
3043 return true;
3044 }
3045};
3046
3048{
3049 void RemoveInvalidTargets(std::list<WorldObject*>& targets)
3050 {
3051 // In arenas Replenishment may only affect the caster
3052 if (Player* caster = GetCaster()->ToPlayer())
3053 {
3054 if (caster->InArena())
3055 {
3056 targets.clear();
3057 targets.push_back(caster);
3058 return;
3059 }
3060 }
3061
3062 targets.remove_if(ReplenishmentCheck());
3063
3064 uint8 const maxTargets = 10;
3065
3066 if (targets.size() > maxTargets)
3067 {
3069 targets.resize(maxTargets);
3070 }
3071 }
3072
3077};
3078
3080{
3081 bool Load() override
3082 {
3083 return GetUnitOwner()->GetPowerType() == POWER_MANA;
3084 }
3085
3086 void CalculateAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
3087 {
3088 switch (GetSpellInfo()->Id)
3089 {
3091 amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f;
3092 break;
3094 amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f;
3095 break;
3096 default:
3097 break;
3098 }
3099 }
3100
3105};
3106
3107// 32343 - Revive Self
3109{
3110 void HandleDummy(SpellEffIndex /*effIndex*/)
3111 {
3114 }
3115
3120};
3121
3126
3128{
3129 bool Validate(SpellInfo const* /*spell*/) override
3130 {
3132 }
3133
3138
3139 void Register() override
3140 {
3141 }
3142};
3143
3145{
3146 bool Validate(SpellInfo const* /*spell*/) override
3147 {
3149 return false;
3150 return true;
3151 }
3152
3153 void HandleMount(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
3154 {
3155 Unit* target = GetTarget();
3157
3158 target->Mount(DISPLAYID_HIDDEN_MOUNT, 0, 0);
3159
3160 // cast speed aura
3161 if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(aurEff->GetAmountAsInt()))
3162 target->CastSpell(target, mountCapability->ModSpellAuraID, TRIGGERED_FULL_MASK);
3163 }
3164
3169};
3170
3172{
3174 {
3175 if (GetCaster()->IsInCombat())
3176 {
3179 }
3180
3181 // Player cannot transform to human form if he is forced to be worgen for some reason (Darkflight)
3183 if (std::distance(alteredFormAuras.begin(), alteredFormAuras.end()) > 1)
3184 {
3187 }
3188
3189 return SPELL_CAST_OK;
3190 }
3191
3193 {
3194 Unit* target = GetHitUnit();
3195 PreventHitDefaultEffect(effIndex);
3198 else // Basepoints 1 for this aura control whether to trigger transform transition animation or not.
3200 }
3201
3207};
3208
3221
3226
3228{
3229 bool Validate(SpellInfo const* /*spellInfo*/) override
3230 {
3232 }
3233
3234 bool Load() override
3235 {
3236 return GetGObjCaster()->GetOwnerGUID().IsPlayer();
3237 }
3238
3240 {
3241 if (Unit* owner = GetGObjCaster()->GetOwner())
3242 if (GameObject* go = GetHitGObj())
3243 if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING)
3244 owner->CastSpell(nullptr, SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT, true);
3245 }
3246
3251};
3252
3254
3268
3270{
3271 bool Load() override
3272 {
3274 }
3275
3276 void HandleDummy(SpellEffIndex /* effIndex */)
3277 {
3278 Player* originalCaster = GetOriginalCaster()->ToPlayer();
3279 if (Unit* target = GetHitUnit())
3280 {
3282 spiritHealerConfirm.Npc = target->GetGUID();
3284 spiritHealerConfirm.Success = true;
3285 originalCaster->SendDirectMessage(spiritHealerConfirm.Write());
3286 }
3287 }
3288
3293};
3294
3299
3301{
3302 bool Validate(SpellInfo const* /*spellInfo*/) override
3303 {
3305 }
3306
3320
3325};
3326
3327// 41213, 43416, 69222, 73076 - Throw Shield
3341
3347
3349{
3350 bool Validate(SpellInfo const* /*spellInfo*/) override
3351 {
3352 return ValidateSpellInfo(
3353 {
3356 });
3357 }
3358
3360 {
3361 if (Unit* rider = GetCaster()->GetCharmer())
3362 {
3363 if (Player* playerTarget = GetHitPlayer())
3364 {
3365 if (playerTarget->HasAura(SPELL_ON_TOURNAMENT_MOUNT) && playerTarget->GetVehicleBase())
3366 rider->CastSpell(playerTarget, SPELL_MOUNTED_DUEL, true);
3367 }
3368 else if (Unit* unitTarget = GetHitUnit())
3369 {
3370 if (unitTarget->GetCharmer() && unitTarget->GetCharmer()->GetTypeId() == TYPEID_PLAYER && unitTarget->GetCharmer()->HasAura(SPELL_ON_TOURNAMENT_MOUNT))
3371 rider->CastSpell(unitTarget->GetCharmer(), SPELL_MOUNTED_DUEL, true);
3372 }
3373 }
3374 }
3375
3380};
3381
3383{
3384 bool Load() override
3385 {
3386 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
3387 }
3388
3389 void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
3390 {
3391 if (Unit* caster = GetCaster())
3392 if (!caster->GetVehicleBase())
3393 caster->RemoveAurasDueToSpell(GetId());
3394 }
3395
3400};
3401
3409
3411{
3412 void HandleScript(SpellEffIndex /* effIndex */)
3413 {
3414 Unit* target = GetHitUnit();
3415 if (target->GetTypeId() != TYPEID_PLAYER)
3416 return;
3417
3418 // return from top
3419 if (target->ToPlayer()->GetAreaId() == AREA_VIOLET_CITADEL_SPIRE)
3420 target->CastSpell(target, SPELL_TELEPORT_SPIRE_DOWN, true);
3421 // teleport atop
3422 else
3423 target->CastSpell(target, SPELL_TELEPORT_SPIRE_UP, true);
3424 }
3425
3430};
3431
3433{
3434 bool Validate(SpellInfo const* spellInfo) override
3435 {
3436 return ValidateSpellInfo({ spellInfo->ExcludeCasterAuraSpell });
3437 }
3438
3440 {
3441 // Blizz seems to just apply aura without bothering to cast
3442 GetCaster()->AddAura(GetSpellInfo()->ExcludeCasterAuraSpell, GetCaster());
3443 }
3444
3449};
3450
3452{
3453 bool Validate(SpellInfo const* spellInfo) override
3454 {
3455 return ValidateSpellInfo({ spellInfo->ExcludeTargetAuraSpell });
3456 }
3457
3459 {
3460 if (Unit* target = GetHitUnit())
3461 // Blizz seems to just apply aura without bothering to cast
3462 GetCaster()->AddAura(GetSpellInfo()->ExcludeTargetAuraSpell, target);
3463 }
3464
3469};
3470
3476
3477template <uint32 TriggeredSpellId>
3479{
3480 bool Validate(SpellInfo const* /*spellInfo*/) override
3481 {
3482 return ValidateSpellInfo({ TriggeredSpellId });
3483 }
3484
3486 {
3487 /*
3488 * @workaround: PendingCast flag normally means 'triggered' spell, however
3489 * if the spell is cast triggered, the core won't send SMSG_SPELL_GO packet
3490 * so client never registers the cooldown (see Spell::IsNeedSendToClient)
3491 *
3492 * ServerToClient: SMSG_SPELL_GO (0x0132) Length: 42 ConnIdx: 0 Time: 07/19/2010 02:32:35.000 Number: 362675
3493 * Caster GUID: Full: Player
3494 * Caster Unit GUID: Full: Player
3495 * Cast Count: 0
3496 * Spell ID: 72752 (72752)
3497 * Cast Flags: PendingCast, Unknown3, Unknown7 (265)
3498 * Time: 3901468825
3499 * Hit Count: 1
3500 * [0] Hit GUID: Player
3501 * Miss Count: 0
3502 * Target Flags: Unit (2)
3503 * Target GUID: 0x0
3504 */
3505
3506 // Spell flags need further research, until then just cast not triggered
3507 GetCaster()->CastSpell(nullptr, TriggeredSpellId, false);
3508 }
3509
3514};
3515
3520
3522{
3523 void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
3524 {
3525 // store stack apply times, so we can pop them while they expire
3527 Unit* target = GetTarget();
3528
3529 // on stack 15 cast the achievement crediting spell
3530 if (GetStackAmount() >= 15)
3531 target->CastSpell(target, SPELL_TURKEY_VENGEANCE, CastSpellExtraArgs(aurEff)
3532 .SetOriginalCaster(GetCasterGUID()));
3533 }
3534
3535 void OnPeriodic(AuraEffect const* /*aurEff*/)
3536 {
3537 int32 removeCount = 0;
3538
3539 // pop expired times off of the stack
3540 while (!_applyTimes.empty() && _applyTimes.front() + GetMaxDuration() < GameTime::GetGameTimeMS())
3541 {
3542 _applyTimes.pop_front();
3543 removeCount++;
3544 }
3545
3546 if (removeCount)
3548 }
3549
3555
3556 std::list<uint32> _applyTimes;
3557};
3558
3567
3569{
3570 void HandleScript(SpellEffIndex /*effIndex*/)
3571 {
3572 if (Player* player = GetHitPlayer())
3573 {
3575 // player can only have one of these items
3576 for (uint8 i = 0; i < 5; ++i)
3577 {
3578 if (player->HasItemCount(itemId[i], 1, true))
3579 return;
3580 }
3581
3582 CreateItem(itemId[urand(0, 4)], ItemContext::NONE);
3583 }
3584 }
3585
3590};
3591
3596
3597// 52723 - Vampiric Touch
3598// 60501 - Vampiric Touch
3600{
3601 bool Validate(SpellInfo const* /*spellInfo*/) override
3602 {
3604 }
3605
3606 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
3607 {
3609 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
3610 if (!damageInfo || !damageInfo->GetDamage())
3611 return;
3612
3613 Unit* caster = eventInfo.GetActor();
3614 CastSpellExtraArgs args(aurEff);
3615 args.AddSpellBP0(damageInfo->GetDamage() / 2);
3616 caster->CastSpell(caster, SPELL_VAMPIRIC_TOUCH_HEAL, args);
3617 }
3618
3623};
3624
3626{
3627 SPELL_GEAR_SCALING = 66668
3629
3631{
3632 bool Load() override
3633 {
3634 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
3635 }
3636
3637 void CalculateAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
3638 {
3639 Unit* caster = GetCaster();
3640 float factor;
3641 float baseItemLevel;
3642
3644 switch (GetId())
3645 {
3646 case SPELL_GEAR_SCALING:
3647 factor = 1.0f;
3648 baseItemLevel = 205.0f;
3649 break;
3650 default:
3651 factor = 1.0f;
3652 baseItemLevel = 170.0f;
3653 break;
3654 }
3655
3656 float avgILvl = caster->ToPlayer()->GetAverageItemLevel();
3657 if (avgILvl < baseItemLevel)
3658 return;
3659
3660 amount = (avgILvl - baseItemLevel) * factor;
3661 }
3662
3669};
3670
3676
3678{
3679 void HandleDummy(SpellEffIndex /* effIndex */)
3680 {
3681 if (Creature* vendor = GetCaster()->ToCreature())
3682 if (vendor->GetEntry() == NPC_AMPHITHEATER_VENDOR)
3683 vendor->AI()->Talk(SAY_AMPHITHEATER_VENDOR);
3684 }
3685
3690};
3691
3693{
3695 {
3696 if (!GetSpellInfo()->CheckTargetCreatureType(GetCaster()))
3698 return SPELL_CAST_OK;
3699 }
3700
3705};
3706
3711
3730
3732{
3733 bool Validate(SpellInfo const* spellInfo) override
3734 {
3735 return sBroadcastTextStore.HasRecord(uint32(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()));
3736 }
3737
3738 void HandleScript(SpellEffIndex /*effIndex*/)
3739 {
3740 if (TempSummon* casterSummon = GetCaster()->ToTempSummon())
3741 if (Player* target = casterSummon->GetSummonerUnit()->ToPlayer())
3742 casterSummon->Unit::Whisper(uint32(GetEffectValueAsInt()), target, false);
3743 }
3744
3749};
3750
3757
3758// BasePoints of spells is ID of npc_text used to group texts, it's not implemented so texts are grouped the old way
3759// 50037 - Mystery of the Infinite: Future You's Whisper to Controller - Random
3760// 50287 - Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random
3761// 60709 - MOTI, Redux: Past You's Whisper to Controller - Random
3763{
3764public:
3766
3767private:
3768 void HandleScript(SpellEffIndex /*effIndex*/)
3769 {
3770 // Same for all spells
3771 if (!roll_chance(20))
3772 return;
3773
3774 if (Creature* target = GetHitCreature())
3775 if (TempSummon* targetSummon = target->ToTempSummon())
3776 if (Player* player = targetSummon->GetSummonerUnit()->ToPlayer())
3777 targetSummon->AI()->Talk(_text, player);
3778 }
3779
3784
3786};
3787
3788// 23777 - Zero Mana/Full Health DND
3802
3804{
3806 {
3807 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3808 vehicle->RemoveAllPassengers();
3809 }
3810
3815};
3816
3818{
3819 bool Validate(SpellInfo const* spellInfo) override
3820 {
3821 if (!ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }))
3822 return false;
3823 if (spellInfo->GetEffect(EFFECT_0).CalcValueAsInt() < 1)
3824 return false;
3825 return true;
3826 }
3827
3829 {
3830 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3831 {
3832 if (Unit* passenger = vehicle->GetPassenger(GetEffectValueAsInt() - 1))
3833 passenger->ExitVehicle();
3834 }
3835 }
3836
3841};
3842
3844{
3845public:
3847
3848private:
3850
3852 {
3853 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3854 {
3855 if (Unit* passenger = vehicle->GetPassenger(_seatId))
3856 passenger->ExitVehicle();
3857 }
3858 }
3859
3864};
3865
3867{
3868 SPELL_GM_FREEZE = 9454
3870
3872{
3873 bool Validate(SpellInfo const* /*spellInfo*/) override
3874 {
3876 }
3877
3878 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
3879 {
3880 // Do what was done before to the target in HandleFreezeCommand
3881 if (Player* player = GetTarget()->ToPlayer())
3882 {
3883 // stop combat + make player unattackable + duel stop + stop some spells
3884 player->SetFaction(FACTION_FRIENDLY);
3885 player->CombatStop();
3886 if (player->IsNonMeleeSpellCast(true))
3887 player->InterruptNonMeleeSpells(true);
3888 player->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
3889
3890 // if player class = hunter || warlock remove pet if alive
3891 if ((player->GetClass() == CLASS_HUNTER) || (player->GetClass() == CLASS_WARLOCK))
3892 {
3893 if (Pet* pet = player->GetPet())
3894 {
3895 pet->SavePetToDB(PET_SAVE_AS_CURRENT);
3896 // not let dismiss dead pet
3897 if (pet->IsAlive())
3898 player->RemovePet(pet, PET_SAVE_NOT_IN_SLOT);
3899 }
3900 }
3901 }
3902 }
3903
3904 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
3905 {
3906 // Do what was done before to the target in HandleUnfreezeCommand
3907 if (Player* player = GetTarget()->ToPlayer())
3908 {
3909 // Reset player faction + allow combat + allow duels
3910 player->SetFactionForRace(player->GetRace());
3911 player->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
3912 // save player
3913 player->SaveToDB();
3914 }
3915 }
3916
3922};
3923
3925{
3927 {
3928 Creature* target = GetHitCreature();
3929 if (!target)
3930 return;
3931
3934 }
3935
3940};
3941
3943{
3945 // Flasks
3962 // Elixirs
4029
4031{
4032 bool Validate(SpellInfo const* spellInfo) override
4033 {
4034 return ValidateSpellInfo({ SPELL_MIXOLOGY }) && ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } });
4035 }
4036
4037 bool Load() override
4038 {
4039 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
4040 }
4041
4042 void SetBonusValueForEffect(SpellEffIndex effIndex, int32 value, AuraEffect const* aurEff)
4043 {
4044 if (aurEff->GetEffIndex() == uint32(effIndex))
4045 bonus = value;
4046 }
4047
4048 void CalculateAmount(AuraEffect const* aurEff, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
4049 {
4050 if (GetCaster()->HasAura(SPELL_MIXOLOGY) && GetCaster()->HasSpell(GetEffectInfo(EFFECT_0).TriggerSpell))
4051 {
4052 switch (GetId())
4053 {
4056 bonus = amount;
4057 break;
4061 bonus = CalculatePct(amount, 80);
4062 break;
4078 bonus = CalculatePct(amount, 50);
4079 break;
4081 bonus = 280;
4082 break;
4084 bonus = 200;
4085 break;
4088 bonus = 140;
4089 break;
4091 bonus = 100;
4092 break;
4094 bonus = 82;
4095 break;
4097 bonus = 70;
4098 break;
4100 bonus = 50;
4101 break;
4103 bonus = 47;
4104 break;
4105 case SPELL_WRATH_ELIXIR:
4106 bonus = 32;
4107 break;
4111 bonus = 29;
4112 break;
4114 bonus = 27;
4115 break;
4120 bonus = 23;
4121 break;
4133 bonus = 20;
4134 break;
4136 bonus = 17;
4137 break;
4140 bonus = 15;
4141 break;
4143 bonus = 13;
4144 break;
4146 bonus = 12;
4147 break;
4150 bonus = 11;
4151 break;
4157 bonus = 10;
4158 break;
4160 bonus = 9;
4161 break;
4163 case SPELL_GURUS_ELIXIR:
4164 bonus = 8;
4165 break;
4169 bonus = 6;
4170 break;
4175 bonus = 5;
4176 break;
4179 bonus = 4;
4180 break;
4182 bonus = -10;
4183 break;
4185 SetBonusValueForEffect(EFFECT_0, 13, aurEff);
4186 SetBonusValueForEffect(EFFECT_1, 13, aurEff);
4187 SetBonusValueForEffect(EFFECT_2, 8, aurEff);
4188 break;
4190 SetBonusValueForEffect(EFFECT_0, 160, aurEff);
4191 break;
4193 SetBonusValueForEffect(EFFECT_0, 116, aurEff);
4194 SetBonusValueForEffect(EFFECT_1, 6, aurEff);
4195 break;
4197 SetBonusValueForEffect(EFFECT_0, 40, aurEff);
4198 SetBonusValueForEffect(EFFECT_1, 40, aurEff);
4199 break;
4201 SetBonusValueForEffect(EFFECT_0, 210, aurEff);
4202 SetBonusValueForEffect(EFFECT_1, 5, aurEff);
4203 break;
4205 SetBonusValueForEffect(EFFECT_0, 19, aurEff);
4206 SetBonusValueForEffect(EFFECT_1, 19, aurEff);
4207 SetBonusValueForEffect(EFFECT_2, 5, aurEff);
4208 break;
4210 SetBonusValueForEffect(EFFECT_0, 5, aurEff);
4211 break;
4212 default:
4213 TC_LOG_ERROR("spells", "SpellId {} couldn't be processed in spell_gen_mixology_bonus", GetId());
4214 break;
4215 }
4216 amount += bonus;
4217 }
4218 }
4219
4221
4226};
4227
4232
4234{
4235 void HandleScript(SpellEffIndex /*effIndex*/)
4236 {
4237 if (Player* target = GetHitPlayer())
4238 {
4239 Aura const* aura = GetHitAura();
4240 if (!aura || aura->GetStackAmount() < 10)
4241 return;
4242
4243 target->CastSpell(target, SPELL_LANDMINE_KNOCKBACK_ACHIEVEMENT, true);
4244 }
4245 }
4246
4251};
4252
4253// 34098 - ClearAllDebuffs
4255{
4256 void HandleScript(SpellEffIndex /*effIndex*/)
4257 {
4258 if (Unit* target = GetHitUnit())
4259 {
4260 target->RemoveOwnedAuras([](Aura const* aura)
4261 {
4262 SpellInfo const* spellInfo = aura->GetSpellInfo();
4263 return !spellInfo->IsPositive() && !spellInfo->IsPassive();
4264 });
4265 }
4266 }
4267
4272};
4273
4275{
4277 MOUNT_PONY = 29736
4279
4281{
4282 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
4283 {
4284 Unit* caster = GetCaster();
4285 if (!caster)
4286 return;
4287 Player* owner = caster->GetOwner()->ToPlayer();
4288 if (!owner || !owner->HasAchieved(ACHIEV_PONY_UP))
4289 return;
4290
4291 if (owner->IsMounted())
4292 {
4293 caster->Mount(MOUNT_PONY);
4294 caster->SetSpeedRate(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
4295 }
4296 else if (caster->IsMounted())
4297 {
4298 caster->Dismount();
4299 caster->SetSpeedRate(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
4300 }
4301 }
4302
4307};
4308
4316
4317// 40350 - Corrupting Plague
4319{
4320public:
4321 CorruptingPlagueSearcher(Unit* obj, float distance) : _unit(obj), _distance(distance) { }
4322
4323 bool operator()(Unit* u) const
4324 {
4325 if (_unit->GetDistance2d(u) < _distance &&
4328 return true;
4329
4330 return false;
4331 }
4332
4333private:
4336};
4337
4338// 40349 - Corrupting Plague
4340{
4341 bool Validate(SpellInfo const* /*spellInfo*/) override
4342 {
4344 }
4345
4346 void OnPeriodic(AuraEffect const* /*aurEff*/)
4347 {
4348 Unit* owner = GetTarget();
4349
4350 std::list<Creature*> targets;
4351 CorruptingPlagueSearcher creature_check(owner, 15.0f);
4352 Trinity::CreatureListSearcher<CorruptingPlagueSearcher> creature_searcher(owner, targets, creature_check);
4353 Cell::VisitGridObjects(owner, creature_searcher, 15.0f);
4354
4355 if (!targets.empty())
4356 return;
4357
4359 }
4360
4365};
4366
4372
4373// 40307 - Stasis Field
4375{
4376public:
4377 StasisFieldSearcher(Unit* obj, float distance) : _unit(obj), _distance(distance) { }
4378
4379 bool operator()(Unit* u) const
4380 {
4381 if (_unit->GetDistance2d(u) < _distance &&
4384 return true;
4385
4386 return false;
4387 }
4388
4389private:
4392};
4393
4394// 40306 - Stasis Field
4396{
4397 bool Validate(SpellInfo const* /*spellInfo*/) override
4398 {
4400 }
4401
4402 void OnPeriodic(AuraEffect const* /*aurEff*/)
4403 {
4404 Unit* owner = GetTarget();
4405
4406 std::list<Creature*> targets;
4407 StasisFieldSearcher creature_check(owner, 15.0f);
4408 Trinity::CreatureListSearcher<StasisFieldSearcher> creature_searcher(owner, targets, creature_check);
4409 Cell::VisitGridObjects(owner, creature_searcher, 15.0f);
4410
4411 if (!targets.empty())
4412 return;
4413
4415 }
4416
4421};
4422
4427
4440
4449
4450// 34779 - Freezing Circle
4452{
4463
4464 void HandleDamage(SpellEffIndex /*effIndex*/)
4465 {
4466 Unit* caster = GetCaster();
4467 uint32 spellId = 0;
4468 Map* map = caster->GetMap();
4469
4470 if (map->IsDungeon())
4472 else
4474
4475 if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetCastDifficulty()))
4476 if (!spellInfo->GetEffects().empty())
4477 SetHitDamage(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt());
4478 }
4479
4484};
4485
4486// Used for some spells cast by vehicles or charmed creatures that do not send a cooldown event on their own
4488{
4490 {
4491 Unit* caster = GetCaster();
4492 if (Player* owner = caster->GetCharmerOrOwnerPlayerOrPlayerItself())
4493 {
4495 spellCooldown.Caster = owner->GetGUID();
4496 spellCooldown.Flags = SPELL_COOLDOWN_FLAG_NONE;
4497 spellCooldown.SpellCooldowns.emplace_back(GetSpellInfo()->Id, GetSpellInfo()->RecoveryTime);
4498 owner->SendDirectMessage(spellCooldown.Write());
4499 }
4500 }
4501
4506};
4507
4513
4515{
4516 bool Validate(SpellInfo const* /*spellInfo*/) override
4517 {
4519 }
4520 void HandleScript(SpellEffIndex /*effIndex*/)
4521 {
4523 Unit* target = GetHitUnit();
4525 args.AddSpellBP0(bp);
4526 target->CastSpell(target, SPELL_CANNON_BLAST_DAMAGE, args);
4527 }
4528
4533};
4534
4535// 37751 - Submerged
4537{
4539 {
4540 if (Creature* target = GetHitCreature())
4541 target->SetStandState(UNIT_STAND_STATE_SUBMERGED);
4542 }
4543
4548};
4549
4550// 169869 - Transformation Sickness
4552{
4553 void HandleScript(SpellEffIndex /*effIndex*/)
4554 {
4555 if (Unit* target = GetHitUnit())
4556 target->SetHealth(target->CountPctFromMaxHealth(25));
4557 }
4558
4563};
4564
4565// 189491 - Summon Towering Infernal.
4578
4584
4586{
4587 public:
4588 bool operator()(WorldObject* target) const
4589 {
4590 if (Unit* unit = target->ToUnit())
4591 return unit->GetPowerType() != POWER_MANA;
4592 return false;
4593 }
4594};
4595
4597{
4598 void FilterTargets(std::list<WorldObject*>& targets)
4599 {
4600 targets.remove_if(MarkTargetHellfireFilter());
4601 }
4602
4607};
4608
4610{
4611 bool Validate(SpellInfo const* /*spell*/) override
4612 {
4614 }
4615
4616 void OnPeriodic(AuraEffect const* aurEff)
4617 {
4618 Unit* target = GetTarget();
4619
4620 if (target->GetPower(POWER_MANA) == 0)
4621 {
4622 target->CastSpell(target, SPELL_MARK_OF_KAZROGAL_DAMAGE_HELLFIRE, aurEff);
4623 // Remove aura
4624 SetDuration(0);
4625 }
4626 }
4627
4632};
4633
4646
4652
4653// 99947 - Face Rage
4655{
4656 bool Validate(SpellInfo const* spellInfo) override
4657 {
4659 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } });
4660 }
4661
4662 void OnRemove(AuraEffect const* /*effect*/, AuraEffectHandleModes /*mode*/)
4663 {
4665 }
4666
4671};
4672
4673// 187213 - Impatient Mind
4675{
4676 bool Validate(SpellInfo const* /*spell*/) override
4677 {
4679 }
4680
4681 void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
4682 {
4684 }
4685
4690};
4691
4692// 209352 - Boost 2.0 [Paladin+Priest] - Watch for Shield
4694{
4695 static constexpr uint32 SPELL_POWER_WORD_SHIELD = 17;
4696 static constexpr uint32 SPELL_DIVINE_SHIELD = 642;
4697
4698 bool Validate(SpellInfo const* /*spellInfo*/) override
4699 {
4701 }
4702
4703 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo& procInfo)
4704 {
4705 SpellInfo const* spellInfo = procInfo.GetSpellInfo();
4706 return spellInfo && (spellInfo->Id == SPELL_POWER_WORD_SHIELD || spellInfo->Id == SPELL_DIVINE_SHIELD);
4707 }
4708
4713};
4714
4715// 269083 - Enlisted
4716// 282559 - Enlisted
4718{
4719 void CalcWarModeBonus(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
4720 {
4721 Player* target = GetUnitOwner()->ToPlayer();
4722 if (!target)
4723 return;
4724
4725 switch (target->GetTeamId())
4726 {
4727 case TEAM_ALLIANCE:
4729 break;
4730 case TEAM_HORDE:
4732 break;
4733 default:
4734 break;
4735 }
4736 }
4737
4760};
4761
4775
4777{
4778 BindLocation(uint32 mapId, float x, float y, float z, float o, uint32 areaId)
4779 : Loc(mapId, x, y, z, o), AreaId(areaId) { }
4782};
4783
4784BindLocation const StormwindInnLoc(0, -8868.1f, 675.82f, 97.9f, 5.164778709411621093f, 5148);
4785BindLocation const OrgrimmarInnLoc(1, 1573.18f, -4441.62f, 16.06f, 1.818284034729003906f, 8618);
4786
4788{
4789 bool Validate(SpellInfo const* /*spell*/) override
4790 {
4791 return ValidateSpellInfo(
4792 {
4795 });
4796 }
4797
4798 void HandleDummy(SpellEffIndex /*effIndex*/)
4799 {
4800 Player* player = GetHitUnit()->ToPlayer();
4801 if (!player)
4802 return;
4803
4805 return;
4806
4807 BindLocation const& bindLoc = player->GetTeam() == ALLIANCE ? StormwindInnLoc : OrgrimmarInnLoc;
4808 player->SetHomebind(bindLoc.Loc, bindLoc.AreaId);
4809 player->SendBindPointUpdate();
4810 player->SendPlayerBound(player->GetGUID(), bindLoc.AreaId);
4811
4813 }
4814
4819};
4820
4822{
4823 void HandleDummy(SpellEffIndex /*effIndex*/)
4824 {
4825 if (!GetCaster())
4826 return;
4827
4828 Player* player = GetCaster()->ToPlayer();
4829 if (!player)
4830 return;
4831
4832 if (Creature* nazgrim = GetHitUnit()->FindNearestCreature(NPC_NAZGRIM, 10.0f))
4833 nazgrim->HandleEmoteCommand(EMOTE_ONESHOT_POINT, player);
4834 if (Creature* trollbane = GetHitUnit()->FindNearestCreature(NPC_TROLLBANE, 10.0f))
4835 trollbane->HandleEmoteCommand(EMOTE_ONESHOT_POINT, player);
4836 if (Creature* whitemane = GetHitUnit()->FindNearestCreature(NPC_WHITEMANE, 10.0f))
4837 whitemane->HandleEmoteCommand(EMOTE_ONESHOT_POINT, player);
4838
4839 // @TODO: spawntracking - show death gate for casting player
4840 }
4841
4846};
4847
4848// 118301 - Summon Battle Pet
4850{
4852 {
4853 uint32 creatureId = uint32(GetSpellValue()->EffectBasePoints[effIndex]);
4854 if (sObjectMgr->GetCreatureTemplate(creatureId))
4855 {
4856 PreventHitDefaultEffect(effIndex);
4857
4858 Unit* caster = GetCaster();
4859 SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetEffectInfo().MiscValueB));
4860 Milliseconds duration = Milliseconds(GetSpellInfo()->CalcDuration(caster));
4861 Position pos = GetHitDest()->GetPosition();
4862
4863 if (Creature* summon = caster->GetMap()->SummonCreature(creatureId, pos, properties, duration, caster, GetSpellInfo()->Id))
4864 summon->SetImmuneToAll(true);
4865 }
4866 }
4867
4872};
4873
4874// 132334 - Trainer Heal Cooldown (SERVERSIDE)
4876{
4877 bool Validate(SpellInfo const* /*spellInfo*/) override
4878 {
4880 }
4881
4882 bool Load() override
4883 {
4884 return GetUnitOwner()->IsPlayer();
4885 }
4886
4888 {
4889 Player* target = GetUnitOwner()->ToPlayer();
4890 SpellInfo const* reviveBattlePetSpellInfo = sSpellMgr->AssertSpellInfo(BattlePets::SPELL_REVIVE_BATTLE_PETS, DIFFICULTY_NONE);
4891
4893 {
4894 Milliseconds expectedCooldown = Milliseconds(GetAura()->GetMaxDuration());
4895 SpellHistory::Duration remainingCooldown = target->GetSpellHistory()->GetRemainingCategoryCooldown(reviveBattlePetSpellInfo);
4896 if (remainingCooldown > SpellHistory::Duration::zero())
4897 {
4898 if (remainingCooldown < expectedCooldown)
4899 target->GetSpellHistory()->ModifyCooldown(reviveBattlePetSpellInfo, expectedCooldown - remainingCooldown);
4900 }
4901 else
4902 {
4903 target->GetSpellHistory()->StartCooldown(reviveBattlePetSpellInfo, 0, nullptr, false, expectedCooldown);
4904 }
4905 }
4906 }
4907
4912};
4913
4914// 45313 - Anchor Here
4916{
4917 void HandleScript(SpellEffIndex /*effIndex*/)
4918 {
4919 if (Creature* creature = GetHitCreature())
4920 creature->SetHomePosition(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation());
4921 }
4922
4927};
4928
4929// 147066 - (Serverside/Non-DB2) Generic - Mount Check Aura
4931{
4932 void OnPeriodic(AuraEffect const* /*aurEff*/)
4933 {
4934 Unit* target = GetTarget();
4935 uint32 mountDisplayId = 0;
4936
4937 TempSummon* tempSummon = target->ToTempSummon();
4938 if (!tempSummon)
4939 return;
4940
4941 Player const* summoner = Object::ToPlayer(tempSummon->GetSummoner());
4942 if (!summoner)
4943 return;
4944
4945 if (summoner->IsMounted() && (!summoner->IsInCombat() || summoner->IsFlying()))
4946 {
4947 if (CreatureSummonedData const* summonedData = sObjectMgr->GetCreatureSummonedData(tempSummon->GetEntry()))
4948 {
4949 if (summoner->IsFlying() && summonedData->FlyingMountDisplayID)
4950 mountDisplayId = *summonedData->FlyingMountDisplayID;
4951 else if (summonedData->GroundMountDisplayID)
4952 mountDisplayId = *summonedData->GroundMountDisplayID;
4953 }
4954 }
4955
4956 if (mountDisplayId != target->GetMountDisplayId())
4957 target->SetMountDisplayId(mountDisplayId);
4958 }
4959
4964};
4965
4973
4974// 274738 - Ancestral Call (Mag'har Orc Racial)
5003
5004// 83477 - Eject Passengers 3-8
5006{
5008 {
5009 Vehicle* vehicle = GetHitUnit()->GetVehicleKit();
5010 if (!vehicle)
5011 return;
5012
5013 for (uint8 i = 2; i < 8; i++)
5014 {
5015 if (Unit* passenger = vehicle->GetPassenger(i))
5016 passenger->ExitVehicle();
5017 }
5018 }
5019
5024};
5025
5026// 83781 - Reverse Cast Ride Vehicle
5027// 85299 - Reverse Cast Ride Seat 1
5028// 258344 - Reverse Cast Ride Vehicle
5041
5042// Note: this spell unsummons any creature owned by the caster. Set appropriate target conditions on the DB.
5043// 84065 - Despawn All Summons
5044// 83935 - Despawn All Summons
5045// 160938 - Despawn All Summons (Garrison Intro Only)
5047{
5049 {
5050 if (Unit* caster = GetCaster())
5051 {
5052 Creature* target = GetHitCreature();
5053
5054 if (target->GetOwner() == caster)
5055 target->DespawnOrUnsummon();
5056 }
5057 }
5058
5063};
5064
5079
5080// 8613 - Skinning
5082{
5098
5100 {
5101 Player* player = GetCaster()->ToPlayer();
5102 if (!player)
5103 return;
5104
5105 ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(GetHitUnit()->GetContentTuning());
5106 if (!contentTuning)
5107 return;
5108
5109 uint32 skinningSkill = player->GetProfessionSkillForExp(SKILL_SKINNING, contentTuning->ExpansionID);
5110 if (!skinningSkill)
5111 return;
5112
5113 // Autolearning missing skinning skill (Dragonflight)
5114 auto getSkinningLearningSpellBySkill = [&]() -> uint32
5115 {
5116 switch (skinningSkill)
5117 {
5126 case SKILL_CLASSIC_SKINNING: // Trainer only
5127 case SKILL_LEGION_SKINNING: // Quest only
5128 default: break;
5129 }
5130
5131 return 0;
5132 };
5133
5134 if (!player->HasSkill(skinningSkill))
5135 if (uint32 spellId = getSkinningLearningSpellBySkill())
5136 player->CastSpell(nullptr, spellId, true);
5137 }
5138
5143};
5144
5153
5154// 2825 - Bloodlust
5155// 32182 - Heroism
5156// 80353 - Time Warp
5157// 264667 - Primal Rage
5158// 390386 - Fury of the Aspects
5159// 146555 - Drums of Rage
5160// 178207 - Drums of Fury
5161// 230935 - Drums of the Mountain
5162// 256740 - Drums of the Maelstrom
5163// 309658 - Drums of Deathly Ferocity
5164// 381301 - Feral Hide Drums
5165// 466904 - Harrier's Cry
5167{
5168public:
5169 spell_gen_bloodlust(uint32 exhaustionSpellId) : _exhaustionSpellId(exhaustionSpellId) { }
5170
5171 bool Validate(SpellInfo const* /*spellInfo*/) override
5172 {
5173 return ValidateSpellInfo(
5174 {
5180 });
5181 }
5182
5183 void FilterTargets(std::list<WorldObject*>& targets)
5184 {
5185 targets.remove_if([](WorldObject* target) -> bool
5186 {
5187 Unit* unit = target->ToUnit();
5188 if (!unit)
5189 return true;
5190
5191 return unit->HasAura(SPELL_SHAMAN_SATED)
5196 });
5197 }
5198
5199 void HandleHit(SpellEffIndex /*effIndex*/)
5200 {
5201 Unit* target = GetHitUnit();
5202 target->CastSpell(target, _exhaustionSpellId, true);
5203 }
5204
5211
5212private:
5214};
5215
5216// AoE resurrections by spirit guides
5217// 22012 - Spirit Heal
5219{
5220 void FilterTargets(std::list<WorldObject*>& targets)
5221 {
5222 Unit* caster = GetCaster();
5223 targets.remove_if([caster](WorldObject* target) -> bool
5224 {
5225 if (Player* playerTarget = target->ToPlayer())
5226 return !playerTarget->CanAcceptAreaSpiritHealFrom(caster);
5227
5228 return true;
5229 });
5230 }
5231
5236};
5237
5238// Personal resurrections in battlegrounds
5239// 156758 - Spirit Heal
5241{
5242 static constexpr uint32 SPELL_SPIRIT_HEAL_EFFECT = 156763;
5243
5244 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
5245 {
5246 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
5247 return;
5248
5249 Player* targetPlayer = GetTarget()->ToPlayer();
5250 if (!targetPlayer)
5251 return;
5252
5253 Unit* caster = GetCaster();
5254 if (!caster)
5255 return;
5256
5257 if (targetPlayer->CanAcceptAreaSpiritHealFrom(caster))
5258 caster->CastSpell(targetPlayer, SPELL_SPIRIT_HEAL_EFFECT);
5259 }
5260
5265};
5266
5268{
5269public:
5271
5272 bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) override
5273 {
5274 if (_caster->GetChannelSpellId() == 0)
5276
5277 return true;
5278 }
5279
5280private:
5282};
5283
5284// 22011 - Spirit Heal Channel
5286{
5287 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
5288 {
5289 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
5290 return;
5291
5292 Unit* target = GetTarget();
5294 }
5295
5300};
5301
5302// 2584 - Waiting to Resurrect
5304{
5305 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
5306 {
5307 Player* targetPlayer = GetTarget()->ToPlayer();
5308 if (!targetPlayer)
5309 return;
5310
5311 targetPlayer->SetAreaSpiritHealer(nullptr);
5312 }
5313
5318};
5319
5332
5334{
5336{
5337 // Note: if caster is not in a raid setting, is in PvP or while in arena combat with 5 or less allied players.
5338 if (!unit->GetMap()->IsRaid() || !unit->GetMap()->IsBattleground())
5339 {
5340 uint32 bonusSpellId = 0;
5341 SpellEffIndex effIndex = EFFECT_0;
5342 switch (spellId)
5343 {
5345 bonusSpellId = SPELL_DRUID_TRANQUILITY;
5346 effIndex = EFFECT_2;
5347 break;
5349 bonusSpellId = SPELL_PRIEST_DIVINE_HYMN;
5350 effIndex = EFFECT_1;
5351 break;
5353 bonusSpellId = spellId;
5354 effIndex = EFFECT_1;
5355 break;
5357 bonusSpellId = SPELL_SHAMAN_HEALING_TIDE_TOTEM;
5358 effIndex = EFFECT_2;
5359 break;
5360 case SPELL_MONK_REVIVAL:
5361 bonusSpellId = spellId;
5362 effIndex = EFFECT_4;
5363 break;
5365 bonusSpellId = spellId;
5366 effIndex = EFFECT_3;
5367 break;
5368 default:
5369 return 0.0f;
5370 }
5371
5372 if (AuraEffect* const healingIncreaseEffect = unit->GetAuraEffect(bonusSpellId, effIndex))
5373 return healingIncreaseEffect->GetAmount();
5374
5375 return sSpellMgr->AssertSpellInfo(bonusSpellId, DIFFICULTY_NONE)->GetEffect(effIndex).CalcValue(unit);
5376 }
5377
5378 return 0.0;
5379}
5380}
5381
5382// 157982 - Tranquility (Heal)
5383// 64844 - Divine Hymn (Heal)
5384// 114942 - Healing Tide (Heal)
5385// 115310 - Revival (Heal)
5387{
5388 bool Validate(SpellInfo const* /*spellInfo*/) override
5389 {
5390 return ValidateSpellEffect
5391 ({
5396 });
5397 }
5398
5399 void CalculateHealingBonus(SpellEffectInfo const& /*spellEffectInfo*/, Unit* /*victim*/, int32& /*healing*/, int32& /*flatMod*/, float& pctMod) const
5400 {
5402 }
5403
5408};
5409
5410// 157982 - Tranquility (Heal)
5411// 271466 - Luminous Barrier (Absorb)
5412// 363534 - Rewind (Heal)
5414{
5415 bool Validate(SpellInfo const* /*spellInfo*/) override
5416 {
5417 return ValidateSpellEffect
5418 ({
5422 });
5423 }
5424
5425 void CalculateHealingBonus(AuraEffect const* /*aurEff*/, Unit* /*victim*/, int32& /*damageOrHealing*/, int32& /*flatMod*/, float& pctMod) const
5426 {
5427 if (Unit const* caster = GetCaster())
5429 }
5430
5435};
5436
5437// 50230 - Random Aggro (Taunt)
5439{
5440 bool Validate(SpellInfo const* spellInfo) override
5441 {
5442 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) && ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_0).BasePoints) });
5443 }
5444
5445 void SelectRandomTarget(std::list<WorldObject*>& targets)
5446 {
5447 if (targets.empty())
5448 return;
5449
5451 }
5452
5454 {
5455 GetHitUnit()->CastSpell(GetCaster(), static_cast<uint32>(GetSpellInfo()->GetEffect(effIndex).BasePoints), CastSpellExtraArgs(TRIGGERED_FULL_MASK));
5456 }
5457
5463};
5464
5465// 24931 - 100 Health
5466// 24959 - 500 Health
5467// 28838 - 1 Health
5468// 43645 - 1 Health
5469// 73342 - 1 Health
5470// 86562 - 1 Health
5472{
5473public:
5475
5476 void HandleHit(SpellEffIndex /*effIndex*/)
5477 {
5478 if (GetHitUnit()->IsAlive() && _health > 0)
5480 }
5481
5486
5487private:
5489};
5490
5491// 128648 - Defending Cart Aura
5493{
5494 void FilterTargets(std::list<WorldObject*>& targets) const
5495 {
5496 if (targets.empty())
5497 return;
5498
5499 if (GameObject const* controlZone = GetControlZone())
5500 {
5501 targets.remove_if([&](WorldObject* obj)
5502 {
5503 if (Player const* player = obj->ToPlayer())
5504 return GetTeamIdForTeam(player->GetBGTeam()) != controlZone->GetControllingTeam();
5505
5506 return true;
5507 });
5508 }
5509 }
5510
5512 {
5513 if (Unit const* caster = GetCaster())
5514 {
5515 Unit::AuraEffectList const& auraEffects = caster->GetAuraEffectsByType(SPELL_AURA_ACT_AS_CONTROL_ZONE);
5516 for (AuraEffect const* auraEffect : auraEffects)
5517 if (GameObject const* gameobject = caster->GetGameObject(auraEffect->GetSpellInfo()->Id))
5518 return gameobject;
5519 }
5520
5521 return nullptr;
5522 }
5523
5528};
5529
5530// 128648 - Defending Cart Aura
5532{
5533 void OnPeriodic(AuraEffect const* /*aurEff*/) const
5534 {
5535 Unit const* caster = GetCaster();
5536 if (!caster)
5537 return;
5538
5539 if (GameObject const* controlZone = GetControlZone())
5540 if (!controlZone->GetInsidePlayers()->contains(GetTarget()->GetGUID()))
5542 }
5543
5545 {
5546 if (Unit const* caster = GetCaster())
5547 {
5548 Unit::AuraEffectList const& auraEffects = caster->GetAuraEffectsByType(SPELL_AURA_ACT_AS_CONTROL_ZONE);
5549 for (AuraEffect const* auraEffect : auraEffects)
5550 if (GameObject const* gameobject = caster->GetGameObject(auraEffect->GetSpellInfo()->Id))
5551 return gameobject;
5552 }
5553
5554 return nullptr;
5555 }
5556
5561};
5562
5563// 296837 - Comfortable Rider's Barding
5565{
5566 bool Validate(SpellInfo const* /*spellInfo*/) override
5567 {
5568 return ValidateSpellInfo({ SPELL_DAZED });
5569 }
5570
5571 template <bool apply>
5572 void HandleEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
5573 {
5575 }
5576
5577 void Register() override
5578 {
5579 OnEffectApply += AuraEffectApplyFn(spell_gen_comfortable_riders_barding::HandleEffect<true>, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
5580 OnEffectRemove += AuraEffectApplyFn(spell_gen_comfortable_riders_barding::HandleEffect<false>, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
5581 }
5582};
5583
5584// 297091 - Parachute
5586{
5587 static constexpr uint32 SPELL_PARACHUTE = 297092;
5588
5589 bool Validate(SpellInfo const* /*spellInfo*/) override
5590 {
5592 }
5593
5594 void TriggerParachute(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
5595 {
5596 Unit* target = GetTarget();
5597 if (target->IsFlying() || target->IsFalling())
5599 }
5600
5605};
5606
5612
5613// 257040 - Spatial Rift
5615{
5616 bool Validate(SpellInfo const* /*spellInfo*/) override
5617 {
5619 }
5620
5621 void HandleDummy(SpellEffIndex /*effIndex*/) const
5622 {
5623 Unit* caster = GetCaster();
5624
5626 if (!at)
5627 return;
5628
5630 .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
5631 .TriggeringSpell = GetSpell()
5632 });
5633
5634 at->SetDuration(0);
5635 }
5636
5641};
5642
5644{
5646
5647 void OnInitialize() override
5648 {
5649 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(at->GetSpellId(), DIFFICULTY_NONE);
5650 if (!spellInfo)
5651 return;
5652
5653 Position destPos = at->GetPosition();
5654 at->MovePositionToFirstCollision(destPos, spellInfo->GetMaxRange(), 0.0f);
5655
5656 PathGenerator path(at);
5657 path.CalculatePath(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ(), true);
5658
5659 at->InitSplines(path.GetPath());
5660 }
5661};
5662
5681
5683{
5684public:
5686
5687 static void CalculateAmount(AuraScript const&, AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
5688 {
5689 amount = -1;
5690 }
5691
5692 void HandleAbsorb(AuraEffect const* /*aurEff*/, DamageInfo const& dmgInfo, uint32& absorbAmount)
5693 {
5694 if (!dmgInfo.GetAttacker() || !dmgInfo.GetAttacker()->IsCreature())
5695 {
5697 return;
5698 }
5699
5700 if (GetTarget()->GetHealthPct() <= _healthPct)
5701 absorbAmount = dmgInfo.GetDamage();
5702 else
5704 }
5705
5711
5712private:
5714};
5715
5716// 92678 - Abandon Vehicle
5729
5731{
5744 RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_break_shield");
5745 RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_tournament_counterattack");
5757 RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_default_count_pct_from_max_hp");
5758 RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_50pct_count_pct_from_max_hp", 50);
5760 RegisterSpellScriptWithArgs(spell_gen_dalaran_disguise, "spell_gen_sunreaver_disguise");
5761 RegisterSpellScriptWithArgs(spell_gen_dalaran_disguise, "spell_gen_silver_covenant_disguise");
5792 RegisterSpellScriptWithArgs(spell_gen_knock_away_threat_reduction, "spell_gen_knock_away_threat_reduction_100", 100); // 10101
5793 RegisterSpellScriptWithArgs(spell_gen_knock_away_threat_reduction, "spell_gen_knock_away_threat_reduction_50", 50); // 18670, 18945
5794 RegisterSpellScriptWithArgs(spell_gen_knock_away_threat_reduction, "spell_gen_knock_away_threat_reduction_25", 25); // 18813, 25778
5795 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pal_blessing_of_kings");
5796 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pal_blessing_of_might");
5797 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_dru_mark_of_the_wild");
5798 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pri_power_word_fortitude");
5799 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pri_shadow_protection");
5817 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_soul_harvesters_charm");
5818 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_commendation_of_kaelthas");
5819 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_corpse_tongue_coin");
5820 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_corpse_tongue_coin_heroic");
5821 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_petrified_twilight_scale");
5822 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_petrified_twilight_scale_heroic");
5833 // Running Wild
5837 /* */
5862 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_future_you_whisper_to_controller_random", WHISPER_FUTURE_YOU);
5863 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_wyrmrest_defender_whisper_to_controller_random", WHISPER_DEFENDER);
5864 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_past_you_whisper_to_controller_random", WHISPER_PAST_YOU);
5868 RegisterSpellScriptWithArgs(spell_gen_eject_passenger_with_seatId, "spell_gen_eject_passenger_1", 0);
5869 RegisterSpellScriptWithArgs(spell_gen_eject_passenger_with_seatId, "spell_gen_eject_passenger_3", 2);
5916 RegisterSpellScriptWithArgs(spell_gen_set_health, "spell_gen_set_health_1", 1);
5917 RegisterSpellScriptWithArgs(spell_gen_set_health, "spell_gen_set_health_100", 100);
5918 RegisterSpellScriptWithArgs(spell_gen_set_health, "spell_gen_set_health_500", 500);
5925 RegisterSpellScriptWithArgs(spell_gen_no_npc_damage_below_override, "spell_gen_no_npc_damage_below_override_70", 70.0f);
5927}
@ SPELL_SPIRIT_HEAL_CHANNEL_AOE
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:579
@ RacialForThePurposeOfTemporaryRaceChange
@ DIFFICULTY_NONE
Definition DBCEnums.h:936
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
uint32_t uint32
Definition Define.h:154
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:24
@ ITEM_CLASS_WEAPON
@ ITEM_SUBCLASS_WEAPON_FISHING_POLE
#define TC_LOG_ERROR(filterType__, message__,...)
Definition Log.h:182
@ TYPEID_UNIT
Definition ObjectGuid.h:43
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
#define sObjectMgr
Definition ObjectMgr.h:1873
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:730
@ EQUIPMENT_SLOT_OFFHAND
Definition Player.h:731
constexpr uint8 INVENTORY_SLOT_BAG_0
Definition Player.h:706
@ QUEST_STATUS_NONE
Definition QuestDef.h:143
Races
Definition RaceMask.h:28
@ RACE_DARK_IRON_DWARF
Definition RaceMask.h:63
@ RACE_TROLL
Definition RaceMask.h:37
@ RACE_UNDEAD_PLAYER
Definition RaceMask.h:34
@ RACE_PANDAREN_NEUTRAL
Definition RaceMask.h:53
@ RACE_ORC
Definition RaceMask.h:31
@ RACE_LIGHTFORGED_DRAENEI
Definition RaceMask.h:59
@ RACE_NONE
Definition RaceMask.h:29
@ RACE_DRAENEI
Definition RaceMask.h:40
@ RACE_EARTHEN_DWARF_HORDE
Definition RaceMask.h:79
@ RACE_NIGHTBORNE
Definition RaceMask.h:56
@ RACE_HIGHMOUNTAIN_TAUREN
Definition RaceMask.h:57
@ RACE_HARANIR_HORDE
Definition RaceMask.h:84
@ RACE_EARTHEN_DWARF_ALLIANCE
Definition RaceMask.h:80
@ RACE_DRACTHYR_HORDE
Definition RaceMask.h:68
@ RACE_ZANDALARI_TROLL
Definition RaceMask.h:60
@ RACE_VOID_ELF
Definition RaceMask.h:58
@ RACE_NIGHTELF
Definition RaceMask.h:33
@ RACE_BLOODELF
Definition RaceMask.h:39
@ RACE_DWARF
Definition RaceMask.h:32
@ RACE_GNOME
Definition RaceMask.h:36
@ RACE_GOBLIN
Definition RaceMask.h:38
@ RACE_KUL_TIRAN
Definition RaceMask.h:61
@ RACE_HUMAN
Definition RaceMask.h:30
@ RACE_DRACTHYR_ALLIANCE
Definition RaceMask.h:67
@ RACE_WORGEN
Definition RaceMask.h:51
@ RACE_PANDAREN_ALLIANCE
Definition RaceMask.h:54
@ RACE_VULPERA
Definition RaceMask.h:64
@ RACE_MECHAGNOME
Definition RaceMask.h:66
@ RACE_HARANIR_ALLIANCE
Definition RaceMask.h:81
@ RACE_MAGHAR_ORC
Definition RaceMask.h:65
@ RACE_PANDAREN_HORDE
Definition RaceMask.h:55
@ RACE_TAUREN
Definition RaceMask.h:35
int32 irand(int32 min, int32 max)
Definition Random.cpp:36
bool roll_chance(float chance, PseudoRandomDistributionState &state)
Definition Random.cpp:131
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:43
#define RegisterSpellAndAuraScriptPair(script_1, script_2)
Definition ScriptMgr.h:1381
#define RegisterAreaTriggerAI(ai_name)
Definition ScriptMgr.h:1428
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
#define RegisterSpellScriptWithArgs(spell_script, script_name,...)
Definition ScriptMgr.h:1382
SpellEffIndex
@ EFFECT_3
@ EFFECT_1
@ EFFECT_0
@ EFFECT_4
@ EFFECT_2
#define EFFECT_FIRST_FOUND
@ 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
Classes
@ CLASS_HUNTER
@ CLASS_WARLOCK
@ GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING
Gender
@ GENDER_FEMALE
constexpr TeamId GetTeamIdForTeam(Team team)
@ TARGET_UNIT_DEST_AREA_ALLY
@ TARGET_UNIT_SRC_AREA_ALLY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ TARGET_UNIT_CASTER_AREA_RAID
@ TARGET_DEST_CASTER
@ EMOTE_ONESHOT_POINT
@ EMOTE_ONESHOT_EXCLAMATION
@ EMOTE_ONESHOT_APPLAUD
@ EMOTE_ONESHOT_CHEER
@ EMOTE_STATE_NONE
SpellSchools GetFirstSchoolInMask(SpellSchoolMask mask)
@ TEAM_ALLIANCE
@ TEAM_HORDE
@ IMMUNITY_ID
@ 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
@ SPELLFAMILY_MAGE
@ 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_SCHOOL_ABSORB
@ SPELL_AURA_PERIODIC_ENERGIZE
@ SPELL_AURA_ACT_AS_CONTROL_ZONE
@ 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
double SpellEffectValue
This is a double instead of float to be able to store full range of int32.
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
@ TRIGGERED_DONT_REPORT_CAST_ERROR
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ SPELLVALUE_BASE_POINT0
@ SPELL_COOLDOWN_FLAG_NONE
@ TARGET_CHECK_ENEMY
Definition SpellInfo.h:83
@ TARGET_OBJECT_TYPE_CORPSE_ENEMY
Definition SpellInfo.h:75
#define sSpellMgr
Definition SpellMgr.h:812
#define AuraProcFn(F)
#define SpellCheckCastFn(F)
#define AuraEffectProcFn(F, I, N)
#define SpellEffectFn(F, I, N)
#define AuraEffectCalcAmountFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraCheckEffectProcFn(F, I, N)
#define AuraEffectUpdatePeriodicFn(F, I, N)
#define AuraEffectCalcHealingFn(F, I, N)
#define SpellCalcDamageFn(F)
#define SpellCastFn(F)
#define SpellDestinationTargetSelectFn(F, I, N)
#define AuraEffectAbsorbFn(F, I)
#define SPELL_EFFECT_ANY
Definition SpellScript.h:60
#define AuraEffectCalcPeriodicFn(F, I, N)
#define AuraEffectApplyFn(F, I, N, M)
#define AuraCheckProcFn(F)
#define SpellHitFn(F)
#define SPELL_AURA_ANY
Definition SpellScript.h:61
#define SpellCalcHealingFn(F)
#define AuraCheckAreaTargetFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
@ MOVE_RUN
@ UNIT_FLAG2_FEIGN_DEATH
@ REACT_PASSIVE
@ UNIT_STAND_STATE_SUBMERGED
Definition UnitDefines.h:51
@ UNIT_STAND_STATE_STAND
Definition UnitDefines.h:42
@ UNIT_FLAG3_FAKE_DEAD
@ UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
@ UNIT_FLAG_NON_ATTACKABLE
@ ALIVE
Definition Unit.h:266
@ JUST_RESPAWNED
Definition Unit.h:270
#define SPELL_DAZED
Definition Unit.h:37
#define DISPLAYID_HIDDEN_MOUNT
Definition Unit.h:40
T AddPct(T &base, U pct)
Definition Util.h:85
T CalculatePct(T base, U pct)
Definition Util.h:72
AreaTrigger *const at
AreaTriggerAI(AreaTrigger *a, uint32 scriptId={}) noexcept
void InitSplines(std::vector< G3D::Vector3 > const &splinePoints, Optional< float > overrideSpeed={}, Optional< bool > speedIsTimeInSeconds={})
uint32 GetSpellId() const
void SetDuration(int32 newDuration)
void ChangeAmount(SpellEffectValue newAmount, bool mark=true, bool onStackOrReapply=false, AuraEffect const *triggeredBy=nullptr)
uint32 GetTickNumber() const
SpellEffIndex GetEffIndex() const
SpellEffectInfo const & GetSpellEffectInfo() const
int32 GetAmountAsInt() const
void SetPeriodic(bool isPeriodic)
uint32 GetTotalTicks() const
SpellEffectValue GetAmount() const
HookList< EffectCalcDamageAndHealingHandler > DoEffectCalcDamageAndHealing
void PreventDefaultAction()
void SetMaxDuration(int32 duration)
HookList< EffectCalcPeriodicHandler > DoEffectCalcPeriodic
AuraApplication const * GetTargetApplication() const
int32 GetDuration() const
HookList< EffectApplyHandler > AfterEffectRemove
HookList< CheckEffectProcHandler > DoCheckEffectProc
HookList< EffectPeriodicHandler > OnEffectPeriodic
SpellInfo const * GetSpellInfo() const
HookList< EffectApplyHandler > AfterEffectApply
int32 GetMaxDuration() const
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Unit * GetCaster() const
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
void SetDuration(int32 duration, bool withMods=false)
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
HookList< EffectAbsorbHandler > OnEffectAbsorb
Aura * GetAura() const
HookList< CheckAreaTargetHandler > DoCheckAreaTarget
Unit * GetTarget() const
ObjectGuid GetCasterGUID() const
HookList< CheckProcHandler > DoCheckProc
HookList< EffectApplyHandler > OnEffectRemove
HookList< EffectProcHandler > OnEffectProc
Unit * GetUnitOwner() const
HookList< AuraProcHandler > OnProc
uint8 GetStackAmount() const
HookList< EffectApplyHandler > OnEffectApply
uint32 GetId() const
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
AuraEffect * GetEffect(uint32 index) const
uint8 GetStackAmount() const
Definition SpellAuras.h:238
SpellInfo const * GetSpellInfo() const
Definition SpellAuras.h:182
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
bool IsCreature() const
Definition BaseEntity.h:172
bool IsPlayer() const
Definition BaseEntity.h:173
TypeID GetTypeId() const
Definition BaseEntity.h:166
bool operator()(Unit *u) const
CorruptingPlagueSearcher(Unit *obj, float distance)
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
static CharBaseInfoEntry const * GetCharBaseInfo(Races race, Classes class_)
Unit * GetAttacker() const
Definition Unit.h:460
uint32 GetDamage() const
Definition Unit.h:466
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
ObjectGuid GetOwnerGUID() const override
Definition GameObject.h:251
Definition Item.h:185
ItemTemplate const * GetTemplate() const
Definition Item.cpp:1233
Definition Map.h:227
bool IsDungeon() const
Definition Map.cpp:3303
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:1704
bool IsBattleground() const
Definition Map.cpp:3395
bool IsRaid() const
Definition Map.cpp:3313
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:1191
uint32 GetId() const
Definition Map.cpp:3288
bool IsHeroic() const
Definition Map.cpp:3347
bool operator()(WorldObject *target) const
static ObjectGuid const Empty
Definition ObjectGuid.h:314
bool IsPlayer() const
Definition ObjectGuid.h:369
Player * ToPlayer()
Definition Object.h:126
uint32 GetEntry() const
Definition Object.h:89
Creature * ToCreature()
Definition Object.h:121
void SetEntry(uint32 entry)
Definition Object.h:90
Unit * ToUnit()
Definition Object.h:116
Movement::PointsArray const & GetPath() const
bool CalculatePath(float srcX, float srcY, float srcZ, float destX, float destY, float destZ, bool forceDest=false)
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:598
static bool OnConditionChange(WorldObject *object, bool updateVisibility=true)
void SendPlayerBound(ObjectGuid const &binderGuid, uint32 areaId) const
Definition Player.cpp:17919
void SendBindPointUpdate() const
Definition Player.cpp:17910
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:6193
bool HasAchieved(uint32 achievementId) const
Definition Player.cpp:27516
WorldSession * GetSession() const
Definition Player.h:2256
void LearnSpell(uint32 spell_id, bool dependent, int32 fromSkill=0, bool suppressMessaging=false, Optional< PlayerSpellTrait > trait={})
Definition Player.cpp:3083
Item * GetItemByPos(uint16 pos) const
Definition Player.cpp:9538
bool HasSkill(uint32 skill) const
Definition Player.cpp:5899
TeamId GetTeamId() const
Definition Player.h:2407
bool CanAcceptAreaSpiritHealFrom(Unit *spiritHealer) const
Definition Player.h:3052
uint32 GetLastPetNumber() const
Definition Player.h:2771
uint32 GetProfessionSkillForExp(uint32 skill, int32 expansion) const
Definition Player.cpp:5873
void RemoveSpell(uint32 spell_id, bool disabled=false, bool learn_low_rank=true, bool suppressMessaging=false)
Definition Player.cpp:3128
float GetAverageItemLevel() const
Definition Player.cpp:29977
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition Player.cpp:15929
void SetAreaSpiritHealer(Creature *creature)
Definition Player.cpp:31395
void SetHomebind(WorldLocation const &loc, uint32 areaId)
Definition Player.cpp:17893
Team GetEffectiveTeam() const
Definition Player.h:2410
ReputationMgr & GetReputationMgr()
Definition Player.h:2422
Team GetTeam() const
Definition Player.h:2406
void LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue, Races race)
Definition Player.cpp:25385
SpellSchoolMask GetSchoolMask() const
Definition Unit.cpp:292
Unit * GetActionTarget() const
Definition Unit.h:514
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:281
DamageInfo * GetDamageInfo() const
Definition Unit.h:524
Unit * GetActor() const
Definition Unit.h:513
bool Execute(uint64, uint32) override
bool operator()(WorldObject *obj) const
int32 GetReputation(uint32 faction_id) const
bool SetReputation(FactionEntry const *factionEntry, int32 standing)
SpellEffectValue CalcValue(WorldObject const *caster=nullptr, SpellEffectValue const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
uint32 TriggerSpell
Definition SpellInfo.h:234
bool IsAura() const
bool IsEffect() const
int32 CalcValueAsInt(WorldObject const *caster=nullptr, SpellEffectValue const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
Duration GetRemainingCategoryCooldown(uint32 categoryId) const
void ResetCooldown(uint32 spellId, bool update=false)
void ModifyCooldown(uint32 spellId, Duration cooldownMod, bool withoutCategoryCooldown=false)
Milliseconds Duration
void StartCooldown(SpellInfo const *spellInfo, uint32 itemId, Spell *spell=nullptr, bool onHold=false, Optional< Duration > forcedCooldown={})
uint32 ExcludeTargetAuraSpell
Definition SpellInfo.h:365
float GetMaxRange(bool positive=false, WorldObject const *caster=nullptr, Spell *spell=nullptr) const
uint32 const Id
Definition SpellInfo.h:328
bool IsPassive() const
uint32 StackAmount
Definition SpellInfo.h:396
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:590
std::vector< SpellEffectInfo > const & GetEffects() const
Definition SpellInfo.h:589
bool HasEffect(SpellEffects effect) const
bool IsPositive() const
uint32 ExcludeCasterAuraSpell
Definition SpellInfo.h:364
bool HasAura(AuraType aura) const
uint32 m_scriptSpellId
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
static bool ValidateSpellEffect(std::initializer_list< std::pair< uint32, SpellEffIndex > > effects)
HookList< DamageAndHealingCalcHandler > CalcDamage
HookList< CastHandler > AfterCast
WorldLocation * GetHitDest() const
HookList< CheckCastHandler > OnCheckCast
Creature * GetHitCreature() const
Player * GetHitPlayer() const
Aura * GetHitAura(bool dynObjAura=false, bool withRemoved=false) const
int32 GetHitDamage() const
Unit * GetCaster() const
HookList< HitHandler > AfterHit
SpellEffectValue GetEffectValue() const
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
int32 GetEffectValueAsInt() const
void CreateItem(uint32 itemId, ItemContext context)
HookList< HitHandler > OnHit
HookList< EffectHandler > OnEffectHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
SpellValue const * GetSpellValue() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Item * GetCastItem() const
HookList< CastHandler > OnCast
void SetCustomCastResultMessage(SpellCustomErrors result)
Difficulty GetCastDifficulty() const
void SetHitDamage(int32 damage)
HookList< EffectHandler > OnEffectLaunch
HookList< DamageAndHealingCalcHandler > CalcHealing
GameObject * GetGObjCaster() const
Unit * GetExplTargetUnit() const
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Unit * GetOriginalCaster() const
GameObject * GetHitGObj() const
StasisFieldSearcher(Unit *obj, float distance)
bool operator()(Unit *u) const
WorldObject * GetSummoner() const
void ModifyThreatByPercent(Unit *target, float percent)
Binary predicate for sorting Units based on percent value of a power.
Definition Unit.h:647
uint32 GetChannelSpellId() const
Definition Unit.h:1443
void ApplySpellImmune(uint32 spellId, SpellImmunity op, uint32 type, bool apply)
Definition Unit.cpp:8261
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:8716
void SetImmuneToAll(bool apply, bool keepCombat)
Definition Unit.cpp:8524
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3769
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3973
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1362
void SetHealth(uint64 val)
Definition Unit.cpp:10041
void SetVirtualItem(uint32 slot, uint32 itemId, uint16 appearanceModId=0, uint16 itemVisual=0)
Definition Unit.cpp:14521
uint64 CountPctFromMaxHealth(float pct) const
Definition Unit.h:809
void SetUnitFlag3(UnitFlags3 flags)
Definition Unit.h:871
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3846
void SetFullHealth()
Definition Unit.h:814
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
Definition Unit.cpp:10804
void EnergizeBySpell(Unit *victim, SpellInfo const *spellInfo, int32 damage, Powers powerType)
Definition Unit.cpp:6817
ThreatManager & GetThreatManager()
Definition Unit.h:1093
uint8 GetClass() const
Definition Unit.h:776
uint32 GetMountDisplayId() const
Definition Unit.h:928
float GetCollisionHeight() const override
Definition Unit.cpp:14680
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:657
Unit * GetCharmer() const
Definition Unit.h:1229
std::forward_list< AuraEffect * > AuraEffectList
Definition Unit.h:664
void SetPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:10114
MotionMaster * GetMotionMaster()
Definition Unit.h:1750
Powers GetPowerType() const
Definition Unit.h:823
void Dismount()
Definition Unit.cpp:8336
Aura * AddAura(uint32 spellId, Unit *target)
Definition Unit.cpp:12344
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4622
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:866
int32 GetMaxPower(Powers power) const
Definition Unit.cpp:10105
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
Definition Unit.cpp:6795
void RemoveAllAurasOnDeath()
Definition Unit.cpp:4491
TempSummon * ToTempSummon()
Definition Unit.h:1844
void RemoveUnitFlag3(UnitFlags3 flags)
Definition Unit.h:872
void SetUninteractible(bool apply)
Definition Unit.cpp:8583
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition Unit.cpp:8303
bool IsCharmedOwnedByPlayerOrPlayer() const
Definition Unit.h:1237
virtual Gender GetNativeGender() const
Definition Unit.h:781
uint32 GetVirtualItemId(uint32 slot) const
Definition Unit.cpp:14505
uint64 GetMaxHealth() const
Definition Unit.h:801
uint16 GetMaxSkillValueForLevel(Unit const *target=nullptr) const
Definition Unit.h:947
void RemoveUnitFlag2(UnitFlags2 flags)
Definition Unit.h:867
bool HasAuraType(AuraType auraType) const
Definition Unit.cpp:4832
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:805
void GetAllMinionsByEntry(std::list< TempSummon * > &Minions, uint32 entry)
Definition Unit.cpp:6439
void SetFullPower(Powers power)
Definition Unit.h:837
bool IsMounted() const
Definition Unit.h:927
float GetSpeedRate(UnitMoveType mtype) const
Definition Unit.h:1734
int32 GetPower(Powers power) const
Definition Unit.cpp:10096
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition Unit.cpp:8961
DeathState getDeathState() const
Definition Unit.h:1208
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4822
SpellHistory * GetSpellHistory()
Definition Unit.h:1521
void HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
Definition Unit.cpp:1662
void SetUnitFlag(UnitFlags flags)
Definition Unit.h:861
bool IsFlying() const
Definition Unit.h:1823
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1315
void RemoveMovementImpairingAuras(bool withRoot)
Definition Unit.cpp:4312
Vehicle * GetVehicleKit() const
Definition Unit.h:1798
bool SetDisableGravity(bool disable, bool updateAnimTier=true, bool updatePlayHoverAnim=true)
Definition Unit.cpp:13440
bool IsFalling() const
Definition Unit.cpp:13035
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3992
uint8 GetLevel() const
Definition Unit.h:769
void SetMountDisplayId(uint32 mountDisplayId)
Definition Unit.h:929
uint8 GetRace() const
Definition Unit.h:773
virtual void SetDisplayId(uint32 displayId, bool setNative=false)
Definition Unit.cpp:10852
bool IsInCombat() const
Definition Unit.h:1073
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:862
AreaTrigger * GetAreaTrigger(uint32 spellId) const
Definition Unit.cpp:5488
virtual void ExitVehicle(Position const *exitPosition=nullptr)
Definition Unit.cpp:12931
Unit * GetPassenger(int8 seatId) const
Gets a passenger on specified seat.
Definition Vehicle.cpp:303
Map * GetMap() const
Definition Object.h:411
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
PhaseShift & GetPhaseShift()
Definition Object.h:310
Unit * GetOwner() const
Definition Object.cpp:1603
float GetDistance2d(WorldObject const *obj) const
Definition Object.cpp:448
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition Object.cpp:1626
EventProcessor m_Events
Definition Object.h:561
void MovePositionToFirstCollision(Position &pos, float dist, float angle) const
Definition Object.cpp:2833
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:430
uint32 GetAreaId() const
Definition Object.h:333
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< SpellCooldownStruct > SpellCooldowns
BattlePets::BattlePetMgr * GetBattlePetMgr() const
GameObject const * GetControlZone() const
void OnPeriodic(AuraEffect const *) const
GameObject const * GetControlZone() const
void FilterTargets(std::list< WorldObject * > &targets) 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 HandleDamage(SpellEffIndex)
bool Validate(SpellInfo const *) override
void Register() override
void HandleScript(SpellEffIndex)
void HandleHitTarget(SpellEffIndex) const
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 OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void CalcAmount(AuraEffect const *, SpellEffectValue &amount, bool &)
void Register() override
bool Validate(SpellInfo const *spellInfo) override
void CalcPeriodic(AuraEffect const *, bool &isPeriodic, int32 &)
void UpdatePeriodic(AuraEffect *aurEff)
bool Validate(SpellInfo const *spellInfo) override
void PeriodicTick(AuraEffect const *aurEff)
bool Validate(SpellInfo const *) override
SpellCastResult CheckCast()
void Register() override
void HandleApply(AuraEffect const *, AuraEffectHandleModes mode) const
void HandleRemove(AuraEffect const *, AuraEffectHandleModes) const
static uint32 GetDisplayIdForRace(Races race, Gender gender)
void UpdateRacials(Races oldRace, Races newRace) const
static std::vector< uint32 > RacialSkills
static std::unordered_map< Races, std::array< uint32, 2 > > const RaceDisplayIds
static Races GetReplacementRace(Races nativeRace, Classes playerClass)
bool Validate(SpellInfo const *) 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 HandleApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *spellInfo) override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void Register() override
bool Validate(SpellInfo const *spellInfo) override
void HandleScript(SpellEffIndex)
void Register() override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
SpellCastResult CheckIfCorpseNear()
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *spellInfo) override
bool Validate(SpellInfo const *spellInfo) override
void UpdatePeriodic(AuraEffect *aurEff)
void HandleScript(SpellEffIndex)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex effIndex)
void HandleScriptEffect(SpellEffIndex effIndex)
void Register() override
void HandleEffect(AuraEffect const *, AuraEffectHandleModes) const
bool Validate(SpellInfo const *) override
void CalculateDamage(SpellEffectInfo const &, 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 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 OnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleDummy(SpellEffIndex)
void HandleDespawn(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleScript(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 OnRemove(AuraEffect const *, AuraEffectHandleModes) const
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes) const
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) const
void AfterRemove(AuraEffect const *, AuraEffectHandleModes) const
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *spellInfo) override
void CalculateAmount(AuraEffect const *aurEff, SpellEffectValue &amount, bool &)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void Register() override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleEffectPeriodic(AuraEffect const *)
void HandleDummy(SpellEffIndex)
void Register() override
void Register() override
void HandleDummy(SpellEffIndex)
void HandleDummy(SpellEffIndex)
void OnRemove(AuraEffect const *effect, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void Register() override
spell_gen_knock_away_threat_reduction(int32 threatPercent)
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
void CalculateHealingBonus(SpellEffectInfo const &, Unit *, int32 &, int32 &, float &pctMod) const
bool Validate(SpellInfo const *) override
void OnPeriodic(AuraEffect const *aurEff)
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
void CalculateAmount(AuraEffect const *aurEff, SpellEffectValue &amount, bool &)
void SetBonusValueForEffect(SpellEffIndex effIndex, int32 value, AuraEffect const *aurEff)
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
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex effIndex)
void PeriodicTick(AuraEffect const *)
static void CalculateAmount(AuraScript const &, AuraEffect const *, SpellEffectValue &amount, bool &)
void HandleAbsorb(AuraEffect const *, DamageInfo const &dmgInfo, uint32 &absorbAmount)
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 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 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 &)
bool Validate(SpellInfo const *spellInfo) override
void HandleTauntEffect(SpellEffIndex effIndex)
void SelectRandomTarget(std::list< WorldObject * > &targets)
void PeriodicTick(AuraEffect const *)
void PeriodicTick(AuraEffect const *aurEff)
void PeriodicTick(AuraEffect const *)
bool Validate(SpellInfo const *spellInfo) override
void CalculateAmount(AuraEffect const *, SpellEffectValue &amount, bool &)
void RemoveInvalidTargets(std::list< WorldObject * > &targets)
void PeriodicTick(AuraEffect const *)
void HandleDummy(SpellEffIndex)
void HandleMount(AuraEffect const *aurEff, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void TriggerParachute(AuraEffect const *, AuraEffectHandleModes) const
static constexpr uint32 SPELL_PARACHUTE
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void AchievementCredit(SpellEffIndex)
void Register() override
spell_gen_set_health(uint64 health)
void HandleHit(SpellEffIndex)
void HandleSkinningEffect(SpellEffIndex)
void Register() override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex) const
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 HandleScript(SpellEffIndex)
void HandleScriptEffect(SpellEffIndex effIndex)
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 *, SpellEffectValue &amount, bool &)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void CalcWarModeBonus(AuraEffect const *, SpellEffectValue &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 OnPeriodic(AuraEffect const *)
bool Validate(SpellInfo const *) override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleSummon(SpellEffIndex effIndex)
@ SPELL_REVIVE_BATTLE_PETS
uint32 GetGameTimeMS()
Definition GameTime.cpp:57
SpellEffectValue GetBonusMultiplier(Unit const *unit, uint32 spellId)
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
Definition Containers.h:110
auto MapGetValuePtr(M &map, typename M::key_type const &key)
Definition MapUtils.h:37
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:67
TC_GAME_API int32 GetValue(int32 worldStateId, Map const *map)
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
SpatialRiftSpells
@ SPELL_SPATIAL_RIFT_AREATRIGGER
@ SPELL_SPATIAL_RIFT_TELEPORT
@ 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
@ 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
DreamingGlory
@ SPELL_DREAMING_GLORY
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
@ 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
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
@ 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
@ 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(SpellEffectValue val)
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:150
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:140
uint32 GetSubClass() const
uint32 GetClass() const
float level
Definition MapDefines.h:149
constexpr float GetPositionX() const
Definition Position.h:87
float m_positionZ
Definition Position.h:66
constexpr float GetPositionY() const
Definition Position.h:88
constexpr void GetPosition(float &x, float &y) const
Definition Position.h:92
constexpr float GetPositionZ() const
Definition Position.h:89
void Relocate(Position const &pos)
Definition Spell.cpp:82
void OnInitialize() override