Open lingxDEV opened 4 years ago
This is what I have so far - working as intended.
SPELL_ROGUE_RELENTLESS_STRIKES = 58423,
SPELL_ROGUE_RELENTLESS_STRIKES_ENERGIZE = 98440
// Called by all finishing moves (Eviscerate 2098, Kidney Shot 408, Slice and Dice 5171, Rupture 1943, Crimson Tempest 121411)
// Relentless Strikes - 58423
class spell_rog_relentless_strikes : public SpellScriptLoader
{
public:
spell_rog_relentless_strikes() : SpellScriptLoader("spell_rog_relentless_strikes") { }
class spell_rog_relentless_strikes_SpellScript : public SpellScript
{
PrepareSpellScript(spell_rog_relentless_strikes_SpellScript);
void HandleAfterHit()
{
if (!GetCaster())
return;
if (Player* _player = GetCaster()->ToPlayer())
{
if (Unit* target = GetHitUnit())
{
if (_player->HasAura(SPELL_ROGUE_RELENTLESS_STRIKES))
{
uint32 cp = _player->GetComboPoints();
if (roll_chance_i(cp * 20))
_player->CastSpell(_player, SPELL_ROGUE_RELENTLESS_STRIKES_ENERGIZE, true);
}
}
}
}
void Register()
{
AfterHit += SpellHitFn(spell_rog_relentless_strikes_SpellScript::HandleAfterHit);
}
};
SpellScript* GetSpellScript() const
{
return new spell_rog_relentless_strikes_SpellScript();
}
};
new spell_rog_relentless_strikes();
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('408', 'spell_rog_relentless_strikes');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('1943', 'spell_rog_relentless_strikes');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('2098', 'spell_rog_relentless_strikes');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('5171', 'spell_rog_relentless_strikes');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('121411', 'spell_rog_relentless_strikes');
Current behaviour:
Relentless Strikes does nothing.
Expected behaviour:
As the tooltip states.
Steps to reproduce the problem:
SF rev. hash/commit:
Skyfire rev. 7f1a4abd1b9f+
SFDB version:
stable5
Operating system:
win10 64