feat(Core/Spells): Move Spell q1846 bending shinbone to spell scripts (#11106)

This commit is contained in:
IntelligentQuantum
2022-03-27 09:36:23 +04:30
committed by GitHub
parent b18dcb7b80
commit d1ac62ff6e
3 changed files with 33 additions and 11 deletions

View File

@@ -0,0 +1,5 @@
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1647923874715608181');
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_q1846_bending_shinbone');
INSERT INTO `spell_script_names` VALUES
(8856, 'spell_q1846_bending_shinbone');

View File

@@ -3782,17 +3782,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
{
switch (m_spellInfo->Id)
{
// Bending Shinbone
case 8856:
{
if (!itemTarget && m_caster->GetTypeId() != TYPEID_PLAYER)
return;
uint32 spell_id = roll_chance_i(20) ? 8854 : 8855;
m_caster->CastSpell(m_caster, spell_id, true, nullptr);
return;
}
// Brittle Armor - need remove one 24575 Brittle Armor aura
case 24590:
unitTarget->RemoveAuraFromStack(24575);

View File

@@ -840,6 +840,33 @@ public:
}
};
enum BendingShinbone
{
SPELL_BENDING_SHINBONE1 = 8854,
SPELL_BENDING_SHINBONE2 = 8855
};
class spell_q1846_bending_shinbone : public SpellScript
{
PrepareSpellScript(spell_q1846_bending_shinbone);
void HandleScriptEffect(SpellEffIndex /* effIndex */)
{
Item* target = GetHitItem();
Unit* caster = GetCaster();
if (!target && caster->GetTypeId() != TYPEID_PLAYER)
return;
uint32 const spellId = roll_chance_i(20) ? SPELL_BENDING_SHINBONE1 : SPELL_BENDING_SHINBONE2;
caster->CastSpell(caster, spellId, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q1846_bending_shinbone::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
// 9712 - Thaumaturgy Channel
enum ThaumaturgyChannel
{
@@ -2400,6 +2427,7 @@ void AddSC_quest_spell_scripts()
RegisterSpellScript(spell_q10985_light_of_the_naaru);
RegisterSpellScript(spell_q9718_crow_transform);
new spell_q55_sacred_cleansing();
RegisterSpellScript(spell_q1846_bending_shinbone);
RegisterSpellScript(spell_q2203_thaumaturgy_channel);
RegisterSpellScript(spell_q5206_test_fetid_skull);
RegisterSpellScript(spell_q6124_6129_apply_salve);