• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

SkyFire [Skyfire 2.4.3] Server Sided Custom Mounts Script

Bloodfangx

Emulation Addict
Greetings EmuDevs Community,

Decided I'd finally register on this community, was a long lurker for a while would read but never posted/released anything.

Its a extremely simple custom mount script that uses basic event, there's some limitations however it uses spells that are already in the game.

Tool tips for spells will show you mounted on you defined spell of choice I used spectral tiger as an example.

Logging off obviously removes the display id so it would show you mounted on the defined mount spell when you log back in.

Couldn't find anything like this while searching, coded it around 6-7 months ago hopefully someone will make use of it.

*EDIT* when you create the mount item use a spell such as http://www.wowhead.com/spell=33208/gossip-npc-periodic-talk (this has no cast time, the script will trigger the mount spell)
* This may not work on base Skyfire 2.4.3, the core i was working on has had years of modifications, it should work on trinitycore and emus alike however.
* If you want to use this on Trinitycore change
Code:
if (player->HasAura(SPELL_MOUNT_SPECTRAL_TIGER, 1)) //Check if mounted before changing mount visual, prevents bugs
to
Code:
 if (player->HasAura(SPELL_MOUNT_SPECTRAL_TIGER)) //Check if mounted before changing mount visual, prevents bugs

Enjoy, Bfx

Code:
/*
// Author: Bfx (Bloodfangx for short)
*/

#include "ScriptPCH.h"
#include "Player.h"

enum mount_timer
{
    MOUNT_TIMER = 3000,
};

enum MountSpells
{
    SPELL_MOUNT_SPECTRAL_TIGER = 42777, //We use this as the actual mount spell, the display id overrides it via the script.
};

enum MountDisplayIds
{
    RABID_BEAR_MOUNT_DISPLAY_ID = 1082,
};

/* [Reins Of The Custom Bear] */
class item_reins_of_the_custom_bear : public ItemScript
{
public:
    item_reins_of_the_custom_bear() : ItemScript("item_reins_of_the_custom_bear") { }

    bool OnUse(Player* player, Item* item, SpellCastTargets const& targets)
    {
        player->CastSpell(player, SPELL_MOUNT_SPECTRAL_TIGER, false); //A mount spell to modify ground movement speed
        player->m_Events.AddEvent(new reins_of_the_custom_bear_handler(player), player->m_Events.CalculateTime(MOUNT_TIMER)); // OnUse is instant so we need to delay the changing of mount visual until cast is complete.
        return true;
    }

    class reins_of_the_custom_bear_handler : public BasicEvent
    {
    public:
        reins_of_the_custom_bear_handler(Player* player) : player(player) {}

        bool Execute(uint64 /*time*/, uint32 /*diff*/)
        {
            if (player->HasAura(SPELL_MOUNT_SPECTRAL_TIGER, 1)) //Check if mounted before changing mount visual, prevents bugs
            {
                player->Mount(RABID_BEAR_MOUNT_DISPLAY_ID); //The custom mount display id
            }
            return true;
        }
        Player* player;
    };
};

void AddSC_item_custom_mounts() 
{
    new item_reins_of_the_custom_bear();
}
 
Last edited:
Top