SkyFire_548 icon indicating copy to clipboard operation
SkyFire_548 copied to clipboard

[SPELL/ROGUE/COMBAT] Ruthlessness

Open lingxDEV opened this issue 4 years ago • 2 comments

Current behaviour:

Ruthlessness does not work.

Expected behaviour:

Gives your finishing moves a 20% chance per combo point to add a combo point to your target.

Steps to reproduce the problem:

  1. Make a rogue
  2. Spec into Combat > Stack 5 combo points > use a Eviscerate (or any other finisher) > see that you don't get a combo point on the target.

SF rev. hash/commit:

Skyfire rev. 164451ca0b0b

SFDB version:

stable5

Operating system:

win10 64

lingxDEV avatar Sep 18 '20 08:09 lingxDEV

    ROGUE_SPELL_RUTHLESSNESS                        = 14161,
    ROGUE_SPELL_ADD_COMBO_POINT                     = 139546

// Called by Crimson Tempest - 121411, Deadly Throw - 26679, Eviscerate - 2098, Kidney Shot - 408, Recuperate - 73651, Rupture - 1943, Slice and Dice - 5171
// Ruthlessness - 14161
class spell_rog_ruthlessness : public SpellScriptLoader
{
public:
    spell_rog_ruthlessness() : SpellScriptLoader("spell_rog_ruthlessness") { }

    class spell_rog_ruthlessness_SpellScript : public SpellScript
    {
        PrepareSpellScript(spell_rog_ruthlessness_SpellScript);

        void HandleAfterHit()
        {
            if (!GetCaster())
                return;

            if (Player* _player = GetCaster()->ToPlayer())
            {
                if (Unit* target = GetHitUnit())
                {
                    if (_player->HasAura(ROGUE_SPELL_RUTHLESSNESS))
                    {
                        uint32 cp = _player->GetComboPoints();
                        if (roll_chance_i(cp * 20))
                            _player->CastSpell(target, ROGUE_SPELL_ADD_COMBO_POINT, true);
                    }
                }
            }
        }

        void Register()
        {
            AfterHit += SpellHitFn(spell_rog_ruthlessness_SpellScript::HandleAfterHit);
        }
    };

    SpellScript* GetSpellScript() const
    {
        return new spell_rog_ruthlessness_SpellScript();
    }
};


new spell_rog_ruthlessness();



INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('121411', 'spell_rog_ruthlessness');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('26679', 'spell_rog_ruthlessness');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('2098', 'spell_rog_ruthlessness');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('408', 'spell_rog_ruthlessness');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('73651', 'spell_rog_ruthlessness');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('1943', 'spell_rog_ruthlessness');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('5171', 'spell_rog_ruthlessness');

This is what I have to far. The logic is working and finisher does give a combo point. The only problem is, that it awards the combo point BEFORE the finisher goes off, so the combo point is added before the finisher, rather than after.

lingxDEV avatar Sep 19 '20 08:09 lingxDEV

Might have to do an AfterCast += SpellCastFn? Or perhaps check if the finisher is done? Not sure

Crypticaz avatar Jul 14 '21 18:07 Crypticaz