• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Dress NPCs coremod

Rochet2

Moderator / Eluna Dev
Hello.
Ppl have asked once in a while if you could dress NPCs some gear and items etc. Usually people answer that you need to make a patch or similar.
Through some core editing and the mage spell "mirror image" (not actually using the spell, but the packet and flags) I made it possible to dress NPCs with gear.
Its a rather simple idea.

You can make an NPC, set the displays of items you want him to have and his race and gender (defines displayID) as well as facial features and skin color.
All this is done in the database. (which is rather self explanatory ..)
The values for skins and features range from 0 to 12 or something .. not quite sure how many there are.
Note that the items are DISPLAYIDS!! Not item entries.

Get it:
https://rochet2.github.io/Dress-NPCs

attachment.php
 

Attachments

  • 4BSLX.jpg
    4BSLX.jpg
    69.7 KB · Views: 432
Last edited:

Tommy

Founder
Very nice, Rochet! Interesting, very interesting. However, isn't there like a creature item set template you could dress them up in? Which, this is obviously changing skin and all of their features. Nonetheless, great job. :p
 

Rochet2

Moderator / Eluna Dev
Very nice, Rochet! Interesting, very interesting. However, isn't there like a creature item set template you could dress them up in? Which, this is obviously changing skin and all of their features. Nonetheless, great job. :p

Hmm ..?
So you are asking for an additional feature for adding itemsets instead of item displays one at a time?
Or talking of some ready feature ingame? There might be other ways to dress NPCs possibly with some other packets.
 
Last edited:

Tommy

Founder
Hmm ..?
So you are asking for an additional feature for adding itemsets instead of item displays one at a time?
Or talking of some ready feature ingame? There might be other ways to dress NPCs possibly with some other packets.

I only asked if there was a creature set table. There is one, but just ignore me. \o/
 

ToxicDev

Banned
This is very interesting. Going to look into it thanks rochet! :p


Edit: After messing around with this it works nicely :p
 
Last edited:

Anthonys-Toolbox

Epic Member
Thankyou! I have no idea what I'm looking at, the diff file but I'm sure it'll be useful to a lot of people since we all hate dealing with the middleman(DBC Editor) anyway. ^_^. Thanks again.
 

Rochet2

Moderator / Eluna Dev
This is very interesting. Going to look into it thanks rochet! :p
Edit: After messing around with this it works nicely :p

Nice that it got a tester right away :)



How it works:
The creature entries in the table get mirror image flag on startup so the client will ask the server for the facial features etc with a packet.
The packet call will then push the data you put in the table. The race and gender define the modelID set for the NPC on startup.
Normally mirror image works so that the creatures are spawned and they have the flag. The client asks for the data and your data is sent (the mage's data, so the mirror image looks like you).
 
Last edited:

Rochet2

Moderator / Eluna Dev
Example of a set I pulled from the net and put together:
Code:
SET @NPCENTRY := 6;
INSERT INTO `creature_template_outfits` (`entry`, `race`, `gender`, `skin`, `face`, `hair`, `haircolor`, `facialhair`, `head`, `shoulders`, `body`, `chest`, `waist`, `legs`, `feet`, `wrists`, `hands`, `back`, `tabard`)
VALUES (@NPCENTRY, 11, 1, 14, 4, 10, 3, 5, 31286, 43617, 0, 26267, 26270, 26272, 0, 0, 43698, 0, 0);
INSERT INTO `creature_equip_template` (`entry`, `id`, `itemEntry1`, `itemEntry2`, `itemEntry3`)
VALUES (@NPCENTRY, 1, 32946, 32945, 0);
liem.jpg
 
Last edited:

ToxicDev

Banned
Figured I would post this in case any one else had any totally harmless db errors when using this like me and wanted to fix them.

So I was adding this to my newest core when I realized that it gave you db errors for using the display id 0 Which you seem to need to when you want this to work. So then I had the bright idea of using a display id from the orb of deception since when you use the orb of deception it continues to shows your even after you have morphed into the new display id. So I tested one of those displays which you can find here http://emudevs.com/showthread.php/43-How-orb-of-dewception-works and it works fine i'm getting no db error and the mod works fine.
 

Rochet2

Moderator / Eluna Dev
Uhm, what exactly do I do with the diff file?
It contains changes made to the source code of the core.
You should use GIT to apply the diff to your source (it does the changes for you).
If this does not work, you can try manually doing the changes. (add the lines that have + and remove the ones that have -)

I use git BASH.
You can open git BASH in the TC source folder and use git apply filename.diff
if the diff file is in the same folder you opened git bash in.

You can also try to use git apply --reject filename.diff
This will apply the patch where it can.
For the failed parts it generates new files scattered in the source folders that have .rej file extension. The file is a diff file for the failed code which you need to change manually.
For example if the patch fails for Player.cpp, the rej file will be in the same directory with Player.cpp and it will be named Player.cpp.rej
 

Arius

Exalted Member
Well I've got a problem installing this patch. I've did what was wrote in installation
open git bash to source location
do git remote add rochet2 https://github.com/Rochet2/TrinityCore.git
do git pull rochet2 dressnpcs
use cmake and compile
Well after compiling and SQL file uploading I've tried to test it with this "test" NPC change and well nothing changed. I just wonder if there should be some change in CMakelist ?
 

Rochet2

Moderator / Eluna Dev
Well I've got a problem installing this patch. I've did what was wrote in installation
open git bash to source location
do git remote add rochet2 https://github.com/Rochet2/TrinityCore.git
do git pull rochet2 dressnpcs
use cmake and compile
Well after compiling and SQL file uploading I've tried to test it with this "test" NPC change and well nothing changed. I just wonder if there should be some change in CMakelist ?

No, there is no change in cmakelists since this is not a script. This is purely a core modification, nothing is "scripted" (like an AI or something).
Only the base functionality of the core was extended a little.

Check that these changes are in place.
https://github.com/Rochet2/TrinityCore/compare/TrinityCore:3.3.5...dressnpcs

You used the SQL that came with the dressnpcs?
 
Top