TrinityCore
spell_quest.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 for quests.
20 * Ordered alphabetically using questId and scriptname.
21 * Scriptnames of files in this file should be prefixed with "spell_q#questID_".
22 */
23
24#include "ScriptMgr.h"
25#include "CellImpl.h"
26#include "CreatureAIImpl.h"
27#include "GridNotifiersImpl.h"
28#include "ObjectMgr.h"
29#include "Player.h"
30#include "ScriptedCreature.h"
31#include "SpellAuraEffects.h"
32#include "SpellScript.h"
33#include "Vehicle.h"
34
36{
37 private:
44
45 public:
46 spell_generic_quest_update_entry_SpellScript(uint16 spellEffect, uint8 effIndex, uint32 originalEntry, uint32 newEntry, bool shouldAttack, Milliseconds despawnTime = 0s) :
47 SpellScript(), _spellEffect(spellEffect), _effIndex(effIndex), _originalEntry(originalEntry),
48 _newEntry(newEntry), _shouldAttack(shouldAttack), _despawnTime(despawnTime) { }
49
50 void HandleDummy(SpellEffIndex /*effIndex*/)
51 {
52 if (Creature* creatureTarget = GetHitCreature())
53 if (!creatureTarget->IsPet() && creatureTarget->GetEntry() == _originalEntry)
54 {
55 creatureTarget->UpdateEntry(_newEntry);
56 if (_shouldAttack)
57 creatureTarget->EngageWithTarget(GetCaster());
58
59 if (_despawnTime != 0s)
60 creatureTarget->DespawnOrUnsummon(_despawnTime);
61 }
62 }
63
64 void Register() override
65 {
67 }
68};
69
70// http://www.wowhead.com/quest=55 Morbent Fel
72{
75};
76
77// 8913 - Sacred Cleansing
79{
80 public:
81 spell_q55_sacred_cleansing() : SpellScriptLoader("spell_q55_sacred_cleansing") { }
82
83 SpellScript* GetSpellScript() const override
84 {
86 }
87};
88
90{
92};
93
94// 9712 - Thaumaturgy Channel
96{
97 bool Validate(SpellInfo const* /*spellInfo*/) override
98 {
100 }
101
102 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
103 {
105 if (Unit* caster = GetCaster())
106 caster->CastSpell(caster, SPELL_THAUMATURGY_CHANNEL, false);
107 }
108
109 void Register() override
110 {
112 }
113};
114
115// http://www.wowhead.com/quest=6124 Curing the Sick (A)
116// http://www.wowhead.com/quest=6129 Curing the Sick (H)
118{
123};
124
126
127// 19512 - Apply Salve
129{
130 bool Load() override
131 {
132 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
133 }
134
135 void HandleDummy(SpellEffIndex /*effIndex*/)
136 {
137 Player* caster = GetCaster()->ToPlayer();
138 if (GetCastItem())
139 if (Creature* creatureTarget = GetHitCreature())
140 {
141 uint32 newEntry = 0;
142 switch (caster->GetTeam())
143 {
144 case HORDE:
145 if (creatureTarget->GetEntry() == NPC_SICKLY_GAZELLE)
146 newEntry = NPC_CURED_GAZELLE;
147 break;
148 case ALLIANCE:
149 if (creatureTarget->GetEntry() == NPC_SICKLY_DEER)
150 newEntry = NPC_CURED_DEER;
151 break;
152 default:
153 break;
154 }
155 if (newEntry)
156 {
157 creatureTarget->UpdateEntry(newEntry);
158 creatureTarget->DespawnOrUnsummon(Quest6124_6129_DESPAWN_TIME);
159 caster->KilledMonsterCredit(newEntry);
160 }
161 }
162 }
163
164 void Register() override
165 {
167 }
168};
169
170// http://www.wowhead.com/quest=10255 Testing the Antidote
172{
173 NPC_HELBOAR = 16880,
175};
176
177// 34665 - Administer Antidote
179{
180 public:
181 spell_q10255_administer_antidote() : SpellScriptLoader("spell_q10255_administer_antidote") { }
182
183 SpellScript* GetSpellScript() const override
184 {
186 }
187};
188
189// http://www.wowhead.com/quest=11396 Bring Down Those Shields (A)
190// http://www.wowhead.com/quest=11399 Bring Down Those Shields (H)
192{
196
197// 43874 - Scourge Mur'gul Camp: Force Shield Arcane Purple x3
199{
200 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
201 {
202 Unit* target = GetTarget();
203 target->SetImmuneToPC(true);
205 }
206
207 void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
208 {
209 GetTarget()->SetImmuneToPC(false);
210 }
211
212 void Register() override
213 {
216 }
217};
218
219// 50133 - Scourging Crystal Controller
221{
222 bool Validate(SpellInfo const* /*spellEntry*/) override
223 {
225 }
226
227 void HandleDummy(SpellEffIndex /*effIndex*/)
228 {
229 if (Unit* target = GetHitUnit())
230 if (target->GetTypeId() == TYPEID_UNIT && target->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3))
231 // Make sure nobody else is channeling the same target
232 if (!target->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER))
234 }
235
236 void Register() override
237 {
239 }
240};
241
242// 43882 - Scourging Crystal Controller Dummy
244{
245 bool Validate(SpellInfo const* /*spellEntry*/) override
246 {
248 }
249
250 void HandleDummy(SpellEffIndex /*effIndex*/)
251 {
252 if (Unit* target = GetHitUnit())
253 if (target->GetTypeId() == TYPEID_UNIT)
254 target->RemoveAurasDueToSpell(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3);
255 }
256
257 void Register() override
258 {
260 }
261};
262
263// http://www.wowhead.com/quest=11515 Blood for Blood
265{
269
270// 44936 - Quest - Fel Siphon Dummy
272{
273 public:
274 spell_q11515_fel_siphon_dummy() : SpellScriptLoader("spell_q11515_fel_siphon_dummy") { }
275
276 SpellScript* GetSpellScript() const override
277 {
279 }
280};
281
282// http://www.wowhead.com/quest=11730 Master and Servant
284{
297
298// 46023 - The Ultrasonic Screwdriver
300{
301 bool Load() override
302 {
303 return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem();
304 }
305
306 bool Validate(SpellInfo const* /*spellEntry*/) override
307 {
308 return ValidateSpellInfo(
309 {
316 });
317 }
318
319 void HandleDummy(SpellEffIndex /*effIndex*/)
320 {
321 Item* castItem = GetCastItem();
322 Unit* caster = GetCaster();
323 if (Creature* target = GetHitCreature())
324 {
325 uint32 spellId = 0;
326 switch (target->GetEntry())
327 {
329 case NPC_SENTRYBOT_57K: spellId = SPELL_SUMMON_SENTRYBOT_57K; break;
333 default:
334 return;
335 }
336 caster->CastSpell(caster, spellId, castItem);
337 caster->CastSpell(caster, SPELL_ROBOT_KILL_CREDIT, true);
338 target->DespawnOrUnsummon();
339 }
340 }
341
342 void Register() override
343 {
345 }
346};
347
348// http://www.wowhead.com/quest=12459 That Which Creates Can Also Destroy
350{
353
354 NPC_TURGID = 27808,
356
359};
360
361// 49587 - Seeds of Nature's Wrath
363{
364 void HandleDummy(SpellEffIndex /*effIndex*/)
365 {
366 if (Creature* creatureTarget = GetHitCreature())
367 {
368 uint32 uiNewEntry = 0;
369 switch (creatureTarget->GetEntry())
370 {
372 case NPC_TURGID: uiNewEntry = NPC_WEAK_TURGID; break;
373 case NPC_DEATHGAZE: uiNewEntry = NPC_WEAK_DEATHGAZE; break;
374 }
375 if (uiNewEntry)
376 creatureTarget->UpdateEntry(uiNewEntry);
377 }
378 }
379
380 void Register() override
381 {
383 }
384};
385
386// http://www.wowhead.com/quest=12634 Some Make Lemonade, Some Make Liquor
388{
394
395// 51840 - Despawn Fruit Tosser
397{
398 bool Validate(SpellInfo const* /*spellEntry*/) override
399 {
400 return ValidateSpellInfo(
401 {
406 });
407 }
408
409 void HandleDummy(SpellEffIndex /*effIndex*/)
410 {
412 switch (urand(0, 3))
413 {
414 case 1: spellId = SPELL_ORANGE_FALLS_TO_GROUND; break;
415 case 2: spellId = SPELL_PAPAYA_FALLS_TO_GROUND; break;
416 }
417 // sometimes, if you're lucky, you get a dwarf
418 if (roll_chance_i(5))
420 GetCaster()->CastSpell(GetCaster(), spellId, true);
421 }
422
423 void Register() override
424 {
426 }
427};
428
429// http://www.wowhead.com/quest=12851 Going Bearback
431{
438};
439
440// 54798 - FLAMING Arrow Triggered Effect
442{
443 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
444 {
445 if (Unit* caster = GetCaster())
446 {
447 Unit* target = GetTarget();
448 // Already in fire
449 if (target->HasAura(SPELL_ABLAZE))
450 return;
451
452 if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself())
453 {
454 switch (target->GetEntry())
455 {
456 case NPC_FROSTWORG:
457 target->CastSpell(player, SPELL_FROSTWORG_CREDIT, true);
458 target->CastSpell(target, SPELL_IMMOLATION, true);
459 target->CastSpell(target, SPELL_ABLAZE, true);
460 break;
461 case NPC_FROSTGIANT:
462 target->CastSpell(player, SPELL_FROSTGIANT_CREDIT, true);
463 target->CastSpell(target, SPELL_IMMOLATION, true);
464 target->CastSpell(target, SPELL_ABLAZE, true);
465 break;
466 }
467 }
468 }
469 }
470
471 void Register() override
472 {
474 }
475};
476
477// http://www.wowhead.com/quest=12659 Scalps!
479{
481};
482
483// 52090 - Ahunae's Knife
485{
486 bool Load() override
487 {
488 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
489 }
490
491 void HandleDummy(SpellEffIndex /*effIndex*/)
492 {
493 Player* caster = GetCaster()->ToPlayer();
494 if (Creature* target = GetHitCreature())
495 {
496 target->DespawnOrUnsummon();
498 }
499 }
500
501 void Register() override
502 {
504 }
505};
506
508{
510};
511
512// 54190 - Lifeblood Dummy
514{
515 bool Load() override
516 {
517 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
518 }
519
520 void HandleScript(SpellEffIndex /*effIndex*/)
521 {
522 Player* caster = GetCaster()->ToPlayer();
523 if (Creature* target = GetHitCreature())
524 {
526 target->CastSpell(target, uint32(GetEffectValue()), true);
527 target->DespawnOrUnsummon(2s);
528 }
529 }
530
531 void Register() override
532 {
534 }
535};
536
537/*
538 http://www.wowhead.com/quest=13283 King of the Mountain
539 http://www.wowhead.com/quest=13280 King of the Mountain
540 */
542{
549
550// 4338 - Plant Alliance Battle Standard
551// 59643 - Plant Horde Battle Standard
553{
554 void HandleDummy(SpellEffIndex /*effIndex*/)
555 {
556 Unit* caster = GetCaster();
557 Unit* target = GetHitUnit();
559
561 if (caster->IsVehicle())
562 if (Unit* player = caster->GetVehicleKit()->GetPassenger(0))
563 player->ToPlayer()->KilledMonsterCredit(NPC_KING_OF_THE_MOUNTAINT_KC);
564
566 triggeredSpellID = SPELL_HORDE_BATTLE_STANDARD_STATE;
567
568 target->RemoveAllAuras();
569 target->CastSpell(target, triggeredSpellID, true);
570 }
571
572 void Register() override
573 {
575 }
576};
577
578// 4336 - Jump Jets
580{
582 {
583 Unit* caster = GetCaster();
584 if (caster->IsVehicle())
585 if (Unit* rocketBunny = caster->GetVehicleKit()->GetPassenger(1))
586 rocketBunny->CastSpell(rocketBunny, SPELL_JUMP_ROCKET_BLAST, true);
587 }
588
589 void Register() override
590 {
592 }
593};
594
596{
598};
599
600// 50546 - The Focus on the Beach: Ley Line Focus Control Ring Effect
602{
603 void HandleDummy(SpellEffIndex /*effIndex*/)
604 {
605 if (Creature* target = GetHitCreature())
606 target->CastSpell(GetCaster(), SPELL_BUNNY_CREDIT_BEAM, false);
607 }
608
609 void Register() override
610 {
612 }
613};
614
616{
619
620// 49213 - Defending Wyrmrest Temple: Character Script Cast From Gossip
622{
623 void HandleScript(SpellEffIndex /*effIndex*/)
624 {
626 }
627
628 void Register() override
629 {
631 }
632};
633
634// http://www.wowhead.com/quest=12372 Defending Wyrmrest Temple
636{
637 // NPCs
640
641// 49370 - Wyrmrest Defender: Destabilize Azure Dragonshrine Effect
643{
644 void HandleDummy(SpellEffIndex /*effIndex*/)
645 {
646 if (GetHitCreature())
647 if (Unit* caster = GetOriginalCaster())
648 if (Vehicle* vehicle = caster->GetVehicleKit())
649 if (Unit* passenger = vehicle->GetPassenger(0))
650 if (Player* player = passenger->ToPlayer())
651 player->KilledMonsterCredit(NPC_WYRMREST_TEMPLE_CREDIT);
652 }
653
654 void Register() override
655 {
657 }
658};
659
660// "Bombing Run" and "Bomb Them Again!"
662{
663 // Spell
667 // NPCs
668 NPC_FEL_CANNON2 = 23082
670
671// 40113 - Knockdown Fel Cannon: The Aggro Check Aura
673{
674 void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
675 {
676 if (Unit* target = GetTarget())
677 // On trigger proccing
678 target->CastSpell(target, SPELL_AGGRO_CHECK);
679 }
680
681 void Register() override
682 {
684 }
685};
686
687// 40112 - Knockdown Fel Cannon: The Aggro Check
689{
690 void HandleDummy(SpellEffIndex /*effIndex*/)
691 {
692 if (Player* playerTarget = GetHitPlayer())
693 // Check if found player target is on fly mount or using flying form
694 if (playerTarget->HasAuraType(SPELL_AURA_FLY) || playerTarget->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
695 playerTarget->CastSpell(playerTarget, SPELL_FLAK_CANNON_TRIGGER, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
696 }
697
698 void Register() override
699 {
701 }
702};
703
704// 40119 - Knockdown Fel Cannon: The Aggro Burst
706{
707 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
708 {
709 if (Unit* target = GetTarget())
710 // On each tick cast Choose Loc to trigger summon
711 target->CastSpell(target, SPELL_CHOOSE_LOC);
712 }
713
714 void Register() override
715 {
717 }
718};
719
720// 40056 - Knockdown Fel Cannon: Choose Loc
722{
723 void HandleDummy(SpellEffIndex /*effIndex*/)
724 {
725 Unit* caster = GetCaster();
726 // Check for player that is in 65 y range
727 std::list<Player*> playerList;
728 Trinity::AnyPlayerInObjectRangeCheck checker(caster, 65.0f);
729 Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(caster, playerList, checker);
730 Cell::VisitWorldObjects(caster, searcher, 65.0f);
731 for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
732 // Check if found player target is on fly mount or using flying form
733 if ((*itr)->HasAuraType(SPELL_AURA_FLY) || (*itr)->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
734 // Summom Fel Cannon (bunny version) at found player
735 caster->SummonCreature(NPC_FEL_CANNON2, (*itr)->GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ());
736 }
737
738 void Register() override
739 {
741 }
742};
743
744// 39844 - Skyguard Blasting Charge
745// 40160 - Throw Bomb
747{
749 {
750 Unit* caster = GetCaster();
751 // This spell will be cast only if caster has one of these auras
754 return SPELL_CAST_OK;
755 }
756
757 void Register() override
758 {
760 }
761};
762
764{
767
768// 50894 - Zul'Drak Rat
770{
771 bool Validate(SpellInfo const* /*spell*/) override
772 {
774 }
775
777 {
778 if (GetHitAura() && GetHitAura()->GetStackAmount() >= GetSpellInfo()->StackAmount)
779 {
781 if (Creature* basilisk = GetHitUnit()->ToCreature())
782 basilisk->DespawnOrUnsummon();
783 }
784 }
785
786 void Register() override
787 {
789 }
790};
791
792// 55368 - Summon Stefan
794{
796 {
797 // Adjust effect summon position
798 Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f };
799 dest.RelocateOffset(offset);
800 }
801
802 void Register() override
803 {
805 }
806};
807
809{
812
813// 53350 - Quenching Mist
815{
816 bool Validate(SpellInfo const* /*spellInfo*/) override
817 {
819 }
820
821 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
822 {
824 }
825
826 void Register() override
827 {
829 }
830};
831
832// 13291 - Borrowed Technology/13292 - The Solution Solution /Daily//13239 - Volatility/13261 - Volatiliy /Daily//
834{
835 // NPCs
837 NPC_DECOY = 31578,
838 // Spells
839 SPELL_RIDE = 59319
841
842// 59318 - Grab Fake Soldier
844{
845 bool Validate(SpellInfo const* /*spell*/) override
846 {
847 return ValidateSpellInfo({ SPELL_RIDE });
848 }
849
850 void HandleDummy(SpellEffIndex /*effIndex*/)
851 {
852 if (!GetHitCreature())
853 return;
854 // TO DO: Being triggered is hack, but in checkcast it doesn't pass aurastate requirements.
855 // Beside that the decoy won't keep it's freeze animation state when enter.
857 }
858
859 void Register() override
860 {
862 }
863};
864
865// 59303 - Summon Frost Wyrm
867{
869 {
870 // Adjust effect summon position
871 Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f };
872 dest.RelocateOffset(offset);
873 }
874
875 void Register() override
876 {
878 }
879};
880
881// 12601 - Second Chances: Summon Landgren's Soul Moveto Target Bunny
883{
885 {
886 // Adjust effect summon position
887 Position const offset = { 0.0f, 0.0f, 2.5f, 0.0f };
888 dest.RelocateOffset(offset);
889 }
890
891 void Register() override
892 {
894 }
895};
896
897// 57385 - Argent Cannon
898// 57412 - Reckoning Bomb
900{
901 bool Validate(SpellInfo const* spellInfo) override
902 {
903 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } })
904 && ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
905 }
906
908 {
909 if (WorldLocation const* pos = GetExplTargetDest())
910 GetCaster()->CastSpell(pos->GetPosition(), GetEffectValue(), true);
911 }
912
913 void Register() override
914 {
916 }
917};
918
920{
923
929
931
939
940 SPELL_BURST_AT_THE_SEAMS_59576 = 59576, //script/knockback, That's Abominable
942 SPELL_BURST_AT_THE_SEAMS_52510 = 52510, //script/knockback, Fuel for the Fire
943 SPELL_BURST_AT_THE_SEAMS_52508 = 52508, //damage 20000
944 SPELL_BURST_AT_THE_SEAMS_59580 = 59580, //damage 50000
945
949
954
955// 59576 - Burst at the Seams
957{
958 bool Validate(SpellInfo const* /*spellInfo*/) override
959 {
960 return ValidateSpellInfo(
961 {
968 });
969 }
970
971 void HandleScript(SpellEffIndex /*effIndex*/)
972 {
973 if (Creature* creature = GetCaster()->ToCreature())
974 {
975 creature->CastSpell(creature, SPELL_BLOATED_ABOMINATION_FEIGN_DEATH, true);
976 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_59579, true);
977 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
978 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
979 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
980 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_MEAT, true);
981 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
982 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
983 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
984 }
985 }
986
987 void Register() override
988 {
990 }
991};
992
993// 59579 - Burst at the Seams
995{
996 void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
997 {
998 Unit* target = GetTarget();
999 target->CastSpell(target, SPELL_TROLL_EXPLOSION, true);
1000 target->CastSpell(target, SPELL_EXPLODE_ABOMINATION_MEAT, true);
1001 target->CastSpell(target, SPELL_EXPLODE_TROLL_MEAT, true);
1002 target->CastSpell(target, SPELL_EXPLODE_TROLL_MEAT, true);
1003 target->CastSpell(target, SPELL_EXPLODE_TROLL_BLOODY_MEAT, true);
1004 target->CastSpell(target, SPELL_BURST_AT_THE_SEAMS_BONE, true);
1005 }
1006
1007 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1008 {
1009 Unit* target = GetTarget();
1010 if (Unit* caster = GetCaster())
1011 {
1012 switch (target->GetEntry())
1013 {
1014 case NPC_ICY_GHOUL:
1016 break;
1017 case NPC_VICIOUS_GEIST:
1019 break;
1022 break;
1023 }
1024 }
1025 target->CastSpell(target, SPELL_BURST_AT_THE_SEAMS_59580, true);
1026 }
1027
1028 void Register() override
1029 {
1032 }
1033};
1034
1035// 52593 - Bloated Abomination Feign Death
1037{
1038 void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1039 {
1040 Unit* target = GetTarget();
1043
1044 if (Creature* creature = target->ToCreature())
1045 creature->SetReactState(REACT_PASSIVE);
1046 }
1047
1048 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1049 {
1050 Unit* target = GetTarget();
1051 if (Creature* creature = target->ToCreature())
1052 creature->DespawnOrUnsummon();
1053 }
1054
1055 void Register() override
1056 {
1059 }
1060};
1061
1062// 76245 - Area Restrict Abom
1064{
1065 void HandleScript(SpellEffIndex /*effIndex*/)
1066 {
1067 if (Creature* creature = GetHitCreature()) {
1068 uint32 area = creature->GetAreaId();
1070 creature->DespawnOrUnsummon();
1071 }
1072 }
1073
1074 void Register() override
1075 {
1077 }
1078};
1079
1080// 59590 - Assign Ghoul Kill Credit to Master
1081// 60039 - Assign Skeleton Kill Credit to Master
1082// 60041 - Assign Geist Kill Credit to Master
1084{
1085 void HandleScript(SpellEffIndex /*effIndex*/)
1086 {
1087 if (Unit* target = GetHitUnit())
1088 {
1089 if (Unit* owner = target->GetOwner())
1090 {
1091 owner->CastSpell(owner, GetEffectValue(), true);
1092 }
1093 }
1094 }
1095
1096 void Register() override
1097 {
1099 }
1100};
1101
1102// 52510 - Burst at the Seams
1104{
1105 bool Validate(SpellInfo const* /*spellInfo*/) override
1106 {
1107 return ValidateSpellInfo(
1108 {
1115 });
1116 }
1117
1118 bool Load() override
1119 {
1120 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1121 }
1122
1124 {
1125 if (Unit* creature = GetHitCreature())
1126 {
1127 if (Unit* charmer = GetCaster()->GetCharmerOrOwner())
1128 {
1129 if (Player* player = charmer->ToPlayer())
1130 {
1131 if (player->GetQuestStatus(QUEST_FUEL_FOR_THE_FIRE) == QUEST_STATUS_INCOMPLETE)
1132 {
1133 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
1134 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_MEAT, true);
1135 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
1136 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_52508, true);
1137 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_59580, true);
1138
1139 player->CastSpell(player, SPELL_DRAKKARI_SKULLCRUSHER_CREDIT, true);
1140 uint16 count = player->GetReqKillOrCastCurrentCount(QUEST_FUEL_FOR_THE_FIRE, NPC_DRAKKARI_CHIEFTAINK);
1141 if ((count % 20) == 0)
1142 player->CastSpell(player, SPELL_SUMMON_DRAKKARI_CHIEFTAIN, true);
1143 }
1144 }
1145 }
1146 }
1147 }
1148
1149 void HandleScript(SpellEffIndex /*effIndex*/)
1150 {
1152 }
1153
1154 void Register() override
1155 {
1158 }
1159};
1160
1162{
1163 SPELL_SUMMON_WORGEN = 48681
1165
1166// 48682 - Escape from Silverbrook - Periodic Dummy
1168{
1169 bool Validate(SpellInfo const* /*spellInfo*/) override
1170 {
1172 }
1173
1174 void HandleDummy(SpellEffIndex /*effIndex*/)
1175 {
1177 }
1178
1179 void Register() override
1180 {
1182 }
1183};
1184
1185// 48681 - Summon Silverbrook Worgen
1187{
1189 {
1190 float dist = GetEffectInfo(EFFECT_0).CalcRadius(GetCaster());
1191 float angle = frand(0.75f, 1.25f) * float(M_PI);
1192
1193 Position pos = GetCaster()->GetNearPosition(dist, angle);
1194 dest.Relocate(pos);
1195 }
1196
1197 void Register() override
1198 {
1200 }
1201};
1202
1204{
1209
1215
1216// 51858 - Siphon of Acherus
1218{
1219 bool Validate(SpellInfo const* /*spellInfo*/) override
1220 {
1221 return ValidateSpellInfo(
1222 {
1227 });
1228 }
1229
1230 void HandleDummy(SpellEffIndex /*effIndex*/)
1231 {
1232 uint32 spellId = 0;
1233
1234 switch (GetHitCreature()->GetEntry())
1235 {
1237 spellId = SPELL_FORGE_CREDIT;
1238 break;
1240 spellId = SPELL_TOWN_HALL_CREDIT;
1241 break;
1242 case NPC_SCARLET_HOLD:
1243 spellId = SPELL_SCARLET_HOLD_CREDIT;
1244 break;
1246 spellId = SPELL_CHAPEL_CREDIT;
1247 break;
1248 default:
1249 return;
1250 }
1251
1252 GetCaster()->CastSpell(nullptr, spellId, true);
1253 }
1254
1255 void Register() override
1256 {
1258 }
1259};
1260
1262{
1263 THE_EYE_OF_ACHERUS = 51852
1265
1266// 52694 - Recall Eye of Acherus
1268{
1269 void HandleDummy(SpellEffIndex /*effIndex*/)
1270 {
1271 if (Player* player = GetCaster()->GetCharmerOrOwner()->ToPlayer())
1272 {
1273 player->StopCastingCharm();
1274 player->StopCastingBindSight();
1275 player->RemoveAura(THE_EYE_OF_ACHERUS);
1276 }
1277 }
1278
1279 void Register() override
1280 {
1282 }
1283};
1284
1285// 51769 - Emblazon Runeblade
1287{
1289 {
1291 if (Unit* caster = GetCaster())
1292 caster->CastSpell(caster, aurEff->GetSpellEffectInfo().TriggerSpell, aurEff);
1293 }
1294
1295 void Register() override
1296 {
1298 }
1299};
1300
1301// 51770 - Emblazon Runeblade
1303{
1304 void HandleScript(SpellEffIndex /*effIndex*/)
1305 {
1307 }
1308
1309 void Register() override
1310 {
1312 }
1313};
1314
1316{
1318 SPELL_GRABBED = 55424
1320
1321// 55516 - Gymer's Grab
1323{
1324 bool Validate(SpellInfo const* /*spell*/) override
1325 {
1327 }
1328
1329 void HandleScript(SpellEffIndex /*effIndex*/)
1330 {
1331 if (!GetHitCreature())
1332 return;
1334 args.AddSpellBP0(2);
1337 }
1338
1339 void Register() override
1340 {
1342 }
1343};
1344
1346{
1349
1350// 55421 - Gymer's Throw
1352{
1353 void HandleScript(SpellEffIndex /*effIndex*/)
1354 {
1355 Unit* caster = GetCaster();
1356 if (caster->IsVehicle())
1357 if (Unit* passenger = caster->GetVehicleKit()->GetPassenger(1))
1358 {
1359 passenger->ExitVehicle();
1360 caster->CastSpell(passenger, SPELL_VARGUL_EXPLOSION, true);
1361 }
1362 }
1363
1364 void Register() override
1365 {
1367 }
1368};
1369
1371{
1374
1375// 61752 - Illidan Kill Credit Master
1377{
1378 bool Validate(SpellInfo const* /*spellInfo*/) override
1379 {
1381 }
1382
1383 void HandleDummy(SpellEffIndex /*effIndex*/)
1384 {
1385 Unit* caster = GetCaster();
1386 if (caster->IsVehicle())
1387 if (Unit* passenger = caster->GetVehicleKit()->GetPassenger(0))
1388 passenger->CastSpell(passenger, SPELL_ILLIDAN_KILL_CREDIT, true);
1389 }
1390
1391 void Register() override
1392 {
1394 }
1395};
1396
1398{
1401
1402// 66744 - Make Player Destroy Totems
1404{
1405 bool Validate(SpellInfo const* /*spellInfo*/) override
1406 {
1408 }
1409
1411 {
1412 if (Player* player = GetHitPlayer())
1413 player->CastSpell(player, SPELL_TOTEM_OF_THE_EARTHEN_RING, TRIGGERED_FULL_MASK); // ignore reagent cost, consumed by quest
1414 }
1415
1416 void Register() override
1417 {
1419 }
1420};
1421
1423{
1427
1428// 39238 - Fumping
1430{
1431 bool Validate(SpellInfo const* /*spell*/) override
1432 {
1434 }
1435
1436 void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1437 {
1438 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
1439 return;
1440
1441 if (Unit* caster = GetCaster())
1442 caster->CastSpell(caster, urand(SPELL_SUMMON_SAND_GNOME, SPELL_SUMMON_BONE_SLICER), true);
1443 }
1444
1445 void Register() override
1446 {
1448 }
1449};
1450
1452{
1456
1457// 93072 - Get Our Boys Back Dummy
1459{
1460public:
1461 spell_q28813_get_our_boys_back_dummy() : SpellScriptLoader("spell_q28813_get_our_boys_back_dummy") { }
1462
1464 {
1465 bool Validate(SpellInfo const* /*spellInfo*/) override
1466 {
1468 }
1469
1471 {
1472 Unit* caster = GetCaster();
1473
1474 if (Creature* injuredStormwindInfantry = caster->FindNearestCreature(NPC_INJURED_STORMWIND_INFANTRY, 5.0f, true))
1475 {
1476 injuredStormwindInfantry->SetCreatorGUID(caster->GetGUID());
1477 injuredStormwindInfantry->CastSpell(injuredStormwindInfantry, SPELL_RENEWED_LIFE, true);
1478 }
1479 }
1480
1481 void Register() override
1482 {
1484 }
1485 };
1486
1487 SpellScript* GetSpellScript() const override
1488 {
1490 }
1491};
1492
1493// 53034 - Set Health Random
1495{
1496public:
1497 spell_q28813_set_health_random() : SpellScriptLoader("spell_q28813_set_health_random") { }
1498
1500 {
1502 {
1503 Unit* caster = GetCaster();
1504 caster->SetHealth(caster->CountPctFromMaxHealth(urand(3, 5)*10));
1505 }
1506
1507 void Register() override
1508 {
1510 }
1511 };
1512
1513 SpellScript* GetSpellScript() const override
1514 {
1516 }
1517};
1518
1519// 49285 - Hand Over Reins
1521{
1522 void HandleScript(SpellEffIndex /*effIndex*/)
1523 {
1524 Creature* caster = GetCaster()->ToCreature();
1526
1527 if (caster)
1528 caster->DespawnOrUnsummon();
1529 }
1530
1531 void Register() override
1532 {
1534 }
1535};
1536
1537// 13790 13793 13811 13814 - Among the Champions
1538// 13665 13745 13750 13756 13761 13767 13772 13777 13782 13787 - The Grand Melee
1540{
1541 void HandleScript(SpellEffIndex /*effIndex*/)
1542 {
1544 target->CastSpell(target, uint32(GetEffectValue()), true);
1545 }
1546
1547 void Register() override
1548 {
1550 }
1551};
1552
1554{
1560
1562
1564 TALK_1 = 1
1566
1567// 43972 - Mixing Blood
1569{
1570 void HandleEffect(SpellEffIndex /*effIndex*/)
1571 {
1572 if (Unit* caster = GetCaster())
1573 if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f))
1574 trigger->AI()->DoCastSelf(SPELL_SPURTS_AND_SMOKE);
1575 }
1576
1577 void Register() override
1578 {
1580 }
1581};
1582
1583// 43375 - Mixing Vrykul Blood
1585{
1586 void HandleDummy(SpellEffIndex /*effIndex*/)
1587 {
1588 if (Unit* caster = GetCaster())
1589 {
1590 uint8 chance = urand(0, 99);
1591 uint32 spellId = 0;
1592
1593 // 90% chance of getting one out of three failure effects
1594 if (chance < 30)
1595 spellId = SPELL_FAILED_MIX_1;
1596 else if (chance < 60)
1597 spellId = SPELL_FAILED_MIX_2;
1598 else if (chance < 90)
1599 spellId = SPELL_FAILED_MIX_3;
1600 else // 10% chance of successful cast
1601 spellId = SPELL_SUCCESSFUL_MIX;
1602
1603 caster->CastSpell(caster, spellId, true);
1604 }
1605 }
1606
1607 void Register() override
1608 {
1610 }
1611};
1612
1613// 43376 - Failed Mix
1615{
1616 void HandleEffect(SpellEffIndex /*effIndex*/)
1617 {
1618 if (Unit* caster = GetCaster())
1619 if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f))
1620 trigger->AI()->Talk(TALK_0, caster);
1621 }
1622
1623 void Register() override
1624 {
1626 }
1627};
1628
1629// 43378 - Failed Mix
1631{
1632 void HandleEffect(SpellEffIndex /*effIndex*/)
1633 {
1634 if (Unit* caster = GetCaster())
1635 if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f))
1636 trigger->AI()->Talk(TALK_1, caster);
1637 }
1638
1639 void Register() override
1640 {
1642 }
1643};
1644
1645// 46444 - Weakness to Lightning: Cast on Master Script Effect
1647{
1648 void HandleScript(SpellEffIndex /*effIndex*/)
1649 {
1650 if (Unit* target = GetHitUnit())
1651 {
1652 if (Unit* owner = target->GetOwner())
1653 {
1654 target->CastSpell(owner, GetEffectValue(), true);
1655 }
1656 }
1657 }
1658
1659 void Register() override
1660 {
1662 }
1663};
1664
1666{
1702 SPELL_TAME_MISTBAT_1 = 30104
1704
1706{
1707 bool Validate(SpellInfo const* /*spellInfo*/) override
1708 {
1709 return ValidateSpellInfo(
1710 {
1729 });
1730 }
1731
1732 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1733 {
1734 if (!GetCaster() || !GetCaster()->IsAlive() || !GetTarget()->IsAlive())
1735 return;
1736
1737 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
1738 return;
1739
1740 uint32 finalSpellId = 0;
1741 switch (GetId())
1742 {
1743 case SPELL_TAME_ICE_CLAW_BEAR: finalSpellId = SPELL_TAME_ICE_CLAW_BEAR_1; break;
1744 case SPELL_TAME_LARGE_CRAG_BOAR: finalSpellId = SPELL_TAME_LARGE_CRAG_BOAR_1; break;
1745 case SPELL_TAME_SNOW_LEOPARD: finalSpellId = SPELL_TAME_SNOW_LEOPARD_1; break;
1747 case SPELL_TAME_PRAIRIE_STALKER: finalSpellId = SPELL_TAME_PRAIRIE_STALKER_1; break;
1748 case SPELL_TAME_SWOOP: finalSpellId = SPELL_TAME_SWOOP_1; break;
1749 case SPELL_TAME_WEBWOOD_LURKER: finalSpellId = SPELL_TAME_WEBWOOD_LURKER_1; break;
1751 case SPELL_TAME_SURF_CRAWLER: finalSpellId = SPELL_TAME_SURF_CRAWLER_1; break;
1752 case SPELL_TAME_ARMORED_SCORPID: finalSpellId = SPELL_TAME_ARMORED_SCORPID_1; break;
1755 case SPELL_TAME_BARBED_CRAWLER: finalSpellId = SPELL_TAME_BARBED_CRAWLER_1; break;
1757 case SPELL_TAME_NIGHTSTALKER: finalSpellId = SPELL_TAME_NIGHTSTALKER_1; break;
1759 case SPELL_TAME_ELDER_SPRINGPAW: finalSpellId = SPELL_TAME_ELDER_SPRINGPAW_1; break;
1760 case SPELL_TAME_MISTBAT: finalSpellId = SPELL_TAME_MISTBAT_1; break;
1761 }
1762
1763 if (finalSpellId)
1764 GetCaster()->CastSpell(GetTarget(), finalSpellId, true);
1765 }
1766
1767 void Register() override
1768 {
1770 }
1771};
1772
1773// 53099, 57896, 58418, 58420, 59064, 59065, 59439, 60900, 60940
1775{
1776 bool Validate(SpellInfo const* spellInfo) override
1777 {
1778 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } })
1779 && ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) })
1780 && sObjectMgr->GetQuestTemplate(uint32(spellInfo->GetEffect(EFFECT_1).CalcValue()));
1781 }
1782
1784 {
1785 Player* target = GetHitPlayer();
1786 if (!target)
1787 return;
1788
1789 uint32 spellId = GetEffectInfo().CalcValue();
1791
1792 // This probably should be a way to throw error in SpellCastResult
1793 if (target->IsActiveQuest(questId))
1794 target->CastSpell(target, spellId, true);
1795 }
1796
1797 void Register() override
1798 {
1800 }
1801};
1802
1804{
1816
1817// 24194 - Uther's Tribute
1818// 24195 - Grom's Tribute
1820{
1821 bool Validate(SpellInfo const* /*spellInfo*/) override
1822 {
1823 return ValidateSpellInfo(
1824 {
1830 });
1831 }
1832
1833 void HandleScript(SpellEffIndex /*effIndex*/)
1834 {
1835 Player* caster = GetCaster()->ToPlayer();
1836 if (!caster)
1837 return;
1838
1839 uint32 spell = 0;
1840 switch (caster->GetRace())
1841 {
1842 case RACE_TROLL: spell = SPELL_GROMS_TROLL_TRIBUTE; break;
1843 case RACE_TAUREN: spell = SPELL_GROMS_TAUREN_TRIBUTE; break;
1845 case RACE_ORC: spell = SPELL_GROMS_ORC_TRIBUTE; break;
1846 case RACE_BLOODELF: spell = SPELL_GROMS_BLOODELF_TRIBUTE; break;
1847 case RACE_HUMAN: spell = SPELL_UTHERS_HUMAN_TRIBUTE; break;
1848 case RACE_GNOME: spell = SPELL_UTHERS_GNOME_TRIBUTE; break;
1849 case RACE_DWARF: spell = SPELL_UTHERS_DWARF_TRIBUTE; break;
1850 case RACE_NIGHTELF: spell = SPELL_UTHERS_NIGHTELF_TRIBUTE; break;
1851 case RACE_DRAENEI: spell = SPELL_UTHERS_DRAENEI_TRIBUTE; break;
1852 default: break;
1853 }
1854
1855 if (spell)
1856 caster->CastSpell(caster, spell);
1857 }
1858
1859 void Register() override
1860 {
1862 }
1863};
1864
1865/*######
1866## Quest 14386 Leader of the Pack
1867######*/
1868
1870{
1871 NPC_ATTACK_MASTIFF = 36405
1873
1874// 68682 Call Attack Mastiffs
1876{
1878 {
1879 Unit* caster = GetCaster();
1880 caster->SummonCreature(NPC_ATTACK_MASTIFF, -1944.573f, 2657.402f, 0.994939f, 1.691919f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1s);
1881 caster->SummonCreature(NPC_ATTACK_MASTIFF, -2005.65f, 2663.526f, -2.086935f, 0.5942355f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1s);
1882 caster->SummonCreature(NPC_ATTACK_MASTIFF, -1996.506f, 2651.347f, -1.011707f, 0.8185352f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1s);
1883 caster->SummonCreature(NPC_ATTACK_MASTIFF, -1972.352f, 2640.07f, 1.080288f, 1.217854f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1s);
1884 caster->SummonCreature(NPC_ATTACK_MASTIFF, -1949.322f, 2642.76f, 1.242482f, 1.58074f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1s);
1885 caster->SummonCreature(NPC_ATTACK_MASTIFF, -1993.94f, 2672.535f, -2.322549f, 0.5766209f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1s);
1886 caster->SummonCreature(NPC_ATTACK_MASTIFF, -1982.724f, 2662.8f, -1.773986f, 0.8628055f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1s);
1887 caster->SummonCreature(NPC_ATTACK_MASTIFF, -1973.301f, 2655.475f, -0.7831049f, 1.098415f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1s);
1888 caster->SummonCreature(NPC_ATTACK_MASTIFF, -1956.509f, 2650.655f, 1.350571f, 1.441473f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1s);
1889 }
1890
1891 void Register() override
1892 {
1894 }
1895};
1897{
1959}
#define M_PI
Definition: Common.h:115
T GetEntry(std::unordered_map< uint32, T > const &map, CriteriaTreeEntry const *tree)
uint8_t uint8
Definition: Define.h:144
uint16_t uint16
Definition: Define.h:143
uint32_t uint32
Definition: Define.h:142
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:29
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition: ObjectDefines.h:66
@ TYPEID_UNIT
Definition: ObjectGuid.h:40
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
#define sObjectMgr
Definition: ObjectMgr.h:1946
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:145
@ RACE_TROLL
Definition: RaceMask.h:35
@ RACE_UNDEAD_PLAYER
Definition: RaceMask.h:32
@ RACE_ORC
Definition: RaceMask.h:29
@ RACE_DRAENEI
Definition: RaceMask.h:38
@ RACE_NIGHTELF
Definition: RaceMask.h:31
@ RACE_BLOODELF
Definition: RaceMask.h:37
@ RACE_DWARF
Definition: RaceMask.h:30
@ RACE_GNOME
Definition: RaceMask.h:34
@ RACE_HUMAN
Definition: RaceMask.h:28
@ RACE_TAUREN
Definition: RaceMask.h:33
float frand(float min, float max)
Definition: Random.cpp:55
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
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_1
Definition: SharedDefines.h:31
@ EFFECT_0
Definition: SharedDefines.h:30
@ EFFECT_2
Definition: SharedDefines.h:32
@ TARGET_DEST_CASTER_BACK
@ TARGET_DEST_CASTER_SUMMON
@ TARGET_DEST_CASTER
@ EMOTE_ONESHOT_ROAR
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_SEND_EVENT
@ SPELL_EFFECT_KNOCK_BACK
@ ALLIANCE
@ HORDE
SpellCastResult
@ SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW
@ SPELL_CAST_OK
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_BY_EXPIRE
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_DUMMY
@ SPELL_AURA_FLY
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:266
@ TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE
Will ignore mounted/on vehicle restrictions.
Definition: SpellDefines.h:260
#define SpellCheckCastFn(F)
Definition: SpellScript.h:830
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
#define SpellCastFn(F)
Definition: SpellScript.h:825
#define SpellDestinationTargetSelectFn(F, I, N)
Definition: SpellScript.h:874
#define AuraEffectApplyFn(F, I, N, M)
Definition: SpellScript.h:2029
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:2040
@ UNIT_FLAG2_FEIGN_DEATH
Definition: UnitDefines.h:194
@ REACT_PASSIVE
Definition: UnitDefines.h:506
@ UNIT_FLAG3_FAKE_DEAD
Definition: UnitDefines.h:259
@ UNIT_STATE_ROOT
Definition: Unit.h:265
SpellEffectInfo const & GetSpellEffectInfo() const
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
Definition: SpellScript.h:2039
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2045
HookList< EffectApplyHandler > AfterEffectApply
Definition: SpellScript.h:2028
Unit * GetCaster() const
Unit * GetTarget() const
HookList< EffectApplyHandler > OnEffectRemove
Definition: SpellScript.h:2035
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:2024
uint32 GetId() const
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Definition: Creature.cpp:2415
Definition: Item.h:170
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
void KilledMonsterCredit(uint32 entry, ObjectGuid guid=ObjectGuid::Empty)
Definition: Player.cpp:16680
bool IsActiveQuest(uint32 quest_id) const
Definition: Player.cpp:14575
Team GetTeam() const
Definition: Player.h:2235
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 CalcRadius(WorldObject *caster=nullptr, SpellTargetIndex targetIndex=SpellTargetIndex::TargetA, Spell *=nullptr) const
Definition: SpellInfo.cpp:673
uint32 const Id
Definition: SpellInfo.h:325
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition: SpellInfo.h:577
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< CheckCastHandler > OnCheckCast
Definition: SpellScript.h:829
Creature * GetHitCreature() const
Player * GetHitPlayer() const
Unit * GetCaster() const
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
Definition: SpellScript.h:873
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:839
Unit * GetHitUnit() const
int32 GetEffectValue() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
Item * GetCastItem() const
HookList< CastHandler > OnCast
Definition: SpellScript.h:822
Aura * GetHitAura(bool dynObjAura=false) const
WorldLocation const * GetExplTargetDest() const
SpellInfo const * GetSpellInfo() const
Unit * GetOriginalCaster() const
Definition: Unit.h:627
bool IsVehicle() const
Definition: Unit.h:743
void SetImmuneToPC(bool apply, bool keepCombat)
Definition: Unit.cpp:8101
void SetHealth(uint64 val)
Definition: Unit.cpp:9346
void SetUnitFlag3(UnitFlags3 flags)
Definition: Unit.h:843
void SetUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:838
void AddUnitState(uint32 f)
Definition: Unit.h:731
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4674
uint64 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:785
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4664
void RemoveAllAuras()
Definition: Unit.cpp:4242
void HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
Definition: Unit.cpp:1598
Vehicle * GetVehicleKit() const
Definition: Unit.h:1711
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
uint8 GetRace() const
Definition: Unit.h:749
virtual void ExitVehicle(Position const *exitPosition=nullptr)
Definition: Unit.cpp:12204
Unit * GetPassenger(int8 seatId) const
Gets a passenger on specified seat.
Definition: Vehicle.cpp:291
Unit * GetCharmerOrOwnerOrSelf() const
Definition: Object.cpp:2244
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition: Object.cpp:2025
Unit * GetOwner() const
Definition: Object.cpp:2229
Position GetNearPosition(float dist, float angle)
Definition: Object.cpp:3409
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2148
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition: Object.cpp:2252
Definition: spell_quest.cpp:36
uint8 _effIndex
Definition: spell_quest.cpp:39
Milliseconds _despawnTime
Definition: spell_quest.cpp:43
void HandleDummy(SpellEffIndex)
Definition: spell_quest.cpp:50
spell_generic_quest_update_entry_SpellScript(uint16 spellEffect, uint8 effIndex, uint32 originalEntry, uint32 newEntry, bool shouldAttack, Milliseconds despawnTime=0s)
Definition: spell_quest.cpp:46
bool _shouldAttack
Definition: spell_quest.cpp:42
uint32 _newEntry
Definition: spell_quest.cpp:41
uint32 _originalEntry
Definition: spell_quest.cpp:40
uint16 _spellEffect
Definition: spell_quest.cpp:38
void Register() override
Definition: spell_quest.cpp:64
SpellScript * GetSpellScript() const override
void Register() override
bool Validate(SpellInfo const *) override
void HandleEffectRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleEffectPeriodic(AuraEffect const *)
void HandleTriggerSpell(AuraEffect const *)
void HandleEffect(SpellEffIndex)
void HandleEffect(SpellEffIndex)
void HandleEffect(SpellEffIndex)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
void HandleEffectRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
SpellScript * GetSpellScript() const override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *) override
void Register() override
void HandleScriptEffect(SpellEffIndex)
void HandleEffectPeriodic(AuraEffect const *aurEff)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleEffectPeriodic(AuraEffect const *)
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
void SetDest(SpellDestination &dest)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void Register() override
void HandleScript(SpellEffIndex)
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *spellInfo) override
void HandleEffectDummy(SpellEffIndex)
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleApply(AuraEffect const *, AuraEffectHandleModes)
void HandleApply(AuraEffect const *, AuraEffectHandleModes)
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleEffectPeriodic(AuraEffect const *)
bool Validate(SpellInfo const *) override
Definition: spell_quest.cpp:97
SpellScript * GetSpellScript() const override
SpellScript * GetSpellScript() const override
SpellScript * GetSpellScript() const override
Definition: spell_quest.cpp:83
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *spellInfo) override
void HandleScriptEffect(SpellEffIndex)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
TamingTheBeast
@ SPELL_TAME_SURF_CRAWLER
@ SPELL_TAME_SNOW_LEOPARD_1
@ SPELL_TAME_GREATER_TIMBERSTRIDER_1
@ SPELL_TAME_ELDER_SPRINGPAW_1
@ SPELL_TAME_PRAIRIE_STALKER
@ SPELL_TAME_WEBWOOD_LURKER_1
@ SPELL_TAME_LARGE_CRAG_BOAR
@ SPELL_TAME_MISTBAT
@ SPELL_TAME_STRIGID_SCREECHER_1
@ SPELL_TAME_NIGHTSTALKER_1
@ SPELL_TAME_NIGHTSABER_STALKER
@ SPELL_TAME_ELDER_SPRINGPAW
@ SPELL_TAME_ARMORED_SCORPID
@ SPELL_TAME_ICE_CLAW_BEAR
@ SPELL_TAME_CRAZED_DRAGONHAWK_1
@ SPELL_TAME_CRAZED_DRAGONHAWK
@ SPELL_TAME_ICE_CLAW_BEAR_1
@ SPELL_TAME_ARMORED_SCORPID_1
@ SPELL_TAME_WEBWOOD_LURKER
@ SPELL_TAME_DIRE_MOTTLED_BOAR_1
@ SPELL_TAME_STRIGID_SCREECHER
@ SPELL_TAME_BARBED_CRAWLER
@ SPELL_TAME_SWOOP
@ SPELL_TAME_SURF_CRAWLER_1
@ SPELL_TAME_LARGE_CRAG_BOAR_1
@ SPELL_TAME_NIGHTSTALKER
@ SPELL_TAME_BARBED_CRAWLER_1
@ SPELL_TAME_ADULT_PLAINSTRIDER
@ SPELL_TAME_GREATER_TIMBERSTRIDER
@ SPELL_TAME_SWOOP_1
@ SPELL_TAME_DIRE_MOTTLED_BOAR
@ SPELL_TAME_PRAIRIE_STALKER_1
@ SPELL_TAME_NIGHTSABER_STALKER_1
@ SPELL_TAME_SNOW_LEOPARD
@ SPELL_TAME_MISTBAT_1
@ SPELL_TAME_ADULT_PLAINSTRIDER_1
FocusOnTheBeach
@ SPELL_BUNNY_CREDIT_BEAM
Quest13291_13292_13239_13261Data
@ NPC_DECOY
@ SPELL_RIDE
@ NPC_SKYTALON
ApplyHeatAndStir
@ SPELL_FAILED_MIX_1
@ CREATURE_GENERIC_TRIGGER_LAB
@ SPELL_SUCCESSFUL_MIX
@ SPELL_FAILED_MIX_3
@ SPELL_SPURTS_AND_SMOKE
@ TALK_1
@ TALK_0
@ SPELL_FAILED_MIX_2
Quest12459Data
@ NPC_REANIMATED_FROSTWYRM
@ NPC_WEAK_REANIMATED_FROSTWYRM
@ NPC_TURGID
@ NPC_DEATHGAZE
@ NPC_WEAK_DEATHGAZE
@ NPC_WEAK_TURGID
Quest_The_Hunter_And_The_Prince
@ SPELL_ILLIDAN_KILL_CREDIT
SalvagingLifesStength
@ NPC_SHARD_KILL_CREDIT
TributeSpells
@ SPELL_UTHERS_DRAENEI_TRIBUTE
@ SPELL_GROMS_TAUREN_TRIBUTE
@ SPELL_UTHERS_HUMAN_TRIBUTE
@ SPELL_UTHERS_GNOME_TRIBUTE
@ SPELL_UTHERS_NIGHTELF_TRIBUTE
@ SPELL_GROMS_ORC_TRIBUTE
@ SPELL_GROMS_TROLL_TRIBUTE
@ SPELL_GROMS_BLOODELF_TRIBUTE
@ SPELL_UTHERS_DWARF_TRIBUTE
@ SPELL_GROMS_UNDEAD_TRIBUTE
DefendingWyrmrestTemple
@ SPELL_SUMMON_WYRMREST_DEFENDER
Quest12372Data
@ NPC_WYRMREST_TEMPLE_CREDIT
Quest11730Data
@ SPELL_SUMMON_SENTRYBOT_57K
@ SPELL_SUMMON_SCAVENGEBOT_004A8
@ NPC_DEFENDOTANK_66D
@ SPELL_SUMMON_55D_COLLECTATRON
@ SPELL_SUMMON_SCAVENGEBOT_005B6
@ NPC_SCAVENGEBOT_004A8
@ NPC_SCAVENGEBOT_005B6
@ NPC_SENTRYBOT_57K
@ SPELL_SUMMON_DEFENDOTANK_66D
@ SPELL_ROBOT_KILL_CREDIT
@ NPC_55D_COLLECTATRON
CallAttackMastiffs
@ NPC_ATTACK_MASTIFF
Quest_The_Storm_King_Throw
@ SPELL_VARGUL_EXPLOSION
BattleStandard
@ SPELL_PLANT_HORDE_BATTLE_STANDARD
@ SPELL_ALLIANCE_BATTLE_STANDARD_STATE
@ SPELL_HORDE_BATTLE_STANDARD_STATE
@ SPELL_JUMP_ROCKET_BLAST
@ NPC_KING_OF_THE_MOUNTAINT_KC
SpellZuldrakRat
@ SPELL_SUMMON_GORGED_LURKING_BASILISK
Quest12851Data
@ SPELL_IMMOLATION
@ SPELL_ABLAZE
@ SPELL_FROSTGIANT_CREDIT
@ SPELL_FROSTWORG_CREDIT
@ NPC_FROSTGIANT
@ NPC_FROSTWORG
QuenchingMist
@ SPELL_FLICKERING_FLAMES
Quest12634Data
@ SPELL_SUMMON_ADVENTUROUS_DWARF
@ SPELL_ORANGE_FALLS_TO_GROUND
@ SPELL_PAPAYA_FALLS_TO_GROUND
@ SPELL_BANANAS_FALL_TO_GROUND
DeathComesFromOnHigh
@ NPC_NEW_AVALON_TOWN_HALL
@ NPC_NEW_AVALON_FORGE
@ SPELL_TOWN_HALL_CREDIT
@ NPC_CHAPEL_OF_THE_CRIMSON_FLAME
@ NPC_SCARLET_HOLD
@ SPELL_SCARLET_HOLD_CREDIT
@ SPELL_CHAPEL_CREDIT
@ SPELL_FORGE_CREDIT
Fumping
@ SPELL_SUMMON_SAND_GNOME
@ SPELL_SUMMON_BONE_SLICER
Quest55Data
Definition: spell_quest.cpp:72
@ NPC_MORBENT
Definition: spell_quest.cpp:73
@ NPC_WEAKENED_MORBENT
Definition: spell_quest.cpp:74
Quest11010_11102_11023Data
@ SPELL_CHOOSE_LOC
@ SPELL_AGGRO_CHECK
@ NPC_FEL_CANNON2
@ SPELL_FLAK_CANNON_TRIGGER
RelicOfTheEarthenRing
@ SPELL_TOTEM_OF_THE_EARTHEN_RING
EscapeFromSilverbrook
@ SPELL_SUMMON_WORGEN
BurstAtTheSeams
@ SPELL_BURST_AT_THE_SEAMS_52510
@ SPELL_BURST_AT_THE_SEAMS_BONE
@ SPELL_DRAKKARI_CHIEFTAINK_KILL_CREDIT
@ QUEST_FUEL_FOR_THE_FIRE
@ SPELL_ASSIGN_SKELETON_KILL_CREDIT_TO_MASTER
@ AREA_MORD_RETHAR_THE_DEATH_GATE
@ SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT
@ NPC_RENIMATED_ABOMINATION
@ SPELL_TROLL_EXPLOSION
@ SPELL_ASSIGN_GEIST_KILL_CREDIT_TO_MASTER
@ NPC_RISEN_ALLIANCE_SOLDIERS
@ AREA_THE_BROKEN_FRONT
@ SPELL_EXPLODE_TROLL_MEAT
@ SPELL_EXPLODE_TROLL_BLOODY_MEAT
@ NPC_VICIOUS_GEIST
@ SPELL_BURST_AT_THE_SEAMS_59580
@ NPC_ICY_GHOUL
@ NPC_DRAKKARI_CHIEFTAINK
@ SPELL_SUMMON_DRAKKARI_CHIEFTAIN
@ SPELL_BURST_AT_THE_SEAMS_52508
@ SPELL_BURST_AT_THE_SEAMS_59579
@ SPELL_BURST_AT_THE_SEAMS_59576
@ SPELL_ASSIGN_GHOUL_KILL_CREDIT_TO_MASTER
@ SPELL_DRAKKARI_SKULLCRUSHER_CREDIT
@ SPELL_EXPLODE_ABOMINATION_MEAT
@ SPELL_BLOATED_ABOMINATION_FEIGN_DEATH
FearNoEvil
@ NPC_INJURED_STORMWIND_INFANTRY
@ SPELL_RENEWED_LIFE
Recall_Eye_of_Acherus
@ THE_EYE_OF_ACHERUS
Quest12659Data
@ NPC_SCALPS_KC_BUNNY
Quest11396_11399Data
@ SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3
@ SPELL_SCOURGING_CRYSTAL_CONTROLLER
constexpr Milliseconds Quest6124_6129_DESPAWN_TIME
Quests6124_6129Data
@ NPC_SICKLY_DEER
@ NPC_SICKLY_GAZELLE
@ NPC_CURED_GAZELLE
@ NPC_CURED_DEER
void AddSC_quest_spell_scripts()
ThaumaturgyChannel
Definition: spell_quest.cpp:90
@ SPELL_THAUMATURGY_CHANNEL
Definition: spell_quest.cpp:91
Quest_The_Storm_King
@ SPELL_RIDE_GYMER
@ SPELL_GRABBED
Quest10255Data
@ NPC_HELBOAR
@ NPC_DREADTUSK
Quest11515Data
@ NPC_EMACIATED_FELBLOOD
@ NPC_FELBLOOD_INITIATE
CastSpellExtraArgs & AddSpellBP0(int32 val)
Definition: SpellDefines.h:475
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:191
void RelocateOffset(Position const &offset)
Definition: Spell.cpp:122
void Relocate(Position const &pos)
Definition: Spell.cpp:111