Sign in to follow this  
Followers 0
zachrunner3241

[Declined][Legion]: Jump to Skyhold

2 posts in this topic

Title: Jump to Skyhold
Bugtracker Link:


Patch Content:

 

Correction: Adds proper retail-like jump animation before teleporting the player to Skyhold

 

C++ part:

enum WarriorSpells
{ 	
    SPELL_WARRIOR_JUMP_TO_SKYHOLD_AURA              = 215997,
    SPELL_WARRIOR_JUMP_TO_SKYHOLD_JUMP              = 192085,
    SPELL_WARRIOR_JUMP_TO_SKYHOLD_TELEPORT          = 216016,
};


// Jump to Skyhold Jump - 192085
class spell_warr_jump_to_skyhold : public SpellScriptLoader
{
public:
    spell_warr_jump_to_skyhold() : SpellScriptLoader("spell_warr_jump_to_skyhold") {}

    class spell_warr_jump_to_skyhold_SpellScript : public SpellScript
    {
        PrepareSpellScript(spell_warr_jump_to_skyhold_SpellScript);

        bool Validate(SpellInfo const* /*spellInfo*/) override
        {
            if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_JUMP_TO_SKYHOLD_TELEPORT))
                return false;
            return true;
        }

        void HandleJump(SpellEffIndex effIndex)
        {
            PreventHitDefaultEffect(effIndex);

            if (Unit* caster = GetCaster())
            {
                float pos_x = caster->GetPositionX();
                float pos_y = caster->GetPositionY();
                float pos_z = caster->GetPositionZ() + 30.0f;

                JumpArrivalCastArgs arrivalCast;
                arrivalCast.SpellId = SPELL_WARRIOR_JUMP_TO_SKYHOLD_TELEPORT;
                arrivalCast.Target = caster->GetGUID();
                caster->GetMotionMaster()->MoveJump(pos_x, pos_y, pos_z, caster->GetOrientation(), 20.f, 20.f, EVENT_JUMP, false, &arrivalCast);

                caster->RemoveAurasDueToSpell(SPELL_WARRIOR_JUMP_TO_SKYHOLD_AURA);
            }
        }

        void Register() override
        {
            OnEffectLaunch += SpellEffectFn(spell_warr_jump_to_skyhold_SpellScript::HandleJump, EFFECT_0, SPELL_EFFECT_JUMP_DEST);
        }
    };

    SpellScript* GetSpellScript() const override
    {
        return new spell_warr_jump_to_skyhold_SpellScript();
    }
};

void AddSC_warrior_spell_scripts()
{
   new spell_warr_jump_to_skyhold();
}

SQL part: 

REPLACE INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `VerifiedBuild`) VALUES 
(216016, 0, 1479, 1028.64, 7225.23, 100.18, 26654);
REPLACE INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES 
(192085, 'spell_warr_jump_to_skyhold');

 

 

Edited by zachrunner3241

Share this post


Link to post
Share on other sites

Greetings Zachrunner3241,

Unfortunately, we can't accept any C++ patch, only SQL patches are accepted. Anyway, thank you for your work.

Regards, Thyvene.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0