TrinityCore
Loading...
Searching...
No Matches
spell_warlock.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_WARLOCK and SPELLFAMILY_GENERIC spells used by warlock players.
20 * Ordered alphabetically using scriptname.
21 * Scriptnames of files in this file should be prefixed with "spell_warl_".
22 */
23
24#include "ScriptMgr.h"
25#include "AreaTrigger.h"
26#include "AreaTriggerAI.h"
27#include "CellImpl.h"
28#include "Containers.h"
29#include "Creature.h"
30#include "GameObject.h"
31#include "GridNotifiersImpl.h"
32#include "ObjectAccessor.h"
33#include "Pet.h"
34#include "Player.h"
35#include "Random.h"
36#include "SpellAuraEffects.h"
37#include "SpellAuras.h"
38#include "SpellHistory.h"
39#include "SpellMgr.h"
40#include "SpellScript.h"
41
43{
108};
109
115
120
121// 146739 - Corruption
122// 445474 - Wither
124{
125 bool Validate(SpellInfo const* /*spellInfo*/) override
126 {
128 }
129
130 bool Load() override
131 {
133 }
134
135 void HandleApply(SpellEffIndex /*effIndex*/) const
136 {
137 if (Aura const* absoluteCorruption = GetCaster()->GetAura(SPELL_WARLOCK_ABSOLUTE_CORRUPTION))
138 {
139 Milliseconds duration = GetHitUnit()->IsPvP()
140 ? Seconds(absoluteCorruption->GetSpellInfo()->GetEffect(EFFECT_0).CalcValueAsInt())
141 : Milliseconds(-1);
142
143 GetHitAura()->SetMaxDuration(duration.count());
144 GetHitAura()->SetDuration(duration.count());
145 }
146 }
147
152};
153
154// Called by 17962 - Conflagrate
156{
157 bool Validate(SpellInfo const* /*spellInfo*/) override
158 {
160 }
161
162 bool Load() override
163 {
165 }
166
167 void HandleAfterCast() const
168 {
169 Unit* caster = GetCaster();
172 .TriggeringSpell = GetSpell()
173 });
174 }
175
180};
181
182// 710 - Banish
184{
185public:
187
188private:
190 {
191 if (missInfo != SPELL_MISS_IMMUNE)
192 return;
193
194 if (Unit* target = GetHitUnit())
195 {
196 // Casting Banish on a banished target will remove applied aura
197 if (Aura * banishAura = target->GetAura(GetSpellInfo()->Id, GetCaster()->GetGUID()))
198 banishAura->Remove();
199 }
200 }
201
206};
207
208// 267211 - Bilescourge Bombers
229
231{
232public:
233 explicit BilescourgeBombersEvent(Unit* caster, Position srcPos, Position destPos) : _caster(caster), _srcPos(srcPos), _destPos(destPos) { }
234
241
242private:
246};
247
248// 15141 - Bilescourge Bombers
250{
251 static constexpr uint8 MAX_TICKS = 12;
252
254
255 void OnCreate(Spell const* /*creatingSpell*/) override
256 {
257 Unit* caster = at->GetCaster();
258 if (!caster)
259 return;
260
262 if (!targetAt)
263 return;
264
265 int32 tickRate = at->GetTotalDuration() / MAX_TICKS;
266
267 for (uint8 i = 1; i <= 12; i++)
268 caster->m_Events.AddEventAtOffset(new BilescourgeBombersEvent(caster, at->GetPosition(), targetAt->GetPosition()), Milliseconds(tickRate * i));
269 }
270};
271
272// 111400 - Burning Rush
274{
275 bool Validate(SpellInfo const* spellInfo) override
276 {
277 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
278 }
279
281 {
282 Unit* caster = GetCaster();
283
284 if (caster->GetHealthPct() <= GetEffectInfo(EFFECT_1).CalcValue(caster))
285 {
288 }
289
290 return SPELL_CAST_OK;
291 }
292
297};
298
299// 111400 - Burning Rush
301{
302 void PeriodicTick(AuraEffect const* aurEff)
303 {
304 if (GetTarget()->GetHealthPct() <= aurEff->GetAmount())
305 {
307 Remove();
308 }
309 }
310
315};
316
317// 152108 - Cataclysm
338
339// 228312 - Immolate (attached to 157736 - Immolate and 445474 - Wither)
341{
342 bool Validate(SpellInfo const* /*spellInfo*/) override
343 {
345 }
346
347 void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
348 {
349 if (Unit* caster = GetCaster())
352 .SpellValueOverrides = { { SPELLVALUE_DURATION, GetDuration() } }
353 });
354 }
355
356 void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
357 {
358 Unit* caster = GetCaster();
359 if (!caster)
360 return;
361
362 Unit* validTarget = nullptr;
363 Trinity::UnitAuraCheck check(true, GetId(), caster->GetGUID());
364 Trinity::UnitSearcher searcher(caster, validTarget, check);
365 Cell::VisitAllObjects(caster, searcher, 100.f);
366
367 if (!validTarget)
369 }
370
376};
377
378// 196447 - Channel Demonfire
400
401// 196449 - Channel Demonfire
431
432// 116858 - Chaos Bolt
434{
435 bool Load() override
436 {
437 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
438 }
439
440 void HandleDummy(SpellEffIndex /*effIndex*/)
441 {
442 SetHitDamage(GetHitDamage() + CalculatePct(GetHitDamage(), GetCaster()->ToPlayer()->m_activePlayerData->SpellCritPercentage));
443 }
444
445 void CalcCritChance(Unit const* /*victim*/, float& critChance)
446 {
447 critChance = 100.0f;
448 }
449
455};
456
457// 77220 - Mastery: Chaotic Energies
459{
460 void HandleAbsorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
461 {
462 AuraEffect const* effect1 = GetEffect(EFFECT_1);
463 if (!effect1 || !GetTargetApplication()->HasEffect(EFFECT_1))
464 {
466 return;
467 }
468
469 // You take ${$s2/3}% reduced damage
470 float damageReductionPct = effect1->GetAmount() / 3;
471 // plus a random amount of up to ${$s2/3}% additional reduced damage
472 damageReductionPct += frand(0.0f, damageReductionPct);
473
474 absorbAmount = CalculatePct(dmgInfo.GetDamage(), damageReductionPct);
475 }
476
481};
482
483// 17962 - Conflagrate
504
505// 6201 - Create Healthstone
507{
508 bool Validate(SpellInfo const* /*spellInfo*/) override
509 {
511 }
512
513 bool Load() override
514 {
515 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
516 }
517
522
527};
528
529// 108416 - Dark Pact
531{
532 bool Validate(SpellInfo const* spellInfo) override
533 {
534 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 }, { spellInfo->Id, EFFECT_2 } });
535 }
536
537 void CalculateAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& canBeRecalculated)
538 {
539 canBeRecalculated = false;
540 if (Unit* caster = GetCaster())
541 {
542 float extraAmount = caster->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()) * 2.5f;
543 uint64 absorb = caster->CountPctFromCurHealth(GetEffectInfo(EFFECT_1).CalcValue(caster));
544 caster->SetHealth(caster->GetHealth() - absorb);
545 amount = CalculatePct(absorb, GetEffectInfo(EFFECT_2).CalcValue(caster)) + extraAmount;
546 }
547 }
548
553};
554
556{
557 static void HandleDamageOrHealingCalculation(Unit const* caster, Unit const* target, float& pctMod, SpellEffIndex inreaseEffect, SpellEffIndex healthLimitEffect)
558 {
559 Aura const* deathsEmbrace = caster->GetAura(SPELL_WARLOCK_DEATHS_EMBRACE, ObjectGuid::Empty, ObjectGuid::Empty, 1 << inreaseEffect | 1 << healthLimitEffect);
560 if (!deathsEmbrace)
561 return;
562
563 if (!target->HealthBelowPct(deathsEmbrace->GetEffect(healthLimitEffect)->GetAmount()))
564 return;
565
566 AddPct(pctMod, deathsEmbrace->GetEffect(inreaseEffect)->GetAmount());
567 }
568};
569
570// Called by 324540 - Malefic Rapture
572{
573 bool Validate(SpellInfo const* /*spellInfo*/) override
574 {
576 }
577
578 void HandleDamageCalculation(SpellEffectInfo const& /*spellEffectInfo*/, Unit const* victim, int32 const& /*damage*/, int32 const& /*flatMod*/, float& pctMod) const
579 {
581 }
582
587};
588
589// Called by 980 - Agony, 146739 - Corruption and 316099 - Unstable Affliction
591{
592 bool Validate(SpellInfo const* /*spellInfo*/) override
593 {
595 }
596
597 void CalculateDamage(AuraEffect const* /*aurEff*/, Unit const* victim, int32& /*damage*/, int32& /*flatMod*/, float& pctMod) const
598 {
599 if (Unit const* caster = GetCaster())
601 }
602
607};
608
609// 234153 - Drain Life
611{
612 bool Validate(SpellInfo const* /*spellInfo*/) override
613 {
615 }
616
617 void CalculateHeal(AuraEffect const* /*aurEff*/, Unit const* victim, int32& /*damage*/, int32& /*flatMod*/, float& pctMod) const
618 {
619 Unit const* caster = GetCaster();
620 if (!caster)
621 return;
622
623 if (caster != victim) // check who is being targeted, this hook is called for both damage and healing of PERIODIC_LEECH
624 return;
625
627 }
628
633};
634
635// 264178 - Demonbolt
656
657// 48018 - Demonic Circle: Summon
659{
660 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode)
661 {
662 // If effect is removed by expire remove the summoned demonic circle too.
663 if (!(mode & AURA_EFFECT_HANDLE_REAPPLY))
664 GetTarget()->RemoveGameObject(GetId(), true);
665
667 }
668
669 void HandleDummyTick(AuraEffect const* /*aurEff*/)
670 {
671 if (GameObject* circle = GetTarget()->GetGameObject(GetId()))
672 {
673 // Here we check if player is in demonic circle teleport range, if so add
674 // WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT.
675 // If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST.
676
677 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT, GetCastDifficulty());
678
679 if (GetTarget()->IsWithinDist(circle, spellInfo->GetMaxRange(true)))
680 {
683 }
684 else
686 }
687 }
688
694};
695
696// 48020 - Demonic Circle: Teleport
698{
699 void HandleTeleport(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
700 {
701 if (Player* player = GetTarget()->ToPlayer())
702 {
703 if (GameObject* circle = player->GetGameObject(SPELL_WARLOCK_DEMONIC_CIRCLE_SUMMON))
704 {
705 player->NearTeleportTo(circle->GetPositionX(), circle->GetPositionY(), circle->GetPositionZ(), circle->GetOrientation());
706 player->RemoveMovementImpairingAuras(false);
707 }
708 }
709 }
710
715};
716
717// 67518, 19505 - Devour Magic
719{
720 bool Validate(SpellInfo const* spellInfo) override
721 {
723 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
724 }
725
727 {
728 Unit* caster = GetCaster();
731 args.AddSpellBP0(GetEffectInfo(EFFECT_1).CalcValue(caster));
732
733 caster->CastSpell(caster, SPELL_WARLOCK_DEVOUR_MAGIC_HEAL, args);
734
735 // Glyph of Felhunter
736 if (Unit* owner = caster->GetOwner())
737 if (owner->GetAura(SPELL_WARLOCK_GLYPH_OF_DEMON_TRAINING))
738 owner->CastSpell(owner, SPELL_WARLOCK_DEVOUR_MAGIC_HEAL, args);
739 }
740
745};
746
747// 603 - Doom
749{
750 bool Validate(SpellInfo const* /*spellInfo*/) override
751 {
753 }
754
755 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
756 {
757 if (Unit* caster = GetCaster())
758 caster->CastSpell(caster, SPELL_WARLOCK_DOOM_ENERGIZE, true);
759 }
760
765};
766
767// 198590 - Drain Soul
769{
770 bool Validate(SpellInfo const* spellInfo) override
771 {
773 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } });
774 }
775
776 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
777 {
778 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
779 return;
780
781 if (Unit* caster = GetCaster())
782 caster->CastSpell(caster, SPELL_WARLOCK_DRAIN_SOUL_ENERGIZE, true);
783 }
784
785 void CalculateDamage(AuraEffect const* /*aurEff*/, Unit const* victim, int32& /*damage*/, int32& /*flatMod*/, float& pctMod) const
786 {
787 if (victim->HealthBelowPct(GetEffectInfo(EFFECT_2).CalcValue(GetCaster())))
788 AddPct(pctMod, GetEffectInfo(EFFECT_1).CalcValue(GetCaster()));
789 }
790
796};
797
798// 48181 - Haunt
800{
801 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
802 {
803 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
804 if (Unit* caster = GetCaster())
805 caster->GetSpellHistory()->ResetCooldown(GetId(), true);
806 }
807
812};
813
814// 755 - Health Funnel
816{
817 void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
818 {
819 Unit* caster = GetCaster();
820 if (!caster)
821 return;
822
823 Unit* target = GetTarget();
828 }
829
836
837 void OnPeriodic(AuraEffect const* aurEff)
838 {
839 Unit* caster = GetCaster();
840 if (!caster)
841 return;
843 uint32 damage = caster->CountPctFromMaxHealth(aurEff->GetBaseAmount());
844
845 if (Player* modOwner = caster->GetSpellModOwner())
846 modOwner->ApplySpellMod(GetSpellInfo(), SpellModOp::PowerCost0, damage);
847
848 SpellNonMeleeDamage damageInfo(caster, caster, GetSpellInfo(), GetAura()->GetSpellVisual(), GetSpellInfo()->SchoolMask, GetAura()->GetCastId());
849 damageInfo.periodicLog = true;
850 damageInfo.damage = damage;
851 caster->DealSpellDamage(&damageInfo, false);
852 caster->SendSpellNonMeleeDamageLog(&damageInfo);
853 }
854
861};
862
863// 6262 - Healthstone
865{
867 {
868 int32 heal = int32(CalculatePct(GetCaster()->GetCreateHealth(), GetHitHeal()));
869 SetHitHeal(heal);
870 }
871
876};
877
878// 348 - Immolate
896
897// Called by 316099 - Unstable Affliction
898// 459376 - Perpetual Unstability
900{
905
906 void TriggerExplosion() const
907 {
908 Unit* caster = GetCaster();
909 Unit* target = GetHitUnit();
910
911 if (AuraEffect const* perpetualUnstability = caster->GetAuraEffect(SPELL_WARLOCK_PERPETUAL_UNSTABILITY_TALENT, EFFECT_0))
912 {
913 if (Aura const* unstableAfflictionAura = target->GetAura(GetSpellInfo()->Id, caster->GetGUID()))
914 {
915 FloatSeconds maxUnstableAfflictionDuration(perpetualUnstability->GetAmount());
916 if (Milliseconds(unstableAfflictionAura->GetDuration()) <= maxUnstableAfflictionDuration)
919 .SetTriggeringSpell(GetSpell()));
920 }
921 }
922 }
923
928};
929
930// 387095 - Pyrogenics
932{
933 bool Validate(SpellInfo const* /*spellInfo*/) override
934 {
936 }
937
938 void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& procInfo) const
939 {
941 .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
942 .TriggeringAura = aurEff
943 });
944 }
945
950};
951
952// 5740 - Rain of Fire
955{
956 void HandleDummyTick(AuraEffect const* /*aurEff*/)
957 {
958 std::vector<AreaTrigger*> rainOfFireAreaTriggers = GetTarget()->GetAreaTriggers(SPELL_WARLOCK_RAIN_OF_FIRE);
959 GuidUnorderedSet targetsInRainOfFire;
960
961 for (AreaTrigger* rainOfFireAreaTrigger : rainOfFireAreaTriggers)
962 {
963 GuidUnorderedSet const& insideTargets = rainOfFireAreaTrigger->GetInsideUnits();
964 targetsInRainOfFire.insert(insideTargets.begin(), insideTargets.end());
965 }
966
967 for (ObjectGuid insideTargetGuid : targetsInRainOfFire)
968 if (Unit* insideTarget = ObjectAccessor::GetUnit(*GetTarget(), insideTargetGuid))
969 if (!GetTarget()->IsFriendlyTo(insideTarget))
971 }
972
977};
978
979// 366330 - Random Sayaad
981{
982 bool Validate(SpellInfo const* /*spellInfo*/) override
983 {
984 return ValidateSpellInfo
985 ({
988 });
989 }
990
991 void HandleDummy(SpellEffIndex /*effIndex*/)
992 {
993 Unit* caster = GetCaster();
994
997
998 Player* player = GetCaster()->ToPlayer();
999 if (!player)
1000 return;
1001
1002 if (Pet* pet = player->GetPet())
1003 {
1004 if (pet->IsPetSayaad())
1005 pet->DespawnOrUnsummon();
1006 }
1007 }
1008
1013};
1014
1015// Called by 17962 - Conflagrate
1041
1042// 366323 - Strengthen Pact - Succubus
1043// 366325 - Strengthen Pact - Incubus
1044// 366222 - Summon Sayaad
1046{
1047 bool Validate(SpellInfo const* /*spellInfo*/) override
1048 {
1050 }
1051
1052 // Note: this is a special case in which the warlock's minion pet must also cast Summon Disorientation at the beginning since this is only handled by SPELL_EFFECT_SUMMON_PET in Spell::CheckCast.
1053 void OnPrecast() override
1054 {
1055 Player* player = GetCaster()->ToPlayer();
1056 if (!player)
1057 return;
1058
1059 if (Pet* pet = player->GetPet())
1061 .SetOriginalCaster(pet->GetGUID())
1063 }
1064
1065 void Register() override
1066 {
1067 }
1068};
1069
1070// 6358 - Seduction (Special Ability)
1072{
1073 bool Validate(SpellInfo const* /*spellInfo*/) override
1074 {
1076 }
1077
1079 {
1080 Unit* caster = GetCaster();
1081 if (Unit* target = GetHitUnit())
1082 {
1083 if (caster->GetOwner() && caster->GetOwner()->HasAura(SPELL_WARLOCK_GLYPH_OF_SUCCUBUS))
1084 {
1085 target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE, ObjectGuid::Empty, target->GetAura(SPELL_PRIEST_SHADOW_WORD_DEATH)); // SW:D shall not be removed.
1086 target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT);
1087 target->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH);
1088 }
1089 }
1090 }
1091
1096};
1097
1098// 27285 - Seed of Corruption (damage)
1100{
1101 bool Validate(SpellInfo const* /*spellInfo*/) override
1102 {
1104 }
1105
1106 void HandleHit(SpellEffIndex /*effIndex*/) const
1107 {
1109 }
1110
1115};
1116
1118{
1120 {
1121 target = nullptr;
1122 }
1123
1124 void SelectTarget(std::list<WorldObject*>& targets) const
1125 {
1126 if (targets.size() < 2)
1127 return;
1128
1129 if (!GetExplTargetUnit()->HasAura(GetSpellInfo()->Id, GetCaster()->GetGUID()))
1130 {
1131 // primary target doesn't have seed, keep it
1132 targets.clear();
1133 targets.push_back(GetExplTargetUnit());
1134 }
1135 else
1136 {
1137 // primary target has seed, select random other target with no seed
1138 targets.remove_if(Trinity::UnitAuraCheck(true, GetSpellInfo()->Id, GetCaster()->GetGUID()));
1139 if (!targets.empty())
1141 else
1142 targets.push_back(GetExplTargetUnit());
1143 }
1144 }
1145
1152};
1153
1154// 27243 - Seed of Corruption
1156{
1157 bool Validate(SpellInfo const* /*spellInfo*/) override
1158 {
1160 }
1161
1162 void OnPeriodic(AuraEffect const* aurEff) const
1163 {
1164 if (Unit* caster = GetCaster())
1165 caster->CastSpell(GetTarget(), SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE, aurEff);
1166 }
1167
1168 void CalculateBuffer(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/) const
1169 {
1170 Unit* caster = GetCaster();
1171 if (!caster)
1172 return;
1173
1174 amount = caster->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()) * GetEffectInfo(EFFECT_0).CalcValue(caster) / 100;
1175 }
1176
1177 void HandleProc(AuraEffect* aurEff, ProcEventInfo const& eventInfo)
1178 {
1180
1181 DamageInfo const* damageInfo = eventInfo.GetDamageInfo();
1182 if (!damageInfo)
1183 return;
1184
1185 Unit* caster = GetCaster();
1186 if (!caster)
1187 return;
1188
1189 if (!damageInfo->GetAttacker() || damageInfo->GetAttacker() != caster)
1190 return;
1191
1192 // other seed explosions detonate this instantly, no matter what damage amount is
1193 if (!damageInfo->GetSpellInfo() || damageInfo->GetSpellInfo()->Id != SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE)
1194 {
1195 SpellEffectValue amount = aurEff->GetAmount() - damageInfo->GetDamage();
1196 if (amount > 0)
1197 {
1198 aurEff->SetAmount(amount);
1199 if (!GetTarget()->HealthBelowPctDamaged(1, damageInfo->GetDamage()))
1200 return;
1201 }
1202 }
1203
1204 Remove();
1205
1207 }
1208
1215};
1216
1217// 32863 - Seed of Corruption
1218// 36123 - Seed of Corruption
1219// 38252 - Seed of Corruption
1220// 39367 - Seed of Corruption
1221// 44141 - Seed of Corruption
1222// 70388 - Seed of Corruption
1223// Monster spells, triggered only on amount drop (not on death)
1225{
1226 bool Validate(SpellInfo const* /*spellInfo*/) override
1227 {
1229 }
1230
1231 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1232 {
1234 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
1235 if (!damageInfo || !damageInfo->GetDamage())
1236 return;
1237
1238 SpellEffectValue amount = aurEff->GetAmount() - damageInfo->GetDamage();
1239 if (amount > 0)
1240 {
1241 aurEff->SetAmount(amount);
1242 return;
1243 }
1244
1245 Remove();
1246
1247 Unit* caster = GetCaster();
1248 if (!caster)
1249 return;
1250
1252 }
1253
1258};
1259
1260// 17877 - Shadowburn
1262{
1263 bool Validate(SpellInfo const* spellInfo) override
1264 {
1266 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_3 } });
1267 }
1268
1269 void HandleEnergize() const
1270 {
1271 if (GetHitUnit()->IsAlive())
1272 return;
1273
1274 // killing target with current spell doesn't apply the aura (apply/remove scripts don't execute)
1275 // but we can use the fact that it still gets created and immediately marked as removed to detect that case
1276 Aura* hitAura = GetHitAura(false, true);
1277 if (!hitAura || !hitAura->IsRemoved())
1278 return;
1279
1281 }
1282
1283 void CalcCritChance(Unit const* victim, float& critChance) const
1284 {
1285 if (victim->HealthBelowPct(GetEffectInfo(EFFECT_3).CalcValue(GetCaster())))
1286 critChance += GetEffectInfo(EFFECT_2).CalcValue(GetCaster());
1287 }
1288
1294
1295public:
1296 static void TryEnergize(Player* caster, Unit const* target, SpellInfo const* spellInfo,
1297 Spell const* triggeringSpell, AuraEffect const* triggeringAura)
1298 {
1299 if (!caster)
1300 return;
1301
1302 if (caster->isHonorOrXPTarget(target))
1303 {
1306 .TriggeringSpell = triggeringSpell,
1307 .TriggeringAura = triggeringAura
1308 });
1309
1310 caster->GetSpellHistory()->RestoreCharge(spellInfo->ChargeCategoryId);
1311 }
1312 }
1313};
1314
1330
1331// 686 - Shadow Bolt
1333{
1334 bool Validate(SpellInfo const* /*spellInfo*/) override
1335 {
1337 }
1338
1343
1348};
1349
1350// 422054 - Shadow Invocation
1352{
1353 void HandleProc(ProcEventInfo& eventInfo)
1354 {
1355 Unit* caster = eventInfo.GetActor();
1356 Unit* target = eventInfo.GetActionTarget();
1357 caster->m_Events.AddEventAtOffset(new BilescourgeBombersEvent(caster, caster->GetPosition(), target->GetPosition()), 500ms);
1358 }
1359
1364};
1365
1366// 452999 - Siphon Life
1368{
1369 bool Validate(SpellInfo const* /*spellInfo*/) override
1370 {
1372 }
1373
1374 void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo) const
1375 {
1376 DamageInfo const* damageInfo = eventInfo.GetDamageInfo();
1377 if (!damageInfo || !damageInfo->GetDamage())
1378 return;
1379
1380 Unit* caster = GetTarget();
1382 .AddSpellMod(SPELLVALUE_BASE_POINT0, CalculatePct(damageInfo->GetDamage(), aurEff->GetAmount())));
1383 }
1384
1389};
1390
1391// 6353 - Soul Fire
1428
1429// 86121 - Soul Swap
1453
1454// 86211 - Soul Swap Override - Also acts as a dot container
1456{
1458 void Register() override { }
1459
1460public:
1461 void AddDot(uint32 id) { _dotList.push_back(id); }
1462 std::list<uint32> const GetDotList() const { return _dotList; }
1464 void SetOriginalSwapSource(Unit* victim) { _swapCaster = victim; }
1465
1466private:
1467 std::list<uint32> _dotList;
1468 Unit* _swapCaster = nullptr;
1469};
1470
1473{
1474 void HandleHit(SpellEffIndex /*effIndex*/)
1475 {
1476 Unit* swapVictim = GetCaster();
1477 Unit* warlock = GetHitUnit();
1478 if (!warlock || !swapVictim)
1479 return;
1480
1481 Unit::AuraApplicationMap const& appliedAuras = swapVictim->GetAppliedAuras();
1482 spell_warl_soul_swap_override* swapSpellScript = nullptr;
1483 if (Aura* swapOverrideAura = warlock->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
1484 swapSpellScript = swapOverrideAura->GetScript<spell_warl_soul_swap_override>();
1485
1486 if (!swapSpellScript)
1487 return;
1488
1489 flag128 classMask = GetEffectInfo().SpellClassMask;
1490
1491 for (Unit::AuraApplicationMap::const_iterator itr = appliedAuras.begin(); itr != appliedAuras.end(); ++itr)
1492 {
1493 SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo();
1494 if (itr->second->GetBase()->GetCaster() == warlock)
1495 if (spellProto->SpellFamilyName == SPELLFAMILY_WARLOCK && (spellProto->SpellFamilyFlags & classMask))
1496 swapSpellScript->AddDot(itr->first);
1497 }
1498
1499 swapSpellScript->SetOriginalSwapSource(swapVictim);
1500 }
1501
1506};
1507
1508// 86213 - Soul Swap Exhale
1510{
1511 bool Validate(SpellInfo const* /*spellInfo*/) override
1512 {
1514 }
1515
1517 {
1518 Unit* currentTarget = GetExplTargetUnit();
1519 Unit* swapTarget = nullptr;
1520 if (Aura const* swapOverride = GetCaster()->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
1521 if (spell_warl_soul_swap_override* swapScript = swapOverride->GetScript<spell_warl_soul_swap_override>())
1522 swapTarget = swapScript->GetOriginalSwapSource();
1523
1524 // Soul Swap Exhale can't be cast on the same target than Soul Swap
1525 if (swapTarget && currentTarget && swapTarget == currentTarget)
1527
1528 return SPELL_CAST_OK;
1529 }
1530
1531 void OnEffectHit(SpellEffIndex /*effIndex*/)
1532 {
1535
1536 std::list<uint32> dotList;
1537 Unit* swapSource = nullptr;
1538 if (Aura const* swapOverride = GetCaster()->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
1539 {
1540 spell_warl_soul_swap_override* swapScript = swapOverride->GetScript<spell_warl_soul_swap_override>();
1541 if (!swapScript)
1542 return;
1543 dotList = swapScript->GetDotList();
1544 swapSource = swapScript->GetOriginalSwapSource();
1545 }
1546
1547 if (dotList.empty())
1548 return;
1549
1550 for (std::list<uint32>::const_iterator itr = dotList.begin(); itr != dotList.end(); ++itr)
1551 {
1552 GetCaster()->AddAura(*itr, GetHitUnit());
1553 if (!hasGlyph && swapSource)
1554 swapSource->RemoveAurasDueToSpell(*itr);
1555 }
1556
1557 // Remove Soul Swap Exhale buff
1559
1560 if (hasGlyph) // Add a cooldown on Soul Swap if caster has the glyph
1562 }
1563
1569};
1570
1571// 29858 - Soulshatter
1573{
1574 bool Validate(SpellInfo const* /*spellInfo*/) override
1575 {
1577 }
1578
1579 void HandleDummy(SpellEffIndex /*effIndex*/)
1580 {
1581 Unit* caster = GetCaster();
1582 if (Unit* target = GetHitUnit())
1583 if (target->GetThreatManager().IsThreatenedBy(caster, true))
1584 caster->CastSpell(target, SPELL_WARLOCK_SOULSHATTER_EFFECT, true);
1585 }
1586
1591};
1592
1593// 366323 - Strengthen Pact - Succubus
1595{
1596 bool Validate(SpellInfo const* /*spellInfo*/) override
1597 {
1598 return ValidateSpellInfo
1599 ({
1602 });
1603 }
1604
1605 void HandleDummy(SpellEffIndex /*effIndex*/)
1606 {
1607 Unit* caster = GetCaster();
1608
1611 }
1612
1617};
1618
1619// 366325 - Strengthen Pact - Incubus
1621{
1622 bool Validate(SpellInfo const* /*spellInfo*/) override
1623 {
1624 return ValidateSpellInfo
1625 ({
1628 });
1629 }
1630
1631 void HandleDummy(SpellEffIndex /*effIndex*/)
1632 {
1633 Unit* caster = GetCaster();
1634
1637 }
1638
1643};
1644
1645// 366222 - Summon Sayaad
1647{
1648 bool Validate(SpellInfo const* /*spellInfo*/) override
1649 {
1650 return ValidateSpellInfo
1651 ({
1654 });
1655 }
1656
1661
1666};
1667
1668// 37377 - Shadowflame
1669// 39437 - Shadowflame Hellfire and RoF
1670template <uint32 Trigger>
1672{
1673 bool Validate(SpellInfo const* /*spellInfo*/) override
1674 {
1675 return ValidateSpellInfo({ Trigger });
1676 }
1677
1678 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1679 {
1681 Unit* caster = eventInfo.GetActor();
1682 caster->CastSpell(caster, Trigger, aurEff);
1683 }
1684
1689};
1690
1691// 316099 - Unstable Affliction
1693{
1698
1699 void HandleDispel(DispelInfo const* dispelInfo) const
1700 {
1701 Unit* caster = GetCaster();
1702 if (!caster)
1703 return;
1704
1705 AuraEffect const* removedEffect = GetEffect(EFFECT_1);
1706 if (!removedEffect)
1707 return;
1708
1709 SpellEffectValue damage = GetEffectInfo(EFFECT_0).CalcValue(caster, nullptr, GetUnitOwner()) / 100.0 * *removedEffect->CalculateEstimatedAmount(caster, removedEffect->GetAmount());
1711 .AddSpellMod(SPELLVALUE_BASE_POINT0, damage)
1713 }
1714
1715 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
1716 {
1717 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
1718 return;
1719
1721 }
1722
1728};
1729
1730// 278350 - Vile Taint
1758
1759// Called by 980 - Agony
1760// 453034 - Volatile Agony
1762{
1763 bool Validate(SpellInfo const* /*spellInfo*/) override
1764 {
1766 }
1767
1768 void TriggerExplosion() const
1769 {
1770 Unit* caster = GetCaster();
1771 Unit* target = GetHitUnit();
1772
1773 if (AuraEffect const* volatileAgony = caster->GetAuraEffect(SPELL_WARLOCK_VOLATILE_AGONY_TALENT, EFFECT_0))
1774 {
1775 if (Aura const* agonyAura = target->GetAura(GetSpellInfo()->Id, caster->GetGUID()))
1776 {
1777 FloatSeconds maxAgonyDuration(volatileAgony->GetAmount());
1778 if (Milliseconds(agonyAura->GetDuration()) <= maxAgonyDuration)
1781 .SetTriggeringSpell(GetSpell()));
1782 }
1783 }
1784 }
1785
1790};
1791
1793{
1850}
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
uint32_t uint32
Definition Define.h:154
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:24
std::chrono::duration< double, Seconds::period > FloatSeconds
Definition Duration.h:29
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:28
std::unordered_set< ObjectGuid > GuidUnorderedSet
Definition ObjectGuid.h:435
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
constexpr uint32 PET_SUMMONING_DISORIENTATION
Definition PetDefines.h:142
float frand(float min, float max)
Definition Random.cpp:55
bool roll_chance(T chance)
Definition Random.h:55
#define RegisterSpellAndAuraScriptPair(script_1, script_2)
Definition ScriptMgr.h:1381
#define RegisterAreaTriggerAI(ai_name)
Definition ScriptMgr.h:1428
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
#define RegisterSpellScriptWithArgs(spell_script, script_name,...)
Definition ScriptMgr.h:1382
SpellEffIndex
@ EFFECT_3
@ EFFECT_1
@ EFFECT_0
@ EFFECT_2
SpellMissInfo
@ SPELL_MISS_IMMUNE
@ TARGET_UNIT_DEST_AREA_ENEMY
@ TARGET_UNIT_TARGET_ENEMY
@ SPELL_EFFECT_CREATE_AREATRIGGER
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_DISPEL
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ SPELL_EFFECT_APPLY_AURA
@ SPELL_CUSTOM_ERROR_YOU_DONT_HAVE_ENOUGH_HEALTH
SpellCastResult
@ SPELL_FAILED_CUSTOM_ERROR
@ SPELL_FAILED_BAD_TARGETS
@ SPELL_CAST_OK
#define EFFECT_ALL
@ SPELLFAMILY_WARLOCK
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAPPLY
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_BY_DEATH
@ SPELL_AURA_MOD_SCHOOL_MASK_DAMAGE_FROM_CASTER
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_OBS_MOD_HEALTH
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
@ SPELL_AURA_DUMMY
@ SPELL_AURA_ADD_FLAT_MODIFIER_BY_SPELL_LABEL
@ SPELL_AURA_MECHANIC_IMMUNITY
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_PERIODIC_LEECH
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELLVALUE_DURATION
double SpellEffectValue
This is a double instead of float to be able to store full range of int32.
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
@ TRIGGERED_IGNORE_CAST_IN_PROGRESS
Will not check if a current cast is in progress.
@ TRIGGERED_IGNORE_POWER_COST
Will ignore power and reagent cost.
@ TRIGGERED_IGNORE_GCD
Will ignore GCD.
@ TRIGGERED_DONT_REPORT_CAST_ERROR
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ SPELLVALUE_BASE_POINT0
#define sSpellMgr
Definition SpellMgr.h:812
#define AuraProcFn(F)
#define SpellOnCalcCritChanceFn(F)
#define BeforeSpellHitFn(F)
#define SpellObjectTargetSelectFn(F, I, N)
#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 AuraEffectCalcHealingFn(F, I, N)
#define SpellCalcDamageFn(F)
#define SpellCastFn(F)
#define AuraEffectAbsorbFn(F, I)
#define AuraEffectApplyFn(F, I, N, M)
#define SpellHitFn(F)
#define AuraEffectCalcDamageFn(F, I, N)
#define AuraDispelFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
T AddPct(T &base, U pct)
Definition Util.h:85
T CalculatePct(T base, U pct)
Definition Util.h:72
AreaTrigger *const at
int32 GetTotalDuration() const
Unit * GetCaster() const
void SetAmount(SpellEffectValue amount)
SpellEffectValue GetBaseAmount() const
static Optional< SpellEffectValue > CalculateEstimatedAmount(Unit const *caster, Unit *target, SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, SpellEffectValue amount, uint8 stack, AuraEffect const *aurEff)
SpellEffectValue GetAmount() const
HookList< EffectCalcDamageAndHealingHandler > DoEffectCalcDamageAndHealing
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
int32 GetDuration() const
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectPeriodicHandler > OnEffectPeriodic
SpellInfo const * GetSpellInfo() const
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Unit * GetCaster() const
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
AuraEffect * GetEffect(uint8 effIndex) const
HookList< EffectAbsorbHandler > OnEffectAbsorb
Aura * GetAura() const
Unit * GetTarget() const
Difficulty GetCastDifficulty() const
HookList< EffectApplyHandler > OnEffectRemove
HookList< AuraDispelHandler > AfterDispel
HookList< EffectProcHandler > OnEffectProc
Unit * GetUnitOwner() const
HookList< AuraProcHandler > OnProc
bool HasEffect(uint8 effIndex) const
HookList< EffectApplyHandler > OnEffectApply
uint32 GetId() const
bool IsRemoved() const
Definition SpellAuras.h:254
AuraEffect * GetEffect(uint32 index) const
void SetDuration(int32 duration, bool withMods=false)
void SetMaxDuration(int32 duration)
Definition SpellAuras.h:218
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
TypeID GetTypeId() const
Definition BaseEntity.h:166
bool Execute(uint64, uint32) override
BilescourgeBombersEvent(Unit *caster, Position srcPos, Position destPos)
Unit * GetAttacker() const
Definition Unit.h:446
SpellInfo const * GetSpellInfo() const
Definition Unit.h:448
uint32 GetDamage() const
Definition Unit.h:452
WorldObject * GetDispeller() const
Definition Unit.h:396
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
static ObjectGuid const Empty
Definition ObjectGuid.h:314
Player * ToPlayer()
Definition Object.h:126
Definition Pet.h:40
Pet * GetPet() const
Definition Player.cpp:22060
bool isHonorOrXPTarget(Unit const *victim) const
Definition Player.cpp:26354
Unit * GetActionTarget() const
Definition Unit.h:500
DamageInfo * GetDamageInfo() const
Definition Unit.h:511
Unit * GetActor() const
Definition Unit.h:499
SpellEffectValue CalcValue(WorldObject const *caster=nullptr, SpellEffectValue const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
flag128 SpellClassMask
Definition SpellInfo.h:235
void RestoreCharge(uint32 chargeCategoryId)
float GetMaxRange(bool positive=false, WorldObject const *caster=nullptr, Spell *spell=nullptr) const
uint32 const Id
Definition SpellInfo.h:328
flag128 SpellFamilyFlags
Definition SpellInfo.h:415
uint32 ChargeCategoryId
Definition SpellInfo.h:420
uint32 SpellFamilyName
Definition SpellInfo.h:414
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
static bool ValidateSpellEffect(std::initializer_list< std::pair< uint32, SpellEffIndex > > effects)
HookList< DamageAndHealingCalcHandler > CalcDamage
HookList< CastHandler > AfterCast
HookList< CheckCastHandler > OnCheckCast
Aura * GetHitAura(bool dynObjAura=false, bool withRemoved=false) const
int32 GetHitDamage() const
Unit * GetCaster() const
HookList< HitHandler > AfterHit
HookList< HitHandler > OnHit
HookList< EffectHandler > OnEffectHit
Unit * GetHitUnit() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectTargetSelectHandler > OnObjectTargetSelect
void SetCustomCastResultMessage(SpellCustomErrors result)
Spell * GetSpell() const
HookList< EffectHandler > OnEffectLaunchTarget
HookList< BeforeHitHandler > BeforeHit
int32 GetHitHeal() const
void SetHitDamage(int32 damage)
HookList< EffectHandler > OnEffectSuccessfulDispel
HookList< OnCalcCritChanceHandler > OnCalcCritChance
void SetHitHeal(int32 heal)
Unit * GetExplTargetUnit() const
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition Spell.h:277
Definition Unit.h:635
void RemoveGameObject(GameObject *gameObj, bool del)
Definition Unit.cpp:5378
float GetHealthPct() const
Definition Unit.h:796
uint64 CountPctFromMaxHealth(float pct) const
Definition Unit.h:797
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3828
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:645
void DealSpellDamage(SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
Definition Unit.cpp:1303
bool IsPvP() const
Definition Unit.h:886
Aura * AddAura(uint32 spellId, Unit *target)
Definition Unit.cpp:12249
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4604
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
Definition Unit.cpp:5540
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4700
bool HealthBelowPct(float pct) const
Definition Unit.h:792
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4804
SpellHistory * GetSpellHistory()
Definition Unit.h:1498
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1295
std::vector< AreaTrigger * > GetAreaTriggers(uint32 spellId) const
Definition Unit.cpp:5475
int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const
Definition Unit.cpp:7084
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
AreaTrigger * GetAreaTrigger(uint32 spellId) const
Definition Unit.cpp:5469
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
Unit * GetOwner() const
Definition Object.cpp:1598
void SendPlayOrphanSpellVisual(Position const &sourceLocation, ObjectGuid const &target, uint32 spellVisualId, float travelSpeed, bool speedAsTime=false, bool withSourceOrientation=false)
Definition Object.cpp:2256
Player * GetSpellModOwner() const
Definition Object.cpp:1641
EventProcessor m_Events
Definition Object.h:561
bool IsFriendlyTo(WorldObject const *target) const
Definition Object.cpp:2186
void HandleApply(SpellEffIndex) const
bool Validate(SpellInfo const *) override
void HandleAfterCast() const
void Register() override
bool Validate(SpellInfo const *) override
void HandleBanish(SpellMissInfo missInfo)
void Register() override
bool Validate(SpellInfo const *) override
void PeriodicTick(AuraEffect const *aurEff)
bool Validate(SpellInfo const *spellInfo) override
SpellCastResult CheckApplyAura()
bool Validate(SpellInfo const *) override
void Register() override
void HandleHit(SpellEffIndex) const
void RemoveEffect(AuraEffect const *, AuraEffectHandleModes) const
void ApplyEffect(AuraEffect const *, AuraEffectHandleModes) const
bool Validate(SpellInfo const *) override
void HandleEffectPeriodic(AuraEffect const *aurEff) const
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleDamage(SpellEffIndex) const
void FilterTargets(std::list< WorldObject * > &targets) const
void HandleDummy(SpellEffIndex)
void Register() override
void CalcCritChance(Unit const *, float &critChance)
void HandleAbsorb(AuraEffect *, DamageInfo &dmgInfo, uint32 &absorbAmount)
void HandleAfterCast(SpellEffIndex) const
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleScriptEffect(SpellEffIndex)
bool Validate(SpellInfo const *spellInfo) override
void Register() override
void CalculateAmount(AuraEffect const *, SpellEffectValue &amount, bool &canBeRecalculated)
void CalculateDamage(AuraEffect const *, Unit const *victim, int32 &, int32 &, float &pctMod) const
bool Validate(SpellInfo const *) override
void CalculateHeal(AuraEffect const *, Unit const *victim, int32 &, int32 &, float &pctMod) const
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleDamageCalculation(SpellEffectInfo const &, Unit const *victim, int32 const &, int32 const &, float &pctMod) const
void HandleAfterCast() const
bool Validate(SpellInfo const *) override
void Register() override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes mode)
void HandleDummyTick(AuraEffect const *)
void HandleTeleport(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *spellInfo) override
void OnSuccessfulDispel(SpellEffIndex)
bool Validate(SpellInfo const *) override
void Register() override
void HandleEffectPeriodic(AuraEffect const *)
void Register() override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void CalculateDamage(AuraEffect const *, Unit const *victim, int32 &, int32 &, float &pctMod) const
bool Validate(SpellInfo const *spellInfo) override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void Register() override
void ApplyEffect(AuraEffect const *, AuraEffectHandleModes)
void RemoveEffect(AuraEffect const *, AuraEffectHandleModes)
void OnPeriodic(AuraEffect const *aurEff)
bool Validate(SpellInfo const *) override
void Register() override
void HandleOnEffectHit(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo const &procInfo) const
bool Validate(SpellInfo const *) override
void Register() override
void HandleDummyTick(AuraEffect const *)
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex) const
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void Register() override
void HandleScriptEffect(SpellEffIndex)
void CalculateBuffer(AuraEffect const *, SpellEffectValue &amount, bool &) const
void HandleProc(AuraEffect *aurEff, ProcEventInfo const &eventInfo)
void OnPeriodic(AuraEffect const *aurEff) const
bool Validate(SpellInfo const *) override
void SelectTarget(std::list< WorldObject * > &targets) const
void RemoveVisualMissile(WorldObject *&target) const
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleHit(SpellEffIndex) const
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleProc(ProcEventInfo &eventInfo)
void RemoveEffect(AuraEffect const *aurEff, AuraEffectHandleModes) const
static void TryEnergize(Player *caster, Unit const *target, SpellInfo const *spellInfo, Spell const *triggeringSpell, AuraEffect const *triggeringAura)
void CalcCritChance(Unit const *victim, float &critChance) const
bool Validate(SpellInfo const *spellInfo) override
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo const &eventInfo) const
void HandleTriggers(SpellEffIndex) const
void Register() override
bool Validate(SpellInfo const *) override
Soul Swap Copy Spells - 92795 - Simply copies spell IDs.
bool Validate(SpellInfo const *) override
void OnEffectHit(SpellEffIndex)
void SetOriginalSwapSource(Unit *victim)
void Register() override
Forced to, pure virtual functions must have a body when linking.
std::list< uint32 > const GetDotList() const
bool Validate(SpellInfo const *) override
void Register() override
void HandleHit(SpellEffIndex)
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *aurEff, ProcEventInfo &eventInfo)
void HandleDispel(DispelInfo const *dispelInfo) const
bool Validate(SpellInfo const *) override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes) const
void HandleScriptEffect(SpellEffIndex) const
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:67
void AddSC_warlock_spell_scripts()
@ SPELL_GEN_REPLENISHMENT
@ SPELL_PRIEST_SHADOW_WORD_DEATH
@ SPELL_WARLOCK_CONFLAGRATE_ENERGIZE
@ SPELL_WARLOCK_SOUL_SWAP_MOD_COST
@ SPELL_WARLOCK_STRENGTHEN_PACT_SUCCUBUS
@ SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT
@ SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2
@ SPELL_WARLOCK_SIPHON_LIFE_HEAL
@ SPELL_WARLOCK_SOUL_SWAP_DOT_MARKER
@ SPELL_WARLOCK_RAIN_OF_FIRE
@ SPELL_WARLOCK_SHADOWFLAME
@ SPELL_WARLOCK_DEATHS_EMBRACE
@ SPELL_WARLOCK_GLYPH_OF_DEMON_TRAINING
@ SPELL_WARLOCK_CHANNEL_DEMONFIRE_SELECTOR
@ SPELL_WARLOCK_PYROGENICS_TALENT
@ SPELL_WARLOCK_RAIN_OF_FIRE_DAMAGE
@ SPELL_WARLOCK_GLYPH_OF_SOUL_SWAP
@ SPELL_WARLOCK_VILE_TAINT_DAMAGE
@ SPELL_WARLOCK_CONFLAGRATE_DEBUFF
@ SPELL_WARLOCK_DRAIN_SOUL_ENERGIZE
@ SPELL_WARLOCK_PERPETUAL_UNSTABILITY_TALENT
@ SPELL_WARLOCK_SHADOW_BOLT_ENERGIZE
@ SPELL_WARLOCK_DEMONIC_CIRCLE_SUMMON
@ SPELL_WARLOCK_BACKDRAFT_PROC
@ SPELL_WARLOCK_UNSTABLE_AFFLICTION_ENERGIZE
@ SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R1
@ SPELL_WARLOCK_CHANNEL_DEMONFIRE_DAMAGE
@ SPELL_WARLOCK_STRENGTHEN_PACT_INCUBUS
@ SPELL_WARLOCK_SOUL_SWAP_OVERRIDE
@ SPELL_WARLOCK_SOUL_FIRE_ENERGIZE
@ SPELL_WARLOCK_SUMMON_SUCCUBUS
@ SPELL_WARLOCK_SEED_OF_CORRUPTION_GENERIC
@ SPELL_WARLOCK_DEVOUR_MAGIC_HEAL
@ SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE
@ SPELL_WARLOCK_SUCCUBUS_PACT
@ SPELL_WARLOCK_SOULSHATTER_EFFECT
@ SPELL_WARLOCK_SOUL_SWAP_CD_MARKER
@ SPELL_WARLOCK_WITHER_PERIODIC
@ SPELL_WARLOCK_CURSE_OF_EXHAUSTION
@ SPELL_WARLOCK_CORRUPTION_DAMAGE
@ SPELL_WARLOCK_ROARING_BLAZE
@ SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST
@ SPELL_WARLOCK_CREATE_HEALTHSTONE
@ SPELL_WARLOCK_SUMMON_INCUBUS
@ SPELL_WARLOCK_SHADOWBURN_ENERGIZE
@ SPELL_WARLOCK_VOLATILE_AGONY_DAMAGE
@ SPELL_WARLOCK_CHANNEL_DEMONFIRE_ACTIVATOR
@ SPELL_WARLOCK_GLYPH_OF_SUCCUBUS
@ SPELL_WARLOCK_INCUBUS_PACT
@ SPELL_WARLOCK_UNSTABLE_AFFLICTION_DAMAGE
@ SPELL_WARLOCK_PERPETUAL_UNSTABILITY_DAMAGE
@ SPELL_WARLOCK_BACKDRAFT
@ SPELL_WARLOCK_FLAMESHADOW
@ SPELL_WARLOCK_WITHER_TALENT
@ SPELL_WARLOCK_PYROGENICS_DEBUFF
@ SPELL_WARLOCK_DEMONBOLT_ENERGIZE
@ SPELL_WARLOCK_DOOM_ENERGIZE
@ SPELL_WARLOCK_AGONY
@ SPELL_WARLOCK_IMMOLATE_PERIODIC
@ SPELL_WARLOCK_BILESCOURGE_BOMBERS_MISSILE
@ SPELL_WARLOCK_BILESCOURGE_BOMBERS_AREATRIGGER
@ SPELL_WARLOCK_VOLATILE_AGONY_TALENT
@ SPELL_WARLOCK_ABSOLUTE_CORRUPTION
@ SPELL_WARLOCK_BILESCOURGE_BOMBERS
@ SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R2
@ SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1
WarlockSpellVisuals
@ SPELL_VISUAL_WARLOCK_BILESCOURGE_BOMBERS_CRASH
TriggerCastFlags TriggerFlags
CastSpellExtraArgs & SetTriggeringSpell(Spell const *triggeringSpell)
Definition Spell.cpp:9707
CastSpellExtraArgs & SetTriggerFlags(TriggerCastFlags flag)
CastSpellExtraArgs & AddSpellBP0(SpellEffectValue val)
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition CellImpl.h:203
constexpr void GetPosition(float &x, float &y) const
Definition Position.h:92
static constexpr uint8 MAX_TICKS
at_warl_bilescourge_bombers(AreaTrigger *areatrigger)
void OnCreate(Spell const *) override
static void HandleDamageOrHealingCalculation(Unit const *caster, Unit const *target, float &pctMod, SpellEffIndex inreaseEffect, SpellEffIndex healthLimitEffect)
MiscSpells