Neo-Mind 264 Posted April 12, 2015 Introduction For our Example we will create the Custom Class "Shinobi" and its Child version i.e. "Baby Shinobi" along with their Cash Mounts/Halter Mounts. Each Job has 3 ID values : 1) Job ID - we will use 4230 & 4231 respectively for the jobs (4232 & 4233 will be reserved for the mounts client side). 2) Map ID - Also called EA Mask. If we are extending a class we OR the existing class with a modifier. Since Shinobi is going to be a seperate branch, we will use 0x11 for Shinobi and 0x11 | 0x2000 for Baby Shinobi (0x2000 is the JOBL_BABY mask). 3) Msg ID - Defined in messages.conf file. We will use 700 and 701. Before we begin, A few points to note: 1) For the client side i will be using my own patch from NEMO not Xray clients - So dont ask me about Xray. 2) This guide is meant to be an overview towards adding jobs - meaning that your job will be enabled once you have done the changes specified here . You can add further details on your own which depends on your Class. 3) If i am missing out on anything please let me know. Nobody is perfect including me 4) We will use Sprite and some data from Ninja class for the time being but you can add your own entries just as easily. Server Source 1) src/common/mmo.h: look for JOB_REBELLION assignment and insert our Job IDs after it. 2) src/map/map.h: look for MAPID_BABY_CHASER and insert our Map IDs after it. 3) src/map/pc.c: i) find case JOB_BABY_CHASER: and insert our cases after it ii) find case MAPID_BABY_CHASER: and insert our cases after it iii) find case JOB_REBELLION: followed by return msg_txt(655); and insert our cases after it. (returns the Msg ID) iv) find { "Rebellion", JOB_REBELLION }, and insert our Job Names after it 4) src/map/itemdb.c: Here we check the job masks that is specified in item_db.conf. There is one limitation, however. Currently there is only 1 more slot left in the job mask since it is 32 bit. In case you need to add more you will need to change the variable to 64 bit. Find jobmask & 1<<30 and insert our class check after it. 5) src/char/inter.c: Find case JOB_REBELLION: and insert our case after it.(returns the Msg ID) Server Config 1) db/const.txt: i) Find Job_Rebellion and insert our Job IDs after it ii) Find EAJ_BABY_CHASER and insert our Map IDs after it 2) db/<pre-re|re>/exp.txt: Insert your IDs in one of the entries (or if you want to specify your own exp per level you can add that). Since our jobs are meant to be amongst First Class, we will simply add it into existing ones. i) Base: ii) Job: 3) db/<pre-re|re>/job_db.conf: Add entry for your Job. We will copy the entry from Ninja with slight changes for now. 4) db/job_db2.txt: Add entry for your Job. Again we will reuse the data from Ninja. 5) conf/help.txt: Insert your class entries to the @go message 6) conf/messages.conf: Add the Msg IDs after Shadow Chaser T 7) db/<pre-re|re>/skill_tree.conf: Add entry for your Job similar to the others. -pic to be added- Client Lua Files Now to make the client support Custom Jobs it should be patched with "Enable Custom Jobs" patch in NEMO. Also you should copy the lua files inside Support folder to different area so we can Add entries of our jobs. (LuaFiles514/Lua Files/Admin folder inside is what we need essentially) 1) PCIDs.lub : i) First we add all our Job IDs (look for JT_2004_JOB_LAST entry). ii) Next we connect the Cash Mount Job IDs to Main Job IDs (Look for JT_REBELLION mapping). iii) Lastly we need to add our Baby Class & its mount to the Baby_List (Look for JT_LION_CRUSADER_B). 2) PCNames.lub: To illustrate that different names can be assigned based on gender, I am calling them as Shinobi M & Shinobi F for Male & Female respectively. i) First we add the Job Name for Male Characters (Look for Rebellion) ii) Next we make the Cash Mounts inherit Names from their respective Main Jobs - since Mounting don't change the name (Look for JT_PECO_REBELLION). iii) Last but not least we add the Job Name for Female characters - Only necessary if it differs from Male name (Look for JT_SORCERER_B). 3) PCPaths.lub: Here we specify the job specific prefix used by the client to get the job sprite. i) First we add the Path prefix for Jobs that is not shared with any existing ones. ii) Next we make the Jobs that has shared path inherit from existing (for e.g. Baby Jobs inherit from Adult versions). 4)PCHands.lub: Here we specify the job specific prefix used by the client to get the weapon and shield sprite locations i) Like before, First we add the Hand prefix for Jobs that is not shared with any existing ones. ii) Next we make the Jobs with shared prefix inherit from existing (e.g. Baby Jobs, Mounts, Baby Mounts etc. all can inherit from Adult versions). 5)PCPals.lub: Here we specify the job specific prefix used by the client to get the Palette file location. i) Like before, First we add the Pal prefix for Jobs that is not shared with any existing ones. ii) Next we make the Jobs with shared prefix inherit from existing (e.g. Baby Jobs, Mounts, Baby Mounts etc. all can inherit from Adult versions). Note: You can also optionally add entries in PCImfs.lub file in case you have an Imf file, but I haven't seen any issues even without it. Hence I am not pursuing it. Once the edits are done pack it into your grf or put it in your data folder and use it. With this much your job will be visible and able to do everything provided you have the sprite files in the right location. spriteÀΰ£Á·¸öÅë³²<pathprefix>_³².spr and act for Male Job spriteÀΰ£Á·¸öÅë¿©<pathprefix>_¿©.spr and act for Female Job Snapshot: (to be added) 10 Obitto, hannah, Lord Ganja and 7 others reacted to this Quote Share this post Link to post Share on other sites
OmarAcero 15 Posted April 13, 2015 COOL GOOD WORD! ty! Now you have a guide on how to add custom skill of homunculus <--- Please *w* Quote Share this post Link to post Share on other sites
evilpuncker 503 Posted April 13, 2015 COOL GOOD WORD! ty! Now you have a guide on how to add custom skill of homunculus <--- Please *w* that is kinda hard unless you are talking about the client part, because the server side part is kinda complicated depending on how you want the skill to work, since as you can see in source code, each skill is coded differently Quote Share this post Link to post Share on other sites
OmarAcero 15 Posted April 13, 2015 Is not so complicated, I've tried, but the only thing I can not add more than 2 custom skills detail here: http://herc.ws/board/topic/8915-how-change-skills-of-homunculus-custom/ You can improve my work? Quote Share this post Link to post Share on other sites
Lord Ganja 5 Posted April 26, 2015 (edited) I'm having these errors while compiling. Any idea why? itemdb.c Line 358 //Custom JobsLine 359 if (jobmask & 1<<31)Line 360 bclass[0] |= 1<<MAPID_AKATSUIT;Line 361 if (jobmask & 1<<32)Line 362 bclass[0] |= 1<<MAPID_AKATSUKI;Line 363 if (jobmask & 1<<33)Line 364 bclass[0] |= 1<<MAPID_ANBU; ERROR: srcmapitemdb.c(361): warning C4293: '<<' : shift count negative or too big, undefined behaviorsrcmapitemdb.c(363): warning C4293: '<<' : shift count negative or too big, undefined behavior pc.c Line 6058 //Custom JobsLine 6059 case MAPID_AKATSUIT: return JOB_AKATSUIT;Line 6060 case MAPID_AKATSUKI: return JOB_AKATSUKI;Line 6061 case MAPID_ANBU: return JOB_ANBU; ERROR: srcmappc.c(6060): error C2196: case value '17' already usedsrcmappc.c(6061): error C2196: case value '17' already used Edited April 26, 2015 by Lord Ganja Quote Share this post Link to post Share on other sites
Dastgir 1246 Posted April 26, 2015 I'm having these errors while compiling. Any idea why? itemdb.c Line 358 //Custom Jobs Line 359 if (jobmask & 1<<31) Line 360 bclass[0] |= 1<<MAPID_AKATSUIT; Line 361 if (jobmask & 1<<32) Line 362 bclass[0] |= 1<<MAPID_AKATSUKI; Line 363 if (jobmask & 1<<33) Line 364 bclass[0] |= 1<<MAPID_ANBU; ERROR: srcmapitemdb.c(361): warning C4293: '<<' : shift count negative or too big, undefined behaviorsrcmapitemdb.c(363): warning C4293: '<<' : shift count negative or too big, undefined behavior pc.c Line 6058 //Custom JobsLine 6059 case MAPID_AKATSUIT: return JOB_AKATSUIT;Line 6060 case MAPID_AKATSUKI: return JOB_AKATSUKI;Line 6061 case MAPID_ANBU: return JOB_ANBU; ERRORS: srcmappc.c(6060): error C2196: case value '17' already usedsrcmappc.c(6061): error C2196: case value '17' already used We only have one jobmask left 1<<31 (i.e 2147483648, which is limit of int, in which we store the jobmask) 1<<32 and 1<<33 are greater than 2.147 bil, thus it gets too big to be used, For allowing more id, change the variable datatype: as Neo Said Currently there is only 1 more slot left in the job mask since it is 32 bit. In case you need to add more you will need to change the variable to 64 bit. About Case 17: maybe MAPID_AKATSUKI and MAPID_ANBU have values 17, that's why, change to 18/19 Quote Share this post Link to post Share on other sites
Lord Ganja 5 Posted April 26, 2015 @@Dastgir Thanks for the response. Anyway can you help me fix those issues? I really don't have any idea how to change the variable from 32 bit to 64 bit.. And about the value 17, how to change it with 18/19? Quote Share this post Link to post Share on other sites
Dastgir 1246 Posted April 26, 2015 @@Dastgir Thanks for the response. Anyway can you help me fix those issues? I really don't have any idea how to change the variable from 32 bit to 64 bit.. And about the value 17, how to change it with 18/19? src/map/map.h:MAPID_AKATSUKI = 0x11 Other 2 should be 0x12 and 0x13 1 Lord Ganja reacted to this Quote Share this post Link to post Share on other sites
Lord Ganja 5 Posted April 26, 2015 @@Dastgir Thanks for the response. Anyway can you help me fix those issues? I really don't have any idea how to change the variable from 32 bit to 64 bit.. And about the value 17, how to change it with 18/19? src/map/map.h:MAPID_AKATSUKI = 0x11 Other 2 should be 0x12 and 0x13 Thank you! How about changing the variable from 32bit to 64bit? Quote Share this post Link to post Share on other sites
Dastgir 1246 Posted April 26, 2015 @@Dastgir Thanks for the response. Anyway can you help me fix those issues? I really don't have any idea how to change the variable from 32 bit to 64 bit.. And about the value 17, how to change it with 18/19? src/map/map.h:MAPID_AKATSUKI = 0x11 Other 2 should be 0x12 and 0x13 Thank you! :DHow about changing the variable from 32bit to 64bit?That's not a easy fix,It needs to change variable type at many places in many files, which would be dome eventually when some new jobs are introduced. Quote Share this post Link to post Share on other sites
Lord Ganja 5 Posted April 26, 2015 (edited) Lol. Alright. Guess i'll have to wait anyways, thanks @@Dastgir EDIT: @@Neo, I'm having this client error now. I didn't even touch the PCImfs.lub file.. Edited April 26, 2015 by Lord Ganja Quote Share this post Link to post Share on other sites
hannah 0 Posted May 18, 2015 (edited) OMG finally thanks! i finally implemented my custom jobs !! <3 love u! D: Edited May 18, 2015 by hannah Quote Share this post Link to post Share on other sites
Kuya Jeo 120 Posted May 19, 2015 thank you for sharing this guide, this is a big help for newbie Quote Share this post Link to post Share on other sites
Batang Kuneho 0 Posted October 26, 2015 Introduction For our Example we will create the Custom Class "Shinobi" and its Child version i.e. "Baby Shinobi" along with their Cash Mounts/Halter Mounts. Each Job has 3 ID values : 1) Job ID - we will use 4230 & 4231 respectively for the jobs (4232 & 4233 will be reserved for the mounts client side). 2) Map ID - Also called EA Mask. If we are extending a class we OR the existing class with a modifier. Since Shinobi is going to be a seperate branch, we will use 0x11 for Shinobi and 0x11 | 0x2000 for Baby Shinobi (0x2000 is the JOBL_BABY mask). 3) Msg ID - Defined in messages.conf file. We will use 700 and 701. Before we begin, A few points to note: 1) For the client side i will be using my own patch from NEMO not Xray clients - So dont ask me about Xray. 2) This guide is meant to be an overview towards adding jobs - meaning that your job will be enabled once you have done the changes specified here . You can add further details on your own which depends on your Class. 3) If i am missing out on anything please let me know. Nobody is perfect including me 4) We will use Sprite and some data from Ninja class for the time being but you can add your own entries just as easily. Server Source 1) src/common/mmo.h: look for JOB_REBELLION assignment and insert our Job IDs after it. CJob_mmo_h.PNG 2) src/map/map.h: look for MAPID_BABY_CHASER and insert our Map IDs after it. CJob_map_h.PNG 3) src/map/pc.c: i) find case JOB_BABY_CHASER: and insert our cases after it CJob_pc_c-1.PNG ii) find case MAPID_BABY_CHASER: and insert our cases after it CJob_pc_c-2.PNG iii) find case JOB_REBELLION: followed by return msg_txt(655); and insert our cases after it. (returns the Msg ID) CJob_pc_c-3.PNG iv) find { "Rebellion", JOB_REBELLION }, and insert our Job Names after it CJob_pc_c-4.PNG 4) src/map/itemdb.c: Here we check the job masks that is specified in item_db.conf. There is one limitation, however. Currently there is only 1 more slot left in the job mask since it is 32 bit. In case you need to add more you will need to change the variable to 64 bit. Find jobmask & 1<<30 and insert our class check after it. CJob_itemdb_c.PNG 5) src/char/inter.c: Find case JOB_REBELLION: and insert our case after it.(returns the Msg ID) CJob_inter_c.PNG Server Config 1) db/const.txt: i) Find Job_Rebellion and insert our Job IDs after it CJob_const_txt-1.PNG ii) Find EAJ_BABY_CHASER and insert our Map IDs after it CJob_const_txt-2.PNG 2) db/<pre-re|re>/exp.txt: Insert your IDs in one of the entries (or if you want to specify your own exp per level you can add that). Since our jobs are meant to be amongst First Class, we will simply add it into existing ones. i) Base: CJob_exp_txt-1.PNG ii) Job: CJob_exp_txt-2.PNG 3) db/<pre-re|re>/job_db.conf: Add entry for your Job. We will copy the entry from Ninja with slight changes for now. CJob_job_db_conf.PNG 4) db/job_db2.txt: Add entry for your Job. Again we will reuse the data from Ninja. CJob_job_db2_txt.PNG 5) conf/help.txt: Insert your class entries to the @go message CJob_help_txt.PNG 6) conf/messages.conf: Add the Msg IDs after Shadow Chaser T CJob_messages_conf.PNG 7) db/<pre-re|re>/skill_tree.conf: Add entry for your Job similar to the others. -pic to be added- Client Lua Files Now to make the client support Custom Jobs it should be patched with "Enable Custom Jobs" patch in NEMO. Also you should copy the lua files inside Support folder to different area so we can Add entries of our jobs. (LuaFiles514/Lua Files/Admin folder inside is what we need essentially) 1) PCIDs.lub : i) First we add all our Job IDs (look for JT_2004_JOB_LAST entry). CJob_PCIDs_lub-1.PNG ii) Next we connect the Cash Mount Job IDs to Main Job IDs (Look for JT_REBELLION mapping). CJob_PCIDs_lub-2.PNG iii) Lastly we need to add our Baby Class & its mount to the Baby_List (Look for JT_LION_CRUSADER_B). CJob_PCIDs_lub-3.PNG 2) PCNames.lub: To illustrate that different names can be assigned based on gender, I am calling them as Shinobi M & Shinobi F for Male & Female respectively. i) First we add the Job Name for Male Characters (Look for Rebellion) CJob_PCNames_lub-1.PNG ii) Next we make the Cash Mounts inherit Names from their respective Main Jobs - since Mounting don't change the name (Look for JT_PECO_REBELLION). CJob_PCNames_lub-2.PNG iii) Last but not least we add the Job Name for Female characters - Only necessary if it differs from Male name (Look for JT_SORCERER_B). CJob_PCNames_lub-3.PNG 3) PCPaths.lub: Here we specify the job specific prefix used by the client to get the job sprite. i) First we add the Path prefix for Jobs that is not shared with any existing ones. CJob_PCPaths_lub-1.PNG ii) Next we make the Jobs that has shared path inherit from existing (for e.g. Baby Jobs inherit from Adult versions). CJob_PCPaths_lub-2.PNG 4)PCHands.lub: Here we specify the job specific prefix used by the client to get the weapon and shield sprite locations i) Like before, First we add the Hand prefix for Jobs that is not shared with any existing ones. CJob_PCHands_lub-1.PNG ii) Next we make the Jobs with shared prefix inherit from existing (e.g. Baby Jobs, Mounts, Baby Mounts etc. all can inherit from Adult versions). CJob_PCHands_lub-2.PNG 5)PCPals.lub: Here we specify the job specific prefix used by the client to get the Palette file location. i) Like before, First we add the Pal prefix for Jobs that is not shared with any existing ones. CJob_PCPals_lub-1.PNG ii) Next we make the Jobs with shared prefix inherit from existing (e.g. Baby Jobs, Mounts, Baby Mounts etc. all can inherit from Adult versions). CJob_PCPals_lub-2.PNG Note: You can also optionally add entries in PCImfs.lub file in case you have an Imf file, but I haven't seen any issues even without it. Hence I am not pursuing it. Once the edits are done pack it into your grf or put it in your data folder and use it. With this much your job will be visible and able to do everything provided you have the sprite files in the right location. spriteÀΰ£Á·¸öÅë³²<pathprefix>_³².spr and act for Male Job spriteÀΰ£Á·¸öÅë¿©<pathprefix>_¿©.spr and act for Female Job Snapshot: (to be added) i use this Guide but When i use @changejob or @job i can't Change to my custom job always say yOU are unable to cHANGE YOUr job @job 4230>? @job Failed @changejob Failed! Quote Share this post Link to post Share on other sites
Neo-Mind 264 Posted October 26, 2015 you recompiled Hercules after adding the server changes right? Quote Share this post Link to post Share on other sites
Batang Kuneho 0 Posted October 26, 2015 you recompiled Hercules after adding the server changes right? yes and i try 2 to rathena and its same i cant change job JOB_Goku = 4230, case JOB_Goku: return msg_txt(NULL,739); MAPID_Goku = 0x11, [PCJobTable.JT_Goku] = "Goku", and the other files I solve the problem of @job for 4230 but i give Rouge Class not my Custom Job ? What is wrong ? Help PLSS wont show the Sprite Of the Custom job!! Quote Share this post Link to post Share on other sites
Super Arki 0 Posted November 7, 2015 I changed to poring :< Quote Share this post Link to post Share on other sites
SyncMaster 23 Posted November 26, 2015 1<<31 (i.e 2147483648, which is limit of int, in which we store the jobmask) 1<<32 and 1<<33 are greater than 2.147 bil, thus it gets too big to be used, For allowing more id, change the variable datatype: as Neo Said About Case 17: maybe MAPID_AKATSUKI and MAPID_ANBU have values 17, that's why, change to 18/19 Same problem, different reason : Quote Share this post Link to post Share on other sites
Dastgir 1246 Posted November 26, 2015 1<<31 (i.e 2147483648, which is limit of int, in which we store the jobmask)1<<32 and 1<<33 are greater than 2.147 bil, thus it gets too big to be used,For allowing more id, change the variable datatype: as Neo Said About Case 17:maybe MAPID_AKATSUKI and MAPID_ANBU have values 17, that's why, change to 18/19Same problem, different reason : You might have some big value for MAPID_SHINOBI Quote Share this post Link to post Share on other sites
SyncMaster 23 Posted November 26, 2015 (edited) You might have some big value for MAPID_SHINOBI I just realize now that I end in Hercules. This problem is in my Rathena emulator. I don't want a complete class, I just need the job to use as costumes with sc_start ou changebase. There are something that I can do? Since it's just for costume I can skip that step? Where I can find the luafiles? PCID.lua??. @edit again : forget, I found.. http://herc.ws/board/topic/1974-release-custom-job-custom-shield-patches/ @edit again : forget, didn't work. hexed info : Hexed 2014-10-22b Edited November 26, 2015 by SyncMaster Quote Share this post Link to post Share on other sites
ossi0110 200 Posted November 27, 2015 the LUA files you need to edit are INSIDE the NEMO folder in the SUPPORT folder, add yiur changes into them and merge them into your GRF 1 edcastroecmr reacted to this Quote Share this post Link to post Share on other sites
angelozoid 0 Posted December 16, 2015 it's Great.. but.. my custom job can't wear any weapon... , , , help.... Quote Share this post Link to post Share on other sites
Reaper_san 3 Posted December 18, 2015 awesome mr NEO!!!... Or should I say... Mr. Anderson? 1 bWolfie reacted to this Quote Share this post Link to post Share on other sites
Waken 7 Posted December 28, 2015 (edited) @@NeoMy client crashes when i trying to login... I tried with default lubs of nemo, and only happens with the option "Enable custom Jobs."And i have the lubs in the correct folder, all is fine with my previous client ( 2013-08-07aRagexe ) Now i'm using 2013-12-23cRagexe. Why...?Thanks! I tested 2014-10-22b also and still happens, the client crashes. Edited December 29, 2015 by Wingel Quote Share this post Link to post Share on other sites