aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2021-11-20 21:49:56 +0200
committerGitHub <noreply@github.com>2021-11-20 21:49:56 +0200
commit44a6d393d7969adf3357ea74c61561c60c6c5a31 (patch)
tree3deadc03fa1cfa0294dfcd506ad4ffc442935a01 /src
parenta5b8e167dda0697f88b16ce0892912afda4c3e4b (diff)
Scripts/Spells: Void Zone's Consumption (#27265)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp18
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp16
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp27
3 files changed, 31 insertions, 30 deletions
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
index 1e8e38fccac..0367f0b5975 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
@@ -698,23 +698,6 @@ class spell_four_horsemen_mark : public AuraScript
}
};
-// 28865 - Consumption
-class spell_four_horsemen_consumption : public SpellScript
-{
- PrepareSpellScript(spell_four_horsemen_consumption);
-
- void HandleDamageCalc(SpellEffIndex /*effIndex*/)
- {
- uint32 damage = GetCaster()->GetMap()->IsHeroic() ? 4250 : 2750;
- SetEffectValue(damage);
- }
-
- void Register() override
- {
- OnEffectLaunchTarget += SpellEffectFn(spell_four_horsemen_consumption::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
- }
-};
-
void AddSC_boss_four_horsemen()
{
RegisterNaxxramasCreatureAI(boss_four_horsemen_baron);
@@ -722,5 +705,4 @@ void AddSC_boss_four_horsemen()
RegisterNaxxramasCreatureAI(boss_four_horsemen_lady);
RegisterNaxxramasCreatureAI(boss_four_horsemen_sir);
RegisterSpellScript(spell_four_horsemen_mark);
- RegisterSpellScript(spell_four_horsemen_consumption);
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
index 3620149a997..8ad560ddf90 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
@@ -60,7 +60,7 @@ enum Spells
SPELL_HEART_LIGHTNING_TETHER = 64799,
// Void Zone
- SPELL_CONSUMPTION = 64208,
+ SPELL_CONSUMPTION = 64209,
// Life Spark
SPELL_ARCANE_POWER_STATE = 49411,
@@ -658,19 +658,11 @@ struct npc_xt_void_zone : public PassiveAI
{
npc_xt_void_zone(Creature* creature) : PassiveAI(creature) { }
- void Reset() override
+ void JustAppeared() override
{
- int32 bp = 0;
- if (SpellInfo const* createdBySpell = sSpellMgr->GetSpellInfo(me->GetUInt32Value(UNIT_CREATED_BY_SPELL)))
- bp = createdBySpell->GetEffect(EFFECT_1).CalcValue();
-
- _scheduler.Schedule(1s, [this, bp](TaskContext consumption)
+ _scheduler.Schedule(2500ms, [this](TaskContext /*task*/)
{
- CastSpellExtraArgs args(false);
- if (bp)
- args.AddSpellBP0(bp);
- DoCastSelf(SPELL_CONSUMPTION, args);
- consumption.Repeat();
+ DoCastSelf(SPELL_CONSUMPTION);
});
}
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 7f02bda1e46..fc753e61b0e 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -1119,6 +1119,32 @@ private:
int32 _damagePct;
};
+// 28865 - Consumption
+// 64208 - Consumption
+class spell_gen_consumption : public SpellScript
+{
+ PrepareSpellScript(spell_gen_consumption);
+
+ void HandleDamageCalc(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ if (!caster || caster->GetTypeId() != TYPEID_UNIT)
+ return;
+
+ uint32 damage = 0;
+ if (SpellInfo const* createdBySpell = sSpellMgr->GetSpellInfo(caster->GetUInt32Value(UNIT_CREATED_BY_SPELL)))
+ damage = createdBySpell->GetEffect(EFFECT_1).CalcValue();
+
+ if (damage)
+ SetEffectValue(damage);
+ }
+
+ void Register() override
+ {
+ OnEffectLaunchTarget += SpellEffectFn(spell_gen_consumption::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
+ }
+};
+
// 63845 - Create Lance
enum CreateLanceSpells
{
@@ -4556,6 +4582,7 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_clone);
RegisterSpellScript(spell_gen_clone_weapon);
RegisterSpellScript(spell_gen_clone_weapon_aura);
+ RegisterSpellScript(spell_gen_consumption);
RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_default_count_pct_from_max_hp");
RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_50pct_count_pct_from_max_hp", 50);
RegisterSpellScript(spell_gen_create_lance);