Jump to content

Druid Forms - cosmetics


Auntie Mangos

Recommended Posts

  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

  • 39 years later...

What does this do:

It switches display ID depending on player's racial features.

I cannot guarantee correctness of these IDs ( some are very similar ), but it is easy to correct them

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index bd852d8..8fa949f 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -2783,85 +2783,36 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
    switch(form)
    {
        case FORM_CAT:
-            if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
-                modelid = 892;
-            else
-                modelid = 8571;
            PowerType = POWER_ENERGY;
            break;
-        case FORM_TRAVEL:
-            modelid = 632;
-            break;
-        case FORM_AQUA:
-            if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
-                modelid = 2428;
-            else
-                modelid = 2428;
-            break;
        case FORM_BEAR:
-            if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
-                modelid = 2281;
-            else
-                modelid = 2289;
-            PowerType = POWER_RAGE;
-            break;
-        case FORM_GHOUL:
-            if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
-                modelid = 10045;
-            break;
        case FORM_DIREBEAR:
-            if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
-                modelid = 2281;
-            else
-                modelid = 2289;
+        case FORM_BATTLESTANCE:
+        case FORM_BERSERKERSTANCE:
+        case FORM_DEFENSIVESTANCE:
            PowerType = POWER_RAGE;
            break;
+        case FORM_TRAVEL:
+        case FORM_AQUA:
+        case FORM_GHOUL:
        case FORM_CREATUREBEAR:
-            modelid = 902;
-            break;
        case FORM_GHOSTWOLF:
-            modelid = 4613;
-            break;
        case FORM_FLIGHT:
-            if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
-                modelid = 20857;
-            else
-                modelid = 20872;
-            break;
        case FORM_MOONKIN:
-            if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
-                modelid = 15374;
-            else
-                modelid = 15375;
-            break;
        case FORM_FLIGHT_EPIC:
-            if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
-                modelid = 21243;
-            else
-                modelid = 21244;
-            break;
        case FORM_METAMORPHOSIS:
-            modelid = 25277;
-            break;
        case FORM_AMBIENT:
        case FORM_SHADOW:
        case FORM_STEALTH:
-            break;
        case FORM_TREE:
-            modelid = 864;
-            break;
-        case FORM_BATTLESTANCE:
-        case FORM_BERSERKERSTANCE:
-        case FORM_DEFENSIVESTANCE:
-            PowerType = POWER_RAGE;
-            break;
        case FORM_SPIRITOFREDEMPTION:
-            modelid = 16031;
            break;
        default:
            sLog.outError("Auras: Unknown Shapeshift Type: %u, SpellId %u.", m_modifier.m_miscvalue, GetId());
    }

