aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOvahlord <dreadkiller@gmx.de>2025-02-09 20:11:34 +0100
committerOvahlord <dreadkiller@gmx.de>2025-02-09 20:11:34 +0100
commitf7be217c941140609c412bc67d2f54854fd1d615 (patch)
tree9ef34d78ab43a8289215ac9dd1efc7ad7a39f4b8
parent0cb94ea082a58474d2ea1fa5166372c0bfcec48e (diff)
Scripts/Spells: fixed Lava Burst crit chance against targets affected by Flame Shock
-rw-r--r--sql/updates/world/cata_classic/2025_02_09_00_world.sql3
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp23
2 files changed, 26 insertions, 0 deletions
diff --git a/sql/updates/world/cata_classic/2025_02_09_00_world.sql b/sql/updates/world/cata_classic/2025_02_09_00_world.sql
new file mode 100644
index 00000000000..31d06babadb
--- /dev/null
+++ b/sql/updates/world/cata_classic/2025_02_09_00_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_sha_lava_burst';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(51505, 'spell_sha_lava_burst');
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index e50797350d4..eb25b9b6503 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -22,7 +22,30 @@
*/
#include "ScriptMgr.h"
+#include "SpellScript.h"
+#include "Unit.h"
+
+namespace Scripts::Spells::Shaman
+{
+ // 51505 - Lava Burst
+ class spell_sha_lava_burst : public SpellScript
+ {
+ void CalcCritChance(Unit const* victim, float& critChance)
+ {
+ // The crit chance against targets effected by the caster's Flame Shock spell is 100%
+ if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, flag128(0x10000000), GetCaster()->GetGUID()))
+ critChance = 100.0f;
+ }
+
+ void Register() override
+ {
+ OnCalcCritChance += SpellOnCalcCritChanceFn(spell_sha_lava_burst::CalcCritChance);
+ }
+ };
+}
void AddSC_shaman_spell_scripts()
{
+ using namespace Scripts::Spells::Shaman;
+ RegisterSpellScript(spell_sha_lava_burst);
}