NPC "Look" Value for player-like NPCs

Post Reply
PrBlahBlahtson
Developer
Posts: 539
Joined: Sun Jul 22, 2012 12:17 am

NPC "Look" Value for player-like NPCs

Post by PrBlahBlahtson » Wed Jul 25, 2012 10:58 pm

Just a reference for if you should ever need to adjust an NPC. It assumes some basic understanding of SQL queries, and hexadecimal, or the critical thinking needed to "figure it out."

Some NPCs have their own custom model (Lion, Tenzen, etc) which use a different look scheme altogether. But a lot of NPCs are just player models, and built from gear you can wear yourself. Their values are complex, and covered below.

You can't directly edit the look value through Navicat, because it's an object. Well, you can edit it, but you may not like the result. So you'll want an SQL query like this:

Code: Select all

DELETE FROM npc_list WHERE npcid = '17444965';
INSERT INTO npc_list VALUES (17444965, 'Knight01', 0, 0, 0, 0, 0, 40, 40, 0, 0, 0, 0, 27, x'01000101161016201630164016501e611d700000', 32, 163);
Now, what's that 'look' value break down as?

0100rrffhe10bb20ha30ll40fe50mm6?oo700000

rr = Race. 01 = HumeM, 02 = HumeF, 03 = ElvM, 04 = ElvF, 05 = TaruM, 06 = TaruF, 07 = Mithra, 08 = Galka
ff = Face. Face 1a = 00, 1b = 01, 2a = 02, etc.
he = Head equipment
bb = Body equipment
ha = Hand equipment
ll = Leg equipment
fe = Feet equipment
mm = Main hand
oo = Off hand
? = Appears to be a flag to indicate the character has a shield. 0 is nothing or dual-wielding, 1 = shield. If you have odd weapon appearance problems, check that this value is correct.

I'm guessing that the pair of octets after 70 will be Ranged and Ammo slots, which might be relevant depending on the animations the NPC is planned to go through. 70 also might act similar to 60 (See ?).

Edit:
Discovery! So I was seeing if I could implement a little sumin-sumin for fun/practice, and learned more about items. Each slot has a list of "Model IDs" defined in item_armor as MId.

The value that you input for the slot is that appearance ID, converted from decimal to hexadecimal. For example, darksteel_armet is 22, which converts to 16 in hexadecimal. The Askar set is all MId 195, which converts to C3. Note that this is also how "look" data is stored for characters, although the server will catch on to shenanigans as soon as you change your equipment.

Some model IDs aren't used at all, such as some chocobo wands, or NPC exclusive gear, like the G.Axe worn by one of the Shiva quest NPCs. We also appear to be missing some model IDs in the database, such as Nightfall and Mercurial Spear.

Neat GK at Main 351, btw.
Nightfall at 464. Synergy weapons and Empyreans are up in that neighborhood as well.
Glowing relics up around 540.
Relatively new crystaline weapons starting at 581.

Edit the final?:
Look data is built very similar to an appearance packet. The "61" behavior is because they're 3 bytes, with the 0/1 being the third byte. Order is swapped, so that 102 would appear as 0261.

Amant
Posts: 12
Joined: Mon Sep 03, 2012 1:47 am
Location: Empyreal Paradox

Re: NPC "Look" Value for player-like NPCs

Post by Amant » Thu Sep 06, 2012 9:24 pm

Thank you sir! I pondered about this field for days, wondering if it was actually binary or just hexadecimal :shock:

EDIT: I guess I should have searched more. I found your other post here: http://forums.dspt.info/viewtopic.php?f=21&t=119 Sorry!
Also seems to correlate to the model id in the mob_pools table. Although AV for example looks much different:
0000620500000000000000000000000000000000
So I guess 0100 = npc? 0000 = mob? With mob being padded with zeroes throughout the rest after 62 and 05?

Not even sure what the 6205 means because I do not think its race and face :\

PrBlahBlahtson
Developer
Posts: 539
Joined: Sun Jul 22, 2012 12:17 am

Re: NPC "Look" Value for player-like NPCs

Post by PrBlahBlahtson » Fri Sep 07, 2012 12:49 am

Yeah, I've got a few posts circulating on it.

It's in hexadecimal, but the pairs are reversed. 0x6205 = 0x0562 = 1378 in Decimal. :)

The way it's stored is really just convenience for the packets. Slap a header on the look data, and away you go.

User avatar
diatanato
Developer
Posts: 112
Joined: Thu Aug 30, 2012 9:59 pm

Re: NPC "Look" Value for player-like NPCs

Post by diatanato » Fri Sep 07, 2012 1:00 am

Also seems to correlate to the model id in the mob_pools table. Although AV for example looks much different:
0000620500000000000000000000000000000000
So I guess 0100 = npc? 0000 = mob? With mob being padded with zeroes throughout the rest after 62 and 05?

Not even sure what the 6205 means because I do not think its race and face :\
entity_update.h

Code: Select all

enum MODELTYPE
{
    MODEL_STANDARD = 0,
    MODEL_EQUIPED  = 1,
    MODEL_DOOR     = 2,
    MODEL_ELEVATOR = 3,
    MODEL_SHIP     = 4,
    MODEL_UNK_5    = 5,
    MODEL_UNK_6    = 6
};
if the model is standard then 6205 is a unique code of model

Post Reply