+    modelid = m_target->GetModelForForm(form);
+
    // remove polymorph before changing display id to keep new display id
    switch ( form )
    {
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index ea2837a..ea4b31e 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -12424,3 +12424,203 @@ void Unit::KnockBackFrom(Unit* target, float horizintalSpeed, float verticalSpee
        NearTeleportTo(fx, fy, fz, GetOrientation(), this == target);
    }
}
+
+uint32 Unit::GetModelForForm(ShapeshiftForm form)
+{
+    switch(form)
+    {
+        case FORM_CAT:
+            // Based on Hair color
+            if (getRace() == RACE_NIGHTELF)
+            {
+                uint8 hairColor = GetByteValue(PLAYER_BYTES, 3);
+                switch (hairColor)
+                {
+                    case 7: // Violet
+                    case 8: 
+                        return 29405;
+                    case 3: // Light Blue
+                        return 29406;
+                    case 0: // Green
+                    case 1: // Light Green
+                    case 2: // Dark Green
+                        return 29407;
+                    case 4: // White
+                        return 29408;
+                    default: // original - Dark Blue
+                        return 892;
+                }
+            }
+            // Based on Skin color
+            else if (getRace() == RACE_TAUREN)
+            {
+                uint8 skinColor = GetByteValue(PLAYER_BYTES, 0);
+                // Male
+                if (getGender() == GENDER_MALE)
+                {
+                    switch(skinColor)
+                    {
+                        case 12: // White
+                        case 13:
+                        case 14:
+                        case 18: // Completly White
+                            return 29409;
+                        case 9: // Light Brown
+                        case 10:
+                        case 11:
+                            return 29410;
+                        case 6: // Brown 
+                        case 7:
+                        case 8:
+                            return 29411;
+                        case 0: // Dark
+                        case 1:
+                        case 2:
+                        case 3: // Dark Grey
+                        case 4:
+                        case 5:
+                            return 29412;
+                        default: // original - Grey
+                            return 8571;
+                    }
+                }
+                // Female
+                else switch (skinColor)
+                {
+                    case 10: // White
+                        return 29409;
+                    case 6: // Light Brown
+                    case 7:
+                        return 29410;
+                    case 4: // Brown
+                    case 5:
+                        return 29411;
+                    case 0: // Dark
+                    case 1:
+                    case 2:
+                    case 3:
+                        return 29412;
+                    default: // original - Grey
+                        return 8571;
+                }
+            }
+            else if(Player::TeamForRace(getRace())==ALLIANCE)
+                return 892;
+            else
+                return 8571;
+        case FORM_DIREBEAR:
+        case FORM_BEAR:
+            // Based on Hair color
+            if (getRace() == RACE_NIGHTELF)
+            {
+                uint8 hairColor = GetByteValue(PLAYER_BYTES, 3);
+                switch (hairColor)
+                {
+                    case 0: // Green
+                    case 1: // Light Green
+                    case 2: // Dark Green
+                        return 29413; // 29415?
+                    case 6: // Dark Blue
+                        return 29414;
+                    case 4: // White
+                        return 29416;
+                    case 3: // Light Blue
+                        return 29417;
+                    default: // original - Violet
+                        return 2281;
+                }
+            }
+            // Based on Skin color
+            else if (getRace() == RACE_TAUREN)
+            {
+                uint8 skinColor = GetByteValue(PLAYER_BYTES, 0);
+                // Male
+                if (getGender() == GENDER_MALE)
+                {
+                    switch (skinColor)
+                    {
+                        case 0: // Dark (Black)
+                        case 1:
+                        case 2:
+                            return 29418;
+                        case 3: // White
+                        case 4:
+                        case 5:
+                        case 12:
+                        case 13:
+                        case 14:
+                            return 29419;
+                        case 9: // Light Brown/Grey
+                        case 10:
+                        case 11:
+                        case 15:
+                        case 16:
+                        case 17:
+                            return 29420;
+                        case 18: // Completly White
+                            return 29421;
+                        default: // original - Brown
+                            return 2289;
+                    }
+                }
+                // Female
+                else switch (skinColor)
+                {
+                    case 0: // Dark (Black)
+                    case 1:
+                        return 29418;
+                    case 2: // White
+                    case 3:
+                        return 29419;
+                    case 6: // Light Brown/Grey
+                    case 7:
+                    case 8:
+                    case 9:
+                        return 29420;
+                    case 10: // Completly White
+                        return 29421;
+                    default: // original - Brown
+                        return 2289;
+                }
+            }
+            else if(Player::TeamForRace(getRace())==ALLIANCE)
+                return 2281;
+            else
+                return 2289;
+        case FORM_TRAVEL:
+            return 632;
+        case FORM_AQUA:
+            if(Player::TeamForRace(getRace())==ALLIANCE)
+                return 2428;
+            else
+                return 2428;
+        case FORM_GHOUL:
+            return 24994;
+        case FORM_CREATUREBEAR:
+            return 902;
+        case FORM_GHOSTWOLF:
+            return 4613;
+        case FORM_FLIGHT:
+            if(Player::TeamForRace(getRace())==ALLIANCE)
+                return 20857;
+            else
+                return 20872;
+        case FORM_MOONKIN:
+            if(Player::TeamForRace(getRace())==ALLIANCE)
+                return 15374;
+            else
+                return 15375;
+        case FORM_FLIGHT_EPIC:
+            if(Player::TeamForRace(getRace())==ALLIANCE)
+                return 21243;
+            else
+                return 21244;
+        case FORM_METAMORPHOSIS:
+            return 25277;
+        case FORM_TREE:
+            return 864;
+        case FORM_SPIRITOFREDEMPTION:
+            return 16031;
+    }
+    return 0;
+}
\\ No newline at end of file
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 43b305d..8e89227 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1519,6 +1519,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
        void AddPetAura(PetAura const* petSpell);
        void RemovePetAura(PetAura const* petSpell);

+        uint32 GetModelForForm(ShapeshiftForm form);
    protected:
        explicit Unit ();

Link to comment
Share on other sites

Entry Point : SpellShapeshiftForm.dbc (sorry for french names...)

