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_CHAOS_BLAST = 37675
835
837{
839
840 bool Validate(SpellInfo const* /*spellInfo*/) override
841 {
843 }
844 void HandleDummy(SpellEffIndex /* effIndex */)
845 {
846 int32 basepoints0 = 100;
847 Unit* caster = GetCaster();
848 if (Unit* target = GetHitUnit())
849 {
851 args.AddSpellBP0(basepoints0);
852 caster->CastSpell(target, SPELL_CHAOS_BLAST, args);
853 }
854 }
855
860};
861
863{
864 SPELL_CHOKING_WOUND = 35247
866
867// 35244 - Choking Vines
869{
871
872 bool Validate(SpellInfo const* /*spellInfo*/) override
873 {
875 }
876
877 void HandleChoke(AuraEffect const* /*aurEff*/)
878 {
879 if (GetStackAmount() != GetSpellInfo()->StackAmount)
880 return;
881
882 GetTarget()->CastSpell(nullptr, SPELL_CHOKING_WOUND, true);
883 Remove();
884 }
885
890};
891
892// 8129 - Mana Burn
894{
896
898 {
899 if (Unit* unitTarget = GetHitUnit())
900 unitTarget->RemoveAurasWithMechanic((1 << MECHANIC_FEAR) | (1 << MECHANIC_POLYMORPH));
901 }
902
907};
908
925
937
953
955{
957
970
971 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
972 {
973 Unit* caster = GetCaster();
974 Unit* target = GetTarget();
975 if (!caster)
976 return;
977
978 switch (GetSpellInfo()->Id)
979 {
983 {
984 prevItem = target->GetVirtualItemId(0);
985
986 if (Player* player = caster->ToPlayer())
987 {
988 if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
989 target->SetVirtualItem(0, mainItem->GetEntry());
990 }
991 else
992 target->SetVirtualItem(0, caster->GetVirtualItemId(0));
993 break;
994 }
997 {
998 prevItem = target->GetVirtualItemId(1);
999
1000 if (Player* player = caster->ToPlayer())
1001 {
1002 if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
1003 target->SetVirtualItem(1, offItem->GetEntry());
1004 }
1005 else
1006 target->SetVirtualItem(1, caster->GetVirtualItemId(1));
1007 break;
1008 }
1010 {
1011 prevItem = target->GetVirtualItemId(2);
1012
1013 if (Player* player = caster->ToPlayer())
1014 {
1015 if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
1016 target->SetVirtualItem(2, rangedItem->GetEntry());
1017 }
1018 else
1019 target->SetVirtualItem(2, caster->GetVirtualItemId(2));
1020 break;
1021 }
1022 default:
1023 break;
1024 }
1025 }
1026
1027 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1028 {
1029 Unit* target = GetTarget();
1030
1031 switch (GetSpellInfo()->Id)
1032 {
1036 target->SetVirtualItem(0, prevItem);
1037 break;
1040 target->SetVirtualItem(1, prevItem);
1041 break;
1043 target->SetVirtualItem(2, prevItem);
1044 break;
1045 default:
1046 break;
1047 }
1048 }
1049
1055
1057};
1058
1060{
1062
1063public:
1065
1067 {
1068 if (!_damagePct)
1070
1071 SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(_damagePct));
1072 }
1073
1078
1079private:
1081};
1082
1083// 28865 - Consumption
1084// 64208 - Consumption
1086{
1088
1090 {
1091 Creature* caster = GetCaster()->ToCreature();
1092 if (!caster)
1093 return;
1094
1095 uint32 damage = 0;
1096 if (SpellInfo const* createdBySpell = sSpellMgr->GetSpellInfo(caster->GetUInt32Value(UNIT_CREATED_BY_SPELL)))
1097 damage = createdBySpell->GetEffect(EFFECT_1).CalcValue();
1098
1099 if (damage)
1100 SetEffectValue(damage);
1101 }
1102
1107};
1108
1109// 63845 - Create Lance
1115
1117{
1119
1120 bool Validate(SpellInfo const* /*spellInfo*/) override
1121 {
1122 return ValidateSpellInfo(
1123 {
1126 });
1127 }
1128
1130 {
1131 PreventHitDefaultEffect(effIndex);
1132
1133 if (Player* target = GetHitPlayer())
1134 {
1135 if (target->GetTeam() == ALLIANCE)
1137 else
1139 }
1140 }
1141
1146};
1147
1158
1160{
1162
1163 bool Validate(SpellInfo const* spellInfo) override
1164 {
1165 switch (spellInfo->Id)
1166 {
1168 return ValidateSpellInfo(
1169 {
1172 });
1174 return ValidateSpellInfo(
1175 {
1178 });
1179 default:
1180 break;
1181 }
1182
1183 return false;
1184 }
1185
1186 void HandleScript(SpellEffIndex /*effIndex*/)
1187 {
1188 if (Player* player = GetHitPlayer())
1189 {
1190 uint8 gender = player->GetNativeGender();
1191
1192 uint32 spellId = GetSpellInfo()->Id;
1193
1194 switch (spellId)
1195 {
1198 break;
1201 break;
1202 default:
1203 break;
1204 }
1205
1206 GetCaster()->CastSpell(player, spellId, true);
1207 }
1208 }
1209
1214};
1215
1224
1258
1260{
1262
1264 {
1265 if (Aura* aur = GetHitAura())
1266 aur->SetStackAmount(static_cast<uint8>(GetSpellInfo()->StackAmount));
1267 }
1268
1273};
1274
1276{
1278
1279protected:
1281
1282 bool CheckProc(ProcEventInfo& eventInfo)
1283 {
1284 return (eventInfo.GetSpellInfo() == GetSpellInfo());
1285 }
1286
1287 void Decay(ProcEventInfo& /*eventInfo*/)
1288 {
1290 ModStackAmount(-1);
1291 }
1292
1298};
1299
1301{
1302 // found in sniffs, there is no duration entry we can possibly use
1303 AURA_DURATION = 12600
1305
1306// 32065 - Fungal Decay
1327
1328// 36659 - Tail Sting
1333
1340
1342{
1344
1345 bool Validate(SpellInfo const* /*spellInfo*/) override
1346 {
1347 return ValidateSpellInfo(
1348 {
1352 });
1353 }
1354
1356 {
1357 if (GetCaster())
1358 {
1359 Unit* target = GetTarget();
1360
1361 for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
1363
1364 target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1, aurEff);
1365 }
1366 else
1368 }
1369
1370 void RemoveVisualShields(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1371 {
1372 for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
1374 }
1375
1377 {
1378 if (Unit* caster = GetCaster())
1379 if (TempSummon* vehicle = caster->ToTempSummon())
1380 if (Unit* rider = vehicle->GetSummonerUnit())
1381 rider->RemoveAurasDueToSpell(GetId());
1382 }
1383
1406};
1407
1409{
1411
1412 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1413 {
1414 if (Creature* target = GetTarget()->ToCreature())
1415 target->DespawnOrUnsummon();
1416 }
1417
1422};
1423
1426{
1428
1429 bool Load() override
1430 {
1431 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1432 }
1433
1434 void HandleDummy(SpellEffIndex /*effIndex*/)
1435 {
1438 }
1439
1444};
1445
1447{
1449
1450 void HandleDespawn(SpellEffIndex /*effIndex*/)
1451 {
1453 if (Creature* target = GetHitCreature())
1454 target->DespawnOrUnsummon();
1455 }
1456
1461};
1462
1467
1468// 70769 Divine Storm!
1470{
1472
1473 bool Load() override
1474 {
1475 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
1476 }
1477
1478 bool Validate(SpellInfo const* /*spellInfo*/) override
1479 {
1481 }
1482
1483 void HandleScript(SpellEffIndex /*effIndex*/)
1484 {
1485 Player* caster = GetCaster()->ToPlayer();
1488 }
1489
1494};
1495
1500
1501// 28698 - Dreaming Glory
1503{
1505
1506 bool Validate(SpellInfo const* /*spellInfo*/) override
1507 {
1509 }
1510
1511 void HandleScript(SpellEffIndex /*effIndex*/)
1512 {
1514 }
1515
1520};
1521
1523{
1525
1526 void HandleScript(SpellEffIndex /*effIndex*/)
1527 {
1528 // Here the target is the water spout and determines the position where the player is knocked from
1529 if (Unit* target = GetHitUnit())
1530 {
1531 if (Player* player = GetCaster()->ToPlayer())
1532 {
1533 float horizontalSpeed = 20.0f + (40.0f - GetCaster()->GetDistance(target));
1534 float verticalSpeed = 8.0f;
1535 // This method relies on the Dalaran Sewer map disposition and Water Spout position
1536 // What we do is knock the player from a position exactly behind him and at the end of the pipe
1537 player->KnockbackFrom(target->GetPositionX(), player->GetPositionY(), horizontalSpeed, verticalSpeed);
1538 }
1539 }
1540 }
1541
1546};
1547
1549{
1551
1552 bool Load() override
1553 {
1554 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1555 }
1556
1558 {
1559 // This hook is executed for every target, make sure we only credit instance once
1560 if (_handled)
1561 return;
1562
1563 _handled = true;
1564 Unit* caster = GetCaster();
1565 if (InstanceScript* instance = caster->GetInstanceScript())
1566 instance->UpdateEncounterStateForSpellCast(GetSpellInfo()->Id, caster);
1567 }
1568
1573
1574 bool _handled = false;
1575};
1576
1577// 50051 - Ethereal Pet Aura
1590
1591// 50051 - Ethereal Pet Aura
1593{
1595
1596 bool CheckProc(ProcEventInfo& eventInfo)
1597 {
1598 uint32 levelDiff = std::abs(eventInfo.GetActor()->GetLevel() - eventInfo.GetActionTarget()->GetLevel());
1599 return levelDiff <= 9;
1600 }
1601
1602 void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
1603 {
1605
1606 std::list<Creature*> minionList;
1608 for (Creature* minion : minionList)
1609 {
1610 if (minion->IsAIEnabled())
1611 {
1612 minion->AI()->Talk(SAY_STEAL_ESSENCE);
1613 minion->CastSpell(eventInfo.GetActionTarget(), SPELL_STEAL_ESSENCE_VISUAL);
1614 }
1615 }
1616 }
1617
1623};
1624
1625// 50052 - Ethereal Pet onSummon
1627{
1629
1630 bool Validate(SpellInfo const* /*spellInfo*/) override
1631 {
1633 }
1634
1636 {
1637 Unit* target = GetHitUnit();
1638 target->CastSpell(target, SPELL_PROC_TRIGGER_ON_KILL_AURA, true);
1639 }
1640
1645};
1646
1647// 50055 - Ethereal Pet Aura Remove
1667
1668// 50101 - Steal Essence Visual
1670{
1672
1673 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1674 {
1675 if (Unit* caster = GetCaster())
1676 {
1677 caster->CastSpell(caster, SPELL_CREATE_TOKEN, true);
1678 if (Creature* soulTrader = caster->ToCreature())
1679 soulTrader->AI()->Talk(SAY_CREATE_TOKEN);
1680 }
1681 }
1682
1687};
1688
1708
1709/* 57337 - Great Feast
1710 57397 - Fish Feast
1711 58466 - Gigantic Feast
1712 58475 - Small Feast
1713 66477 - Bountiful Feast */
1715{
1717
1734
1735 void HandleScript(SpellEffIndex /*effIndex*/)
1736 {
1737 Unit* target = GetHitUnit();
1738
1739 switch (GetSpellInfo()->Id)
1740 {
1741 case SPELL_GREAT_FEAST:
1742 target->CastSpell(target, SPELL_FEAST_FOOD);
1743 target->CastSpell(target, SPELL_FEAST_DRINK);
1745 break;
1746 case SPELL_FISH_FEAST:
1747 target->CastSpell(target, SPELL_FEAST_FOOD);
1748 target->CastSpell(target, SPELL_FEAST_DRINK);
1749 target->CastSpell(target, SPELL_FISH_FEAST_REFRESHMENT);
1750 break;
1752 target->CastSpell(target, SPELL_FEAST_FOOD);
1753 target->CastSpell(target, SPELL_FEAST_DRINK);
1755 break;
1756 case SPELL_SMALL_FEAST:
1757 target->CastSpell(target, SPELL_FEAST_FOOD);
1758 target->CastSpell(target, SPELL_FEAST_DRINK);
1760 break;
1763 target->CastSpell(target, SPELL_BOUNTIFUL_FEAST_DRINK);
1764 target->CastSpell(target, SPELL_BOUNTIFUL_FEAST_FOOD);
1765 break;
1766 default:
1767 break;
1768 }
1769 }
1770
1775};
1776
1777/*
1778There are only 3 possible flags Feign Death auras can apply: UNIT_DYNFLAG_DEAD, UNIT_FLAG2_FEIGN_DEATH
1779and UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT. Some auras can apply only 2 flags
1780
1781spell_gen_feign_death_all_flags applies all 3 flags
1782spell_gen_feign_death_no_dyn_flag applies no UNIT_DYNFLAG_DEAD (does not make the creature appear dead)
1783spell_gen_feign_death_no_prevent_emotes applies no UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
1784
1785REACT_PASSIVE should be handled directly in scripts since not all creatures should be passive. Otherwise
1786creature will be not able to aggro or execute MoveInLineOfSight events. Removing may cause more issues
1787than already exists
1788*/
1789
1822
1823// 35357 - Spawn Feign Death
1824// 51329 - Feign Death
1826{
1828
1829 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1830 {
1831 Unit* target = GetTarget();
1834
1835 if (Creature* creature = target->ToCreature())
1836 creature->SetReactState(REACT_PASSIVE);
1837 }
1838
1839 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1840 {
1841 Unit* target = GetTarget();
1844
1845 if (Creature* creature = target->ToCreature())
1846 creature->InitializeReactState();
1847 }
1848
1854};
1855
1856// 58951 - Permanent Feign Death
1858{
1860
1861 void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1862 {
1863 Unit* target = GetTarget();
1866
1867 if (Creature* creature = target->ToCreature())
1868 creature->SetReactState(REACT_PASSIVE);
1869 }
1870
1871 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1872 {
1873 Unit* target = GetTarget();
1876
1877 if (Creature* creature = target->ToCreature())
1878 creature->InitializeReactState();
1879 }
1880
1886};
1887
1894
1895// 35491 - Furious Rage
1897{
1899
1900 bool Validate(SpellInfo const* /*spellInfo*/) override
1901 {
1902 return ValidateSpellInfo({ SPELL_EXHAUSTION }) &&
1903 sObjectMgr->GetBroadcastText(EMOTE_FURIOUS_RAGE) &&
1904 sObjectMgr->GetBroadcastText(EMOTE_EXHAUSTED);
1905 }
1906
1907 void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1908 {
1909 Unit* target = GetTarget();
1910 target->Unit::TextEmote(EMOTE_FURIOUS_RAGE, target, false);
1911 }
1912
1913 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1914 {
1915 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
1916 return;
1917
1918 Unit* target = GetTarget();
1919 target->Unit::TextEmote(EMOTE_EXHAUSTED, target, false);
1920 target->CastSpell(target, SPELL_EXHAUSTION, true);
1921 }
1922
1928};
1929
1930// 46642 - 5,000 Gold
1932{
1934
1935 void HandleScript(SpellEffIndex /*effIndex*/)
1936 {
1937 if (Player* target = GetHitPlayer())
1938 target->ModifyMoney(5000 * GOLD);
1939 }
1940
1945};
1946
1953
1955{
1957
1958 bool Validate(SpellInfo const* /*spellInfo*/) override
1959 {
1960 return ValidateSpellInfo(
1961 {
1965 });
1966 }
1967
1968 void HandleDummy(SpellEffIndex /* effIndex */)
1969 {
1970 Unit* caster = GetCaster();
1971 int32 r = irand(0, 119);
1972 if (r < 20) // Transporter Malfunction - 1/6 polymorph
1974 else if (r < 100) // Evil Twin - 4/6 evil twin
1975 caster->CastSpell(caster, SPELL_TRANSPORTER_EVIL_TWIN, true);
1976 else // Transporter Malfunction - 1/6 miss the target
1977 caster->CastSpell(caster, SPELL_TRANSPORTER_MALFUNCTION_MISS, true);
1978 }
1979
1984};
1985
1987{
1989
1990 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
1991 {
1992 if (!GetCaster() || !aurEff->GetTotalTicks())
1993 return;
1994
1995 float heal = 0.0f;
1996 switch (GetSpellInfo()->SpellFamilyName)
1997 {
1998 case SPELLFAMILY_MAGE:
2000 case SPELLFAMILY_PRIEST:
2001 heal = 1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()));
2002 break;
2004 case SPELLFAMILY_SHAMAN:
2005 heal = std::max(1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask())), 1.1f * float(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK)));
2006 break;
2008 case SPELLFAMILY_HUNTER:
2010 heal = 1.1f * float(std::max(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetCaster()->GetTotalAttackPowerValue(RANGED_ATTACK)));
2011 break;
2013 default:
2014 break;
2015 }
2016
2017 int32 healTick = std::floor(heal / aurEff->GetTotalTicks());
2018 amount += int32(std::max(healTick, 0));
2019 }
2020
2025};
2026
2032
2056
2057// 69641 - Gryphon/Wyvern Pet - Mounting Check Aura
2059{
2061
2062 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
2063 {
2064 Unit* target = GetTarget();
2065 Unit* owner = target->GetOwner();
2066
2067 if (!owner)
2068 return;
2069
2070 if (owner->IsMounted())
2071 target->SetDisableGravity(true);
2072 else
2073 target->SetDisableGravity(false);
2074 }
2075
2080};
2081
2082/* 9204 - Hate to Zero (Melee)
2083 20538 - Hate to Zero (AoE)
2084 26569 - Hate to Zero (AoE)
2085 26637 - Hate to Zero (AoE, Unique)
2086 37326 - Hate to Zero (AoE)
2087 40410 - Hate to Zero (Should be added, AoE)
2088 40467 - Hate to Zero (Should be added, AoE)
2089 41582 - Hate to Zero (Should be added, Melee) */
2105
2106// This spell is used by both player and creature, but currently works only if used by player
2107// 63984 - Hate to Zero
2109{
2111
2112 void HandleDummy(SpellEffIndex /*effIndex*/)
2113 {
2114 if (Unit* target = GetHitUnit())
2115 if (target->CanHaveThreatList())
2116 target->GetThreatManager().ModifyThreatByPercent(GetCaster(), -100);
2117 }
2118
2123};
2124
2125// 19707 - Hate to 50%
2127{
2129
2130 void HandleDummy(SpellEffIndex /*effIndex*/)
2131 {
2132 if (GetCaster()->CanHaveThreatList())
2134 }
2135
2140};
2141
2142// 26886 - Hate to 75%
2144{
2146
2147 void HandleDummy(SpellEffIndex /*effIndex*/)
2148 {
2149 if (GetCaster()->CanHaveThreatList())
2151 }
2152
2157};
2158
2160{
2162
2163 void HandleDummy(SpellEffIndex /*effIndex*/)
2164 {
2165 GetCaster()->SetHealth(GetCaster()->CountPctFromMaxHealth(30));
2166 }
2167
2172};
2173
2174// To be added: 19633, 20686, 23382, 31389, 32959
2196
2201
2202// -55428 - Lifeblood
2204{
2206
2207 bool Validate(SpellInfo const* /*spellInfo*/) override
2208 {
2210 }
2211
2216
2221};
2222
2223// -55428 - Lifeblood
2225{
2227
2228 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
2229 {
2230 if (!aurEff->GetTotalTicks())
2231 return;
2232
2233 if (Unit* owner = GetUnitOwner())
2234 amount += int32(CalculatePct(owner->GetMaxHealth(), 1.5f / aurEff->GetTotalTicks()));
2235 }
2236
2241};
2242
2251
2253{
2255
2256public:
2258
2259private:
2260 bool Validate(SpellInfo const* /*spellInfo*/) override
2261 {
2262 return ValidateSpellInfo({ _spellId });
2263 }
2264
2265 void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
2266 {
2267 // final heal only on duration end or dispel
2268 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
2269 return;
2270
2271 // final heal
2272 GetTarget()->CastSpell(GetTarget(), _spellId, { aurEff, GetCasterGUID() });
2273 }
2274
2279
2281};
2282
2284{
2286
2287 // Magic Broom
2292
2293 // Headless Horseman's Mount
2298
2299 // Winged Steed of the Ebon Blade
2302
2303 // Big Blizzard Bear
2306
2307 // Big Love Rocket
2313
2314 // Invincible
2319
2320 // Blazing Hippogryph
2323
2324 // Celestial Steed
2330
2331 // X-53 Touring Rocket
2336
2338{
2340
2341public:
2342 spell_gen_mount(uint32 mount0 = 0, uint32 mount60 = 0, uint32 mount100 = 0, uint32 mount150 = 0, uint32 mount280 = 0, uint32 mount310 = 0) : SpellScript(),
2343 _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { }
2344
2345private:
2346 bool Validate(SpellInfo const* /*spellInfo*/) override
2347 {
2348 bool result = true;
2349 if (_mount0)
2350 result &= ValidateSpellInfo({ _mount0 });
2351 if (_mount60)
2352 result &= ValidateSpellInfo({ _mount60 });
2353 if (_mount100)
2354 result &= ValidateSpellInfo({ _mount100 });
2355 if (_mount150)
2356 result &= ValidateSpellInfo({ _mount150 });
2357 if (_mount280)
2358 result &= ValidateSpellInfo({ _mount280 });
2359 if (_mount310)
2360 result &= ValidateSpellInfo({ _mount310 });
2361
2362 return result;
2363 }
2364
2366 {
2367 PreventHitDefaultEffect(effIndex);
2368
2369 if (Player* target = GetHitPlayer())
2370 {
2371 // Prevent stacking of mounts and client crashes upon dismounting
2372 target->RemoveAurasByType(SPELL_AURA_MOUNTED, ObjectGuid::Empty, GetHitAura());
2373
2374 // Triggered spell id dependent on riding skill and zone
2375 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(_mount150);
2376 uint32 zoneid, areaid;
2377 target->GetZoneAndAreaId(zoneid, areaid);
2378 bool const canFly = spellInfo && (spellInfo->CheckLocation(target->GetMapId(), zoneid, areaid, target) == SPELL_CAST_OK);
2379
2380 uint32 mount = 0;
2381 switch (target->GetBaseSkillValue(SKILL_RIDING))
2382 {
2383 case 0:
2384 mount = _mount0;
2385 break;
2386 case 75:
2387 mount = _mount60;
2388 break;
2389 case 150:
2390 mount = _mount100;
2391 break;
2392 case 225:
2393 if (canFly)
2394 mount = _mount150;
2395 else
2396 mount = _mount100;
2397 break;
2398 case 300:
2399 if (canFly)
2400 {
2401 if (_mount310 && target->Has310Flyer(false))
2402 mount = _mount310;
2403 else
2404 mount = _mount280;
2405 }
2406 else
2407 mount = _mount100;
2408 break;
2409 default:
2410 break;
2411 }
2412
2413 if (mount)
2414 target->CastSpell(target, mount, true);
2415 }
2416 }
2417
2422
2429};
2430
2431/* DOCUMENTATION: Charge spells
2432 Charge spells can be classified in four groups:
2433
2434 - Spells on vehicle bar used by players:
2435 + EFFECT_0: SCRIPT_EFFECT
2436 + EFFECT_1: TRIGGER_SPELL
2437 + EFFECT_2: NONE
2438 - Spells cast by player's mounts triggered by script:
2439 + EFFECT_0: CHARGE
2440 + EFFECT_1: TRIGGER_SPELL
2441 + EFFECT_2: APPLY_AURA
2442 - Spells cast by players on the target triggered by script:
2443 + EFFECT_0: SCHOOL_DAMAGE
2444 + EFFECT_1: SCRIPT_EFFECT
2445 + EFFECT_2: NONE
2446 - Spells cast by NPCs on players:
2447 + EFFECT_0: SCHOOL_DAMAGE
2448 + EFFECT_1: CHARGE
2449 + EFFECT_2: SCRIPT_EFFECT
2450
2451 In the following script we handle the SCRIPT_EFFECT and CHARGE
2452 - When handling SCRIPT_EFFECT:
2453 + EFFECT_0: Corresponds to "Spells on vehicle bar used by players" and we make player's mount cast
2454 the charge effect on the current target ("Spells cast by player's mounts triggered by script").
2455 + EFFECT_1 and EFFECT_2: Triggered when "Spells cast by player's mounts triggered by script" hits target,
2456 corresponding to "Spells cast by players on the target triggered by script" and "Spells cast by
2457 NPCs on players" and we check Defend layers and drop a charge of the first found.
2458 - When handling CHARGE:
2459 + Only launched for "Spells cast by player's mounts triggered by script", makes the player cast the
2460 damaging spell on target with a small chance of failing it.
2461*/
2462
2480
2482{
2484
2486 {
2487 Unit* target = GetHitUnit();
2488
2489 switch (effIndex)
2490 {
2491 case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
2492 {
2493 uint32 spellId;
2494
2495 switch (GetSpellInfo()->Id)
2496 {
2499 break;
2502 break;
2503 default:
2504 return;
2505 }
2506
2507 // If target isn't a training dummy there's a chance of failing the charge
2508 if (!target->IsCharmedOwnedByPlayerOrPlayer() && roll_chance_f(12.5f))
2509 spellId = SPELL_CHARGE_MISS_EFFECT;
2510
2511 if (Unit* vehicle = GetCaster()->GetVehicleBase())
2512 vehicle->CastSpell(target, spellId, false);
2513 else
2514 GetCaster()->CastSpell(target, spellId, false);
2515 break;
2516 }
2517 case EFFECT_1: // On damaging spells, for removing a defend layer
2518 case EFFECT_2:
2519 {
2520 Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
2521 for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
2522 {
2523 if (Aura* aura = itr->second->GetBase())
2524 {
2525 SpellInfo const* auraInfo = aura->GetSpellInfo();
2526 if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
2527 {
2528 aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
2529 // Remove dummys from rider (Necessary for updating visual shields)
2530 if (Unit* rider = target->GetCharmer())
2531 if (Aura* defend = rider->GetAura(aura->GetId()))
2532 defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
2533 break;
2534 }
2535 }
2536 }
2537 break;
2538 }
2539 }
2540 }
2541
2543 {
2544 uint32 spellId;
2545
2546 switch (GetSpellInfo()->Id)
2547 {
2549 spellId = SPELL_CHARGE_DAMAGE_8K5;
2550 break;
2553 spellId = SPELL_CHARGE_DAMAGE_20K;
2554 break;
2557 spellId = SPELL_CHARGE_DAMAGE_45K;
2558 break;
2559 default:
2560 return;
2561 }
2562
2563 if (Unit* rider = GetCaster()->GetCharmer())
2564 rider->CastSpell(GetHitUnit(), spellId, false);
2565 else
2566 GetCaster()->CastSpell(GetHitUnit(), spellId, false);
2567 }
2568
2579};
2580
2582{
2583 SPELL_FALL_DOWN = 6869
2585
2586// 6870 Moss Covered Feet
2587// 31399 Moss Covered Feet
2589{
2591
2592 bool Validate(SpellInfo const* /*spellInfo*/) override
2593 {
2595 }
2596
2597 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
2598 {
2600 eventInfo.GetActionTarget()->CastSpell(nullptr, SPELL_FALL_DOWN, aurEff);
2601 }
2602
2607};
2608
2613
2614// 28702 - Netherbloom
2616{
2618
2619 bool Validate(SpellInfo const* /*spellInfo*/) override
2620 {
2621 for (uint8 i = 0; i < 5; ++i)
2623 return false;
2624
2625 return true;
2626 }
2627
2629 {
2630 PreventHitDefaultEffect(effIndex);
2631
2632 if (Unit* target = GetHitUnit())
2633 {
2634 // 25% chance of casting a random buff
2635 if (roll_chance_i(75))
2636 return;
2637
2638 // triggered spells are 28703 to 28707
2639 // Note: some sources say, that there was the possibility of
2640 // receiving a debuff. However, this seems to be removed by a patch.
2641
2642 // don't overwrite an existing aura
2643 for (uint8 i = 0; i < 5; ++i)
2644 if (target->HasAura(SPELL_NETHERBLOOM_POLLEN_1 + i))
2645 return;
2646
2647 target->CastSpell(target, SPELL_NETHERBLOOM_POLLEN_1 + urand(0, 4), true);
2648 }
2649 }
2650
2655};
2656
2661
2662// 28720 - Nightmare Vine
2664{
2666
2667 bool Validate(SpellInfo const* /*spellInfo*/) override
2668 {
2670 }
2671
2673 {
2674 PreventHitDefaultEffect(effIndex);
2675
2676 if (Unit* target = GetHitUnit())
2677 {
2678 // 25% chance of casting Nightmare Pollen
2679 if (roll_chance_i(25))
2680 target->CastSpell(target, SPELL_NIGHTMARE_POLLEN, true);
2681 }
2682 }
2683
2688};
2689
2690// 27746 - Nitrous Boost
2692{
2694
2695 void PeriodicTick(AuraEffect const* /*aurEff*/)
2696 {
2698
2699 if (GetCaster() && GetTarget()->GetPower(POWER_MANA) >= 10)
2701 else
2702 Remove();
2703 }
2704
2709};
2710
2720
2721// 27539 - Obsidian Armor
2723{
2725
2738
2739 bool CheckProc(ProcEventInfo& eventInfo)
2740 {
2741 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
2742 if (!damageInfo || !damageInfo->GetSpellInfo())
2743 return false;
2744
2746 return false;
2747
2748 return true;
2749 }
2750
2751 void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
2752 {
2754
2755 uint32 spellId = 0;
2756 switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))
2757 {
2758 case SPELL_SCHOOL_HOLY:
2760 break;
2761 case SPELL_SCHOOL_FIRE:
2763 break;
2766 break;
2767 case SPELL_SCHOOL_FROST:
2769 break;
2772 break;
2775 break;
2776 default:
2777 return;
2778 }
2779 GetTarget()->CastSpell(GetTarget(), spellId, aurEff);
2780 }
2781
2787};
2788
2789// 55342 Mirror Image
2804
2806{
2808
2809 bool Load() override
2810 {
2811 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
2812 }
2813
2814 void HandleDummy(SpellEffIndex /*effIndex*/)
2815 {
2816 Player* player = GetCaster()->ToPlayer();
2817 uint32 factionId = GetEffectInfo().CalcValue();
2818 int32 repChange = GetEffectInfo(EFFECT_1).CalcValue();
2819
2820 FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
2821 if (!factionEntry)
2822 return;
2823
2824 // Set rep to baserep + basepoints (expecting spillover for oposite faction -> become hated)
2825 // Not when player already has equal or higher rep with this faction
2826 if (player->GetReputationMgr().GetReputation(factionEntry) < repChange)
2827 player->GetReputationMgr().SetReputation(factionEntry, repChange);
2828
2829 // EFFECT_INDEX_2 most likely update at war state, we already handle this in SetReputation
2830 }
2831
2836};
2837
2844
2846{
2848
2849 bool Validate(SpellInfo const* /*spellInfo*/) override
2850 {
2851 return ValidateSpellInfo(
2852 {
2856 });
2857 }
2858
2859 void HandleScript(SpellEffIndex /*effIndex*/)
2860 {
2861 Unit* caster = GetCaster();
2862 if (Player* target = GetHitPlayer())
2863 {
2864 uint8 gender = target->GetNativeGender();
2865 if (!gender)
2866 caster->CastSpell(target, SPELL_ORC_DISGUISE_MALE, true);
2867 else
2868 caster->CastSpell(target, SPELL_ORC_DISGUISE_FEMALE, true);
2869 }
2870 }
2871
2876};
2877
2879{
2880 SPELL_PARALYSIS = 35202
2882
2883// 35201 - Paralytic Poison
2885{
2887
2888 bool Validate(SpellInfo const* /*spellInfo*/) override
2889 {
2891 }
2892
2893 void HandleStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
2894 {
2895 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
2896 return;
2897
2898 GetTarget()->CastSpell(nullptr, SPELL_PARALYSIS, aurEff);
2899 }
2900
2905};
2906
2929
2931{
2933
2934 bool Validate(SpellInfo const* spellInfo) override
2935 {
2936 return sObjectMgr->GetBroadcastText(uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()));
2937 }
2938
2939 void HandleScript(SpellEffIndex /*effIndex*/)
2940 {
2941 // Note: target here is always player; caster here is gameobject, creature or player (self cast)
2942 if (Unit* target = GetHitUnit())
2943 target->Unit::Say(uint32(GetEffectValue()), target);
2944 }
2945
2950};
2951
2953{
2955
2956 bool CheckProc(ProcEventInfo& eventInfo)
2957 {
2958 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
2959 if (!damageInfo || !damageInfo->GetDamage())
2960 return false;
2961
2963
2964 if (eventInfo.GetActionTarget()->HealthBelowPctDamaged(pct, damageInfo->GetDamage()))
2965 return true;
2966
2967 return false;
2968 }
2969
2974};
2975
2990
2996
2997// 45472 Parachute
2999{
3001
3002 bool Validate(SpellInfo const* /*spellInfo*/) override
3003 {
3004 return ValidateSpellInfo(
3005 {
3008 });
3009 }
3010
3011 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
3012 {
3013 if (Player* target = GetTarget()->ToPlayer())
3014 if (target->IsFalling())
3015 {
3016 target->RemoveAurasDueToSpell(SPELL_PARACHUTE);
3017 target->CastSpell(target, SPELL_PARACHUTE_BUFF, true);
3018 }
3019 }
3020
3025};
3026
3028{
3031 NPC_IMP = 416
3033
3035{
3037
3038 bool Load() override
3039 {
3040 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
3041 }
3042
3043 void HandleScript(SpellEffIndex /*effIndex*/)
3044 {
3045 Player* player = GetCaster()->ToPlayer();
3046 if (player->GetLastPetNumber())
3047 {
3048 PetType newPetType = (player->GetClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
3049 Pet* newPet = new Pet(player, newPetType);
3050 if (newPet->LoadPetFromDB(player, 0, player->GetLastPetNumber(), true))
3051 {
3052 // revive the pet if it is dead
3053 if (newPet->getDeathState() != ALIVE && newPet->getDeathState() != JUST_RESPAWNED)
3055
3056 newPet->SetFullHealth();
3057 newPet->SetPower(newPet->GetPowerType(), newPet->GetMaxPower(newPet->GetPowerType()));
3058
3059 switch (newPet->GetEntry())
3060 {
3061 case NPC_DOOMGUARD:
3062 case NPC_INFERNAL:
3063 newPet->SetEntry(NPC_IMP);
3064 break;
3065 default:
3066 break;
3067 }
3068 }
3069 else
3070 delete newPet;
3071 }
3072 }
3073
3078};
3079
3080// 36553 - PetWait
3096
3101
3103{
3105
3106 bool Load() override
3107 {
3108 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
3109 }
3110
3112 {
3113 Player* player = GetCaster()->ToPlayer();
3114
3115 if (HasDiscoveredAllSpells(GetSpellInfo()->Id, player))
3116 {
3119 }
3120
3121 return SPELL_CAST_OK;
3122 }
3123
3124 void HandleScript(SpellEffIndex /*effIndex*/)
3125 {
3126 Player* caster = GetCaster()->ToPlayer();
3127 uint32 spellId = GetSpellInfo()->Id;
3128
3129 // Learn random explicit discovery recipe (if any)
3130 // Players will now learn 3 recipes the very first time they perform Northrend Inscription Research (3.3.0 patch notes)
3131 if (spellId == SPELL_NORTHREND_INSCRIPTION_RESEARCH && !HasDiscoveredAnySpell(spellId, caster))
3132 for (int i = 0; i < 2; ++i)
3133 if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
3134 caster->LearnSpell(discoveredSpellId, false);
3135
3136 if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster))
3137 caster->LearnSpell(discoveredSpellId, false);
3138 }
3139
3145};
3146
3148{
3150
3151 void HandleScript(SpellEffIndex /*effIndex*/)
3152 {
3153 if (Unit* target = GetHitUnit())
3154 {
3155 target->RemoveAurasByType(SPELL_AURA_FLY);
3156 target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
3157 }
3158 }
3159
3164};
3165
3166// 20589 - Escape artist
3167// 30918 - Improved Sprint
3182
3183// 23493 - Restoration
3184// 24379 - Restoration
3186{
3188
3189 void PeriodicTick(AuraEffect const* /*aurEff*/)
3190 {
3192
3193 Unit* target = GetTarget();
3194 if (!target)
3195 return;
3196
3197 int32 heal = target->CountPctFromMaxHealth(10);
3198 HealInfo healInfo(target, target, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
3199 target->HealBySpell(healInfo);
3200
3202 if (int32 mana = target->GetMaxPower(POWER_MANA))
3203 {
3204 mana /= 10;
3205 target->EnergizeBySpell(target, GetId(), mana, POWER_MANA);
3206 }
3207 }
3208
3213};
3214
3215// 38772 Grievous Wound
3216// 43937 Grievous Wound
3217// 62331 Impale
3218// 62418 Impale
3220{
3222
3223 void PeriodicTick(AuraEffect const* /*aurEff*/)
3224 {
3225 // they apply damage so no need to check for ticks here
3226
3227 if (GetTarget()->HealthAbovePct(GetEffectInfo(EFFECT_1).CalcValue()))
3228 {
3231 }
3232 }
3233
3238};
3239
3240// 31956 Grievous Wound
3241// 38801 Grievous Wound
3242// 43093 Grievous Throw
3243// 58517 Grievous Wound
3244// 59262 Grievous Wound
3246{
3248
3249 void PeriodicTick(AuraEffect const* aurEff)
3250 {
3251 // if it has only periodic effect, allow 1 tick
3252 bool onlyEffect = !GetEffectInfo(EFFECT_1).IsEffect() && !GetEffectInfo(EFFECT_2).IsEffect();
3253 if (onlyEffect && aurEff->GetTickNumber() <= 1)
3254 return;
3255
3256 if (GetTarget()->IsFullHealth())
3257 {
3260 }
3261 }
3262
3267};
3268
3269// 70292 - Glacial Strike
3270// 71316 - Glacial Strike
3271// 71317 - Glacial Strike
3273{
3275
3276 void PeriodicTick(AuraEffect const* /*aurEff*/)
3277 {
3278 // they apply damage so no need to check for ticks here
3279
3280 if (GetTarget()->IsFullHealth())
3281 {
3284 }
3285 }
3286
3291};
3292
3298
3300{
3301public:
3302 bool operator()(WorldObject* obj) const
3303 {
3304 if (Unit* target = obj->ToUnit())
3305 return target->GetPowerType() != POWER_MANA;
3306
3307 return true;
3308 }
3309};
3310
3312{
3314
3315 void RemoveInvalidTargets(std::list<WorldObject*>& targets)
3316 {
3317 // In arenas Replenishment may only affect the caster
3318 if (Player* caster = GetCaster()->ToPlayer())
3319 {
3320 if (caster->InArena())
3321 {
3322 targets.clear();
3323 targets.push_back(caster);
3324 return;
3325 }
3326 }
3327
3328 targets.remove_if(ReplenishmentCheck());
3329
3330 uint8 const maxTargets = 10;
3331
3332 if (targets.size() > maxTargets)
3333 {
3335 targets.resize(maxTargets);
3336 }
3337 }
3338
3343};
3344
3346{
3348
3349 bool Load() override
3350 {
3351 return GetUnitOwner()->GetPowerType() == POWER_MANA;
3352 }
3353
3354 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
3355 {
3356 switch (GetSpellInfo()->Id)
3357 {
3359 amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f;
3360 break;
3362 amount = GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f;
3363 break;
3364 default:
3365 break;
3366 }
3367 }
3368
3373};
3374
3375// 32343 - Revive Self
3391
3396
3398{
3400
3401 bool Validate(SpellInfo const* /*spellInfo*/) override
3402 {
3404 }
3405
3406 bool Load() override
3407 {
3408 return GetGObjCaster()->GetOwnerGUID().IsPlayer();
3409 }
3410
3412 {
3413 if (Unit* owner = GetGObjCaster()->GetOwner())
3414 if (GameObject* go = GetHitGObj())
3415 if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING)
3416 owner->CastSpell(nullptr, SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT, true);
3417 }
3418
3423};
3424
3426
3442
3444{
3446
3447 bool Load() override
3448 {
3450 }
3451
3452 void HandleDummy(SpellEffIndex /* effIndex */)
3453 {
3454 Player* originalCaster = GetOriginalCaster()->ToPlayer();
3455 if (Unit* target = GetHitUnit())
3456 {
3458 data << target->GetGUID();
3459 originalCaster->SendDirectMessage(&data);
3460 }
3461 }
3462
3467};
3468
3473
3502
3503// 41213, 43416, 69222, 73076 - Throw Shield
3519
3525
3527{
3529
3530 bool Validate(SpellInfo const* /*spellInfo*/) override
3531 {
3532 return ValidateSpellInfo(
3533 {
3536 });
3537 }
3538
3540 {
3541 if (Unit* rider = GetCaster()->GetCharmer())
3542 {
3543 if (Player* playerTarget = GetHitPlayer())
3544 {
3545 if (playerTarget->HasAura(SPELL_ON_TOURNAMENT_MOUNT) && playerTarget->GetVehicleBase())
3546 rider->CastSpell(playerTarget, SPELL_MOUNTED_DUEL, true);
3547 }
3548 else if (Unit* unitTarget = GetHitUnit())
3549 {
3550 if (unitTarget->GetCharmer() && unitTarget->GetCharmer()->GetTypeId() == TYPEID_PLAYER && unitTarget->GetCharmer()->HasAura(SPELL_ON_TOURNAMENT_MOUNT))
3551 rider->CastSpell(unitTarget->GetCharmer(), SPELL_MOUNTED_DUEL, true);
3552 }
3553 }
3554 }
3555
3560};
3561
3563{
3565
3566 bool Load() override
3567 {
3568 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
3569 }
3570
3571 void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
3572 {
3573 if (Unit* caster = GetCaster())
3574 if (!caster->GetVehicleBase())
3575 caster->RemoveAurasDueToSpell(GetId());
3576 }
3577
3582};
3583
3591
3593{
3595
3596 void HandleScript(SpellEffIndex /* effIndex */)
3597 {
3598 Unit* target = GetHitUnit();
3599 if (target->GetTypeId() != TYPEID_PLAYER)
3600 return;
3601
3602 // return from top
3603 if (target->ToPlayer()->GetAreaId() == AREA_VIOLET_CITADEL_SPIRE)
3604 target->CastSpell(target, SPELL_TELEPORT_SPIRE_DOWN, true);
3605 // teleport atop
3606 else
3607 target->CastSpell(target, SPELL_TELEPORT_SPIRE_UP, true);
3608 }
3609
3614};
3615
3621
3622template <uint32 TriggeredSpellId>
3624{
3626
3627 bool Validate(SpellInfo const* /*spellInfo*/) override
3628 {
3629 return ValidateSpellInfo({ TriggeredSpellId });
3630 }
3631
3633 {
3634 /*
3635 * @workaround: PendingCast flag normally means 'triggered' spell, however
3636 * if the spell is cast triggered, the core won't send SMSG_SPELL_GO packet
3637 * so client never registers the cooldown (see Spell::IsNeedSendToClient)
3638 *
3639 * ServerToClient: SMSG_SPELL_GO (0x0132) Length: 42 ConnIdx: 0 Time: 07/19/2010 02:32:35.000 Number: 362675
3640 * Caster GUID: Full: Player
3641 * Caster Unit GUID: Full: Player
3642 * Cast Count: 0
3643 * Spell ID: 72752 (72752)
3644 * Cast Flags: PendingCast, Unknown3, Unknown7 (265)
3645 * Time: 3901468825
3646 * Hit Count: 1
3647 * [0] Hit GUID: Player
3648 * Miss Count: 0
3649 * Target Flags: Unit (2)
3650 * Target GUID: 0x0
3651 */
3652
3653 // Spell flags need further research, until then just cast not triggered
3654 GetCaster()->CastSpell(nullptr, TriggeredSpellId, false);
3655 }
3656
3661};
3662
3667
3669{
3671
3672 void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
3673 {
3674 // store stack apply times, so we can pop them while they expire
3676 Unit* target = GetTarget();
3677
3678 // on stack 15 cast the achievement crediting spell
3679 if (GetStackAmount() >= 15)
3680 target->CastSpell(target, SPELL_TURKEY_VENGEANCE, { aurEff, GetCasterGUID() });
3681 }
3682
3683 void OnPeriodic(AuraEffect const* /*aurEff*/)
3684 {
3685 int32 removeCount = 0;
3686
3687 // pop expired times off of the stack
3688 while (!_applyTimes.empty() && _applyTimes.front() + GetMaxDuration() < GameTime::GetGameTimeMS())
3689 {
3690 _applyTimes.pop_front();
3691 removeCount++;
3692 }
3693
3694 if (removeCount)
3696 }
3697
3703
3704 std::list<uint32> _applyTimes;
3705};
3706
3715
3717{
3719
3720 void HandleScript(SpellEffIndex /*effIndex*/)
3721 {
3722 if (Player* player = GetHitPlayer())
3723 {
3725 // player can only have one of these items
3726 for (uint8 i = 0; i < 5; ++i)
3727 {
3728 if (player->HasItemCount(itemId[i], 1, true))
3729 return;
3730 }
3731
3732 CreateItem(itemId[urand(0, 4)]);
3733 }
3734 }
3735
3740};
3741
3746
3747// 52723 - Vampiric Touch
3748// 60501 - Vampiric Touch
3750{
3752
3753 bool Validate(SpellInfo const* /*spellInfo*/) override
3754 {
3756 }
3757
3758 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
3759 {
3761 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
3762 if (!damageInfo || !damageInfo->GetDamage())
3763 return;
3764
3765 Unit* caster = eventInfo.GetActor();
3766 CastSpellExtraArgs args(aurEff);
3767 args.AddSpellBP0(damageInfo->GetDamage() / 2);
3768 caster->CastSpell(caster, SPELL_VAMPIRIC_TOUCH_HEAL, args);
3769 }
3770
3775};
3776
3778{
3779 SPELL_GEAR_SCALING = 66668
3781
3783{
3785
3786 bool Load() override
3787 {
3788 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
3789 }
3790
3791 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
3792 {
3793 Unit* caster = GetCaster();
3794 float factor;
3795 uint16 baseItemLevel;
3796
3798 switch (GetId())
3799 {
3800 case SPELL_GEAR_SCALING:
3801 factor = 1.0f;
3802 baseItemLevel = 205;
3803 break;
3804 default:
3805 factor = 1.0f;
3806 baseItemLevel = 170;
3807 break;
3808 }
3809
3810 float avgILvl = caster->ToPlayer()->GetAverageItemLevel();
3811 if (avgILvl < baseItemLevel)
3812 return;
3813
3814 amount = uint16((avgILvl - baseItemLevel) * factor);
3815 }
3816
3823};
3824
3830
3832{
3834
3835 void HandleDummy(SpellEffIndex /* effIndex */)
3836 {
3837 if (Creature* vendor = GetCaster()->ToCreature())
3838 if (vendor->GetEntry() == NPC_AMPHITHEATER_VENDOR)
3839 vendor->AI()->Talk(SAY_AMPHITHEATER_VENDOR);
3840 }
3841
3846};
3847
3849{
3851
3853 {
3854 if (!GetSpellInfo()->CheckTargetCreatureType(GetCaster()))
3856 return SPELL_CAST_OK;
3857 }
3858
3863};
3864
3869
3890
3892{
3894
3895 bool Validate(SpellInfo const* spellInfo) override
3896 {
3897 return sObjectMgr->GetBroadcastText(uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()));
3898 }
3899
3900 void HandleScript(SpellEffIndex /*effIndex*/)
3901 {
3902 if (TempSummon* casterSummon = GetCaster()->ToTempSummon())
3903 if (Player* target = casterSummon->GetSummonerUnit()->ToPlayer())
3904 casterSummon->Unit::Whisper(uint32(GetEffectValue()), target, false);
3905 }
3906
3911};
3912
3919
3920// BasePoints of spells is ID of npc_text used to group texts, it's not implemented so texts are grouped the old way
3921// 50037 - Mystery of the Infinite: Future You's Whisper to Controller - Random
3922// 50287 - Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random
3923// 60709 - MOTI, Redux: Past You's Whisper to Controller - Random
3925{
3927
3928public:
3930
3931private:
3932 void HandleScript(SpellEffIndex /*effIndex*/)
3933 {
3934 // Same for all spells
3935 if (!roll_chance_i(20))
3936 return;
3937
3938 if (Creature* target = GetHitCreature())
3939 if (TempSummon* targetSummon = target->ToTempSummon())
3940 if (Player* player = targetSummon->GetSummonerUnit()->ToPlayer())
3941 targetSummon->AI()->Talk(_text, player);
3942 }
3943
3948
3950};
3951
3952// 23777 - Zero Mana/Full Health DND
3968
3970{
3972
3974 {
3975 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3976 vehicle->RemoveAllPassengers();
3977 }
3978
3983};
3984
3986{
3988
3989 bool Validate(SpellInfo const* spellInfo) override
3990 {
3991 if (spellInfo->GetEffect(EFFECT_0).CalcValue() < 1)
3992 return false;
3993 return true;
3994 }
3995
3997 {
3998 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
3999 {
4000 if (Unit* passenger = vehicle->GetPassenger(GetEffectValue() - 1))
4001 passenger->ExitVehicle();
4002 }
4003 }
4004
4009};
4010
4012{
4014
4015public:
4017
4018private:
4020
4022 {
4023 if (Vehicle* vehicle = GetHitUnit()->GetVehicleKit())
4024 {
4025 if (Unit* passenger = vehicle->GetPassenger(_seatId))
4026 passenger->ExitVehicle();
4027 }
4028 }
4029
4034};
4035
4037{
4038 SPELL_GM_FREEZE = 9454
4040
4042{
4044
4045 bool Validate(SpellInfo const* /*spellInfo*/) override
4046 {
4048 }
4049
4050 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
4051 {
4052 // Do what was done before to the target in HandleFreezeCommand
4053 if (Player* player = GetTarget()->ToPlayer())
4054 {
4055 // stop combat + make player unattackable + duel stop + stop some spells
4056 player->SetFaction(FACTION_FRIENDLY);
4057 player->CombatStop();
4058 if (player->IsNonMeleeSpellCast(true))
4059 player->InterruptNonMeleeSpells(true);
4060 player->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
4061
4062 // if player class = hunter || warlock remove pet if alive
4063 if ((player->GetClass() == CLASS_HUNTER) || (player->GetClass() == CLASS_WARLOCK))
4064 {
4065 if (Pet* pet = player->GetPet())
4066 {
4067 pet->SavePetToDB(PET_SAVE_AS_CURRENT);
4068 // not let dismiss dead pet
4069 if (pet->IsAlive())
4070 player->RemovePet(pet, PET_SAVE_NOT_IN_SLOT);
4071 }
4072 }
4073 }
4074 }
4075
4076 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
4077 {
4078 // Do what was done before to the target in HandleUnfreezeCommand
4079 if (Player* player = GetTarget()->ToPlayer())
4080 {
4081 // Reset player faction + allow combat + allow duels
4082 player->SetFactionForRace(player->GetRace());
4083 player->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
4084 // save player
4085 player->SaveToDB();
4086 }
4087 }
4088
4094};
4095
4097{
4099
4101 {
4102 Creature* target = GetHitCreature();
4103 if (!target)
4104 return;
4105
4108 }
4109
4114};
4115
4117{
4119 // Flasks
4136 // Elixirs
4203
4205{
4207
4208 bool Validate(SpellInfo const* /*spellInfo*/) override
4209 {
4211 }
4212
4213 bool Load() override
4214 {
4215 return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
4216 }
4217
4218 void SetBonusValueForEffect(SpellEffIndex effIndex, int32 value, AuraEffect const* aurEff)
4219 {
4220 if (aurEff->GetEffIndex() == uint32(effIndex))
4221 bonus = value;
4222 }
4223
4224 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
4225 {
4226 if (GetCaster()->HasAura(SPELL_MIXOLOGY) && GetCaster()->HasSpell(GetEffectInfo(EFFECT_0).TriggerSpell))
4227 {
4228 switch (GetId())
4229 {
4232 bonus = amount;
4233 break;
4237 bonus = CalculatePct(amount, 80);
4238 break;
4254 bonus = CalculatePct(amount, 50);
4255 break;
4257 bonus = 280;
4258 break;
4260 bonus = 200;
4261 break;
4264 bonus = 140;
4265 break;
4267 bonus = 100;
4268 break;
4270 bonus = 82;
4271 break;
4273 bonus = 70;
4274 break;
4276 bonus = 50;
4277 break;
4279 bonus = 47;
4280 break;
4281 case SPELL_WRATH_ELIXIR:
4282 bonus = 32;
4283 break;
4287 bonus = 29;
4288 break;
4290 bonus = 27;
4291 break;
4296 bonus = 23;
4297 break;
4309 bonus = 20;
4310 break;
4312 bonus = 17;
4313 break;
4316 bonus = 15;
4317 break;
4319 bonus = 13;
4320 break;
4322 bonus = 12;
4323 break;
4326 bonus = 11;
4327 break;
4333 bonus = 10;
4334 break;
4336 bonus = 9;
4337 break;
4339 case SPELL_GURUS_ELIXIR:
4340 bonus = 8;
4341 break;
4345 bonus = 6;
4346 break;
4351 bonus = 5;
4352 break;
4355 bonus = 4;
4356 break;
4358 bonus = -10;
4359 break;
4361 SetBonusValueForEffect(EFFECT_0, 13, aurEff);
4362 SetBonusValueForEffect(EFFECT_1, 13, aurEff);
4363 SetBonusValueForEffect(EFFECT_2, 8, aurEff);
4364 break;
4366 SetBonusValueForEffect(EFFECT_0, 160, aurEff);
4367 break;
4369 SetBonusValueForEffect(EFFECT_0, 116, aurEff);
4370 SetBonusValueForEffect(EFFECT_1, 6, aurEff);
4371 break;
4373 SetBonusValueForEffect(EFFECT_0, 40, aurEff);
4374 SetBonusValueForEffect(EFFECT_1, 40, aurEff);
4375 break;
4377 SetBonusValueForEffect(EFFECT_0, 210, aurEff);
4378 SetBonusValueForEffect(EFFECT_1, 5, aurEff);
4379 break;
4381 SetBonusValueForEffect(EFFECT_0, 19, aurEff);
4382 SetBonusValueForEffect(EFFECT_1, 19, aurEff);
4383 SetBonusValueForEffect(EFFECT_2, 5, aurEff);
4384 break;
4386 SetBonusValueForEffect(EFFECT_0, 5, aurEff);
4387 break;
4388 default:
4389 TC_LOG_ERROR("spells", "SpellId {} couldn't be processed in spell_gen_mixology_bonus", GetId());
4390 break;
4391 }
4392 amount += bonus;
4393 }
4394 }
4395
4397
4402};
4403
4408
4410{
4412
4413 void HandleScript(SpellEffIndex /*effIndex*/)
4414 {
4415 if (Player* target = GetHitPlayer())
4416 {
4417 Aura const* aura = GetHitAura();
4418 if (!aura || aura->GetStackAmount() < 10)
4419 return;
4420
4421 target->CastSpell(target, SPELL_LANDMINE_KNOCKBACK_ACHIEVEMENT, true);
4422 }
4423 }
4424
4429};
4430
4431// 34098 - ClearAllDebuffs
4433{
4435
4436 void HandleScript(SpellEffIndex /*effIndex*/)
4437 {
4438 if (Unit* target = GetHitUnit())
4439 {
4440 target->RemoveOwnedAuras([](Aura const* aura)
4441 {
4442 SpellInfo const* spellInfo = aura->GetSpellInfo();
4443 return !spellInfo->IsPositive() && !spellInfo->IsPassive();
4444 });
4445 }
4446 }
4447
4452};
4453
4455{
4457 MOUNT_PONY = 29736
4459
4461{
4463
4464 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
4465 {
4466 Unit* caster = GetCaster();
4467 if (!caster)
4468 return;
4469 Player* owner = caster->GetOwner()->ToPlayer();
4470 if (!owner || !owner->HasAchieved(ACHIEV_PONY_UP))
4471 return;
4472
4473 if (owner->IsMounted())
4474 {
4475 caster->Mount(MOUNT_PONY);
4476 caster->SetSpeedRate(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
4477 }
4478 else if (caster->IsMounted())
4479 {
4480 caster->Dismount();
4481 caster->SetSpeedRate(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
4482 }
4483 }
4484
4489};
4490
4498
4499// 40350 - Corrupting Plague
4501{
4502public:
4503 CorruptingPlagueSearcher(Unit* obj, float distance) : _unit(obj), _distance(distance) { }
4504
4505 bool operator()(Unit* u) const
4506 {
4507 if (_unit->GetDistance2d(u) < _distance &&
4510 return true;
4511
4512 return false;
4513 }
4514
4515private:
4518};
4519
4520// 40349 - Corrupting Plague
4522{
4524
4525 bool Validate(SpellInfo const* /*spellInfo*/) override
4526 {
4528 }
4529
4530 void OnPeriodic(AuraEffect const* /*aurEff*/)
4531 {
4532 Unit* owner = GetTarget();
4533
4534 std::list<Creature*> targets;
4535 CorruptingPlagueSearcher creature_check(owner, 15.0f);
4536 Trinity::CreatureListSearcher<CorruptingPlagueSearcher> creature_searcher(owner, targets, creature_check);
4537 Cell::VisitGridObjects(owner, creature_searcher, 15.0f);
4538
4539 if (!targets.empty())
4540 return;
4541
4543 }
4544
4549};
4550
4556
4557// 40307 - Stasis Field
4559{
4560public:
4561 StasisFieldSearcher(Unit* obj, float distance) : _unit(obj), _distance(distance) { }
4562
4563 bool operator()(Unit* u) const
4564 {
4565 if (_unit->GetDistance2d(u) < _distance &&
4568 return true;
4569
4570 return false;
4571 }
4572
4573private:
4576};
4577
4578// 40306 - Stasis Field
4580{
4582
4583 bool Validate(SpellInfo const* /*spellInfo*/) override
4584 {
4586 }
4587
4588 void OnPeriodic(AuraEffect const* /*aurEff*/)
4589 {
4590 Unit* owner = GetTarget();
4591
4592 std::list<Creature*> targets;
4593 StasisFieldSearcher creature_check(owner, 15.0f);
4594 Trinity::CreatureListSearcher<StasisFieldSearcher> creature_searcher(owner, targets, creature_check);
4595 Cell::VisitGridObjects(owner, creature_searcher, 15.0f);
4596
4597 if (!targets.empty())
4598 return;
4599
4601 }
4602
4607};
4608
4613
4628
4635
4636// 34779 - Freezing Circle
4638{
4640
4641 bool Validate(SpellInfo const* /*spellInfo*/) override
4642 {
4643 return ValidateSpellInfo(
4644 {
4648 });
4649 }
4650
4651 void HandleDamage(SpellEffIndex /*effIndex*/)
4652 {
4653 Unit* caster = GetCaster();
4654 uint32 spellId = 0;
4655 Map* map = caster->GetMap();
4656
4657 if (map->IsDungeon())
4659 else
4660 spellId = SPELL_FREEZING_CIRCLE;
4661
4662 if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId))
4663 SetHitDamage(spellInfo->GetEffect(EFFECT_0).CalcValue());
4664 }
4665
4670};
4671
4672// Used for some spells cast by vehicles or charmed creatures that do not send a cooldown event on their own
4674{
4676
4678 {
4679 Unit* caster = GetCaster();
4680 if (Player* owner = caster->GetCharmerOrOwnerPlayerOrPlayerItself())
4681 {
4682 WorldPacket data;
4684 owner->SendDirectMessage(&data);
4685 }
4686 }
4687
4692};
4693
4699
4701{
4703
4704 bool Validate(SpellInfo const* /*spellInfo*/) override
4705 {
4707 }
4708 void HandleScript(SpellEffIndex /*effIndex*/)
4709 {
4710 int32 bp = GetEffectInfo().CalcValue();
4711 Unit* target = GetHitUnit();
4713 args.AddSpellBP0(bp);
4714 target->CastSpell(target, SPELL_CANNON_BLAST_DAMAGE, args);
4715 }
4716
4721};
4722
4723// 37751 - Submerged
4739
4741{
4755 RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_break_shield");
4756 RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_tournament_counterattack");
4770 RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_default_count_pct_from_max_hp");
4771 RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_50pct_count_pct_from_max_hp", 50);
4773 RegisterSpellScriptWithArgs(spell_gen_dalaran_disguise, "spell_gen_sunreaver_disguise");
4774 RegisterSpellScriptWithArgs(spell_gen_dalaran_disguise, "spell_gen_silver_covenant_disguise");
4805 RegisterSpellScriptWithArgs(spell_gen_knock_away_threat_reduction, "spell_gen_knock_away_threat_reduction_100", 100); // 10101
4806 RegisterSpellScriptWithArgs(spell_gen_knock_away_threat_reduction, "spell_gen_knock_away_threat_reduction_50", 50); // 18670, 18945
4807 RegisterSpellScriptWithArgs(spell_gen_knock_away_threat_reduction, "spell_gen_knock_away_threat_reduction_25", 25); // 18813, 25778
4816 RegisterSpellScriptWithArgs(spell_gen_mount, "spell_winged_steed_of_the_ebon_blade", 0, 0, 0, SPELL_WINGED_STEED_150, SPELL_WINGED_STEED_280);
4835 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_soul_harvesters_charm");
4836 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_commendation_of_kaelthas");
4837 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_corpse_tongue_coin");
4838 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_corpse_tongue_coin_heroic");
4839 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_petrified_twilight_scale");
4840 RegisterSpellScriptWithArgs(spell_gen_proc_below_pct_damaged, "spell_item_petrified_twilight_scale_heroic");
4872 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_future_you_whisper_to_controller_random", WHISPER_FUTURE_YOU);
4873 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_wyrmrest_defender_whisper_to_controller_random", WHISPER_DEFENDER);
4874 RegisterSpellScriptWithArgs(spell_gen_whisper_to_controller_random, "spell_past_you_whisper_to_controller_random", WHISPER_PAST_YOU);
4878 RegisterSpellScriptWithArgs(spell_gen_eject_passenger_with_seatId, "spell_gen_eject_passenger_1", 0);
4879 RegisterSpellScriptWithArgs(spell_gen_eject_passenger_with_seatId, "spell_gen_eject_passenger_3", 2);
4893}
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:567
@ EQUIPMENT_SLOT_OFFHAND
Definition Player.h:568
@ EQUIPMENT_SLOT_RANGED
Definition Player.h:569
#define INVENTORY_SLOT_BAG_0
Definition Player.h:547
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:211
@ JUST_RESPAWNED
Definition Unit.h:215
@ 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:201
uint8 GetStackAmount() const
Definition SpellAuras.h:164
SpellInfo const * GetSpellInfo() const
Definition SpellAuras.h:115
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:460
uint32 GetDamage() const
Definition Unit.h:464
ObjectGuid GetOwnerGUID() const override
Definition GameObject.h:141
Definition Item.h:62
Definition Map.h:281
bool IsDungeon() const
Definition Map.cpp:4236
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:4256
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:186
static Unit * ToUnit(Object *o)
Definition Object.h:192
uint32 GetUInt32Value(uint16 index) const
Definition Object.cpp:249
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:180
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:3353
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:6161
bool HasAchieved(uint32 achievementId) const
Definition Player.cpp:24920
uint32 GetLastPetNumber() const
Definition Player.h:2162
float GetAverageItemLevel() const
Definition Player.cpp:26146
ReputationMgr & GetReputationMgr()
Definition Player.h:1848
SpellSchoolMask GetSchoolMask() const
Definition Unit.cpp:279
Unit * GetActionTarget() const
Definition Unit.h:509
uint32 GetTypeMask() const
Definition Unit.h:511
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:268
Unit * GetActor()
Definition Unit.h:508
DamageInfo * GetDamageInfo() const
Definition Unit.h:519
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:769
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:8439
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3561
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3765
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3638
void SetFullHealth()
Definition Unit.h:927
ThreatManager & GetThreatManager()
Definition Unit.h:1155
uint8 GetClass() const
Definition Unit.h:895
float GetCollisionHeight() const override
Definition Unit.cpp:13924
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:780
Unit * GetCharmer() const
Definition Unit.h:1253
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
Powers GetPowerType() const
Definition Unit.h:931
void Dismount()
Definition Unit.cpp:8234
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:960
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
Definition Unit.cpp:6420
void SetHealth(uint32 val)
Definition Unit.cpp:9361
TempSummon * ToTempSummon()
Definition Unit.h:1794
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition Unit.cpp:13286
void SetVirtualItem(uint32 slot, uint32 itemId)
Definition Unit.cpp:13868
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition Unit.cpp:8184
bool IsCharmedOwnedByPlayerOrPlayer() const
Definition Unit.h:1261
uint32 GetVirtualItemId(uint32 slot) const
Definition Unit.cpp:13860
uint32 GetMaxPower(Powers power) const
Definition Unit.h:936
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool force=false)
Definition Unit.cpp:9421
void RemoveUnitFlag2(UnitFlags2 flags)
Definition Unit.h:961
void SetFullPower(Powers power)
Definition Unit.h:941
bool IsMounted() const
Definition Unit.h:1013
float GetSpeedRate(UnitMoveType mtype) const
Definition Unit.h:1654
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition Unit.cpp:8678
void EnergizeBySpell(Unit *victim, uint32 spellId, int32 damage, Powers powerType)
Definition Unit.cpp:6440
DeathState getDeathState() const
Definition Unit.h:1238
void HandleEmoteCommand(Emote emoteId)
Definition Unit.cpp:1568
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:922
void SetStandState(UnitStandStateType state)
Definition Unit.cpp:10363
SpellHistory * GetSpellHistory()
Definition Unit.h:1484
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:918
void SetUnitFlag(UnitFlags flags)
Definition Unit.h:954
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1338
void RemoveMovementImpairingAuras(bool withRoot)
Definition Unit.cpp:4069
void GetAllMinionsByEntry(std::list< Creature * > &Minions, uint32 entry)
Definition Unit.cpp:6062
uint8 GetLevel() const
Definition Unit.h:889
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:955
uint32 GetPhaseMask() const
Definition Object.h:368
Map * GetMap() const
Definition Object.h:449
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1087
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
Unit * GetOwner() const
Definition Object.cpp:2180
float GetDistance2d(WorldObject const *obj) const
Definition Object.cpp:1141
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition Object.cpp:2203
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1123
uint32 GetAreaId() const
Definition Object.h:374
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)
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
PrepareSpellScript(spell_gen_chaos_blast)
void Register() override
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
ChaosBlast
@ SPELL_CHAOS_BLAST
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_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL
@ SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL
DefendVisuals
@ SPELL_VISUAL_SHIELD_2
@ SPELL_VISUAL_SHIELD_3
@ SPELL_VISUAL_SHIELD_1
TournamentMountsSpells
@ SPELL_LANCE_EQUIPPED
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