ProjectSkyfire / SkyFire_548

SkyFireEMU is a full featured World of Warcraft: Mists of Pandaria emulator written in C++. || Compatible with World of Warcraft client 5.4.8 (Build: 18414) Project Established in 2011 || Support on Discord https://discord.gg/DnKZycD
http://www.projectskyfire.org
GNU General Public License v3.0
499 stars 421 forks source link

[SPELL/ROGUE/COMBAT] Revealing Strike #968

Open lingxDEV opened 4 years ago

lingxDEV commented 4 years ago

Current behaviour:

Revealing Strike only gives the debuff on the target, but it has no effect.

Expected behaviour:

Should give a chance to gain 2 combo points when using Sinister Strike. Should make offensive finishers 35% more efficient. (this means that Eviscerate should do 35% more damage, Kidney Shot should last 35% longer, etc.)

Steps to reproduce the problem:

  1. Make a rogue
  2. Spec into Combat > Use Revealing Strike > Get 5 combo points > use Kidney Shot > See that it only lasts 6 seconds (should last 8,1 seconds)
  3. Use Eviscerate at 5 combo points a bunch of times, see the average damage
  4. Do the same, but with Revealing Strike and see that it's the same damage being done
  5. While Revealing Strike is active, use Sinister Strike a bunch of times, see that you will never get 2 combo points.

SF rev. hash/commit:

Skyfire rev. 164451ca0b0b

SFDB version:

stable5

Operating system:

win10 64

lingxDEV commented 4 years ago

Wrote the logic for Kidney Shot increased duration.

Need to add 35% more damage to Eviscerate, 35% increased damage for Rupture.

Also need to add logic for when Target is affected by Revealing Strikes, the rogue has a 20% chance when using Sinister Strike, to add an extra combo point.

    ROGUE_SPELL_KIDNEY_SHOT                         = 408,
    ROGUE_SPELL_REVEALING_STRIKE                    = 84617

// Called by Kidney Shot - 408
// Revealing Strike
class spell_rog_revealing_strike : public SpellScriptLoader
{
public:
    spell_rog_revealing_strike() : SpellScriptLoader("spell_rog_revealing_strike") { }

    class spell_rog_revealing_strike_SpellScript : public SpellScript
    {
        PrepareSpellScript(spell_rog_revealing_strike_SpellScript);

        void HandleOnHit()
        {
            if (GetSpellInfo()->Id != ROGUE_SPELL_KIDNEY_SHOT)
                return;

            if (!GetCaster())
                return;

            if (Unit* caster = GetCaster())
            {
                if (Unit* target = GetHitUnit())
                {
                    if (target->HasAura(ROGUE_SPELL_REVEALING_STRIKE, caster->GetGUID()))
                    {
                        if (Aura* kidney = target->GetAura(ROGUE_SPELL_KIDNEY_SHOT, caster->GetGUID()))
                        {
                            int32 duration = kidney->GetMaxDuration();
                            AddPct(duration, 35);
                            kidney->SetMaxDuration(duration);
                            kidney->RefreshDuration();
                        }
                    }
                }
            }
        }

        void Register()
        {
            OnHit += SpellHitFn(spell_rog_revealing_strike_SpellScript::HandleOnHit);
        }
    };

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

new spell_rog_revealing_strike();

INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES ('408', 'spell_rog_revealing_strike');