Enabling NPC and Death knight skins for all players

Hello.

After hours of searching for an answer to this, I figured I might as well just ask.

I have been trying for my server to stop kicking out characters with “wrong appearance” according to the core. Long story short, I try to enable Death Knight skins for all classes. When I modify the skin value to one that shouldn’t be allowed, while it does save, when I enter the character select screen, a message on the worldserver appears, saying that X character has a wrong appearance value, and it forces recustomize. If I try to enter with this character without “recustomizing”, it just kicks me out. When I enter the recustomization screen, it shows up (Such as a human warrior with green undead skin), and if I try to save, the game brushes it off as “Could not customize character”. I have no clue on where to start, so even if you can’t provide an answer, maybe you can show me a bit the way to it.

Thanks in advance to all.

— Canned message start —
This thread is not related to the official Trinity codebase and was moved to the Custom Code section.
Please read the stickies next time.
— Canned message end —

Have you edited the ValidateAppearance function in core?

I believe that returns false if the combinations are wrong and thus making the core reject your combinations.

Hello. I have searched for this function but I cannot seem to find it anywhere I look. Any clue where to find this?

Thanks, and sorry for posting in the wrong section

https://github.com/TrinityCore/TrinityCore/blob/bc758991140e961ceac46b17b766b0d54b8129fb/src/server/game/Entities/Player/Player.h#L1654
Looks like its in Player.cpp - if you were looking for the function I mentioned.
You can just search in github: https://github.com/TrinityCore/TrinityCore/search?utf8=✓&q=ValidateAppearance

Hey. Thanks for helping me find it, but since I already have compiled the whole thing, is there a way to “de-compile” it so I can modify the thing without losing the things I did in the server? It’s a roleplay server and we did some customization, and we would prefer to not lose it.

(Sorry if I am asking trivial questions, but I’m no expert, I was helped to do the whole thing)

Thanks again

no there is no way to decompile.
Depending on what kind of custom things you have it is possible to compile a new server that has all the same custom things in it.

We only put objects and npcs, nothing else aside from our characters, any way to save any of those?

Yeah.
If your core has auto updater used then it could be easy. You would just need to compile a new core and let the auto updater handle the DB updates.
If not, then you would need to find out what your core version is ( what commit it is on or what was the newest DB update that was run to any of the DBs ) and then compile a new core and run any new SQL files that have been added since your version.

You could also try to just compile a new core and move the old data to the new one, but that can be considerably more difficult since character data is a bit more complex than just some creature rows and I believe the character DB has had at least some changes in it.

Hello! Now that I have Player.cpp in my face, in which way should I edit it so the game doesn’t verify the appearance?

Simplest way (single line addition shown in red). This causes the function to return true no matter what a character looks like.

[SIZE=10px][FONT=‘Courier New’]bool Player::ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 hairID, uint8 hairColor, uint8 faceID, uint8 facialHair, uint8 skinColor, bool create /=false/) [/FONT][/SIZE]

[SIZE=10px][FONT=‘Courier New’]{ [/FONT][/SIZE]

[SIZE=10px][FONT=‘Courier New’][COLOR=rgb(255,0,0)]return true; [/FONT][/SIZE]

[SIZE=10px][FONT=‘Courier New’]// Check skin color [/FONT][/SIZE]

[SIZE=10px][FONT=‘Courier New’]// For Skin type is always 0 [/FONT][/SIZE]

I believe I have tried this already, but I remember the server returning the error message, kicking out the character and forcing a recustomization. Will try again, though. Doing it right now, will compile and try it. Thanks.

Edit: I believe you are using the 3.3.5 branch, yes? My Player.cpp doesn’t appear to be exactly that. I’ll post a pastebin of my part when my laptop opens.

Edit2: http://pastebin.com/qe3R9Qd2 I assume I have to put “true” on every false except for the first, yes?

Not sure about non-3.3.5 branches, but I’d guess that changing all the falses to trues would do it.

After countless attempts, I’ve given up. I think it may be a client limitation. Thanks for the help though.