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{
111};
112
118
123
124// 146739 - Corruption
125// 445474 - Wither
127{
128 bool Validate(SpellInfo const* /*spellInfo*/) override
129 {
131 }
132
133 bool Load() override
134 {
136 }
137
138 void HandleApply(SpellEffIndex /*effIndex*/) const
139 {
140 if (Aura const* absoluteCorruption = GetCaster()->GetAura(SPELL_WARLOCK_ABSOLUTE_CORRUPTION))
141 {
142 Milliseconds duration = GetHitUnit()->IsPvP()
143 ? Seconds(absoluteCorruption->GetSpellInfo()->GetEffect(EFFECT_0).CalcValueAsInt())
144 : Milliseconds(-1);
145
146 GetHitAura()->SetMaxDuration(duration.count());
147 GetHitAura()->SetDuration(duration.count());
148 }
149 }
150
155};
156
157// Called by 17962 - Conflagrate
159{
160 bool Validate(SpellInfo const* /*spellInfo*/) override
161 {
163 }
164
165 bool Load() override
166 {
168 }
169
170 void HandleAfterCast() const
171 {
172 Unit* caster = GetCaster();
175 .TriggeringSpell = GetSpell()
176 });
177 }
178
183};
184
185// 710 - Banish
187{
188public:
190
191private:
193 {
194 if (missInfo != SPELL_MISS_IMMUNE)
195 return;
196
197 if (Unit* target = GetHitUnit())
198 {
199 // Casting Banish on a banished target will remove applied aura
200 if (Aura * banishAura = target->GetAura(GetSpellInfo()->Id, GetCaster()->GetGUID()))
201 banishAura->Remove();
202 }
203 }
204
209};
210
211// 267211 - Bilescourge Bombers
232
234{
235public:
236 explicit BilescourgeBombersEvent(Unit* caster, Position srcPos, Position destPos) : _caster(caster), _srcPos(srcPos), _destPos(destPos) { }
237
244
245private:
249};
250
251// 15141 - Bilescourge Bombers
253{
254 static constexpr uint8 MAX_TICKS = 12;
255
257
258 void OnCreate(Spell const* /*creatingSpell*/) override
259 {
260 Unit* caster = at->GetCaster();
261 if (!caster)
262 return;
263
265 if (!targetAt)
266 return;
267
268 int32 tickRate = at->GetTotalDuration() / MAX_TICKS;
269
270 for (uint8 i = 1; i <= 12; i++)
271 caster->m_Events.AddEventAtOffset(new BilescourgeBombersEvent(caster, at->GetPosition(), targetAt->GetPosition()), Milliseconds(tickRate * i));
272 }
273};
274
275// 111400 - Burning Rush
277{
278 bool Validate(SpellInfo const* spellInfo) override
279 {
280 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
281 }
282
284 {
285 Unit* caster = GetCaster();
286
287 if (caster->GetHealthPct() <= GetEffectInfo(EFFECT_1).CalcValue(caster))
288 {
291 }
292
293 return SPELL_CAST_OK;
294 }
295
300};
301
302// 111400 - Burning Rush
304{
305 void PeriodicTick(AuraEffect const* aurEff)
306 {
307 if (GetTarget()->GetHealthPct() <= aurEff->GetAmount())
308 {
310 Remove();
311 }
312 }
313
318};
319
320// 152108 - Cataclysm
341
342// 228312 - Immolate (attached to 157736 - Immolate and 445474 - Wither)
344{
345 bool Validate(SpellInfo const* /*spellInfo*/) override
346 {
348 }
349
350 void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
351 {
352 if (Unit* caster = GetCaster())
355 .SpellValueOverrides = { { SPELLVALUE_DURATION, GetDuration() } }
356 });
357 }
358
359 void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
360 {
361 Unit* caster = GetCaster();
362 if (!caster)
363 return;
364
365 Unit* validTarget = nullptr;
366 Trinity::UnitAuraCheck check(true, GetId(), caster->GetGUID());
367 Trinity::UnitSearcher searcher(caster, validTarget, check);
368 Cell::VisitAllObjects(caster, searcher, 100.f);
369
370 if (!validTarget)
372 }
373
379};
380
381// 196447 - Channel Demonfire
403
404// 196449 - Channel Demonfire
434
435// 116858 - Chaos Bolt
437{
438 bool Load() override
439 {
440 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
441 }
442
443 void HandleDummy(SpellEffIndex /*effIndex*/)
444 {
445 SetHitDamage(GetHitDamage() + CalculatePct(GetHitDamage(), GetCaster()->ToPlayer()->m_activePlayerData->SpellCritPercentage));
446 }
447
448 void CalcCritChance(Unit const* /*victim*/, float& critChance)
449 {
450 critChance = 100.0f;
451 }
452
458};
459
460// 77220 - Mastery: Chaotic Energies
462{
463 void HandleAbsorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
464 {
465 AuraEffect const* effect1 = GetEffect(EFFECT_1);
466 if (!effect1 || !GetTargetApplication()->HasEffect(EFFECT_1))
467 {
469 return;
470 }
471
472 // You take ${$s2/3}% reduced damage
473 float damageReductionPct = effect1->GetAmount() / 3;
474 // plus a random amount of up to ${$s2/3}% additional reduced damage
475 damageReductionPct += frand(0.0f, damageReductionPct);
476
477 absorbAmount = CalculatePct(dmgInfo.GetDamage(), damageReductionPct);
478 }
479
484};
485
486// 17962 - Conflagrate
507
508// 6201 - Create Healthstone
510{
511 bool Validate(SpellInfo const* /*spellInfo*/) override
512 {
514 }
515
516 bool Load() override
517 {
518 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
519 }
520
525
530};
531
532// 1259886 - Cull the Weak
534{
535 bool Validate(SpellInfo const* /*spellInfo*/) override
536 {
538 }
539
540 void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo const& /*eventInfo*/) const
541 {
543 }
544
549};
550
551// 453172 - Cunning Cruelty
553{
554 bool Validate(SpellInfo const* /*spellInfo*/) override
555 {
557 }
558
559 bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo)
560 {
561 // Shadow Bolt proc chance is 50%
562 // Drain Soul proc chance is 25%
563 float chance = 50.0f;
564 if (eventInfo.GetSpellInfo()->IsAffected(SPELLFAMILY_WARLOCK, { 0x800000 }))
565 chance = 25.0f;
566
567 return roll_chance(chance, _rng);
568 }
569
574
580
582};
583
584// 108416 - Dark Pact
586{
587 bool Validate(SpellInfo const* spellInfo) override
588 {
589 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 }, { spellInfo->Id, EFFECT_2 } });
590 }
591
592 void CalculateAmount(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& canBeRecalculated)
593 {
594 canBeRecalculated = false;
595 if (Unit* caster = GetCaster())
596 {
597 float extraAmount = caster->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()) * 2.5f;
598 uint64 absorb = caster->CountPctFromCurHealth(GetEffectInfo(EFFECT_1).CalcValue(caster));
599 caster->SetHealth(caster->GetHealth() - absorb);
600 amount = CalculatePct(absorb, GetEffectInfo(EFFECT_2).CalcValue(caster)) + extraAmount;
601 }
602 }
603
608};
609
611{
612 static void HandleDamageOrHealingCalculation(Unit const* caster, Unit const* target, float& pctMod, SpellEffIndex inreaseEffect, SpellEffIndex healthLimitEffect)
613 {
614 Aura const* deathsEmbrace = caster->GetAura(SPELL_WARLOCK_DEATHS_EMBRACE, ObjectGuid::Empty, ObjectGuid::Empty, 1 << inreaseEffect | 1 << healthLimitEffect);
615 if (!deathsEmbrace)
616 return;
617
618 if (!target->HealthBelowPct(deathsEmbrace->GetEffect(healthLimitEffect)->GetAmount()))
619 return;
620
621 AddPct(pctMod, deathsEmbrace->GetEffect(inreaseEffect)->GetAmount());
622 }
623};
624
625// Called by 324540 - Malefic Rapture
627{
628 bool Validate(SpellInfo const* /*spellInfo*/) override
629 {
631 }
632
633 void HandleDamageCalculation(SpellEffectInfo const& /*spellEffectInfo*/, Unit const* victim, int32 const& /*damage*/, int32 const& /*flatMod*/, float& pctMod) const
634 {
636 }
637
642};
643
644// Called by 980 - Agony, 146739 - Corruption and 316099 - Unstable Affliction
646{
647 bool Validate(SpellInfo const* /*spellInfo*/) override
648 {
650 }
651
652 void CalculateDamage(AuraEffect const* /*aurEff*/, Unit const* victim, int32& /*damage*/, int32& /*flatMod*/, float& pctMod) const
653 {
654 if (Unit const* caster = GetCaster())
656 }
657
662};
663
664// 234153 - Drain Life
666{
667 bool Validate(SpellInfo const* /*spellInfo*/) override
668 {
670 }
671
672 void CalculateHeal(AuraEffect const* /*aurEff*/, Unit const* victim, int32& /*damage*/, int32& /*flatMod*/, float& pctMod) const
673 {
674 Unit const* caster = GetCaster();
675 if (!caster)
676 return;
677
678 if (caster != victim) // check who is being targeted, this hook is called for both damage and healing of PERIODIC_LEECH
679 return;
680
682 }
683
688};
689
690// 264178 - Demonbolt
711
712// 48018 - Demonic Circle: Summon
714{
715 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode)
716 {
717 // If effect is removed by expire remove the summoned demonic circle too.
718 if (!(mode & AURA_EFFECT_HANDLE_REAPPLY))
719 GetTarget()->RemoveGameObject(GetId(), true);
720
722 }
723
724 void HandleDummyTick(AuraEffect const* /*aurEff*/)
725 {
726 if (GameObject* circle = GetTarget()->GetGameObject(GetId()))
727 {
728 // Here we check if player is in demonic circle teleport range, if so add
729 // WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT.
730 // If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST.
731
732 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT, GetCastDifficulty());
733
734 if (GetTarget()->IsWithinDist(circle, spellInfo->GetMaxRange(true)))
735 {
738 }
739 else
741 }
742 }
743
749};
750
751// 48020 - Demonic Circle: Teleport
753{
754 void HandleTeleport(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
755 {
756 if (Player* player = GetTarget()->ToPlayer())
757 {
758 if (GameObject* circle = player->GetGameObject(SPELL_WARLOCK_DEMONIC_CIRCLE_SUMMON))
759 {
760 player->NearTeleportTo(circle->GetPositionX(), circle->GetPositionY(), circle->GetPositionZ(), circle->GetOrientation());
761 player->RemoveMovementImpairingAuras(false);
762 }
763 }
764 }
765
770};
771
772// 67518, 19505 - Devour Magic
774{
775 bool Validate(SpellInfo const* spellInfo) override
776 {
778 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
779 }
780
782 {
783 Unit* caster = GetCaster();
786 args.AddSpellBP0(GetEffectInfo(EFFECT_1).CalcValue(caster));
787
788 caster->CastSpell(caster, SPELL_WARLOCK_DEVOUR_MAGIC_HEAL, args);
789
790 // Glyph of Felhunter
791 if (Unit* owner = caster->GetOwner())
792 if (owner->GetAura(SPELL_WARLOCK_GLYPH_OF_DEMON_TRAINING))
793 owner->CastSpell(owner, SPELL_WARLOCK_DEVOUR_MAGIC_HEAL, args);
794 }
795
800};
801
802// 603 - Doom
804{
805 bool Validate(SpellInfo const* /*spellInfo*/) override
806 {
808 }
809
810 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
811 {
812 if (Unit* caster = GetCaster())
813 caster->CastSpell(caster, SPELL_WARLOCK_DOOM_ENERGIZE, true);
814 }
815
820};
821
822// 198590 - Drain Soul
824{
825 bool Validate(SpellInfo const* spellInfo) override
826 {
828 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } });
829 }
830
831 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
832 {
833 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
834 return;
835
836 if (Unit* caster = GetCaster())
837 caster->CastSpell(caster, SPELL_WARLOCK_DRAIN_SOUL_ENERGIZE, true);
838 }
839
840 void CalculateDamage(AuraEffect const* /*aurEff*/, Unit const* victim, int32& /*damage*/, int32& /*flatMod*/, float& pctMod) const
841 {
842 if (victim->HealthBelowPct(GetEffectInfo(EFFECT_2).CalcValue(GetCaster())))
843 AddPct(pctMod, GetEffectInfo(EFFECT_1).CalcValue(GetCaster()));
844 }
845
851};
852
853// 48181 - Haunt
855{
856 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
857 {
858 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
859 if (Unit* caster = GetCaster())
860 caster->GetSpellHistory()->ResetCooldown(GetId(), true);
861 }
862
867};
868
869// 755 - Health Funnel
871{
872 void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
873 {
874 Unit* caster = GetCaster();
875 if (!caster)
876 return;
877
878 Unit* target = GetTarget();
883 }
884
891
892 void OnPeriodic(AuraEffect const* aurEff)
893 {
894 Unit* caster = GetCaster();
895 if (!caster)
896 return;
898 uint32 damage = caster->CountPctFromMaxHealth(aurEff->GetBaseAmount());
899
900 if (Player* modOwner = caster->GetSpellModOwner())
901 modOwner->ApplySpellMod(GetSpellInfo(), SpellModOp::PowerCost0, damage);
902
903 SpellNonMeleeDamage damageInfo(caster, caster, GetSpellInfo(), GetAura()->GetSpellVisual(), GetSpellInfo()->SchoolMask, GetAura()->GetCastId());
904 damageInfo.periodicLog = true;
905 damageInfo.damage = damage;
906 caster->DealSpellDamage(&damageInfo, false);
907 caster->SendSpellNonMeleeDamageLog(&damageInfo);
908 }
909
916};
917
918// 6262 - Healthstone
920{
922 {
923 int32 heal = int32(CalculatePct(GetCaster()->GetCreateHealth(), GetHitHeal()));
924 SetHitHeal(heal);
925 }
926
931};
932
933// 348 - Immolate
951
952// Called by 316099 - Unstable Affliction
953// 459376 - Perpetual Unstability
955{
960
961 void TriggerExplosion() const
962 {
963 Unit* caster = GetCaster();
964 Unit* target = GetHitUnit();
965
966 if (AuraEffect const* perpetualUnstability = caster->GetAuraEffect(SPELL_WARLOCK_PERPETUAL_UNSTABILITY_TALENT, EFFECT_0))
967 {
968 if (Aura const* unstableAfflictionAura = target->GetAura(GetSpellInfo()->Id, caster->GetGUID()))
969 {
970 FloatSeconds maxUnstableAfflictionDuration(perpetualUnstability->GetAmount());
971 if (Milliseconds(unstableAfflictionAura->GetDuration()) <= maxUnstableAfflictionDuration)
974 .SetTriggeringSpell(GetSpell()));
975 }
976 }
977 }
978
983};
984
985// 387095 - Pyrogenics
987{
988 bool Validate(SpellInfo const* /*spellInfo*/) override
989 {
991 }
992
993 void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& procInfo) const
994 {
996 .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
997 .TriggeringAura = aurEff
998 });
999 }
1000
1005};
1006
1007// 5740 - Rain of Fire
1010{
1011 void HandleDummyTick(AuraEffect const* /*aurEff*/)
1012 {
1013 std::vector<AreaTrigger*> rainOfFireAreaTriggers = GetTarget()->GetAreaTriggers(SPELL_WARLOCK_RAIN_OF_FIRE);
1014 GuidUnorderedSet targetsInRainOfFire;
1015
1016 for (AreaTrigger* rainOfFireAreaTrigger : rainOfFireAreaTriggers)
1017 {
1018 GuidUnorderedSet const& insideTargets = rainOfFireAreaTrigger->GetInsideUnits();
1019 targetsInRainOfFire.insert(insideTargets.begin(), insideTargets.end());
1020 }
1021
1022 for (ObjectGuid insideTargetGuid : targetsInRainOfFire)
1023 if (Unit* insideTarget = ObjectAccessor::GetUnit(*GetTarget(), insideTargetGuid))
1024 if (!GetTarget()->IsFriendlyTo(insideTarget))
1026 }
1027
1032};
1033
1034// 366330 - Random Sayaad
1036{
1037 bool Validate(SpellInfo const* /*spellInfo*/) override
1038 {
1039 return ValidateSpellInfo
1040 ({
1043 });
1044 }
1045
1046 void HandleDummy(SpellEffIndex /*effIndex*/)
1047 {
1048 Unit* caster = GetCaster();
1049
1052
1053 Player* player = GetCaster()->ToPlayer();
1054 if (!player)
1055 return;
1056
1057 if (Pet* pet = player->GetPet())
1058 {
1059 if (pet->IsPetSayaad())
1060 pet->DespawnOrUnsummon();
1061 }
1062 }
1063
1068};
1069
1070// Called by 17962 - Conflagrate
1096
1097// 366323 - Strengthen Pact - Succubus
1098// 366325 - Strengthen Pact - Incubus
1099// 366222 - Summon Sayaad
1101{
1102 bool Validate(SpellInfo const* /*spellInfo*/) override
1103 {
1105 }
1106
1107 // 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.
1108 void OnPrecast() override
1109 {
1110 Player* player = GetCaster()->ToPlayer();
1111 if (!player)
1112 return;
1113
1114 if (Pet* pet = player->GetPet())
1116 .SetOriginalCaster(pet->GetGUID())
1118 }
1119
1120 void Register() override
1121 {
1122 }
1123};
1124
1125// 6358 - Seduction (Special Ability)
1127{
1128 bool Validate(SpellInfo const* /*spellInfo*/) override
1129 {
1131 }
1132
1134 {
1135 Unit* caster = GetCaster();
1136 if (Unit* target = GetHitUnit())
1137 {
1138 if (caster->GetOwner() && caster->GetOwner()->HasAura(SPELL_WARLOCK_GLYPH_OF_SUCCUBUS))
1139 {
1140 target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE, ObjectGuid::Empty, target->GetAura(SPELL_PRIEST_SHADOW_WORD_DEATH)); // SW:D shall not be removed.
1141 target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT);
1142 target->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH);
1143 }
1144 }
1145 }
1146
1151};
1152
1153// 27285 - Seed of Corruption (damage)
1155{
1156 bool Validate(SpellInfo const* /*spellInfo*/) override
1157 {
1159 }
1160
1161 void HandleHit(SpellEffIndex /*effIndex*/) const
1162 {
1164 }
1165
1170};
1171
1173{
1175 {
1176 target = nullptr;
1177 }
1178
1179 void SelectTarget(std::list<WorldObject*>& targets) const
1180 {
1181 if (targets.size() < 2)
1182 return;
1183
1184 if (!GetExplTargetUnit()->HasAura(GetSpellInfo()->Id, GetCaster()->GetGUID()))
1185 {
1186 // primary target doesn't have seed, keep it
1187 targets.clear();
1188 targets.push_back(GetExplTargetUnit());
1189 }
1190 else
1191 {
1192 // primary target has seed, select random other target with no seed
1193 targets.remove_if(Trinity::UnitAuraCheck(true, GetSpellInfo()->Id, GetCaster()->GetGUID()));
1194 if (!targets.empty())
1196 else
1197 targets.push_back(GetExplTargetUnit());
1198 }
1199 }
1200
1207};
1208
1209// 27243 - Seed of Corruption
1211{
1212 bool Validate(SpellInfo const* /*spellInfo*/) override
1213 {
1215 }
1216
1217 void OnPeriodic(AuraEffect const* aurEff) const
1218 {
1219 if (Unit* caster = GetCaster())
1220 caster->CastSpell(GetTarget(), SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE, aurEff);
1221 }
1222
1223 void CalculateBuffer(AuraEffect const* /*aurEff*/, SpellEffectValue& amount, bool& /*canBeRecalculated*/) const
1224 {
1225 Unit* caster = GetCaster();
1226 if (!caster)
1227 return;
1228
1229 amount = caster->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()) * GetEffectInfo(EFFECT_0).CalcValue(caster) / 100;
1230 }
1231
1232 void HandleProc(AuraEffect* aurEff, ProcEventInfo const& eventInfo)
1233 {
1235
1236 DamageInfo const* damageInfo = eventInfo.GetDamageInfo();
1237 if (!damageInfo)
1238 return;
1239
1240 Unit* caster = GetCaster();
1241 if (!caster)
1242 return;
1243
1244 if (!damageInfo->GetAttacker() || damageInfo->GetAttacker() != caster)
1245 return;
1246
1247 // other seed explosions detonate this instantly, no matter what damage amount is
1248 if (!damageInfo->GetSpellInfo() || damageInfo->GetSpellInfo()->Id != SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE)
1249 {
1250 SpellEffectValue amount = aurEff->GetAmount() - damageInfo->GetDamage();
1251 if (amount > 0)
1252 {
1253 aurEff->SetAmount(amount);
1254 if (!GetTarget()->HealthBelowPctDamaged(1, damageInfo->GetDamage()))
1255 return;
1256 }
1257 }
1258
1259 Remove();
1260
1262 }
1263
1270};
1271
1272// 32863 - Seed of Corruption
1273// 36123 - Seed of Corruption
1274// 38252 - Seed of Corruption
1275// 39367 - Seed of Corruption
1276// 44141 - Seed of Corruption
1277// 70388 - Seed of Corruption
1278// Monster spells, triggered only on amount drop (not on death)
1280{
1281 bool Validate(SpellInfo const* /*spellInfo*/) override
1282 {
1284 }
1285
1286 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1287 {
1289 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
1290 if (!damageInfo || !damageInfo->GetDamage())
1291 return;
1292
1293 SpellEffectValue amount = aurEff->GetAmount() - damageInfo->GetDamage();
1294 if (amount > 0)
1295 {
1296 aurEff->SetAmount(amount);
1297 return;
1298 }
1299
1300 Remove();
1301
1302 Unit* caster = GetCaster();
1303 if (!caster)
1304 return;
1305
1307 }
1308
1313};
1314
1315// 17877 - Shadowburn
1317{
1318 bool Validate(SpellInfo const* spellInfo) override
1319 {
1321 && ValidateSpellEffect({ { spellInfo->Id, EFFECT_3 } });
1322 }
1323
1324 void HandleEnergize() const
1325 {
1326 if (GetHitUnit()->IsAlive())
1327 return;
1328
1329 // killing target with current spell doesn't apply the aura (apply/remove scripts don't execute)
1330 // but we can use the fact that it still gets created and immediately marked as removed to detect that case
1331 Aura* hitAura = GetHitAura(false, true);
1332 if (!hitAura || !hitAura->IsRemoved())
1333 return;
1334
1336 }
1337
1338 void CalcCritChance(Unit const* victim, float& critChance) const
1339 {
1340 if (victim->HealthBelowPct(GetEffectInfo(EFFECT_3).CalcValue(GetCaster())))
1341 critChance += GetEffectInfo(EFFECT_2).CalcValue(GetCaster());
1342 }
1343
1349
1350public:
1351 static void TryEnergize(Player* caster, Unit const* target, SpellInfo const* spellInfo,
1352 Spell const* triggeringSpell, AuraEffect const* triggeringAura)
1353 {
1354 if (!caster)
1355 return;
1356
1357 if (caster->isHonorOrXPTarget(target))
1358 {
1361 .TriggeringSpell = triggeringSpell,
1362 .TriggeringAura = triggeringAura
1363 });
1364
1365 caster->GetSpellHistory()->RestoreCharge(spellInfo->ChargeCategoryId);
1366 }
1367 }
1368};
1369
1385
1386// 686 - Shadow Bolt
1388{
1389 bool Validate(SpellInfo const* /*spellInfo*/) override
1390 {
1392 }
1393
1398
1403};
1404
1405// 422054 - Shadow Invocation
1407{
1408 void HandleProc(ProcEventInfo& eventInfo)
1409 {
1410 Unit* caster = eventInfo.GetActor();
1411 Unit* target = eventInfo.GetActionTarget();
1412 caster->m_Events.AddEventAtOffset(new BilescourgeBombersEvent(caster, caster->GetPosition(), target->GetPosition()), 500ms);
1413 }
1414
1419};
1420
1421// 1260264 - Shard Instability
1423{
1424 bool Validate(SpellInfo const* /*spellInfo*/) override
1425 {
1427 }
1428
1429 template <bool IsDrainSoul>
1430 bool CheckProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo)
1431 {
1432 if (eventInfo.GetSpellInfo()->IsAffected(SPELLFAMILY_WARLOCK, { 0x800000 }) != IsDrainSoul)
1433 return false;
1434
1435 return roll_chance(aurEff->GetAmount(), _rng);
1436 }
1437
1438 static void HandleProc(AuraScript const&, AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo)
1439 {
1441 }
1442
1450
1452};
1453
1454// 452999 - Siphon Life
1456{
1457 bool Validate(SpellInfo const* /*spellInfo*/) override
1458 {
1460 }
1461
1462 void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo) const
1463 {
1464 DamageInfo const* damageInfo = eventInfo.GetDamageInfo();
1465 if (!damageInfo || !damageInfo->GetDamage())
1466 return;
1467
1468 Unit* caster = GetTarget();
1470 .AddSpellMod(SPELLVALUE_BASE_POINT0, CalculatePct(damageInfo->GetDamage(), aurEff->GetAmount())));
1471 }
1472
1477};
1478
1479// 6353 - Soul Fire
1516
1517// 86121 - Soul Swap
1541
1542// 86211 - Soul Swap Override - Also acts as a dot container
1544{
1546 void Register() override { }
1547
1548public:
1549 void AddDot(uint32 id) { _dotList.push_back(id); }
1550 std::list<uint32> const GetDotList() const { return _dotList; }
1552 void SetOriginalSwapSource(Unit* victim) { _swapCaster = victim; }
1553
1554private:
1555 std::list<uint32> _dotList;
1556 Unit* _swapCaster = nullptr;
1557};
1558
1561{
1562 void HandleHit(SpellEffIndex /*effIndex*/)
1563 {
1564 Unit* swapVictim = GetCaster();
1565 Unit* warlock = GetHitUnit();
1566 if (!warlock || !swapVictim)
1567 return;
1568
1569 Unit::AuraApplicationMap const& appliedAuras = swapVictim->GetAppliedAuras();
1570 spell_warl_soul_swap_override* swapSpellScript = nullptr;
1571 if (Aura* swapOverrideAura = warlock->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
1572 swapSpellScript = swapOverrideAura->GetScript<spell_warl_soul_swap_override>();
1573
1574 if (!swapSpellScript)
1575 return;
1576
1577 flag128 classMask = GetEffectInfo().SpellClassMask;
1578
1579 for (Unit::AuraApplicationMap::const_iterator itr = appliedAuras.begin(); itr != appliedAuras.end(); ++itr)
1580 {
1581 SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo();
1582 if (itr->second->GetBase()->GetCaster() == warlock)
1583 if (spellProto->SpellFamilyName == SPELLFAMILY_WARLOCK && (spellProto->SpellFamilyFlags & classMask))
1584 swapSpellScript->AddDot(itr->first);
1585 }
1586
1587 swapSpellScript->SetOriginalSwapSource(swapVictim);
1588 }
1589
1594};
1595
1596// 86213 - Soul Swap Exhale
1598{
1599 bool Validate(SpellInfo const* /*spellInfo*/) override
1600 {
1602 }
1603
1605 {
1606 Unit* currentTarget = GetExplTargetUnit();
1607 Unit* swapTarget = nullptr;
1608 if (Aura const* swapOverride = GetCaster()->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
1609 if (spell_warl_soul_swap_override* swapScript = swapOverride->GetScript<spell_warl_soul_swap_override>())
1610 swapTarget = swapScript->GetOriginalSwapSource();
1611
1612 // Soul Swap Exhale can't be cast on the same target than Soul Swap
1613 if (swapTarget && currentTarget && swapTarget == currentTarget)
1615
1616 return SPELL_CAST_OK;
1617 }
1618
1619 void OnEffectHit(SpellEffIndex /*effIndex*/)
1620 {
1623
1624 std::list<uint32> dotList;
1625 Unit* swapSource = nullptr;
1626 if (Aura const* swapOverride = GetCaster()->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
1627 {
1628 spell_warl_soul_swap_override* swapScript = swapOverride->GetScript<spell_warl_soul_swap_override>();
1629 if (!swapScript)
1630 return;
1631 dotList = swapScript->GetDotList();
1632 swapSource = swapScript->GetOriginalSwapSource();
1633 }
1634
1635 if (dotList.empty())
1636 return;
1637
1638 for (std::list<uint32>::const_iterator itr = dotList.begin(); itr != dotList.end(); ++itr)
1639 {
1640 GetCaster()->AddAura(*itr, GetHitUnit());
1641 if (!hasGlyph && swapSource)
1642 swapSource->RemoveAurasDueToSpell(*itr);
1643 }
1644
1645 // Remove Soul Swap Exhale buff
1647
1648 if (hasGlyph) // Add a cooldown on Soul Swap if caster has the glyph
1650 }
1651
1657};
1658
1659// 29858 - Soulshatter
1661{
1662 bool Validate(SpellInfo const* /*spellInfo*/) override
1663 {
1665 }
1666
1667 void HandleDummy(SpellEffIndex /*effIndex*/)
1668 {
1669 Unit* caster = GetCaster();
1670 if (Unit* target = GetHitUnit())
1671 if (target->GetThreatManager().IsThreatenedBy(caster, true))
1672 caster->CastSpell(target, SPELL_WARLOCK_SOULSHATTER_EFFECT, true);
1673 }
1674
1679};
1680
1681// 366323 - Strengthen Pact - Succubus
1683{
1684 bool Validate(SpellInfo const* /*spellInfo*/) override
1685 {
1686 return ValidateSpellInfo
1687 ({
1690 });
1691 }
1692
1693 void HandleDummy(SpellEffIndex /*effIndex*/)
1694 {
1695 Unit* caster = GetCaster();
1696
1699 }
1700
1705};
1706
1707// 366325 - Strengthen Pact - Incubus
1709{
1710 bool Validate(SpellInfo const* /*spellInfo*/) override
1711 {
1712 return ValidateSpellInfo
1713 ({
1716 });
1717 }
1718
1719 void HandleDummy(SpellEffIndex /*effIndex*/)
1720 {
1721 Unit* caster = GetCaster();
1722
1725 }
1726
1731};
1732
1733// 366222 - Summon Sayaad
1735{
1736 bool Validate(SpellInfo const* /*spellInfo*/) override
1737 {
1738 return ValidateSpellInfo
1739 ({
1742 });
1743 }
1744
1749
1754};
1755
1756// 37377 - Shadowflame
1757// 39437 - Shadowflame Hellfire and RoF
1758template <uint32 Trigger>
1760{
1761 bool Validate(SpellInfo const* /*spellInfo*/) override
1762 {
1763 return ValidateSpellInfo({ Trigger });
1764 }
1765
1766 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1767 {
1769 Unit* caster = eventInfo.GetActor();
1770 caster->CastSpell(caster, Trigger, aurEff);
1771 }
1772
1777};
1778
1779// 316099 - Unstable Affliction
1781{
1786
1787 void HandleDispel(DispelInfo const* dispelInfo) const
1788 {
1789 Unit* caster = GetCaster();
1790 if (!caster)
1791 return;
1792
1793 AuraEffect const* removedEffect = GetEffect(EFFECT_1);
1794 if (!removedEffect)
1795 return;
1796
1797 SpellEffectValue damage = GetEffectInfo(EFFECT_0).CalcValue(caster, nullptr, GetUnitOwner()) / 100.0 * *removedEffect->CalculateEstimatedAmount(caster, removedEffect->GetAmount());
1799 .AddSpellMod(SPELLVALUE_BASE_POINT0, damage)
1801 }
1802
1803 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
1804 {
1805 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
1806 return;
1807
1809 }
1810
1816};
1817
1818// 278350 - Vile Taint
1846
1847// Called by 980 - Agony
1848// 453034 - Volatile Agony
1850{
1851 bool Validate(SpellInfo const* /*spellInfo*/) override
1852 {
1854 }
1855
1856 void TriggerExplosion() const
1857 {
1858 Unit* caster = GetCaster();
1859 Unit* target = GetHitUnit();
1860
1861 if (AuraEffect const* volatileAgony = caster->GetAuraEffect(SPELL_WARLOCK_VOLATILE_AGONY_TALENT, EFFECT_0))
1862 {
1863 if (Aura const* agonyAura = target->GetAura(GetSpellInfo()->Id, caster->GetGUID()))
1864 {
1865 FloatSeconds maxAgonyDuration(volatileAgony->GetAmount());
1866 if (Milliseconds(agonyAura->GetDuration()) <= maxAgonyDuration)
1869 .SetTriggeringSpell(GetSpell()));
1870 }
1871 }
1872 }
1873
1878};
1879
1881{
1941}
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:56
bool roll_chance(float chance, PseudoRandomDistributionState &state)
Definition Random.cpp:131
#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
@ SPELL_EFFECT_CREATE_AREATRIGGER
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_DISPEL
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ SPELL_EFFECT_APPLY_AURA
SpellMissInfo
@ SPELL_MISS_IMMUNE
@ TARGET_UNIT_DEST_AREA_ENEMY
@ TARGET_UNIT_TARGET_ENEMY
@ 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 AuraCheckEffectProcFn(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)
int32 GetAmountAsInt() const
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< CheckEffectProcHandler > DoCheckEffectProc
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:460
SpellInfo const * GetSpellInfo() const
Definition Unit.h:462
uint32 GetDamage() const
Definition Unit.h:466
WorldObject * GetDispeller() const
Definition Unit.h:410
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:22007
bool isHonorOrXPTarget(Unit const *victim) const
Definition Player.cpp:26295
Unit * GetActionTarget() const
Definition Unit.h:514
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:281
DamageInfo * GetDamageInfo() const
Definition Unit.h:524
Unit * GetActor() const
Definition Unit.h:513
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)
void ModifyCooldown(uint32 spellId, Duration cooldownMod, bool withoutCategoryCooldown=false)
bool IsAffected(uint32 familyName, flag128 const &familyFlags) const
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:647
void RemoveGameObject(GameObject *gameObj, bool del)
Definition Unit.cpp:5436
float GetHealthPct() const
Definition Unit.h:808
uint64 CountPctFromMaxHealth(float pct) const
Definition Unit.h:809
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3846
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:657
void DealSpellDamage(SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
Definition Unit.cpp:1308
bool IsPvP() const
Definition Unit.h:901
Aura * AddAura(uint32 spellId, Unit *target)
Definition Unit.cpp:12344
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4622
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
Definition Unit.cpp:5559
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4718
bool HealthBelowPct(float pct) const
Definition Unit.h:804
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4822
SpellHistory * GetSpellHistory()
Definition Unit.h:1521
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1315
std::vector< AreaTrigger * > GetAreaTriggers(uint32 spellId) const
Definition Unit.cpp:5494
int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const
Definition Unit.cpp:7103
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3992
AreaTrigger * GetAreaTrigger(uint32 spellId) const
Definition Unit.cpp:5488
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
Unit * GetOwner() const
Definition Object.cpp:1603
void SendPlayOrphanSpellVisual(Position const &sourceLocation, ObjectGuid const &target, uint32 spellVisualId, float travelSpeed, bool speedAsTime=false, bool withSourceOrientation=false)
Definition Object.cpp:2261
Player * GetSpellModOwner() const
Definition Object.cpp:1646
EventProcessor m_Events
Definition Object.h:561
bool IsFriendlyTo(WorldObject const *target) const
Definition Object.cpp:2191
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 *) override
void HandleEffectProc(AuraEffect const *aurEff, ProcEventInfo const &) const
static void HandleProc(AuraScript const &, AuraEffect const *, ProcEventInfo const &eventInfo)
bool CheckProc(AuraEffect const *, ProcEventInfo const &eventInfo)
bool Validate(SpellInfo const *) override
PseudoRandomDistributionState _rng
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 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 CheckProc(AuraEffect const *aurEff, ProcEventInfo const &eventInfo)
bool Validate(SpellInfo const *) override
PseudoRandomDistributionState _rng
static void HandleProc(AuraScript const &, AuraEffect const *, ProcEventInfo const &eventInfo)
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_DARK_HARVEST
@ 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_SHARD_INSTABILITY
@ 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_SHADOWBOLT_VOLLEY_AREA
@ 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:9646
CastSpellExtraArgs & SetTriggerFlags(TriggerCastFlags flag)
CastSpellExtraArgs & AddSpellBP0(SpellEffectValue val)
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:160
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