diff --git a/data/sql/updates/pending_db_world/rev_1639551676154983666.sql b/data/sql/updates/pending_db_world/rev_1639551676154983666.sql new file mode 100644 index 000000000..99d1586fd --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1639551676154983666.sql @@ -0,0 +1,13 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1639551676154983666'); + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN +('spell_four_horsemen_consumption', + 'spell_rajaxx_thundercrash', + 'spell_gen_arcane_charge', + 'spell_pet_dk_gargoyle_strike'); + +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(28865, 'spell_four_horsemen_consumption'), +(25599, 'spell_rajaxx_thundercrash'), +(45072, 'spell_gen_arcane_charge'), +(51963, 'spell_pet_dk_gargoyle_strike'); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 9d826a3cc..420c1a5e5 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -343,37 +343,6 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) damage /= count; // divide to all targets } - - switch (m_spellInfo->Id) // better way to check unknown - { - // Consumption - case 28865: - damage = (m_caster->GetMap()->ToInstanceMap()->GetDifficulty() == REGULAR_DIFFICULTY ? 2750 : 4250); - break; - // percent from health with min - case 25599: // Thundercrash - { - damage = unitTarget->GetHealth() / 2; - if (damage < 200) - damage = 200; - break; - } - // arcane charge. must only affect demons (also undead?) - case 45072: - { - if (unitTarget->GetCreatureType() != CREATURE_TYPE_DEMON - && unitTarget->GetCreatureType() != CREATURE_TYPE_UNDEAD) - return; - break; - } - // Gargoyle Strike - case 51963: - { - // about +4 base spell dmg per level - damage = (m_caster->getLevel() - 60) * 4 + 60; - break; - } - } break; } case SPELLFAMILY_WARRIOR: diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp index b1727873b..d9587d28e 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -17,6 +17,7 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" #include "ruins_of_ahnqiraj.h" enum Yells @@ -124,7 +125,29 @@ public: } }; +class spell_rajaxx_thundercrash : public SpellScript +{ + PrepareSpellScript(spell_rajaxx_thundercrash); + + void HandleDamageCalc(SpellEffIndex /*effIndex*/) + { + int32 damage = GetHitUnit()->GetHealth() / 2; + if (damage < 200) + { + damage = 200; + } + + SetHitDamage(damage); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_rajaxx_thundercrash::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } +}; + void AddSC_boss_rajaxx() { new boss_rajaxx(); + RegisterSpellScript(spell_rajaxx_thundercrash); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 2b83e104f..e4ed8481f 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -431,8 +431,25 @@ 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/Pet/pet_dk.cpp b/src/server/scripts/Pet/pet_dk.cpp index ecfa49df8..e8bd58629 100644 --- a/src/server/scripts/Pet/pet_dk.cpp +++ b/src/server/scripts/Pet/pet_dk.cpp @@ -28,6 +28,7 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellAuraEffects.h" +#include "SpellScript.h" // TODO: this import is not necessary for compilation and marked as unused by the IDE // however, for some reasons removing it would cause a damn linking issue @@ -306,10 +307,35 @@ public: } }; +class spell_pet_dk_gargoyle_strike : public SpellScript +{ + PrepareSpellScript(spell_pet_dk_gargoyle_strike); + + void HandleDamageCalc(SpellEffIndex /*effIndex*/) + { + int32 damage = 60; + if (Unit* caster = GetCaster()) + { + if (caster->getLevel() >= 60) + { + damage += (caster->getLevel() - 60) * 4; + } + } + + SetHitDamage(damage); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_pet_dk_gargoyle_strike::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } +}; + void AddSC_deathknight_pet_scripts() { new npc_pet_dk_ebon_gargoyle(); new npc_pet_dk_ghoul(); new npc_pet_dk_army_of_the_dead(); new npc_pet_dk_dancing_rune_weapon(); + RegisterSpellScript(spell_pet_dk_gargoyle_strike); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index bb481e775..bb95d8c13 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -4363,6 +4363,29 @@ class spell_gen_holiday_buff_food : public AuraScript } }; +class spell_gen_arcane_charge : public SpellScript +{ + PrepareSpellScript(spell_gen_arcane_charge); + + SpellCastResult CheckRequirement() + { + if (Unit* target = GetExplTargetUnit()) + { + if (target->GetCreatureType() != CREATURE_TYPE_DEMON && target->GetCreatureType() != CREATURE_TYPE_UNDEAD) + { + return SPELL_FAILED_DONT_REPORT; + } + } + + return SPELL_CAST_OK; + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_gen_arcane_charge::CheckRequirement); + } +}; + void AddSC_generic_spell_scripts() { RegisterSpellScript(spell_silithyst); @@ -4495,4 +4518,5 @@ void AddSC_generic_spell_scripts() RegisterSpellScript(spell_gen_charmed_unit_spell_cooldown); RegisterSpellScript(spell_contagion_of_rot); RegisterSpellScript(spell_gen_holiday_buff_food); + RegisterSpellScript(spell_gen_arcane_charge); }