Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: Medhi2703 on September 03, 2015, 01:03:29 am

Title: [SOLVED] [QUESTION:WotlK] Some trouble with resources
Post by: Medhi2703 on September 03, 2015, 01:03:29 am
Hello everyone.
First, i'm sorry for my bad english(current&technics).
It's my first post and i have a problem. Haha.

I come here today because i have little problem.

I work actually on new Form for a new class.
It's simple, i work on Citizen class.
With this class, i create 3 form (like druid form)
I copy the line of the Catform on SpellShapeshiftForm.dbc to my new form (Light Fighter) with no morph.
And, i copy the line in spell.dbc for the new spell. I change the column 111 to new ID of my Shapeshift.
The form is ok but one thing don't work. The form don't change the mana to energy. :/

So i come here, if anyone have an idea for my problem.
Thanks for reading.

PS: I can upload my DBC file and some screen, if you want more information.
Title: Re: [QUESTION:WotlK] Some trouble with resources
Post by: XxXGenesisXxX on September 04, 2015, 04:49:51 pm
You need to add a new case to the forms and make it change to whatever resource you would prefer. You would also have to edit it in the handler and probably as a shared define as well.

Code: [Select]
   switch (form)
    {
        case FORM_GHOUL:
        case FORM_CAT:
        {
            if (getPowerType() != POWER_ENERGY)
                setPowerType(POWER_ENERGY);
            break;
        }
        case FORM_BEAR:
        {
            if (getPowerType() != POWER_RAGE)
                setPowerType(POWER_RAGE);
            break;
        }
        default:                                            // 0, for example
        {
            ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(getClass());
            if (cEntry && cEntry->PowerType < MAX_POWERS && uint32(getPowerType()) != cEntry->PowerType)
                setPowerType(Powers(cEntry->PowerType));
            break;
        }
    }

Player.cpp - Line 21210 (https://github.com/TrinityCore/TrinityCore/blob/614b5832ba96b4c5905ece5490a7b5d18c2f710b/src/server/game/Entities/Player/Player.cpp#L21210)
Title: Re: [QUESTION:WotlK] Some trouble with resources
Post by: Medhi2703 on September 05, 2015, 12:40:09 am
Thanks for you reply.
I fixed it with : Player.cpp, SpellAuraEffects.cpp, Unit.h and StatSystem.cpp
I would do an example tomorrow. :)