Scripts/Spells: fixed Lava Burst crit chance against targets affected by Flame Shock

This commit is contained in:
Ovahlord
2025-02-09 20:11:34 +01:00
parent 0cb94ea082
commit f7be217c94
2 changed files with 26 additions and 0 deletions

View File

@@ -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');

View File

@@ -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);
}