Okay, time for a very basic and probably ugly tutorial on making items and finding appearances, both for you and anyone else that comes along. If someone wants to improve it for user friendliness and format it for the wiki, feel free. I just want it all in one place, once and for all, so that people have to search less.
How do I make an item?
Item id: Find it on ffxiah.com. The itemid is part of the URL.
Not all tables are required. Except item_basic.
item_basic is always required.
item_basic -- I'm guessing that flags handles rare/ex, and probably some other things.
item_usable -- If it's usable, it goes here. Think clusters, potions, and items that have charges.
item_armor -- The name is deceiving. If you want the item to be equipped, it must exist in this table, even if it's a weapon. Determines the level, jobs, appearance, slot(s) it can be equipped in, and what slots should be turned off in the case of 2hd weapons, or cloaks with hoods. I've never puzzled out what scriptType is for.
item_weapon -- For weapons, of course. Determines skill (h2h, sword, etc), damage type (slashing, blunt, etc), how many times it can hit (K Club, Joyeuse, etc,) the delay, and the dmg.
item_mods -- Stats go here. A list for modId can be found in /scripts/globals/status.lua.
I haven't done anything with item_puppet and item_furnishing, since neither system is close to working.
One side note: if the item can be equipped and is usable, you may want to add a script to /scripts/globals/items, otherwise you're going to have an error message every time someone puts on or takes off that item. Filename of the script should be item_basic.name, not sort_name. The swimsuits that were added from my settings.lua experiment probably still do that, if anyone with SVN access feels energetic.
How do I find an appearance/mId?
You need a GM account. If you haven't made one, make one. While a GM account is technically optional, you are wasting time without one. It's such a horrible waste of time that I won't even cover how to find them using just the database and server restarts.
To find an mId, you create an appearance packet (info below.) Then on a GM, you use the command @inject <filename> where filename is the name of the packet's file.
So how do I make an appearance packet?
You need a hex editor. I have Frhed left over from some project or another. It works and isn't obnoxious, but any hex editor should do. For hex editor novices, type on the left, not on the right. Unless you're entering a text string, then you type on the right. We're not entering text strings.
Make a file in darkstar's root directory (c:\dsp). I use things like "appearance.dat," but the filename is irrelevant, as long as you remember it. You're going to be making an appearance packet. Here's how they're structured.
51 0c 57 00 08 07 28 11 28 21 28 31 28 41 28 51 a1 61 00 70 80 00
The first four pairs (51 0c 57 00) are pretty much irrelevant for what you're doing. Just use the ones supplied. Technically, they identify the packet type and the packet number, as far as order.
The fifth pair (08) is the face to use, while the sixth (07) is race. Race may be important with armor, because modId isn't always the same when you're messing with things like swimsuits. Why? Because male and female tarutarus use the same armor models, just a different modId when gender matters.
Every two pairs after that is a slot, in the following order: head, body, hands, legs, feet, main hand, off hand, ranged/instrument. The order is reversed, and it will be necessary to convert between base 10 and base 16.
28 11 is actually 11 28, except the first digit is just packet formating. The mId being used is 0x128, or 296 in base 10. This is the Summoner's "Caller" set if you're working with armor.
For a second example, a1 61 is 0x1a1 or 417 (Nirvana.)
At the moment, armor mIds seem to go up to around 0x151/337. Weapons go up to about 0x259 or 601. There are gaps by the way, just to keep things interesting.
Simplifying the process
So yeah, checking every single mId in a substantial range sucks. Been there, done that, fixed a few dozen pieces of armor that were invisible.
Use SQL queries to simplify life. For example:
SELECT itemid, name, mId FROM item_armor WHERE slot <= 3 AND mId != 0 GROUP BY mId ORDER BY mId ASC;
That query will show you every mId currently in use for main and offhand items. Why would you do this?
If the item you're trying to create looks like a different item, now you know the mId that item uses.
If it's completely unique, then you know the mId won't be in use elsewhere. Look in the gaps. For example, Zanbato is 151 and Mukademaru is 153. Nothing's using 152 right now. We change the packet to use 98 60, @inject appearance.dat and we find... it's just another Zanbato/Hagun. The colors might be slightly different, but yeah, that's a Hagun.
Finding Monster/NPC appearances
Wooo, you're in for some fun.
The look data is a pain to manipulate directly, so you're going to need to use update SQL queries when changing it. It's easiest to view it in /sql/npc_list.sql or /sql/mob_pools.sql.
Normal humanoid NPCs will use look data that's very similar to the appearance packet above. Not even kidding. Want an example? Have an example. 0x01000E0312107520663066400050006000700000. That's appearance 0e 03 12 10 75 20 66 30 66 40 and so on. The same rules apply. Decimal to hexadecimal, reverse the order of the pairs.
Humanoid NPCs with special appearances or animations (ex: Cid), as well as monsters will use something different. Bahamut is 0x0000C10500000000000000000000000000000000. 0x05C1 -> 1473. @costume 1473, poof, you're Bahamut. It's that simple.
Quick warnings on @costume:
- @costume 0 to return to normal
- Some costumes require an animation to look right. What's interesting is that Empties in Promyvion seem to have 4 DATs for all 8 elements, so finding those animation IDs may be necessary later on. I haven't explored those yet. They may have their own appearances.
- Due to the above, moving can sometimes show what you're costumed as, even if standing still leaves you invisible. Example: Iron Golem (heads)
- You can't use @animation on yourself while costumed
- There are often multiple appearances for the "same" thing. For example, elementals have a set of appearances for wild elementals, and for Summoner pets. We're using the appearance for pets at the moment. Light elementals should have their orbiting spheres. There's probably three or more Carbuncles. Be aware this can happen.
- Some costumes have... interesting effects on your camera. Dualboxing or a partner is suggested. @wallhack and walking into an empty space can be useful as well, since sometimes you're in the floor/air.
- I've had some odd things happen with size after using @costume for extensive periods. We're talking an Elvaan so tall that a Mithra stood as tall as their hip. Either that or the Mithra was extremely short.
- I've found costumes all the way up to 0x94F / 2383, but I haven't really tried to find an end to it
- The groupings seem to be somewhat similar to AltanaViewer and Model_Viewer, although they're not necessarily identical. That may help you by finding something that's in the right neighborhood at least.