Jump to content
  • 0

Adding custom NPC sprite


Dori

Question


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

I'm trying to add a new npc sprite. I did everything I possibly can to get this to work but the npc does not appear in-game.

 

name of my npc is 4_drunk_man

 

I added to jobname.lua

[jobtbl.JT_4_DRUNK_MAN] = "4_DRUNK_MAN"
I added to npcidentity.lua
["JT_4_DRUNK_MAN"] = 126,
Server side I added to db/const.txt
4_DRUNK_MAN	126
When I go @disguise 126 in-game nothing happens. What am I doing wrong?
Link to comment
Share on other sites

20 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  270
  • Reputation:   20
  • Joined:  12/10/11
  • Last Seen:  

I think there is a certain range for NPC sprites, like the job_id's for you to use

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

I think there is a certain range for NPC sprites, like the job_id's for you to use

that's what i'm also trying to figure out. I don't know where to start the IDs or which ones  I'm able to use. I tried many but nothing works.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  270
  • Reputation:   20
  • Joined:  12/10/11
  • Last Seen:  

My custom npcs are around 590 range, try there

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

My custom npcs are around 590 range, try there

all those IDs are taken by official npcs now. btw do I only have to edit the 2 lua files or do I also have to edit the db/const.txt?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

My custom npcs are around 590 range, try there

all those IDs are taken by official npcs now. btw do I only have to edit the 2 lua files or do I also have to edit the db/const.txt?

 

Personally I've never changed my const.txt and don't see why it would be necessary...

 

By the way, do you also have the luafiles514 folder in your grf?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

Yes I do

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

Cause I noticed you said that you edited "jobname.lua" yet recent clients use .lub files and the folder path is data\luafiles514\lua files\datainfo...so if you have both luafiles514 and lua files in data the one who should be edited is luafiles514 since that's the one being used by the client.

 

And in case your client actually does make use of it, then make sure you use .lub files as well otherwise the client will be reading the default ones from rdata.grf, .lub is read first than .lua

Edited by F0xxy
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

I'm not using a grf atm. my client is reading the data folder first. 

and yes the lua folder is in this format  data/luafiles514/lua files/

 

and my client is 2012-04-10

Edited by Phenex
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

I'm not using a grf atm. my client is reading the data folder first. 

and yes the lua folder is in this format  data/luafiles514/lua files/

 

and my client is 2012-04-10

 

And the files in there are .lua or .lub?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

lua.

Edited by Phenex
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

That's the problem then...that client is not reading those files unless you diff it with the "Load lua before lub" option, but I'd recommend getting them from here instead of doing that:

 

http://svn6.assembla.com/svn/ClientSide/Lua_Project/lubs/2012-04-10%20Lub+src%20Files%20%5bTranslated%5d.rar

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

The client is diffed with "Load lua before lub" option. the lua files are being read. I know this because I have added custom headgear sprites before I tried this whole custom npc thing.

And also, I replaced one of the official npcs in jobname.lua and npcidentity.lua with my custom npc. And that worked out well.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

Uh if you're trying to get new npc's in unused slots then it's simply not possible without hexing the client.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Is there any guide for hexing the client to do this... I've noticed some npcs in the 10000 range... Idk if that's an official thing, but we really are out of IDs for new custom npcs, and I'd like more,

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

Is there any guide for hexing the client to do this... I've noticed some npcs in the 10000 range... Idk if that's an official thing, but we really are out of IDs for new custom npcs, and I'd like more,

 

Not sure if Ai4rei came up with anything of sorts so far but technically if you change this line in npc.h:

 

#define npcdb_checkid(id) ( ( (id) >= 46 && (id) <= 125) || (id) == HIDDEN_WARP_CLASS || ( (id) > 400 && (id) < MAX_NPC_CLASS ) || (id) == INVISIBLE_CLASS || ( id > MAX_NPC_CLASS2_START && id < MAX_NPC_CLASS2_END ) )

 

to

 

#define npcdb_checkid(id) ( ( (id) >= 46 && (id) <= 138) || (id) == HIDDEN_WARP_CLASS || ( (id) > 400 && (id) < MAX_NPC_CLASS ) || (id) == INVISIBLE_CLASS || ( id > MAX_NPC_CLASS2_START && id < MAX_NPC_CLASS2_END ) )

 

...you could use a few extra ID's....but the problem is that the client will display the npc's as porings without the proper hex for the npcidentity.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

I was able to get more IDs by editing this line in npc.h

#define MAX_NPC_CLASS2_END 10049
I made mine to
#define MAX_NPC_CLASS2_END 11000
now when I @disguise my custom npc works but comes up as a poring. Edited by Phenex
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

That's the problem.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  51
  • Reputation:   3
  • Joined:  11/29/13
  • Last Seen:  

Hi, i'm using rathena svn 17600, but my server is running eathena mode (99/70 no third job), but i love to add renewal npc like 4_f_shalosh..

my rdata do not support, so when i disguise to 10041 (shalosh) my server will crash..

 

but finally i found the npc sprite itself. i follow your guide.. but when i disguise to 10041, i just disguise to poring.. what's wrong?

hope someone can help me..

 

*ps: the 4_f_shalosh sprite i merge to my server.grf so all my player can enjoy the npc sprite too if their rdata.grf do not support.

(sorry for bad english before)

Edited by Jesky
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   6
  • Joined:  05/29/14
  • Last Seen:  

Having this issue.

 

Changed clientside:

ADDED: data\sprite\npc\nobunaga.spr

ADDED: data\sprite\npc\nobunaga.act

EDITED: data\luafiles514\lua files\datainfo\jobname.lua

EDITED: data\luafiles514\lua files\datainfo\npcidentity.lua

 

Changed server side:

EDITED: db\const.txt

* EDITED:src\map\npc.h - recompiling now

 

Results:

@disguise failed

* hoping recompiling fixes this and I don't have to re-hex my client

Edited by Zairik
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

I was able to get more IDs by editing this line in npc.h

#define MAX_NPC_CLASS2_END 10049
I made mine to
#define MAX_NPC_CLASS2_END 11000
now when I @disguise my custom npc works but comes up as a poring.

 

 

i have that same problem, they are displayed as porings

 

i tryied to use an unused range like 140 but didn't work (not ranges like 44 also....)

 

may i ask, where to increase the range of use of them? it should be somewhere in the src

 

Edit:

I'm using 2012 04 10 client, i had to remove a npc id that is not being used or that caused my client to crash, that id was 487 

http://nn.nachtwolke.com/dev/npclist/?qq=4

 

This is what i did to make the client read npcs over 10k

 

open NPCIdentity.lub

change the name of the ID 487 to my desired npc sprite

["JT_4_F_RUNAIN"] = 487,

open jobname.lub

change the [jobtbl.JT_1_FLAG_NOFEAR] = "1_FLAG_NOFEAR",

to my desired npc sprite

[jobtbl.JT_4_F_RUNAIN] = "4_f_runain",

then it worked o:

 

i'm using the data v4. from Fluffle and for what i tested this 2 IDs are crashing my client

487 (this one is the one that i used to subs. with my desired npc sprite)

488

 

There may be more, if i find more i will update this post ;D

 

Edit:

 

Seems like NPCs that are pRo & some jRo Only are the ones who are crashing

 

PS:

Thank you so much Ai4rei 

For that helping page <3

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...