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
743
745{
746 bool Validate(SpellInfo const* /*spellInfo*/) override
747 {
749 }
750
752 {
753 Unit* caster = GetCaster();
754 float max_range = GetSpellInfo()->GetMaxRange(false);
755 WorldObject* result = nullptr;
756 // search for nearby enemy corpse in range
759 Cell::VisitWorldObjects(caster, searcher, max_range);
760 if (!result)
761 Cell::VisitGridObjects(caster, searcher, max_range);
762 if (!result)
764 return SPELL_CAST_OK;
765 }
766
767 void HandleDummy(SpellEffIndex /*effIndex*/)
768 {
770 }
771
777};
778
779// 66020 Chains of Ice
781{
783 {
784 // Get 0 effect aura
786 if (!slow)
787 return;
788
789 SpellEffectValue newAmount = std::min(slow->GetAmount() + aurEff->GetAmount(), 0.0);
790 slow->ChangeAmount(newAmount);
791 }
792
797};
798
800{
801 SPELL_CHAOS_BLAST = 37675
803
805{
806 bool Validate(SpellInfo const* /*spellInfo*/) override
807 {
809 }
810
811 void HandleDummy(SpellEffIndex /* effIndex */)
812 {
813 int32 basepoints0 = 100;
814 Unit* caster = GetCaster();
815 if (Unit* target = GetHitUnit())
816 {
818 args.AddSpellBP0(basepoints0);
819 caster->CastSpell(target, SPELL_CHAOS_BLAST, args);
820 }
821 }
822
827};
828
829// 28471 - ClearAll
831{
832 void HandleScript(SpellEffIndex /*effIndex*/)
833 {
834 Unit* caster = GetCaster();
835 caster->RemoveAllAurasOnDeath();
836 }
837
842};
843
848
871
883
897
899{
912
913 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
914 {
915 Unit* caster = GetCaster();
916 Unit* target = GetTarget();
917 if (!caster)
918 return;
919
920 switch (GetSpellInfo()->Id)
921 {
925 {
926 prevItem = target->GetVirtualItemId(0);
927
928 if (Player* player = caster->ToPlayer())
929 {
930 if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
931 target->SetVirtualItem(0, mainItem->GetEntry());
932 }
933 else
934 target->SetVirtualItem(0, caster->GetVirtualItemId(0));
935 break;
936 }
939 {
940 prevItem = target->GetVirtualItemId(1);
941
942 if (Player* player = caster->ToPlayer())
943 {
944 if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
945 target->SetVirtualItem(1, offItem->GetEntry());
946 }
947 else
948 target->SetVirtualItem(1, caster->GetVirtualItemId(1));
949 break;
950 }
952 {
953 prevItem = target->GetVirtualItemId(2);
954
955 if (Player* player = caster->ToPlayer())
956 {
957 if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
958 target->SetVirtualItem(2, rangedItem->GetEntry());
959 }
960 else
961 target->SetVirtualItem(2, caster->GetVirtualItemId(2));
962 break;
963 }
964 default:
965 break;
966 }
967 }
968
969 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
970 {
971 Unit* target = GetTarget();
972
973 switch (GetSpellInfo()->Id)
974 {
978 target->SetVirtualItem(0, prevItem);
979 break;
982 target->SetVirtualItem(1, prevItem);
983 break;
985 target->SetVirtualItem(2, prevItem);
986 break;
987 default:
988 break;
989 }
990 }
991
997
999};
1000
1002{
1003public:
1005
1007 {
1008 if (!_damagePct)
1010
1011 SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(_damagePct));
1012 }
1013
1018
1019private:
1021};
1022
1023// 28865 - Consumption
1024// 64208 - Consumption
1026{
1027 void CalculateDamage(SpellEffectInfo const& /*spellEffectInfo*/, Unit const* /*victim*/, int32& damage, int32& /*flatMod*/, float& /*pctMod*/) const
1028 {
1029 if (SpellInfo const* createdBySpell = sSpellMgr->GetSpellInfo(GetCaster()->m_unitData->CreatedBySpell, GetCastDifficulty()))
1030 damage = createdBySpell->GetEffect(EFFECT_1).CalcValueAsInt();
1031 }
1032
1037};
1038
1039// 63845 - Create Lance
1045
1047{
1048 bool Validate(SpellInfo const* /*spellInfo*/) override
1049 {
1050 return ValidateSpellInfo(
1051 {
1054 });
1055 }
1056
1058 {
1059 PreventHitDefaultEffect(effIndex);
1060
1061 if (Player* target = GetHitPlayer())
1062 {
1063 if (target->GetTeam() == ALLIANCE)
1065 else if (target->GetTeam() == HORDE)
1067 }
1068 }
1069
1074};
1075
1086
1088{
1089 bool Validate(SpellInfo const* spellInfo) override
1090 {
1091 switch (spellInfo->Id)
1092 {
1094 return ValidateSpellInfo(
1095 {
1098 });
1100 return ValidateSpellInfo(
1101 {
1104 });
1105 default:
1106 break;
1107 }
1108
1109 return false;
1110 }
1111
1112 void HandleScript(SpellEffIndex /*effIndex*/)
1113 {
1114 if (Player* player = GetHitPlayer())
1115 {
1116 uint8 gender = player->GetNativeGender();
1117
1118 uint32 spellId = GetSpellInfo()->Id;
1119
1120 switch (spellId)
1121 {
1124 break;
1127 break;
1128 default:
1129 break;
1130 }
1131
1132 GetCaster()->CastSpell(player, spellId, true);
1133 }
1134 }
1135
1140};
1141
1143{
1145 {
1146 if (Aura* aur = GetHitAura())
1147 aur->SetStackAmount(static_cast<uint8>(GetSpellInfo()->StackAmount));
1148 }
1149
1154};
1155
1157{
1158protected:
1160
1161 bool CheckProc(ProcEventInfo& eventInfo)
1162 {
1163 return (eventInfo.GetSpellInfo() == GetSpellInfo());
1164 }
1165
1166 void Decay(ProcEventInfo& /*eventInfo*/)
1167 {
1169 ModStackAmount(-1);
1170 }
1171
1177};
1178
1180{
1181 // found in sniffs, there is no duration entry we can possibly use
1182 AURA_DURATION = 12600
1184
1185// 32065 - Fungal Decay
1204
1205// 36659 - Tail Sting
1209
1216
1218{
1219 bool Validate(SpellInfo const* /*spellInfo*/) override
1220 {
1221 return ValidateSpellInfo(
1222 {
1226 });
1227 }
1228
1230 {
1231 if (GetCaster())
1232 {
1233 Unit* target = GetTarget();
1234
1235 for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
1237
1238 target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, aurEff);
1239 }
1240 else
1242 }
1243
1244 void RemoveVisualShields(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1245 {
1246 for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
1248 }
1249
1251 {
1252 if (Unit* caster = GetCaster())
1253 if (TempSummon* vehicle = caster->ToTempSummon())
1254 if (Unit* rider = vehicle->GetSummonerUnit())
1255 rider->RemoveAurasDueToSpell(GetId());
1256 }
1257
1258 void Register() override
1259 {
1260 /*
1261 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(m_scriptSpellId, DIFFICULTY_NONE);
1262
1263 // 6.x effects removed
1264
1265 // Defend spells cast by NPCs (add visuals)
1266 if (spell->GetEffect(EFFECT_0)->ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
1267 {
1268 AfterEffectApply += AuraEffectApplyFn(spell_gen_defend::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
1269 OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend::RemoveVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
1270 }
1271
1272 // Remove Defend spell from player when he dismounts
1273 if (spell->GetEffect(EFFECT_2)->ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
1274 OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
1275
1276 // Defend spells cast by players (add/remove visuals)
1277 if (spell->GetEffect(EFFECT_1)->ApplyAuraName == SPELL_AURA_DUMMY)
1278 {
1279 AfterEffectApply += AuraEffectApplyFn(spell_gen_defend::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
1280 OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend::RemoveVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
1281 }
1282 */
1283 }
1284};
1285
1287{
1288 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1289 {
1290 if (Creature* target = GetTarget()->ToCreature())
1291 target->DespawnOrUnsummon();
1292 }
1293
1298};
1299
1302{
1303 bool Load() override
1304 {
1305 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1306 }
1307
1308 void HandleDummy(SpellEffIndex /*effIndex*/)
1309 {
1312 }
1313
1318};
1319
1321{
1322 void HandleDespawn(SpellEffIndex /*effIndex*/)
1323 {
1325 if (Creature* target = GetHitCreature())
1326 target->DespawnOrUnsummon();
1327 }
1328
1333};
1334
1339
1340// 70769 Divine Storm!
1342{
1343 bool Load() override
1344 {
1345 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1346 }
1347
1348 bool Validate(SpellInfo const* /*spellInfo*/) override
1349 {
1351 }
1352
1353 void HandleScript(SpellEffIndex /*effIndex*/)
1354 {
1356 }
1357
1362};
1363
1365{
1366 void HandleScript(SpellEffIndex /*effIndex*/)
1367 {
1368 // Here the target is the water spout and determines the position where the player is knocked from
1369 if (Unit* target = GetHitUnit())
1370 {
1371 if (Player* player = GetCaster()->ToPlayer())
1372 {
1373 float horizontalSpeed = 20.0f + (40.0f - GetCaster()->GetDistance(target));
1374 float verticalSpeed = 8.0f;
1375 // This method relies on the Dalaran Sewer map disposition and Water Spout position
1376 // What we do is knock the player from a position exactly behind him and at the end of the pipe
1377 player->KnockbackFrom(target->GetPosition(), horizontalSpeed, verticalSpeed);
1378 }
1379 }
1380 }
1381
1386};
1387
1388// 50051 - Ethereal Pet Aura
1401
1402// 50051 - Ethereal Pet Aura
1404{
1405 bool CheckProc(ProcEventInfo& eventInfo)
1406 {
1407 uint32 levelDiff = std::abs(GetTarget()->GetLevel() - eventInfo.GetProcTarget()->GetLevel());
1408 return levelDiff <= 9;
1409 }
1410
1411 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
1412 {
1414
1415 std::list<TempSummon*> minionList;
1417 for (Creature* minion : minionList)
1418 {
1419 if (minion->IsAIEnabled())
1420 {
1421 minion->AI()->Talk(SAY_STEAL_ESSENCE);
1422 minion->CastSpell(eventInfo.GetProcTarget(), SPELL_STEAL_ESSENCE_VISUAL);
1423 }
1424 }
1425 }
1426
1432};
1433
1434// 50052 - Ethereal Pet onSummon
1436{
1437 bool Validate(SpellInfo const* /*spellInfo*/) override
1438 {
1440 }
1441
1443 {
1444 Unit* target = GetHitUnit();
1445 target->CastSpell(target, SPELL_PROC_TRIGGER_ON_KILL_AURA, true);
1446 }
1447
1452};
1453
1454// 50055 - Ethereal Pet Aura Remove
1472
1473// 50101 - Ethereal Pet OnKill Steal Essence
1475{
1476 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1477 {
1478 if (Unit* caster = GetCaster())
1479 {
1480 caster->CastSpell(caster, SPELL_CREATE_TOKEN, true);
1481 if (Creature* soulTrader = caster->ToCreature())
1482 soulTrader->AI()->Talk(SAY_CREATE_TOKEN);
1483 }
1484 }
1485
1490};
1491
1511
1512/* 57337 - Great Feast
1513 57397 - Fish Feast
1514 58466 - Gigantic Feast
1515 58475 - Small Feast
1516 66477 - Bountiful Feast */
1518{
1535
1536 void HandleScript(SpellEffIndex /*effIndex*/)
1537 {
1538 Unit* target = GetHitUnit();
1539
1540 switch (GetSpellInfo()->Id)
1541 {
1542 case SPELL_GREAT_FEAST:
1543 target->CastSpell(target, SPELL_FEAST_FOOD);
1544 target->CastSpell(target, SPELL_FEAST_DRINK);
1546 break;
1547 case SPELL_FISH_FEAST:
1548 target->CastSpell(target, SPELL_FEAST_FOOD);
1549 target->CastSpell(target, SPELL_FEAST_DRINK);
1550 target->CastSpell(target, SPELL_FISH_FEAST_REFRESHMENT);
1551 break;
1553 target->CastSpell(target, SPELL_FEAST_FOOD);
1554 target->CastSpell(target, SPELL_FEAST_DRINK);
1556 break;
1557 case SPELL_SMALL_FEAST:
1558 target->CastSpell(target, SPELL_FEAST_FOOD);
1559 target->CastSpell(target, SPELL_FEAST_DRINK);
1561 break;
1564 target->CastSpell(target, SPELL_BOUNTIFUL_FEAST_DRINK);
1565 target->CastSpell(target, SPELL_BOUNTIFUL_FEAST_FOOD);
1566 break;
1567 default:
1568 break;
1569 }
1570 }
1571
1576};
1577
1578/*
1579There are only 3 possible flags Feign Death auras can apply: UNIT_DYNFLAG_DEAD, UNIT_FLAG2_FEIGN_DEATH
1580and UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT. Some auras can apply only 2 flags
1581
1582spell_gen_feign_death_all_flags applies all 3 flags
1583spell_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
1584spell_gen_feign_death_all_flags_no_uninteractible applies all 3 flags and additionally sets UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC
1585spell_gen_feign_death_no_dyn_flag applies no UNIT_DYNFLAG_DEAD (does not make the creature appear dead)
1586spell_gen_feign_death_no_prevent_emotes applies no UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
1587
1588REACT_PASSIVE should be handled directly in scripts since not all creatures should be passive. Otherwise
1589creature will be not able to aggro or execute MoveInLineOfSight events. Removing may cause more issues
1590than already exists
1591*/
1592
1594{
1595 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1596 {
1597 Unit* target = GetTarget();
1601
1602 if (Creature* creature = target->ToCreature())
1603 creature->SetReactState(REACT_PASSIVE);
1604 }
1605
1606 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1607 {
1608 Unit* target = GetTarget();
1612
1613 if (Creature* creature = target->ToCreature())
1614 creature->InitializeReactState();
1615 }
1616
1622};
1623
1625{
1626 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1627 {
1628 Unit* target = GetTarget();
1632 target->SetImmuneToAll(true);
1633 target->SetUninteractible(true);
1634
1635 if (Creature* creature = target->ToCreature())
1636 creature->SetReactState(REACT_PASSIVE);
1637 }
1638
1639 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1640 {
1641 Unit* target = GetTarget();
1645 target->SetImmuneToAll(false);
1646 target->SetUninteractible(false);
1647
1648 if (Creature* creature = target->ToCreature())
1649 creature->InitializeReactState();
1650 }
1651
1657};
1658
1659// 96733 - Permanent Feign Death (Stun)
1661{
1662 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
1663 {
1664 Unit* target = GetTarget();
1668 target->SetImmuneToAll(true);
1669
1670 if (Creature* creature = target->ToCreature())
1671 creature->SetReactState(REACT_PASSIVE);
1672 }
1673
1674 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
1675 {
1676 Unit* target = GetTarget();
1680 target->SetImmuneToAll(false);
1681
1682 if (Creature* creature = target->ToCreature())
1683 creature->InitializeReactState();
1684 }
1685
1691};
1692
1693// 35357 - Spawn Feign Death
1694// 51329 - Feign Death
1696{
1697 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1698 {
1699 Unit* target = GetTarget();
1702
1703 if (Creature* creature = target->ToCreature())
1704 creature->SetReactState(REACT_PASSIVE);
1705 }
1706
1707 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1708 {
1709 Unit* target = GetTarget();
1712
1713 if (Creature* creature = target->ToCreature())
1714 creature->InitializeReactState();
1715 }
1716
1722};
1723
1724// 58951 - Permanent Feign Death
1726{
1727 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1728 {
1729 Unit* target = GetTarget();
1732
1733 if (Creature* creature = target->ToCreature())
1734 creature->SetReactState(REACT_PASSIVE);
1735 }
1736
1737 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1738 {
1739 Unit* target = GetTarget();
1742
1743 if (Creature* creature = target->ToCreature())
1744 creature->InitializeReactState();
1745 }
1746
1752};
1753
1760
1761// 35491 - Furious Rage
1763{
1764 bool Validate(SpellInfo const* /*spellInfo*/) override
1765 {
1766 return ValidateSpellInfo({ SPELL_EXHAUSTION }) &&
1769 }
1770
1771 void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1772 {
1773 Unit* target = GetTarget();
1774 target->Unit::TextEmote(EMOTE_FURIOUS_RAGE, target, false);
1775 }
1776
1777 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1778 {
1779 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
1780 return;
1781
1782 Unit* target = GetTarget();
1783 target->Unit::TextEmote(EMOTE_EXHAUSTED, target, false);
1784 target->CastSpell(target, SPELL_EXHAUSTION, true);
1785 }
1786
1792};
1793
1794// 46642 - 5,000 Gold
1796{
1797 void HandleScript(SpellEffIndex /*effIndex*/)
1798 {
1799 if (Player* target = GetHitPlayer())
1800 target->ModifyMoney(5000 * GOLD);
1801 }
1802
1807};
1808
1814
1815// 131474 - Fishing
1817{
1818 bool Validate(SpellInfo const* /*spellInfo*/) override
1819 {
1821 }
1822
1823 bool Load() override
1824 {
1825 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1826 }
1827
1829 {
1830 PreventHitDefaultEffect(effIndex);
1831 uint32 spellId;
1833 if (!mainHand || mainHand->GetTemplate()->GetClass() != ITEM_CLASS_WEAPON || mainHand->GetTemplate()->GetSubClass() != ITEM_SUBCLASS_WEAPON_FISHING_POLE)
1835 else
1836 spellId = SPELL_FISHING_WITH_POLE;
1837
1838 GetCaster()->CastSpell(GetCaster(), spellId, false);
1839 }
1840
1845};
1846
1853
1855{
1856 bool Validate(SpellInfo const* /*spellInfo*/) override
1857 {
1858 return ValidateSpellInfo(
1859 {
1863 });
1864 }
1865
1866 void HandleDummy(SpellEffIndex /* effIndex */)
1867 {
1868 Unit* caster = GetCaster();
1869 int32 r = irand(0, 119);
1870 if (r < 20) // Transporter Malfunction - 1/6 polymorph
1872 else if (r < 100) // Evil Twin - 4/6 evil twin
1873 caster->CastSpell(caster, SPELL_TRANSPORTER_EVIL_TWIN, true);
1874 else // Transporter Malfunction - 1/6 miss the target
1875 caster->CastSpell(caster, SPELL_TRANSPORTER_MALFUNCTION_MISS, true);
1876 }
1877
1882};
1883
1884// 28880 - Warrior
1885// 59542 - Paladin
1886// 59543 - Hunter
1887// 59544 - Priest
1888// 59545 - Death Knight
1889// 59547 - Shaman
1890// 59548 - Mage
1891// 121093 - Monk
1893{
1894 bool Validate(SpellInfo const* spellInfo) override
1895 {
1896 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
1897 }
1898
1899 void CalculateAmount(AuraEffect const* aurEff, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
1900 {
1901 if (!GetCaster() || !aurEff->GetTotalTicks())
1902 return;
1903
1904 SpellEffectValue healPct = GetEffectInfo(EFFECT_1).CalcValue() / 100.0;
1905 SpellEffectValue heal = healPct * GetCaster()->GetMaxHealth();
1906 SpellEffectValue healTick = std::floor(heal / aurEff->GetTotalTicks());
1907 amount += healTick;
1908 }
1909
1914};
1915
1921
1923{
1924 bool Validate(SpellInfo const* /*spellInfo*/) override
1925 {
1926 return ValidateSpellInfo(
1927 {
1930 });
1931 }
1932
1937
1942};
1943
1944// 69641 - Gryphon/Wyvern Pet - Mounting Check Aura
1946{
1947 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
1948 {
1949 Unit* target = GetTarget();
1950 Unit* owner = target->GetOwner();
1951
1952 if (!owner)
1953 return;
1954
1955 if (owner->IsMounted())
1956 target->SetDisableGravity(true);
1957 else
1958 target->SetDisableGravity(false);
1959 }
1960
1965};
1966
1967/* 9204 - Hate to Zero (Melee)
1968 20538 - Hate to Zero (AoE)
1969 26569 - Hate to Zero (AoE)
1970 26637 - Hate to Zero (AoE, Unique)
1971 37326 - Hate to Zero (AoE)
1972 40410 - Hate to Zero (Should be added, AoE)
1973 40467 - Hate to Zero (Should be added, AoE)
1974 41582 - Hate to Zero (Should be added, Melee) */
1976{
1977 void HandleDummy(SpellEffIndex /*effIndex*/)
1978 {
1979 if (GetCaster()->CanHaveThreatList())
1981 }
1982
1987};
1988
1989// This spell is used by both player and creature, but currently works only if used by player
1990// 63984 - Hate to Zero
1992{
1993 void HandleDummy(SpellEffIndex /*effIndex*/)
1994 {
1995 if (Unit* target = GetHitUnit())
1996 if (target->CanHaveThreatList())
1997 target->GetThreatManager().ModifyThreatByPercent(GetCaster(), -100);
1998 }
1999
2004};
2005
2006// 19707 - Hate to 50%
2008{
2009 void HandleDummy(SpellEffIndex /*effIndex*/)
2010 {
2011 if (GetCaster()->CanHaveThreatList())
2013 }
2014
2019};
2020
2021// 26886 - Hate to 75%
2023{
2024 void HandleDummy(SpellEffIndex /*effIndex*/)
2025 {
2026 if (GetCaster()->CanHaveThreatList())
2028 }
2029
2034};
2035
2040
2041// 32748 - Deadly Throw Interrupt
2042// 44835 - Maim Interrupt
2044{
2045 bool Validate(SpellInfo const* /*spellInfo*/) override
2046 {
2048 }
2049
2050 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2051 {
2054 }
2055
2060};
2061
2063{
2064 void HandleDummy(SpellEffIndex /*effIndex*/)
2065 {
2066 if (GetHitUnit()->IsInRaidWith(GetCaster()))
2067 GetCaster()->CastSpell(GetCaster(), GetEffectValueAsInt() + 1, true); // raid buff
2068 else
2069 GetCaster()->CastSpell(GetHitUnit(), GetEffectValueAsInt(), true); // single-target buff
2070 }
2071
2076};
2077
2086
2088{
2089public:
2091
2092private:
2093 bool Validate(SpellInfo const* /*spellInfo*/) override
2094 {
2095 return ValidateSpellInfo({ _spellId });
2096 }
2097
2098 void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
2099 {
2100 // final heal only on duration end or dispel
2101 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
2102 return;
2103
2104 // final heal
2105 GetTarget()->CastSpell(GetTarget(), _spellId, CastSpellExtraArgs(aurEff).SetOriginalCaster(GetCasterGUID()));
2106 }
2107
2112
2114};
2115
2116/* DOCUMENTATION: Charge spells
2117 Charge spells can be classified in four groups:
2118
2119 - Spells on vehicle bar used by players:
2120 + EFFECT_0: SCRIPT_EFFECT
2121 + EFFECT_1: TRIGGER_SPELL
2122 + EFFECT_2: NONE
2123 - Spells cast by player's mounts triggered by script:
2124 + EFFECT_0: CHARGE
2125 + EFFECT_1: TRIGGER_SPELL
2126 + EFFECT_2: APPLY_AURA
2127 - Spells cast by players on the target triggered by script:
2128 + EFFECT_0: SCHOOL_DAMAGE
2129 + EFFECT_1: SCRIPT_EFFECT
2130 + EFFECT_2: NONE
2131 - Spells cast by NPCs on players:
2132 + EFFECT_0: SCHOOL_DAMAGE
2133 + EFFECT_1: CHARGE
2134 + EFFECT_2: SCRIPT_EFFECT
2135
2136 In the following script we handle the SCRIPT_EFFECT and CHARGE
2137 - When handling SCRIPT_EFFECT:
2138 + EFFECT_0: Corresponds to "Spells on vehicle bar used by players" and we make player's mount cast
2139 the charge effect on the current target ("Spells cast by player's mounts triggered by script").
2140 + EFFECT_1 and EFFECT_2: Triggered when "Spells cast by player's mounts triggered by script" hits target,
2141 corresponding to "Spells cast by players on the target triggered by script" and "Spells cast by
2142 NPCs on players" and we check Defend layers and drop a charge of the first found.
2143 - When handling CHARGE:
2144 + Only launched for "Spells cast by player's mounts triggered by script", makes the player cast the
2145 damaging spell on target with a small chance of failing it.
2146*/
2147
2165
2167{
2168 bool Validate(SpellInfo const* /*spellInfo*/) override
2169 {
2170 return ValidateSpellInfo({ 62552, 62719, 64100, 66482 });
2171 }
2172
2174 {
2175 Unit* target = GetHitUnit();
2176
2177 switch (effIndex)
2178 {
2179 case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
2180 {
2181 uint32 spellId;
2182
2183 switch (GetSpellInfo()->Id)
2184 {
2187 break;
2190 break;
2191 default:
2192 return;
2193 }
2194
2195 // If target isn't a training dummy there's a chance of failing the charge
2196 if (!target->IsCharmedOwnedByPlayerOrPlayer() && roll_chance(12.5f))
2197 spellId = SPELL_CHARGE_MISS_EFFECT;
2198
2199 if (Unit* vehicle = GetCaster()->GetVehicleBase())
2200 vehicle->CastSpell(target, spellId, false);
2201 else
2202 GetCaster()->CastSpell(target, spellId, false);
2203 break;
2204 }
2205 case EFFECT_1: // On damaging spells, for removing a defend layer
2206 case EFFECT_2:
2207 {
2208 Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
2209 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
2210 {
2211 if (Aura* aura = itr->second->GetBase())
2212 {
2213 if (aura->GetId() == 62552 || aura->GetId() == 62719 || aura->GetId() == 64100 || aura->GetId() == 66482)
2214 {
2215 aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
2216 // Remove dummys from rider (Necessary for updating visual shields)
2217 if (Unit* rider = target->GetCharmer())
2218 if (Aura* defend = rider->GetAura(aura->GetId()))
2219 defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
2220 break;
2221 }
2222 }
2223 }
2224 break;
2225 }
2226 default:
2227 break;
2228 }
2229 }
2230
2232 {
2233 uint32 spellId;
2234
2235 switch (GetSpellInfo()->Id)
2236 {
2238 spellId = SPELL_CHARGE_DAMAGE_8K5;
2239 break;
2242 spellId = SPELL_CHARGE_DAMAGE_20K;
2243 break;
2246 spellId = SPELL_CHARGE_DAMAGE_45K;
2247 break;
2248 default:
2249 return;
2250 }
2251
2252 if (Unit* rider = GetCaster()->GetCharmer())
2253 rider->CastSpell(GetHitUnit(), spellId, false);
2254 else
2255 GetCaster()->CastSpell(GetHitUnit(), spellId, false);
2256 }
2257
2268};
2269
2271{
2272 SPELL_FALL_DOWN = 6869
2274
2275// 6870 Moss Covered Feet
2276// 31399 Moss Covered Feet
2278{
2279 bool Validate(SpellInfo const* /*spellInfo*/) override
2280 {
2282 }
2283
2284 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2285 {
2287 eventInfo.GetActionTarget()->CastSpell(nullptr, SPELL_FALL_DOWN, aurEff);
2288 }
2289
2294};
2295
2300
2301// 28702 - Netherbloom
2303{
2304 bool Validate(SpellInfo const* /*spellInfo*/) override
2305 {
2306 for (uint8 i = 0; i < 5; ++i)
2308 return false;
2309
2310 return true;
2311 }
2312
2314 {
2315 PreventHitDefaultEffect(effIndex);
2316
2317 if (Unit* target = GetHitUnit())
2318 {
2319 // 25% chance of casting a random buff
2320 if (roll_chance(75))
2321 return;
2322
2323 // triggered spells are 28703 to 28707
2324 // Note: some sources say, that there was the possibility of
2325 // receiving a debuff. However, this seems to be removed by a patch.
2326
2327 // don't overwrite an existing aura
2328 for (uint8 i = 0; i < 5; ++i)
2329 if (target->HasAura(SPELL_NETHERBLOOM_POLLEN_1 + i))
2330 return;
2331
2332 target->CastSpell(target, SPELL_NETHERBLOOM_POLLEN_1 + urand(0, 4), true);
2333 }
2334 }
2335
2340};
2341
2346
2347// 28720 - Nightmare Vine
2349{
2350 bool Validate(SpellInfo const* /*spellInfo*/) override
2351 {
2353 }
2354
2356 {
2357 PreventHitDefaultEffect(effIndex);
2358
2359 if (Unit* target = GetHitUnit())
2360 {
2361 // 25% chance of casting Nightmare Pollen
2362 if (roll_chance(25))
2363 target->CastSpell(target, SPELL_NIGHTMARE_POLLEN, true);
2364 }
2365 }
2366
2371};
2372
2373// 27746 - Nitrous Boost
2375{
2376 void PeriodicTick(AuraEffect const* /*aurEff*/)
2377 {
2379
2380 if (GetCaster() && GetTarget()->GetPower(POWER_MANA) >= 10)
2382 else
2383 Remove();
2384 }
2385
2390};
2391
2401
2402// 27539 - Obsidian Armor
2404{
2417
2418 bool CheckProc(ProcEventInfo& eventInfo)
2419 {
2420 if (!eventInfo.GetSpellInfo())
2421 return false;
2422
2424 return false;
2425
2426 return true;
2427 }
2428
2429 void OnProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2430 {
2432
2433 uint32 spellId = 0;
2434 switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
2435 {
2436 case SPELL_SCHOOL_HOLY:
2438 break;
2439 case SPELL_SCHOOL_FIRE:
2441 break;
2444 break;
2445 case SPELL_SCHOOL_FROST:
2447 break;
2450 break;
2453 break;
2454 default:
2455 return;
2456 }
2457 GetTarget()->CastSpell(GetTarget(), spellId, aurEff);
2458 }
2459
2465};
2466
2468{
2469 bool Validate(SpellInfo const* spellInfo) override
2470 {
2471 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
2472 }
2473
2474 bool Load() override
2475 {
2476 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2477 }
2478
2479 void HandleDummy(SpellEffIndex /*effIndex*/)
2480 {
2481 Player* player = GetCaster()->ToPlayer();
2482 uint32 factionId = GetEffectInfo().CalcValueAsInt();
2484
2485 FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
2486 if (!factionEntry)
2487 return;
2488
2489 // Set rep to baserep + basepoints (expecting spillover for oposite faction -> become hated)
2490 // Not when player already has equal or higher rep with this faction
2491 if (player->GetReputationMgr().GetReputation(factionEntry) < repChange)
2492 player->GetReputationMgr().SetReputation(factionEntry, repChange);
2493
2494 // EFFECT_INDEX_2 most likely update at war state, we already handle this in SetReputation
2495 }
2496
2501};
2502
2509
2511{
2512 bool Validate(SpellInfo const* /*spellInfo*/) override
2513 {
2514 return ValidateSpellInfo(
2515 {
2519 });
2520 }
2521
2522 void HandleScript(SpellEffIndex /*effIndex*/)
2523 {
2524 Unit* caster = GetCaster();
2525 if (Player* target = GetHitPlayer())
2526 {
2527 uint8 gender = target->GetNativeGender();
2528 if (!gender)
2529 caster->CastSpell(target, SPELL_ORC_DISGUISE_MALE, true);
2530 else
2531 caster->CastSpell(target, SPELL_ORC_DISGUISE_FEMALE, true);
2532 }
2533 }
2534
2539};
2540
2542{
2543 SPELL_PARALYSIS = 35202
2545
2546// 35201 - Paralytic Poison
2548{
2549 bool Validate(SpellInfo const* /*spellInfo*/) override
2550 {
2552 }
2553
2554 void HandleStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
2555 {
2556 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
2557 return;
2558
2559 GetTarget()->CastSpell(nullptr, SPELL_PARALYSIS, aurEff);
2560 }
2561
2566};
2567
2588
2590{
2591 bool Validate(SpellInfo const* spellInfo) override
2592 {
2593 return sBroadcastTextStore.HasRecord(uint32(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()));
2594 }
2595
2596 void HandleScript(SpellEffIndex /*effIndex*/)
2597 {
2598 // Note: target here is always player; caster here is gameobject, creature or player (self cast)
2599 if (Unit* target = GetHitUnit())
2600 target->Unit::Say(uint32(GetEffectValueAsInt()), target);
2601 }
2602
2607};
2608
2610{
2611 bool CheckProc(ProcEventInfo& eventInfo)
2612 {
2613 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
2614 if (!damageInfo || !damageInfo->GetDamage())
2615 return false;
2616
2618
2619 if (eventInfo.GetActionTarget()->HealthBelowPctDamaged(pct, damageInfo->GetDamage()))
2620 return true;
2621
2622 return false;
2623 }
2624
2629};
2630
2632{
2633 void HandleChargeDrop(ProcEventInfo& /*eventInfo*/)
2634 {
2636 }
2637
2642};
2643
2649
2650// 45472 Parachute
2652{
2653 bool Validate(SpellInfo const* /*spellInfo*/) override
2654 {
2655 return ValidateSpellInfo(
2656 {
2659 });
2660 }
2661
2662 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
2663 {
2664 if (Player* target = GetTarget()->ToPlayer())
2665 if (target->IsFalling())
2666 {
2667 target->RemoveAurasDueToSpell(SPELL_PARACHUTE);
2668 target->CastSpell(target, SPELL_PARACHUTE_BUFF, true);
2669 }
2670 }
2671
2676};
2677
2679{
2682 NPC_IMP = 416
2684
2686{
2687 bool Load() override
2688 {
2689 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2690 }
2691
2692 void HandleScript(SpellEffIndex /*effIndex*/)
2693 {
2694 Player* player = GetCaster()->ToPlayer();
2695 if (player->GetLastPetNumber())
2696 {
2697 PetType newPetType = (player->GetClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
2698 Pet* newPet = new Pet(player, newPetType);
2699 if (newPet->LoadPetFromDB(player, 0, player->GetLastPetNumber(), true))
2700 {
2701 // revive the pet if it is dead
2702 if (newPet->getDeathState() != ALIVE && newPet->getDeathState() != JUST_RESPAWNED)
2704
2705 newPet->SetFullHealth();
2706 newPet->SetFullPower(newPet->GetPowerType());
2707
2708 switch (newPet->GetEntry())
2709 {
2710 case NPC_DOOMGUARD:
2711 case NPC_INFERNAL:
2712 newPet->SetEntry(NPC_IMP);
2713 break;
2714 default:
2715 break;
2716 }
2717 }
2718 else
2719 delete newPet;
2720 }
2721 }
2722
2727};
2728
2729// 36553 - PetWait
2731{
2732 void HandleScript(SpellEffIndex /*effIndex*/)
2733 {
2736 }
2737
2742};
2743
2748
2750{
2751 bool Load() override
2752 {
2753 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2754 }
2755
2757 {
2758 Player* player = GetCaster()->ToPlayer();
2759
2760 if (HasDiscoveredAllSpells(GetSpellInfo()->Id, player))
2761 {
2764 }
2765
2766 return SPELL_CAST_OK;
2767 }
2768
2769 void HandleScript(SpellEffIndex /*effIndex*/)
2770 {
2771 Player* caster = GetCaster()->ToPlayer();
2772 uint32 spellId = GetSpellInfo()->Id;
2773
2774 // Learn random explicit discovery recipe (if any)
2775 // Players will now learn 3 recipes the very first time they perform Northrend Inscription Research (3.3.0 patch notes)
2776 if (spellId == SPELL_NORTHREND_INSCRIPTION_RESEARCH && !HasDiscoveredAnySpell(spellId, caster))
2777 for (int i = 0; i < 2; ++i)
2778 if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
2779 caster->LearnSpell(discoveredSpellId, false);
2780
2781 if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
2782 caster->LearnSpell(discoveredSpellId, false);
2783 }
2784
2790};
2791
2797
2799{
2801 {
2802 Player* caster = GetCaster()->ToPlayer();
2803
2804 switch (caster->GetEffectiveTeam())
2805 {
2806 case ALLIANCE:
2808 break;
2809 case HORDE:
2811 break;
2812 default:
2813 break;
2814 }
2815 }
2816
2821};
2822
2824{
2825 void HandleScript(SpellEffIndex /*effIndex*/)
2826 {
2827 if (Unit* target = GetHitUnit())
2828 {
2829 target->RemoveAurasByType(SPELL_AURA_FLY);
2830 target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
2831 }
2832 }
2833
2838};
2839
2840// 20589 - Escape artist
2853
2854// 23493 - Restoration
2855// 24379 - Restoration
2857{
2858 void PeriodicTick(AuraEffect const* /*aurEff*/)
2859 {
2861
2862 Unit* target = GetTarget();
2863 if (!target)
2864 return;
2865
2866 int32 heal = target->CountPctFromMaxHealth(10);
2867 HealInfo healInfo(target, target, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
2868 target->HealBySpell(healInfo);
2869
2871 if (int32 mana = target->GetMaxPower(POWER_MANA))
2872 {
2873 mana /= 10;
2874 target->EnergizeBySpell(target, GetSpellInfo(), mana, POWER_MANA);
2875 }
2876 }
2877
2882};
2883
2884// 38772 Grievous Wound
2885// 43937 Grievous Wound
2886// 62331 Impale
2887// 62418 Impale
2889{
2890 bool Validate(SpellInfo const* spellInfo) override
2891 {
2892 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
2893 }
2894
2895 void PeriodicTick(AuraEffect const* /*aurEff*/)
2896 {
2897 // they apply damage so no need to check for ticks here
2898
2899 if (GetTarget()->HealthAbovePct(GetEffectInfo(EFFECT_1).CalcValue()))
2900 {
2903 }
2904 }
2905
2910};
2911
2912// 31956 Grievous Wound
2913// 38801 Grievous Wound
2914// 43093 Grievous Throw
2915// 58517 Grievous Wound
2916// 59262 Grievous Wound
2918{
2919 void PeriodicTick(AuraEffect const* aurEff)
2920 {
2921 // if it has only periodic effect, allow 1 tick
2922 bool onlyEffect = GetSpellInfo()->GetEffects().size() == 1;
2923 if (onlyEffect && aurEff->GetTickNumber() <= 1)
2924 return;
2925
2926 if (GetTarget()->IsFullHealth())
2927 {
2930 }
2931 }
2932
2937};
2938
2939// 70292 - Glacial Strike
2940// 71316 - Glacial Strike
2942{
2943 void PeriodicTick(AuraEffect const* /*aurEff*/)
2944 {
2945 // they apply damage so no need to check for ticks here
2946
2947 if (GetTarget()->IsFullHealth())
2948 {
2951 }
2952 }
2953
2958};
2959
2965
2967{
2968public:
2969 bool operator()(WorldObject* obj) const
2970 {
2971 if (Unit* target = obj->ToUnit())
2972 return target->GetPowerType() != POWER_MANA;
2973
2974 return true;
2975 }
2976};
2977
2979{
2980 void RemoveInvalidTargets(std::list<WorldObject*>& targets)
2981 {
2982 // In arenas Replenishment may only affect the caster
2983 if (Player* caster = GetCaster()->ToPlayer())
2984 {
2985 if (caster->InArena())
2986 {
2987 targets.clear();
2988 targets.push_back(caster);
2989 return;
2990 }
2991 }
2992
2993 targets.remove_if(ReplenishmentCheck());
2994
2995 uint8 const maxTargets = 10;
2996
2997 if (targets.size() > maxTargets)
2998 {
3000 targets.resize(maxTargets);
3001 }
3002 }
3003
3008};
3009
3011{
3012 bool Load() override
3013 {
3014 return GetUnitOwner()->GetPowerType() == POWER_MANA;
3015 }
3016
3017 void CalculateAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
3018 {
3019 switch (GetSpellInfo()->Id)
3020 {
3022 amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f;
3023 break;
3025 amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f;
3026 break;
3027 default:
3028 break;
3029 }
3030 }
3031
3036};
3037
3042
3044{
3045 bool Validate(SpellInfo const* /*spell*/) override
3046 {
3048 }
3049
3054
3055 void Register() override
3056 {
3057 }
3058};
3059
3061{
3062 bool Validate(SpellInfo const* /*spell*/) override
3063 {
3065 return false;
3066 return true;
3067 }
3068
3069 void HandleMount(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
3070 {
3071 Unit* target = GetTarget();
3073
3074 target->Mount(DISPLAYID_HIDDEN_MOUNT, 0, 0);
3075
3076 // cast speed aura
3077 if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(aurEff->GetAmountAsInt()))
3078 target->CastSpell(target, mountCapability->ModSpellAuraID, TRIGGERED_FULL_MASK);
3079 }
3080
3085};
3086
3088{
3090 {
3091 if (GetCaster()->IsInCombat())
3092 {
3095 }
3096
3097 // Player cannot transform to human form if he is forced to be worgen for some reason (Darkflight)
3099 if (std::distance(alteredFormAuras.begin(), alteredFormAuras.end()) > 1)
3100 {
3103 }
3104
3105 return SPELL_CAST_OK;
3106 }
3107
3109 {
3110 Unit* target = GetHitUnit();
3111 PreventHitDefaultEffect(effIndex);
3114 else // Basepoints 1 for this aura control whether to trigger transform transition animation or not.
3116 }
3117
3123};
3124
3137
3142
3144{
3145 bool Validate(SpellInfo const* /*spellInfo*/) override
3146 {
3148 }
3149
3150 bool Load() override
3151 {
3152 return GetGObjCaster()->GetOwnerGUID().IsPlayer();
3153 }
3154
3156 {
3157 if (Unit* owner = GetGObjCaster()->GetOwner())
3158 if (GameObject* go = GetHitGObj())
3159 if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING)
3160 owner->CastSpell(nullptr, SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT, true);
3161 }
3162
3167};
3168
3170
3184
3186{
3187 bool Load() override
3188 {
3190 }
3191
3192 void HandleDummy(SpellEffIndex /* effIndex */)
3193 {
3194 Player* originalCaster = GetOriginalCaster()->ToPlayer();
3195 if (Unit* target = GetHitUnit())
3196 {
3198 spiritHealerConfirm.Npc = target->GetGUID();
3200 spiritHealerConfirm.Success = true;
3201 originalCaster->SendDirectMessage(spiritHealerConfirm.Write());
3202 }
3203 }
3204
3209};
3210
3215
3217{
3218 bool Validate(SpellInfo const* /*spellInfo*/) override
3219 {
3221 }
3222
3236
3241};
3242
3243// 41213, 43416, 69222, 73076 - Throw Shield
3257
3263
3265{
3266 bool Validate(SpellInfo const* /*spellInfo*/) override
3267 {
3268 return ValidateSpellInfo(
3269 {
3272 });
3273 }
3274
3276 {
3277 if (Unit* rider = GetCaster()->GetCharmer())
3278 {
3279 if (Player* playerTarget = GetHitPlayer())
3280 {
3281 if (playerTarget->HasAura(SPELL_ON_TOURNAMENT_MOUNT) && playerTarget->GetVehicleBase())
3282 rider->CastSpell(playerTarget, SPELL_MOUNTED_DUEL, true);
3283 }
3284 else if (Unit* unitTarget = GetHitUnit())
3285 {
3286 if (unitTarget->GetCharmer() && unitTarget->GetCharmer()->GetTypeId() == TYPEID_PLAYER && unitTarget->GetCharmer()->HasAura(SPELL_ON_TOURNAMENT_MOUNT))
3287 rider->CastSpell(unitTarget->GetCharmer(), SPELL_MOUNTED_DUEL, true);
3288 }
3289 }
3290 }
3291
3296};
3297
3299{
3300 bool Load() override
3301 {
3302 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
3303 }
3304
3305 void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
3306 {
3307 if (Unit* caster = GetCaster())
3308 if (!caster->GetVehicleBase())
3309 caster->RemoveAurasDueToSpell(GetId());
3310 }
3311
3316};
3317
3325
3327{
3328 void HandleScript(SpellEffIndex /* effIndex */)
3329 {
3330 Unit* target = GetHitUnit();
3331 if (target->GetTypeId() != TYPEID_PLAYER)
3332 return;
3333
3334 // return from top
3335 if (target->ToPlayer()->GetAreaId() == AREA_VIOLET_CITADEL_SPIRE)
3336 target->CastSpell(target, SPELL_TELEPORT_SPIRE_DOWN, true);
3337 // teleport atop
3338 else
3339 target->CastSpell(target, SPELL_TELEPORT_SPIRE_UP, true);
3340 }
3341
3346};
3347
3349{
3350 bool Validate(SpellInfo const* spellInfo) override
3351 {
3352 return ValidateSpellInfo({ spellInfo->ExcludeCasterAuraSpell });
3353 }
3354
3356 {
3357 // Blizz seems to just apply aura without bothering to cast
3358 GetCaster()->AddAura(GetSpellInfo()->ExcludeCasterAuraSpell, GetCaster());
3359 }
3360
3365};
3366
3368{
3369 bool Validate(SpellInfo const* spellInfo) override
3370 {
3371 return ValidateSpellInfo({ spellInfo->ExcludeTargetAuraSpell });
3372 }
3373
3375 {
3376 if (Unit* target = GetHitUnit())
3377 // Blizz seems to just apply aura without bothering to cast
3378 GetCaster()->AddAura(GetSpellInfo()->ExcludeTargetAuraSpell, target);
3379 }
3380
3385};
3386
3392
3393template <uint32 TriggeredSpellId>
3395{
3396 bool Validate(SpellInfo const* /*spellInfo*/) override
3397 {
3398 return ValidateSpellInfo({ TriggeredSpellId });
3399 }
3400
3402 {
3403 /*
3404 * @workaround: PendingCast flag normally means 'triggered' spell, however
3405 * if the spell is cast triggered, the core won't send SMSG_SPELL_GO packet
3406 * so client never registers the cooldown (see Spell::IsNeedSendToClient)
3407 *
3408 * ServerToClient: SMSG_SPELL_GO (0x0132) Length: 42 ConnIdx: 0 Time: 07/19/2010 02:32:35.000 Number: 362675
3409 * Caster GUID: Full: Player
3410 * Caster Unit GUID: Full: Player
3411 * Cast Count: 0
3412 * Spell ID: 72752 (72752)
3413 * Cast Flags: PendingCast, Unknown3, Unknown7 (265)
3414 * Time: 3901468825
3415 * Hit Count: 1
3416 * [0] Hit GUID: Player
3417 * Miss Count: 0
3418 * Target Flags: Unit (2)
3419 * Target GUID: 0x0
3420 */
3421
3422 // Spell flags need further research, until then just cast not triggered
3423 GetCaster()->CastSpell(nullptr, TriggeredSpellId, false);
3424 }
3425
3430};
3431
3436
3438{
3439 void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
3440 {
3441 // store stack apply times, so we can pop them while they expire
3443 Unit* target = GetTarget();
3444
3445 // on stack 15 cast the achievement crediting spell
3446 if (GetStackAmount() >= 15)
3447 target->CastSpell(target, SPELL_TURKEY_VENGEANCE, CastSpellExtraArgs(aurEff)
3448 .SetOriginalCaster(GetCasterGUID()));
3449 }
3450
3451 void OnPeriodic(AuraEffect const* /*aurEff*/)
3452 {
3453 int32 removeCount = 0;
3454
3455 // pop expired times off of the stack
3456 while (!_applyTimes.empty() && _applyTimes.front() + GetMaxDuration() < GameTime::GetGameTimeMS())
3457 {
3458 _applyTimes.pop_front();
3459 removeCount++;
3460 }
3461
3462 if (removeCount)
3464 }
3465
3471
3472 std::list<uint32> _applyTimes;
3473};
3474
3483
3485{
3486 void HandleScript(SpellEffIndex /*effIndex*/)
3487 {
3488 if (Player* player = GetHitPlayer())
3489 {
3491 // player can only have one of these items
3492 for (uint8 i = 0; i < 5; ++i)
3493 {
3494 if (player->HasItemCount(itemId[i], 1, true))
3495 return;
3496 }
3497
3498 CreateItem(itemId[urand(0, 4)], ItemContext::NONE);
3499 }
3500 }
3501
3506};
3507
3512
3513// 52723 - Vampiric Touch
3514// 60501 - Vampiric Touch
3516{
3517 bool Validate(SpellInfo const* /*spellInfo*/) override
3518 {
3520 }
3521
3522 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
3523 {
3525 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
3526 if (!damageInfo || !damageInfo->GetDamage())
3527 return;
3528
3529 Unit* caster = eventInfo.GetActor();
3530 CastSpellExtraArgs args(aurEff);
3531 args.AddSpellBP0(damageInfo->GetDamage() / 2);
3532 caster->CastSpell(caster, SPELL_VAMPIRIC_TOUCH_HEAL, args);
3533 }
3534
3539};
3540
3542{
3543 SPELL_GEAR_SCALING = 66668
3545
3547{
3548 bool Load() override
3549 {
3550 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
3551 }
3552
3553 void CalculateAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
3554 {
3555 Unit* caster = GetCaster();
3556 float factor;
3557 float baseItemLevel;
3558
3560 switch (GetId())
3561 {
3562 case SPELL_GEAR_SCALING:
3563 factor = 1.0f;
3564 baseItemLevel = 205.0f;
3565 break;
3566 default:
3567 factor = 1.0f;
3568 baseItemLevel = 170.0f;
3569 break;
3570 }
3571
3572 float avgILvl = caster->ToPlayer()->GetAverageItemLevel();
3573 if (avgILvl < baseItemLevel)
3574 return;
3575
3576 amount = (avgILvl - baseItemLevel) * factor;
3577 }
3578
3585};
3586
3592
3594{
3595 void HandleDummy(SpellEffIndex /* effIndex */)
3596 {
3597 if (Creature* vendor = GetCaster()->ToCreature())
3598 if (vendor->GetEntry() == NPC_AMPHITHEATER_VENDOR)
3599 vendor->AI()->Talk(SAY_AMPHITHEATER_VENDOR);
3600 }
3601
3606};
3607
3609{
3611 {
3612 if (!GetSpellInfo()->CheckTargetCreatureType(GetCaster()))
3614 return SPELL_CAST_OK;
3615 }
3616
3621};
3622
3627
3646
3648{
3649 bool Validate(SpellInfo const* spellInfo) override
3650 {
3651 return sBroadcastTextStore.HasRecord(uint32(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()));
3652 }
3653
3654 void HandleScript(SpellEffIndex /*effIndex*/)
3655 {
3656 if (TempSummon* casterSummon = GetCaster()->ToTempSummon())
3657 if (Player* target = casterSummon->GetSummonerUnit()->ToPlayer())
3658 casterSummon->Unit::Whisper(uint32(GetEffectValueAsInt()), target, false);
3659 }
3660
3665};
3666
3673
3674// BasePoints of spells is ID of npc_text used to group texts, it's not implemented so texts are grouped the old way
3675// 50037 - Mystery of the Infinite: Future You's Whisper to Controller - Random
3676// 50287 - Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random
3677// 60709 - MOTI, Redux: Past You's Whisper to Controller - Random
3679{
3680public:
3682
3683private:
3684 void HandleScript(SpellEffIndex /*effIndex*/)
3685 {
3686 // Same for all spells
3687 if (!roll_chance(20))
3688 return;
3689
3690 if (Creature* target = GetHitCreature())
3691 if (TempSummon* targetSummon = target->ToTempSummon())
3692 if (Player* player = targetSummon->GetSummonerUnit()->ToPlayer())
3693 targetSummon->AI()->Talk(_text, player);
3694 }
3695
3700
3702};
3703
3705{
3707 {
3708 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3709 vehicle->RemoveAllPassengers();
3710 }
3711
3716};
3717
3719{
3720 bool Validate(SpellInfo const* spellInfo) override
3721 {
3722 if (!ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }))
3723 return false;
3724 if (spellInfo->GetEffect(EFFECT_0).CalcValueAsInt() < 1)
3725 return false;
3726 return true;
3727 }
3728
3730 {
3731 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3732 {
3733 if (Unit* passenger = vehicle->GetPassenger(GetEffectValueAsInt() - 1))
3734 passenger->ExitVehicle();
3735 }
3736 }
3737
3742};
3743
3745{
3746public:
3748
3749private:
3751
3753 {
3754 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3755 {
3756 if (Unit* passenger = vehicle->GetPassenger(_seatId))
3757 passenger->ExitVehicle();
3758 }
3759 }
3760
3765};
3766
3768{
3769 SPELL_GM_FREEZE = 9454
3771
3773{
3774 bool Validate(SpellInfo const* /*spellInfo*/) override
3775 {
3777 }
3778
3779 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
3780 {
3781 // Do what was done before to the target in HandleFreezeCommand
3782 if (Player* player = GetTarget()->ToPlayer())
3783 {
3784 // stop combat + make player unattackable + duel stop + stop some spells
3785 player->SetFaction(FACTION_FRIENDLY);
3786 player->CombatStop();
3787 if (player->IsNonMeleeSpellCast(true))
3788 player->InterruptNonMeleeSpells(true);
3789 player->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
3790
3791 // if player class = hunter || warlock remove pet if alive
3792 if ((player->GetClass() == CLASS_HUNTER) || (player->GetClass() == CLASS_WARLOCK))
3793 {
3794 if (Pet* pet = player->GetPet())
3795 {
3796 pet->SavePetToDB(PET_SAVE_AS_CURRENT);
3797 // not let dismiss dead pet
3798 if (pet->IsAlive())
3799 player->RemovePet(pet, PET_SAVE_NOT_IN_SLOT);
3800 }
3801 }
3802 }
3803 }
3804
3805 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
3806 {
3807 // Do what was done before to the target in HandleUnfreezeCommand
3808 if (Player* player = GetTarget()->ToPlayer())
3809 {
3810 // Reset player faction + allow combat + allow duels
3811 player->SetFactionForRace(player->GetRace());
3812 player->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
3813 // save player
3814 player->SaveToDB();
3815 }
3816 }
3817
3823};
3824
3826{
3828 {
3829 Creature* target = GetHitCreature();
3830 if (!target)
3831 return;
3832
3835 }
3836
3841};
3842
3844{
3846 // Flasks
3863 // Elixirs
3930
3932{
3933 bool Validate(SpellInfo const* spellInfo) override
3934 {
3935 return ValidateSpellInfo({ SPELL_MIXOLOGY }) && ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } });
3936 }
3937
3938 bool Load() override
3939 {
3940 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
3941 }
3942
3943 void SetBonusValueForEffect(SpellEffIndex effIndex, int32 value, AuraEffect const* aurEff)
3944 {
3945 if (aurEff->GetEffIndex() == uint32(effIndex))
3946 bonus = value;
3947 }
3948
3949 void CalculateAmount(AuraEffect const* aurEff, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
3950 {
3951 if (GetCaster()->HasAura(SPELL_MIXOLOGY) && GetCaster()->HasSpell(GetEffectInfo(EFFECT_0).TriggerSpell))
3952 {
3953 switch (GetId())
3954 {
3957 bonus = amount;
3958 break;
3962 bonus = CalculatePct(amount, 80);
3963 break;
3979 bonus = CalculatePct(amount, 50);
3980 break;
3982 bonus = 280;
3983 break;
3985 bonus = 200;
3986 break;
3989 bonus = 140;
3990 break;
3992 bonus = 100;
3993 break;
3995 bonus = 82;
3996 break;
3998 bonus = 70;
3999 break;
4001 bonus = 50;
4002 break;
4004 bonus = 47;
4005 break;
4006 case SPELL_WRATH_ELIXIR:
4007 bonus = 32;
4008 break;
4012 bonus = 29;
4013 break;
4015 bonus = 27;
4016 break;
4021 bonus = 23;
4022 break;
4034 bonus = 20;
4035 break;
4037 bonus = 17;
4038 break;
4041 bonus = 15;
4042 break;
4044 bonus = 13;
4045 break;
4047 bonus = 12;
4048 break;
4051 bonus = 11;
4052 break;
4058 bonus = 10;
4059 break;
4061 bonus = 9;
4062 break;
4064 case SPELL_GURUS_ELIXIR:
4065 bonus = 8;
4066 break;
4070 bonus = 6;
4071 break;
4076 bonus = 5;
4077 break;
4080 bonus = 4;
4081 break;
4083 bonus = -10;
4084 break;
4086 SetBonusValueForEffect(EFFECT_0, 13, aurEff);
4087 SetBonusValueForEffect(EFFECT_1, 13, aurEff);
4088 SetBonusValueForEffect(EFFECT_2, 8, aurEff);
4089 break;
4091 SetBonusValueForEffect(EFFECT_0, 160, aurEff);
4092 break;
4094 SetBonusValueForEffect(EFFECT_0, 116, aurEff);
4095 SetBonusValueForEffect(EFFECT_1, 6, aurEff);
4096 break;
4098 SetBonusValueForEffect(EFFECT_0, 40, aurEff);
4099 SetBonusValueForEffect(EFFECT_1, 40, aurEff);
4100 break;
4102 SetBonusValueForEffect(EFFECT_0, 210, aurEff);
4103 SetBonusValueForEffect(EFFECT_1, 5, aurEff);
4104 break;
4106 SetBonusValueForEffect(EFFECT_0, 19, aurEff);
4107 SetBonusValueForEffect(EFFECT_1, 19, aurEff);
4108 SetBonusValueForEffect(EFFECT_2, 5, aurEff);
4109 break;
4111 SetBonusValueForEffect(EFFECT_0, 5, aurEff);
4112 break;
4113 default:
4114 TC_LOG_ERROR("spells", "SpellId {} couldn't be processed in spell_gen_mixology_bonus", GetId());
4115 break;
4116 }
4117 amount += bonus;
4118 }
4119 }
4120
4122
4127};
4128
4133
4135{
4136 void HandleScript(SpellEffIndex /*effIndex*/)
4137 {
4138 if (Player* target = GetHitPlayer())
4139 {
4140 Aura const* aura = GetHitAura();
4141 if (!aura || aura->GetStackAmount() < 10)
4142 return;
4143
4144 target->CastSpell(target, SPELL_LANDMINE_KNOCKBACK_ACHIEVEMENT, true);
4145 }
4146 }
4147
4152};
4153
4154// 34098 - ClearAllDebuffs
4156{
4157 void HandleScript(SpellEffIndex /*effIndex*/)
4158 {
4159 if (Unit* target = GetHitUnit())
4160 {
4161 target->RemoveOwnedAuras([](Aura const* aura)
4162 {
4163 SpellInfo const* spellInfo = aura->GetSpellInfo();
4164 return !spellInfo->IsPositive() && !spellInfo->IsPassive();
4165 });
4166 }
4167 }
4168
4173};
4174
4176{
4178 MOUNT_PONY = 29736
4180
4182{
4183 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
4184 {
4185 Unit* caster = GetCaster();
4186 if (!caster)
4187 return;
4188 Player* owner = caster->GetOwner()->ToPlayer();
4189 if (!owner || !owner->HasAchieved(ACHIEV_PONY_UP))
4190 return;
4191
4192 if (owner->IsMounted())
4193 {
4194 caster->Mount(MOUNT_PONY);
4195 caster->SetSpeedRate(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
4196 }
4197 else if (caster->IsMounted())
4198 {
4199 caster->Dismount();
4200 caster->SetSpeedRate(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
4201 }
4202 }
4203
4208};
4209
4217
4218// 40350 - Corrupting Plague
4220{
4221public:
4222 CorruptingPlagueSearcher(Unit* obj, float distance) : _unit(obj), _distance(distance) { }
4223
4224 bool operator()(Unit* u) const
4225 {
4226 if (_unit->GetDistance2d(u) < _distance &&
4229 return true;
4230
4231 return false;
4232 }
4233
4234private:
4237};
4238
4239// 40349 - Corrupting Plague
4241{
4242 bool Validate(SpellInfo const* /*spellInfo*/) override
4243 {
4245 }
4246
4247 void OnPeriodic(AuraEffect const* /*aurEff*/)
4248 {
4249 Unit* owner = GetTarget();
4250
4251 std::list<Creature*> targets;
4252 CorruptingPlagueSearcher creature_check(owner, 15.0f);
4253 Trinity::CreatureListSearcher<CorruptingPlagueSearcher> creature_searcher(owner, targets, creature_check);
4254 Cell::VisitGridObjects(owner, creature_searcher, 15.0f);
4255
4256 if (!targets.empty())
4257 return;
4258
4260 }
4261
4266};
4267
4273
4274// 40307 - Stasis Field
4276{
4277public:
4278 StasisFieldSearcher(Unit* obj, float distance) : _unit(obj), _distance(distance) { }
4279
4280 bool operator()(Unit* u) const
4281 {
4282 if (_unit->GetDistance2d(u) < _distance &&
4285 return true;
4286
4287 return false;
4288 }
4289
4290private:
4293};
4294
4295// 40306 - Stasis Field
4297{
4298 bool Validate(SpellInfo const* /*spellInfo*/) override
4299 {
4301 }
4302
4303 void OnPeriodic(AuraEffect const* /*aurEff*/)
4304 {
4305 Unit* owner = GetTarget();
4306
4307 std::list<Creature*> targets;
4308 StasisFieldSearcher creature_check(owner, 15.0f);
4309 Trinity::CreatureListSearcher<StasisFieldSearcher> creature_searcher(owner, targets, creature_check);
4310 Cell::VisitGridObjects(owner, creature_searcher, 15.0f);
4311
4312 if (!targets.empty())
4313 return;
4314
4316 }
4317
4322};
4323
4328
4341
4350
4351// 34779 - Freezing Circle
4353{
4364
4365 void HandleDamage(SpellEffIndex /*effIndex*/)
4366 {
4367 Unit* caster = GetCaster();
4368 uint32 spellId = 0;
4369 Map* map = caster->GetMap();
4370
4371 if (map->IsDungeon())
4373 else
4375
4376 if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetCastDifficulty()))
4377 if (!spellInfo->GetEffects().empty())
4378 SetHitDamage(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt());
4379 }
4380
4385};
4386
4387// Used for some spells cast by vehicles or charmed creatures that do not send a cooldown event on their own
4389{
4391 {
4392 Unit* caster = GetCaster();
4393 if (Player* owner = caster->GetCharmerOrOwnerPlayerOrPlayerItself())
4394 {
4396 spellCooldown.Caster = owner->GetGUID();
4397 spellCooldown.Flags = SPELL_COOLDOWN_FLAG_NONE;
4398 spellCooldown.SpellCooldowns.emplace_back(GetSpellInfo()->Id, GetSpellInfo()->RecoveryTime);
4399 owner->SendDirectMessage(spellCooldown.Write());
4400 }
4401 }
4402
4407};
4408
4414
4416{
4417 bool Validate(SpellInfo const* /*spellInfo*/) override
4418 {
4420 }
4421 void HandleScript(SpellEffIndex /*effIndex*/)
4422 {
4424 Unit* target = GetHitUnit();
4426 args.AddSpellBP0(bp);
4427 target->CastSpell(target, SPELL_CANNON_BLAST_DAMAGE, args);
4428 }
4429
4434};
4435
4436// 37751 - Submerged
4438{
4440 {
4441 if (Creature* target = GetHitCreature())
4442 target->SetStandState(UNIT_STAND_STATE_SUBMERGED);
4443 }
4444
4449};
4450
4451// 169869 - Transformation Sickness
4453{
4454 void HandleScript(SpellEffIndex /*effIndex*/)
4455 {
4456 if (Unit* target = GetHitUnit())
4457 target->SetHealth(target->CountPctFromMaxHealth(25));
4458 }
4459
4464};
4465
4466// 189491 - Summon Towering Infernal.
4479
4485
4487{
4488 public:
4489 bool operator()(WorldObject* target) const
4490 {
4491 if (Unit* unit = target->ToUnit())
4492 return unit->GetPowerType() != POWER_MANA;
4493 return false;
4494 }
4495};
4496
4498{
4499 void FilterTargets(std::list<WorldObject*>& targets)
4500 {
4501 targets.remove_if(MarkTargetHellfireFilter());
4502 }
4503
4508};
4509
4511{
4512 bool Validate(SpellInfo const* /*spell*/) override
4513 {
4515 }
4516
4517 void OnPeriodic(AuraEffect const* aurEff)
4518 {
4519 Unit* target = GetTarget();
4520
4521 if (target->GetPower(POWER_MANA) == 0)
4522 {
4523 target->CastSpell(target, SPELL_MARK_OF_KAZROGAL_DAMAGE_HELLFIRE, aurEff);
4524 // Remove aura
4525 SetDuration(0);
4526 }
4527 }
4528
4533};
4534
4547
4553
4554// 99947 - Face Rage
4556{
4557 bool Validate(SpellInfo const* spellInfo) override
4558 {
4560 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } });
4561 }
4562
4563 void OnRemove(AuraEffect const* /*effect*/, AuraEffectHandleModes /*mode*/)
4564 {
4566 }
4567
4572};
4573
4574// 187213 - Impatient Mind
4576{
4577 bool Validate(SpellInfo const* /*spell*/) override
4578 {
4580 }
4581
4582 void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
4583 {
4585 }
4586
4591};
4592
4593// 209352 - Boost 2.0 [Paladin+Priest] - Watch for Shield
4595{
4596 static constexpr uint32 SPELL_POWER_WORD_SHIELD = 17;
4597 static constexpr uint32 SPELL_DIVINE_SHIELD = 642;
4598
4599 bool Validate(SpellInfo const* /*spellInfo*/) override
4600 {
4602 }
4603
4604 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo& procInfo)
4605 {
4606 SpellInfo const* spellInfo = procInfo.GetSpellInfo();
4607 return spellInfo && (spellInfo->Id == SPELL_POWER_WORD_SHIELD || spellInfo->Id == SPELL_DIVINE_SHIELD);
4608 }
4609
4614};
4615
4616// 269083 - Enlisted
4617// 282559 - Enlisted
4619{
4620 void CalcWarModeBonus(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
4621 {
4622 Player* target = GetUnitOwner()->ToPlayer();
4623 if (!target)
4624 return;
4625
4626 switch (target->GetTeamId())
4627 {
4628 case TEAM_ALLIANCE:
4630 break;
4631 case TEAM_HORDE:
4633 break;
4634 default:
4635 break;
4636 }
4637 }
4638
4661};
4662
4676
4678{
4679 BindLocation(uint32 mapId, float x, float y, float z, float o, uint32 areaId)
4680 : Loc(mapId, x, y, z, o), AreaId(areaId) { }
4683};
4684
4685BindLocation const StormwindInnLoc(0, -8868.1f, 675.82f, 97.9f, 5.164778709411621093f, 5148);
4686BindLocation const OrgrimmarInnLoc(1, 1573.18f, -4441.62f, 16.06f, 1.818284034729003906f, 8618);
4687
4689{
4690 bool Validate(SpellInfo const* /*spell*/) override
4691 {
4692 return ValidateSpellInfo(
4693 {
4696 });
4697 }
4698
4699 void HandleDummy(SpellEffIndex /*effIndex*/)
4700 {
4701 Player* player = GetHitUnit()->ToPlayer();
4702 if (!player)
4703 return;
4704
4706 return;
4707
4708 BindLocation const& bindLoc = player->GetTeam() == ALLIANCE ? StormwindInnLoc : OrgrimmarInnLoc;
4709 player->SetHomebind(bindLoc.Loc, bindLoc.AreaId);
4710 player->SendBindPointUpdate();
4711 player->SendPlayerBound(player->GetGUID(), bindLoc.AreaId);
4712
4714 }
4715
4720};
4721
4723{
4724 void HandleDummy(SpellEffIndex /*effIndex*/)
4725 {
4726 if (!GetCaster())
4727 return;
4728
4729 Player* player = GetCaster()->ToPlayer();
4730 if (!player)
4731 return;
4732
4733 if (Creature* nazgrim = GetHitUnit()->FindNearestCreature(NPC_NAZGRIM, 10.0f))
4734 nazgrim->HandleEmoteCommand(EMOTE_ONESHOT_POINT, player);
4735 if (Creature* trollbane = GetHitUnit()->FindNearestCreature(NPC_TROLLBANE, 10.0f))
4736 trollbane->HandleEmoteCommand(EMOTE_ONESHOT_POINT, player);
4737 if (Creature* whitemane = GetHitUnit()->FindNearestCreature(NPC_WHITEMANE, 10.0f))
4738 whitemane->HandleEmoteCommand(EMOTE_ONESHOT_POINT, player);
4739
4740 // @TODO: spawntracking - show death gate for casting player
4741 }
4742
4747};
4748
4749// 118301 - Summon Battle Pet
4751{
4753 {
4754 uint32 creatureId = uint32(GetSpellValue()->EffectBasePoints[effIndex]);
4755 if (sObjectMgr->GetCreatureTemplate(creatureId))
4756 {
4757 PreventHitDefaultEffect(effIndex);
4758
4759 Unit* caster = GetCaster();
4760 SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetEffectInfo().MiscValueB));
4761 Milliseconds duration = Milliseconds(GetSpellInfo()->CalcDuration(caster));
4762 Position pos = GetHitDest()->GetPosition();
4763
4764 if (Creature* summon = caster->GetMap()->SummonCreature(creatureId, pos, properties, duration, caster, GetSpellInfo()->Id))
4765 summon->SetImmuneToAll(true);
4766 }
4767 }
4768
4773};
4774
4775// 132334 - Trainer Heal Cooldown (SERVERSIDE)
4777{
4778 bool Validate(SpellInfo const* /*spellInfo*/) override
4779 {
4781 }
4782
4783 bool Load() override
4784 {
4785 return GetUnitOwner()->IsPlayer();
4786 }
4787
4789 {
4790 Player* target = GetUnitOwner()->ToPlayer();
4791 SpellInfo const* reviveBattlePetSpellInfo = sSpellMgr->AssertSpellInfo(BattlePets::SPELL_REVIVE_BATTLE_PETS, DIFFICULTY_NONE);
4792
4794 {
4795 Milliseconds expectedCooldown = Milliseconds(GetAura()->GetMaxDuration());
4796 SpellHistory::Duration remainingCooldown = target->GetSpellHistory()->GetRemainingCategoryCooldown(reviveBattlePetSpellInfo);
4797 if (remainingCooldown > SpellHistory::Duration::zero())
4798 {
4799 if (remainingCooldown < expectedCooldown)
4800 target->GetSpellHistory()->ModifyCooldown(reviveBattlePetSpellInfo, expectedCooldown - remainingCooldown);
4801 }
4802 else
4803 {
4804 target->GetSpellHistory()->StartCooldown(reviveBattlePetSpellInfo, 0, nullptr, false, expectedCooldown);
4805 }
4806 }
4807 }
4808
4813};
4814
4815// 45313 - Anchor Here
4817{
4818 void HandleScript(SpellEffIndex /*effIndex*/)
4819 {
4820 if (Creature* creature = GetHitCreature())
4821 creature->SetHomePosition(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation());
4822 }
4823
4828};
4829
4830// 147066 - (Serverside/Non-DB2) Generic - Mount Check Aura
4832{
4833 void OnPeriodic(AuraEffect const* /*aurEff*/)
4834 {
4835 Unit* target = GetTarget();
4836 uint32 mountDisplayId = 0;
4837
4838 TempSummon* tempSummon = target->ToTempSummon();
4839 if (!tempSummon)
4840 return;
4841
4842 Player const* summoner = Object::ToPlayer(tempSummon->GetSummoner());
4843 if (!summoner)
4844 return;
4845
4846 if (summoner->IsMounted() && (!summoner->IsInCombat() || summoner->IsFlying()))
4847 {
4848 if (CreatureSummonedData const* summonedData = sObjectMgr->GetCreatureSummonedData(tempSummon->GetEntry()))
4849 {
4850 if (summoner->IsFlying() && summonedData->FlyingMountDisplayID)
4851 mountDisplayId = *summonedData->FlyingMountDisplayID;
4852 else if (summonedData->GroundMountDisplayID)
4853 mountDisplayId = *summonedData->GroundMountDisplayID;
4854 }
4855 }
4856
4857 if (mountDisplayId != target->GetMountDisplayId())
4858 target->SetMountDisplayId(mountDisplayId);
4859 }
4860
4865};
4866
4874
4875// 274738 - Ancestral Call (Mag'har Orc Racial)
4904
4905// 83477 - Eject Passengers 3-8
4907{
4909 {
4910 Vehicle* vehicle = GetHitUnit()->GetVehicleKit();
4911 if (!vehicle)
4912 return;
4913
4914 for (uint8 i = 2; i < 8; i++)
4915 {
4916 if (Unit* passenger = vehicle->GetPassenger(i))
4917 passenger->ExitVehicle();
4918 }
4919 }
4920
4925};
4926
4927// 83781 - Reverse Cast Ride Vehicle
4928// 85299 - Reverse Cast Ride Seat 1
4929// 258344 - Reverse Cast Ride Vehicle
4942
4943// Note: this spell unsummons any creature owned by the caster. Set appropriate target conditions on the DB.
4944// 84065 - Despawn All Summons
4945// 83935 - Despawn All Summons
4946// 160938 - Despawn All Summons (Garrison Intro Only)
4948{
4950 {
4951 if (Unit* caster = GetCaster())
4952 {
4953 Creature* target = GetHitCreature();
4954
4955 if (target->GetOwner() == caster)
4956 target->DespawnOrUnsummon();
4957 }
4958 }
4959
4964};
4965
4980
4981// 8613 - Skinning
4983{
4999
5001 {
5002 Player* player = GetCaster()->ToPlayer();
5003 if (!player)
5004 return;
5005
5006 ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(GetHitUnit()->GetContentTuning());
5007 if (!contentTuning)
5008 return;
5009
5010 uint32 skinningSkill = player->GetProfessionSkillForExp(SKILL_SKINNING, contentTuning->ExpansionID);
5011 if (!skinningSkill)
5012 return;
5013
5014 // Autolearning missing skinning skill (Dragonflight)
5015 auto getSkinningLearningSpellBySkill = [&]() -> uint32
5016 {
5017 switch (skinningSkill)
5018 {
5027 case SKILL_CLASSIC_SKINNING: // Trainer only
5028 case SKILL_LEGION_SKINNING: // Quest only
5029 default: break;
5030 }
5031
5032 return 0;
5033 };
5034
5035 if (!player->HasSkill(skinningSkill))
5036 if (uint32 spellId = getSkinningLearningSpellBySkill())
5037 player->CastSpell(nullptr, spellId, true);
5038 }
5039
5044};
5045
5054
5055// 2825 - Bloodlust
5056// 32182 - Heroism
5057// 80353 - Time Warp
5058// 264667 - Primal Rage
5059// 390386 - Fury of the Aspects
5060// 146555 - Drums of Rage
5061// 178207 - Drums of Fury
5062// 230935 - Drums of the Mountain
5063// 256740 - Drums of the Maelstrom
5064// 309658 - Drums of Deathly Ferocity
5065// 381301 - Feral Hide Drums
5067{
5068public:
5069 spell_gen_bloodlust(uint32 exhaustionSpellId) : _exhaustionSpellId(exhaustionSpellId) { }
5070
5071 bool Validate(SpellInfo const* /*spellInfo*/) override
5072 {
5073 return ValidateSpellInfo(
5074 {
5080 });
5081 }
5082
5083 void FilterTargets(std::list<WorldObject*>& targets)
5084 {
5085 targets.remove_if([](WorldObject* target) -> bool
5086 {
5087 Unit* unit = target->ToUnit();
5088 if (!unit)
5089 return true;
5090
5091 return unit->HasAura(SPELL_SHAMAN_SATED)
5096 });
5097 }
5098
5099 void HandleHit(SpellEffIndex /*effIndex*/)
5100 {
5101 Unit* target = GetHitUnit();
5102 target->CastSpell(target, _exhaustionSpellId, true);
5103 }
5104
5111
5112private:
5114};
5115
5116// AoE resurrections by spirit guides
5117// 22012 - Spirit Heal
5119{
5120 void FilterTargets(std::list<WorldObject*>& targets)
5121 {
5122 Unit* caster = GetCaster();
5123 targets.remove_if([caster](WorldObject* target) -> bool
5124 {
5125 if (Player* playerTarget = target->ToPlayer())
5126 return !playerTarget->CanAcceptAreaSpiritHealFrom(caster);
5127
5128 return true;
5129 });
5130 }
5131
5136};
5137
5138// Personal resurrections in battlegrounds
5139// 156758 - Spirit Heal
5141{
5142 static constexpr uint32 SPELL_SPIRIT_HEAL_EFFECT = 156763;
5143
5144 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
5145 {
5146 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
5147 return;
5148
5149 Player* targetPlayer = GetTarget()->ToPlayer();
5150 if (!targetPlayer)
5151 return;
5152
5153 Unit* caster = GetCaster();
5154 if (!caster)
5155 return;
5156
5157 if (targetPlayer->CanAcceptAreaSpiritHealFrom(caster))
5158 caster->CastSpell(targetPlayer, SPELL_SPIRIT_HEAL_EFFECT);
5159 }
5160
5165};
5166
5168{
5169public:
5171
5172 bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) override
5173 {
5174 if (_caster->GetChannelSpellId() == 0)
5176
5177 return true;
5178 }
5179
5180private:
5182};
5183
5184// 22011 - Spirit Heal Channel
5186{
5187 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
5188 {
5189 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
5190 return;
5191
5192 Unit* target = GetTarget();
5194 }
5195
5200};
5201
5202// 2584 - Waiting to Resurrect
5204{
5205 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
5206 {
5207 Player* targetPlayer = GetTarget()->ToPlayer();
5208 if (!targetPlayer)
5209 return;
5210
5211 targetPlayer->SetAreaSpiritHealer(nullptr);
5212 }
5213
5218};
5219
5232
5234{
5236{
5237 // Note: if caster is not in a raid setting, is in PvP or while in arena combat with 5 or less allied players.
5238 if (!unit->GetMap()->IsRaid() || !unit->GetMap()->IsBattleground())
5239 {
5240 uint32 bonusSpellId = 0;
5241 SpellEffIndex effIndex = EFFECT_0;
5242 switch (spellId)
5243 {
5245 bonusSpellId = SPELL_DRUID_TRANQUILITY;
5246 effIndex = EFFECT_2;
5247 break;
5249 bonusSpellId = SPELL_PRIEST_DIVINE_HYMN;
5250 effIndex = EFFECT_1;
5251 break;
5253 bonusSpellId = spellId;
5254 effIndex = EFFECT_1;
5255 break;
5257 bonusSpellId = SPELL_SHAMAN_HEALING_TIDE_TOTEM;
5258 effIndex = EFFECT_2;
5259 break;
5260 case SPELL_MONK_REVIVAL:
5261 bonusSpellId = spellId;
5262 effIndex = EFFECT_4;
5263 break;
5265 bonusSpellId = spellId;
5266 effIndex = EFFECT_3;
5267 break;
5268 default:
5269 return 0.0f;
5270 }
5271
5272 if (AuraEffect* const healingIncreaseEffect = unit->GetAuraEffect(bonusSpellId, effIndex))
5273 return healingIncreaseEffect->GetAmount();
5274
5275 return sSpellMgr->AssertSpellInfo(bonusSpellId, DIFFICULTY_NONE)->GetEffect(effIndex).CalcValue(unit);
5276 }
5277
5278 return 0.0;
5279}
5280}
5281
5282// 157982 - Tranquility (Heal)
5283// 64844 - Divine Hymn (Heal)
5284// 114942 - Healing Tide (Heal)
5285// 115310 - Revival (Heal)
5287{
5288 bool Validate(SpellInfo const* /*spellInfo*/) override
5289 {
5290 return ValidateSpellEffect
5291 ({
5296 });
5297 }
5298
5299 void CalculateHealingBonus(SpellEffectInfo const& /*spellEffectInfo*/, Unit* /*victim*/, int32& /*healing*/, int32& /*flatMod*/, float& pctMod) const
5300 {
5302 }
5303
5308};
5309
5310// 157982 - Tranquility (Heal)
5311// 271466 - Luminous Barrier (Absorb)
5312// 363534 - Rewind (Heal)
5314{
5315 bool Validate(SpellInfo const* /*spellInfo*/) override
5316 {
5317 return ValidateSpellEffect
5318 ({
5322 });
5323 }
5324
5325 void CalculateHealingBonus(AuraEffect const* /*aurEff*/, Unit* /*victim*/, int32& /*damageOrHealing*/, int32& /*flatMod*/, float& pctMod) const
5326 {
5327 if (Unit const* caster = GetCaster())
5329 }
5330
5335};
5336
5337// 50230 - Random Aggro (Taunt)
5339{
5340 bool Validate(SpellInfo const* spellInfo) override
5341 {
5342 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) && ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_0).BasePoints) });
5343 }
5344
5345 void SelectRandomTarget(std::list<WorldObject*>& targets)
5346 {
5347 if (targets.empty())
5348 return;
5349
5351 }
5352
5354 {
5355 GetHitUnit()->CastSpell(GetCaster(), static_cast<uint32>(GetSpellInfo()->GetEffect(effIndex).BasePoints), CastSpellExtraArgs(TRIGGERED_FULL_MASK));
5356 }
5357
5363};
5364
5365// 24931 - 100 Health
5366// 24959 - 500 Health
5367// 28838 - 1 Health
5368// 43645 - 1 Health
5369// 73342 - 1 Health
5370// 86562 - 1 Health
5372{
5373public:
5375
5376 void HandleHit(SpellEffIndex /*effIndex*/)
5377 {
5378 if (GetHitUnit()->IsAlive() && _health > 0)
5380 }
5381
5386
5387private:
5389};
5390
5391// 128648 - Defending Cart Aura
5393{
5394 void FilterTargets(std::list<WorldObject*>& targets) const
5395 {
5396 if (targets.empty())
5397 return;
5398
5399 if (GameObject const* controlZone = GetControlZone())
5400 {
5401 targets.remove_if([&](WorldObject* obj)
5402 {
5403 if (Player const* player = obj->ToPlayer())
5404 return GetTeamIdForTeam(player->GetBGTeam()) != controlZone->GetControllingTeam();
5405
5406 return true;
5407 });
5408 }
5409 }
5410
5412 {
5413 if (Unit const* caster = GetCaster())
5414 {
5415 Unit::AuraEffectList const& auraEffects = caster->GetAuraEffectsByType(SPELL_AURA_ACT_AS_CONTROL_ZONE);
5416 for (AuraEffect const* auraEffect : auraEffects)
5417 if (GameObject const* gameobject = caster->GetGameObject(auraEffect->GetSpellInfo()->Id))
5418 return gameobject;
5419 }
5420
5421 return nullptr;
5422 }
5423
5428};
5429
5430// 128648 - Defending Cart Aura
5432{
5433 void OnPeriodic(AuraEffect const* /*aurEff*/) const
5434 {
5435 Unit const* caster = GetCaster();
5436 if (!caster)
5437 return;
5438
5439 if (GameObject const* controlZone = GetControlZone())
5440 if (!controlZone->GetInsidePlayers()->contains(GetTarget()->GetGUID()))
5442 }
5443
5445 {
5446 if (Unit const* caster = GetCaster())
5447 {
5448 Unit::AuraEffectList const& auraEffects = caster->GetAuraEffectsByType(SPELL_AURA_ACT_AS_CONTROL_ZONE);
5449 for (AuraEffect const* auraEffect : auraEffects)
5450 if (GameObject const* gameobject = caster->GetGameObject(auraEffect->GetSpellInfo()->Id))
5451 return gameobject;
5452 }
5453
5454 return nullptr;
5455 }
5456
5461};
5462
5463// 296837 - Comfortable Rider's Barding
5465{
5466 bool Validate(SpellInfo const* /*spellInfo*/) override
5467 {
5468 return ValidateSpellInfo({ SPELL_DAZED });
5469 }
5470
5471 template <bool apply>
5472 void HandleEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
5473 {
5475 }
5476
5477 void Register() override
5478 {
5479 OnEffectApply += AuraEffectApplyFn(spell_gen_comfortable_riders_barding::HandleEffect<true>, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
5480 OnEffectRemove += AuraEffectApplyFn(spell_gen_comfortable_riders_barding::HandleEffect<false>, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
5481 }
5482};
5483
5484// 297091 - Parachute
5486{
5487 static constexpr uint32 SPELL_PARACHUTE = 297092;
5488
5489 bool Validate(SpellInfo const* /*spellInfo*/) override
5490 {
5492 }
5493
5494 void TriggerParachute(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
5495 {
5496 Unit* target = GetTarget();
5497 if (target->IsFlying() || target->IsFalling())
5499 }
5500
5505};
5506
5512
5513// 257040 - Spatial Rift
5515{
5516 bool Validate(SpellInfo const* /*spellInfo*/) override
5517 {
5519 }
5520
5521 void HandleDummy(SpellEffIndex /*effIndex*/) const
5522 {
5523 Unit* caster = GetCaster();
5524
5526 if (!at)
5527 return;
5528
5530 .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
5531 .TriggeringSpell = GetSpell()
5532 });
5533
5534 at->SetDuration(0);
5535 }
5536
5541};
5542
5544{
5546
5547 void OnInitialize() override
5548 {
5549 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(at->GetSpellId(), DIFFICULTY_NONE);
5550 if (!spellInfo)
5551 return;
5552
5553 Position destPos = at->GetPosition();
5554 at->MovePositionToFirstCollision(destPos, spellInfo->GetMaxRange(), 0.0f);
5555
5556 PathGenerator path(at);
5557 path.CalculatePath(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ(), true);
5558
5559 at->InitSplines(path.GetPath());
5560 }
5561};
5562
5581
5583{
5584public:
5586
5587 static void CalculateAmount(AuraScript const&, AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/)
5588 {
5589 amount = -1;
5590 }
5591
5592 void HandleAbsorb(AuraEffect const* /*aurEff*/, DamageInfo const& dmgInfo, uint32& absorbAmount)
5593 {
5594 if (!dmgInfo.GetAttacker() || !dmgInfo.GetAttacker()->IsCreature())
5595 {
5597 return;
5598 }
5599
5600 if (GetTarget()->GetHealthPct() <= _healthPct)
5601 absorbAmount = dmgInfo.GetDamage();
5602 else
5604 }
5605
5611
5612private:
5614};
5615
5616// 92678 - Abandon Vehicle
5629
5631{
5644 RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_break_shield");
5645 RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_tournament_counterattack");
5655 RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_default_count_pct_from_max_hp");
5656 RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_50pct_count_pct_from_max_hp", 50);
5658 RegisterSpellScriptWithArgs(spell_gen_dalaran_disguise, "spell_gen_sunreaver_disguise");
5659 RegisterSpellScriptWithArgs(spell_gen_dalaran_disguise, "spell_gen_silver_covenant_disguise");
5689 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pal_blessing_of_kings");
5690 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pal_blessing_of_might");
5691 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_dru_mark_of_the_wild");
5692 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pri_power_word_fortitude");
5693 RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pri_shadow_protection");
5711 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_soul_harvesters_charm");
5712 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_commendation_of_kaelthas");
5713 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_corpse_tongue_coin");
5714 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_corpse_tongue_coin_heroic");
5715 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_petrified_twilight_scale");
5716 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_petrified_twilight_scale_heroic");
5727 // Running Wild
5731 /* */
5755 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_future_you_whisper_to_controller_random", WHISPER_FUTURE_YOU);
5756 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_wyrmrest_defender_whisper_to_controller_random", WHISPER_DEFENDER);
5757 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_past_you_whisper_to_controller_random", WHISPER_PAST_YOU);
5760 RegisterSpellScriptWithArgs(spell_gen_eject_passenger_with_seatId, "spell_gen_eject_passenger_1", 0);
5761 RegisterSpellScriptWithArgs(spell_gen_eject_passenger_with_seatId, "spell_gen_eject_passenger_3", 2);
5807 RegisterSpellScriptWithArgs(spell_gen_set_health, "spell_gen_set_health_1", 1);
5808 RegisterSpellScriptWithArgs(spell_gen_set_health, "spell_gen_set_health_100", 100);
5809 RegisterSpellScriptWithArgs(spell_gen_set_health, "spell_gen_set_health_500", 500);
5816 RegisterSpellScriptWithArgs(spell_gen_no_npc_damage_below_override, "spell_gen_no_npc_damage_below_override_70", 70.0f);
5818}
@ 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:569
@ RacialForThePurposeOfTemporaryRaceChange
@ DIFFICULTY_NONE
Definition DBCEnums.h:933
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:190
@ TYPEID_UNIT
Definition ObjectGuid.h:43
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
#define sObjectMgr
Definition ObjectMgr.h:1885
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:744
@ EQUIPMENT_SLOT_OFFHAND
Definition Player.h:745
#define INVENTORY_SLOT_BAG_0
Definition Player.h:723
@ QUEST_STATUS_NONE
Definition QuestDef.h:147
Races
Definition RaceMask.h:27
@ RACE_DARK_IRON_DWARF
Definition RaceMask.h:62
@ RACE_TROLL
Definition RaceMask.h:36
@ RACE_UNDEAD_PLAYER
Definition RaceMask.h:33
@ RACE_PANDAREN_NEUTRAL
Definition RaceMask.h:52
@ RACE_ORC
Definition RaceMask.h:30
@ RACE_LIGHTFORGED_DRAENEI
Definition RaceMask.h:58
@ RACE_NONE
Definition RaceMask.h:28
@ RACE_DRAENEI
Definition RaceMask.h:39
@ RACE_EARTHEN_DWARF_HORDE
Definition RaceMask.h:78
@ RACE_NIGHTBORNE
Definition RaceMask.h:55
@ RACE_HIGHMOUNTAIN_TAUREN
Definition RaceMask.h:56
@ RACE_HARANIR_HORDE
Definition RaceMask.h:83
@ RACE_EARTHEN_DWARF_ALLIANCE
Definition RaceMask.h:79
@ RACE_DRACTHYR_HORDE
Definition RaceMask.h:67
@ RACE_ZANDALARI_TROLL
Definition RaceMask.h:59
@ RACE_VOID_ELF
Definition RaceMask.h:57
@ RACE_NIGHTELF
Definition RaceMask.h:32
@ RACE_BLOODELF
Definition RaceMask.h:38
@ RACE_DWARF
Definition RaceMask.h:31
@ RACE_GNOME
Definition RaceMask.h:35
@ RACE_GOBLIN
Definition RaceMask.h:37
@ RACE_KUL_TIRAN
Definition RaceMask.h:60
@ RACE_HUMAN
Definition RaceMask.h:29
@ RACE_DRACTHYR_ALLIANCE
Definition RaceMask.h:66
@ RACE_WORGEN
Definition RaceMask.h:50
@ RACE_PANDAREN_ALLIANCE
Definition RaceMask.h:53
@ RACE_VULPERA
Definition RaceMask.h:63
@ RACE_MECHAGNOME
Definition RaceMask.h:65
@ RACE_HARANIR_ALLIANCE
Definition RaceMask.h:80
@ RACE_MAGHAR_ORC
Definition RaceMask.h:64
@ RACE_PANDAREN_HORDE
Definition RaceMask.h:54
@ RACE_TAUREN
Definition RaceMask.h:34
int32 irand(int32 min, int32 max)
Definition Random.cpp:35
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:42
bool roll_chance(T chance)
Definition Random.h:55
#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
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
@ 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
@ 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:252
@ JUST_RESPAWNED
Definition Unit.h:256
#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:446
uint32 GetDamage() const
Definition Unit.h:452
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
ObjectGuid GetOwnerGUID() const override
Definition GameObject.h:245
Definition Item.h:179
ItemTemplate const * GetTemplate() const
Definition Item.cpp:1233
Definition Map.h:225
bool IsDungeon() const
Definition Map.cpp:3267
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:1694
bool IsBattleground() const
Definition Map.cpp:3359
bool IsRaid() const
Definition Map.cpp:3277
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:1186
uint32 GetId() const
Definition Map.cpp:3257
bool IsHeroic() const
Definition Map.cpp:3311
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:17952
void SendBindPointUpdate() const
Definition Player.cpp:17943
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:6283
bool HasAchieved(uint32 achievementId) const
Definition Player.cpp:27572
WorldSession * GetSession() const
Definition Player.h:2272
void LearnSpell(uint32 spell_id, bool dependent, int32 fromSkill=0, bool suppressMessaging=false, Optional< PlayerSpellTrait > trait={})
Definition Player.cpp:3178
Item * GetItemByPos(uint16 pos) const
Definition Player.cpp:9630
bool HasSkill(uint32 skill) const
Definition Player.cpp:5989
TeamId GetTeamId() const
Definition Player.h:2424
bool CanAcceptAreaSpiritHealFrom(Unit *spiritHealer) const
Definition Player.h:3066
uint32 GetLastPetNumber() const
Definition Player.h:2786
uint32 GetProfessionSkillForExp(uint32 skill, int32 expansion) const
Definition Player.cpp:5963
void RemoveSpell(uint32 spell_id, bool disabled=false, bool learn_low_rank=true, bool suppressMessaging=false)
Definition Player.cpp:3223
float GetAverageItemLevel() const
Definition Player.cpp:30033
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition Player.cpp:15962
void SetAreaSpiritHealer(Creature *creature)
Definition Player.cpp:31469
void SetHomebind(WorldLocation const &loc, uint32 areaId)
Definition Player.cpp:17926
Team GetEffectiveTeam() const
Definition Player.h:2427
ReputationMgr & GetReputationMgr()
Definition Player.h:2439
Team GetTeam() const
Definition Player.h:2423
void LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue, Races race)
Definition Player.cpp:25450
SpellSchoolMask GetSchoolMask() const
Definition Unit.cpp:292
Unit * GetActionTarget() const
Definition Unit.h:500
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:281
DamageInfo * GetDamageInfo() const
Definition Unit.h:511
Unit * GetProcTarget() const
Definition Unit.h:501
Unit * GetActor() const
Definition Unit.h:499
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
bool HasEffect(SpellEffectName effect) 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:588
std::vector< SpellEffectInfo > const & GetEffects() const
Definition SpellInfo.h:587
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:635
uint32 GetChannelSpellId() const
Definition Unit.h:1423
void ApplySpellImmune(uint32 spellId, SpellImmunity op, uint32 type, bool apply)
Definition Unit.cpp:8242
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:8697
void SetImmuneToAll(bool apply, bool keepCombat)
Definition Unit.cpp:8505
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3751
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3955
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1342
void SetHealth(uint64 val)
Definition Unit.cpp:9973
void SetVirtualItem(uint32 slot, uint32 itemId, uint16 appearanceModId=0, uint16 itemVisual=0)
Definition Unit.cpp:14374
uint64 CountPctFromMaxHealth(float pct) const
Definition Unit.h:797
void SetUnitFlag3(UnitFlags3 flags)
Definition Unit.h:856
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3828
void SetFullHealth()
Definition Unit.h:802
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
Definition Unit.cpp:10731
void EnergizeBySpell(Unit *victim, SpellInfo const *spellInfo, int32 damage, Powers powerType)
Definition Unit.cpp:6798
ThreatManager & GetThreatManager()
Definition Unit.h:1078
uint8 GetClass() const
Definition Unit.h:764
uint32 GetMountDisplayId() const
Definition Unit.h:913
float GetCollisionHeight() const override
Definition Unit.cpp:14533
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:645
Unit * GetCharmer() const
Definition Unit.h:1209
std::forward_list< AuraEffect * > AuraEffectList
Definition Unit.h:652
MotionMaster * GetMotionMaster()
Definition Unit.h:1723
Powers GetPowerType() const
Definition Unit.h:811
void Dismount()
Definition Unit.cpp:8317
Aura * AddAura(uint32 spellId, Unit *target)
Definition Unit.cpp:12249
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4604
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:851
int32 GetMaxPower(Powers power) const
Definition Unit.cpp:10037
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
Definition Unit.cpp:6776
void RemoveAllAurasOnDeath()
Definition Unit.cpp:4473
TempSummon * ToTempSummon()
Definition Unit.h:1828
void RemoveUnitFlag3(UnitFlags3 flags)
Definition Unit.h:857
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition Unit.cpp:13361
void SetUninteractible(bool apply)
Definition Unit.cpp:8564
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition Unit.cpp:8284
bool IsCharmedOwnedByPlayerOrPlayer() const
Definition Unit.h:1217
virtual Gender GetNativeGender() const
Definition Unit.h:769
uint32 GetVirtualItemId(uint32 slot) const
Definition Unit.cpp:14358
uint64 GetMaxHealth() const
Definition Unit.h:789
uint16 GetMaxSkillValueForLevel(Unit const *target=nullptr) const
Definition Unit.h:932
void RemoveUnitFlag2(UnitFlags2 flags)
Definition Unit.h:852
bool HasAuraType(AuraType auraType) const
Definition Unit.cpp:4814
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:793
void GetAllMinionsByEntry(std::list< TempSummon * > &Minions, uint32 entry)
Definition Unit.cpp:6420
void SetFullPower(Powers power)
Definition Unit.h:825
bool IsMounted() const
Definition Unit.h:912
float GetSpeedRate(UnitMoveType mtype) const
Definition Unit.h:1707
int32 GetPower(Powers power) const
Definition Unit.cpp:10028
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition Unit.cpp:8942
DeathState getDeathState() const
Definition Unit.h:1188
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4804
SpellHistory * GetSpellHistory()
Definition Unit.h:1498
void HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
Definition Unit.cpp:1657
void SetUnitFlag(UnitFlags flags)
Definition Unit.h:846
bool IsFlying() const
Definition Unit.h:1807
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1295
void RemoveMovementImpairingAuras(bool withRoot)
Definition Unit.cpp:4294
Vehicle * GetVehicleKit() const
Definition Unit.h:1782
bool IsFalling() const
Definition Unit.cpp:12939
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
uint8 GetLevel() const
Definition Unit.h:757
void SetMountDisplayId(uint32 mountDisplayId)
Definition Unit.h:914
uint8 GetRace() const
Definition Unit.h:761
virtual void SetDisplayId(uint32 displayId, bool setNative=false)
Definition Unit.cpp:10779
bool IsInCombat() const
Definition Unit.h:1058
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:847
AreaTrigger * GetAreaTrigger(uint32 spellId) const
Definition Unit.cpp:5469
virtual void ExitVehicle(Position const *exitPosition=nullptr)
Definition Unit.cpp:12835
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:2217
PhaseShift & GetPhaseShift()
Definition Object.h:310
Unit * GetOwner() const
Definition Object.cpp:1598
float GetDistance2d(WorldObject const *obj) const
Definition Object.cpp:450
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition Object.cpp:1621
EventProcessor m_Events
Definition Object.h:561
void MovePositionToFirstCollision(Position &pos, float dist, float angle) const
Definition Object.cpp:2828
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:432
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 *) override
void HandleDummy(SpellEffIndex)
SpellCastResult CheckIfCorpseNear()
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
void UpdatePeriodic(AuraEffect *aurEff)
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
void Register() override
void HandleScript(SpellEffIndex)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex effIndex)
void 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)
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
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 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
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
ChaosBlast
@ SPELL_CHAOS_BLAST
GenericBandage
@ SPELL_RECENTLY_BANDAGED
AuraProcRemoveSpells
@ SPELL_IMPATIENT_MIND
@ SPELL_FACE_RAGE
WhisperGulchYoggSaronWhisper
@ SPELL_YOGG_SARON_WHISPER_DUMMY
AdaptiveWarding
@ SPELL_GEN_ADAPTIVE_WARDING_ARCANE
@ SPELL_GEN_ADAPTIVE_WARDING_FIRE
@ SPELL_GEN_ADAPTIVE_WARDING_NATURE
@ SPELL_GEN_ADAPTIVE_WARDING_FROST
@ SPELL_GEN_ADAPTIVE_WARDING_SHADOW
MajorHealingCooldownSpell
@ SPELL_PRIEST_DIVINE_HYMN_HEAL
@ SPELL_DRUID_TRANQUILITY
@ SPELL_SHAMAN_HEALING_TIDE_TOTEM_HEAL
@ SPELL_EVOKER_REWIND
@ SPELL_SHAMAN_HEALING_TIDE_TOTEM
@ SPELL_PRIEST_LUMINOUS_BARRIER
@ SPELL_DRUID_TRANQUILITY_HEAL
@ SPELL_PRIEST_DIVINE_HYMN
@ SPELL_MONK_REVIVAL
RunningWildMountIds
@ SPELL_ALTERED_FORM
DefenderOfAzerothData
@ NPC_TROLLBANE
@ QUEST_DEFENDER_OF_AZEROTH_HORDE
@ QUEST_DEFENDER_OF_AZEROTH_ALLIANCE
@ NPC_MOGRAINE
@ SPELL_DEATH_GATE_TELEPORT_STORMWIND
@ SPELL_DEATH_GATE_TELEPORT_ORGRIMMAR
@ NPC_NAZGRIM
@ NPC_WHITEMANE
OrcDisguiseSpells
@ SPELL_ORC_DISGUISE_FEMALE
@ SPELL_ORC_DISGUISE_MALE
@ SPELL_ORC_DISGUISE_TRIGGER
ProfessionResearch
@ SPELL_NORTHREND_INSCRIPTION_RESEARCH
@ 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 VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition CellImpl.h:179
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition CellImpl.h:191
uint32 GetSubClass() const
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