TrinityCore
spell_item.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 spells used by items.
20 * Ordered alphabetically using scriptname.
21 * Scriptnames of files in this file should be prefixed with "spell_item_".
22 */
23
24#include "ScriptMgr.h"
25#include "Battleground.h"
26#include "CommonPredicates.h"
27#include "Containers.h"
28#include "Creature.h"
29#include "CreatureAIImpl.h"
30#include "DB2Stores.h"
31#include "Item.h"
32#include "Log.h"
33#include "LootMgr.h"
34#include "Map.h"
35#include "ObjectMgr.h"
36#include "Player.h"
37#include "Random.h"
38#include "SkillDiscovery.h"
39#include "Spell.h"
40#include "SpellAuraEffects.h"
41#include "SpellHistory.h"
42#include "SpellMgr.h"
43#include "SpellScript.h"
44
46{
51};
52
53// Generic script for handling item dummy effects which trigger another spell.
55{
56 private:
58
59 public:
60 spell_item_trigger_spell(char const* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
61
63 {
65
66 public:
67 spell_item_trigger_spell_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { }
68
69 private:
70 bool Validate(SpellInfo const* /*spellInfo*/) override
71 {
73 }
74
75 void HandleDummy(SpellEffIndex /*effIndex*/)
76 {
77 Unit* caster = GetCaster();
78 if (Item* item = GetCastItem())
79 caster->CastSpell(caster, _triggeredSpellId, item);
80 }
81
82 void Register() override
83 {
85 }
86 };
87
88 SpellScript* GetSpellScript() const override
89 {
91 }
92};
93
95{
96 SPELL_AEGIS_HEAL = 23781
97};
98
99// 23780 - Aegis of Preservation
101{
102 bool Validate(SpellInfo const* /*spellInfo*/) override
103 {
105 }
106
107 void HandleProc(AuraEffect* aurEff, ProcEventInfo& /*eventInfo*/)
108 {
111 }
112
113 void Register() override
114 {
116 }
117};
118
120{
123
124// 38554 - Absorb Eye of Grillok (31463: Zezzak's Shard)
126{
127 bool Validate(SpellInfo const* /*spellInfo*/) override
128 {
130 }
131
132 void PeriodicTick(AuraEffect const* aurEff)
133 {
135
136 if (!GetCaster() || GetTarget()->GetTypeId() != TYPEID_UNIT)
137 return;
138
141 }
142
143 void Register() override
144 {
146 }
147};
148
150{
156
157// 37877 - Blessing of Faith
159{
160 bool Validate(SpellInfo const* /*spellInfo*/) override
161 {
162 return ValidateSpellInfo
163 ({
168 });
169 }
170
171 void HandleDummy(SpellEffIndex /*effIndex*/)
172 {
173 if (Unit* unitTarget = GetHitUnit())
174 {
175 uint32 spellId = 0;
176 switch (unitTarget->GetClass())
177 {
178 case CLASS_DRUID:
180 break;
181 case CLASS_PALADIN:
183 break;
184 case CLASS_PRIEST:
186 break;
187 case CLASS_SHAMAN:
189 break;
190 default:
191 return; // ignore for non-healing classes
192 }
193
194 Unit* caster = GetCaster();
195 caster->CastSpell(caster, spellId, true);
196 }
197 }
198
199 void Register() override
200 {
202 }
203};
204
206{
210
211// Item - 13503: Alchemist's Stone
212// Item - 35748: Guardian's Alchemist Stone
213// Item - 35749: Sorcerer's Alchemist Stone
214// Item - 35750: Redeemer's Alchemist Stone
215// Item - 35751: Assassin's Alchemist Stone
216// Item - 44322: Mercurial Alchemist Stone
217// Item - 44323: Indestructible Alchemist's Stone
218// Item - 44324: Mighty Alchemist's Stone
219
220// 17619 - Alchemist Stone
222{
223 bool Validate(SpellInfo const* /*spellInfo*/) override
224 {
225 return ValidateSpellInfo(
226 {
229 });
230 }
231
232 bool CheckProc(ProcEventInfo& eventInfo)
233 {
235 }
236
237 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
238 {
240
241 uint32 spellId = 0;
242 int32 amount = int32(eventInfo.GetDamageInfo()->GetDamage() * 0.4f);
243
248
249 if (!spellId)
250 return;
251
252 Unit* caster = eventInfo.GetActionTarget();
253 CastSpellExtraArgs args(aurEff);
254 args.AddSpellBP0(amount);
255 caster->CastSpell(nullptr, spellId, args);
256 }
257
258 void Register() override
259 {
262 }
263};
264
266{
271
272// Item - 50351: Tiny Abomination in a Jar
273// 71406 - Anger Capacitor
274
275// Item - 50706: Tiny Abomination in a Jar (Heroic)
276// 71545 - Anger Capacitor
277template <uint8 StackAmount>
279{
280 public:
281 spell_item_anger_capacitor(char const* ScriptName) : SpellScriptLoader(ScriptName) { }
282
283 template <uint8 Stacks>
285 {
286 bool Validate(SpellInfo const* /*spellInfo*/) override
287 {
288 return ValidateSpellInfo(
289 {
293 });
294 }
295
296 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
297 {
299 Unit* caster = eventInfo.GetActor();
300 Unit* target = eventInfo.GetProcTarget();
301
302 caster->CastSpell(nullptr, SPELL_MOTE_OF_ANGER, true);
303 Aura const* motes = caster->GetAura(SPELL_MOTE_OF_ANGER);
304 if (!motes || motes->GetStackAmount() < Stacks)
305 return;
306
309 if (Player* player = caster->ToPlayer())
310 if (player->GetWeaponForAttack(OFF_ATTACK, true) && roll_chance_i(50))
312
313 caster->CastSpell(target, spellId, aurEff);
314 }
315
316 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
317 {
319 }
320
321 void Register() override
322 {
325 }
326 };
327
328 AuraScript* GetAuraScript() const override
329 {
331 }
332};
333
334// 26400 - Arcane Shroud
336{
337 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
338 {
339 int32 diff = GetUnitOwner()->GetLevel() - 60;
340 if (diff > 0)
341 amount += 2 * diff;
342 }
343
344 void Register() override
345 {
347 }
348};
349
351{
352 SPELL_SOCIOPATH = 39511, // Sociopath: +35 strength(Paladin, Rogue, Druid, Warrior)
353 SPELL_DELUSIONAL = 40997, // Delusional: +70 attack power(Rogue, Hunter, Paladin, Warrior, Druid)
354 SPELL_KLEPTOMANIA = 40998, // Kleptomania: +35 agility(Warrior, Rogue, Paladin, Hunter, Druid)
355 SPELL_MEGALOMANIA = 40999, // Megalomania: +41 damage / healing(Druid, Shaman, Priest, Warlock, Mage, Paladin)
356 SPELL_PARANOIA = 41002, // Paranoia: +35 spell / melee / ranged crit strike rating(All classes)
357 SPELL_MANIC = 41005, // Manic: +35 haste(spell, melee and ranged) (All classes)
358 SPELL_NARCISSISM = 41009, // Narcissism: +35 intellect(Druid, Shaman, Priest, Warlock, Mage, Paladin, Hunter)
359 SPELL_MARTYR_COMPLEX = 41011, // Martyr Complex: +35 stamina(All classes)
360 SPELL_DEMENTIA = 41404, // Dementia: Every 5 seconds either gives you +5/-5% damage/healing. (Druid, Shaman, Priest, Warlock, Mage, Paladin)
361
364
365 SAY_MADNESS = 21954
367
368// Item - 31859: Darkmoon Card: Madness
369// 39446 - Aura of Madness
371{
372 bool Validate(SpellInfo const* /*spellInfo*/) override
373 {
374 return ValidateSpellInfo(
375 {
385 }) && sBroadcastTextStore.LookupEntry(SAY_MADNESS);
386 }
387
388 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
389 {
390 static std::vector<uint32> const triggeredSpells[MAX_CLASSES] =
391 {
392 //CLASS_NONE
393 { },
394 //CLASS_WARRIOR
396 //CLASS_PALADIN
398 //CLASS_HUNTER
400 //CLASS_ROGUE
402 //CLASS_PRIEST
404 //CLASS_DEATH_KNIGHT
406 //CLASS_SHAMAN
408 //CLASS_MAGE
410 //CLASS_WARLOCK
412 //CLASS_UNK
413 { },
414 //CLASS_DRUID
416 };
417
419 Unit* caster = eventInfo.GetActor();
420 uint32 spellId = Trinity::Containers::SelectRandomContainerElement(triggeredSpells[caster->GetClass()]);
421 caster->CastSpell(caster, spellId, aurEff);
422
423 if (roll_chance_i(10))
424 caster->Unit::Say(SAY_MADNESS);
425 }
426
427 void Register() override
428 {
430 }
431};
432
433// 41404 - Dementia
435{
436 bool Validate(SpellInfo const* /*spellInfo*/) override
437 {
438 return ValidateSpellInfo(
439 {
442 });
443 }
444
445 void HandlePeriodicDummy(AuraEffect const* aurEff)
446 {
449 }
450
451 void Register() override
452 {
454 }
455};
456
457// 24590 - Brittle Armor
459{
460 SPELL_BRITTLE_ARMOR = 24575
462
464{
465 bool Validate(SpellInfo const* /*spellInfo*/) override
466 {
468 }
469
470 void HandleScript(SpellEffIndex /* effIndex */)
471 {
473 }
474
475 void Register() override
476 {
478 }
479};
480
481// 64411 - Blessing of Ancient Kings (Val'anyr, Hammer of Ancient Kings)
483{
486
488{
489 bool Validate(SpellInfo const* /*spellInfo*/) override
490 {
492 }
493
494 bool CheckProc(ProcEventInfo& eventInfo)
495 {
496 return eventInfo.GetProcTarget() != nullptr;
497 }
498
499 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
500 {
502
503 HealInfo* healInfo = eventInfo.GetHealInfo();
504 if (!healInfo || !healInfo->GetHeal())
505 return;
506
507 int32 absorb = int32(CalculatePct(healInfo->GetHeal(), 15.0f));
509 {
510 // The shield can grow to a maximum size of 20,000 damage absorbtion
511 protEff->SetAmount(std::min<int32>(protEff->GetAmount() + absorb, 20000));
512
513 // Refresh and return to prevent replacing the aura
514 protEff->GetBase()->RefreshDuration();
515 }
516 else
517 {
518 CastSpellExtraArgs args(aurEff);
519 args.AddSpellBP0(absorb);
521 }
522 }
523
524 void Register() override
525 {
528 }
529};
530
531// 64415 Val'anyr Hammer of Ancient Kings - Equip Effect
533{
534 bool CheckProc(ProcEventInfo& eventInfo)
535 {
536 return eventInfo.GetHealInfo() && eventInfo.GetHealInfo()->GetEffectiveHeal() > 0;
537 }
538
539 void Register() override
540 {
542 }
543};
544
546{
549
550// 71564 - Deadly Precision
552{
553 void HandleStackDrop(AuraEffect* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
554 {
556 GetTarget()->RemoveAuraFromStack(GetId(), GetTarget()->GetGUID());
557 }
558
559 void Register() override
560 {
562 }
563};
564
565// 71563 - Deadly Precision Dummy
567{
568 bool Validate(SpellInfo const* /*spellInfo*/) override
569 {
571 }
572
573 void HandleDummy(SpellEffIndex /*effIndex*/)
574 {
575 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_DEADLY_PRECISION, GetCastDifficulty());
578 GetCaster()->CastSpell(GetCaster(), spellInfo->Id, args);
579 }
580
581 void Register() override
582 {
584 }
585};
586
588{
589 SPELL_STRENGTH_OF_THE_TAUNKA = 71484, // +600 Strength
590 SPELL_AGILITY_OF_THE_VRYKUL = 71485, // +600 Agility
591 SPELL_POWER_OF_THE_TAUNKA = 71486, // +1200 Attack Power
592 SPELL_AIM_OF_THE_IRON_DWARVES = 71491, // +600 Critical
593 SPELL_SPEED_OF_THE_VRYKUL = 71492, // +600 Haste
594
595 SPELL_AGILITY_OF_THE_VRYKUL_HERO = 71556, // +700 Agility
596 SPELL_POWER_OF_THE_TAUNKA_HERO = 71558, // +1400 Attack Power
597 SPELL_AIM_OF_THE_IRON_DWARVES_HERO = 71559, // +700 Critical
598 SPELL_SPEED_OF_THE_VRYKUL_HERO = 71560, // +700 Haste
599 SPELL_STRENGTH_OF_THE_TAUNKA_HERO = 71561 // +700 Strength
601
602// Item - 50362: Deathbringer's Will
603// 71519 - Item - Icecrown 25 Normal Melee Trinket
604
605// Item - 50363: Deathbringer's Will
606// 71562 - Item - Icecrown 25 Heroic Melee Trinket
607template <uint32 StrengthSpellId, uint32 AgilitySpellId, uint32 APSpellId, uint32 CriticalSpellId, uint32 HasteSpellId>
609{
610 public:
611 spell_item_deathbringers_will(char const* ScriptName) : SpellScriptLoader(ScriptName) { }
612
613 template <uint32 Strength, uint32 Agility, uint32 AttackPower, uint32 Critical, uint32 Haste>
615 {
616 bool Validate(SpellInfo const* /*spellInfo*/) override
617 {
618 return ValidateSpellInfo(
619 {
620 Strength,
621 Agility,
622 AttackPower,
623 Critical,
624 Haste
625 });
626 }
627
628 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
629 {
630 static std::vector<uint32> const triggeredSpells[MAX_CLASSES] =
631 {
632 //CLASS_NONE
633 { },
634 //CLASS_WARRIOR
635 { Strength, Critical, Haste },
636 //CLASS_PALADIN
637 { Strength, Critical, Haste },
638 //CLASS_HUNTER
639 { Agility, Critical, AttackPower },
640 //CLASS_ROGUE
641 { Agility, Haste, AttackPower },
642 //CLASS_PRIEST
643 { },
644 //CLASS_DEATH_KNIGHT
645 { Strength, Critical, Haste },
646 //CLASS_SHAMAN
647 { Agility, Haste, AttackPower },
648 //CLASS_MAGE
649 { },
650 //CLASS_WARLOCK
651 { },
652 //CLASS_UNK
653 { },
654 //CLASS_DRUID
655 { Strength, Agility, Haste }
656 };
657
659 Unit* caster = eventInfo.GetActor();
660 std::vector<uint32> const& randomSpells = triggeredSpells[caster->GetClass()];
661 if (randomSpells.empty())
662 return;
663
665 caster->CastSpell(caster, spellId, aurEff);
666 }
667
668 void Register() override
669 {
671 }
672 };
673
674 AuraScript* GetAuraScript() const override
675 {
677 }
678};
679
680// 47770 - Roll Dice
682{
683 enum
684 {
686 };
687
688 bool Validate(SpellInfo const* /*spellInfo*/) override
689 {
691 return false;
692 return true;
693 }
694
695 bool Load() override
696 {
697 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
698 }
699
700 void HandleScript(SpellEffIndex /*effIndex*/)
701 {
703
704 static uint32 const minimum = 1;
705 static uint32 const maximum = 100;
706
707 GetCaster()->ToPlayer()->DoRandomRoll(minimum, maximum);
708 }
709
710 void Register() override
711 {
713 }
714};
715
717{
721
722// 23134 - Goblin Bomb
724{
725 bool Validate(SpellInfo const* /*spell*/) override
726 {
728 }
729
730 void HandleDummy(SpellEffIndex /*effIndex*/)
731 {
732 if (Item* item = GetCastItem())
734 }
735
736 void Register() override
737 {
739 }
740};
741
743{
749
750// 46203 - Goblin Weather Machine
752{
753 void HandleScript(SpellEffIndex /* effIndex */)
754 {
755 Unit* target = GetHitUnit();
756
759 target->CastSpell(target, spellId, GetSpell());
760 }
761
762 void Register() override
763 {
765 }
766};
767
768// 8342 - Defibrillate (Goblin Jumper Cables) have 33% chance on success
769// 22999 - Defibrillate (Goblin Jumper Cables XL) have 50% chance on success
770// 54732 - Defibrillate (Gnomish Army Knife) have 67% chance on success
772{
776
778{
779 public:
780 spell_item_defibrillate(char const* name, uint8 chance, uint32 failSpell = 0) : SpellScriptLoader(name), _chance(chance), _failSpell(failSpell) { }
781
783 {
784 public:
785 spell_item_defibrillate_SpellScript(uint8 chance, uint32 failSpell) : SpellScript(), _chance(chance), _failSpell(failSpell) { }
786
787 private:
788 bool Validate(SpellInfo const* /*spellInfo*/) override
789 {
791 }
792
794 {
796 {
797 PreventHitDefaultEffect(effIndex);
798 if (_failSpell)
800 }
801 }
802
803 void Register() override
804 {
806 }
807
810 };
811
812 SpellScript* GetSpellScript() const override
813 {
815 }
816
817 private:
820};
821
823{
826
827// 33896 - Desperate Defense
829{
830 bool Validate(SpellInfo const* /*spellInfo*/) override
831 {
833 }
834
835 void HandleProc(AuraEffect* aurEff, ProcEventInfo& /*eventInfo*/)
836 {
839 }
840
841 void Register() override
842 {
844 }
845};
846
847// http://www.wowhead.com/item=6522 Deviate Fish
848// 8063 Deviate Fish
850{
856 SPELL_REJUVENATION = 8070
858
860{
861 bool Load() override
862 {
863 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
864 }
865
866 bool Validate(SpellInfo const* /*spellInfo*/) override
867 {
869 }
870
871 void HandleDummy(SpellEffIndex /*effIndex*/)
872 {
873 Unit* caster = GetCaster();
875 caster->CastSpell(caster, spellId, true);
876 }
877
878 void Register() override
879 {
881 }
882};
883
885{
886public:
887 PartyTimeEmoteEvent(Player* player) : _player(player) { }
888
889 bool Execute(uint64 /*time*/, uint32 /*diff*/) override
890 {
892 return true;
893
894 if (_player->isMoving())
896 else
898
899 _player->m_Events.AddEventAtOffset(this, RAND(5s, 10s, 15s));
900
901 return false; // do not delete re-added event in EventProcessor::Update
902 }
903
904private:
906};
907
909{
910 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
911 {
912 Player* player = GetOwner()->ToPlayer();
913 if (!player)
914 return;
915
916 player->m_Events.AddEventAtOffset(new PartyTimeEmoteEvent(player), RAND(5s, 10s, 15s));
917 }
918
919 void Register() override
920 {
922 }
923};
924
926{
936
937// 51010 - Dire Brew
939{
940 void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
941 {
942 Unit* target = GetTarget();
943
944 uint32 model = 0;
945 uint8 gender = target->GetGender();
946 ChrClassesEntry const* chrClass = sChrClassesStore.AssertEntry(target->GetClass());
947 if (chrClass->ArmorTypeMask & (1 << ITEM_SUBCLASS_ARMOR_PLATE))
949 else if (chrClass->ArmorTypeMask & (1 << ITEM_SUBCLASS_ARMOR_MAIL))
951 else if (chrClass->ArmorTypeMask & (1 << ITEM_SUBCLASS_ARMOR_LEATHER))
953 else if (chrClass->ArmorTypeMask & (1 << ITEM_SUBCLASS_ARMOR_CLOTH))
955
956 if (model)
957 target->SetDisplayId(model);
958 }
959
960 void Register() override
961 {
963 }
964};
965
967{
970
971// 59915 - Discerning Eye of the Beast Dummy
973{
974 bool Validate(SpellInfo const* /*spellInfo*/) override
975 {
977 }
978
979 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
980 {
982 eventInfo.GetActor()->CastSpell(nullptr, SPELL_DISCERNING_EYE_BEAST, aurEff);
983 }
984
985 void Register() override
986 {
988 }
989};
990
991// 71610, 71641 - Echoes of Light (Althor's Abacus)
993{
994 void FilterTargets(std::list<WorldObject*>& targets)
995 {
996 if (targets.size() < 2)
997 return;
998
1000
1001 WorldObject* target = targets.front();
1002 targets.clear();
1003 targets.push_back(target);
1004 }
1005
1006 void Register() override
1007 {
1009 }
1010};
1011
1012// 30427 - Extract Gas (23821: Zapthrottle Mote Extractor)
1014{
1015 void PeriodicTick(AuraEffect const* /*aurEff*/)
1016 {
1018
1019 // move loot to player inventory and despawn target
1020 if (GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER &&
1021 GetTarget()->GetTypeId() == TYPEID_UNIT &&
1022 GetTarget()->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_GAS_CLOUD)
1023 {
1024 Player* player = GetCaster()->ToPlayer();
1025 Creature* creature = GetTarget()->ToCreature();
1026 CreatureDifficulty const* creatureDifficulty = creature->GetCreatureDifficulty();
1027 // missing lootid has been reported on startup - just return
1028 if (!creatureDifficulty->SkinLootID)
1029 return;
1030
1031 player->AutoStoreLoot(creatureDifficulty->SkinLootID, LootTemplates_Skinning, ItemContext::NONE, true);
1032 creature->DespawnOrUnsummon();
1033 }
1034 }
1035
1036 void Register() override
1037 {
1039 }
1040};
1041
1042// 7434 - Fate Rune of Unsurpassed Vigor
1044{
1047
1049{
1050 bool Validate(SpellInfo const* /*spellInfo*/) override
1051 {
1053 }
1054
1055 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
1056 {
1059 }
1060
1061 void Register() override
1062 {
1064 }
1065};
1066
1068{
1073 TEXT_BOUNTIFUL_FEAST = 35153
1075
1076/* 57301 - Great Feast
1077 57426 - Fish Feast
1078 58465 - Gigantic Feast
1079 58474 - Small Feast
1080 66476 - Bountiful Feast */
1082{
1083public:
1085
1086private:
1087 bool Validate(SpellInfo const* /*spellInfo*/) override
1088 {
1089 return sBroadcastTextStore.LookupEntry(_text);
1090 }
1091
1092 void HandleScript(SpellEffIndex /*effIndex*/)
1093 {
1094 Unit* caster = GetCaster();
1095 caster->Unit::TextEmote(_text, caster, false);
1096 }
1097
1098 void Register() override
1099 {
1101 }
1102
1104};
1105
1106// http://www.wowhead.com/item=47499 Flask of the North
1107// 67019 Flask of the North
1109{
1113};
1114
1116{
1117 bool Validate(SpellInfo const* /*spellInfo*/) override
1118 {
1120 }
1121
1122 void HandleDummy(SpellEffIndex /*effIndex*/)
1123 {
1124 Unit* caster = GetCaster();
1125 std::vector<uint32> possibleSpells;
1126 switch (caster->GetClass())
1127 {
1128 case CLASS_WARLOCK:
1129 case CLASS_MAGE:
1130 case CLASS_PRIEST:
1131 possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP);
1132 break;
1133 case CLASS_DEATH_KNIGHT:
1134 case CLASS_WARRIOR:
1135 possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_STR);
1136 break;
1137 case CLASS_ROGUE:
1138 case CLASS_HUNTER:
1139 possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_AP);
1140 break;
1141 case CLASS_DRUID:
1142 case CLASS_PALADIN:
1143 possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP);
1144 possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_STR);
1145 break;
1146 case CLASS_SHAMAN:
1147 possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_SP);
1148 possibleSpells.push_back(SPELL_FLASK_OF_THE_NORTH_AP);
1149 break;
1150 }
1151
1152 if (possibleSpells.empty())
1153 {
1154 TC_LOG_WARN("spells", "Missing spells for class {} in script spell_item_flask_of_the_north", caster->GetClass());
1155 return;
1156 }
1157
1158 caster->CastSpell(caster, Trinity::Containers::SelectRandomContainerElement(possibleSpells), true);
1159 }
1160
1161 void Register() override
1162 {
1164 }
1165};
1166
1168{
1169 SPELL_SHADOWMEND = 39373
1171
1172// 39372 - Frozen Shadoweave
1173// Frozen Shadoweave set 3p bonus
1175{
1176 bool Validate(SpellInfo const* /*spellInfo*/) override
1177 {
1179 }
1180
1181 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1182 {
1184 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
1185 if (!damageInfo || !damageInfo->GetDamage())
1186 return;
1187
1188 Unit* caster = eventInfo.GetActor();
1189 CastSpellExtraArgs args(aurEff);
1190 args.AddSpellBP0(CalculatePct(damageInfo->GetDamage(), aurEff->GetAmount()));
1191 caster->CastSpell(nullptr, SPELL_SHADOWMEND, args);
1192 }
1193
1194 void Register() override
1195 {
1197 }
1198};
1199
1200// http://www.wowhead.com/item=10645 Gnomish Death Ray
1201// 13280 Gnomish Death Ray
1203{
1206};
1207
1209{
1210 bool Validate(SpellInfo const* /*spellInfo*/) override
1211 {
1213 }
1214
1215 void HandleDummy(SpellEffIndex /*effIndex*/)
1216 {
1217 Unit* caster = GetCaster();
1218 if (Unit* target = GetHitUnit())
1219 {
1220 if (urand(0, 99) < 15)
1221 caster->CastSpell(caster, SPELL_GNOMISH_DEATH_RAY_SELF, true); // failure
1222 else
1223 caster->CastSpell(target, SPELL_GNOMISH_DEATH_RAY_TARGET, true);
1224 }
1225 }
1226
1227 void Register() override
1228 {
1230 }
1231};
1232
1233// Item 10721: Gnomish Harm Prevention Belt
1234// 13234 - Harm Prevention Belt
1236{
1239
1241{
1242 bool Validate(SpellInfo const* /*spellInfo*/) override
1243 {
1245 }
1246
1247 void HandleProc(ProcEventInfo& /*eventInfo*/)
1248 {
1250 }
1251
1252 void Register() override
1253 {
1255 }
1256};
1257
1259{
1264
1270
1271// Item - 49982: Heartpierce
1272// 71880 - Item - Icecrown 25 Normal Dagger Proc
1273
1274// Item - 50641: Heartpierce (Heroic)
1275// 71892 - Item - Icecrown 25 Heroic Dagger Proc
1276template <uint32 Energy, uint32 Mana, uint32 Rage, uint32 RunicPower>
1278{
1279 bool Validate(SpellInfo const* /*spellInfo*/) override
1280 {
1281 return ValidateSpellInfo(
1282 {
1283 Energy,
1284 Mana,
1285 Rage,
1286 RunicPower
1287 });
1288 }
1289
1290 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1291 {
1293 Unit* caster = eventInfo.GetActor();
1294
1295 uint32 spellId;
1296 switch (caster->GetPowerType())
1297 {
1298 case POWER_MANA:
1299 spellId = Mana;
1300 break;
1301 case POWER_ENERGY:
1302 spellId = Energy;
1303 break;
1304 case POWER_RAGE:
1305 spellId = Rage;
1306 break;
1307 // Death Knights can't use daggers, but oh well
1308 case POWER_RUNIC_POWER:
1309 spellId = RunicPower;
1310 break;
1311 default:
1312 return;
1313 }
1314
1315 caster->CastSpell(nullptr, spellId, aurEff);
1316 }
1317
1318 void Register() override
1319 {
1321 }
1322};
1323
1325{
1328
1329// 23645 - Hourglass Sand
1331{
1332 bool Validate(SpellInfo const* /*spellInfo*/) override
1333 {
1335 }
1336
1337 void HandleDummy(SpellEffIndex /*effIndex*/)
1338 {
1340 }
1341
1342 void Register() override
1343 {
1345 }
1346};
1347
1348// 40971 - Bonus Healing (Crystal Spire of Karabor)
1350{
1351 bool Validate(SpellInfo const* spellInfo) override
1352 {
1353 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } });
1354 }
1355
1356 bool CheckProc(ProcEventInfo& eventInfo)
1357 {
1359 if (HealInfo* healInfo = eventInfo.GetHealInfo())
1360 if (Unit* healTarget = healInfo->GetTarget())
1361 if (healTarget->GetHealth() - healInfo->GetEffectiveHeal() <= healTarget->CountPctFromMaxHealth(pct))
1362 return true;
1363
1364 return false;
1365 }
1366
1367 void Register() override
1368 {
1370 }
1371};
1372
1373// http://www.wowhead.com/item=27388 Mr. Pinchy
1374// 33060 Make a Wish
1376{
1382};
1383
1385{
1386 bool Load() override
1387 {
1388 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1389 }
1390
1391 bool Validate(SpellInfo const* /*spellInfo*/) override
1392 {
1393 return ValidateSpellInfo(
1394 {
1400 });
1401 }
1402
1403 void HandleDummy(SpellEffIndex /*effIndex*/)
1404 {
1405 Unit* caster = GetCaster();
1406 uint32 spellId = SPELL_MR_PINCHYS_GIFT;
1407 switch (urand(1, 5))
1408 {
1409 case 1: spellId = SPELL_MR_PINCHYS_BLESSING; break;
1410 case 2: spellId = SPELL_SUMMON_MIGHTY_MR_PINCHY; break;
1411 case 3: spellId = SPELL_SUMMON_FURIOUS_MR_PINCHY; break;
1412 case 4: spellId = SPELL_TINY_MAGICAL_CRAWDAD; break;
1413 }
1414 caster->CastSpell(caster, spellId, true);
1415 }
1416
1417 void Register() override
1418 {
1420 }
1421};
1422
1424{
1427
1428// Item - 27920: Mark of Conquest
1429// Item - 27921: Mark of Conquest
1430// 33510 - Health Restore
1432{
1433 bool Validate(SpellInfo const* /*spellInfo*/) override
1434 {
1436 }
1437
1438 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1439 {
1441 {
1442 // in that case, do not cast heal spell
1444 // but mana instead
1445 eventInfo.GetActor()->CastSpell(nullptr, SPELL_MARK_OF_CONQUEST_ENERGIZE, aurEff);
1446 }
1447 }
1448
1449 void Register() override
1450 {
1452 }
1453};
1454
1455// 26465 - Mercurial Shield
1457{
1460
1462{
1463 bool Validate(SpellInfo const* /*spellInfo*/) override
1464 {
1466 }
1467
1468 void HandleScript(SpellEffIndex /* effIndex */)
1469 {
1471 }
1472
1473 void Register() override
1474 {
1476 }
1477};
1478
1480{
1502
1503std::array<uint32, 20> const CreateFortuneSpells =
1504{
1509};
1510
1511// http://www.wowhead.com/item=32686 Mingo's Fortune Giblets
1512// 40802 Mingo's Fortune Generator
1514{
1515 bool Validate(SpellInfo const* /*spellInfo*/) override
1516 {
1518 }
1519
1520 void HandleDummy(SpellEffIndex /*effIndex*/)
1521 {
1523 }
1524
1525 void Register() override
1526 {
1528 }
1529};
1530
1531// 71875, 71877 - Item - Black Bruise: Necrotic Touch Proc
1533{
1536
1538{
1539 bool Validate(SpellInfo const* /*spellInfo*/) override
1540 {
1542 }
1543
1544 bool CheckProc(ProcEventInfo& eventInfo)
1545 {
1546 return eventInfo.GetProcTarget() && eventInfo.GetProcTarget()->IsAlive();
1547 }
1548
1549 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1550 {
1552 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
1553 if (!damageInfo || !damageInfo->GetDamage())
1554 return;
1555
1556 CastSpellExtraArgs args(aurEff);
1557 args.AddSpellBP0(CalculatePct(damageInfo->GetDamage(), aurEff->GetAmount()));
1559 }
1560
1561 void Register() override
1562 {
1565 }
1566};
1567
1568// http://www.wowhead.com/item=10720 Gnomish Net-o-Matic Projector
1569// 13120 Net-o-Matic
1571{
1575};
1576
1578{
1579 bool Validate(SpellInfo const* /*spellInfo*/) override
1580 {
1581 return ValidateSpellInfo(
1582 {
1586 });
1587 }
1588
1589 void HandleDummy(SpellEffIndex /*effIndex*/)
1590 {
1591 if (Unit* target = GetHitUnit())
1592 {
1594 uint32 roll = urand(0, 99);
1595 if (roll < 2) // 2% for 30 sec self root (off-like chance unknown)
1597 else if (roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown)
1599
1600 GetCaster()->CastSpell(target, spellId, true);
1601 }
1602 }
1603
1604 void Register() override
1605 {
1607 }
1608};
1609
1610// http://www.wowhead.com/item=8529 Noggenfogger Elixir
1611// 16589 Noggenfogger Elixir
1613{
1617};
1618
1620{
1621 bool Load() override
1622 {
1623 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1624 }
1625
1626 bool Validate(SpellInfo const* /*spellInfo*/) override
1627 {
1628 return ValidateSpellInfo(
1629 {
1633 });
1634 }
1635
1636 void HandleDummy(SpellEffIndex /*effIndex*/)
1637 {
1638 Unit* caster = GetCaster();
1640 switch (urand(1, 3))
1641 {
1642 case 1: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1; break;
1643 case 2: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2; break;
1644 }
1645
1646 caster->CastSpell(caster, spellId, true);
1647 }
1648
1649 void Register() override
1650 {
1652 }
1653};
1654
1655// 29601 - Enlightenment (Pendant of the Violet Eye)
1657{
1658 bool CheckProc(ProcEventInfo& eventInfo)
1659 {
1660 if (Spell const* spell = eventInfo.GetProcSpell())
1661 {
1662 std::vector<SpellPowerCost> const& costs = spell->GetPowerCost();
1663 auto m = std::find_if(costs.begin(), costs.end(), [](SpellPowerCost const& cost) { return cost.Power == POWER_MANA && cost.Amount > 0; });
1664 if (m != costs.end())
1665 return true;
1666 }
1667
1668 return false;
1669 }
1670
1671 void Register() override
1672 {
1674 }
1675};
1676
1678{
1681
1682// 26467 - Persistent Shield
1684{
1685 bool Validate(SpellInfo const* /*spellInfo*/) override
1686 {
1688 }
1689
1690 bool CheckProc(ProcEventInfo& eventInfo)
1691 {
1692 return eventInfo.GetHealInfo() && eventInfo.GetHealInfo()->GetHeal();
1693 }
1694
1695 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1696 {
1697 Unit* caster = eventInfo.GetActor();
1698 Unit* target = eventInfo.GetProcTarget();
1699 int32 bp0 = CalculatePct(eventInfo.GetHealInfo()->GetHeal(), 15);
1700
1701 // Scarab Brooch does not replace stronger shields
1702 if (AuraEffect const* shield = target->GetAuraEffect(SPELL_PERSISTENT_SHIELD_TRIGGERED, EFFECT_0, caster->GetGUID()))
1703 if (shield->GetAmount() > bp0)
1704 return;
1705
1706 CastSpellExtraArgs args(aurEff);
1707 args.AddSpellBP0(bp0);
1708 caster->CastSpell(target, SPELL_PERSISTENT_SHIELD_TRIGGERED, args);
1709 }
1710
1711 void Register() override
1712 {
1715 }
1716};
1717
1719{
1720 SPELL_HEALTH_LINK = 37382
1722
1723// 37381 - Pet Healing
1724// Hunter T5 2P Bonus
1725// Warlock T5 2P Bonus
1727{
1728 bool Validate(SpellInfo const* /*spellInfo*/) override
1729 {
1731 }
1732
1733 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1734 {
1736 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
1737 if (!damageInfo || !damageInfo->GetDamage())
1738 return;
1739
1740 CastSpellExtraArgs args(aurEff);
1741 args.AddSpellBP0(CalculatePct(damageInfo->GetDamage(), aurEff->GetAmount()));
1742 eventInfo.GetActor()->CastSpell(nullptr, SPELL_HEALTH_LINK, args);
1743 }
1744
1745 void Register() override
1746 {
1748 }
1749};
1750
1751// 17512 - Piccolo of the Flaming Fire
1753{
1755 {
1756 PreventHitDefaultEffect(effIndex);
1757 if (Player* target = GetHitPlayer())
1758 target->HandleEmoteCommand(EMOTE_STATE_DANCE);
1759 }
1760
1761 void Register() override
1762 {
1764 }
1765};
1766
1768{
1769 SPELL_LIMITLESS_POWER = 45044
1771
1772// 45043 - Power Circle (Shifting Naaru Sliver)
1774{
1775 bool Validate(SpellInfo const* /*spellInfo*/) override
1776 {
1778 }
1779
1780 bool CheckCaster(Unit* target)
1781 {
1782 return target->GetGUID() == GetCasterGUID();
1783 }
1784
1785 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1786 {
1787 GetTarget()->CastSpell(nullptr, SPELL_LIMITLESS_POWER, true);
1789 buff->SetDuration(GetDuration());
1790 }
1791
1792 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1793 {
1795 }
1796
1797 void Register() override
1798 {
1800
1803 }
1804};
1805
1806// http://www.wowhead.com/item=6657 Savory Deviate Delight
1807// 8213 Savory Deviate Delight
1809{
1814};
1815
1817{
1818 bool Load() override
1819 {
1820 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1821 }
1822
1823 bool Validate(SpellInfo const* /*spellInfo*/) override
1824 {
1825 return ValidateSpellInfo(
1826 {
1831 });
1832 }
1833
1834 void HandleDummy(SpellEffIndex /*effIndex*/)
1835 {
1836 Unit* caster = GetCaster();
1837 uint32 spellId = 0;
1838 switch (urand(1, 2))
1839 {
1840 // Flip Out - ninja
1841 case 1: spellId = (caster->GetNativeGender() == GENDER_MALE ? SPELL_FLIP_OUT_MALE : SPELL_FLIP_OUT_FEMALE); break;
1842 // Yaaarrrr - pirate
1843 case 2: spellId = (caster->GetNativeGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break;
1844 }
1845 caster->CastSpell(caster, spellId, true);
1846 }
1847
1848 void Register() override
1849 {
1851 }
1852};
1853
1854// 48129 - Scroll of Recall
1855// 60320 - Scroll of Recall II
1856// 60321 - Scroll of Recall III
1858{
1862 SPELL_LOST = 60444,
1865};
1866
1868{
1869 bool Load() override
1870 {
1871 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1872 }
1873
1875 {
1876 Unit* caster = GetCaster();
1877 uint8 maxSafeLevel = 0;
1878 switch (GetSpellInfo()->Id)
1879 {
1880 case SPELL_SCROLL_OF_RECALL_I: // Scroll of Recall
1881 maxSafeLevel = 40;
1882 break;
1883 case SPELL_SCROLL_OF_RECALL_II: // Scroll of Recall II
1884 maxSafeLevel = 70;
1885 break;
1886 case SPELL_SCROLL_OF_RECALL_III: // Scroll of Recal III
1887 maxSafeLevel = 80;
1888 break;
1889 default:
1890 break;
1891 }
1892
1893 if (caster->GetLevel() > maxSafeLevel)
1894 {
1895 caster->CastSpell(caster, SPELL_LOST, true);
1896
1897 // ALLIANCE from 60323 to 60330 - HORDE from 60328 to 60335
1899 if (GetCaster()->ToPlayer()->GetTeam() == HORDE)
1901
1902 GetCaster()->CastSpell(GetCaster(), spellId + urand(0, 7), true);
1903
1904 PreventHitDefaultEffect(effIndex);
1905 }
1906 }
1907
1908 void Register() override
1909 {
1911 }
1912};
1913
1915{
1924 SPELL_SOUL_SPLIT_GOOD = 36901
1926
1927// 23442 - Dimensional Ripper - Everlook
1929{
1930 bool Validate(SpellInfo const* /*spellInfo*/) override
1931 {
1933 }
1934
1935 bool Load() override
1936 {
1937 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1938 }
1939
1940 void HandleScript(SpellEffIndex /* effIndex */)
1941 {
1942 int32 r = irand(0, 119);
1943 if (r <= 70) // 7/12 success
1944 return;
1945
1946 Unit* caster = GetCaster();
1947
1948 if (r < 100) // 4/12 evil twin
1949 caster->CastSpell(caster, SPELL_EVIL_TWIN, true);
1950 else // 1/12 fire
1951 caster->CastSpell(caster, SPELL_TRANSPORTER_MALFUNCTION_FIRE, true);
1952 }
1953
1954 void Register() override
1955 {
1957 }
1958};
1959
1960// 36941 - Ultrasafe Transporter: Toshley's Station
1962{
1963 bool Validate(SpellInfo const* /*spellInfo*/) override
1964 {
1965 return ValidateSpellInfo(
1966 {
1975 });
1976 }
1977
1978 bool Load() override
1979 {
1980 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1981 }
1982
1983 void HandleScript(SpellEffIndex /* effIndex */)
1984 {
1985 if (!roll_chance_i(50)) // 50% success
1986 return;
1987
1988 Unit* caster = GetCaster();
1989
1990 uint32 spellId = 0;
1991 switch (urand(0, 6))
1992 {
1993 case 0:
1995 break;
1996 case 1:
1998 break;
1999 case 2:
2000 spellId = SPELL_SOUL_SPLIT_EVIL;
2001 break;
2002 case 3:
2003 spellId = SPELL_SOUL_SPLIT_GOOD;
2004 break;
2005 case 4:
2006 if (caster->ToPlayer()->GetTeamId() == TEAM_ALLIANCE)
2007 spellId = SPELL_TRANSFORM_HORDE;
2008 else
2009 spellId = SPELL_TRANSFORM_ALLIANCE;
2010 break;
2011 case 5:
2013 break;
2014 case 6:
2015 spellId = SPELL_EVIL_TWIN;
2016 break;
2017 default:
2018 break;
2019 }
2020
2021 caster->CastSpell(caster, spellId, true);
2022 }
2023
2024 void Register() override
2025 {
2027 }
2028};
2029
2030// 36890 - Dimensional Ripper - Area 52
2032{
2033 bool Validate(SpellInfo const* /*spellInfo*/) override
2034 {
2035 return ValidateSpellInfo(
2036 {
2042 });
2043 }
2044
2045 bool Load() override
2046 {
2047 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2048 }
2049
2050 void HandleScript(SpellEffIndex /* effIndex */)
2051 {
2052 if (!roll_chance_i(50)) // 50% success
2053 return;
2054
2055 Unit* caster = GetCaster();
2056
2057 uint32 spellId = 0;
2058 switch (urand(0, 3))
2059 {
2060 case 0:
2062 break;
2063 case 1:
2064 spellId = SPELL_SOUL_SPLIT_EVIL;
2065 break;
2066 case 2:
2067 spellId = SPELL_SOUL_SPLIT_GOOD;
2068 break;
2069 case 3:
2070 if (caster->ToPlayer()->GetTeamId() == TEAM_ALLIANCE)
2071 spellId = SPELL_TRANSFORM_HORDE;
2072 else
2073 spellId = SPELL_TRANSFORM_ALLIANCE;
2074 break;
2075 default:
2076 break;
2077 }
2078
2079 caster->CastSpell(caster, spellId, true);
2080 }
2081
2082 void Register() override
2083 {
2085 }
2086};
2087
2088// 71169 - Shadow's Fate (Shadowmourne questline)
2090{
2092 NPC_SINDRAGOSA = 36853
2094
2096{
2097 bool CheckProc(ProcEventInfo& procInfo)
2098 {
2099 Unit* caster = procInfo.GetActor();
2100 if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
2101 return false;
2102
2103 Unit* target = procInfo.GetActionTarget();
2104 if (!target || target->GetTypeId() != TYPEID_UNIT || target->IsCritter() || (target->GetEntry() != NPC_SINDRAGOSA && target->IsSummon()))
2105 return false;
2106
2107 return true;
2108 }
2109
2110 void Register() override
2111 {
2113 }
2114};
2115
2117{
2119 {
2121
2122 Unit* caster = procInfo.GetActor();
2123 Unit* target = GetCaster();
2124 if (!caster || !target)
2125 return;
2126
2128 }
2129
2130 void Register() override
2131 {
2133 }
2134};
2135
2137{
2143};
2144
2145// 71903 - Item - Shadowmourne Legendary
2147{
2148 bool Validate(SpellInfo const* /*spellInfo*/) override
2149 {
2150 return ValidateSpellInfo(
2151 {
2155 });
2156 }
2157
2158 bool CheckProc(ProcEventInfo& eventInfo)
2159 {
2160 if (GetTarget()->HasAura(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF)) // cant collect shards while under effect of Chaos Bane buff
2161 return false;
2162 return eventInfo.GetProcTarget() && eventInfo.GetProcTarget()->IsAlive();
2163 }
2164
2165 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2166 {
2169
2170 // this can't be handled in AuraScript of SoulFragments because we need to know victim
2171 if (Aura* soulFragments = GetTarget()->GetAura(SPELL_SHADOWMOURNE_SOUL_FRAGMENT))
2172 {
2173 if (soulFragments->GetStackAmount() >= 10)
2174 {
2176 soulFragments->Remove();
2177 }
2178 }
2179 }
2180
2181 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
2182 {
2184 }
2185
2186 void Register() override
2187 {
2191 }
2192};
2193
2194// 71905 - Soul Fragment
2196{
2197 bool Validate(SpellInfo const* /*spellInfo*/) override
2198 {
2199 return ValidateSpellInfo(
2200 {
2204 });
2205 }
2206
2207 void OnStackChange(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
2208 {
2209 Unit* target = GetTarget();
2210 switch (GetStackAmount())
2211 {
2212 case 1:
2213 target->CastSpell(target, SPELL_SHADOWMOURNE_VISUAL_LOW, true);
2214 break;
2215 case 6:
2217 target->CastSpell(target, SPELL_SHADOWMOURNE_VISUAL_HIGH, true);
2218 break;
2219 case 10:
2221 target->CastSpell(target, SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF, true);
2222 break;
2223 default:
2224 break;
2225 }
2226 }
2227
2228 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
2229 {
2230 Unit* target = GetTarget();
2233 }
2234
2235 void Register() override
2236 {
2239 }
2240};
2241
2242// http://www.wowhead.com/item=7734 Six Demon Bag
2243// 14537 Six Demon Bag
2245{
2252};
2253
2255{
2256 bool Validate(SpellInfo const* /*spellInfo*/) override
2257 {
2258 return ValidateSpellInfo(
2259 {
2266 });
2267 }
2268
2269 void HandleDummy(SpellEffIndex /*effIndex*/)
2270 {
2271 Unit* caster = GetCaster();
2272 if (Unit* target = GetHitUnit())
2273 {
2274 uint32 spellId = 0;
2275 uint32 rand = urand(0, 99);
2276 if (rand < 25) // Fireball (25% chance)
2277 spellId = SPELL_FIREBALL;
2278 else if (rand < 50) // Frostball (25% chance)
2279 spellId = SPELL_FROSTBOLT;
2280 else if (rand < 70) // Chain Lighting (20% chance)
2281 spellId = SPELL_CHAIN_LIGHTNING;
2282 else if (rand < 80) // Polymorph (10% chance)
2283 {
2284 spellId = SPELL_POLYMORPH;
2285 if (urand(0, 100) <= 30) // 30% chance to self-cast
2286 target = caster;
2287 }
2288 else if (rand < 95) // Enveloping Winds (15% chance)
2289 spellId = SPELL_ENVELOPING_WINDS;
2290 else // Summon Felhund minion (5% chance)
2291 {
2293 target = caster;
2294 }
2295
2296 caster->CastSpell(target, spellId, GetCastItem());
2297 }
2298 }
2299
2300 void Register() override
2301 {
2303 }
2304};
2305
2307{
2310
2311// 59906 - Swift Hand of Justice Dummy
2313{
2314 bool Validate(SpellInfo const* /*spellInfo*/) override
2315 {
2317 }
2318
2319 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
2320 {
2322
2323 Unit* caster = eventInfo.GetActor();
2324 CastSpellExtraArgs args(aurEff);
2325 args.AddSpellBP0(caster->CountPctFromMaxHealth(aurEff->GetAmount()));
2326 caster->CastSpell(nullptr, SPELL_SWIFT_HAND_OF_JUSTICE_HEAL, args);
2327 }
2328
2329 void Register() override
2330 {
2332 }
2333};
2334
2335// 28862 - The Eye of Diminution
2337{
2338 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
2339 {
2340 int32 diff = GetUnitOwner()->GetLevel() - 60;
2341 if (diff > 0)
2342 amount += diff;
2343 }
2344
2345 void Register() override
2346 {
2348 }
2349};
2350
2351// http://www.wowhead.com/item=44012 Underbelly Elixir
2352// 59640 Underbelly Elixir
2354{
2358};
2359
2361{
2362 bool Load() override
2363 {
2364 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2365 }
2366 bool Validate(SpellInfo const* /*spellInfo*/) override
2367 {
2368 return ValidateSpellInfo(
2369 {
2373 });
2374 }
2375
2376 void HandleDummy(SpellEffIndex /*effIndex*/)
2377 {
2378 Unit* caster = GetCaster();
2380 switch (urand(1, 3))
2381 {
2382 case 1: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED1; break;
2383 case 2: spellId = SPELL_UNDERBELLY_ELIXIR_TRIGGERED2; break;
2384 }
2385 caster->CastSpell(caster, spellId, true);
2386 }
2387
2388 void Register() override
2389 {
2391 }
2392};
2393
2395{
2405};
2406
2408{
2418};
2419
2420// 126755 - Wormhole: Pandaria
2422{
2423 bool Validate(SpellInfo const* /*spellInfo*/) override
2424 {
2426 }
2427
2429 {
2430 PreventHitDefaultEffect(effIndex);
2432 GetCaster()->CastSpell(GetHitUnit(), spellId, true);
2433 }
2434
2435 void Register() override
2436 {
2438 }
2439};
2440
2441// 47776 - Roll 'dem Bones
2443{
2444 enum
2445 {
2446 TEXT_WORN_TROLL_DICE = 26152
2448
2449 bool Validate(SpellInfo const* /*spellInfo*/) override
2450 {
2451 if (!sBroadcastTextStore.LookupEntry(TEXT_WORN_TROLL_DICE))
2452 return false;
2453 return true;
2454 }
2455
2456 bool Load() override
2457 {
2458 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2459 }
2460
2461 void HandleScript(SpellEffIndex /*effIndex*/)
2462 {
2464
2465 static uint32 const minimum = 1;
2466 static uint32 const maximum = 6;
2467
2468 // roll twice
2469 GetCaster()->ToPlayer()->DoRandomRoll(minimum, maximum);
2470 GetCaster()->ToPlayer()->DoRandomRoll(minimum, maximum);
2471 }
2472
2473 void Register() override
2474 {
2476 }
2477};
2478
2480{
2484};
2485
2487{
2488 bool Validate(SpellInfo const* /*spell*/) override
2489 {
2490 return ValidateSpellInfo(
2491 {
2495 });
2496 }
2497
2499 {
2500 PreventHitDefaultEffect(effIndex);
2501 Unit* caster = GetCaster();
2502 if (Unit* target = GetHitUnit())
2503 {
2504 caster->CastSpell(caster, SPELL_AIR_RIFLE_HOLD_VISUAL, true);
2505 // needed because this spell shares GCD with its triggered spells (which must not be cast with triggered flag)
2506 if (Player* player = caster->ToPlayer())
2507 player->GetSpellHistory()->CancelGlobalCooldown(GetSpellInfo());
2508 if (urand(0, 4))
2509 caster->CastSpell(target, SPELL_AIR_RIFLE_SHOOT, false);
2510 else
2511 caster->CastSpell(caster, SPELL_AIR_RIFLE_SHOOT_SELF, false);
2512 }
2513 }
2514
2515 void Register() override
2516 {
2518 }
2519};
2520
2522{
2523 bool Load() override
2524 {
2525 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2526 }
2527
2529 {
2530 if (HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer()))
2531 {
2534 }
2535
2536 return SPELL_CAST_OK;
2537 }
2538
2539 void HandleScript(SpellEffIndex /*effIndex*/)
2540 {
2541 Player* caster = GetCaster()->ToPlayer();
2542 uint32 spellId = GetSpellInfo()->Id;
2543
2544 // learn random explicit discovery recipe (if any)
2545 if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
2546 caster->LearnSpell(discoveredSpellId, false);
2547 }
2548
2549 void Register() override
2550 {
2553 }
2554};
2555
2557{
2558 NPC_GHOUL = 28845,
2560};
2561
2563{
2565 {
2566 std::list<TempSummon*> ghouls;
2568 if (ghouls.size() >= MAX_GHOULS)
2569 {
2572 }
2573
2574 return SPELL_CAST_OK;
2575 }
2576
2577 void Register() override
2578 {
2580 }
2581};
2582
2584{
2588};
2589
2591{
2593 {
2594 Unit* caster = GetCaster();
2595 if (caster->FindNearestCreature(NPC_SOUTH_SINKHOLE, 30.0f, true) ||
2596 caster->FindNearestCreature(NPC_NORTHEAST_SINKHOLE, 30.0f, true) ||
2597 caster->FindNearestCreature(NPC_NORTHWEST_SINKHOLE, 30.0f, true))
2598 return SPELL_CAST_OK;
2599
2602 }
2603
2604 void Register() override
2605 {
2607 }
2608};
2609
2611{
2615};
2616
2618{
2619 bool Validate(SpellInfo const* /*spellInfo*/) override
2620 {
2621 return ValidateSpellInfo(
2622 {
2626 });
2627 }
2628
2629 void HandleDummy(SpellEffIndex /*effIndex*/)
2630 {
2632 Unit* caster = GetCaster();
2633 caster->CastSpell(caster, spellId, true);
2634 }
2635
2636 void Register() override
2637 {
2639 }
2640};
2641
2643{
2644 SOUND_ASHBRINGER_1 = 8906, // "I was pure once"
2645 SOUND_ASHBRINGER_2 = 8907, // "Fought for righteousness"
2646 SOUND_ASHBRINGER_3 = 8908, // "I was once called Ashbringer"
2647 SOUND_ASHBRINGER_4 = 8920, // "Betrayed by my order"
2648 SOUND_ASHBRINGER_5 = 8921, // "Destroyed by Kel'Thuzad"
2649 SOUND_ASHBRINGER_6 = 8922, // "Made to serve"
2650 SOUND_ASHBRINGER_7 = 8923, // "My son watched me die"
2651 SOUND_ASHBRINGER_8 = 8924, // "Crusades fed his rage"
2652 SOUND_ASHBRINGER_9 = 8925, // "Truth is unknown to him"
2653 SOUND_ASHBRINGER_10 = 8926, // "Scarlet Crusade is pure no longer"
2654 SOUND_ASHBRINGER_11 = 8927, // "Balnazzar's crusade corrupted my son"
2655 SOUND_ASHBRINGER_12 = 8928, // "Kill them all!"
2656};
2657
2659{
2660 bool Load() override
2661 {
2662 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2663 }
2664
2666 {
2667 PreventHitDefaultEffect(effIndex);
2668
2669 Player* player = GetCaster()->ToPlayer();
2672
2673 // Ashbringers effect (spellID 28441) retriggers every 5 seconds, with a chance of making it say one of the above 12 sounds
2674 if (urand(0, 60) < 1)
2675 player->PlayDirectSound(sound_id, player);
2676 }
2677
2678 void Register() override
2679 {
2681 }
2682};
2683
2685{
2692};
2693
2694// 58886 - Food
2696{
2697 void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
2698 {
2700 Unit* target = GetTarget();
2701 switch (urand(0, 5))
2702 {
2703 case 0:
2704 target->CastSpell(target, SPELL_WILD_MAGIC, true);
2705 break;
2706 case 1:
2707 target->CastSpell(target, SPELL_WELL_FED_1, true);
2708 break;
2709 case 2:
2710 target->CastSpell(target, SPELL_WELL_FED_2, true);
2711 break;
2712 case 3:
2713 target->CastSpell(target, SPELL_WELL_FED_3, true);
2714 break;
2715 case 4:
2716 target->CastSpell(target, SPELL_WELL_FED_4, true);
2717 break;
2718 case 5:
2719 target->CastSpell(target, SPELL_WELL_FED_5, true);
2720 break;
2721 }
2722 }
2723
2724 void Register() override
2725 {
2727 }
2728};
2729
2731{
2734};
2735
2737{
2738 bool Load() override
2739 {
2740 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2741 }
2742
2743 bool Validate(SpellInfo const* /*spell*/) override
2744 {
2745 return ValidateSpellInfo(
2746 {
2749 });
2750 }
2751
2752 void HandleDummy(SpellEffIndex /* effIndex */)
2753 {
2754 Unit* caster = GetCaster();
2756 }
2757
2758 void Register() override
2759 {
2761 }
2762};
2763
2765{
2768};
2769
2771{
2772 bool Validate(SpellInfo const* /*spell*/) override
2773 {
2775 }
2776
2777 void HandleDummy(SpellEffIndex /* effIndex */)
2778 {
2779 Unit* caster = GetCaster();
2780 if (Item* castItem = GetCastItem())
2781 {
2782 if (roll_chance_i(86)) // Nigh-Invulnerability - success
2783 caster->CastSpell(caster, SPELL_NIGH_INVULNERABILITY, castItem);
2784 else // Complete Vulnerability - backfire in 14% casts
2785 caster->CastSpell(caster, SPELL_COMPLETE_VULNERABILITY, castItem);
2786 }
2787 }
2788
2789 void Register() override
2790 {
2792 }
2793};
2794
2796{
2799};
2800
2802{
2803 bool Validate(SpellInfo const* /*spell*/) override
2804 {
2806 }
2807
2808 void HandleDummy(SpellEffIndex /* effIndex */)
2809 {
2810 if (GetCastItem() && GetHitUnit())
2812 }
2813
2814 void Register() override
2815 {
2817 }
2818};
2819
2821{
2824};
2825
2827{
2828 bool Load() override
2829 {
2830 return (GetCaster()->GetAreaId() == 3900 || GetCaster()->GetAreaId() == 3742);
2831 }
2832 bool Validate(SpellInfo const* /*spell*/) override
2833 {
2835 }
2836
2837 void HandleDummy(SpellEffIndex /* effIndex */)
2838 {
2839 Unit* caster = GetCaster();
2840 switch (caster->GetAreaId())
2841 {
2842 case 3900:
2843 caster->CastSpell(caster, SPELL_SOCRETHAR_TO_SEAT, true);
2844 break;
2845 case 3742:
2846 caster->CastSpell(caster, SPELL_SOCRETHAR_FROM_SEAT, true);
2847 break;
2848 default:
2849 return;
2850 }
2851 }
2852
2853 void Register() override
2854 {
2856 }
2857};
2858
2860{
2864};
2865
2867{
2868 bool Validate(SpellInfo const* /*spell*/) override
2869 {
2871 sObjectMgr->GetCreatureTemplate(NPC_ABYSSAL_FLAMEBRINGER) &&
2872 sObjectMgr->GetQuestTemplate(QUEST_SUPER_HOT_STEW);
2873 }
2874
2875 bool Load() override
2876 {
2877 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2878 }
2879
2880 void HandleDummy(SpellEffIndex /* effIndex */)
2881 {
2882 Unit* player = GetCaster();
2883 player->CastSpell(player, SPELL_CREATE_DEMON_BROILED_SURPRISE, false);
2884 }
2885
2887 {
2888 Player* player = GetCaster()->ToPlayer();
2891
2892 if (Creature* creature = player->FindNearestCreature(NPC_ABYSSAL_FLAMEBRINGER, 10, false))
2893 if (creature->isDead())
2894 return SPELL_CAST_OK;
2895 return SPELL_FAILED_NOT_HERE;
2896 }
2897
2898 void Register() override
2899 {
2902 }
2903};
2904
2906{
2908};
2909
2911{
2912 bool Validate(SpellInfo const* /*spell*/) override
2913 {
2915 }
2916
2917 void HandleDummy(SpellEffIndex /* effIndex */)
2918 {
2919 Unit* caster = GetCaster();
2920 if (GetHitCreature())
2921 {
2923
2924 //cast spell Raptor Capture Credit
2925 caster->CastSpell(caster, SPELL_RAPTOR_CAPTURE_CREDIT, true);
2926 }
2927 }
2928
2929 void Register() override
2930 {
2932 }
2933};
2934
2936{
2940
2942{
2943 bool Validate(SpellInfo const* /*spell*/) override
2944 {
2945 if (!sObjectMgr->GetCreatureTemplate(NPC_LEVIROTH))
2946 return false;
2947 return true;
2948 }
2949
2950 void HandleDummy(SpellEffIndex /*effIndex*/)
2951 {
2952 if (Creature* target = GetHitCreature())
2953 if (target->GetEntry() == NPC_LEVIROTH && !target->HealthBelowPct(95))
2954 {
2955 target->CastSpell(target, SPELL_LEVIROTH_SELF_IMPALE, true);
2956 target->ResetPlayerDamageReq();
2957 }
2958 }
2959
2960 void Register() override
2961 {
2963 }
2964};
2965
2967{
2969 SPELL_GIFT_OF_LIFE_2 = 23783
2971
2972// 23725 - Gift of Life
2974{
2975 bool Validate(SpellInfo const* /*spellInfo*/) override
2976 {
2978 }
2979
2980 void HandleDummy(SpellEffIndex /*effIndex*/)
2981 {
2982 Unit* caster = GetCaster();
2983 caster->CastSpell(caster, SPELL_GIFT_OF_LIFE_1, true);
2984 caster->CastSpell(caster, SPELL_GIFT_OF_LIFE_2, true);
2985 }
2986
2987 void Register() override
2988 {
2990 }
2991};
2992
2994{
2998};
2999
3001{
3002 bool Load() override
3003 {
3004 if (!GetCastItem())
3005 return false;
3006 return true;
3007 }
3008
3009 bool Validate(SpellInfo const* /*spell*/) override
3010 {
3012 }
3013
3014 void HandleDummy(SpellEffIndex /* effIndex */)
3015 {
3016 Unit* caster = GetCaster();
3017 bool success = true;
3018 if (!caster->GetMap()->IsDungeon())
3019 success = roll_chance_i(95); // nitro boosts can only fail in flying-enabled locations on 3.3.5
3021 }
3022
3023 void Register() override
3024 {
3026 }
3027};
3028
3030{
3031 bool Validate(SpellInfo const* /*spell*/) override
3032 {
3034 }
3035
3036 void HandleApply(AuraEffect const* /*effect*/, AuraEffectHandleModes /*mode*/)
3037 {
3039 }
3040
3042 {
3044 float curZ = GetTarget()->GetPositionZ();
3045 if (curZ < lastZ)
3046 {
3047 if (roll_chance_i(80)) // we don't have enough sniffs to verify this, guesstimate
3049 GetAura()->Remove();
3050 }
3051 else
3052 lastZ = curZ;
3053 }
3054
3055 void Register() override
3056 {
3059 }
3060
3062};
3063
3065{
3067};
3068
3070{
3071 bool Load() override
3072 {
3073 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
3074 }
3075
3076 bool Validate(SpellInfo const* /*spell*/) override
3077 {
3079 }
3080
3081 void HandleDummy(SpellEffIndex /* effIndex */)
3082 {
3083 Player* caster = GetCaster()->ToPlayer();
3084 if (Battleground* bg = caster->GetBattleground())
3085 bg->EventPlayerDroppedFlag(caster);
3086
3088 caster->CastSpell(caster, SPELL_ROCKET_BOOTS_PROC, true);
3089 }
3090
3092 {
3093 if (GetCaster()->IsInWater())
3095 return SPELL_CAST_OK;
3096 }
3097
3098 void Register() override
3099 {
3102 }
3103};
3104
3105// 67489 - Runic Healing Injector
3107{
3108 bool Load() override
3109 {
3110 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
3111 }
3112
3113 void HandleHeal(SpellEffIndex /*effIndex*/)
3114 {
3115 if (Player* caster = GetCaster()->ToPlayer())
3116 if (caster->HasSkill(SKILL_ENGINEERING))
3117 SetHitHeal(GetHitHeal() * 1.25f);
3118 }
3119
3120 void Register() override
3121 {
3123 }
3124};
3125
3127{
3130};
3131
3133{
3134 bool Validate(SpellInfo const* /*spell*/) override
3135 {
3137 }
3138
3139 void HandleDummy(SpellEffIndex /* effIndex */)
3140 {
3141 Unit* caster = GetCaster();
3142 if (Aura* aura = caster->GetAura(SPELL_PYGMY_OIL_PYGMY_AURA))
3143 aura->RefreshDuration();
3144 else
3145 {
3146 aura = caster->GetAura(SPELL_PYGMY_OIL_SMALLER_AURA);
3147 if (!aura || aura->GetStackAmount() < 5 || !roll_chance_i(50))
3148 caster->CastSpell(caster, SPELL_PYGMY_OIL_SMALLER_AURA, true);
3149 else
3150 {
3151 aura->Remove();
3152 caster->CastSpell(caster, SPELL_PYGMY_OIL_PYGMY_AURA, true);
3153 }
3154 }
3155 }
3156
3157 void Register() override
3158 {
3160 }
3161};
3162
3164{
3165 void HandleDummy(SpellEffIndex /* effIndex */)
3166 {
3167 Unit* caster = GetCaster();
3168 caster->SetFacingTo(frand(0.0f, 2.0f * float(M_PI)));
3169 }
3170
3171 void Register() override
3172 {
3174 }
3175};
3176
3178{
3183};
3184
3186{
3187 bool Load() override
3188 {
3189 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
3190 }
3191
3192 bool Validate(SpellInfo const* /*spell*/) override
3193 {
3195 sObjectMgr->GetQuestTemplate(QUEST_CHICKEN_PARTY) &&
3196 sObjectMgr->GetQuestTemplate(QUEST_FLOWN_THE_COOP);
3197 }
3198
3199 void HandleDummy(SpellEffIndex /* effIndex */)
3200 {
3201 Player* caster = GetCaster()->ToPlayer();
3202 if (Unit* target = GetHitUnit())
3203 {
3205 {
3206 caster->CastSpell(caster, SPELL_CAPTURE_CHICKEN_ESCAPE, true);
3207 target->KillSelf();
3208 }
3209 }
3210 }
3211
3212 void Register() override
3213 {
3215 }
3216};
3217
3219{
3220 void HandleDummy(SpellEffIndex /*effIndex*/)
3221 {
3222 if (Creature* target = GetHitCreature())
3223 if (target->isDead())
3224 target->DespawnOrUnsummon();
3225 }
3226
3227 void Register() override
3228 {
3230 }
3231};
3232
3234{
3236};
3238{
3239 void HandleDummy(SpellEffIndex /*effIndex*/)
3240 {
3241 if (GetHitUnit())
3243 }
3244
3245 void Register() override
3246 {
3248 }
3249};
3250
3252{
3255
3259
3260// Item - 49310: Purified Shard of the Scale
3261// 69755 - Purified Shard of the Scale - Equip Effect
3262
3263// Item - 49488: Shiny Shard of the Scale
3264// 69739 - Shiny Shard of the Scale - Equip Effect
3265template <uint32 HealProcSpellId, uint32 DamageProcSpellId>
3267{
3268 public:
3269 spell_item_shard_of_the_scale(char const* ScriptName) : SpellScriptLoader(ScriptName) { }
3270
3271 template <uint32 HealProc, uint32 DamageProc>
3273 {
3274 bool Validate(SpellInfo const* /*spellInfo*/) override
3275 {
3276 return ValidateSpellInfo(
3277 {
3278 HealProc,
3279 DamageProc
3280 });
3281 }
3282
3283 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
3284 {
3286 Unit* caster = eventInfo.GetActor();
3287 Unit* target = eventInfo.GetProcTarget();
3288
3289 if (eventInfo.GetTypeMask() & PROC_FLAG_DEAL_HELPFUL_SPELL)
3290 caster->CastSpell(target, HealProc, aurEff);
3291
3292 if (eventInfo.GetTypeMask() & PROC_FLAG_DEAL_HARMFUL_SPELL)
3293 caster->CastSpell(target, DamageProc, aurEff);
3294 }
3295
3296 void Register() override
3297 {
3299 }
3300 };
3301
3302 AuraScript* GetAuraScript() const override
3303 {
3305 }
3306};
3307
3309{
3314};
3315
3317{
3318 bool Validate(SpellInfo const* /*spellInfo*/) override
3319 {
3320 return ValidateSpellInfo(
3321 {
3326 });
3327 }
3328
3329 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
3330 {
3332
3333 Unit* caster = eventInfo.GetActor();
3334
3335 switch (caster->GetClass())
3336 {
3337 case CLASS_DRUID:
3338 caster->CastSpell(caster, SPELL_SOUL_PRESERVER_DRUID, aurEff);
3339 break;
3340 case CLASS_PALADIN:
3341 caster->CastSpell(caster, SPELL_SOUL_PRESERVER_PALADIN, aurEff);
3342 break;
3343 case CLASS_PRIEST:
3344 caster->CastSpell(caster, SPELL_SOUL_PRESERVER_PRIEST, aurEff);
3345 break;
3346 case CLASS_SHAMAN:
3347 caster->CastSpell(caster, SPELL_SOUL_PRESERVER_SHAMAN, aurEff);
3348 break;
3349 default:
3350 break;
3351 }
3352 }
3353
3354 void Register() override
3355 {
3357 }
3358};
3359
3361{
3362 SPELL_LIGHTS_WRATH = 45479, // Light's Wrath if Exalted by Aldor
3363 SPELL_ARCANE_BOLT = 45429, // Arcane Bolt if Exalted by Scryers
3364
3365 SPELL_LIGHTS_STRENGTH = 45480, // Light's Strength if Exalted by Aldor
3366 SPELL_ARCANE_STRIKE = 45428, // Arcane Strike if Exalted by Scryers
3367
3368 SPELL_LIGHTS_WARD = 45432, // Light's Ward if Exalted by Aldor
3369 SPELL_ARCANE_INSIGHT = 45431, // Arcane Insight if Exalted by Scryers
3370
3371 SPELL_LIGHTS_SALVATION = 45478, // Light's Salvation if Exalted by Aldor
3372 SPELL_ARCANE_SURGE = 45430, // Arcane Surge if Exalted by Scryers
3373
3375 FACTION_SCRYERS = 934
3377
3378// Item - 34678: Shattered Sun Pendant of Acumen
3379// 45481 - Sunwell Exalted Caster Neck
3380
3381// Item - 34679: Shattered Sun Pendant of Might
3382// 45482 - Sunwell Exalted Melee Neck
3383
3384// Item - 34680: Shattered Sun Pendant of Resolve
3385// 45483 - Sunwell Exalted Tank Neck
3386
3387// Item - 34677: Shattered Sun Pendant of Restoration
3388// 45484 Sunwell Exalted Healer Neck
3389template <uint32 AldorSpellId, uint32 ScryersSpellId>
3391{
3392 public:
3393 spell_item_sunwell_neck(char const* ScriptName) : SpellScriptLoader(ScriptName) { }
3394
3395 template <uint32 Aldors, uint32 Scryers>
3397 {
3398 bool Validate(SpellInfo const* /*spellInfo*/) override
3399 {
3400 return ValidateSpellInfo({ Aldors, Scryers }) &&
3401 sFactionStore.LookupEntry(FACTION_ALDOR) &&
3402 sFactionStore.LookupEntry(FACTION_SCRYERS);
3403 }
3404
3405 bool CheckProc(ProcEventInfo& eventInfo)
3406 {
3407 if (eventInfo.GetActor()->GetTypeId() != TYPEID_PLAYER)
3408 return false;
3409 return true;
3410 }
3411
3412 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
3413 {
3415 Player* player = eventInfo.GetActor()->ToPlayer();
3416 Unit* target = eventInfo.GetProcTarget();
3417
3418 // Aggression checks are in the spell system... just cast and forget
3420 player->CastSpell(target, Aldors, aurEff);
3421
3423 player->CastSpell(target, Scryers, aurEff);
3424 }
3425
3426 void Register() override
3427 {
3430 }
3431 };
3432
3433 AuraScript* GetAuraScript() const override
3434 {
3436 }
3437};
3438
3440{
3442 {
3443 if (Player* target = GetHitUnit()->ToPlayer())
3444 {
3445 target->HandleEmoteCommand(EMOTE_ONESHOT_TRAIN);
3446 if (EmotesTextSoundEntry const* soundEntry = sDB2Manager.GetTextSoundEmoteFor(TEXT_EMOTE_TRAIN, target->GetRace(), target->GetNativeGender(), target->GetClass()))
3447 target->PlayDistanceSound(soundEntry->SoundID);
3448 }
3449 }
3450
3451 void HandleTargets(std::list<WorldObject*>& targetList)
3452 {
3453 targetList.remove_if([](WorldObject const* obj) { return obj->GetTypeId() != TYPEID_PLAYER; });
3454 }
3455
3456 void Register() override
3457 {
3460 }
3461};
3462
3464{
3472
3474{
3475 bool Validate(SpellInfo const* /*spellInfo*/) override
3476 {
3477 return ValidateSpellInfo(
3478 {
3483 });
3484 }
3485
3486 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
3487 {
3489
3490 Unit* caster = eventInfo.GetActor();
3491 float str = caster->GetStat(STAT_STRENGTH);
3492 float agi = caster->GetStat(STAT_AGILITY);
3493
3494 switch (aurEff->GetId())
3495 {
3497 {
3498 if (str > agi)
3499 caster->CastSpell(caster, SPELL_DEATH_CHOICE_NORMAL_STRENGTH, aurEff);
3500 else
3501 caster->CastSpell(caster, SPELL_DEATH_CHOICE_NORMAL_AGILITY, aurEff);
3502 break;
3503 }
3505 {
3506 if (str > agi)
3507 caster->CastSpell(caster, SPELL_DEATH_CHOICE_HEROIC_STRENGTH, aurEff);
3508 else
3509 caster->CastSpell(caster, SPELL_DEATH_CHOICE_HEROIC_AGILITY, aurEff);
3510 break;
3511 }
3512 default:
3513 break;
3514 }
3515 }
3516
3517 void Register() override
3518 {
3520 }
3521};
3522
3524{
3525 SPELL_LIGHTNING_CAPACITOR_AURA = 37657, // Lightning Capacitor
3528 SPELL_THUNDER_CAPACITOR_AURA = 54841, // Thunder Capacitor
3531 SPELL_TOC25_CASTER_TRINKET_NORMAL_AURA = 67712, // Item - Coliseum 25 Normal Caster Trinket
3534 SPELL_TOC25_CASTER_TRINKET_HEROIC_AURA = 67758, // Item - Coliseum 25 Heroic Caster Trinket
3537};
3538
3540{
3541public:
3542 spell_item_trinket_stack(char const* scriptName, uint32 stackSpell, uint32 triggerSpell) : SpellScriptLoader(scriptName),
3543 _stackSpell(stackSpell), _triggerSpell(triggerSpell)
3544 {
3545 }
3546
3548 {
3549 public:
3550 spell_item_trinket_stack_AuraScript(uint32 stackSpell, uint32 triggerSpell) : _stackSpell(stackSpell), _triggerSpell(triggerSpell)
3551 {
3552 }
3553
3554 private:
3555 bool Validate(SpellInfo const* /*spellInfo*/) override
3556 {
3558 }
3559
3560 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
3561 {
3563
3564 Unit* caster = eventInfo.GetActor();
3565
3566 caster->CastSpell(caster, _stackSpell, aurEff); // cast the stack
3567
3568 Aura* dummy = caster->GetAura(_stackSpell); // retrieve aura
3569
3570 //dont do anything if it's not the right amount of stacks;
3571 if (!dummy || dummy->GetStackAmount() < aurEff->GetAmount())
3572 return;
3573
3574 // if right amount, remove the aura and cast real trigger
3576 if (Unit* target = eventInfo.GetActionTarget())
3577 caster->CastSpell(target, _triggerSpell, aurEff);
3578 }
3579
3580 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
3581 {
3583 }
3584
3585 void Register() override
3586 {
3589 }
3590
3593 };
3594
3595 AuraScript* GetAuraScript() const override
3596 {
3598 }
3599
3600private:
3603};
3604
3605// 57345 - Darkmoon Card: Greatness
3607{
3612};
3613
3615{
3616 bool Validate(SpellInfo const* /*spellInfo*/) override
3617 {
3618 return ValidateSpellInfo(
3619 {
3624 });
3625 }
3626
3627 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
3628 {
3630
3631 Unit* caster = eventInfo.GetActor();
3632 float str = caster->GetStat(STAT_STRENGTH);
3633 float agi = caster->GetStat(STAT_AGILITY);
3634 float intl = caster->GetStat(STAT_INTELLECT);
3635 float vers = 0.0f; // caster->GetStat(STAT_VERSATILITY);
3636 float stat = 0.0f;
3637
3638 uint32 spellTrigger = SPELL_DARKMOON_CARD_STRENGTH;
3639
3640 if (str > stat)
3641 {
3642 spellTrigger = SPELL_DARKMOON_CARD_STRENGTH;
3643 stat = str;
3644 }
3645
3646 if (agi > stat)
3647 {
3648 spellTrigger = SPELL_DARKMOON_CARD_AGILITY;
3649 stat = agi;
3650 }
3651
3652 if (intl > stat)
3653 {
3654 spellTrigger = SPELL_DARKMOON_CARD_INTELLECT;
3655 stat = intl;
3656 }
3657
3658 if (vers > stat)
3659 {
3660 spellTrigger = SPELL_DARKMOON_CARD_VERSATILITY;
3661 stat = vers;
3662 }
3663
3664 caster->CastSpell(caster, spellTrigger, aurEff);
3665 }
3666
3667 void Register() override
3668 {
3670 }
3671};
3672
3673// 27522,40336 - Mana Drain
3675{
3679
3681{
3682 bool Validate(SpellInfo const* /*spellInfo*/) override
3683 {
3684 return ValidateSpellInfo(
3685 {
3688 });
3689 }
3690
3691 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
3692 {
3694
3695 Unit* caster = eventInfo.GetActor();
3696 Unit* target = eventInfo.GetActionTarget();
3697
3698 if (caster->IsAlive())
3699 caster->CastSpell(caster, SPELL_MANA_DRAIN_ENERGIZE, aurEff);
3700
3701 if (target && target->IsAlive())
3702 caster->CastSpell(target, SPELL_MANA_DRAIN_LEECH, aurEff);
3703 }
3704
3705 void Register() override
3706 {
3708 }
3709};
3710
3712{
3714
3715 EMOTE_PLANTS_FLAG = 28008
3717
3718// 51640 - Taunt Flag Targeting
3720{
3721 bool Validate(SpellInfo const* /*spellInfo*/) override
3722 {
3723 return ValidateSpellInfo({ SPELL_TAUNT_FLAG }) &&
3725 }
3726
3727 void FilterTargets(std::list<WorldObject*>& targets)
3728 {
3729 targets.remove_if([](WorldObject* obj) -> bool
3730 {
3731 return obj->GetTypeId() != TYPEID_PLAYER && obj->GetTypeId() != TYPEID_CORPSE;
3732 });
3733
3734 if (targets.empty())
3735 {
3737 return;
3738 }
3739
3741 }
3742
3743 void HandleDummy(SpellEffIndex /*effIndex*/)
3744 {
3745 // we *really* want the unit implementation here
3746 // it sends a packet like seen on sniff
3747 GetCaster()->Unit::TextEmote(EMOTE_PLANTS_FLAG, GetHitUnit(), false);
3748
3750 }
3751
3752 void Register() override
3753 {
3756 }
3757};
3758
3760{
3765
3766// 29830 - Mirren's Drinking Hat
3768{
3770 {
3771 uint32 spellId = 0;
3772 switch (urand(1, 6))
3773 {
3774 case 1:
3775 case 2:
3776 case 3:
3777 spellId = SPELL_LOCH_MODAN_LAGER; break;
3778 case 4:
3779 case 5:
3780 spellId = SPELL_STOUTHAMMER_LITE; break;
3781 case 6:
3782 spellId = SPELL_AERIE_PEAK_PALE_ALE; break;
3783 default:
3784 return;
3785 }
3786
3787 Unit* caster = GetCaster();
3788 caster->CastSpell(caster, spellId, GetSpell());
3789 }
3790
3791 void Register() override
3792 {
3794 }
3795};
3796
3797// 13180 - Gnomish Mind Control Cap
3799{
3803 SPELL_DULLARD = 67809
3805
3807{
3808 bool Load() override
3809 {
3810 if (!GetCastItem())
3811 return false;
3812 return true;
3813 }
3814
3815 bool Validate(SpellInfo const* /*spell*/) override
3816 {
3818 }
3819
3820 void HandleDummy(SpellEffIndex /* effIndex */)
3821 {
3822 Unit* caster = GetCaster();
3823 if (Unit* target = GetHitUnit())
3824 {
3827 else
3828 target->CastSpell(caster, SPELL_GNOMISH_MIND_CONTROL_CAP, true); // backfire - 5% chance
3829 }
3830 }
3831
3832 void Register() override
3833 {
3835 }
3836};
3837
3838// 8344 - Universal Remote (Gnomish Universal Remote)
3840{
3843 SPELL_TARGET_LOCK = 8347
3845
3847{
3848 bool Load() override
3849 {
3850 if (!GetCastItem())
3851 return false;
3852 return true;
3853 }
3854
3855 bool Validate(SpellInfo const* /*spellInfo*/) override
3856 {
3858 }
3859
3860 void HandleDummy(SpellEffIndex /*effIndex*/)
3861 {
3862 if (Unit* target = GetHitUnit())
3863 {
3864 uint8 chance = urand(0, 99);
3865 if (chance < 15)
3867 else if (chance < 25)
3869 else
3871 }
3872 }
3873
3874 void Register() override
3875 {
3877 }
3878};
3879
3881{
3885
3886// Item - 19950: Zandalarian Hero Charm
3887// 24658 - Unstable Power
3888
3889// Item - 19949: Zandalarian Hero Medallion
3890// 24661 - Restless Strength
3892{
3893 public:
3894 spell_item_zandalarian_charm(char const* ScriptName, uint32 SpellId) : SpellScriptLoader(ScriptName), _spellId(SpellId) { }
3895
3897 {
3900
3901 bool Validate(SpellInfo const* /*spellInfo*/) override
3902 {
3903 return ValidateSpellInfo({ _spellId });
3904 }
3905
3906 bool CheckProc(ProcEventInfo& eventInfo)
3907 {
3908 if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
3909 if (spellInfo->Id != m_scriptSpellId)
3910 return true;
3911
3912 return false;
3913 }
3914
3915 void HandleStackDrop(AuraEffect* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
3916 {
3919 }
3920
3921 void Register() override
3922 {
3925 }
3926
3928 };
3929
3930 AuraScript* GetAuraScript() const override
3931 {
3933 }
3934
3935 private:
3937};
3938
3940{
3941 bool Validate(SpellInfo const* spellInfo) override
3942 {
3943 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
3944 }
3945
3946 bool Load() override
3947 {
3948 return GetOwner()->GetTypeId() == TYPEID_PLAYER;
3949 }
3950
3951 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
3952 {
3953 if (Item* artifact = GetOwner()->ToPlayer()->GetItemByGuid(GetAura()->GetCastItemGUID()))
3954 amount = GetEffectInfo(EFFECT_1).BasePoints * artifact->GetTotalPurchasedArtifactPowers() / 100;
3955 }
3956
3957 void Register() override
3958 {
3960 }
3961};
3962
3964{
3965 bool Validate(SpellInfo const* spellInfo) override
3966 {
3967 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
3968 }
3969
3970 bool Load() override
3971 {
3972 return GetOwner()->GetTypeId() == TYPEID_PLAYER;
3973 }
3974
3975 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
3976 {
3977 if (Item* artifact = GetOwner()->ToPlayer()->GetItemByGuid(GetAura()->GetCastItemGUID()))
3978 amount = GetSpellInfo()->GetEffect(EFFECT_1).BasePoints * artifact->GetTotalPurchasedArtifactPowers() / 100;
3979 }
3980
3981 void Register() override
3982 {
3984 }
3985};
3986
3988{
3994 SPELL_BRUTAL_KINSHIP_2 = 145738
3996
3997// 28200 - Ascendance
3999{
4000 bool Validate(SpellInfo const* /*spell*/) override
4001 {
4003 }
4004
4005 void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
4006 {
4008 }
4009
4010 void Register() override
4011 {
4013 }
4014};
4015
4016// 29602 - Jom Gabbar
4018{
4019 bool Validate(SpellInfo const* /*spell*/) override
4020 {
4022 }
4023
4024 void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
4025 {
4027 }
4028
4029 void Register() override
4030 {
4032 }
4033};
4034
4035// 45040 - Battle Trance
4037{
4038 bool Validate(SpellInfo const* /*spell*/) override
4039 {
4041 }
4042
4043 void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
4044 {
4046 }
4047
4048 void Register() override
4049 {
4051 }
4052};
4053
4054// 90900 - World-Queller Focus
4056{
4057 bool Validate(SpellInfo const* /*spell*/) override
4058 {
4060 }
4061
4062 void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
4063 {
4065 }
4066
4067 void Register() override
4068 {
4070 }
4071};
4072
4073// 118089 - Azure Water Strider
4074// 127271 - Crimson Water Strider
4075// 127272 - Orange Water Strider
4076// 127274 - Jade Water Strider
4077// 127278 - Golden Water Strider
4079{
4080 bool Validate(SpellInfo const* spellInfo) override
4081 {
4082 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
4083 }
4084
4085 void OnRemove(AuraEffect const* /*effect*/, AuraEffectHandleModes /*mode*/)
4086 {
4088 }
4089
4090 void Register() override
4091 {
4093 }
4094};
4095
4096// 144671 - Brutal Kinship
4097// 145738 - Brutal Kinship
4099{
4100 bool Validate(SpellInfo const* /*spell*/) override
4101 {
4103 }
4104
4105 void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
4106 {
4108 }
4109
4110 void Register() override
4111 {
4113 }
4114};
4115
4116// 45051 - Mad Alchemist's Potion (34440)
4118{
4120 {
4121 std::vector<uint32> availableElixirs =
4122 {
4123 // Battle Elixirs
4124 33720, // Onslaught Elixir (28102)
4125 54452, // Adept's Elixir (28103)
4126 33726, // Elixir of Mastery (28104)
4127 28490, // Elixir of Major Strength (22824)
4128 28491, // Elixir of Healing Power (22825)
4129 28493, // Elixir of Major Frost Power (22827)
4130 54494, // Elixir of Major Agility (22831)
4131 28501, // Elixir of Major Firepower (22833)
4132 28503,// Elixir of Major Shadow Power (22835)
4133 38954, // Fel Strength Elixir (31679)
4134 // Guardian Elixirs
4135 39625, // Elixir of Major Fortitude (32062)
4136 39626, // Earthen Elixir (32063)
4137 39627, // Elixir of Draenic Wisdom (32067)
4138 39628, // Elixir of Ironskin (32068)
4139 28502, // Elixir of Major Defense (22834)
4140 28514, // Elixir of Empowerment (22848)
4141 // Other
4142 28489, // Elixir of Camouflage (22823)
4143 28496 // Elixir of the Searching Eye (22830)
4144 };
4145
4146 Unit* target = GetCaster();
4147
4148 if (target->GetPowerType() == POWER_MANA)
4149 availableElixirs.push_back(28509); // Elixir of Major Mageblood (22840)
4150
4151 uint32 chosenElixir = Trinity::Containers::SelectRandomContainerElement(availableElixirs);
4152
4153 bool useElixir = true;
4154
4155 SpellGroup chosenSpellGroup = SPELL_GROUP_NONE;
4156 if (sSpellMgr->IsSpellMemberOfSpellGroup(chosenElixir, SPELL_GROUP_ELIXIR_BATTLE))
4157 chosenSpellGroup = SPELL_GROUP_ELIXIR_BATTLE;
4158 if (sSpellMgr->IsSpellMemberOfSpellGroup(chosenElixir, SPELL_GROUP_ELIXIR_GUARDIAN))
4159 chosenSpellGroup = SPELL_GROUP_ELIXIR_GUARDIAN;
4160 // If another spell of the same group is already active the elixir should not be cast
4161 if (chosenSpellGroup != SPELL_GROUP_NONE)
4162 {
4163 Unit::AuraApplicationMap const& auraMap = target->GetAppliedAuras();
4164 for (auto itr = auraMap.begin(); itr != auraMap.end(); ++itr)
4165 {
4166 uint32 spellId = itr->second->GetBase()->GetId();
4167 if (sSpellMgr->IsSpellMemberOfSpellGroup(spellId, chosenSpellGroup) && spellId != chosenElixir)
4168 {
4169 useElixir = false;
4170 break;
4171 }
4172 }
4173 }
4174
4175 if (useElixir)
4176 target->CastSpell(target, chosenElixir, GetCastItem());
4177 }
4178
4179 void Register() override
4180 {
4182 }
4183};
4184
4185// 53750 - Crazy Alchemist's Potion (40077)
4187{
4189 {
4190 std::vector<uint32> availableElixirs =
4191 {
4192 43185, // Runic Healing Potion (33447)
4193 53750, // Crazy Alchemist's Potion (40077)
4194 53761, // Powerful Rejuvenation Potion (40087)
4195 53762, // Indestructible Potion (40093)
4196 53908, // Potion of Speed (40211)
4197 53909, // Potion of Wild Magic (40212)
4198 53910, // Mighty Arcane Protection Potion (40213)
4199 53911, // Mighty Fire Protection Potion (40214)
4200 53913, // Mighty Frost Protection Potion (40215)
4201 53914, // Mighty Nature Protection Potion (40216)
4202 53915 // Mighty Shadow Protection Potion (40217)
4203 };
4204
4205 Unit* target = GetCaster();
4206
4207 if (!target->IsInCombat())
4208 availableElixirs.push_back(53753); // Potion of Nightmares (40081)
4209 if (target->GetPowerType() == POWER_MANA)
4210 availableElixirs.push_back(43186); // Runic Mana Potion(33448)
4211
4212 uint32 chosenElixir = Trinity::Containers::SelectRandomContainerElement(availableElixirs);
4213
4214 target->CastSpell(target, chosenElixir, GetCastItem());
4215 }
4216
4217 void Register() override
4218 {
4220 }
4221};
4222
4224{
4227};
4228
4229// 21149 - Egg Nog
4231{
4232 bool Validate(SpellInfo const* /*spellInfo*/) override
4233 {
4235 }
4236
4237 void HandleScript(SpellEffIndex /* effIndex */)
4238 {
4239 if (roll_chance_i(40))
4241 }
4242
4243 void Register() override
4244 {
4246 }
4247};
4248
4250{
4253
4254// 208051 - Sephuz's Secret
4255// 234867 - Sephuz's Secret
4256// 236763 - Sephuz's Secret
4258{
4259 bool Validate(SpellInfo const* /*spellInfo*/) override
4260 {
4262 }
4263
4264 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
4265 {
4267 return false;
4268
4269 if (eventInfo.GetHitMask() & (PROC_HIT_INTERRUPT | PROC_HIT_DISPEL))
4270 return true;
4271
4272 Spell const* procSpell = eventInfo.GetProcSpell();
4273 if (!procSpell)
4274 return false;
4275
4276 bool isCrowdControl = procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_CONFUSE)
4277 || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_FEAR)
4278 || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_STUN)
4280 || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_ROOT)
4283 || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_ROOT_2);
4284
4285 if (!isCrowdControl)
4286 return false;
4287
4288 return true;
4289 }
4290
4291 void HandleProc(AuraEffect* aurEff, ProcEventInfo& procInfo)
4292 {
4294
4296 GetUnitOwner()->CastSpell(procInfo.GetProcTarget(), aurEff->GetSpellEffectInfo().TriggerSpell, CastSpellExtraArgs(aurEff).SetTriggeringSpell(procInfo.GetProcSpell()));
4297 }
4298
4299 void Register() override
4300 {
4303 }
4304};
4305
4307{
4315};
4316
4317// 215266 - Fragile Echoes
4319{
4320 bool Validate(SpellInfo const* /*spellInfo*/) override
4321 {
4322 return ValidateSpellInfo({
4329 });
4330 }
4331
4332 void ForcePeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
4333 {
4334 // simulate heartbeat timer
4335 isPeriodic = true;
4336 amplitude = 5000;
4337 }
4338
4339 void UpdateSpecAura(AuraEffect const* aurEff)
4340 {
4342 Player* target = GetTarget()->ToPlayer();
4343 if (!target)
4344 return;
4345
4346 auto updateAuraIfInCorrectSpec = [&](ChrSpecialization spec, AmalgamsSeventhSpine aura)
4347 {
4348 if (target->GetPrimarySpecialization() != spec)
4349 target->RemoveAurasDueToSpell(aura);
4350 else if (!target->HasAura(aura))
4351 target->CastSpell(target, aura, aurEff);
4352 };
4353
4354 switch (target->GetClass())
4355 {
4356 case CLASS_MONK:
4358 break;
4359 case CLASS_SHAMAN:
4361 break;
4362 case CLASS_PRIEST:
4365 break;
4366 case CLASS_PALADIN:
4368 break;
4369 case CLASS_DRUID:
4371 break;
4372 default:
4373 break;
4374 }
4375 }
4376
4377 void Register() override
4378 {
4381 }
4382};
4383
4384// 215267 - Fragile Echo
4386{
4387 bool Validate(SpellInfo const* /*spellInfo*/) override
4388 {
4390 }
4391
4393 {
4394 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
4395 return;
4396
4397 Unit* caster = GetCaster();
4398 if (!caster)
4399 return;
4400
4401 if (AuraEffect const* trinketEffect = caster->GetAuraEffect(aurEff->GetSpellEffectInfo().TriggerSpell, EFFECT_0))
4402 caster->CastSpell(caster, SPELL_FRAGILE_ECHO_ENERGIZE, CastSpellExtraArgs(aurEff).AddSpellMod(SPELLVALUE_BASE_POINT0, trinketEffect->GetAmount()));
4403 }
4404
4405 void Register() override
4406 {
4408 }
4409};
4410
4411// 228445 - March of the Legion
4413{
4414 bool IsDemon(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
4415 {
4416 return eventInfo.GetProcTarget() && eventInfo.GetProcTarget()->GetCreatureType() == CREATURE_TYPE_DEMON;
4417 }
4418
4419 void Register() override
4420 {
4422 }
4423};
4424
4425// 234113 - Arrogance (used by item 142171 - Seal of Darkshire Nobility)
4427{
4428 bool Validate(SpellInfo const* spellInfo) override
4429 {
4430 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } })
4431 && ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_1).TriggerSpell });
4432 }
4433
4435 {
4436 return eventInfo.GetProcTarget() && !eventInfo.GetProcTarget()->HasAura(GetEffectInfo(EFFECT_1).TriggerSpell, GetTarget()->GetGUID());
4437 }
4438
4439 void Register() override
4440 {
4442 }
4443};
4444
4445// 247625 - March of the Legion
4447{
4448 bool IsDemon(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
4449 {
4450 return eventInfo.GetProcTarget() && eventInfo.GetProcTarget()->GetCreatureType() == CREATURE_TYPE_DEMON;
4451 }
4452
4453 void Register() override
4454 {
4456 }
4457};
4458
4460{
4463
4464// 253287 - Highfather's Timekeeping
4466{
4467 bool Validate(SpellInfo const* /*spellInfo*/) override
4468 {
4470 }
4471
4472 bool CheckHealth(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
4473 {
4474 return eventInfo.GetDamageInfo() && GetTarget()->HealthBelowPctDamaged(aurEff->GetAmount(), eventInfo.GetDamageInfo()->GetDamage());
4475 }
4476
4477 void Heal(AuraEffect* aurEff, ProcEventInfo& /*procInfo*/)
4478 {
4480 if (Unit* caster = GetCaster())
4481 caster->CastSpell(GetTarget(), SPELL_HIGHFATHERS_TIMEKEEPING_HEAL, aurEff);
4482 }
4483
4484 void Register() override
4485 {
4488 }
4489};
4490
4492{
4494 SPELL_ISOLATED_STRIKE = 255609
4496
4497// 253323 - Shadow Strike
4499{
4500 bool Validate(SpellInfo const* /*spellInfo*/) override
4501 {
4503 }
4504
4506 {
4508 CastSpellExtraArgs(aurEff).SetTriggeringSpell(eventInfo.GetProcSpell()));
4509 }
4510
4511 void Register() override
4512 {
4514 }
4515};
4516
4517// 255861 - Shadow Strike
4519{
4521 {
4523 return;
4524
4525 CastSpellExtraArgs args;
4528 if (GetSpell()->m_castItemLevel >= 0)
4530
4532 }
4533
4534 void Register() override
4535 {
4537 }
4538};
4539
4540// 295175 - Spiteful Binding
4542{
4543 bool Validate(SpellInfo const* spellInfo) override
4544 {
4545 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
4546 }
4547
4548 bool CheckHealth(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
4549 {
4550 return eventInfo.GetActor()->GetHealthPct() >= float(GetEffectInfo(EFFECT_1).CalcValue());
4551 }
4552
4553 void Register() override
4554 {
4556 }
4557};
4558
4559// 302385 - Resurrect Health
4561{
4562 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
4563 {
4564 return eventInfo.GetSpellInfo() && eventInfo.GetSpellInfo()->HasEffect(SPELL_EFFECT_RESURRECT);
4565 }
4566
4567 void Register() override
4568 {
4570 }
4571};
4572
4574{
4577 SPELL_VENOMOUS_LANCE = 303562
4579
4580// 303358 Venomous Bolt
4581// 303361 Shivering Lance
4583{
4584public:
4585 spell_item_shiver_venom_weapon_proc(ShiverVenomSpell additionalProcSpellId) : _additionalProcSpellId(additionalProcSpellId) { }
4586
4587 bool Validate(SpellInfo const* /*spellInfo*/) override
4588 {
4590 }
4591
4593 {
4594 if (procInfo.GetProcTarget()->HasAura(SPELL_SHIVER_VENOM))
4596 .AddSpellMod(SPELLVALUE_BASE_POINT0, aurEff->GetAmount())
4597 .SetTriggeringSpell(procInfo.GetProcSpell()));
4598 }
4599
4600 void Register() override
4601 {
4603 }
4604
4605private:
4607};
4608
4609// 302774 - Arcane Tempest
4611{
4613 {
4615 return;
4616
4617 if (AuraEffect* aurEff = GetCaster()->GetAuraEffect(GetTriggeringSpell()->Id, EFFECT_0))
4618 {
4619 aurEff->GetBase()->ModStackAmount(1, AURA_REMOVE_NONE, false);
4620 aurEff->CalculatePeriodic(GetCaster(), false);
4621 }
4622 }
4623
4624 void Register() override
4625 {
4627 }
4628};
4629
4630// 302769 - Arcane Tempest
4632{
4633 void CalculatePeriod(AuraEffect const* /*aurEff*/, bool& /*isPeriodic*/, int32& period)
4634 {
4635 period -= (GetStackAmount() - 1) * 300;
4636 }
4637
4638 void Register() override
4639 {
4641 }
4642};
4643
4644// 410530 - Mettle
4645// 410964 - Mettle
4647{
4648 static constexpr uint32 SPELL_METTLE_COOLDOWN = 410532;
4649
4650 bool Validate(SpellInfo const* /*spellInfo*/) override
4651 {
4653 }
4654
4655 bool CheckProc(ProcEventInfo& eventInfo)
4656 {
4658 return false;
4659
4660 if (eventInfo.GetHitMask() & (PROC_HIT_INTERRUPT | PROC_HIT_DISPEL))
4661 return true;
4662
4663 Spell const* procSpell = eventInfo.GetProcSpell();
4664 if (!procSpell)
4665 return false;
4666
4667 bool isCrowdControl = procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_CONFUSE)
4668 || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_FEAR)
4669 || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_STUN)
4671 || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_ROOT)
4674 || procSpell->GetSpellInfo()->HasAura(SPELL_AURA_MOD_ROOT_2);
4675
4676 if (!isCrowdControl)
4677 return false;
4678
4679 return eventInfo.GetActionTarget()->HasAura([&](Aura const* aura) { return aura->GetCastId() == procSpell->m_castId; });
4680 }
4681
4682 void TriggerCooldown(ProcEventInfo& /*eventInfo*/)
4683 {
4685 }
4686
4687 void Register() override
4688 {
4691 }
4692};
4693
4695{
4696 // 23074 Arcanite Dragonling
4697 new spell_item_trigger_spell("spell_item_arcanite_dragonling", SPELL_ARCANITE_DRAGONLING);
4698 // 23133 Gnomish Battle Chicken
4699 new spell_item_trigger_spell("spell_item_gnomish_battle_chicken", SPELL_BATTLE_CHICKEN);
4700 // 23076 Mechanical Dragonling
4701 new spell_item_trigger_spell("spell_item_mechanical_dragonling", SPELL_MECHANICAL_DRAGONLING);
4702 // 23075 Mithril Mechanical Dragonling
4703 new spell_item_trigger_spell("spell_item_mithril_mechanical_dragonling", SPELL_MITHRIL_MECHANICAL_DRAGONLING);
4704
4709 new spell_item_anger_capacitor<8>("spell_item_tiny_abomination_in_a_jar");
4710 new spell_item_anger_capacitor<7>("spell_item_tiny_abomination_in_a_jar_hero");
4724 new spell_item_defibrillate("spell_item_goblin_jumper_cables", 67, SPELL_GOBLIN_JUMPER_CABLES_FAIL);
4725 new spell_item_defibrillate("spell_item_goblin_jumper_cables_xl", 50, SPELL_GOBLIN_JUMPER_CABLES_XL_FAIL);
4726 new spell_item_defibrillate("spell_item_gnomish_army_knife", 33);
4776
4781
4804 new spell_item_sunwell_neck<SPELL_LIGHTS_WRATH, SPELL_ARCANE_BOLT>("spell_item_sunwell_exalted_caster_neck");
4805 new spell_item_sunwell_neck<SPELL_LIGHTS_STRENGTH, SPELL_ARCANE_STRIKE>("spell_item_sunwell_exalted_melee_neck");
4806 new spell_item_sunwell_neck<SPELL_LIGHTS_WARD, SPELL_ARCANE_INSIGHT>("spell_item_sunwell_exalted_tank_neck");
4807 new spell_item_sunwell_neck<SPELL_LIGHTS_SALVATION, SPELL_ARCANE_SURGE>("spell_item_sunwell_exalted_healer_neck");
4820 new spell_item_zandalarian_charm("spell_item_unstable_power", SPELL_UNSTABLE_POWER_AURA_STACK);
4821 new spell_item_zandalarian_charm("spell_item_restless_strength", SPELL_RESTLESS_STRENGTH_AURA_STACK);
4829
4833
4849
4851}
#define M_PI
Definition: Common.h:115
First const & RAND(First const &first, Second const &second, Rest const &... rest)
DB2Storage< ChrClassesEntry > sChrClassesStore("ChrClasses.db2", &ChrClassesLoadInfo::Instance)
DB2Storage< BroadcastTextEntry > sBroadcastTextStore("BroadcastText.db2", &BroadcastTextLoadInfo::Instance)
DB2Storage< FactionEntry > sFactionStore("Faction.db2", &FactionLoadInfo::Instance)
#define sDB2Manager
Definition: DB2Stores.h:538
ChrSpecialization
Definition: DBCEnums.h:357
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint64_t uint64
Definition: Define.h:141
uint32_t uint32
Definition: Define.h:142
#define INVALID_HEIGHT
Definition: GridDefines.h:61
@ ITEM_SUBCLASS_ARMOR_MAIL
Definition: ItemTemplate.h:532
@ ITEM_SUBCLASS_ARMOR_CLOTH
Definition: ItemTemplate.h:530
@ ITEM_SUBCLASS_ARMOR_LEATHER
Definition: ItemTemplate.h:531
@ ITEM_SUBCLASS_ARMOR_PLATE
Definition: ItemTemplate.h:533
#define TC_LOG_WARN(filterType__,...)
Definition: Log.h:162
LootStore LootTemplates_Skinning("skinning_loot_template", "creature skinning id", true)
@ TYPEID_UNIT
Definition: ObjectGuid.h:40
@ TYPEID_CORPSE
Definition: ObjectGuid.h:45
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
#define sObjectMgr
Definition: ObjectMgr.h:1946
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:145
float frand(float min, float max)
Definition: Random.cpp:55
int32 irand(int32 min, int32 max)
Definition: Random.cpp:35
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
bool roll_chance_i(int chance)
Definition: Random.h:59
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
#define RegisterSpellScriptWithArgs(spell_script, script_name,...)
Definition: ScriptMgr.h:1368
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_1
Definition: SharedDefines.h:31
@ EFFECT_0
Definition: SharedDefines.h:30
@ EFFECT_2
Definition: SharedDefines.h:32
@ CLASS_HUNTER
@ CLASS_DRUID
@ CLASS_SHAMAN
@ CLASS_MONK
@ CLASS_PRIEST
@ CLASS_WARRIOR
@ CLASS_WARLOCK
@ CLASS_MAGE
@ CLASS_DEATH_KNIGHT
@ CLASS_PALADIN
@ CLASS_ROGUE
@ GENDER_MALE
@ TARGET_UNIT_DEST_AREA_ALLY
@ TARGET_CORPSE_SRC_AREA_ENEMY
@ TARGET_UNIT_SRC_AREA_ALLY
@ EMOTE_ONESHOT_APPLAUD
@ EMOTE_ONESHOT_LAUGH
@ EMOTE_ONESHOT_CHEER
@ EMOTE_ONESHOT_CHICKEN
@ EMOTE_STATE_DANCE
@ EMOTE_ONESHOT_TRAIN
@ EMOTE_ONESHOT_DANCESPECIAL
@ CREATURE_TYPE_GAS_CLOUD
@ CREATURE_TYPE_DEMON
@ TEXT_EMOTE_TRAIN
@ TEAM_ALLIANCE
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_INEBRIATE
@ SPELL_EFFECT_HEAL
@ SPELL_EFFECT_ENERGIZE
@ SPELL_EFFECT_RESURRECT
@ SPELL_EFFECT_TELEPORT_UNITS
@ SPELL_EFFECT_APPLY_AURA
@ OFF_ATTACK
@ SPELL_CUSTOM_ERROR_TOO_MANY_GHOULS
@ SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_SINKHOLE
@ SPELL_CUSTOM_ERROR_LEARNED_EVERYTHING
@ HORDE
@ POWER_RAGE
@ POWER_RUNIC_POWER
@ POWER_ENERGY
@ POWER_MANA
#define MAX_CLASSES
@ REP_EXALTED
SpellCastResult
@ SPELL_FAILED_NOT_HERE
@ SPELL_FAILED_CUSTOM_ERROR
@ SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW
@ SPELL_FAILED_ONLY_ABOVEWATER
@ SPELL_CAST_OK
@ SPELL_FAILED_NO_VALID_TARGETS
@ STAT_INTELLECT
@ STAT_AGILITY
@ STAT_STRENGTH
#define EFFECT_ALL
Definition: SharedDefines.h:72
@ SPELLFAMILY_POTION
@ SKILL_ENGINEERING
uint32 GetExplicitDiscoverySpell(uint32 spellId, Player *player)
bool HasDiscoveredAllSpells(uint32 spellId, Player *player)
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAPPLY
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_NONE
@ AURA_REMOVE_BY_EXPIRE
@ SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE
@ SPELL_AURA_MOD_THREAT
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_MOD_FEAR
@ SPELL_AURA_MOD_ROOT_2
@ SPELL_AURA_MOD_RATING
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOD_PACIFY
@ SPELL_AURA_MOD_SILENCE
@ SPELL_AURA_MOD_STAT
@ SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
@ SPELL_AURA_MOD_ROOT
@ SPELL_AURA_MOUNTED
@ SPELL_AURA_MOD_PACIFY_SILENCE
@ SPELL_AURA_TRANSFORM
@ SPELL_AURA_MOD_CONFUSE
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELL_AURA_MOD_STUN
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:266
@ SPELLVALUE_AURA_STACK
Definition: SpellDefines.h:231
@ SPELLVALUE_BASE_POINT0
Definition: SpellDefines.h:196
SpellGroup
Definition: SpellMgr.h:350
@ SPELL_GROUP_NONE
Definition: SpellMgr.h:351
@ SPELL_GROUP_ELIXIR_BATTLE
Definition: SpellMgr.h:352
@ SPELL_GROUP_ELIXIR_GUARDIAN
Definition: SpellMgr.h:353
#define sSpellMgr
Definition: SpellMgr.h:849
@ PROC_FLAG_DEAL_RANGED_ABILITY
Definition: SpellMgr.h:149
@ PROC_FLAG_DEAL_RANGED_ATTACK
Definition: SpellMgr.h:146
@ PROC_FLAG_DEAL_HELPFUL_SPELL
Definition: SpellMgr.h:158
@ PROC_FLAG_DEAL_HARMFUL_SPELL
Definition: SpellMgr.h:161
@ PROC_HIT_DISPEL
Definition: SpellMgr.h:288
@ PROC_HIT_INTERRUPT
Definition: SpellMgr.h:286
#define AuraProcFn(F)
Definition: SpellScript.h:2150
#define SpellCheckCastFn(F)
Definition: SpellScript.h:830
#define AuraEffectProcFn(F, I, N)
Definition: SpellScript.h:2160
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define AuraEffectCalcAmountFn(F, I, N)
Definition: SpellScript.h:2058
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
#define AuraCheckEffectProcFn(F, I, N)
Definition: SpellScript.h:2136
#define SpellCastFn(F)
Definition: SpellScript.h:825
#define AuraEffectCalcPeriodicFn(F, I, N)
Definition: SpellScript.h:2064
#define AuraEffectApplyFn(F, I, N, M)
Definition: SpellScript.h:2029
#define AuraCheckProcFn(F)
Definition: SpellScript.h:2130
#define SpellHitFn(F)
Definition: SpellScript.h:854
#define AuraCheckAreaTargetFn(F)
Definition: SpellScript.h:2008
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:2040
T CalculatePct(T base, U pct)
Definition: Util.h:72
GiftOfTheHarvester
Definition: chapter1.cpp:1091
SpellEffectInfo const & GetSpellEffectInfo() const
uint32 GetId() const
int32 GetAmount() const
void PreventDefaultAction()
HookList< EffectCalcPeriodicHandler > DoEffectCalcPeriodic
Definition: SpellScript.h:2063
AuraApplication const * GetTargetApplication() const
int32 GetDuration() const
HookList< EffectApplyHandler > AfterEffectRemove
Definition: SpellScript.h:2039
HookList< CheckEffectProcHandler > DoCheckEffectProc
Definition: SpellScript.h:2135
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2045
SpellInfo const * GetSpellInfo() const
WorldObject * GetOwner() const
HookList< EffectApplyHandler > AfterEffectApply
Definition: SpellScript.h:2028
HookList< EffectProcHandler > AfterEffectProc
Definition: SpellScript.h:2159
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Definition: SpellScript.h:2057
Unit * GetCaster() const
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
AuraEffect * GetEffect(uint8 effIndex) const
Aura * GetAura() const
HookList< CheckAreaTargetHandler > DoCheckAreaTarget
Definition: SpellScript.h:2007
Unit * GetTarget() const
ObjectGuid GetCasterGUID() const
HookList< AuraProcHandler > AfterProc
Definition: SpellScript.h:2149
HookList< CheckProcHandler > DoCheckProc
Definition: SpellScript.h:2129
HookList< EffectApplyHandler > OnEffectRemove
Definition: SpellScript.h:2035
HookList< EffectProcHandler > OnEffectProc
Definition: SpellScript.h:2155
Unit * GetUnitOwner() const
HookList< AuraProcHandler > OnProc
Definition: SpellScript.h:2145
uint8 GetStackAmount() const
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:2024
uint32 GetId() const
ObjectGuid GetCastId() const
Definition: SpellAuras.h:138
uint8 GetStackAmount() const
Definition: SpellAuras.h:189
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
CreatureDifficulty const * GetCreatureDifficulty() const
Definition: Creature.h:252
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Definition: Creature.cpp:2415
SpellInfo const * GetSpellInfo() const
Definition: Unit.h:442
uint32 GetDamage() const
Definition: Unit.h:446
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
Definition: Unit.h:456
uint32 GetEffectiveHeal() const
Definition: Unit.h:478
uint32 GetHeal() const
Definition: Unit.h:476
Definition: Item.h:170
bool IsDungeon() const
Definition: Map.cpp:3238
static Creature * ToCreature(Object *o)
Definition: Object.h:219
TypeID GetTypeId() const
Definition: Object.h:173
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
static Player * ToPlayer(Object *o)
Definition: Object.h:213
PartyTimeEmoteEvent(Player *player)
Definition: spell_item.cpp:887
bool Execute(uint64, uint32) override
Definition: spell_item.cpp:889
void LearnSpell(uint32 spell_id, bool dependent, int32 fromSkill=0, bool suppressMessaging=false, Optional< int32 > traitDefinitionId={})
Definition: Player.cpp:3216
void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const &store, ItemContext context=ItemContext::NONE, bool broadcast=false, bool createdByPlayer=false)
Definition: Player.cpp:26395
ChrSpecialization GetPrimarySpecialization() const
Definition: Player.h:1841
uint32 DoRandomRoll(uint32 minimum, uint32 maximum)
Definition: Player.cpp:29841
TeamId GetTeamId() const
Definition: Player.h:2236
Battleground * GetBattleground() const
Definition: Player.cpp:24976
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: Player.cpp:16050
ReputationRank GetReputationRank(uint32 faction_id) const
Definition: Player.cpp:6497
HealInfo * GetHealInfo() const
Definition: Unit.h:506
Unit * GetActionTarget() const
Definition: Unit.h:494
Spell const * GetProcSpell() const
Definition: Unit.h:508
ProcFlagsHit GetHitMask() const
Definition: Unit.h:500
SpellInfo const * GetSpellInfo() const
Definition: Unit.cpp:280
ProcFlagsInit GetTypeMask() const
Definition: Unit.h:497
DamageInfo * GetDamageInfo() const
Definition: Unit.h:505
Unit * GetProcTarget() const
Definition: Unit.h:495
Unit * GetActor() const
Definition: Unit.h:493
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
Definition: SpellInfo.cpp:495
uint32 TriggerSpell
Definition: SpellInfo.h:237
float BasePoints
Definition: SpellInfo.h:221
void ResetCooldown(uint32 spellId, bool update=false)
bool HasEffect(SpellEffectName effect) const
Definition: SpellInfo.cpp:1391
uint32 const Id
Definition: SpellInfo.h:325
uint32 StackAmount
Definition: SpellInfo.h:390
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition: SpellInfo.h:577
bool HasAura(AuraType aura) const
Definition: SpellInfo.cpp:1400
uint32 SpellFamilyName
Definition: SpellInfo.h:408
uint32 m_scriptSpellId
Definition: SpellScript.h:134
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
static bool ValidateSpellEffect(std::initializer_list< std::pair< uint32, SpellEffIndex > > effects)
Definition: SpellScript.h:173
HookList< CastHandler > AfterCast
Definition: SpellScript.h:824
HookList< CheckCastHandler > OnCheckCast
Definition: SpellScript.h:829
Creature * GetHitCreature() const
Player * GetHitPlayer() const
Unit * GetCaster() const
HookList< HitHandler > AfterHit
Definition: SpellScript.h:852
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:839
void PreventHitDefaultEffect(SpellEffIndex effIndex)
int64 GetUnitTargetCountForEffect(SpellEffIndex effect) const
SpellInfo const * GetTriggeringSpell() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
Item * GetCastItem() const
void SetCustomCastResultMessage(SpellCustomErrors result)
Spell * GetSpell() const
Definition: SpellScript.h:987
void FinishCast(SpellCastResult result, int32 *param1=nullptr, int32 *param2=nullptr)
Difficulty GetCastDifficulty() const
int32 GetHitHeal() const
void SetHitHeal(int32 heal)
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
Definition: Spell.h:255
SpellInfo const * GetSpellInfo() const
Definition: Spell.h:650
ObjectGuid m_originalCastId
Definition: Spell.h:569
int32 m_castItemLevel
Definition: Spell.h:567
ObjectGuid m_castId
Definition: Spell.h:568
Binary predicate for sorting Units based on percent value of health.
Definition: Unit.h:627
float GetHealthPct() const
Definition: Unit.h:784
uint8 GetClass() const
Definition: Unit.h:752
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition: Unit.h:637
Powers GetPowerType() const
Definition: Unit.h:799
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition: Unit.cpp:4464
bool IsAlive() const
Definition: Unit.h:1164
Gender GetGender() const
Definition: Unit.h:755
virtual Gender GetNativeGender() const
Definition: Unit.h:757
uint32 GetCreatureType() const
Definition: Unit.cpp:8880
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4560
bool IsSummon() const
Definition: Unit.h:738
virtual void TextEmote(std::string_view text, WorldObject const *target=nullptr, bool isBossEmote=false)
Definition: Unit.cpp:13572
bool isMoving() const
Definition: Unit.h:1732
void GetAllMinionsByEntry(std::list< TempSummon * > &Minions, uint32 entry)
Definition: Unit.cpp:6235
void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, uint16 num=1)
Definition: Unit.cpp:3847
uint64 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:785
void SetFacingTo(float const ori, bool force=true)
Definition: Unit.cpp:12653
bool IsCritter() const
Definition: Unit.h:1010
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4664
float GetStat(Stats stat) const
Definition: Unit.h:760
SpellHistory * GetSpellHistory()
Definition: Unit.h:1457
void HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
Definition: Unit.cpp:1598
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:781
AuraApplicationMap & GetAppliedAuras()
Definition: Unit.h:1274
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
ObjectGuid GetTarget() const
Definition: Unit.h:1759
uint8 GetLevel() const
Definition: Unit.h:746
virtual void SetDisplayId(uint32 displayId, bool setNative=false)
Definition: Unit.cpp:10148
bool IsInCombat() const
Definition: Unit.h:1043
void PlayDirectSound(uint32 soundId, Player const *target=nullptr, uint32 broadcastTextId=0) const
Definition: Object.cpp:3592
Map * GetMap() const
Definition: Object.h:624
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2148
EventProcessor m_Events
Definition: Object.h:777
uint32 GetAreaId() const
Definition: Object.h:546
void PeriodicTick(AuraEffect const *aurEff)
Definition: spell_item.cpp:132
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:127
void HandleProc(AuraEffect *aurEff, ProcEventInfo &)
Definition: spell_item.cpp:107
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:102
bool CheckProc(ProcEventInfo &eventInfo)
Definition: spell_item.cpp:232
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:223
void Register() override
Definition: spell_item.cpp:258
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
Definition: spell_item.cpp:237
bool Validate(SpellInfo const *) override
void TriggerManaRestoration(AuraEffect const *aurEff, AuraEffectHandleModes)
void ForcePeriodic(AuraEffect const *, bool &isPeriodic, int32 &amplitude)
void UpdateSpecAura(AuraEffect const *aurEff)
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
Definition: spell_item.cpp:316
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
Definition: spell_item.cpp:296
spell_item_anger_capacitor(char const *ScriptName)
Definition: spell_item.cpp:281
AuraScript * GetAuraScript() const override
Definition: spell_item.cpp:328
void Register() override
Definition: spell_item.cpp:344
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
Definition: spell_item.cpp:337
bool Validate(SpellInfo const *spellInfo) override
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
bool Validate(SpellInfo const *spellInfo) override
void Register() override
bool Load() override
void OnDummyEffect(SpellEffIndex effIndex)
void Register() override
Definition: spell_item.cpp:427
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:372
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
Definition: spell_item.cpp:388
void OnRemove(AuraEffect const *effect, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void Register() override
bool CheckProc(ProcEventInfo &eventInfo)
Definition: spell_item.cpp:494
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:489
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
Definition: spell_item.cpp:499
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:160
void HandleDummy(SpellEffIndex)
Definition: spell_item.cpp:171
SpellCastResult CheckRequirement()
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:465
void Register() override
Definition: spell_item.cpp:475
void HandleScript(SpellEffIndex)
Definition: spell_item.cpp:470
void Register() override
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *effect, AuraEffectHandleModes)
void Register() override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *spellInfo) override
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void HandleDummy(SpellEffIndex)
Definition: spell_item.cpp:573
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:568
void HandleStackDrop(AuraEffect *, ProcEventInfo &)
Definition: spell_item.cpp:553
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void Register() override
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
Definition: spell_item.cpp:628
AuraScript * GetAuraScript() const override
Definition: spell_item.cpp:674
spell_item_deathbringers_will(char const *ScriptName)
Definition: spell_item.cpp:611
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:688
void HandleScript(SpellEffIndex)
Definition: spell_item.cpp:700
spell_item_defibrillate_SpellScript(uint8 chance, uint32 failSpell)
Definition: spell_item.cpp:785
SpellScript * GetSpellScript() const override
Definition: spell_item.cpp:812
spell_item_defibrillate(char const *name, uint8 chance, uint32 failSpell=0)
Definition: spell_item.cpp:780
void Register() override
Definition: spell_item.cpp:451
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:436
void HandlePeriodicDummy(AuraEffect const *aurEff)
Definition: spell_item.cpp:445
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &)
Definition: spell_item.cpp:835
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:830
void HandleDummy(SpellEffIndex)
Definition: spell_item.cpp:871
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:866
void Register() override
Definition: spell_item.cpp:878
bool Load() override
Definition: spell_item.cpp:861
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void Register() override
Definition: spell_item.cpp:960
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
Definition: spell_item.cpp:940
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
Definition: spell_item.cpp:979
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:974
void FilterTargets(std::list< WorldObject * > &targets)
Definition: spell_item.cpp:994
void Register() override
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
void Register() override
void PeriodicTick(AuraEffect const *)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *, ProcEventInfo &)
void HandleScript(SpellEffIndex)
spell_item_feast(uint32 text)
void Register() override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
SpellCastResult CheckRequirement()
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
Definition: spell_item.cpp:725
void HandleDummy(SpellEffIndex)
Definition: spell_item.cpp:730
void HandleScript(SpellEffIndex)
Definition: spell_item.cpp:753
bool Validate(SpellInfo const *spellInfo) override
bool CheckHealth(AuraEffect const *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleProc(ProcEventInfo &)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void Register() override
bool CheckHealth(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
void Heal(AuraEffect *aurEff, ProcEventInfo &)
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
void Register() override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
static constexpr uint32 SPELL_METTLE_COOLDOWN
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
void OnRemove(AuraEffect const *effect, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void Register() override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
void Register() override
bool IsDemon(AuraEffect const *, ProcEventInfo &eventInfo)
bool Load() override
bool Validate(SpellInfo const *) override
void Register() override
void HandleDummy(SpellEffIndex)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void Register() override
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex)
void HandleDummy(SpellEffIndex)
void Register() override
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void Register() override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void Register() override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleApply(AuraEffect const *, AuraEffectHandleModes)
void HandlePeriodicDummy(AuraEffect const *effect)
void HandleDummy(SpellEffIndex)
void Register() override
bool Validate(SpellInfo const *) override
bool Load() override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
void Register() override
Definition: spell_item.cpp:919
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
Definition: spell_item.cpp:910
bool CheckProc(ProcEventInfo &eventInfo)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void Register() override
bool Validate(SpellInfo const *) override
void CalculatePeriod(AuraEffect const *, bool &, int32 &period)
void HandleScript(SpellEffIndex effIndex)
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
void Register() override
bool Validate(SpellInfo const *) override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void Register() override
bool CheckCaster(Unit *target)
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void Register() override
void HandleDummy(SpellEffIndex)
void HandleScript(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
void Register() override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
bool Load() override
SpellCastResult CheckCast()
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex effIndex)
bool Validate(SpellInfo const *spellInfo) override
bool CheckCooldownAura(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void TriggerIsolatedStrikeCheck(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(AuraEffect const *, ProcEventInfo &eventInfo)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &procInfo)
void Register() override
bool Validate(SpellInfo const *) override
bool IsDemon(AuraEffect const *, ProcEventInfo &eventInfo)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void OnStackChange(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void Register() override
void HandleProc(ProcEventInfo &procInfo)
void Register() override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
AuraScript * GetAuraScript() const override
spell_item_shard_of_the_scale(char const *ScriptName)
spell_item_shiver_venom_weapon_proc(ShiverVenomSpell additionalProcSpellId)
void HandleAdditionalProc(AuraEffect *aurEff, ProcEventInfo &procInfo)
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
void Register() override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void Register() override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
spell_item_sunwell_neck(char const *ScriptName)
AuraScript * GetAuraScript() const override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *effect, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
void FilterTargets(std::list< WorldObject * > &targets)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
void HandleTargets(std::list< WorldObject * > &targetList)
void HandleDummy(SpellEffIndex)
SpellScript * GetSpellScript() const override
Definition: spell_item.cpp:88
spell_item_trigger_spell(char const *name, uint32 triggeredSpellId)
Definition: spell_item.cpp:60
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
spell_item_trinket_stack_AuraScript(uint32 stackSpell, uint32 triggerSpell)
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
spell_item_trinket_stack(char const *scriptName, uint32 stackSpell, uint32 triggerSpell)
AuraScript * GetAuraScript() const override
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
bool CheckProc(ProcEventInfo &procInfo)
void HandleDummy(SpellEffIndex)
bool CheckProc(ProcEventInfo &eventInfo)
Definition: spell_item.cpp:534
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *spellInfo) override
void Register() override
void OnRemove(AuraEffect const *effect, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void HandleTeleport(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
AuraScript * GetAuraScript() const override
spell_item_zandalarian_charm(char const *ScriptName, uint32 SpellId)
bool CheckProc(AuraEffect const *, ProcEventInfo &eventInfo)
void HandleTriggerSpell(AuraEffect const *)
void Register() override
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:109
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:67
AuraProcRemoveSpells
DarkmoonCardSpells
@ SPELL_DARKMOON_CARD_STRENGTH
@ SPELL_DARKMOON_CARD_AGILITY
@ SPELL_DARKMOON_CARD_VERSATILITY
@ SPELL_DARKMOON_CARD_INTELLECT
GnomishDeathRay
@ SPELL_GNOMISH_DEATH_RAY_SELF
@ SPELL_GNOMISH_DEATH_RAY_TARGET
ScrollOfRecall
@ SPELL_SCROLL_OF_RECALL_III
@ SPELL_LOST
@ SPELL_SCROLL_OF_RECALL_FAIL_ALLIANCE_1
@ SPELL_SCROLL_OF_RECALL_I
@ SPELL_SCROLL_OF_RECALL_II
@ SPELL_SCROLL_OF_RECALL_FAIL_HORDE_1
HighfathersMachination
@ SPELL_HIGHFATHERS_TIMEKEEPING_HEAL
Heartpierce
@ SPELL_INVIGORATION_RP_HERO
@ SPELL_INVIGORATION_MANA
@ SPELL_INVIGORATION_ENERGY_HERO
@ SPELL_INVIGORATION_MANA_HERO
@ SPELL_INVIGORATION_RAGE_HERO
@ SPELL_INVIGORATION_RP
@ SPELL_INVIGORATION_RAGE
@ SPELL_INVIGORATION_ENERGY
VanquishedClutchesSpells
@ SPELL_CONSTRICTOR
@ SPELL_CRUSHER
@ SPELL_CORRUPTOR
BlessingOfAncientKings
Definition: spell_item.cpp:483
@ SPELL_PROTECTION_OF_ANCIENT_KINGS
Definition: spell_item.cpp:484
NitroBoosts
@ SPELL_NITRO_BOOSTS_SUCCESS
@ SPELL_NITRO_BOOSTS_PARACHUTE
@ SPELL_NITRO_BOOSTS_BACKFIRE
ShiverVenomSpell
@ SPELL_SHIVER_VENOM
@ SPELL_VENOMOUS_LANCE
@ SPELL_SHIVERING_BOLT
FlaskOfTheNorthSpells
@ SPELL_FLASK_OF_THE_NORTH_SP
@ SPELL_FLASK_OF_THE_NORTH_STR
@ SPELL_FLASK_OF_THE_NORTH_AP
PowerCircle
@ SPELL_LIMITLESS_POWER
HarmPreventionBelt
@ SPELL_FORCEFIELD_COLLAPSE
GenericData
Definition: spell_item.cpp:46
@ SPELL_MECHANICAL_DRAGONLING
Definition: spell_item.cpp:49
@ SPELL_MITHRIL_MECHANICAL_DRAGONLING
Definition: spell_item.cpp:50
@ SPELL_BATTLE_CHICKEN
Definition: spell_item.cpp:48
@ SPELL_ARCANITE_DRAGONLING
Definition: spell_item.cpp:47
UnderbellyElixirSpells
@ SPELL_UNDERBELLY_ELIXIR_TRIGGERED2
@ SPELL_UNDERBELLY_ELIXIR_TRIGGERED1
@ SPELL_UNDERBELLY_ELIXIR_TRIGGERED3
@ NPC_GHOUL
@ MAX_GHOULS
Poultryzer
@ SPELL_POULTRYIZER_SUCCESS
@ SPELL_POULTRYIZER_BACKFIRE
ManaDrainSpells
@ SPELL_MANA_DRAIN_LEECH
@ SPELL_MANA_DRAIN_ENERGIZE
NoggenfoggerElixirSpells
@ SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED1
@ SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2
@ SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED3
DesperateDefense
Definition: spell_item.cpp:823
@ SPELL_DESPERATE_RAGE
Definition: spell_item.cpp:824
Defibrillate
Definition: spell_item.cpp:772
@ SPELL_GOBLIN_JUMPER_CABLES_XL_FAIL
Definition: spell_item.cpp:774
@ SPELL_GOBLIN_JUMPER_CABLES_FAIL
Definition: spell_item.cpp:773
@ TEXT_SMALL_FEAST
@ TEXT_GREAT_FEAST
@ TEXT_BOUNTIFUL_FEAST
@ TEXT_GIGANTIC_FEAST
@ TEXT_FISH_FEAST
SwiftHandJusticeMisc
@ SPELL_SWIFT_HAND_OF_JUSTICE_HEAL
RocketBoots
@ SPELL_ROCKET_BOOTS_PROC
DemonBroiledSurprise
@ NPC_ABYSSAL_FLAMEBRINGER
@ SPELL_CREATE_DEMON_BROILED_SURPRISE
@ QUEST_SUPER_HOT_STEW
MindControlCap
@ SPELL_GNOMISH_MIND_CONTROL_CAP
@ ROLL_CHANCE_NO_BACKFIRE
@ SPELL_DULLARD
@ ROLL_CHANCE_DULLARD
NecroticTouch
@ SPELL_ITEM_NECROTIC_TOUCH_PROC
ZandalarianCharms
@ SPELL_RESTLESS_STRENGTH_AURA_STACK
@ SPELL_UNSTABLE_POWER_AURA_STACK
MagicEater
@ SPELL_WELL_FED_3
@ SPELL_WELL_FED_5
@ SPELL_WILD_MAGIC
@ SPELL_WELL_FED_2
@ SPELL_WELL_FED_1
@ SPELL_WELL_FED_4
MingoFortune
@ SPELL_CREATE_FORTUNE_4
@ SPELL_CREATE_FORTUNE_10
@ SPELL_CREATE_FORTUNE_6
@ SPELL_CREATE_FORTUNE_19
@ SPELL_CREATE_FORTUNE_20
@ SPELL_CREATE_FORTUNE_9
@ SPELL_CREATE_FORTUNE_17
@ SPELL_CREATE_FORTUNE_12
@ SPELL_CREATE_FORTUNE_18
@ SPELL_CREATE_FORTUNE_7
@ SPELL_CREATE_FORTUNE_5
@ SPELL_CREATE_FORTUNE_1
@ SPELL_CREATE_FORTUNE_16
@ SPELL_CREATE_FORTUNE_13
@ SPELL_CREATE_FORTUNE_15
@ SPELL_CREATE_FORTUNE_14
@ SPELL_CREATE_FORTUNE_11
@ SPELL_CREATE_FORTUNE_8
@ SPELL_CREATE_FORTUNE_2
@ SPELL_CREATE_FORTUNE_3
LifegivingGem
@ SPELL_GIFT_OF_LIFE_1
@ SPELL_GIFT_OF_LIFE_2
AirRifleSpells
@ SPELL_AIR_RIFLE_SHOOT_SELF
@ SPELL_AIR_RIFLE_HOLD_VISUAL
@ SPELL_AIR_RIFLE_SHOOT
UniversalRemote
@ SPELL_CONTROL_MACHINE
@ SPELL_TARGET_LOCK
@ SPELL_MOBILITY_MALFUNCTION
DireBrew
Definition: spell_item.cpp:926
@ MODEL_CLASS_MAIL_FEMALE
Definition: spell_item.cpp:932
@ MODEL_CLASS_LEATHER_FEMALE
Definition: spell_item.cpp:930
@ MODEL_CLASS_MAIL_MALE
Definition: spell_item.cpp:931
@ MODEL_CLASS_CLOTH_FEMALE
Definition: spell_item.cpp:928
@ MODEL_CLASS_PLATE_MALE
Definition: spell_item.cpp:933
@ MODEL_CLASS_CLOTH_MALE
Definition: spell_item.cpp:927
@ MODEL_CLASS_LEATHER_MALE
Definition: spell_item.cpp:929
@ MODEL_CLASS_PLATE_FEMALE
Definition: spell_item.cpp:934
MakeAWish
@ SPELL_SUMMON_FURIOUS_MR_PINCHY
@ SPELL_MR_PINCHYS_GIFT
@ SPELL_TINY_MAGICAL_CRAWDAD
@ SPELL_SUMMON_MIGHTY_MR_PINCHY
@ SPELL_MR_PINCHYS_BLESSING
NighInvulnerability
@ SPELL_COMPLETE_VULNERABILITY
@ SPELL_NIGH_INVULNERABILITY
ShadowsFate
@ SPELL_SOUL_FEAST
@ NPC_SINDRAGOSA
@ SPELL_WORLD_QUELLER_FOCUS
@ SPELL_BRUTAL_KINSHIP_2
@ SPELL_BATTLE_TRANCE
@ SPELL_TALISMAN_OF_ASCENDANCE
@ SPELL_JOM_GABBAR
@ SPELL_BRUTAL_KINSHIP_1
GreatmothersSoulcather
@ SPELL_FORCE_CAST_SUMMON_GNOME_SOUL
void AddSC_item_spell_scripts()
TransporterSpells
@ SPELL_TRANSFORM_ALLIANCE
@ SPELL_SOUL_SPLIT_EVIL
@ SPELL_TRANSFORM_HORDE
@ SPELL_TRANSPORTER_MALFUNCTION_CHICKEN
@ SPELL_TRANSPORTER_MALFUNCTION_SMALLER
@ SPELL_TRANSPORTER_MALFUNCTION_FIRE
@ SPELL_EVIL_TWIN
@ SPELL_SOUL_SPLIT_GOOD
@ SPELL_TRANSPORTER_MALFUNCTION_BIGGER
DeathChoiceSpells
@ SPELL_DEATH_CHOICE_HEROIC_AURA
@ SPELL_DEATH_CHOICE_HEROIC_STRENGTH
@ SPELL_DEATH_CHOICE_NORMAL_AURA
@ SPELL_DEATH_CHOICE_NORMAL_STRENGTH
@ SPELL_DEATH_CHOICE_NORMAL_AGILITY
@ SPELL_DEATH_CHOICE_HEROIC_AGILITY
FateRuneOfUnsurpassedVigor
@ SPELL_UNSURPASSED_VIGOR
ZezzaksShard
Definition: spell_item.cpp:120
@ SPELL_EYE_OF_GRILLOK
Definition: spell_item.cpp:121
MercurialShield
@ SPELL_MERCURIAL_SHIELD
CompleteRaptorCapture
@ SPELL_RAPTOR_CAPTURE_CREDIT
DeviateFishSpells
Definition: spell_item.cpp:850
@ SPELL_SHRINK
Definition: spell_item.cpp:853
@ SPELL_PARTY_TIME
Definition: spell_item.cpp:854
@ SPELL_INVIGORATE
Definition: spell_item.cpp:852
@ SPELL_REJUVENATION
Definition: spell_item.cpp:856
@ SPELL_HEALTHY_SPIRIT
Definition: spell_item.cpp:855
@ SPELL_SLEEPY
Definition: spell_item.cpp:851
LowerCityPrayerbook
Definition: spell_item.cpp:150
@ SPELL_BLESSING_OF_LOWER_CITY_SHAMAN
Definition: spell_item.cpp:154
@ SPELL_BLESSING_OF_LOWER_CITY_PALADIN
Definition: spell_item.cpp:152
@ SPELL_BLESSING_OF_LOWER_CITY_DRUID
Definition: spell_item.cpp:151
@ SPELL_BLESSING_OF_LOWER_CITY_PRIEST
Definition: spell_item.cpp:153
SoulPreserver
@ SPELL_SOUL_PRESERVER_PALADIN
@ SPELL_SOUL_PRESERVER_SHAMAN
@ SPELL_SOUL_PRESERVER_DRUID
@ SPELL_SOUL_PRESERVER_PRIEST
DeadlyPrecision
Definition: spell_item.cpp:546
@ SPELL_DEADLY_PRECISION
Definition: spell_item.cpp:547
GoblinWeatherMachine
Definition: spell_item.cpp:743
@ SPELL_PERSONALIZED_WEATHER2
Definition: spell_item.cpp:745
@ SPELL_PERSONALIZED_WEATHER1
Definition: spell_item.cpp:744
@ SPELL_PERSONALIZED_WEATHER4
Definition: spell_item.cpp:747
@ SPELL_PERSONALIZED_WEATHER3
Definition: spell_item.cpp:746
AlchemistStone
Definition: spell_item.cpp:206
@ SPELL_ALCHEMIST_STONE_EXTRA_HEAL
Definition: spell_item.cpp:207
@ SPELL_ALCHEMIST_STONE_EXTRA_MANA
Definition: spell_item.cpp:208
SephuzsSecret
@ SPELL_SEPHUZS_SECRET_COOLDOWN
uint32 const WormholeTargetLocations[]
AshbringerSounds
@ SOUND_ASHBRINGER_6
@ SOUND_ASHBRINGER_11
@ SOUND_ASHBRINGER_12
@ SOUND_ASHBRINGER_5
@ SOUND_ASHBRINGER_1
@ SOUND_ASHBRINGER_4
@ SOUND_ASHBRINGER_3
@ SOUND_ASHBRINGER_2
@ SOUND_ASHBRINGER_7
@ SOUND_ASHBRINGER_10
@ SOUND_ASHBRINGER_8
@ SOUND_ASHBRINGER_9
ChickenCover
@ QUEST_CHICKEN_PARTY
@ SPELL_CAPTURE_CHICKEN_ESCAPE
@ QUEST_FLOWN_THE_COOP
@ SPELL_CHICKEN_NET
Eggnog
@ SPELL_EGG_NOG_REINDEER
@ SPELL_EGG_NOG_SNOWMAN
DeathbringersWill
Definition: spell_item.cpp:588
@ SPELL_AGILITY_OF_THE_VRYKUL_HERO
Definition: spell_item.cpp:595
@ SPELL_STRENGTH_OF_THE_TAUNKA_HERO
Definition: spell_item.cpp:599
@ SPELL_POWER_OF_THE_TAUNKA
Definition: spell_item.cpp:591
@ SPELL_POWER_OF_THE_TAUNKA_HERO
Definition: spell_item.cpp:596
@ SPELL_SPEED_OF_THE_VRYKUL
Definition: spell_item.cpp:593
@ SPELL_STRENGTH_OF_THE_TAUNKA
Definition: spell_item.cpp:589
@ SPELL_AIM_OF_THE_IRON_DWARVES
Definition: spell_item.cpp:592
@ SPELL_SPEED_OF_THE_VRYKUL_HERO
Definition: spell_item.cpp:598
@ SPELL_AIM_OF_THE_IRON_DWARVES_HERO
Definition: spell_item.cpp:597
@ SPELL_AGILITY_OF_THE_VRYKUL
Definition: spell_item.cpp:590
@ SPELL_SHADOWMOURNE_VISUAL_HIGH
@ SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF
@ SPELL_SHADOWMOURNE_SOUL_FRAGMENT
@ SPELL_SHADOWMOURNE_CHAOS_BANE_DAMAGE
@ SPELL_SHADOWMOURNE_VISUAL_LOW
AngerCapacitor
Definition: spell_item.cpp:266
@ SPELL_MANIFEST_ANGER_OFF_HAND
Definition: spell_item.cpp:269
@ SPELL_MANIFEST_ANGER_MAIN_HAND
Definition: spell_item.cpp:268
@ SPELL_MOTE_OF_ANGER
Definition: spell_item.cpp:267
ShardOfTheScale
@ SPELL_PURIFIED_CAUTERIZING_HEAL
@ SPELL_PURIFIED_SEARING_FLAMES
@ SPELL_SHINY_SEARING_FLAMES
@ SPELL_SHINY_CAUTERIZING_HEAL
PersistentShieldMisc
@ SPELL_PERSISTENT_SHIELD_TRIGGERED
Sinkholes
@ NPC_NORTHEAST_SINKHOLE
@ NPC_SOUTH_SINKHOLE
@ NPC_NORTHWEST_SINKHOLE
PurifyHelboarMeat
@ SPELL_SUMMON_TOXIC_HELBOAR_MEAT
@ SPELL_SUMMON_PURIFIED_HELBOAR_MEAT
SavoryDeviateDelight
@ SPELL_FLIP_OUT_FEMALE
@ SPELL_FLIP_OUT_MALE
@ SPELL_YAAARRRR_FEMALE
@ SPELL_YAAARRRR_MALE
WormholeGeneratorPandariaSpell
@ SPELL_WORMHOLE_PANDARIA_CRANE_STATUE
@ SPELL_WORMHOLE_PANDARIA_ISLE_OF_RECKONING
@ SPELL_WORMHOLE_PANDARIA_SRA_VESS
@ SPELL_WORMHOLE_PANDARIA_WHITEPETAL_LAKE
@ SPELL_WORMHOLE_PANDARIA_EMPERORS_OMEN
@ SPELL_WORMHOLE_PANDARIA_KUNLAI_UNDERWATER
@ SPELL_WORMHOLE_PANDARIA_ZANVESS_TREE
@ SPELL_WORMHOLE_PANDARIA_RIKKITUN_VILLAGE
@ SPELL_WORMHOLE_PANDARIA_ANGLERS_WHARF
HourglassSand
@ SPELL_BROOD_AFFLICTION_BRONZE
BrittleArmor
Definition: spell_item.cpp:459
@ SPELL_BRITTLE_ARMOR
Definition: spell_item.cpp:460
GoblinBombDispenser
Definition: spell_item.cpp:717
@ SPELL_MALFUNCTION_EXPLOSION
Definition: spell_item.cpp:719
@ SPELL_SUMMON_GOBLIN_BOMB
Definition: spell_item.cpp:718
FrozenShadoweave
@ SPELL_SHADOWMEND
TauntFlag
@ SPELL_TAUNT_FLAG
@ EMOTE_PLANTS_FLAG
MarkOfConquest
@ SPELL_MARK_OF_CONQUEST_ENERGIZE
SixDemonBagSpells
@ SPELL_FROSTBOLT
@ SPELL_SUMMON_FELHOUND_MINION
@ SPELL_FIREBALL
@ SPELL_CHAIN_LIGHTNING
@ SPELL_ENVELOPING_WINDS
@ SPELL_POLYMORPH
PygmyOil
@ SPELL_PYGMY_OIL_SMALLER_AURA
@ SPELL_PYGMY_OIL_PYGMY_AURA
AmalgamsSeventhSpine
@ SPELL_FRAGILE_ECHOES_DRUID
@ SPELL_FRAGILE_ECHO_ENERGIZE
@ SPELL_FRAGILE_ECHOES_PRIEST_DISCIPLINE
@ SPELL_FRAGILE_ECHOES_MONK
@ SPELL_FRAGILE_ECHOES_PALADIN
@ SPELL_FRAGILE_ECHOES_SHAMAN
@ SPELL_FRAGILE_ECHOES_PRIEST_HOLY
AegisOfPreservation
Definition: spell_item.cpp:95
@ SPELL_AEGIS_HEAL
Definition: spell_item.cpp:96
NetOMaticSpells
@ SPELL_NET_O_MATIC_TRIGGERED2
@ SPELL_NET_O_MATIC_TRIGGERED1
@ SPELL_NET_O_MATIC_TRIGGERED3
PetHealing
@ SPELL_HEALTH_LINK
ImpaleLeviroth
@ NPC_LEVIROTH
@ SPELL_LEVIROTH_SELF_IMPALE
SocretharsStone
@ SPELL_SOCRETHAR_FROM_SEAT
@ SPELL_SOCRETHAR_TO_SEAT
SeepingScourgewing
@ SPELL_ISOLATED_STRIKE
@ SPELL_SHADOW_STRIKE_AOE_CHECK
std::array< uint32, 20 > const CreateFortuneSpells
TrinketStackSpells
@ SPELL_LIGHTNING_CAPACITOR_AURA
@ SPELL_THUNDER_CAPACITOR_AURA
@ SPELL_TOC25_CASTER_TRINKET_HEROIC_TRIGGER
@ SPELL_LIGHTNING_CAPACITOR_TRIGGER
@ SPELL_TOC25_CASTER_TRINKET_HEROIC_STACK
@ SPELL_TOC25_CASTER_TRINKET_NORMAL_TRIGGER
@ SPELL_TOC25_CASTER_TRINKET_NORMAL_AURA
@ SPELL_THUNDER_CAPACITOR_TRIGGER
@ SPELL_TOC25_CASTER_TRINKET_NORMAL_STACK
@ SPELL_THUNDER_CAPACITOR_STACK
@ SPELL_LIGHTNING_CAPACITOR_STACK
@ SPELL_TOC25_CASTER_TRINKET_HEROIC_AURA
ExaltedSunwellNeck
@ SPELL_LIGHTS_STRENGTH
@ FACTION_ALDOR
@ SPELL_ARCANE_SURGE
@ SPELL_ARCANE_STRIKE
@ SPELL_LIGHTS_SALVATION
@ SPELL_ARCANE_INSIGHT
@ SPELL_LIGHTS_WARD
@ FACTION_SCRYERS
@ SPELL_LIGHTS_WRATH
@ SPELL_ARCANE_BOLT
MirrensDrinkingHat
@ SPELL_AERIE_PEAK_PALE_ALE
@ SPELL_STOUTHAMMER_LITE
@ SPELL_LOCH_MODAN_LAGER
DiscerningEyeBeastMisc
Definition: spell_item.cpp:967
@ SPELL_DISCERNING_EYE_BEAST
Definition: spell_item.cpp:968
AuraOfMadness
Definition: spell_item.cpp:351
@ SPELL_MARTYR_COMPLEX
Definition: spell_item.cpp:359
@ SPELL_NARCISSISM
Definition: spell_item.cpp:358
@ SPELL_DEMENTIA_NEG
Definition: spell_item.cpp:363
@ SPELL_SOCIOPATH
Definition: spell_item.cpp:352
@ SPELL_PARANOIA
Definition: spell_item.cpp:356
@ SPELL_DELUSIONAL
Definition: spell_item.cpp:353
@ SPELL_DEMENTIA_POS
Definition: spell_item.cpp:362
@ SPELL_KLEPTOMANIA
Definition: spell_item.cpp:354
@ SPELL_MANIC
Definition: spell_item.cpp:357
@ SPELL_MEGALOMANIA
Definition: spell_item.cpp:355
@ SPELL_DEMENTIA
Definition: spell_item.cpp:360
@ SAY_MADNESS
Definition: spell_item.cpp:365
CastSpellExtraArgs & SetTriggeringSpell(Spell const *triggeringSpell)
Definition: Spell.cpp:9403
TriggerCastFlags TriggerFlags
Definition: SpellDefines.h:478
CastSpellExtraArgs & AddSpellBP0(int32 val)
Definition: SpellDefines.h:475
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:474
ObjectGuid OriginalCastId
Definition: SpellDefines.h:484
Optional< int32 > OriginalCastItemLevel
Definition: SpellDefines.h:485
uint32 ArmorTypeMask
Definition: DB2Structure.h:652
constexpr float GetPositionZ() const
Definition: Position.h:78