Main Menu
Events Calendar

Latest Threads
What is glistening
Last Post: Maulbane
07-30-2020 03:21 AM
» Replies: 8
» Views: 2418
Where Are You Now?
Last Post: therew
07-17-2020 09:42 AM
» Replies: 12
» Views: 317
You are a fond memory. Good night, CoTH...
Last Post: CappnRob
05-01-2020 08:05 PM
» Replies: 32
» Views: 84930
You Can't Go Home Again
Last Post: Scout
03-15-2019 09:24 PM
» Replies: 0
» Views: 1986
"Years of Service" Awards
Last Post: Maulbane
05-26-2018 09:58 PM
» Replies: 100
» Views: 3349

Who's Online
There are currently no members online.

Google AdStuff

Morph Items
Hey guys!

Just wanted to briefly mention this what with the whole durgen focus going on and with new special profiles but in case @Kretol maybe hasn't investigated it yet you can tie commands to items with a touch of C++ coding which would allow you to make items that toggle a morph on and off without GM powarz.

I haven't done it in a while but if I recall correctly it was super easy, anyway just thought I'd throw it out there.
[Image: Signature.png]
[-] The following 6 users Like Vrahn's post:
  • flammos200, Beltharean, Scout, SachikoMaeda, Kira13, ThePharaoh
Useful for Druids of the Flame.
"Every gun..."

[Image: Jonah-Hex-Counting-Corpses-Flaming-Leap.jpg]

"...Makes its own tune."

~ The Good, the Bad, and the Ugly ~
[-] The following 1 user Likes Beltharean's post:
  • Scout
I remember talking with him a bit ago (actually about Druids of the Antler, not Flame) and he said that he didn't know if such a thing was capable, and, if so, didn't know how to do it. Perhaps if you could give a small example or tutorial, Vrahn, it might be good?
Would be nice to have that on my succubus as well, so I won't have to roll other characters for disguises.
[Image: pj3isZU.gif]

[Image: 43883.png]
(09-18-2014, 08:36 AM)Beltharean Wrote: Useful for Druids of the Flame.

For a temporary measure, try looking in the Firelands raiding zone for those burning seedpods. They have a drop that will let you turn into a firecat until you leave the form.
I've got my birthday this weekend so I'm pretty busy, I'll try and dig up a sample to post.
[Image: Signature.png]
[-] The following 1 user Likes Vrahn's post:
  • FlyingSquirrel


So, after preforming the fun task that is tracking down all the dependencies to compile TrinityCore I took a quick look into the source code. It's been a looong time but basically this would be the deal, you need to register a new item script class for morph items, this class inherits ItemScript and has a function OnUse which handles code when the item is activated, so the dirt simplest way of doing this would be to make a script for each morph ID you wanted to create and compile it each time for separate items. A fancier way of doing it would be to make a generic handler script that pulled the associated display ID match from a database table that links item GUIDs to display IDs or something similar.

Below I'm pasting an excerpt from cs_modify.cpp which contains the handler for the GM Morph command:
static bool HandleModifyMorphCommand(ChatHandler* handler, const char* args)
        if (!*args)
            return false;

        uint16 display_id = (uint16)atoi((char*)args);

        Unit* target = handler->getSelectedUnit();
        if (!target)
            target = handler->GetSession()->GetPlayer();

        // check online security
        else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), ObjectGuid::Empty))
            return false;


        return true;

As we can see the obvious part here is assign the target based on the user's target OR just target themselves, then use the SetDisplayId function in the Unit class. (Plus some security / sanity checks, etc.)

So like.... super roughly in untested code, you're looking at adding something like the following in the item_scripts.cpp file:

class item_morph_player : public ItemScript
    item_morph_player() : ItemScript("item_morph_player") { }

    bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) override
        return true;

Again, untested but that should really be it for the simple version. Don't forget you need to register the new class and then associate it to an item which I think is just a database field in the items table. If the above doesn't work you may have to cast Player to Unit, but if memory serves it shouldn't be necessary.

Note that the above is only morphing the user, to do a toggle you'd need to do a check on the player's display ID and if it is different set it to that, otherwise demorph them back to the default display ID, relevant code should be easily located in the Handle Demorph block in cs_modify.cpp.

Let me know if you want any further info.

[Image: Signature.png]
[-] The following 5 users Like Vrahn's post:
  • FlyingSquirrel, SachikoMaeda, Sorum, Beltharean, ThePharaoh

Possibly Related Threads…
Thread Author Replies Views Last Post
  Forum gold/Purchasable Items Harmonic 18 2,873 01-28-2014, 08:07 AM
Last Post: ProjectRandom
  Adding custom items to vendors? FlyingSquirrel 9 1,557 01-03-2014, 11:45 AM
Last Post: FlyingSquirrel
  Tanuka NPC items? Dae 1 508 11-03-2013, 12:35 PM
Last Post: Maarten
  List of Spawnable Items c0rzilla 10 1,169 09-21-2013, 10:01 PM
Last Post: Reigen
  Druid of the Flame Items [Cosmetic] c0rzilla 11 1,081 08-16-2013, 10:51 PM
Last Post: Harmonic

Users browsing this thread: 1 Guest(s)

This forum uses Lukasz Tkacz MyBB addons.