diff options
author | Ovahlord <dreadkiller@gmx.de> | 2024-07-31 11:34:42 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-07-31 11:34:42 +0200 |
commit | 0a56248fb4c714747c617e0cae6ee9d6b4be67b5 (patch) | |
tree | 60e8b154bde5d4cc302205a34705a90e8da36fee | |
parent | 2401e32c552ac119666bd2e27de9fb4b064868e1 (diff) |
Core/Spells: fixed Eviscerate damage calculation
-rw-r--r-- | sql/updates/world/cata_classic/2024_07_31_00_world.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_rogue.cpp | 25 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sql/updates/world/cata_classic/2024_07_31_00_world.sql b/sql/updates/world/cata_classic/2024_07_31_00_world.sql new file mode 100644 index 00000000000..1486ab9ac2d --- /dev/null +++ b/sql/updates/world/cata_classic/2024_07_31_00_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_rog_eviscerate'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(2098, 'spell_rog_eviscerate'); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 619676b5b4c..f63117299f5 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -22,7 +22,32 @@ */ #include "ScriptMgr.h" +#include "SpellInfo.h" +#include "SpellScript.h" +#include "Unit.h" + +// 2098 - Eviscerate +class spell_rog_eviscerate : public SpellScript +{ + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }); + } + + // Damage: effectValue + (basePoints * Combo) + (AP * 0.091 * Combo) + void CalculateDamage(Unit* /*victim*/, int32& /*damage*/, int32& flatMod, float& /*pctMod*/) const + { + int32 combo = GetCaster()->GetPower(POWER_COMBO_POINTS); + flatMod += (GetSpellInfo()->GetEffect(EFFECT_0).BasePoints * combo) + (GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK) * 0.091f * combo); + } + + void Register() override + { + CalcDamage += SpellCalcDamageFn(spell_rog_eviscerate::CalculateDamage); + } +}; void AddSC_rogue_spell_scripts() { + RegisterSpellScript(spell_rog_eviscerate); } |