Jump to content
  • 0
HyperSonic2097

Custom sprites

Question

Ok guys, i have tried to search around, but i'm still confused.

I have wrote a script that i have put in /Hercules/npc/custom/aggiuntivi/regen.txt

The script works fine. My question is, how i change the sprite with MY OWN CREATED sprite?

prontera,156,179,4      script  REGENERATOR     PLASMA_B,{


PLASMA_B is obviously a placeholder... I want to put a sprite that is not in lists like these https://dotalux.com/ro/npclist/

I have created a regenerator.act and regenerator.spr already. Now i'm confused on how i have to add that to "list" in a way that i can declare in regen.txt something like prontera,156,179,4      script  REGENERATOR     REGENERATOR,{

 

Thanks for the reply and for your time. I know that is a noob question, but... :D

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

the list of NPC ids is in db/constants.conf around line 2630 (search for FAKE_NPC)

Share this post


Link to post
Share on other sites
  • 0
14 minutes ago, meko said:

the list of NPC ids is in db/constants.conf around line 2630 (search for FAKE_NPC)

Hi, thanks for the reply. I have tried to write that between free ids and hidden ecc

    // Free IDs 126 - 138
    REGENERATOR:              126
    HIDDEN_WARP_NPC:          139

and in regen.txt i have put this

prontera,156,179,4      script  REGENERATOR     REGENERATOR,{

 

But the npc doesen't load. The console give me this error... Any Hint?

 

screen.png

Share this post


Link to post
Share on other sites
  • 0

from the screenshot I see you are using reloadscript, but the const db doesn't get reloaded when using this command

Share this post


Link to post
Share on other sites
  • 0
56 minutes ago, meko said:

from the screenshot I see you are using reloadscript, but the const db doesn't get reloaded when using this command

Yes, now i have tried to ahot down the entite emulator, reboot, and restart... but I still have this

 

4ADC2EA3-A390-4D57-951E-5AA58838B6EF.png

Share this post


Link to post
Share on other sites
  • 0
20 minutes ago, meko said:

this is because 126 is not in the valid range of NPC ids:

it has to be between 45 and 125, or between 400 and 1000, or between 10001 and 10248

 

reference: https://github.com/HerculesWS/Hercules/blob/stable/src/map/npc.c#L108

But in this way i don’t replace an existent npc?

Why in constant.conf there are write some line with “free id’s”?

4B9FFBF0-541D-4C8E-95F2-5949A5D645D6.png

Share this post


Link to post
Share on other sites
  • 1

those are reserved for future use, but feel free to use anything that is free between 400 and 1000, or between 10001 and 10248

currently the only free ID within this range is 10204 but you could manually change src/map/npc.h on line 147 (currently the max is 10248)

Share this post


Link to post
Share on other sites
  • 0
4 hours ago, meko said:

those are reserved for future use, but feel free to use anything that is free between 400 and 1000, or between 10001 and 10248

currently the only free ID within this range is 10204 but you could manually change src/map/npc.h on line 147 (currently the max is 10248)

Ok, i have raised the max at 10448

// Old NPC range
#define MAX_NPC_CLASS 1000
// New NPC range
#define MAX_NPC_CLASS2_START 10001
#define MAX_NPC_CLASS2_END 10448

 

 modified constants.conf in this way

..

    MER_SWORDMAN09:    6045
    MER_SWORDMAN10:    6046
//CUSTOM SPRITES RANGE 10249 - 10448
    REGENERATOR:       10249

 

but now doesen't load anymore the script.Stille give me this error.

Immagine.png.220b51ddde522f1f122b2df7f3c6bbf8.png

 

Edited by HyperSonic2097

Share this post


Link to post
Share on other sites
  • 0

Before I have forgot to recompile the server! But now this are the result...It search for a empty name!

Why? I have to declare something even client side? The error "status _set_viewdata (npc) ecc from the console is gone, so server side it seems all ok

Immagine.png

edit: I tried to edit client side data/luafiles514/luafiles/datainfo/npcidentity.lub in this way

..

    JT_4_BONFIRE = 10252,
    JT_4_PCCOUNT = 10253,
    JT_REGENERATOR = 10249    
}

 

and data/luafiles514/luafiles/datainfo/jobname.lub

    [jobtbl.JT_MD_ORC_LORD] = "ORC_LORD",
    [jobtbl.JT_MD_ORC_FLOWER] = "BLUE_FLOWER",
    [jobtbl.REGENERATOR] = "regenerator"

No luck for now, the error persist

 

EDIT2: using ID's range > 10250 instead 10249 it finally work!

Thanks meko for the support!

Edited by HyperSonic2097

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.