5,3,,,"Forme d’ours",,,,,,,,,,,,,,0xFF01FE,728,1,496,2500,2281,0,,,0,0,0,0,0,0,0,0x0,

In : CreatureDisplayInfo.dbc

Alliance Display : 2281 ==>

2281,213,3022,0,1.0,255,"DruidBearSkinRed","","","",1,0,0,0,0x0,0,

All 213 are DruidBear (I suppose Alliance for all - not tested)==>

23950,213,0,0,2.0,255,"DruidBearSkin","","","",1,0,0,0,0x0,0,

29413,213,0,0,1.0,255,"DruidBearSkinPurple","","","",1,0,0,0,0x0,0,

29414,213,0,0,1.0,255,"DruidBearSkinBlack","","","",1,0,0,0,0x0,0,

29415,213,0,0,1.0,255,"DruidBearSkinBlue","","","",1,0,0,0,0x0,0,

29416,213,0,0,1.0,255,"DruidBearSkinWhite","","","",1,0,0,0,0x0,0,

29417,213,0,0,1.0,255,"DruidBearSkinRed","","","",1,0,0,0,0x0,0,

29438,213,0,0,1.0,255,"DruidBearSkinBlack","","","",1,0,0,0,0x0,0,

29440,213,0,0,1.0,255,"DruidBearSkinPurple","","","",1,0,0,0,0x0,0,

count(DruidTaurenBearSkin) == 9

Sound id (DBCStructure.h) another record : 3022 ==>

2289,214,3022,0,1.20000004768,255,"DruidTaurenBearSkinBrown","","","",1,0,0,0,0x0,0,

All 214 are DruidBear (I suppose Horde : "Tauren" for all - not tested)==>

29418,214,0,0,1.20000004768,255,"DruidTaurenBearSkinBlack","","","",1,0,0,0,0x0,0,

29419,214,0,0,1.20000004768,255,"DruidTaurenBearSkinSilver","","","",1,0,0,0,0x0,0,

29420,214,0,0,1.20000004768,255,"DruidTaurenBearSkinYellow","","","",1,0,0,0,0x0,0,

29421,214,0,0,1.20000004768,255,"DruidTaurenBearSkinWhite","","","",1,0,0,0,0x0,0,

count(DruidTaurenBearSkin) == 5

Not tested for all Druid ShapeshiftForm... seams to be exactly the same thing as this for cat form

EDIT1 :

Interesting topic here : http://forums.worldofwarcraft.com/thread.html?topicId=17631614423&sid=1

EDIT2 :

I think thenecromancer issue is the best issue... (just verify displayid in case...)

"hardcode" displayid (Horde & Alliance) is faster than to find displayid from dbc with "my" idea to find both

(use displayid_A to find displayid_H from SpellShapeshiftForm.dbc to CreatureDisplayInfo.dbc)

In any case I don't see how bear and cat skin are defined. No way in DBC... (in my opinion)

Link to comment
Share on other sites

the patch throws an error about the empty line here near eof

void RemovePetAura(PetAura const* petSpell);

<<<This one i mean

+ uint32 GetModelForForm(ShapeshiftForm form);

on linux while patching with "git am [patch]".says something about corrupted file please repair my wife would love to see this on mangos :D

Link to comment
Share on other sites

Yes, but (I think, not tested for all) you can find displayid_H with search based on SoundId in CreatureDisplayInfo.dbc

I just test some Shapeshift Form, this doesnt work with FORM_FLIGHT, no SoundID and 2 forms.

So, check isn't good...

EDIT :

Maybe load DisplayID_H from creature_template

However querie :

SELECT * FROM `creature_template` WHERE `modelid_A` = 2281 OR `modelid_A2` = 2281;

returns `modelid_H` = 2281;

( On UDB ) for creature entry 4253 and another creature ...

So better issue is hardcode modelid... :(

What is Vladimir's opinion ?

Link to comment
Share on other sites

  • 2 weeks later...

I got this working on a live server, seems fine. Duno why all people just spams "bump" or "any news", why not just try it out yourself (and improve it), or just want everything handed on a silver plate?

only detail i found is that one of the white tauren skins give a black cat form

oh, and also found this

+        case FORM_AQUA:
+            if(Player::TeamForRace(getRace())==ALLIANCE)
+                return 2428;
+            else
+                return 2428;

dead code? or a typo here?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use