Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: Portals on March 30, 2016, 08:48:22 am

Title: [WotLk] [QUESTION] Hunter Pet Scaling?
Post by: Portals on March 30, 2016, 08:48:22 am
Is there a way to edit hunter pets scaling? imo they are super small and I just want to make them a bit bigger.
Title: Re: [WotLk] [QUESTION] Hunter Pet Scaling?
Post by: Grymskvll on March 31, 2016, 08:13:52 pm
Probably the easiest and cleanest way would be to change each hunter pet family's maxscale (and minscale if you want to change scale at minimum level too) in CreatureFamily.DBC (it's in your server's dbc folder). Seems like the server checks this DBC file and calculates what the pet's scale should be (between minscale and maxscale) based on the pet's level. As far as I can tell, this DBC is only used for pet scaling. See https://wowdev.wiki/DB/CreatureFamily

If you're using TrinityCore WotLK, you can see the below code from Pet.cpp to see how this is applied. You can also change this part to get more complex scaling, such as non-linear scaling:
Code: [Select]
   //scale
    CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family);
    if (cFamily && cFamily->minScale > 0.0f && petType == HUNTER_PET)
    {
        float scale;
        if (getLevel() >= cFamily->maxScaleLevel)
            scale = cFamily->maxScale;
        else if (getLevel() <= cFamily->minScaleLevel)
            scale = cFamily->minScale;
        else
            scale = cFamily->minScale + float(getLevel() - cFamily->minScaleLevel) / cFamily->maxScaleLevel * (cFamily->maxScale - cFamily->minScale);

        SetObjectScale(scale);
    }