aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2017-12-30 20:28:41 +0100
committerShauren <shauren.trinity@gmail.com>2021-04-16 15:22:42 +0200
commit9b141207d170e4b2b4e6d9290d5f921f76cbcea0 (patch)
tree47d65d966a66699f6de7e308047e408bdb255bff /src/server/scripts/EasternKingdoms
parent2ea8f5e6fced094f28c45ac84123c85477122567 (diff)
[3.3.5] CastSpell unclusterfucking (that's a word now) (#21123)
Core/Spell: The giant CastSpell unclusterfucking (that's a word now) of this generation. - CastSpell now always takes three arguments - target, spellId, and a struct containing extra arguments - This struct (CastSpellExtraArgs, see SpellDefines.h) serves as a conglomerate of every previous combination of the 20 billion different CastSpell overloads, all merged into one - It has some great utility constructors - check them out! All of these can be used to implicitly construct the ExtraArgs object. - A gajillion refactors to make everything behave the way it always has (cherry picked from commit d507a7e3388382960108b24143da48e5f912b4a7)
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp12
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp10
8 files changed, 35 insertions, 13 deletions
diff --git a/src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp b/src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp
index c3c61a3490c..eecfbb08573 100644
--- a/src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp
+++ b/src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp
@@ -364,7 +364,7 @@ class spell_occuthar_occuthars_destruction : public SpellScriptLoader
if (Unit* caster = GetCaster())
{
if (IsExpired())
- caster->CastSpell(nullptr, SPELL_OCCUTHARS_DESTUCTION, true, nullptr, aurEff);
+ caster->CastSpell(nullptr, SPELL_OCCUTHARS_DESTUCTION, aurEff);
caster->ToCreature()->DespawnOrUnsummon(500);
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp
index fffc3981f5a..d01fb7f55d5 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_coren_direbrew.cpp
@@ -259,9 +259,14 @@ struct boss_coren_direbrew : public BossAI
SummonSister(NPC_URSULA_DIREBREW);
break;
case EVENT_SUMMON_MOLE_MACHINE:
- me->CastCustomSpell(SPELL_MOLE_MACHINE_TARGET_PICKER, SPELLVALUE_MAX_TARGETS, 1, nullptr, true);
+ {
+ CastSpellExtraArgs args;
+ args.TriggerFlags = TRIGGERED_FULL_MASK;
+ args.SpellValueOverrides.AddMod(SPELLVALUE_MAX_TARGETS, 1);
+ me->CastSpell(nullptr, SPELL_MOLE_MACHINE_TARGET_PICKER, args);
events.Repeat(Seconds(15));
break;
+ }
case EVENT_DIREBREW_DISARM:
DoCastSelf(SPELL_DIREBREW_DISARM_PRE_CAST, true);
events.Repeat(Seconds(20));
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
index 52fe779f4c1..108fdeb605b 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
@@ -135,8 +135,12 @@ class spell_baron_geddon_inferno : public SpellScriptLoader
void OnPeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
- int32 damageForTick[8] = { 500, 500, 1000, 1000, 2000, 2000, 3000, 5000 };
- GetTarget()->CastCustomSpell(SPELL_INFERNO_DMG, SPELLVALUE_BASE_POINT0, damageForTick[aurEff->GetTickNumber() - 1], nullptr, TRIGGERED_FULL_MASK, nullptr, aurEff);
+ int32 const damageForTick[8] = { 500, 500, 1000, 1000, 2000, 2000, 3000, 5000 };
+ CastSpellExtraArgs args;
+ args.TriggerFlags = TRIGGERED_FULL_MASK;
+ args.TriggeringAura = aurEff;
+ args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, damageForTick[aurEff->GetTickNumber() - 1]);
+ GetTarget()->CastSpell(nullptr, SPELL_INFERNO_DMG, args);
}
void Register() override
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index c1feefc773c..5419d8c4c16 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -339,7 +339,10 @@ public:
enfeeble_targets[i] = target->GetGUID();
enfeeble_health[i] = target->GetHealth();
- target->CastSpell(target, SPELL_ENFEEBLE, true, nullptr, nullptr, me->GetGUID());
+ CastSpellExtraArgs args;
+ args.TriggerFlags = TRIGGERED_FULL_MASK;
+ args.OriginalCaster = me->GetGUID();
+ target->CastSpell(target, SPELL_ENFEEBLE, args);
target->SetHealth(1);
}
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
index a9eaa863f46..ce4bfdce6dd 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
@@ -479,7 +479,7 @@ public:
Unit* unit = ObjectAccessor::GetUnit(*me, FlameWreathTarget[i]);
if (unit && !unit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3))
{
- unit->CastSpell(unit, 20476, true, nullptr, nullptr, me->GetGUID());
+ unit->CastSpell(unit, 20476, me->GetGUID());
unit->CastSpell(unit, 11027, true);
FlameWreathTarget[i].Clear();
}
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
index 7c1f428e6e5..4f7e025c984 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
@@ -235,8 +235,13 @@ public:
{
Unit* unit = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid());
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
+ {
// Knockback into the air
- unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_DOT, true, nullptr, nullptr, me->GetGUID());
+ CastSpellExtraArgs args;
+ args.TriggerFlags = TRIGGERED_FULL_MASK;
+ args.OriginalCaster = me->GetGUID();
+ unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_DOT, args);
+ }
}
}
@@ -250,7 +255,10 @@ public:
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
{
// Also needs an exception in spell system.
- unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_FLY, true, nullptr, nullptr, me->GetGUID());
+ CastSpellExtraArgs args;
+ args.TriggerFlags = TRIGGERED_FULL_MASK;
+ args.OriginalCaster = me->GetGUID();
+ unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_FLY, args);
unit->SetCanFly(true);
}
}
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
index c1038bd7d08..117043615bb 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
@@ -121,7 +121,7 @@ class spell_hexlord_unstable_affliction : public SpellScriptLoader
void HandleDispel(DispelInfo* dispelInfo)
{
if (Unit* caster = GetCaster())
- caster->CastSpell(dispelInfo->GetDispeller(), SPELL_WL_UNSTABLE_AFFL_DISPEL, true, nullptr, GetEffect(EFFECT_0));
+ caster->CastSpell(dispelInfo->GetDispeller(), SPELL_WL_UNSTABLE_AFFL_DISPEL, GetEffect(EFFECT_0));
}
void Register() override
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
index bf70c9d7da7..67b1d379158 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
@@ -500,10 +500,12 @@ class spell_mandokir_bloodletting : public SpellScriptLoader
if (!caster)
return;
- int32 damage = std::max<int32>(7500, target->CountPctFromCurHealth(aurEff->GetAmount()));
+ CastSpellExtraArgs args;
+ args.TriggerFlags = TRIGGERED_FULL_MASK;
+ args.AddSpellMod(SPELLVALUE_BASE_POINT0, std::max<int32>(7500, target->CountPctFromCurHealth(aurEff->GetAmount())));
- caster->CastCustomSpell(target, SPELL_BLOODLETTING_DAMAGE, &damage, nullptr, nullptr, true);
- target->CastCustomSpell(caster, SPELL_BLOODLETTING_HEAL, &damage, nullptr, nullptr, true);
+ caster->CastSpell(target, SPELL_BLOODLETTING_DAMAGE, args);
+ target->CastSpell(caster, SPELL_BLOODLETTING_HEAL, args);
}
void Register() override
@@ -606,7 +608,7 @@ class spell_mandokir_devastating_slam : public SpellScriptLoader
angle = float(rand_norm()) * static_cast<float>(M_PI * 35.0f / 180.0f) - static_cast<float>(M_PI * 17.5f / 180.0f);
caster->GetClosePoint(x, y, z, 4.0f, frand(-2.5f, 50.0f), angle);
- caster->CastSpell(x, y, z, SPELL_DEVASTATING_SLAM_DAMAGE, true);
+ caster->CastSpell({ x, y, z }, SPELL_DEVASTATING_SLAM_DAMAGE, true);
}
}
}