aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2022_03_22_03_world_2021_11_20_02_world.sql14
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp18
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp17
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp27
4 files changed, 45 insertions, 31 deletions
diff --git a/sql/updates/world/master/2022_03_22_03_world_2021_11_20_02_world.sql b/sql/updates/world/master/2022_03_22_03_world_2021_11_20_02_world.sql
new file mode 100644
index 00000000000..23d953b6199
--- /dev/null
+++ b/sql/updates/world/master/2022_03_22_03_world_2021_11_20_02_world.sql
@@ -0,0 +1,14 @@
+-- It looked like 34000 and 34001 are heroic and normal entries but they're not. Even in CreatureDifficulty they are separate entries
+-- Spell 64206 is simply not used but looks like was created for heroic, 64207 probably triggers it
+-- We'll use 64209 as trigger of 64208
+UPDATE `serverside_spell` SET `ProcChance` = 101 WHERE `Id` = 64209;
+
+DELETE FROM `serverside_spell_effect` WHERE `SpellID`=64209;
+INSERT INTO `serverside_spell_effect` (`SpellID`, `Effect`, `EffectAura`, `EffectAuraPeriod`, `EffectChainAmplitude`, `ImplicitTarget1`) VALUES
+(64209,6,23,1000,1,1);
+
+UPDATE `spell_script_names` SET `ScriptName` = 'spell_gen_consumption' WHERE `ScriptName` = 'spell_four_horsemen_consumption';
+
+DELETE FROM `spell_script_names` WHERE `spell_id` = 64208 AND `ScriptName` = 'spell_gen_consumption';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(64208,'spell_gen_consumption');
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
index e3e14e4dc21..821f497c2c8 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
@@ -699,23 +699,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);
@@ -723,5 +706,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 bab377ba90e..c52bc7c6f8f 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
@@ -57,7 +57,7 @@ enum Spells
SPELL_HEART_LIGHTNING_TETHER = 64799,
// Void Zone
- SPELL_CONSUMPTION = 64208,
+ SPELL_CONSUMPTION = 64209,
// Life Spark
SPELL_ARCANE_POWER_STATE = 49411,
@@ -649,20 +649,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->m_unitData->CreatedBySpell, me->GetMap()->GetDifficultyID()))
- if (createdBySpell->GetEffects().size() > EFFECT_1)
- 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 26876ea5ade..a3074e46dae 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -1030,6 +1030,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;
+
+ int32 damage = 0;
+ if (SpellInfo const* createdBySpell = sSpellMgr->GetSpellInfo(caster->m_unitData->CreatedBySpell, GetCastDifficulty()))
+ 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
{
@@ -4853,6 +4879,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);