fix(Scripts/Spells): Linken's boomerang (#8179)
* fix(Scripts/Spells): Linken's boomerang * Update rev_1633027575141830731.sql
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1633027575141830731');
|
||||||
|
|
||||||
|
DELETE FROM `spell_script_names` WHERE `spell_id` = 15712 AND `ScriptName` = 'spell_item_linken_boomerang';
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (15712, 'spell_item_linken_boomerang');
|
||||||
|
|
||||||
@@ -4395,6 +4395,73 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum LinkenBoomerang
|
||||||
|
{
|
||||||
|
SPELL_DISARM = 15752,
|
||||||
|
SPELL_STUN = 15753,
|
||||||
|
CHANCE_TO_HIT = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
class spell_item_linken_boomerang : public SpellScriptLoader
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
spell_item_linken_boomerang() : SpellScriptLoader("spell_item_linken_boomerang") {}
|
||||||
|
|
||||||
|
class spell_item_linken_boomerang_SpellScript : public SpellScript
|
||||||
|
{
|
||||||
|
PrepareSpellScript(spell_item_linken_boomerang_SpellScript)
|
||||||
|
|
||||||
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||||
|
{
|
||||||
|
return ValidateSpellInfo({SPELL_DISARM, SPELL_STUN});
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnEffectHitTargetDisarm(SpellEffIndex effIndex)
|
||||||
|
{
|
||||||
|
PreventHitDefaultEffect(effIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnEffectHitTargetStun(SpellEffIndex effIndex)
|
||||||
|
{
|
||||||
|
PreventHitDefaultEffect(effIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnEffectLaunchTargetDisarm(SpellEffIndex effIndex)
|
||||||
|
{
|
||||||
|
PreventHitDefaultEffect(effIndex);
|
||||||
|
|
||||||
|
if (roll_chance_i(CHANCE_TO_HIT)) // 3% from wiki
|
||||||
|
{
|
||||||
|
GetCaster()->CastSpell(GetHitUnit(), SPELL_DISARM, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnEffectLaunchTargetStun(SpellEffIndex effIndex)
|
||||||
|
{
|
||||||
|
PreventHitDefaultEffect(effIndex);
|
||||||
|
|
||||||
|
if (roll_chance_i(CHANCE_TO_HIT)) // 3% from wiki
|
||||||
|
{
|
||||||
|
GetCaster()->CastSpell(GetHitUnit(), SPELL_STUN, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register() override
|
||||||
|
{
|
||||||
|
OnEffectLaunchTarget += SpellEffectFn(spell_item_linken_boomerang_SpellScript::OnEffectLaunchTargetDisarm, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL);
|
||||||
|
OnEffectLaunchTarget += SpellEffectFn(spell_item_linken_boomerang_SpellScript::OnEffectLaunchTargetStun, EFFECT_2, SPELL_EFFECT_TRIGGER_SPELL);
|
||||||
|
|
||||||
|
OnEffectHitTarget += SpellEffectFn(spell_item_linken_boomerang_SpellScript::OnEffectHitTargetDisarm, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL);
|
||||||
|
OnEffectHitTarget += SpellEffectFn(spell_item_linken_boomerang_SpellScript::OnEffectHitTargetStun, EFFECT_2, SPELL_EFFECT_TRIGGER_SPELL);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
SpellScript* GetSpellScript() const override
|
||||||
|
{
|
||||||
|
return new spell_item_linken_boomerang_SpellScript();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void AddSC_item_spell_scripts()
|
void AddSC_item_spell_scripts()
|
||||||
{
|
{
|
||||||
// Ours
|
// Ours
|
||||||
@@ -4504,4 +4571,5 @@ void AddSC_item_spell_scripts()
|
|||||||
new spell_item_greatmothers_soulcatcher();
|
new spell_item_greatmothers_soulcatcher();
|
||||||
new spell_item_eggnog();
|
new spell_item_eggnog();
|
||||||
new spell_item_goblin_bomb();
|
new spell_item_goblin_bomb();
|
||||||
|
new spell_item_linken_boomerang();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user