Jump to content
  • 0

How to turn a player sprite into NPC sprite?


MI53RE

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   0
  • Joined:  01/14/12
  • Last Seen:  

Hello,

So here is my question: "How to turn a player sprite into NPC sprite?"

This question, in fact, is a following of my previous topic http://rathena.org/board/topic/58985-done-moving-npc/

which would explain better the interest of having npc with player skill, BUT not also.

The fact is that I have been able to make npc look like player by using bio lab monster sprite but it takes quite a lot of time to create 1 npc sprite, futhermore you have to edit the Lua files in the client to make it working proprely so everybody can see it so everytime that you want a new look npc you'll have to work on both server and client side...

what a waste of time isn't it?

basicaly I would like to understand why you can have a monster with player skin (which include cart, mount etc...) a npc with monster skin (like I do for now) BUT that npc cannot use it T_T

is it possible to copy/past this (from mob.c):

//Player sprites
if(pcdb_checkid(k) && columns==12) {
 mob_db_data[class_]->vd.sex=atoi(str[2]);
 mob_db_data[class_]->vd.hair_style=atoi(str[3]);
 mob_db_data[class_]->vd.hair_color=atoi(str[4]);
 mob_db_data[class_]->vd.weapon=atoi(str[5]);
 mob_db_data[class_]->vd.shield=atoi(str[6]);
 mob_db_data[class_]->vd.head_top=atoi(str[7]);
 mob_db_data[class_]->vd.head_mid=atoi(str[8]);
 mob_db_data[class_]->vd.head_bottom=atoi(str[9]);
 mob_db_data[class_]->option=atoi(str[10])&~(OPTION_HIDE|OPTION_CLOAK|OPTION_INVISIBLE);
 mob_db_data[class_]->vd.cloth_color=atoi(str[11]); // Monster player dye option - Valaris
}

to a specific place so npc could use it as well?

sorry if that a very dumb' question (but you never know if you on't try right? :) )

thank you in advance!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   1
  • Joined:  03/02/12
  • Last Seen:  

have the same problem, but as far as i know, it worked before around 12586 of eathena trunk, what have change, client or server ? robe support ?

edit : find a solution in clif.c (from another source than me)

#if PACKETVER >= 20071106
static inline unsigned char clif_bl_type(struct block_list *bl) {

   // Lecture de la class
   int class_ = status_get_viewdata(bl)->class_;
   int type = bl->type;

   if( type == BL_NPC || type == BL_MOB || type == BL_PC )
   {
       if ( class_ < 45 ) type = BL_PC;
       else if ( class_ < 1000 ) type = BL_NPC;
       else if ( class_ < 4000 ) type = BL_MOB;
       else type = BL_PC;
   }

   switch( type )
   {
       case BL_PC:    return 0x0; //PC_TYPE
       case BL_ITEM:  return 0x2; //ITEM_TYPE
       case BL_SKILL: return 0x3; //SKILL_TYPE
       case BL_CHAT:  return 0x4; //UNKNOWN_TYPE
       case BL_MOB:   return 0x5; //NPC_MOB_TYPE
       case BL_NPC:   return 0x6; //NPC_EVT_TYPE
       case BL_PET:   return 0x7; //NPC_PET_TYPE
       case BL_HOM:   return 0x8; //NPC_HOM_TYPE
       case BL_MER:   return 0x9; //NPC_MERSOL_TYPE
   // case BL_ELEM:  return 0xA; //NPC_ELEMENTAL_TYPE
       default:	   return 0x1; //NPC_TYPE
   }
}
#endif

spawn npc with a player sprite = win

Edited by Stingor
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

tldr;

have u looked at mob_avail.txt file already? iirc it was possible to create monsters using players info and just use the monster id into the npc

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   0
  • Joined:  01/14/12
  • Last Seen:  

As I said in my previous topic with Gepard but yes I did look at it already :)

I did try put the class sprite into the npc (and renamed them) but I dont get why, when I connect my character, I got a headless slipping npc at first. Then, when I move around and that the npc come on my sight BY ITSELF (very important information I think)it look like a normal moving character (with head on the right place this time)?

This is because player sprites consist of two parts: head with hairstyle and everything below head. I don't know how to change it, you should ask in a separate question how to turn a player sprite into NPC sprite.

/// setnpcdisplay("<npc name>", "<new display name>", <new class id>, <new size>, <new headgear id>, <new hair id>) -> <int>

That's exactly what I meant. It's rather complex change that would require changes in script.c, status.c, and clif.c at least.

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...