Morpher Issue menu

Shout-Out

User Tag List

Results 1 to 12 of 12
  1. #1
    aeo's Avatar Contributor
    Reputation
    135
    Join Date
    Apr 2007
    Posts
    286
    Thanks G/R
    97/68
    Trade Feedback
    7 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Morpher Issue

    Hello OC,

    Originally I just made my own morpher that calls UpdateDisplayInfo(true) and it worked. However, I could not use race specific items like pvp trinket. I took a look at Just-A-morpher source and tried to use the hooking method instead of just forcing my model with a direct function call and that also results in the same problem. "You cant use that" error and the text for my trinket ( orc,bloodelf,tauren ect...) is red.

    Just wondering if someone has a quick solution to this issue. I'm sure I've overlooked something small but I thought it was as simple as calling that function after setting your descriptors to the correct IDs.

    Thanks,
    Ace

    Morpher Issue
  2. #2
    danwins's Avatar Contributor
    Reputation
    189
    Join Date
    Mar 2013
    Posts
    143
    Thanks G/R
    6/62
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd have to guess your issues are coming when trying to set a descriptor in the CGPlayerData descriptors (ArenaFaction? i think it was called) to change the player race. and in doing so blocks the use of faction specific items.

    I ran into this issue some time ago, and the solution was to modify a value in the CGUnit_C struct rather then edit the descriptor.

    Code:
    .text:0071D235 CGUnit_C__GetCurrentClientRace proc near
    .text:0071D235                                         ; CODE XREF: CGPlayer_C__SendTextEmote+1AAp
    .text:0071D235                                         ; CGUnit_C__GetDisplaySex+2Dj ...
    .text:0071D235                 mov     eax, [ecx+184Ch]
    .text:0071D23B                 test    eax, eax
    .text:0071D23D                 jz      short loc_71D248
    .text:0071D23F                 test    byte ptr [ecx+17C8h], 40h
    .text:0071D246                 jz      short locret_71D255
    .text:0071D248
    .text:0071D248 loc_71D248:                             ; CODE XREF: CGUnit_C__GetCurrentClientRace+8j
    .text:0071D248                 mov     eax, [ecx+124h]
    .text:0071D24E                 movzx   eax, byte ptr [eax+0B4h]
    .text:0071D255
    .text:0071D255 locret_71D255:                          ; CODE XREF: CGUnit_C__GetCurrentClientRace+11j
    .text:0071D255                 retn
    .text:0071D255 CGUnit_C__GetCurrentClientRace endp
    Found from the Lua function Script_HasAlternateForm

    It's a 1Byte value, its default value will be 0 (no transform).

    Code:
    enum Race : uint
    		{
    			Human = 1,
    			Orc = 2,
    			Dwarf = 3,
    			NightElf = 4,
    			Undead = 5,
    			Tauren = 6,
    			Gnome = 7,
    			Troll = 8,
    			Goblin = 9,
    			BloodElf = 10,
    			Draenei = 11,
    
    			Worgen = 22,
    
    			PandarenNeutral = 24,
    			PandarenAlliance = 25,
    			PandarenHorde = 26,
    		};
    it is important to note that changing this will ONLY work with the original Race DisplayId's (old but likely have not changed):

    Code:
    enum RaceDisplayId : uint
    		{
    			HumanMale = 49,
    			HumanFemale = 50,
    			DwarfMale = 53,
    			DwarfFemale = 54,
    			NightElfMale = 55,
    			NightElfFemale = 56,
    			GnomeMale = 1563,
    			GnomeFemale = 1564,
    			DraeneiMale = 16125,
    			DraeneiFemale = 16126,
    			WorgenMale = 29422,
    			WorgenFemale = 29423,
    
    			OrcMale = 51,
    			OrcFemale = 52,
    			UndeadMale = 57,
    			UndeadFemale = 58,
    			TaurenMale = 59,
    			TaurenFemale = 60,
    			TrollMale = 1478,
    			TrollFemale = 1479,
    			BloodElfFemale = 15475,
    			BloodElfMale = 15476,
    			GoblinMale = 6894,
    			GoblinFemale = 6895,
    
    			PandarenMale = 38551,
    			PandarenFemale = 38552,
    		};
    these are also the models needed if you plan on changing features (earings, tusks, hair color etc.)
    Last edited by danwins; 09-19-2015 at 03:28 PM.

  3. #3
    aeo's Avatar Contributor
    Reputation
    135
    Join Date
    Apr 2007
    Posts
    286
    Thanks G/R
    97/68
    Trade Feedback
    7 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Very useful danwins. I will work on it tomorrow. Im using 64bit so will have to do some reversing but shouldn't be too hard. Thanks,

    Edit::

    I tried to implement this quickly as its easy to find the function in x64. I tried to set the first reference (
    mov eax, [ecx+184Ch]) in your example and got a crash. The following 2 pointers do not crash but also 1) dont change my model 2) Even if i force the model change using the old way I still cant use race specific item.

    Not sure what I'm doing wrong as it looks like the third two offset pointer reference should be the set one, its the one that gets returned, You said it was a byte value that rules out the first pointer.

    Code:
    int __thiscall CGUnit_C_GetCurrentClientRace(int this){
      int result; // eax@1
    
    
      result = *(_DWORD *)(this + 0x184C);
      if ( !result || *(_BYTE *)(this + 0x17C8) & 0x40 )
        result = *(_BYTE *)(*(_DWORD *)(this + 0x124) + 0xB4);
      return result;
    
    }
    Last edited by aeo; 09-19-2015 at 04:40 PM.

  4. #4
    danwins's Avatar Contributor
    Reputation
    189
    Join Date
    Mar 2013
    Posts
    143
    Thanks G/R
    6/62
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you cant just set that variable and have it work, it requires more steps.

    first of all:

    Code:
    result = *(_BYTE *)(*(_DWORD *)(this + 0x124) + 0xB4);
    is a dead giveaway thats its in the descriptors (playerbase+0x124 holds a pointer to the CGUnitData descriptors, similar to how playerbase+0x4 holds a pointer to the CGObjectData descriptors). so this isn't the one you're looking for.

    next you should take a look at the other descriptor next to the displayid:

    Code:
        DisplayID = 0x1A0, // Size: 0x1, Flags: 0x280
        NativeDisplayID = 0x1A4, // Size: 0x1, Flags: 0x201
        MountDisplayID = 0x1A8, // Size: 0x1, Flags: 0x201
    Whatever race you pick, the Native Display Id must match the given race (you also must keep in mind the gender descriptor)

  5. #5
    aeo's Avatar Contributor
    Reputation
    135
    Join Date
    Apr 2007
    Posts
    286
    Thanks G/R
    97/68
    Trade Feedback
    7 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Got it working I guess I just wasn't syncing the native display Ids. Everything else was going fine. Thanks Danwins. Only Issue now is my characters face is messed up its like tauren skin on NE model. But ill look into that. Probably just not setting a descriptor.
    Last edited by aeo; 09-19-2015 at 05:52 PM.

  6. #6
    danwins's Avatar Contributor
    Reputation
    189
    Join Date
    Mar 2013
    Posts
    143
    Thanks G/R
    6/62
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    are you talking about the whole texture? or just the face? this method of morphing is to solve that exact issue, because otherwise your only morphing the model without textures. changing the race offset fixes this.

    if theres an issue with the face only it may be because the current setting for facial features you have on say an orc, doesnt match how many there are for a night elf, see the "HairColorID" descriptor, its a byte-array of 5(i think) values that control skin color/hair color/tusks/earings etc.

  7. #7
    aeo's Avatar Contributor
    Reputation
    135
    Join Date
    Apr 2007
    Posts
    286
    Thanks G/R
    97/68
    Trade Feedback
    7 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Its the whole texture. I set the 7th bit like they reference in the function (this + 0x17C & 0x40 ) like so

    Code:
            unsigned int oldValue = *reinterpret_cast<unsigned int*>((DWORD_PTR)this + 0x25DC);     
            oldValue &= ~(unsigned int)((unsigned int)0xFF << (7 * 8));
            oldValue |= (unsigned int)((unsigned int)RaceID << (7 * 8)); //4 for NE 
            *reinterpret_cast<unsigned int*>((DWORD_PTR)this + 0x25DC) = oldValue;
    
    //Then i set the gender and the native display ID
    
            SetByte(UnitFields::UNIT_FIELD_BYTES_0, Female, 2); // value 1
            *reinterpret_cast<unsigned int*>(DescriptorFields() + UnitFields::UNIT_FIELD_NATIVEDISPLAYID*4) = DisplayID; //56 NEFemale
    If I set the race descriptor the race items don't work. Ill keep looking at it tomorrow It works better then it did a few hours ago but still needs finial touches

  8. #8
    danwins's Avatar Contributor
    Reputation
    189
    Join Date
    Mar 2013
    Posts
    143
    Thanks G/R
    6/62
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you still need to set the normal display id aswell iirc

    Also the offset your supposed to be using is 0x184C (the first one referenced), the other two are something else (cant recall what it was).

    again, remember i said its only 1byte in size (perhaps the reason for your crash)

    Code:
    typedef unsigned char byte;
    
    byte *race;
    race = (byte*)(GetAddress() + Offsets::WowObject::Race); // baseaddress + 0x184C
    *race = value;
    Last edited by danwins; 09-19-2015 at 10:54 PM.

  9. #9
    aeo's Avatar Contributor
    Reputation
    135
    Join Date
    Apr 2007
    Posts
    286
    Thanks G/R
    97/68
    Trade Feedback
    7 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Odd, still no luck with this working 100%. Ive even logged the values prior to updateing to make sure they are correct:

    Code:
    [17:17:22] Old Race: 0, DisplayId: 59,NDisplayId: 59 //TaurenMale
    [17:17:22] New Race: 4, DisplayId: 55,NDisplayId: 55 //NEMale
    I set the Race, Gender(UNIT_FIELD_BYTES_0), DisplayId and NativeDisplayId with no luck. I did some looking around in my IDB for similar AlternateForm type functions with no real luck. Not sure where to go now.Any other input is greatly appreciated.

    Thanks for the help Danwins.

  10. #10
    danwins's Avatar Contributor
    Reputation
    189
    Join Date
    Mar 2013
    Posts
    143
    Thanks G/R
    6/62
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by aeo View Post
    Odd, still no luck with this working 100%. Ive even logged the values prior to updateing to make sure they are correct:

    Code:
    [17:17:22] Old Race: 0, DisplayId: 59,NDisplayId: 59 //TaurenMale
    [17:17:22] New Race: 4, DisplayId: 55,NDisplayId: 55 //NEMale
    I set the Race, Gender(UNIT_FIELD_BYTES_0), DisplayId and NativeDisplayId with no luck. I did some looking around in my IDB for similar AlternateForm type functions with no real luck. Not sure where to go now.Any other input is greatly appreciated.

    Thanks for the help Danwins.
    What exactly are you referring to with "UNIT_FIELD_BYTES_0"? what offset?

    gender should be at descriptors+0xE7 (1byte)

  11. #11
    aeo's Avatar Contributor
    Reputation
    135
    Join Date
    Apr 2007
    Posts
    286
    Thanks G/R
    97/68
    Trade Feedback
    7 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    It was my understanding that the unit field bytes were a 4 byte array that hold class race gender and on other attribute I can't recall this is how it is in my descriptors dumped by uf extractor tool from trinity core I think or mangos one of the two,


    Edit it's race, class, gender and power type in the byte array

    I've compared my descriptors to the one posted in the latest dump they match. Making UnitFieldBytes[2] E7

    Code:
    enum UnitFields{
        UNIT_FIELD_CHARM = OBJECT_END + 0x000, // Size: 4, Flags: PUBLIC
        UNIT_FIELD_SUMMON = OBJECT_END + 0x004, // Size: 4, Flags: PUBLIC
        UNIT_FIELD_CRITTER = OBJECT_END + 0x008, // Size: 4, Flags: PRIVATE
        UNIT_FIELD_CHARMEDBY = OBJECT_END + 0x00C, // Size: 4, Flags: PUBLIC
        UNIT_FIELD_SUMMONEDBY = OBJECT_END + 0x010, // Size: 4, Flags: PUBLIC
        UNIT_FIELD_CREATEDBY = OBJECT_END + 0x014, // Size: 4, Flags: PUBLIC
        UNIT_FIELD_DEMON_CREATOR = OBJECT_END + 0x018, // Size: 4, Flags: PUBLIC
        UNIT_FIELD_TARGET = OBJECT_END + 0x01C, // Size: 4, Flags: PUBLIC
        UNIT_FIELD_BATTLE_PET_COMPANION_GUID = OBJECT_END + 0x020, // Size: 4, Flags: PUBLIC
        UNIT_FIELD_BATTLE_PET_DB_ID = OBJECT_END + 0x024, // Size: 2, Flags: PUBLIC
        UNIT_FIELD_CHANNEL_OBJECT = OBJECT_END + 0x026, // Size: 4, Flags: PUBLIC, URGENT
        UNIT_CHANNEL_SPELL = OBJECT_END + 0x02A, // Size: 1, Flags: PUBLIC, URGENT
        UNIT_CHANNEL_SPELL_X_SPELL_VISUAL = OBJECT_END + 0x02B, // Size: 1, Flags: PUBLIC, URGENT
        UNIT_FIELD_SUMMONED_BY_HOME_REALM = OBJECT_END + 0x02C, // Size: 1, Flags: PUBLIC
        UNIT_FIELD_BYTES_0 = OBJECT_END + 0x02D, // Size: 1, Flags: PUBLIC
        UNIT_FIELD_DISPLAY_POWER = OBJECT_END + 0x02E, // Size: 1, Flags: PUBLIC
        UNIT_FIELD_OVERRIDE_DISPLAY_POWER_ID = OBJECT_END + 0x02F, // Size: 1, Flags: PUBLIC
        UNIT_FIELD_HEALTH = OBJECT_END + 0x030, // Size: 1, Flags: PUBLIC
    Last edited by aeo; 09-21-2015 at 07:42 PM.

  12. Thanks vitalic (1 members gave Thanks to aeo for this useful post)
  13. #12
    danwins's Avatar Contributor
    Reputation
    189
    Join Date
    Mar 2013
    Posts
    143
    Thanks G/R
    6/62
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    theres also one in the CGPlayerData that needs to be changed aswell tho iirc

    EDIT: check pm aeo.

  14. Thanks vitalic (1 members gave Thanks to danwins for this useful post)

Similar Threads

  1. Issues with Deeprun Tram exploit
    By shade599 in forum World of Warcraft Exploration
    Replies: 3
    Last Post: 03-25-2007, 08:01 AM
  2. !xSpeednet Issues
    By Taldeer in forum World of Warcraft General
    Replies: 5
    Last Post: 01-28-2007, 06:32 PM
  3. DBC More issues.
    By dela in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 09-29-2006, 07:46 PM
  4. patching issue
    By Marlo in forum World of Warcraft General
    Replies: 0
    Last Post: 07-22-2006, 07:35 PM
  5. [Patch 1.11] - Known Issues (6-20-06)
    By Cypher in forum World of Warcraft General
    Replies: 1
    Last Post: 06-24-2006, 12:42 AM
All times are GMT -5. The time now is 01:47 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search