diff --git a/data/sql/updates/pending_db_world/rev_1713998045630729445.sql b/data/sql/updates/pending_db_world/rev_1713998045630729445.sql new file mode 100644 index 000000000..9fe74e25d --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1713998045630729445.sql @@ -0,0 +1,11 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 28865; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(28865,'spell_gen_consumption'); + +DELETE FROM `creature_template_spell` WHERE `CreatureID` = 16697; + +UPDATE `creature_template` SET `ScriptName` = '', `AIName` = 'SmartAI' WHERE `entry` = 16697; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 16697); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(16697, 0, 0, 0, 60, 0, 100, 0, 0, 0, 2500, 2500, 0, 0, 11, 28865, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Void Zone - On Update - Cast \'Consumption\''), +(16697, 0, 1, 0, 37, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Void Zone - On Initialize - Set Reactstate Passive'); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 572849a9b..c3bd17fa1 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -437,26 +437,9 @@ public: } }; -class spell_four_horsemen_consumption : public SpellScript -{ - PrepareSpellScript(spell_four_horsemen_consumption); - - void HandleDamageCalc(SpellEffIndex /*effIndex*/) - { - uint32 damage = GetCaster()->GetMap()->ToInstanceMap()->GetDifficulty() == REGULAR_DIFFICULTY ? 2750 : 4250; - SetHitDamage(damage); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_four_horsemen_consumption::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); - } -}; - void AddSC_boss_four_horsemen() { new boss_four_horsemen(); new spell_four_horsemen_mark(); - RegisterSpellScript(spell_four_horsemen_consumption); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 780577605..0b0d81091 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -5134,6 +5134,43 @@ class spell_gen_choking_vines : public AuraScript } }; + // 28865 - Consumption +class spell_gen_consumption : public SpellScript +{ + PrepareSpellScript(spell_gen_consumption); + + void CalculateDamage(SpellEffIndex /*effIndex*/) + { + Map* map = GetCaster()->GetMap(); + if (!map) + { + return; + } + int32 value = 0; + if (map->GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) // NAXX25 N + { + value = urand(4500, 4700); + } + else if (map->GetId() == 533) // NAXX10 N + { + value = urand(3000, 3200); + } + else if (map->GetId() == 532) // Karazhan + { + value = urand(1110, 1310); + } + if (value) + { + SetEffectValue(value); + } + } + + void Register() override + { + OnEffectLaunchTarget += SpellEffectFn(spell_gen_consumption::CalculateDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } +}; + void AddSC_generic_spell_scripts() { RegisterSpellScript(spell_silithyst); @@ -5287,5 +5324,6 @@ void AddSC_generic_spell_scripts() RegisterSpellScript(spell_gen_jubling_cooldown); RegisterSpellScript(spell_gen_yehkinya_bramble); RegisterSpellScript(spell_gen_choking_vines); + RegisterSpellScript(spell_gen_consumption); }