TrinityCore
Loading...
Searching...
No Matches
spell_generic.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19 * Scripts for spells with SPELLFAMILY_GENERIC which cannot be included in AI script file
20 * of creature using it or can't be bound to any player class.
21 * Ordered alphabetically using scriptname.
22 * Scriptnames of files in this file should be prefixed with "spell_gen_"
23 */
24
25#include "ScriptMgr.h"
26#include "Battleground.h"
27#include "CellImpl.h"
28#include "Containers.h"
29#include "DBCStores.h"
30#include "GameTime.h"
31#include "GridNotifiersImpl.h"
32#include "Group.h"
33#include "InstanceScript.h"
34#include "Item.h"
35#include "LFGMgr.h"
36#include "Log.h"
37#include "MotionMaster.h"
38#include "ObjectMgr.h"
39#include "Pet.h"
40#include "ReputationMgr.h"
41#include "SkillDiscovery.h"
42#include "SpellAuraEffects.h"
43#include "SpellHistory.h"
44#include "SpellMgr.h"
45#include "SpellScript.h"
46#include "Vehicle.h"
47
49{
51
53
54 bool Load() override
55 {
56 // Max absorb stored in 1 dummy effect
58 return true;
59 }
60
61 void Absorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
62 {
63 absorbAmount = std::min(limit, absorbAmount);
64 }
65
70};
71
72// 28764 - Adaptive Warding (Frostfire Regalia Set)
81
83{
85
97
98 bool CheckProc(ProcEventInfo& eventInfo)
99 {
100 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
101 if (!damageInfo || !damageInfo->GetSpellInfo())
102 return false;
103
104 // find Mage Armor
105 if (!GetTarget()->GetAuraEffect(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT, SPELLFAMILY_MAGE, 0x10000000, 0x0, 0x0))
106 return false;
107
108 switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
109 {
112 return false;
113 default:
114 break;
115 }
116 return true;
117 }
118
119 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
120 {
122
123 uint32 spellId = 0;
124 switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
125 {
128 break;
131 break;
134 break;
137 break;
140 break;
141 default:
142 return;
143 }
144 GetTarget()->CastSpell(GetTarget(), spellId, aurEff);
145 }
146
152};
153
170
176
177// 46221 - Animal Blood
179{
181
182 bool Validate(SpellInfo const* /*spellInfo*/) override
183 {
185 }
186
187 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
188 {
189 // Remove all auras with spell id 46221, except the one currently being applied
190 while (Aura* aur = GetUnitOwner()->GetOwnedAura(SPELL_ANIMAL_BLOOD, ObjectGuid::Empty, ObjectGuid::Empty, 0, GetAura()))
192 }
193
194 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
195 {
196 if (Unit* owner = GetUnitOwner())
197 owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true);
198 }
199
205};
206
207// 63471 - Spawn Blood Pool
209{
211
213 {
214 Unit* caster = GetCaster();
215 Position summonPos = caster->GetPosition();
216 LiquidData liquidStatus;
217 if (caster->GetMap()->GetLiquidStatus(caster->GetPhaseMask(), caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), {}, &liquidStatus, caster->GetCollisionHeight()))
218 summonPos.m_positionZ = liquidStatus.level;
219 dest.Relocate(summonPos);
220 }
221
226};
227
228// 430 Drink
229// 431 Drink
230// 432 Drink
231// 1133 Drink
232// 1135 Drink
233// 1137 Drink
234// 10250 Drink
235// 22734 Drink
236// 27089 Drink
237// 34291 Drink
238// 43182 Drink
239// 43183 Drink
240// 46755 Drink
241// 49472 Drink Coffee
242// 57073 Drink
243// 61830 Drink
244// 72623 Drink
246{
248
249 bool Load() override
250 {
251 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
252 }
253
254 bool Validate(SpellInfo const* spellInfo) override
255 {
257 {
258 TC_LOG_ERROR("spells", "Aura {} structure has been changed - first aura is no longer SPELL_AURA_MOD_POWER_REGEN", GetId());
259 return false;
260 }
261
262 return true;
263 }
264
265 void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& /*amplitude*/)
266 {
267 // Get SPELL_AURA_MOD_POWER_REGEN aura from spell
269 if (!regen)
270 return;
271
272 // default case - not in arena
273 if (!GetCaster()->ToPlayer()->InArena())
274 isPeriodic = false;
275 }
276
277 void CalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
278 {
280 if (!regen)
281 return;
282
283 // default case - not in arena
284 if (!GetCaster()->ToPlayer()->InArena())
285 regen->ChangeAmount(amount);
286 }
287
289 {
291 if (!regen)
292 return;
293
294 // **********************************************
295 // This feature used only in arenas
296 // **********************************************
297 // Here need increase mana regen per tick (6 second rule)
298 // on 0 tick - 0 (handled in 2 second)
299 // on 1 tick - 166% (handled in 4 second)
300 // on 2 tick - 133% (handled in 6 second)
301
302 // Apply bonus for 1 - 4 tick
303 switch (aurEff->GetTickNumber())
304 {
305 case 1: // 0%
306 regen->ChangeAmount(0);
307 break;
308 case 2: // 166%
309 regen->ChangeAmount(aurEff->GetAmount() * 5 / 3);
310 break;
311 case 3: // 133%
312 regen->ChangeAmount(aurEff->GetAmount() * 4 / 3);
313 break;
314 default: // 100% - normal regen
315 regen->ChangeAmount(aurEff->GetAmount());
316 // No need to update after 4th tick
317 aurEff->SetPeriodic(false);
318 break;
319 }
320 }
321
328};
329
330// 28313 - Aura of Fear
332{
334
335 bool Validate(SpellInfo const* spellInfo) override
336 {
337 return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
338 }
339
340 void PeriodicTick(AuraEffect const* aurEff)
341 {
343 if (!roll_chance_i(GetSpellInfo()->ProcChance))
344 return;
345
346 GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, true);
347 }
348
353};
354
356{
358
359 bool CheckAreaTarget(Unit* target)
360 {
361 switch (target->GetEntry())
362 {
363 // alliance
364 case 14762: // Dun Baldar North Marshal
365 case 14763: // Dun Baldar South Marshal
366 case 14764: // Icewing Marshal
367 case 14765: // Stonehearth Marshal
368 case 11948: // Vandar Stormspike
369 // horde
370 case 14772: // East Frostwolf Warmaster
371 case 14776: // Tower Point Warmaster
372 case 14773: // Iceblood Warmaster
373 case 14777: // West Frostwolf Warmaster
374 case 11946: // Drek'thar
375 return true;
376 default:
377 return false;
378 }
379 }
380
385};
386
391
393{
395
396 bool Validate(SpellInfo const* /*spellInfo*/) override
397 {
399 }
400
402 {
403 if (Unit* target = GetExplTargetUnit())
404 {
405 if (target->HasAura(SPELL_RECENTLY_BANDAGED))
407 }
408 return SPELL_CAST_OK;
409 }
410
412 {
413 if (Unit* target = GetHitUnit())
415 }
416
422};
423
428
429// 59630 - Black Magic
431{
433
434 bool CheckProc(ProcEventInfo& eventInfo)
435 {
436 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
437 uint32 typeMask = eventInfo.GetTypeMask();
438 if (!spellInfo)
439 return false;
440
442 return true;
443 else if (typeMask & PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS)
444 {
445 // Shred and Mangle (Cat)
446 if (spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && (spellInfo->SpellFamilyFlags[0] == 0x00008000 || spellInfo->SpellFamilyFlags[1] == 0x00000400))
447 return true;
448 }
449 else if (typeMask & PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG)
450 {
452 return true;
453 }
454
455 return false;
456 }
457
462};
463
464// Blood Reserve - 64568
470
472{
474
475 bool Validate(SpellInfo const* /*spellInfo*/) override
476 {
478 }
479
480 bool CheckProc(ProcEventInfo& eventInfo)
481 {
482 if (Unit* caster = eventInfo.GetActionTarget())
483 if (caster->HealthBelowPct(35))
484 return true;
485
486 return false;
487 }
488
489 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
490 {
492
493 Unit* caster = eventInfo.GetActionTarget();
494 CastSpellExtraArgs args(aurEff);
495 args.AddSpellBP0(aurEff->GetAmount());
496 caster->CastSpell(caster, SPELL_GEN_BLOOD_RESERVE_HEAL, args);
498 }
499
505};
506
507// Blade Warding - 64440
512
514{
516
517 bool Validate(SpellInfo const* /*spellInfo*/) override
518 {
520 }
521
522 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
523 {
525
526 Unit* caster = eventInfo.GetActionTarget();
527 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_GEN_BLADE_WARDING_TRIGGERED);
528
529 uint8 stacks = GetStackAmount();
530 int32 bp = 0;
531
532 for (uint8 i = 0; i < stacks; ++i)
533 bp += spellInfo->GetEffect(EFFECT_0).CalcValue(caster);
534
535 CastSpellExtraArgs args(aurEff);
536 args.AddSpellBP0(bp);
537 caster->CastSpell(eventInfo.GetActor(), SPELL_GEN_BLADE_WARDING_TRIGGERED, args);
538 }
539
544};
545
552
554{
556
557 void HandleScript(SpellEffIndex /*effIndex*/)
558 {
559 if (Player* target = GetHitPlayer())
560 {
561 Aura const* aura = GetHitAura();
562 if (!(aura && aura->GetStackAmount() == 3))
563 return;
564
565 target->CastSpell(target, SPELL_FOAM_SWORD_DEFEAT, true);
566 target->RemoveAurasDueToSpell(SPELL_BONKED);
567
568 if (Aura const* auraOnGuard = target->GetAura(SPELL_ON_GUARD))
569 if (Item* item = target->GetItemByGuid(auraOnGuard->GetCastItemGUID()))
570 target->DestroyItemCount(item->GetEntry(), 1, true);
571 }
572 }
573
578};
579
580/* DOCUMENTATION: Break-Shield spells
581 Break-Shield spells can be classified in three groups:
582
583 - Spells on vehicle bar used by players:
584 + EFFECT_0: SCRIPT_EFFECT
585 + EFFECT_1: NONE
586 + EFFECT_2: NONE
587 - Spells cast by players triggered by script:
588 + EFFECT_0: SCHOOL_DAMAGE
589 + EFFECT_1: SCRIPT_EFFECT
590 + EFFECT_2: FORCE_CAST
591 - Spells cast by NPCs on players:
592 + EFFECT_0: SCHOOL_DAMAGE
593 + EFFECT_1: SCRIPT_EFFECT
594 + EFFECT_2: NONE
595
596 In the following script we handle the SCRIPT_EFFECT for effIndex EFFECT_0 and EFFECT_1.
597 - When handling EFFECT_0 we're in the "Spells on vehicle bar used by players" case
598 and we'll trigger "Spells cast by players triggered by script"
599 - When handling EFFECT_1 we're in the "Spells cast by players triggered by script"
600 or "Spells cast by NPCs on players" so we'll search for the first defend layer and drop it.
601*/
602
612
614{
616
618 {
619 Unit* target = GetHitUnit();
620
621 switch (effIndex)
622 {
623 case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
624 {
625 uint32 spellId;
626
627 switch (GetSpellInfo()->Id)
628 {
632 break;
635 break;
636 default:
637 return;
638 }
639
640 if (Unit* rider = GetCaster()->GetCharmer())
641 rider->CastSpell(target, spellId, false);
642 else
643 GetCaster()->CastSpell(target, spellId, false);
644 break;
645 }
646 case EFFECT_1: // On damaging spells, for removing a defend layer
647 {
648 Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
649 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
650 {
651 if (Aura* aura = itr->second->GetBase())
652 {
653 SpellInfo const* auraInfo = aura->GetSpellInfo();
654 if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
655 {
656 aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
657 // Remove dummys from rider (Necessary for updating visual shields)
658 if (Unit* rider = target->GetCharmer())
659 if (Aura* defend = rider->GetAura(aura->GetId()))
660 defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
661 break;
662 }
663 }
664 }
665 break;
666 }
667 default:
668 break;
669 }
670 }
671
676};
677
678// 48750 - Burning Depths Necrolyte Image
705
725
745
765
770
772{
774
775 bool Validate(SpellInfo const* /*spellInfo*/) override
776 {
778 }
779
781 {
782 Unit* caster = GetCaster();
783 float max_range = GetSpellInfo()->GetMaxRange(false);
784 WorldObject* result = nullptr;
785 // search for nearby enemy corpse in range
788 Cell::VisitWorldObjects(caster, searcher, max_range);
789 if (!result)
790 Cell::VisitGridObjects(caster, searcher, max_range);
791 if (!result)
793 return SPELL_CAST_OK;
794 }
795
796 void HandleDummy(SpellEffIndex /*effIndex*/)
797 {
799 }
800
806};
807
808// 45524 Chains of Ice
809// 66020 Chains of Ice
811{
813
815 {
816 // Get 0 effect aura
818 if (!slow)
819 return;
820
821 int32 newAmount = std::min<int32>(slow->GetAmount() + aurEff->GetAmount(), 0);
822 slow->ChangeAmount(newAmount);
823 }
824
829};
830
832{
833 SPELL_CHOKING_WOUND = 35247
835
836// 35244 - Choking Vines
838{
840
841 bool Validate(SpellInfo const* /*spellInfo*/) override
842 {
844 }
845
846 void HandleChoke(AuraEffect const* /*aurEff*/)
847 {
848 if (GetStackAmount() != GetSpellInfo()->StackAmount)
849 return;
850
851 GetTarget()->CastSpell(nullptr, SPELL_CHOKING_WOUND, true);
852 Remove();
853 }
854
859};
860
861// 8129 - Mana Burn
863{
865
867 {
868 if (Unit* unitTarget = GetHitUnit())
869 unitTarget->RemoveAurasWithMechanic((1 << MECHANIC_FEAR) | (1 << MECHANIC_POLYMORPH));
870 }
871
876};
877
894
906
922
924{
926
939
940 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
941 {
942 Unit* caster = GetCaster();
943 Unit* target = GetTarget();
944 if (!caster)
945 return;
946
947 switch (GetSpellInfo()->Id)
948 {
952 {
953 prevItem = target->GetVirtualItemId(0);
954
955 if (Player* player = caster->ToPlayer())
956 {
957 if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
958 target->SetVirtualItem(0, mainItem->GetEntry());
959 }
960 else
961 target->SetVirtualItem(0, caster->GetVirtualItemId(0));
962 break;
963 }
966 {
967 prevItem = target->GetVirtualItemId(1);
968
969 if (Player* player = caster->ToPlayer())
970 {
971 if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
972 target->SetVirtualItem(1, offItem->GetEntry());
973 }
974 else
975 target->SetVirtualItem(1, caster->GetVirtualItemId(1));
976 break;
977 }
979 {
980 prevItem = target->GetVirtualItemId(2);
981
982 if (Player* player = caster->ToPlayer())
983 {
984 if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
985 target->SetVirtualItem(2, rangedItem->GetEntry());
986 }
987 else
988 target->SetVirtualItem(2, caster->GetVirtualItemId(2));
989 break;
990 }
991 default:
992 break;
993 }
994 }
995
996 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
997 {
998 Unit* target = GetTarget();
999
1000 switch (GetSpellInfo()->Id)
1001 {
1005 target->SetVirtualItem(0, prevItem);
1006 break;
1009 target->SetVirtualItem(1, prevItem);
1010 break;
1012 target->SetVirtualItem(2, prevItem);
1013 break;
1014 default:
1015 break;
1016 }
1017 }
1018
1024
1026};
1027
1029{
1031
1032public:
1034
1036 {
1037 if (!_damagePct)
1039
1040 SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(_damagePct));
1041 }
1042
1047
1048private:
1050};
1051
1052// 28865 - Consumption
1053// 64208 - Consumption
1055{
1057
1059 {
1060 Creature* caster = GetCaster()->ToCreature();
1061 if (!caster)
1062 return;
1063
1064 uint32 damage = 0;
1065 if (SpellInfo const* createdBySpell = sSpellMgr->GetSpellInfo(caster->GetUInt32Value(UNIT_CREATED_BY_SPELL)))
1066 damage = createdBySpell->GetEffect(EFFECT_1).CalcValue();
1067
1068 if (damage)
1069 SetEffectValue(damage);
1070 }
1071
1076};
1077
1078// 63845 - Create Lance
1084
1086{
1088
1089 bool Validate(SpellInfo const* /*spellInfo*/) override
1090 {
1091 return ValidateSpellInfo(
1092 {
1095 });
1096 }
1097
1099 {
1100 PreventHitDefaultEffect(effIndex);
1101
1102 if (Player* target = GetHitPlayer())
1103 {
1104 if (target->GetTeam() == ALLIANCE)
1106 else
1108 }
1109 }
1110
1115};
1116
1127
1129{
1131
1132 bool Validate(SpellInfo const* spellInfo) override
1133 {
1134 switch (spellInfo->Id)
1135 {
1137 return ValidateSpellInfo(
1138 {
1141 });
1143 return ValidateSpellInfo(
1144 {
1147 });
1148 default:
1149 break;
1150 }
1151
1152 return false;
1153 }
1154
1155 void HandleScript(SpellEffIndex /*effIndex*/)
1156 {
1157 if (Player* player = GetHitPlayer())
1158 {
1159 uint8 gender = player->GetNativeGender();
1160
1161 uint32 spellId = GetSpellInfo()->Id;
1162
1163 switch (spellId)
1164 {
1167 break;
1170 break;
1171 default:
1172 break;
1173 }
1174
1175 GetCaster()->CastSpell(player, spellId, true);
1176 }
1177 }
1178
1183};
1184
1193
1227
1229{
1231
1233 {
1234 if (Aura* aur = GetHitAura())
1235 aur->SetStackAmount(static_cast<uint8>(GetSpellInfo()->StackAmount));
1236 }
1237
1242};
1243
1245{
1247
1248protected:
1250
1251 bool CheckProc(ProcEventInfo& eventInfo)
1252 {
1253 return (eventInfo.GetSpellInfo() == GetSpellInfo());
1254 }
1255
1256 void Decay(ProcEventInfo& /*eventInfo*/)
1257 {
1259 ModStackAmount(-1);
1260 }
1261
1267};
1268
1270{
1271 // found in sniffs, there is no duration entry we can possibly use
1272 AURA_DURATION = 12600
1274
1275// 32065 - Fungal Decay
1296
1297// 36659 - Tail Sting
1302
1309
1311{
1313
1314 bool Validate(SpellInfo const* /*spellInfo*/) override
1315 {
1316 return ValidateSpellInfo(
1317 {
1321 });
1322 }
1323
1325 {
1326 if (GetCaster())
1327 {
1328 Unit* target = GetTarget();
1329
1330 for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
1332
1333 target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, aurEff);
1334 }
1335 else
1337 }
1338
1339 void RemoveVisualShields(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1340 {
1341 for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
1343 }
1344
1346 {
1347 if (Unit* caster = GetCaster())
1348 if (TempSummon* vehicle = caster->ToTempSummon())
1349 if (Unit* rider = vehicle->GetSummonerUnit())
1350 rider->RemoveAurasDueToSpell(GetId());
1351 }
1352
1375};
1376
1378{
1380
1381 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1382 {
1383 if (Creature* target = GetTarget()->ToCreature())
1384 target->DespawnOrUnsummon();
1385 }
1386
1391};
1392
1395{
1397
1398 bool Load() override
1399 {
1400 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1401 }
1402
1403 void HandleDummy(SpellEffIndex /*effIndex*/)
1404 {
1407 }
1408
1413};
1414
1416{
1418
1419 void HandleDespawn(SpellEffIndex /*effIndex*/)
1420 {
1422 if (Creature* target = GetHitCreature())
1423 target->DespawnOrUnsummon();
1424 }
1425
1430};
1431
1436
1437// 70769 Divine Storm!
1439{
1441
1442 bool Load() override
1443 {
1444 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1445 }
1446
1447 bool Validate(SpellInfo const* /*spellInfo*/) override
1448 {
1450 }
1451
1452 void HandleScript(SpellEffIndex /*effIndex*/)
1453 {
1454 Player* caster = GetCaster()->ToPlayer();
1457 }
1458
1463};
1464
1469
1470// 28698 - Dreaming Glory
1472{
1474
1475 bool Validate(SpellInfo const* /*spellInfo*/) override
1476 {
1478 }
1479
1480 void HandleScript(SpellEffIndex /*effIndex*/)
1481 {
1483 }
1484
1489};
1490
1492{
1494
1495 void HandleScript(SpellEffIndex /*effIndex*/)
1496 {
1497 // Here the target is the water spout and determines the position where the player is knocked from
1498 if (Unit* target = GetHitUnit())
1499 {
1500 if (Player* player = GetCaster()->ToPlayer())
1501 {
1502 float horizontalSpeed = 20.0f + (40.0f - GetCaster()->GetDistance(target));
1503 float verticalSpeed = 8.0f;
1504 // This method relies on the Dalaran Sewer map disposition and Water Spout position
1505 // What we do is knock the player from a position exactly behind him and at the end of the pipe
1506 player->KnockbackFrom(target->GetPositionX(), player->GetPositionY(), horizontalSpeed, verticalSpeed);
1507 }
1508 }
1509 }
1510
1515};
1516
1518{
1520
1521 bool Load() override
1522 {
1523 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1524 }
1525
1527 {
1528 // This hook is executed for every target, make sure we only credit instance once
1529 if (_handled)
1530 return;
1531
1532 _handled = true;
1533 Unit* caster = GetCaster();
1534 if (InstanceScript* instance = caster->GetInstanceScript())
1535 instance->UpdateEncounterStateForSpellCast(GetSpellInfo()->Id, caster);
1536 }
1537
1542
1543 bool _handled = false;
1544};
1545
1546// 50051 - Ethereal Pet Aura
1559
1560// 50051 - Ethereal Pet Aura
1562{
1564
1565 bool CheckProc(ProcEventInfo& eventInfo)
1566 {
1567 uint32 levelDiff = std::abs(eventInfo.GetActor()->GetLevel() - eventInfo.GetActionTarget()->GetLevel());
1568 return levelDiff <= 9;
1569 }
1570
1571 void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
1572 {
1574
1575 std::list<TempSummon*> minionList;
1577 for (Creature* minion : minionList)
1578 {
1579 if (minion->IsAIEnabled())
1580 {
1581 minion->AI()->Talk(SAY_STEAL_ESSENCE);
1582 minion->CastSpell(eventInfo.GetActionTarget(), SPELL_STEAL_ESSENCE_VISUAL);
1583 }
1584 }
1585 }
1586
1592};
1593
1594// 50052 - Ethereal Pet onSummon
1596{
1598
1599 bool Validate(SpellInfo const* /*spellInfo*/) override
1600 {
1602 }
1603
1605 {
1606 Unit* target = GetHitUnit();
1607 target->CastSpell(target, SPELL_PROC_TRIGGER_ON_KILL_AURA, true);
1608 }
1609
1614};
1615
1616// 50055 - Ethereal Pet Aura Remove
1636
1637// 50101 - Steal Essence Visual
1639{
1641
1642 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1643 {
1644 if (Unit* caster = GetCaster())
1645 {
1646 caster->CastSpell(caster, SPELL_CREATE_TOKEN, true);
1647 if (Creature* soulTrader = caster->ToCreature())
1648 soulTrader->AI()->Talk(SAY_CREATE_TOKEN);
1649 }
1650 }
1651
1656};
1657
1677
1678/* 57337 - Great Feast
1679 57397 - Fish Feast
1680 58466 - Gigantic Feast
1681 58475 - Small Feast
1682 66477 - Bountiful Feast */
1684{
1686
1703
1704 void HandleScript(SpellEffIndex /*effIndex*/)
1705 {
1706 Unit* target = GetHitUnit();
1707
1708 switch (GetSpellInfo()->Id)
1709 {
1710 case SPELL_GREAT_FEAST:
1711 target->CastSpell(target, SPELL_FEAST_FOOD);
1712 target->CastSpell(target, SPELL_FEAST_DRINK);
1714 break;
1715 case SPELL_FISH_FEAST:
1716 target->CastSpell(target, SPELL_FEAST_FOOD);
1717 target->CastSpell(target, SPELL_FEAST_DRINK);
1718 target->CastSpell(target, SPELL_FISH_FEAST_REFRESHMENT);
1719 break;
1721 target->CastSpell(target, SPELL_FEAST_FOOD);
1722 target->CastSpell(target, SPELL_FEAST_DRINK);
1724 break;
1725 case SPELL_SMALL_FEAST:
1726 target->CastSpell(target, SPELL_FEAST_FOOD);
1727 target->CastSpell(target, SPELL_FEAST_DRINK);
1729 break;
1732 target->CastSpell(target, SPELL_BOUNTIFUL_FEAST_DRINK);
1733 target->CastSpell(target, SPELL_BOUNTIFUL_FEAST_FOOD);
1734 break;
1735 default:
1736 break;
1737 }
1738 }
1739
1744};
1745
1746/*
1747There are only 3 possible flags Feign Death auras can apply: UNIT_DYNFLAG_DEAD, UNIT_FLAG2_FEIGN_DEATH
1748and UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT. Some auras can apply only 2 flags
1749
1750spell_gen_feign_death_all_flags applies all 3 flags
1751spell_gen_feign_death_no_dyn_flag applies no UNIT_DYNFLAG_DEAD (does not make the creature appear dead)
1752spell_gen_feign_death_no_prevent_emotes applies no UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
1753
1754REACT_PASSIVE should be handled directly in scripts since not all creatures should be passive. Otherwise
1755creature will be not able to aggro or execute MoveInLineOfSight events. Removing may cause more issues
1756than already exists
1757*/
1758
1791
1792// 35357 - Spawn Feign Death
1793// 51329 - Feign Death
1795{
1797
1798 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1799 {
1800 Unit* target = GetTarget();
1803
1804 if (Creature* creature = target->ToCreature())
1805 creature->SetReactState(REACT_PASSIVE);
1806 }
1807
1808 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1809 {
1810 Unit* target = GetTarget();
1813
1814 if (Creature* creature = target->ToCreature())
1815 creature->InitializeReactState();
1816 }
1817
1823};
1824
1825// 58951 - Permanent Feign Death
1827{
1829
1830 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1831 {
1832 Unit* target = GetTarget();
1835
1836 if (Creature* creature = target->ToCreature())
1837 creature->SetReactState(REACT_PASSIVE);
1838 }
1839
1840 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1841 {
1842 Unit* target = GetTarget();
1845
1846 if (Creature* creature = target->ToCreature())
1847 creature->InitializeReactState();
1848 }
1849
1855};
1856
1863
1864// 35491 - Furious Rage
1866{
1868
1869 bool Validate(SpellInfo const* /*spellInfo*/) override
1870 {
1871 return ValidateSpellInfo({ SPELL_EXHAUSTION }) &&
1872 sObjectMgr->GetBroadcastText(EMOTE_FURIOUS_RAGE) &&
1873 sObjectMgr->GetBroadcastText(EMOTE_EXHAUSTED);
1874 }
1875
1876 void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1877 {
1878 Unit* target = GetTarget();
1879 target->Unit::TextEmote(EMOTE_FURIOUS_RAGE, target, false);
1880 }
1881
1882 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1883 {
1884 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
1885 return;
1886
1887 Unit* target = GetTarget();
1888 target->Unit::TextEmote(EMOTE_EXHAUSTED, target, false);
1889 target->CastSpell(target, SPELL_EXHAUSTION, true);
1890 }
1891
1897};
1898
1899// 46642 - 5,000 Gold
1901{
1903
1904 void HandleScript(SpellEffIndex /*effIndex*/)
1905 {
1906 if (Player* target = GetHitPlayer())
1907 target->ModifyMoney(5000 * GOLD);
1908 }
1909
1914};
1915
1922
1924{
1926
1927 bool Validate(SpellInfo const* /*spellInfo*/) override
1928 {
1929 return ValidateSpellInfo(
1930 {
1934 });
1935 }
1936
1937 void HandleDummy(SpellEffIndex /* effIndex */)
1938 {
1939 Unit* caster = GetCaster();
1940 int32 r = irand(0, 119);
1941 if (r < 20) // Transporter Malfunction - 1/6 polymorph
1943 else if (r < 100) // Evil Twin - 4/6 evil twin
1944 caster->CastSpell(caster, SPELL_TRANSPORTER_EVIL_TWIN, true);
1945 else // Transporter Malfunction - 1/6 miss the target
1946 caster->CastSpell(caster, SPELL_TRANSPORTER_MALFUNCTION_MISS, true);
1947 }
1948
1953};
1954
1956{
1958
1959 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
1960 {
1961 if (!GetCaster() || !aurEff->GetTotalTicks())
1962 return;
1963
1964 float heal = 0.0f;
1965 switch (GetSpellInfo()->SpellFamilyName)
1966 {
1967 case SPELLFAMILY_MAGE:
1969 case SPELLFAMILY_PRIEST:
1970 heal = 1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()));
1971 break;
1973 case SPELLFAMILY_SHAMAN:
1974 heal = std::max(1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask())), 1.1f * float(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK)));
1975 break;
1977 case SPELLFAMILY_HUNTER:
1979 heal = 1.1f * float(std::max(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetCaster()->GetTotalAttackPowerValue(RANGED_ATTACK)));
1980 break;
1982 default:
1983 break;
1984 }
1985
1986 int32 healTick = std::floor(heal / aurEff->GetTotalTicks());
1987 amount += int32(std::max(healTick, 0));
1988 }
1989
1994};
1995
2001
2025
2026// 69641 - Gryphon/Wyvern Pet - Mounting Check Aura
2028{
2030
2031 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
2032 {
2033 Unit* target = GetTarget();
2034 Unit* owner = target->GetOwner();
2035
2036 if (!owner)
2037 return;
2038
2039 if (owner->IsMounted())
2040 target->SetDisableGravity(true);
2041 else
2042 target->SetDisableGravity(false);
2043 }
2044
2049};
2050
2051/* 9204 - Hate to Zero (Melee)
2052 20538 - Hate to Zero (AoE)
2053 26569 - Hate to Zero (AoE)
2054 26637 - Hate to Zero (AoE, Unique)
2055 37326 - Hate to Zero (AoE)
2056 40410 - Hate to Zero (Should be added, AoE)
2057 40467 - Hate to Zero (Should be added, AoE)
2058 41582 - Hate to Zero (Should be added, Melee) */
2074
2075// This spell is used by both player and creature, but currently works only if used by player
2076// 63984 - Hate to Zero
2078{
2080
2081 void HandleDummy(SpellEffIndex /*effIndex*/)
2082 {
2083 if (Unit* target = GetHitUnit())
2084 if (target->CanHaveThreatList())
2085 target->GetThreatManager().ModifyThreatByPercent(GetCaster(), -100);
2086 }
2087
2092};
2093
2094// 19707 - Hate to 50%
2096{
2098
2099 void HandleDummy(SpellEffIndex /*effIndex*/)
2100 {
2101 if (GetCaster()->CanHaveThreatList())
2103 }
2104
2109};
2110
2111// 26886 - Hate to 75%
2113{
2115
2116 void HandleDummy(SpellEffIndex /*effIndex*/)
2117 {
2118 if (GetCaster()->CanHaveThreatList())
2120 }
2121
2126};
2127
2129{
2131
2132 void HandleDummy(SpellEffIndex /*effIndex*/)
2133 {
2134 GetCaster()->SetHealth(GetCaster()->CountPctFromMaxHealth(30));
2135 }
2136
2141};
2142
2143// To be added: 19633, 20686, 23382, 31389, 32959
2165
2170
2171// -55428 - Lifeblood
2173{
2175
2176 bool Validate(SpellInfo const* /*spellInfo*/) override
2177 {
2179 }
2180
2185
2190};
2191
2192// -55428 - Lifeblood
2194{
2196
2197 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
2198 {
2199 if (!aurEff->GetTotalTicks())
2200 return;
2201
2202 if (Unit* owner = GetUnitOwner())
2203 amount += int32(CalculatePct(owner->GetMaxHealth(), 1.5f / aurEff->GetTotalTicks()));
2204 }
2205
2210};
2211
2219
2221{
2223
2224public:
2226
2227private:
2228 bool Validate(SpellInfo const* /*spellInfo*/) override
2229 {
2230 return ValidateSpellInfo({ _spellId });
2231 }
2232
2233 void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
2234 {
2235 // final heal only on duration end or dispel
2236 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
2237 return;
2238
2239 // final heal
2240 GetTarget()->CastSpell(GetTarget(), _spellId, { aurEff, GetCasterGUID() });
2241 }
2242
2247
2249};
2250
2252{
2254
2255 // Magic Broom
2260
2261 // Headless Horseman's Mount
2266
2267 // Winged Steed of the Ebon Blade
2270
2271 // Big Blizzard Bear
2274
2275 // Big Love Rocket
2281
2282 // Invincible
2287
2288 // Blazing Hippogryph
2291
2292 // Celestial Steed
2298
2299 // X-53 Touring Rocket
2304
2306{
2308
2309public:
2310 spell_gen_mount(uint32 mount0 = 0, uint32 mount60 = 0, uint32 mount100 = 0, uint32 mount150 = 0, uint32 mount280 = 0, uint32 mount310 = 0) : SpellScript(),
2311 _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { }
2312
2313private:
2314 bool Validate(SpellInfo const* /*spellInfo*/) override
2315 {
2316 bool result = true;
2317 if (_mount0)
2318 result &= ValidateSpellInfo({ _mount0 });
2319 if (_mount60)
2320 result &= ValidateSpellInfo({ _mount60 });
2321 if (_mount100)
2322 result &= ValidateSpellInfo({ _mount100 });
2323 if (_mount150)
2324 result &= ValidateSpellInfo({ _mount150 });
2325 if (_mount280)
2326 result &= ValidateSpellInfo({ _mount280 });
2327 if (_mount310)
2328 result &= ValidateSpellInfo({ _mount310 });
2329
2330 return result;
2331 }
2332
2334 {
2335 PreventHitDefaultEffect(effIndex);
2336
2337 if (Player* target = GetHitPlayer())
2338 {
2339 // Prevent stacking of mounts and client crashes upon dismounting
2340 target->RemoveAurasByType(SPELL_AURA_MOUNTED, ObjectGuid::Empty, GetHitAura());
2341
2342 // Triggered spell id dependent on riding skill and zone
2343 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(_mount150);
2344 uint32 zoneid, areaid;
2345 target->GetZoneAndAreaId(zoneid, areaid);
2346 bool const canFly = spellInfo && (spellInfo->CheckLocation(target->GetMapId(), zoneid, areaid, target) == SPELL_CAST_OK);
2347
2348 uint32 mount = 0;
2349 switch (target->GetBaseSkillValue(SKILL_RIDING))
2350 {
2351 case 0:
2352 mount = _mount0;
2353 break;
2354 case 75:
2355 mount = _mount60;
2356 break;
2357 case 150:
2358 mount = _mount100;
2359 break;
2360 case 225:
2361 if (canFly)
2362 mount = _mount150;
2363 else
2364 mount = _mount100;
2365 break;
2366 case 300:
2367 if (canFly)
2368 {
2369 if (_mount310 && target->Has310Flyer(false))
2370 mount = _mount310;
2371 else
2372 mount = _mount280;
2373 }
2374 else
2375 mount = _mount100;
2376 break;
2377 default:
2378 break;
2379 }
2380
2381 if (mount)
2382 target->CastSpell(target, mount, true);
2383 }
2384 }
2385
2390
2397};
2398
2399/* DOCUMENTATION: Charge spells
2400 Charge spells can be classified in four groups:
2401
2402 - Spells on vehicle bar used by players:
2403 + EFFECT_0: SCRIPT_EFFECT
2404 + EFFECT_1: TRIGGER_SPELL
2405 + EFFECT_2: NONE
2406 - Spells cast by player's mounts triggered by script:
2407 + EFFECT_0: CHARGE
2408 + EFFECT_1: TRIGGER_SPELL
2409 + EFFECT_2: APPLY_AURA
2410 - Spells cast by players on the target triggered by script:
2411 + EFFECT_0: SCHOOL_DAMAGE
2412 + EFFECT_1: SCRIPT_EFFECT
2413 + EFFECT_2: NONE
2414 - Spells cast by NPCs on players:
2415 + EFFECT_0: SCHOOL_DAMAGE
2416 + EFFECT_1: CHARGE
2417 + EFFECT_2: SCRIPT_EFFECT
2418
2419 In the following script we handle the SCRIPT_EFFECT and CHARGE
2420 - When handling SCRIPT_EFFECT:
2421 + EFFECT_0: Corresponds to "Spells on vehicle bar used by players" and we make player's mount cast
2422 the charge effect on the current target ("Spells cast by player's mounts triggered by script").
2423 + EFFECT_1 and EFFECT_2: Triggered when "Spells cast by player's mounts triggered by script" hits target,
2424 corresponding to "Spells cast by players on the target triggered by script" and "Spells cast by
2425 NPCs on players" and we check Defend layers and drop a charge of the first found.
2426 - When handling CHARGE:
2427 + Only launched for "Spells cast by player's mounts triggered by script", makes the player cast the
2428 damaging spell on target with a small chance of failing it.
2429*/
2430
2448
2450{
2452
2454 {
2455 Unit* target = GetHitUnit();
2456
2457 switch (effIndex)
2458 {
2459 case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
2460 {
2461 uint32 spellId;
2462
2463 switch (GetSpellInfo()->Id)
2464 {
2467 break;
2470 break;
2471 default:
2472 return;
2473 }
2474
2475 // If target isn't a training dummy there's a chance of failing the charge
2476 if (!target->IsCharmedOwnedByPlayerOrPlayer() && roll_chance_f(12.5f))
2477 spellId = SPELL_CHARGE_MISS_EFFECT;
2478
2479 if (Unit* vehicle = GetCaster()->GetVehicleBase())
2480 vehicle->CastSpell(target, spellId, false);
2481 else
2482 GetCaster()->CastSpell(target, spellId, false);
2483 break;
2484 }
2485 case EFFECT_1: // On damaging spells, for removing a defend layer
2486 case EFFECT_2:
2487 {
2488 Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
2489 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
2490 {
2491 if (Aura* aura = itr->second->GetBase())
2492 {
2493 SpellInfo const* auraInfo = aura->GetSpellInfo();
2494 if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
2495 {
2496 aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
2497 // Remove dummys from rider (Necessary for updating visual shields)
2498 if (Unit* rider = target->GetCharmer())
2499 if (Aura* defend = rider->GetAura(aura->GetId()))
2500 defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
2501 break;
2502 }
2503 }
2504 }
2505 break;
2506 }
2507 default:
2508 break;
2509 }
2510 }
2511
2513 {
2514 uint32 spellId;
2515
2516 switch (GetSpellInfo()->Id)
2517 {
2519 spellId = SPELL_CHARGE_DAMAGE_8K5;
2520 break;
2523 spellId = SPELL_CHARGE_DAMAGE_20K;
2524 break;
2527 spellId = SPELL_CHARGE_DAMAGE_45K;
2528 break;
2529 default:
2530 return;
2531 }
2532
2533 if (Unit* rider = GetCaster()->GetCharmer())
2534 rider->CastSpell(GetHitUnit(), spellId, false);
2535 else
2536 GetCaster()->CastSpell(GetHitUnit(), spellId, false);
2537 }
2538
2549};
2550
2552{
2553 SPELL_FALL_DOWN = 6869
2555
2556// 6870 Moss Covered Feet
2557// 31399 Moss Covered Feet
2559{
2561
2562 bool Validate(SpellInfo const* /*spellInfo*/) override
2563 {
2565 }
2566
2567 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
2568 {
2570 eventInfo.GetActionTarget()->CastSpell(nullptr, SPELL_FALL_DOWN, aurEff);
2571 }
2572
2577};
2578
2583
2584// 28702 - Netherbloom
2586{
2588
2589 bool Validate(SpellInfo const* /*spellInfo*/) override
2590 {
2591 for (uint8 i = 0; i < 5; ++i)
2593 return false;
2594
2595 return true;
2596 }
2597
2599 {
2600 PreventHitDefaultEffect(effIndex);
2601
2602 if (Unit* target = GetHitUnit())
2603 {
2604 // 25% chance of casting a random buff
2605 if (roll_chance_i(75))
2606 return;
2607
2608 // triggered spells are 28703 to 28707
2609 // Note: some sources say, that there was the possibility of
2610 // receiving a debuff. However, this seems to be removed by a patch.
2611
2612 // don't overwrite an existing aura
2613 for (uint8 i = 0; i < 5; ++i)
2614 if (target->HasAura(SPELL_NETHERBLOOM_POLLEN_1 + i))
2615 return;
2616
2617 target->CastSpell(target, SPELL_NETHERBLOOM_POLLEN_1 + urand(0, 4), true);
2618 }
2619 }
2620
2625};
2626
2631
2632// 28720 - Nightmare Vine
2634{
2636
2637 bool Validate(SpellInfo const* /*spellInfo*/) override
2638 {
2640 }
2641
2643 {
2644 PreventHitDefaultEffect(effIndex);
2645
2646 if (Unit* target = GetHitUnit())
2647 {
2648 // 25% chance of casting Nightmare Pollen
2649 if (roll_chance_i(25))
2650 target->CastSpell(target, SPELL_NIGHTMARE_POLLEN, true);
2651 }
2652 }
2653
2658};
2659
2660// 27746 - Nitrous Boost
2662{
2664
2665 void PeriodicTick(AuraEffect const* /*aurEff*/)
2666 {
2668
2669 if (GetCaster() && GetTarget()->GetPower(POWER_MANA) >= 10)
2671 else
2672 Remove();
2673 }
2674
2679};
2680
2690
2691// 27539 - Obsidian Armor
2693{
2695
2708
2709 bool CheckProc(ProcEventInfo& eventInfo)
2710 {
2711 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
2712 if (!damageInfo || !damageInfo->GetSpellInfo())
2713 return false;
2714
2716 return false;
2717
2718 return true;
2719 }
2720
2721 void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
2722 {
2724
2725 uint32 spellId = 0;
2726 switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
2727 {
2728 case SPELL_SCHOOL_HOLY:
2730 break;
2731 case SPELL_SCHOOL_FIRE:
2733 break;
2736 break;
2737 case SPELL_SCHOOL_FROST:
2739 break;
2742 break;
2745 break;
2746 default:
2747 return;
2748 }
2749 GetTarget()->CastSpell(GetTarget(), spellId, aurEff);
2750 }
2751
2757};
2758
2759// 55342 Mirror Image
2774
2776{
2778
2779 bool Load() override
2780 {
2781 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2782 }
2783
2784 void HandleDummy(SpellEffIndex /*effIndex*/)
2785 {
2786 Player* player = GetCaster()->ToPlayer();
2787 uint32 factionId = GetEffectInfo().CalcValue();
2788 int32 repChange = GetEffectInfo(EFFECT_1).CalcValue();
2789
2790 FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
2791 if (!factionEntry)
2792 return;
2793
2794 // Set rep to baserep + basepoints (expecting spillover for oposite faction -> become hated)
2795 // Not when player already has equal or higher rep with this faction
2796 if (player->GetReputationMgr().GetReputation(factionEntry) < repChange)
2797 player->GetReputationMgr().SetReputation(factionEntry, repChange);
2798
2799 // EFFECT_INDEX_2 most likely update at war state, we already handle this in SetReputation
2800 }
2801
2806};
2807
2814
2816{
2818
2819 bool Validate(SpellInfo const* /*spellInfo*/) override
2820 {
2821 return ValidateSpellInfo(
2822 {
2826 });
2827 }
2828
2829 void HandleScript(SpellEffIndex /*effIndex*/)
2830 {
2831 Unit* caster = GetCaster();
2832 if (Player* target = GetHitPlayer())
2833 {
2834 uint8 gender = target->GetNativeGender();
2835 if (!gender)
2836 caster->CastSpell(target, SPELL_ORC_DISGUISE_MALE, true);
2837 else
2838 caster->CastSpell(target, SPELL_ORC_DISGUISE_FEMALE, true);
2839 }
2840 }
2841
2846};
2847
2849{
2850 SPELL_PARALYSIS = 35202
2852
2853// 35201 - Paralytic Poison
2855{
2857
2858 bool Validate(SpellInfo const* /*spellInfo*/) override
2859 {
2861 }
2862
2863 void HandleStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
2864 {
2865 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
2866 return;
2867
2868 GetTarget()->CastSpell(nullptr, SPELL_PARALYSIS, aurEff);
2869 }
2870
2875};
2876
2899
2901{
2903
2904 bool Validate(SpellInfo const* spellInfo) override
2905 {
2906 return sObjectMgr->GetBroadcastText(uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()));
2907 }
2908
2909 void HandleScript(SpellEffIndex /*effIndex*/)
2910 {
2911 // Note: target here is always player; caster here is gameobject, creature or player (self cast)
2912 if (Unit* target = GetHitUnit())
2913 target->Unit::Say(uint32(GetEffectValue()), target);
2914 }
2915
2920};
2921
2923{
2925
2926 bool CheckProc(ProcEventInfo& eventInfo)
2927 {
2928 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
2929 if (!damageInfo || !damageInfo->GetDamage())
2930 return false;
2931
2933
2934 if (eventInfo.GetActionTarget()->HealthBelowPctDamaged(pct, damageInfo->GetDamage()))
2935 return true;
2936
2937 return false;
2938 }
2939
2944};
2945
2960
2966
2967// 45472 Parachute
2969{
2971
2972 bool Validate(SpellInfo const* /*spellInfo*/) override
2973 {
2974 return ValidateSpellInfo(
2975 {
2978 });
2979 }
2980
2981 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
2982 {
2983 if (Player* target = GetTarget()->ToPlayer())
2984 if (target->IsFalling())
2985 {
2986 target->RemoveAurasDueToSpell(SPELL_PARACHUTE);
2987 target->CastSpell(target, SPELL_PARACHUTE_BUFF, true);
2988 }
2989 }
2990
2995};
2996
2998{
3001 NPC_IMP = 416
3003
3005{
3007
3008 bool Load() override
3009 {
3010 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
3011 }
3012
3013 void HandleScript(SpellEffIndex /*effIndex*/)
3014 {
3015 Player* player = GetCaster()->ToPlayer();
3016 if (player->GetLastPetNumber())
3017 {
3018 PetType newPetType = (player->GetClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
3019 Pet* newPet = new Pet(player, newPetType);
3020 if (newPet->LoadPetFromDB(player, 0, player->GetLastPetNumber(), true))
3021 {
3022 // revive the pet if it is dead
3023 if (newPet->getDeathState() != ALIVE && newPet->getDeathState() != JUST_RESPAWNED)
3025
3026 newPet->SetFullHealth();
3027 newPet->SetPower(newPet->GetPowerType(), newPet->GetMaxPower(newPet->GetPowerType()));
3028
3029 switch (newPet->GetEntry())
3030 {
3031 case NPC_DOOMGUARD:
3032 case NPC_INFERNAL:
3033 newPet->SetEntry(NPC_IMP);
3034 break;
3035 default:
3036 break;
3037 }
3038 }
3039 else
3040 delete newPet;
3041 }
3042 }
3043
3048};
3049
3050// 36553 - PetWait
3066
3071
3073{
3075
3076 bool Load() override
3077 {
3078 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
3079 }
3080
3082 {
3083 Player* player = GetCaster()->ToPlayer();
3084
3085 if (HasDiscoveredAllSpells(GetSpellInfo()->Id, player))
3086 {
3089 }
3090
3091 return SPELL_CAST_OK;
3092 }
3093
3094 void HandleScript(SpellEffIndex /*effIndex*/)
3095 {
3096 Player* caster = GetCaster()->ToPlayer();
3097 uint32 spellId = GetSpellInfo()->Id;
3098
3099 // Learn random explicit discovery recipe (if any)
3100 // Players will now learn 3 recipes the very first time they perform Northrend Inscription Research (3.3.0 patch notes)
3101 if (spellId == SPELL_NORTHREND_INSCRIPTION_RESEARCH && !HasDiscoveredAnySpell(spellId, caster))
3102 for (int i = 0; i < 2; ++i)
3103 if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
3104 caster->LearnSpell(discoveredSpellId, false);
3105
3106 if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
3107 caster->LearnSpell(discoveredSpellId, false);
3108 }
3109
3115};
3116
3118{
3120
3121 void HandleScript(SpellEffIndex /*effIndex*/)
3122 {
3123 if (Unit* target = GetHitUnit())
3124 {
3125 target->RemoveAurasByType(SPELL_AURA_FLY);
3126 target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
3127 }
3128 }
3129
3134};
3135
3136// 20589 - Escape artist
3137// 30918 - Improved Sprint
3152
3153// 23493 - Restoration
3154// 24379 - Restoration
3156{
3158
3159 void PeriodicTick(AuraEffect const* /*aurEff*/)
3160 {
3162
3163 Unit* target = GetTarget();
3164 if (!target)
3165 return;
3166
3167 int32 heal = target->CountPctFromMaxHealth(10);
3168 HealInfo healInfo(target, target, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
3169 target->HealBySpell(healInfo);
3170
3172 if (int32 mana = target->GetMaxPower(POWER_MANA))
3173 {
3174 mana /= 10;
3175 target->EnergizeBySpell(target, GetId(), mana, POWER_MANA);
3176 }
3177 }
3178
3183};
3184
3185// 38772 Grievous Wound
3186// 43937 Grievous Wound
3187// 62331 Impale
3188// 62418 Impale
3190{
3192
3193 void PeriodicTick(AuraEffect const* /*aurEff*/)
3194 {
3195 // they apply damage so no need to check for ticks here
3196
3197 if (GetTarget()->HealthAbovePct(GetEffectInfo(EFFECT_1).CalcValue()))
3198 {
3201 }
3202 }
3203
3208};
3209
3210// 31956 Grievous Wound
3211// 38801 Grievous Wound
3212// 43093 Grievous Throw
3213// 58517 Grievous Wound
3214// 59262 Grievous Wound
3216{
3218
3219 void PeriodicTick(AuraEffect const* aurEff)
3220 {
3221 // if it has only periodic effect, allow 1 tick
3222 bool onlyEffect = !GetEffectInfo(EFFECT_1).IsEffect() && !GetEffectInfo(EFFECT_2).IsEffect();
3223 if (onlyEffect && aurEff->GetTickNumber() <= 1)
3224 return;
3225
3226 if (GetTarget()->IsFullHealth())
3227 {
3230 }
3231 }
3232
3237};
3238
3239// 70292 - Glacial Strike
3240// 71316 - Glacial Strike
3241// 71317 - Glacial Strike
3243{
3245
3246 void PeriodicTick(AuraEffect const* /*aurEff*/)
3247 {
3248 // they apply damage so no need to check for ticks here
3249
3250 if (GetTarget()->IsFullHealth())
3251 {
3254 }
3255 }
3256
3261};
3262
3268
3270{
3271public:
3272 bool operator()(WorldObject* obj) const
3273 {
3274 if (Unit* target = obj->ToUnit())
3275 return target->GetPowerType() != POWER_MANA;
3276
3277 return true;
3278 }
3279};
3280
3282{
3284
3285 void RemoveInvalidTargets(std::list<WorldObject*>& targets)
3286 {
3287 // In arenas Replenishment may only affect the caster
3288 if (Player* caster = GetCaster()->ToPlayer())
3289 {
3290 if (caster->InArena())
3291 {
3292 targets.clear();
3293 targets.push_back(caster);
3294 return;
3295 }
3296 }
3297
3298 targets.remove_if(ReplenishmentCheck());
3299
3300 uint8 const maxTargets = 10;
3301
3302 if (targets.size() > maxTargets)
3303 {
3305 targets.resize(maxTargets);
3306 }
3307 }
3308
3313};
3314
3316{
3318
3319 bool Load() override
3320 {
3321 return GetUnitOwner()->GetPowerType() == POWER_MANA;
3322 }
3323
3324 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
3325 {
3326 switch (GetSpellInfo()->Id)
3327 {
3329 amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f;
3330 break;
3332 amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f;
3333 break;
3334 default:
3335 break;
3336 }
3337 }
3338
3343};
3344
3345// 32343 - Revive Self
3361
3366
3368{
3370
3371 bool Validate(SpellInfo const* /*spellInfo*/) override
3372 {
3374 }
3375
3376 bool Load() override
3377 {
3378 return GetGObjCaster()->GetOwnerGUID().IsPlayer();
3379 }
3380
3382 {
3383 if (Unit* owner = GetGObjCaster()->GetOwner())
3384 if (GameObject* go = GetHitGObj())
3385 if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING)
3386 owner->CastSpell(nullptr, SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT, true);
3387 }
3388
3393};
3394
3396
3412
3414{
3416
3417 bool Load() override
3418 {
3420 }
3421
3422 void HandleDummy(SpellEffIndex /* effIndex */)
3423 {
3424 Player* originalCaster = GetOriginalCaster()->ToPlayer();
3425 if (Unit* target = GetHitUnit())
3426 {
3428 data << target->GetGUID();
3429 originalCaster->SendDirectMessage(&data);
3430 }
3431 }
3432
3437};
3438
3443
3472
3473// 41213, 43416, 69222, 73076 - Throw Shield
3489
3495
3497{
3499
3500 bool Validate(SpellInfo const* /*spellInfo*/) override
3501 {
3502 return ValidateSpellInfo(
3503 {
3506 });
3507 }
3508
3510 {
3511 if (Unit* rider = GetCaster()->GetCharmer())
3512 {
3513 if (Player* playerTarget = GetHitPlayer())
3514 {
3515 if (playerTarget->HasAura(SPELL_ON_TOURNAMENT_MOUNT) && playerTarget->GetVehicleBase())
3516 rider->CastSpell(playerTarget, SPELL_MOUNTED_DUEL, true);
3517 }
3518 else if (Unit* unitTarget = GetHitUnit())
3519 {
3520 if (unitTarget->GetCharmer() && unitTarget->GetCharmer()->GetTypeId() == TYPEID_PLAYER && unitTarget->GetCharmer()->HasAura(SPELL_ON_TOURNAMENT_MOUNT))
3521 rider->CastSpell(unitTarget->GetCharmer(), SPELL_MOUNTED_DUEL, true);
3522 }
3523 }
3524 }
3525
3530};
3531
3533{
3535
3536 bool Load() override
3537 {
3538 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
3539 }
3540
3541 void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
3542 {
3543 if (Unit* caster = GetCaster())
3544 if (!caster->GetVehicleBase())
3545 caster->RemoveAurasDueToSpell(GetId());
3546 }
3547
3552};
3553
3561
3563{
3565
3566 void HandleScript(SpellEffIndex /* effIndex */)
3567 {
3568 Unit* target = GetHitUnit();
3569 if (target->GetTypeId() != TYPEID_PLAYER)
3570 return;
3571
3572 // return from top
3573 if (target->ToPlayer()->GetAreaId() == AREA_VIOLET_CITADEL_SPIRE)
3574 target->CastSpell(target, SPELL_TELEPORT_SPIRE_DOWN, true);
3575 // teleport atop
3576 else
3577 target->CastSpell(target, SPELL_TELEPORT_SPIRE_UP, true);
3578 }
3579
3584};
3585
3591
3592template <uint32 TriggeredSpellId>
3594{
3596
3597 bool Validate(SpellInfo const* /*spellInfo*/) override
3598 {
3599 return ValidateSpellInfo({ TriggeredSpellId });
3600 }
3601
3603 {
3604 /*
3605 * @workaround: PendingCast flag normally means 'triggered' spell, however
3606 * if the spell is cast triggered, the core won't send SMSG_SPELL_GO packet
3607 * so client never registers the cooldown (see Spell::IsNeedSendToClient)
3608 *
3609 * ServerToClient: SMSG_SPELL_GO (0x0132) Length: 42 ConnIdx: 0 Time: 07/19/2010 02:32:35.000 Number: 362675
3610 * Caster GUID: Full: Player
3611 * Caster Unit GUID: Full: Player
3612 * Cast Count: 0
3613 * Spell ID: 72752 (72752)
3614 * Cast Flags: PendingCast, Unknown3, Unknown7 (265)
3615 * Time: 3901468825
3616 * Hit Count: 1
3617 * [0] Hit GUID: Player
3618 * Miss Count: 0
3619 * Target Flags: Unit (2)
3620 * Target GUID: 0x0
3621 */
3622
3623 // Spell flags need further research, until then just cast not triggered
3624 GetCaster()->CastSpell(nullptr, TriggeredSpellId, false);
3625 }
3626
3631};
3632
3637
3639{
3641
3642 void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
3643 {
3644 // store stack apply times, so we can pop them while they expire
3646 Unit* target = GetTarget();
3647
3648 // on stack 15 cast the achievement crediting spell
3649 if (GetStackAmount() >= 15)
3650 target->CastSpell(target, SPELL_TURKEY_VENGEANCE, { aurEff, GetCasterGUID() });
3651 }
3652
3653 void OnPeriodic(AuraEffect const* /*aurEff*/)
3654 {
3655 int32 removeCount = 0;
3656
3657 // pop expired times off of the stack
3658 while (!_applyTimes.empty() && _applyTimes.front() + GetMaxDuration() < GameTime::GetGameTimeMS())
3659 {
3660 _applyTimes.pop_front();
3661 removeCount++;
3662 }
3663
3664 if (removeCount)
3666 }
3667
3673
3674 std::list<uint32> _applyTimes;
3675};
3676
3685
3687{
3689
3690 void HandleScript(SpellEffIndex /*effIndex*/)
3691 {
3692 if (Player* player = GetHitPlayer())
3693 {
3695 // player can only have one of these items
3696 for (uint8 i = 0; i < 5; ++i)
3697 {
3698 if (player->HasItemCount(itemId[i], 1, true))
3699 return;
3700 }
3701
3702 CreateItem(itemId[urand(0, 4)]);
3703 }
3704 }
3705
3710};
3711
3716
3717// 52723 - Vampiric Touch
3718// 60501 - Vampiric Touch
3720{
3722
3723 bool Validate(SpellInfo const* /*spellInfo*/) override
3724 {
3726 }
3727
3728 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
3729 {
3731 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
3732 if (!damageInfo || !damageInfo->GetDamage())
3733 return;
3734
3735 Unit* caster = eventInfo.GetActor();
3736 CastSpellExtraArgs args(aurEff);
3737 args.AddSpellBP0(damageInfo->GetDamage() / 2);
3738 caster->CastSpell(caster, SPELL_VAMPIRIC_TOUCH_HEAL, args);
3739 }
3740
3745};
3746
3748{
3749 SPELL_GEAR_SCALING = 66668
3751
3753{
3755
3756 bool Load() override
3757 {
3758 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
3759 }
3760
3761 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
3762 {
3763 Unit* caster = GetCaster();
3764 float factor;
3765 uint16 baseItemLevel;
3766
3768 switch (GetId())
3769 {
3770 case SPELL_GEAR_SCALING:
3771 factor = 1.0f;
3772 baseItemLevel = 205;
3773 break;
3774 default:
3775 factor = 1.0f;
3776 baseItemLevel = 170;
3777 break;
3778 }
3779
3780 float avgILvl = caster->ToPlayer()->GetAverageItemLevel();
3781 if (avgILvl < baseItemLevel)
3782 return;
3783
3784 amount = uint16((avgILvl - baseItemLevel) * factor);
3785 }
3786
3793};
3794
3800
3802{
3804
3805 void HandleDummy(SpellEffIndex /* effIndex */)
3806 {
3807 if (Creature* vendor = GetCaster()->ToCreature())
3808 if (vendor->GetEntry() == NPC_AMPHITHEATER_VENDOR)
3809 vendor->AI()->Talk(SAY_AMPHITHEATER_VENDOR);
3810 }
3811
3816};
3817
3819{
3821
3823 {
3824 if (!GetSpellInfo()->CheckTargetCreatureType(GetCaster()))
3826 return SPELL_CAST_OK;
3827 }
3828
3833};
3834
3839
3860
3862{
3864
3865 bool Validate(SpellInfo const* spellInfo) override
3866 {
3867 return sObjectMgr->GetBroadcastText(uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()));
3868 }
3869
3870 void HandleScript(SpellEffIndex /*effIndex*/)
3871 {
3872 if (TempSummon* casterSummon = GetCaster()->ToTempSummon())
3873 if (Player* target = casterSummon->GetSummonerUnit()->ToPlayer())
3874 casterSummon->Unit::Whisper(uint32(GetEffectValue()), target, false);
3875 }
3876
3881};
3882
3889
3890// BasePoints of spells is ID of npc_text used to group texts, it's not implemented so texts are grouped the old way
3891// 50037 - Mystery of the Infinite: Future You's Whisper to Controller - Random
3892// 50287 - Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random
3893// 60709 - MOTI, Redux: Past You's Whisper to Controller - Random
3895{
3897
3898public:
3900
3901private:
3902 void HandleScript(SpellEffIndex /*effIndex*/)
3903 {
3904 // Same for all spells
3905 if (!roll_chance_i(20))
3906 return;
3907
3908 if (Creature* target = GetHitCreature())
3909 if (TempSummon* targetSummon = target->ToTempSummon())
3910 if (Player* player = targetSummon->GetSummonerUnit()->ToPlayer())
3911 targetSummon->AI()->Talk(_text, player);
3912 }
3913
3918
3920};
3921
3922// 23777 - Zero Mana/Full Health DND
3938
3940{
3942
3944 {
3945 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3946 vehicle->RemoveAllPassengers();
3947 }
3948
3953};
3954
3956{
3958
3959 bool Validate(SpellInfo const* spellInfo) override
3960 {
3961 if (spellInfo->GetEffect(EFFECT_0).CalcValue() < 1)
3962 return false;
3963 return true;
3964 }
3965
3967 {
3968 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3969 {
3970 if (Unit* passenger = vehicle->GetPassenger(GetEffectValue() - 1))
3971 passenger->ExitVehicle();
3972 }
3973 }
3974
3979};
3980
3982{
3984
3985public:
3987
3988private:
3990
3992 {
3993 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3994 {
3995 if (Unit* passenger = vehicle->GetPassenger(_seatId))
3996 passenger->ExitVehicle();
3997 }
3998 }
3999
4004};
4005
4007{
4008 SPELL_GM_FREEZE = 9454
4010
4012{
4014
4015 bool Validate(SpellInfo const* /*spellInfo*/) override
4016 {
4018 }
4019
4020 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
4021 {
4022 // Do what was done before to the target in HandleFreezeCommand
4023 if (Player* player = GetTarget()->ToPlayer())
4024 {
4025 // stop combat + make player unattackable + duel stop + stop some spells
4026 player->SetFaction(FACTION_FRIENDLY);
4027 player->CombatStop();
4028 if (player->IsNonMeleeSpellCast(true))
4029 player->InterruptNonMeleeSpells(true);
4030 player->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
4031
4032 // if player class = hunter || warlock remove pet if alive
4033 if ((player->GetClass() == CLASS_HUNTER) || (player->GetClass() == CLASS_WARLOCK))
4034 {
4035 if (Pet* pet = player->GetPet())
4036 {
4037 pet->SavePetToDB(PET_SAVE_AS_CURRENT);
4038 // not let dismiss dead pet
4039 if (pet->IsAlive())
4040 player->RemovePet(pet, PET_SAVE_NOT_IN_SLOT);
4041 }
4042 }
4043 }
4044 }
4045
4046 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
4047 {
4048 // Do what was done before to the target in HandleUnfreezeCommand
4049 if (Player* player = GetTarget()->ToPlayer())
4050 {
4051 // Reset player faction + allow combat + allow duels
4052 player->SetFactionForRace(player->GetRace());
4053 player->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
4054 // save player
4055 player->SaveToDB();
4056 }
4057 }
4058
4064};
4065
4067{
4069
4071 {
4072 Creature* target = GetHitCreature();
4073 if (!target)
4074 return;
4075
4078 }
4079
4084};
4085
4087{
4089 // Flasks
4106 // Elixirs
4173
4175{
4177
4178 bool Validate(SpellInfo const* /*spellInfo*/) override
4179 {
4181 }
4182
4183 bool Load() override
4184 {
4185 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
4186 }
4187
4188 void SetBonusValueForEffect(SpellEffIndex effIndex, int32 value, AuraEffect const* aurEff)
4189 {
4190 if (aurEff->GetEffIndex() == uint32(effIndex))
4191 bonus = value;
4192 }
4193
4194 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
4195 {
4196 if (GetCaster()->HasAura(SPELL_MIXOLOGY) && GetCaster()->HasSpell(GetEffectInfo(EFFECT_0).TriggerSpell))
4197 {
4198 switch (GetId())
4199 {
4202 bonus = amount;
4203 break;
4207 bonus = CalculatePct(amount, 80);
4208 break;
4224 bonus = CalculatePct(amount, 50);
4225 break;
4227 bonus = 280;
4228 break;
4230 bonus = 200;
4231 break;
4234 bonus = 140;
4235 break;
4237 bonus = 100;
4238 break;
4240 bonus = 82;
4241 break;
4243 bonus = 70;
4244 break;
4246 bonus = 50;
4247 break;
4249 bonus = 47;
4250 break;
4251 case SPELL_WRATH_ELIXIR:
4252 bonus = 32;
4253 break;
4257 bonus = 29;
4258 break;
4260 bonus = 27;
4261 break;
4266 bonus = 23;
4267 break;
4279 bonus = 20;
4280 break;
4282 bonus = 17;
4283 break;
4286 bonus = 15;
4287 break;
4289 bonus = 13;
4290 break;
4292 bonus = 12;
4293 break;
4296 bonus = 11;
4297 break;
4303 bonus = 10;
4304 break;
4306 bonus = 9;
4307 break;
4309 case SPELL_GURUS_ELIXIR:
4310 bonus = 8;
4311 break;
4315 bonus = 6;
4316 break;
4321 bonus = 5;
4322 break;
4325 bonus = 4;
4326 break;
4328 bonus = -10;
4329 break;
4331 SetBonusValueForEffect(EFFECT_0, 13, aurEff);
4332 SetBonusValueForEffect(EFFECT_1, 13, aurEff);
4333 SetBonusValueForEffect(EFFECT_2, 8, aurEff);
4334 break;
4336 SetBonusValueForEffect(EFFECT_0, 160, aurEff);
4337 break;
4339 SetBonusValueForEffect(EFFECT_0, 116, aurEff);
4340 SetBonusValueForEffect(EFFECT_1, 6, aurEff);
4341 break;
4343 SetBonusValueForEffect(EFFECT_0, 40, aurEff);
4344 SetBonusValueForEffect(EFFECT_1, 40, aurEff);
4345 break;
4347 SetBonusValueForEffect(EFFECT_0, 210, aurEff);
4348 SetBonusValueForEffect(EFFECT_1, 5, aurEff);
4349 break;
4351 SetBonusValueForEffect(EFFECT_0, 19, aurEff);
4352 SetBonusValueForEffect(EFFECT_1, 19, aurEff);
4353 SetBonusValueForEffect(EFFECT_2, 5, aurEff);
4354 break;
4356 SetBonusValueForEffect(EFFECT_0, 5, aurEff);
4357 break;
4358 default:
4359 TC_LOG_ERROR("spells", "SpellId {} couldn't be processed in spell_gen_mixology_bonus", GetId());
4360 break;
4361 }
4362 amount += bonus;
4363 }
4364 }
4365
4367
4372};
4373
4378
4380{
4382
4383 void HandleScript(SpellEffIndex /*effIndex*/)
4384 {
4385 if (Player* target = GetHitPlayer())
4386 {
4387 Aura const* aura = GetHitAura();
4388 if (!aura || aura->GetStackAmount() < 10)
4389 return;
4390
4391 target->CastSpell(target, SPELL_LANDMINE_KNOCKBACK_ACHIEVEMENT, true);
4392 }
4393 }
4394
4399};
4400
4401// 34098 - ClearAllDebuffs
4403{
4405
4406 void HandleScript(SpellEffIndex /*effIndex*/)
4407 {
4408 if (Unit* target = GetHitUnit())
4409 {
4410 target->RemoveOwnedAuras([](Aura const* aura)
4411 {
4412 SpellInfo const* spellInfo = aura->GetSpellInfo();
4413 return !spellInfo->IsPositive() && !spellInfo->IsPassive();
4414 });
4415 }
4416 }
4417
4422};
4423
4425{
4427 MOUNT_PONY = 29736
4429
4431{
4433
4434 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
4435 {
4436 Unit* caster = GetCaster();
4437 if (!caster)
4438 return;
4439 Player* owner = caster->GetOwner()->ToPlayer();
4440 if (!owner || !owner->HasAchieved(ACHIEV_PONY_UP))
4441 return;
4442
4443 if (owner->IsMounted())
4444 {
4445 caster->Mount(MOUNT_PONY);
4446 caster->SetSpeedRate(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
4447 }
4448 else if (caster->IsMounted())
4449 {
4450 caster->Dismount();
4451 caster->SetSpeedRate(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
4452 }
4453 }
4454
4459};
4460
4468
4469// 40350 - Corrupting Plague
4471{
4472public:
4473 CorruptingPlagueSearcher(Unit* obj, float distance) : _unit(obj), _distance(distance) { }
4474
4475 bool operator()(Unit* u) const
4476 {
4477 if (_unit->GetDistance2d(u) < _distance &&
4480 return true;
4481
4482 return false;
4483 }
4484
4485private:
4488};
4489
4490// 40349 - Corrupting Plague
4492{
4494
4495 bool Validate(SpellInfo const* /*spellInfo*/) override
4496 {
4498 }
4499
4500 void OnPeriodic(AuraEffect const* /*aurEff*/)
4501 {
4502 Unit* owner = GetTarget();
4503
4504 std::list<Creature*> targets;
4505 CorruptingPlagueSearcher creature_check(owner, 15.0f);
4506 Trinity::CreatureListSearcher<CorruptingPlagueSearcher> creature_searcher(owner, targets, creature_check);
4507 Cell::VisitGridObjects(owner, creature_searcher, 15.0f);
4508
4509 if (!targets.empty())
4510 return;
4511
4513 }
4514
4519};
4520
4526
4527// 40307 - Stasis Field
4529{
4530public:
4531 StasisFieldSearcher(Unit* obj, float distance) : _unit(obj), _distance(distance) { }
4532
4533 bool operator()(Unit* u) const
4534 {
4535 if (_unit->GetDistance2d(u) < _distance &&
4538 return true;
4539
4540 return false;
4541 }
4542
4543private:
4546};
4547
4548// 40306 - Stasis Field
4550{
4552
4553 bool Validate(SpellInfo const* /*spellInfo*/) override
4554 {
4556 }
4557
4558 void OnPeriodic(AuraEffect const* /*aurEff*/)
4559 {
4560 Unit* owner = GetTarget();
4561
4562 std::list<Creature*> targets;
4563 StasisFieldSearcher creature_check(owner, 15.0f);
4564 Trinity::CreatureListSearcher<StasisFieldSearcher> creature_searcher(owner, targets, creature_check);
4565 Cell::VisitGridObjects(owner, creature_searcher, 15.0f);
4566
4567 if (!targets.empty())
4568 return;
4569
4571 }
4572
4577};
4578
4583
4598
4605
4606// 34779 - Freezing Circle
4608{
4610
4611 bool Validate(SpellInfo const* /*spellInfo*/) override
4612 {
4613 return ValidateSpellInfo(
4614 {
4618 });
4619 }
4620
4621 void HandleDamage(SpellEffIndex /*effIndex*/)
4622 {
4623 Unit* caster = GetCaster();
4624 uint32 spellId = 0;
4625 Map* map = caster->GetMap();
4626
4627 if (map->IsDungeon())
4629 else
4630 spellId = SPELL_FREEZING_CIRCLE;
4631
4632 if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId))
4633 SetHitDamage(spellInfo->GetEffect(EFFECT_0).CalcValue());
4634 }
4635
4640};
4641
4642// Used for some spells cast by vehicles or charmed creatures that do not send a cooldown event on their own
4644{
4646
4648 {
4649 Unit* caster = GetCaster();
4650 if (Player* owner = caster->GetCharmerOrOwnerPlayerOrPlayerItself())
4651 {
4652 WorldPacket data;
4654 owner->SendDirectMessage(&data);
4655 }
4656 }
4657
4662};
4663
4669
4671{
4673
4674 bool Validate(SpellInfo const* /*spellInfo*/) override
4675 {
4677 }
4678 void HandleScript(SpellEffIndex /*effIndex*/)
4679 {
4680 int32 bp = GetEffectInfo().CalcValue();
4681 Unit* target = GetHitUnit();
4683 args.AddSpellBP0(bp);
4684 target->CastSpell(target, SPELL_CANNON_BLAST_DAMAGE, args);
4685 }
4686
4691};
4692
4693// 37751 - Submerged
4709
4711{
4725 RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_break_shield");
4726 RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_tournament_counterattack");
4739 RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_default_count_pct_from_max_hp");
4740 RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_50pct_count_pct_from_max_hp", 50);
4742 RegisterSpellScriptWithArgs(spell_gen_dalaran_disguise, "spell_gen_sunreaver_disguise");
4743 RegisterSpellScriptWithArgs(spell_gen_dalaran_disguise, "spell_gen_silver_covenant_disguise");
4774 RegisterSpellScriptWithArgs(spell_gen_knock_away_threat_reduction, "spell_gen_knock_away_threat_reduction_100", 100); // 10101
4775 RegisterSpellScriptWithArgs(spell_gen_knock_away_threat_reduction, "spell_gen_knock_away_threat_reduction_50", 50); // 18670, 18945
4776 RegisterSpellScriptWithArgs(spell_gen_knock_away_threat_reduction, "spell_gen_knock_away_threat_reduction_25", 25); // 18813, 25778
4784 RegisterSpellScriptWithArgs(spell_gen_mount, "spell_winged_steed_of_the_ebon_blade", 0, 0, 0, SPELL_WINGED_STEED_150, SPELL_WINGED_STEED_280);
4803 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_soul_harvesters_charm");
4804 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_commendation_of_kaelthas");
4805 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_corpse_tongue_coin");
4806 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_corpse_tongue_coin_heroic");
4807 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_petrified_twilight_scale");
4808 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_petrified_twilight_scale_heroic");
4840 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_future_you_whisper_to_controller_random", WHISPER_FUTURE_YOU);
4841 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_wyrmrest_defender_whisper_to_controller_random", WHISPER_DEFENDER);
4842 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_past_you_whisper_to_controller_random", WHISPER_PAST_YOU);
4846 RegisterSpellScriptWithArgs(spell_gen_eject_passenger_with_seatId, "spell_gen_eject_passenger_1", 0);
4847 RegisterSpellScriptWithArgs(spell_gen_eject_passenger_with_seatId, "spell_gen_eject_passenger_3", 2);
4861}
DBCStorage< FactionEntry > sFactionStore(FactionEntryfmt)
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint16_t uint16
Definition Define.h:134
uint32_t uint32
Definition Define.h:133
#define TC_LOG_ERROR(filterType__,...)
Definition Log.h:165
@ TYPEID_UNIT
Definition ObjectGuid.h:38
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
#define sObjectMgr
Definition ObjectMgr.h:1721
@ PET_SAVE_NOT_IN_SLOT
Definition PetDefines.h:45
@ PET_SAVE_AS_CURRENT
Definition PetDefines.h:42
PetType
Definition PetDefines.h:30
@ SUMMON_PET
Definition PetDefines.h:31
@ HUNTER_PET
Definition PetDefines.h:32
@ EQUIPMENT_SLOT_MAINHAND
Definition Player.h:575
@ EQUIPMENT_SLOT_OFFHAND
Definition Player.h:576
@ EQUIPMENT_SLOT_RANGED
Definition Player.h:577
#define INVENTORY_SLOT_BAG_0
Definition Player.h:555
int32 irand(int32 min, int32 max)
Definition Random.cpp:35
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:42
bool roll_chance_f(float chance)
Definition Random.h:53
bool roll_chance_i(int chance)
Definition Random.h:59
#define RegisterSpellAndAuraScriptPair(script_1, script_2)
Definition ScriptMgr.h:1130
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
#define RegisterSpellScriptWithArgs(spell_script, script_name,...)
Definition ScriptMgr.h:1127
@ GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ EFFECT_2
#define EFFECT_FIRST_FOUND
@ SPELL_SCHOOL_SHADOW
@ SPELL_SCHOOL_NORMAL
@ SPELL_SCHOOL_NATURE
@ SPELL_SCHOOL_FROST
@ SPELL_SCHOOL_ARCANE
@ SPELL_SCHOOL_FIRE
@ SPELL_SCHOOL_HOLY
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_CHARGE
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ SPELL_EFFECT_GAMEOBJECT_DAMAGE
@ GENDER_FEMALE
@ TARGET_UNIT_CASTER_AREA_RAID
@ TARGET_DEST_CASTER
@ EMOTE_ONESHOT_EXCLAMATION
@ EMOTE_ONESHOT_APPLAUD
@ EMOTE_ONESHOT_CHEER
@ EMOTE_STATE_NONE
SpellSchools GetFirstSchoolInMask(SpellSchoolMask mask)
@ UNIT_DYNFLAG_DEAD
@ BASE_ATTACK
@ RANGED_ATTACK
@ CLASS_HUNTER
@ CLASS_WARLOCK
@ MECHANIC_FEAR
@ MECHANIC_POLYMORPH
@ SPELLFAMILY_PRIEST
@ SPELLFAMILY_WARLOCK
@ SPELLFAMILY_MAGE
@ SPELLFAMILY_GENERIC
@ SPELLFAMILY_WARRIOR
@ SPELLFAMILY_PALADIN
@ SPELLFAMILY_HUNTER
@ SPELLFAMILY_SHAMAN
@ SPELLFAMILY_DRUID
@ SPELLFAMILY_DEATHKNIGHT
@ SPELL_CUSTOM_ERROR_NOTHING_TO_DISCOVER
@ SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED
@ ALLIANCE
@ POWER_MANA
@ GOLD
@ FACTION_FRIENDLY
#define EFFECT_ALL
SpellCastResult
@ SPELL_FAILED_CUSTOM_ERROR
@ SPELL_FAILED_DONT_REPORT
@ SPELL_FAILED_TARGET_AURASTATE
@ SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW
@ SPELL_CAST_OK
@ SPELL_FAILED_NO_EDIBLE_CORPSES
@ SKILL_RIDING
uint32 GetExplicitDiscoverySpell(uint32 spellId, Player *player)
bool HasDiscoveredAllSpells(uint32 spellId, Player *player)
bool HasDiscoveredAnySpell(uint32 spellId, Player *player)
@ AURA_REMOVE_BY_EXPIRE
@ AURA_REMOVE_BY_ENEMY_SPELL
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_MOD_SHAPESHIFT
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_MOD_POWER_REGEN
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
@ SPELL_AURA_FLY
@ SPELL_AURA_MOD_HEALING_PCT
@ SPELL_AURA_MOD_MANA_REGEN_INTERRUPT
@ SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
@ SPELL_AURA_MOUNTED
@ SPELL_AURA_MOD_DECREASE_SPEED
@ SPELL_AURA_TRANSFORM
@ SPELL_AURA_PERIODIC_ENERGIZE
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT
@ SPELL_AURA_MOD_STUN
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ SPELL_COOLDOWN_FLAG_NONE
@ TARGET_CHECK_ENEMY
Definition SpellInfo.h:81
#define sSpellMgr
Definition SpellMgr.h:738
@ PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS
Definition SpellMgr.h:121
@ PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG
Definition SpellMgr.h:133
@ PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG
Definition SpellMgr.h:139
#define AuraProcFn(F)
#define SpellCheckCastFn(F)
#define AuraEffectProcFn(F, I, N)
#define SpellEffectFn(F, I, N)
#define AuraEffectCalcAmountFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraEffectUpdatePeriodicFn(F, I, N)
#define SpellCastFn(F)
#define SpellDestinationTargetSelectFn(F, I, N)
#define AuraEffectAbsorbFn(F, I)
#define SPELL_EFFECT_ANY
Definition SpellScript.h:52
#define AuraEffectCalcPeriodicFn(F, I, N)
#define AuraEffectApplyFn(F, I, N, M)
#define AuraCheckProcFn(F)
#define SpellHitFn(F)
#define SPELL_AURA_ANY
Definition SpellScript.h:53
#define AuraCheckAreaTargetFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
@ UNIT_FLAG2_FEIGN_DEATH
@ REACT_PASSIVE
@ UNIT_STAND_STATE_SUBMERGED
Definition UnitDefines.h:43
@ UNIT_STAND_STATE_STAND
Definition UnitDefines.h:34
@ MOVE_RUN
@ UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
@ UNIT_FLAG_NON_ATTACKABLE
@ ALIVE
Definition Unit.h:225
@ JUST_RESPAWNED
Definition Unit.h:229
@ UNIT_CREATED_BY_SPELL
T CalculatePct(T base, U pct)
Definition Util.h:71
void ChangeAmount(int32 newAmount, bool mark=true, bool onStackOrReapply=false)
uint32 GetTickNumber() const
SpellEffIndex GetEffIndex() const
SpellEffectInfo const & GetSpellEffectInfo() const
void SetPeriodic(bool isPeriodic)
uint32 GetTotalTicks() const
int32 GetAmount() const
void PreventDefaultAction()
void SetMaxDuration(int32 duration)
HookList< EffectCalcPeriodicHandler > DoEffectCalcPeriodic
AuraApplication const * GetTargetApplication() const
int32 GetDuration() const
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectPeriodicHandler > OnEffectPeriodic
SpellInfo const * GetSpellInfo() const
HookList< EffectApplyHandler > AfterEffectApply
int32 GetMaxDuration() const
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Unit * GetCaster() const
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
void SetDuration(int32 duration, bool withMods=false)
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
HookList< EffectAbsorbHandler > OnEffectAbsorb
Aura * GetAura() const
HookList< CheckAreaTargetHandler > DoCheckAreaTarget
Unit * GetTarget() const
ObjectGuid GetCasterGUID() const
HookList< CheckProcHandler > DoCheckProc
HookList< EffectApplyHandler > OnEffectRemove
void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
HookList< EffectProcHandler > OnEffectProc
Unit * GetUnitOwner() const
HookList< AuraProcHandler > OnProc
uint8 GetStackAmount() const
HookList< EffectApplyHandler > OnEffectApply
uint32 GetId() const
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
AuraEffect * GetEffect(uint8 effIndex) const
Definition SpellAuras.h:226
uint8 GetStackAmount() const
Definition SpellAuras.h:189
SpellInfo const * GetSpellInfo() const
Definition SpellAuras.h:140
bool operator()(Unit *u) const
CorruptingPlagueSearcher(Unit *obj, float distance)
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
SpellInfo const * GetSpellInfo() const
Definition Unit.h:474
uint32 GetDamage() const
Definition Unit.h:478
ObjectGuid GetOwnerGUID() const override
Definition GameObject.h:141
Definition Item.h:62
Definition Map.h:302
bool IsDungeon() const
Definition Map.cpp:4231
ZLiquidStatus GetLiquidStatus(uint32 phaseMask, float x, float y, float z, Optional< uint8 > ReqLiquidType, LiquidData *data=nullptr, float collisionHeight=2.03128f) const
Definition Map.cpp:2635
bool IsHeroic() const
Definition Map.cpp:4251
static ObjectGuid const Empty
Definition ObjectGuid.h:140
bool IsPlayer() const
Definition ObjectGuid.h:179
virtual void RemoveDynamicFlag(uint32 flag)
Definition Object.h:90
static Creature * ToCreature(Object *o)
Definition Object.h:189
static Unit * ToUnit(Object *o)
Definition Object.h:195
uint32 GetUInt32Value(uint16 index) const
Definition Object.cpp:241
TypeID GetTypeId() const
Definition Object.h:93
virtual void SetDynamicFlag(uint32 flag)
Definition Object.h:89
uint32 GetEntry() const
Definition Object.h:81
void SetEntry(uint32 entry)
Definition Object.h:82
static Player * ToPlayer(Object *o)
Definition Object.h:183
Definition Pet.h:40
void setDeathState(DeathState s) override
Definition Pet.cpp:582
bool LoadPetFromDB(Player *owner, uint32 petEntry, uint32 petnumber, bool current)
Definition Pet.cpp:185
void LearnSpell(uint32 spell_id, bool dependent, uint32 fromSkill=0)
Definition Player.cpp:3381
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:6163
bool HasAchieved(uint32 achievementId) const
Definition Player.cpp:24894
uint32 GetLastPetNumber() const
Definition Player.h:2150
float GetAverageItemLevel() const
Definition Player.cpp:26101
ReputationMgr & GetReputationMgr()
Definition Player.h:1834
SpellSchoolMask GetSchoolMask() const
Definition Unit.cpp:280
Unit * GetActionTarget() const
Definition Unit.h:523
uint32 GetTypeMask() const
Definition Unit.h:525
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:269
Unit * GetActor()
Definition Unit.h:522
DamageInfo * GetDamageInfo() const
Definition Unit.h:533
bool operator()(WorldObject *obj) const
int32 GetReputation(uint32 faction_id) const
bool SetReputation(FactionEntry const *factionEntry, int32 standing)
AuraType ApplyAuraName
Definition SpellInfo.h:211
uint32 TriggerSpell
Definition SpellInfo.h:228
SpellEffects Effect
Definition SpellInfo.h:210
bool IsAura() const
bool IsEffect() const
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr) const
void ResetCooldown(uint32 spellId, bool update=false)
bool HasCooldown(SpellInfo const *spellInfo, uint32 itemId=0, bool ignoreCategoryCooldown=false) const
void BuildCooldownPacket(WorldPacket &data, uint8 flags, uint32 spellId, uint32 cooldown) const
float GetMaxRange(bool positive=false, WorldObject *caster=nullptr, Spell *spell=nullptr) const
flag96 SpellFamilyFlags
Definition SpellInfo.h:357
bool IsPassive() const
uint32 StackAmount
Definition SpellInfo.h:340
uint32 Id
Definition SpellInfo.h:289
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:483
uint32 SpellIconID
Definition SpellInfo.h:349
bool HasEffect(SpellEffects effect) const
bool IsPositive() const
SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const *player=nullptr, bool strict=true) const
uint32 SpellFamilyName
Definition SpellInfo.h:356
HookList< CastHandler > AfterCast
HookList< CheckCastHandler > OnCheckCast
Creature * GetHitCreature() const
Player * GetHitPlayer() const
void SetEffectValue(int32 value)
int32 GetHitDamage() const
Unit * GetCaster() const
HookList< HitHandler > AfterHit
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
HookList< HitHandler > OnHit
HookList< EffectHandler > OnEffectHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
int32 GetEffectValue() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Item * GetCastItem() const
HookList< CastHandler > OnCast
Aura * GetHitAura(bool dynObjAura=false) const
void SetCustomCastResultMessage(SpellCustomErrors result)
HookList< EffectHandler > OnEffectLaunchTarget
void SetHitDamage(int32 damage)
void CreateItem(uint32 itemId)
GameObject * GetGObjCaster() const
Unit * GetExplTargetUnit() const
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Unit * GetOriginalCaster() const
GameObject * GetHitGObj() const
StasisFieldSearcher(Unit *obj, float distance)
bool operator()(Unit *u) const
void ModifyThreatByPercent(Unit *target, int32 percent)
Definition Unit.h:783
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:8379
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3584
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3788
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3661
void SetFullHealth()
Definition Unit.h:941
ThreatManager & GetThreatManager()
Definition Unit.h:1169
uint8 GetClass() const
Definition Unit.h:909
float GetCollisionHeight() const override
Definition Unit.cpp:13895
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:794
Unit * GetCharmer() const
Definition Unit.h:1266
MotionMaster * GetMotionMaster()
Definition Unit.h:1683
Powers GetPowerType() const
Definition Unit.h:945
void Dismount()
Definition Unit.cpp:8174
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:974
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
Definition Unit.cpp:6360
void SetHealth(uint32 val)
Definition Unit.cpp:9338
TempSummon * ToTempSummon()
Definition Unit.h:1810
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4558
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition Unit.cpp:13262
void SetVirtualItem(uint32 slot, uint32 itemId)
Definition Unit.cpp:13839
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition Unit.cpp:8124
bool IsCharmedOwnedByPlayerOrPlayer() const
Definition Unit.h:1274
uint32 GetVirtualItemId(uint32 slot) const
Definition Unit.cpp:13831
uint32 GetMaxPower(Powers power) const
Definition Unit.h:950
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool force=false)
Definition Unit.cpp:9398
void RemoveUnitFlag2(UnitFlags2 flags)
Definition Unit.h:975
void GetAllMinionsByEntry(std::list< TempSummon * > &Minions, uint32 entry)
Definition Unit.cpp:6004
void SetFullPower(Powers power)
Definition Unit.h:955
bool IsMounted() const
Definition Unit.h:1027
float GetSpeedRate(UnitMoveType mtype) const
Definition Unit.h:1670
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3807
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition Unit.cpp:8618
void EnergizeBySpell(Unit *victim, uint32 spellId, int32 damage, Powers powerType)
Definition Unit.cpp:6380
DeathState getDeathState() const
Definition Unit.h:1251
void HandleEmoteCommand(Emote emoteId)
Definition Unit.cpp:1579
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:936
void SetStandState(UnitStandStateType state)
Definition Unit.cpp:10340
SpellHistory * GetSpellHistory()
Definition Unit.h:1497
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:932
void SetUnitFlag(UnitFlags flags)
Definition Unit.h:968
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1351
void RemoveMovementImpairingAuras(bool withRoot)
Definition Unit.cpp:4092
uint8 GetLevel() const
Definition Unit.h:903
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:969
uint32 GetPhaseMask() const
Definition Object.h:370
Map * GetMap() const
Definition Object.h:451
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1088
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2833
Unit * GetOwner() const
Definition Object.cpp:2181
float GetDistance2d(WorldObject const *obj) const
Definition Object.cpp:1142
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition Object.cpp:2204
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1124
uint32 GetAreaId() const
Definition Object.h:376
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
uint32 m_scriptSpellId
bool Validate(SpellInfo const *) override
void OnPeriodic(AuraEffect const *)
PrepareAuraScript(spell_corrupting_plague_aura)
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex)
PrepareSpellScript(spell_ethereal_pet_aura_remove)
PrepareAuraScript(spell_ethereal_pet_aura)
bool CheckProc(ProcEventInfo &eventInfo)
void HandleProc(AuraEffect const *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_ethereal_pet_onsummon)
void HandleScriptEffect(SpellEffIndex)
void HandleDamage(SpellEffIndex)
PrepareSpellScript(spell_freezing_circle)
bool Validate(SpellInfo const *) override
void Register() override
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_gen_5000_gold)
PrepareAuraScript(spell_gen_absorb0_hitlimit1)
void Absorb(AuraEffect *, DamageInfo &, uint32 &absorbAmount)
PrepareAuraScript(spell_gen_adaptive_warding)
bool CheckProc(ProcEventInfo &eventInfo)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_gen_allow_cast_from_item_only)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_gen_animal_blood)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void CalcAmount(AuraEffect const *, int32 &amount, bool &)
void Register() override
bool Validate(SpellInfo const *spellInfo) override
void CalcPeriodic(AuraEffect const *, bool &isPeriodic, int32 &)
PrepareAuraScript(spell_gen_arena_drink)
void UpdatePeriodic(AuraEffect *aurEff)
bool Validate(SpellInfo const *spellInfo) override
PrepareAuraScript(spell_gen_aura_of_fear)
void PeriodicTick(AuraEffect const *aurEff)
PrepareAuraScript(spell_gen_av_drekthar_presence)
bool Validate(SpellInfo const *) override
SpellCastResult CheckCast()
PrepareSpellScript(spell_gen_bandage)
void Register() override
bool CheckProc(ProcEventInfo &eventInfo)
void Register() override
PrepareAuraScript(spell_gen_black_magic)
PrepareAuraScript(spell_gen_blade_warding)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_gen_blood_reserve)
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_gen_bonked)
void Register() override
void HandleScriptEffect(SpellEffIndex effIndex)
PrepareSpellScript(spell_gen_break_shield)
void HandleApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *spellInfo) override
PrepareAuraScript(spell_gen_burning_depths_necrolyte_image)
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void Register() override
PrepareSpellScript(spell_gen_cancel_aura)
bool Validate(SpellInfo const *spellInfo) override
void HandleScript(SpellEffIndex)
void Register() override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
PrepareSpellScript(spell_gen_cannibalize)
SpellCastResult CheckIfCorpseNear()
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_gen_cannon_blast)
PrepareSpellScript(spell_gen_cast_caster_to_target)
bool Validate(SpellInfo const *spellInfo) override
PrepareSpellScript(spell_gen_cast_target_to_target)
bool Validate(SpellInfo const *spellInfo) override
PrepareAuraScript(spell_gen_chains_of_ice)
void UpdatePeriodic(AuraEffect *aurEff)
PrepareSpellScript(spell_gen_charmed_unit_spell_cooldown)
void HandleChoke(AuraEffect const *)
PrepareAuraScript(spell_gen_choking_vines)
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_gen_clear_debuffs)
PrepareSpellScript(spell_gen_clear_fear_poly)
PrepareAuraScript(spell_gen_clone_weapon_aura)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_gen_clone_weapon)
void HandleScriptEffect(SpellEffIndex effIndex)
void HandleScriptEffect(SpellEffIndex effIndex)
PrepareSpellScript(spell_gen_clone)
void Register() override
void HandleDamageCalc(SpellEffIndex)
PrepareSpellScript(spell_gen_consumption)
spell_gen_count_pct_from_max_hp(int32 damagePct=0)
PrepareSpellScript(spell_gen_count_pct_from_max_hp)
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex effIndex)
PrepareSpellScript(spell_gen_create_lance)
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_gen_dalaran_disguise)
bool Validate(SpellInfo const *spellInfo) override
bool Validate(SpellInfo const *) override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_gen_damage_reduction_aura)
bool CheckProc(ProcEventInfo &eventInfo)
PrepareAuraScript(spell_gen_decay_over_time_aura)
void ModDuration(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_gen_decay_over_time_fungal_decay)
PrepareSpellScript(spell_gen_decay_over_time_spell)
PrepareAuraScript(spell_gen_decay_over_time_tail_sting)
void RemoveDummyFromDriver(AuraEffect const *, AuraEffectHandleModes)
void Register() override
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_gen_defend)
void RemoveVisualShields(AuraEffect const *, AuraEffectHandleModes)
void RefreshVisualShields(AuraEffect const *aurEff, AuraEffectHandleModes)
PrepareAuraScript(spell_gen_despawn_aura)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleDummy(SpellEffIndex)
PrepareSpellScript(spell_gen_despawn_self)
PrepareSpellScript(spell_gen_despawn_target)
void HandleDespawn(SpellEffIndex)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_gen_divine_storm_cd_reset)
PrepareSpellScript(spell_gen_dreaming_glory)
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_gen_ds_flush_knockback)
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_gen_dungeon_credit)
PrepareSpellScript(spell_gen_eject_all_passengers)
PrepareSpellScript(spell_gen_eject_passenger_with_seatId)
void EjectPassenger(SpellEffIndex)
bool Validate(SpellInfo const *spellInfo) override
PrepareSpellScript(spell_gen_eject_passenger)
void Register() override
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_gen_feast)
PrepareAuraScript(spell_gen_feign_death_all_flags)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_gen_feign_death_no_dyn_flag)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_gen_feign_death_no_prevent_emotes)
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_gen_furious_rage)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareSpellScript(spell_gen_gadgetzan_transporter_backfire)
bool Validate(SpellInfo const *) override
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &)
PrepareAuraScript(spell_gen_gift_of_naaru)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_gen_gm_freeze)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void Register() override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_gen_gnomish_transporter)
void HandleEffectPeriodic(AuraEffect const *)
PrepareAuraScript(spell_gen_gryphon_wyvern_mount_check)
void HandleDummy(SpellEffIndex)
PrepareSpellScript(spell_gen_hate_to_50)
void Register() override
void Register() override
PrepareSpellScript(spell_gen_hate_to_75)
void HandleDummy(SpellEffIndex)
PrepareSpellScript(spell_gen_hate_to_zero_caster_target)
PrepareSpellScript(spell_gen_hate_to_zero)
void HandleDummy(SpellEffIndex)
void HandleDummy(SpellEffIndex)
void Register() override
PrepareSpellScript(spell_gen_injured)
spell_gen_knock_away_threat_reduction(int32 threatPercent)
PrepareSpellScript(spell_gen_knock_away_threat_reduction)
PrepareSpellScript(spell_gen_landmine_knockback_achievement)
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &)
PrepareAuraScript(spell_gen_lifeblood_aura)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_gen_lifeblood)
void Register() override
bool Validate(SpellInfo const *) override
spell_gen_lifebloom(uint32 spellId)
void Register() override
PrepareAuraScript(spell_gen_lifebloom)
void AfterRemove(AuraEffect const *aurEff, AuraEffectHandleModes)
PrepareAuraScript(spell_gen_mixology_bonus)
void SetBonusValueForEffect(SpellEffIndex effIndex, int32 value, AuraEffect const *aurEff)
bool Validate(SpellInfo const *) override
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_gen_moss_covered_feet)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareSpellScript(spell_gen_mount)
void HandleMount(SpellEffIndex effIndex)
void Register() override
spell_gen_mount(uint32 mount0=0, uint32 mount60=0, uint32 mount100=0, uint32 mount150=0, uint32 mount280=0, uint32 mount310=0)
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex effIndex)
void HandleChargeEffect(SpellEffIndex)
PrepareSpellScript(spell_gen_mounted_charge)
void HandleScript(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_gen_netherbloom)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_gen_nightmare_vine)
void HandleScript(SpellEffIndex effIndex)
PrepareAuraScript(spell_gen_nitrous_boost)
void PeriodicTick(AuraEffect const *)
bool CheckProc(ProcEventInfo &eventInfo)
void OnProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_gen_obsidian_armor)
void DisablePeriodic(AuraEffect *aurEff)
PrepareAuraScript(spell_gen_one_tick_dummy)
PrepareSpellScript(spell_gen_oracle_wolvar_reputation)
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_gen_orc_disguise)
void Register() override
void HandleEffectPeriodic(AuraEffect const *)
PrepareAuraScript(spell_gen_parachute)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_gen_paralytic_poison)
bool Validate(SpellInfo const *) override
void HandleStun(AuraEffect const *aurEff, AuraEffectHandleModes)
PrepareSpellScript(spell_gen_pet_summoned)
void HandleScript(SpellEffIndex)
void Register() override
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_gen_pet_wait)
bool Validate(SpellInfo const *spellInfo) override
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_gen_player_say)
void Register() override
PrepareAuraScript(spell_gen_pony_mount_check)
void HandleEffectPeriodic(AuraEffect const *)
PrepareAuraScript(spell_gen_prevent_emotes)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_gen_proc_below_pct_damaged)
bool CheckProc(ProcEventInfo &eventInfo)
void HandleChargeDrop(ProcEventInfo &)
PrepareAuraScript(spell_gen_proc_charge_drop_only)
PrepareSpellScript(spell_gen_profession_research)
PrepareSpellScript(spell_gen_remove_flight_auras)
PrepareSpellScript(spell_gen_remove_impairing_auras)
PrepareAuraScript(spell_gen_remove_on_full_health_pct)
void PeriodicTick(AuraEffect const *)
void PeriodicTick(AuraEffect const *aurEff)
PrepareAuraScript(spell_gen_remove_on_full_health)
PrepareAuraScript(spell_gen_remove_on_health_pct)
void PeriodicTick(AuraEffect const *)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
PrepareAuraScript(spell_gen_replenishment_aura)
void RemoveInvalidTargets(std::list< WorldObject * > &targets)
PrepareSpellScript(spell_gen_replenishment)
PrepareAuraScript(spell_gen_restoration)
void PeriodicTick(AuraEffect const *)
PrepareSpellScript(spell_gen_revive_self)
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
void AchievementCredit(SpellEffIndex)
PrepareSpellScript(spell_gen_seaforium_blast)
PrepareSpellScript(spell_gen_spectator_cheer_trigger)
void HandleDummy(SpellEffIndex)
PrepareSpellScript(spell_gen_spirit_healer_res)
void Register() override
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_gen_stand)
void Register() override
PrepareSpellScript(spell_gen_submerged)
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_gen_summon_tournament_mount)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_gen_teleporting)
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_gen_throw_shield)
void HandleScriptEffect(SpellEffIndex effIndex)
void HandleScriptEffect(SpellEffIndex)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_gen_tournament_duel)
PrepareAuraScript(spell_gen_tournament_pennant)
void HandleApplyEffect(AuraEffect const *, AuraEffectHandleModes)
std::list< uint32 > _applyTimes
void OnApply(AuraEffect const *aurEff, AuraEffectHandleModes)
PrepareAuraScript(spell_gen_turkey_marker)
void OnPeriodic(AuraEffect const *)
PrepareSpellScript(spell_gen_upper_deck_create_foam_sword)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_gen_vampiric_touch)
PrepareAuraScript(spell_gen_vehicle_scaling)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
PrepareSpellScript(spell_gen_vendor_bark_trigger)
void Register() override
SpellCastResult CheckCast()
PrepareSpellScript(spell_gen_wg_water)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_gen_whisper_gulch_yogg_saron_whisper)
PrepareSpellScript(spell_gen_whisper_to_controller_random)
PrepareSpellScript(spell_gen_whisper_to_controller)
bool Validate(SpellInfo const *spellInfo) override
PrepareSpellScript(spell_gen_zero_mana_full_health)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_pvp_trinket_wotf_shared_cd)
PrepareSpellScript(spell_spawn_blood_pool)
void SetDest(SpellDestination &dest)
PrepareAuraScript(spell_stasis_field_aura)
void OnPeriodic(AuraEffect const *)
bool Validate(SpellInfo const *) override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_steal_essence_visual)
@ SMSG_SPIRIT_HEALER_CONFIRM
Definition Opcodes.h:575
uint32 GetGameTimeMS()
Definition GameTime.cpp:47
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition Containers.h:108
StasisFieldEntrys
@ NPC_DAGGERTAIL_LIZARD
@ SPELL_STASIS_FIELD
BladeWarding
@ SPELL_GEN_BLADE_WARDING_TRIGGERED
@ SPELL_MAGIC_BROOM_100
@ SPELL_BIG_BLIZZARD_BEAR_100
@ SPELL_MAGIC_BROOM_60
@ SPELL_CELESTIAL_STEED_280
@ SPELL_BIG_LOVE_ROCKET_0
@ SPELL_HEADLESS_HORSEMAN_MOUNT_60
@ SPELL_MAGIC_BROOM_150
@ SPELL_INVINCIBLE_100
@ SPELL_WINGED_STEED_280
@ SPELL_INVINCIBLE_310
@ SPELL_BIG_LOVE_ROCKET_60
@ SPELL_HEADLESS_HORSEMAN_MOUNT_280
@ SPELL_BIG_BLIZZARD_BEAR_60
@ SPELL_CELESTIAL_STEED_150
@ SPELL_CELESTIAL_STEED_60
@ SPELL_BIG_LOVE_ROCKET_100
@ SPELL_BLAZING_HIPPOGRYPH_150
@ SPELL_BIG_LOVE_ROCKET_150
@ SPELL_INVINCIBLE_150
@ SPELL_BLAZING_HIPPOGRYPH_280
@ SPELL_CELESTIAL_STEED_100
@ SPELL_CELESTIAL_STEED_310
@ SPELL_WINGED_STEED_150
@ SPELL_MAGIC_BROOM_280
@ SPELL_X53_TOURING_ROCKET_150
@ SPELL_HEADLESS_HORSEMAN_MOUNT_150
@ SPELL_X53_TOURING_ROCKET_280
@ SPELL_COLD_WEATHER_FLYING
@ SPELL_HEADLESS_HORSEMAN_MOUNT_100
@ SPELL_X53_TOURING_ROCKET_310
@ SPELL_INVINCIBLE_60
@ SPELL_BIG_LOVE_ROCKET_310
VampiricTouch
@ SPELL_VAMPIRIC_TOUCH_HEAL
SeaforiumSpells
@ SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT
FungalDecay
@ AURA_DURATION
PvPTrinketTriggeredSpells
@ SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER
@ SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF
@ ITEM_FOAM_SWORD_RED
@ ITEM_FOAM_SWORD_PINK
@ ITEM_FOAM_SWORD_YELLOW
@ ITEM_FOAM_SWORD_GREEN
@ ITEM_FOAM_SWORD_BLUE
SiegeTankControl
@ SPELL_SIEGE_TANK_CONTROL
Replenishment
@ SPELL_INFINITE_REPLENISHMENT
@ SPELL_REPLENISHMENT
TransporterBackfires
@ SPELL_TRANSPORTER_EVIL_TWIN
@ SPELL_TRANSPORTER_MALFUNCTION_MISS
@ SPELL_TRANSPORTER_MALFUNCTION_POLYMORPH
DreamingGlory
@ SPELL_DREAMING_GLORY
FreezingCircleSpells
@ SPELL_FREEZING_CIRCLE_PIT_OF_SARON_HEROIC
@ SPELL_FREEZING_CIRCLE
@ SPELL_FREEZING_CIRCLE_PIT_OF_SARON_NORMAL
RequiredMixologySpells
@ SPELL_ELIXIR_OF_MIGHTY_FORTITUDE
@ SPELL_FLASK_OF_THE_FROST_WYRM
@ SPELL_ELIXIR_OF_GREATER_FIREPOWER
@ SPELL_ELIXIR_OF_SAGES
@ SPELL_MIGHTY_TROLLS_BLOOD_ELIXIR
@ SPELL_WEAK_TROLLS_BLOOD_ELIXIR
@ SPELL_ONSLAUGHT_ELIXIR
@ SPELL_ELIXIR_OF_DEADLY_STRIKES
@ SPELL_ELIXIR_OF_MAJOR_MAGEBLOOD
@ SPELL_ELIXIR_OF_OGRES_STRENGTH
@ SPELL_SHADOWPOWER_ELIXIR
@ SPELL_LESSER_FLASK_OF_RESISTANCE
@ SPELL_ELIXIR_OF_GREATER_DEFENSE
@ SPELL_FLASK_OF_BLINDING_LIGHT
@ SPELL_ELIXIR_OF_SPIRIT
@ SPELL_FLASK_OF_STONEBLOOD
@ SPELL_ELIXIR_OF_MAJOR_DEFENSE
@ SPELL_ARCANE_ELIXIR
@ SPELL_ELIXIR_OF_DEFENSE
@ SPELL_LESSER_FLASK_OF_TOUGHNESS
@ SPELL_ELIXIR_OF_WISDOM
@ SPELL_ELIXIR_OF_MAJOR_STRENGTH
@ SPELL_ELIXIR_OF_MINOR_FORTITUDE
@ SPELL_ELIXIR_OF_FORTITUDE
@ SPELL_ELIXIR_OF_AGILITY
@ SPELL_ELIXIR_OF_SUPERIOR_DEFENSE
@ SPELL_FLASK_OF_SUPREME_POWER
@ SPELL_FLASK_OF_FORTIFICATION
@ SPELL_ELIXIR_OF_DRAENIC_WISDOM
@ SPELL_ELIXIR_OF_HEALING_POWER
@ SPELL_ELIXIR_OF_MIGHTY_STRENGTH
@ SPELL_ELIXIR_OF_MIGHTY_MAGEBLOOD
@ SPELL_ELIXIR_OF_MAJOR_FROST_POWER
@ SPELL_ELIXIR_OF_FIREPOWER
@ SPELL_WRATH_ELIXIR
@ SPELL_MIXOLOGY
@ SPELL_ELIXIR_OF_PROTECTION
@ SPELL_FLASK_OF_CHROMATIC_RESISTANCE
@ SPELL_MAGEBLOOD_ELIXIR
@ SPELL_ELIXIR_OF_MAJOR_AGILITY
@ SPELL_FLASK_OF_RELENTLESS_ASSAULT
@ SPELL_ELIXIR_OF_MIGHTY_DEFENSE
@ SPELL_GURUS_ELIXIR
@ SPELL_ELIXIR_OF_GREATER_AGILITY
@ SPELL_FLASK_OF_THE_TITANS
@ SPELL_STRONG_TROLLS_BLOOD_ELIXIR
@ SPELL_FLASK_OF_PURE_MOJO
@ SPELL_ELIXIR_OF_LIGHTNING_SPEED
@ SPELL_FLASK_OF_PURE_DEATH
@ SPELL_ELIXIR_OF_LESSER_AGILITY
@ SPELL_ADEPTS_ELIXIR
@ SPELL_FLASK_OF_ENDLESS_RAGE
@ SPELL_ELIXIR_OF_MIGHTY_TOUGHTS
@ SPELL_ELIXIR_OF_SHADOW_POWER
@ SPELL_ELIXIR_OF_GREATER_INTELLECT
@ SPELL_FLASK_OF_MIGHTY_RESTORATION
@ SPELL_ELIXIR_OF_GIANTS
@ SPELL_ELIXIR_OF_IRONSKIN
@ SPELL_ELIXIR_OF_GIANTH_GROWTH
@ SPELL_ELIXIR_OF_MINOR_AGILITY
@ SPELL_ELIXIR_OF_MINOR_DEFENSE
@ SPELL_ELIXIR_OF_ARMOR_PIERCING
@ SPELL_FEL_STRENGTH_ELIXIR
@ SPELL_ELIXIR_OF_DEMONSLAYING
@ SPELL_ELIXIR_OF_MINOR_ACCURACY
@ SPELL_ELIXIR_OF_EXPERTISE
@ SPELL_ELIXIR_OF_MAJOR_SHADOW_POWER
@ SPELL_ELIXIR_OF_MIGHTY_AGILITY
@ SPELL_ELIXIR_OF_MAJOR_FIREPOWER
@ SPELL_MAJOR_TROLLS_BLLOOD_ELIXIR
@ SPELL_ELIXIR_OF_LIONS_STRENGTH
@ SPELL_ELIXIR_OF_MAJOR_FORTITUDE
@ SPELL_EARTHEN_ELIXIR
@ SPELL_ELIXIR_OF_FROST_POWER
@ SPELL_FLASK_OF_DISTILLED_WISDOM
@ SPELL_ELIXIR_OF_MASTERY
@ SPELL_ELIXIR_OF_THE_MONGOOSE
@ SPELL_ELIXIR_OF_ACCURACY
@ SPELL_FLASK_OF_CHROMATIC_WONDER
@ SPELL_ELIXIR_OF_BRUTE_FORCE
@ SPELL_ELIXIR_OF_EMPOWERMENT
@ SPELL_GREATER_ARCANE_ELIXIR
WhisperToControllerTexts
@ WHISPER_FUTURE_YOU
@ WHISPER_PAST_YOU
@ WHISPER_DEFENDER
VehicleScaling
@ SPELL_GEAR_SCALING
@ SPELL_GREAT_FEAST
@ SPELL_SMALL_FEAST
@ SPELL_FEAST_FOOD
@ SPELL_BOUNTIFUL_FEAST_FOOD
@ SPELL_FISH_FEAST_REFRESHMENT
@ SPELL_BOUNTIFUL_FEAST_REFRESHMENT
@ SPELL_GREAT_FEAST_REFRESHMENT
@ SPELL_SMALL_FEAST_REFRESHMENT
@ SPELL_GIGANTIC_FEAST
@ SPELL_GIGANTIC_FEAST_REFRESHMENT
@ SPELL_FEAST_DRINK
@ SPELL_BOUNTIFUL_FEAST_DRINK
@ SPELL_BOUNTIFUL_FEAST
@ SPELL_FISH_FEAST
EtherealPet
@ SPELL_PROC_TRIGGER_ON_KILL_AURA
@ SPELL_ETHEREAL_PET_AURA
@ SAY_CREATE_TOKEN
@ SPELL_CREATE_TOKEN
@ NPC_ETHEREAL_SOUL_TRADER
@ SAY_STEAL_ESSENCE
@ SPELL_STEAL_ESSENCE_VISUAL
DalaranDisguiseSpells
@ SPELL_SUNREAVER_DISGUISE_MALE
@ SPELL_SUNREAVER_DISGUISE_TRIGGER
@ SPELL_SILVER_COVENANT_DISGUISE_FEMALE
@ SPELL_SILVER_COVENANT_DISGUISE_MALE
@ SPELL_SUNREAVER_DISGUISE_FEMALE
@ SPELL_SILVER_COVENANT_DISGUISE_TRIGGER
@ MOUNT_PONY
@ ACHIEV_PONY_UP
Teleporting
@ SPELL_TELEPORT_SPIRE_UP
@ SPELL_TELEPORT_SPIRE_DOWN
@ AREA_VIOLET_CITADEL_SPIRE
BloodReserve
@ SPELL_GEN_BLOOD_RESERVE_AURA
@ SPELL_GEN_BLOOD_RESERVE_HEAL
CannonBlast
@ SPELL_CANNON_BLAST
@ SPELL_CANNON_BLAST_DAMAGE
ChargeSpells
@ SPELL_CHARGE_CHARGING_EFFECT_8K5
@ SPELL_CHARGE_CHARGING_EFFECT_20K_2
@ SPELL_CHARGE_TRIGGER_FACTION_MOUNTS
@ SPELL_CHARGE_TRIGGER_TRIAL_CHAMPION
@ SPELL_CHARGE_DAMAGE_45K
@ SPELL_CHARGE_MISS_EFFECT
@ SPELL_CHARGE_CHARGING_EFFECT_20K_1
@ SPELL_CHARGE_DAMAGE_8K5
@ SPELL_CHARGE_CHARGING_EFFECT_45K_1
@ SPELL_CHARGE_DAMAGE_20K
@ SPELL_CHARGE_CHARGING_EFFECT_45K_2
GenericBandage
@ SPELL_RECENTLY_BANDAGED
WhisperGulchYoggSaronWhisper
@ SPELL_YOGG_SARON_WHISPER_DUMMY
AdaptiveWarding
@ SPELL_GEN_ADAPTIVE_WARDING_ARCANE
@ SPELL_GEN_ADAPTIVE_WARDING_FIRE
@ SPELL_GEN_ADAPTIVE_WARDING_NATURE
@ SPELL_GEN_ADAPTIVE_WARDING_FROST
@ SPELL_GEN_ADAPTIVE_WARDING_SHADOW
OrcDisguiseSpells
@ SPELL_ORC_DISGUISE_FEMALE
@ SPELL_ORC_DISGUISE_MALE
@ SPELL_ORC_DISGUISE_TRIGGER
ProfessionResearch
@ SPELL_NORTHREND_INSCRIPTION_RESEARCH
@ SPELL_GM_FREEZE
GnomishTransporter
@ SPELL_TRANSPORTER_FAILURE
@ SPELL_TRANSPORTER_SUCCESS
FuriousRage
@ EMOTE_EXHAUSTED
@ EMOTE_FURIOUS_RAGE
@ SPELL_EXHAUSTION
Netherbloom
@ SPELL_NETHERBLOOM_POLLEN_1
ObsidianArmor
@ SPELL_GEN_OBSIDIAN_ARMOR_HOLY
@ SPELL_GEN_OBSIDIAN_ARMOR_FIRE
@ SPELL_GEN_OBSIDIAN_ARMOR_ARCANE
@ SPELL_GEN_OBSIDIAN_ARMOR_FROST
@ SPELL_GEN_OBSIDIAN_ARMOR_SHADOW
@ SPELL_GEN_OBSIDIAN_ARMOR_NATURE
VendorBarkTrigger
@ NPC_AMPHITHEATER_VENDOR
@ SAY_AMPHITHEATER_VENDOR
LandmineKnockbackAchievement
@ SPELL_LANDMINE_KNOCKBACK_ACHIEVEMENT
CloneWeaponSpells
@ SPELL_COPY_OFFHAND_2_AURA
@ SPELL_COPY_WEAPON_3_AURA
@ SPELL_COPY_OFFHAND_AURA
@ SPELL_COPY_WEAPON_AURA
@ SPELL_COPY_WEAPON_2_AURA
@ SPELL_COPY_RANGED_AURA
BlackMagicSpellIconId
@ SPELLICON_DRUID_INFECTED_WOUNDS
DamageReductionAura
@ SPELL_BLESSING_OF_SANCTUARY
@ SPELL_RENEWED_HOPE
@ SPELL_DAMAGE_REDUCTION_AURA
@ SPELL_VIGILANCE
@ SPELL_GREATER_BLESSING_OF_SANCTUARY
CorruptinPlagueEntrys
@ NPC_AETHER_RAY
@ NPC_SHARD_HIDE_BOAR
@ SPELL_CORRUPTING_PLAGUE
@ NPC_APEXIS_FLAYER
static Emote const EmoteArray[]
MossCoveredFeet
@ SPELL_FALL_DOWN
CreateLanceSpells
@ SPELL_CREATE_LANCE_ALLIANCE
@ SPELL_CREATE_LANCE_HORDE
DivineStormSpell
@ SPELL_DIVINE_STORM
void AddSC_generic_spell_scripts()
FriendOrFowl
@ SPELL_TURKEY_VENGEANCE
PetSummoned
@ NPC_DOOMGUARD
@ NPC_INFERNAL
@ NPC_IMP
GenericLifebloom
@ SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL
@ SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL
@ SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL
@ SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL
DefendVisuals
@ SPELL_VISUAL_SHIELD_2
@ SPELL_VISUAL_SHIELD_3
@ SPELL_VISUAL_SHIELD_1
TournamentMountsSpells
@ SPELL_LANCE_EQUIPPED
AnimalBloodPoolSpell
@ SPELL_ANIMAL_BLOOD
@ SPELL_SPAWN_BLOOD_POOL
@ SPELL_BONKED
@ SPELL_FOAM_SWORD_DEFEAT
@ SPELL_ON_GUARD
ParachuteSpells
@ SPELL_PARACHUTE
@ SPELL_PARACHUTE_BUFF
CannibalizeSpells
@ SPELL_CANNIBALIZE_TRIGGERED
NightmareVine
@ SPELL_NIGHTMARE_POLLEN
GenericLifeblood
@ SPELL_GROW_FLOWER_PATCH
BreakShieldSpells
@ SPELL_BREAK_SHIELD_DAMAGE_10K
@ SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS
@ SPELL_BREAK_SHIELD_TRIGGER_UNK
@ SPELL_BREAK_SHIELD_DAMAGE_2K
@ SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE
ParalyticPoison
@ SPELL_PARALYSIS
MountedDuelSpells
@ SPELL_MOUNTED_DUEL
@ SPELL_ON_TOURNAMENT_MOUNT
ChokingVines
@ SPELL_CHOKING_WOUND
CastSpellExtraArgs & AddSpellBP0(int32 val)
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition CellImpl.h:168
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition CellImpl.h:180
float level
Definition MapDefines.h:89
float m_positionZ
Definition Position.h:58
float GetPositionZ() const
Definition Position.h:81
float GetPositionX() const
Definition Position.h:79
void GetPosition(float &x, float &y) const
Definition Position.h:84
float GetPositionY() const
Definition Position.h:80
void Relocate(Position const &pos)
Definition Spell.cpp:99