Adding custom Headgears Guide! for newbies

Files needed:
Server side: item_db2.txt
Clientside: accname.lua, accessoryid.lua, idnum2itemdesctable.txt, idnum2displayname.txt,       idnum2itemresnametable.txt

Server side:
Item_db.txt Format
ID,KroName,Name,Type,Buy,Sell,Weight,ATK,DEF,Range,Slots,Job,Upper,Gender,Loc,wLV,eLV,Refineable,View,{ Script },{ OnEquip_Script },{ OnUnequip_Script }

ex.

19005,3ceam,3ceam_example_hat,5,20,,800,,5,,0,0xFFFFFFFF,7,2,256,,0,1,1001,{ bonus2 bAddRace,RC_DemiHuman,12; bonus bBaseAtk,(JobLevel*2)/7; },{},{}

06/08/2010 rev 421 changes  instead of 31 it is changed to 7

As you can see if you create your custom item for every one to be able to equip it one must put 31 on the upper, 0xFFFFFFFF on the job and 2 for the gender, by using this Every job can wear that item! if you want to limit it by class you can just look on the other items on your item_db and copy those ehehhe

Item locations(headgears Only)
256 - top
512 - mid
1 - lower
Now add those for there location example a headgear that includes both top and mid so 256 + 512 = 768 so 768 is the code for Both Top and mid headgears

Client side: Lua guides (i will just copy and paste it im a bit lazy! credits to rytech)


Look in your accessoryid. This is where you will assign a view ID for your headgear. Notice how all the lines are grouped between a single set of brackets.

ACCESSORY_IDs = {
        ACCESSORY_GOGGLES = 1,
        ACCESSORY_CATTYHAIRBAND = 2,
        ACCESSORY_GLASS = 3,
        ACCESSORY_FLOWER = 4,
        ACCESSORY_FLORALHAIRBAND = 5,
}


This is just the first 5 ID's. All the headgear view ID's that exist are all between this 1 pair of brackets. So when adding lines for your customs, make sure their between them, or they wont be read by the client. Also, youll want to leave a few hundred ID's free for future official headgears that will be added in the future. So its best recommended that you start at ID 1001. The ID limit for the client is 999, but you can apply a diff to raise that limit to 2000, which is recommended you apply when diffing your client.

[Add] Increase Headgear ViewID to 2000

To add a ID, first give your headgear a name. Note that this file does not tell the client the sprite name of the headgear to look for. Well do that soon. Here's for format for each line....

  Tab       Accessory Tag      ID
        ACCESSORY_3CEAM_HAT = 1001,


Lets add a headgear called 3CeAM Hat to our server for this example. When adding data in here, EVERYTHING MUST BE TYPED IN CAPS!!!! Also, no spaces are allowed. Use a underscore instead. So well add it in as 3CEAM_HAT for the accessory tag, and since this is our first custom, well assign 1001 for the ID and add the line below the last existing line, which is 5 in this example.

ACCESSORY_IDs = {
        ACCESSORY_GOGGLES = 1,
        ACCESSORY_CATTYHAIRBAND = 2,
        ACCESSORY_GLASS = 3,
        ACCESSORY_FLOWER = 4,
        ACCESSORY_FLORALHAIRBAND = 5,

        ACCESSORY_3CEAM_HAT = 1001,
}


Now that our ID is assigned, time to assign a file name to that ID. Open the accname file and you see yet another file full of lines between brackets. Well show a example for the first 5 lines for the same 5 headgears above....

AccNameTable = {
        [ACCESSORY_IDs.ACCESSORY_GOGGLES] = "_°í±Û",
        [ACCESSORY_IDs.ACCESSORY_CATTYHAIRBAND] = "_°í¾çÀ̸Ӹ®¶ì",
        [ACCESSORY_IDs.ACCESSORY_GLASS] = "_±Û·¡½º",
        [ACCESSORY_IDs.ACCESSORY_FLOWER] = "_²É",
        [ACCESSORY_IDs.ACCESSORY_FLORALHAIRBAND] = "_²É¸Ó¸®¶ì",
}


And here's the format for each line....

  Tab                     Accessory Tag        File Name of Spr And Act
        [ACCESSORY_IDs.ACCESSORY_3CEAM_HAT] = "_3ceam_hat_example",


Then well place our custom headgear below the last line. The file name for our custom headgear sprite is 3ceam_hat_example. So well use that at the end of the line. Remember, you must start the file name entry with a underscore here for all headgears, like _3ceam_hat_example for example. Also be sure to put your accessory tag in the area in the middle of the line....

AccNameTable = {
        [ACCESSORY_IDs.ACCESSORY_GOGGLES] = "_°í±Û",
        [ACCESSORY_IDs.ACCESSORY_CATTYHAIRBAND] = "_°í¾çÀ̸Ӹ®¶ì",
        [ACCESSORY_IDs.ACCESSORY_GLASS] = "_±Û·¡½º",
        [ACCESSORY_IDs.ACCESSORY_FLOWER] = "_²É",
        [ACCESSORY_IDs.ACCESSORY_FLORALHAIRBAND] = "_²É¸Ó¸®¶ì",

        [ACCESSORY_IDs.ACCESSORY_3CEAM_HAT] = "_3ceam_hat_example",
}


And thats it. Once you make a headgear item and get it added to the item_db, assign the view ID the same ID (1001) as the headgear you just assigned in your lub files.

Now for the idtables

you can find them on data folder

 1st. idnum2itemdesctable.txt - the description found on the client

 Format: itemid#desc#
Ex.
19005#
3ceam example hat
#

note: every new line is read on the client

2nd idnum2itemdisplaynametable.txt - the name displayed on the client
Format: itemid#name#
Ex. 19005#3ceam example hat#

3rd idnum2itemresnametable.txt - the name of bmp files
Format: itemid#nameontexture#
Ex. 19005#3ceam_example_hat#

just add those lines on the bottom.

things to remember! viewid and itemid

1 comments:

Anonymous said...

great blog. thanks for the download link btw

Post a Comment

 
Copyright © Blackfork Gaming Inc.