Jump to content

  •  

Photo

monster hp bar, but only for mvps?


  • Please log in to reply
3 replies to this topic

#1 anjasoleil0

anjasoleil0

    Advanced Member

  • Members
  • PipPipPip
  • 76 posts

Posted 16 September 2016 - 12:31 AM

So, as the title suggests, is it possible to enable HP bars but only for mvps?

Thanks in advance for the reply.



#2 Nardoth

Nardoth

    Member

  • Members
  • PipPip
  • 26 posts

Posted 16 September 2016 - 06:36 AM

Try navigating to the function clif_monster_hp_bar in clif.c and add a condition for the mob to be a mvp. Something like md->state.boss

void clif_monster_hp_bar( struct mob_data* md, struct map_session_data *sd ) {
	struct packet_monster_hp p;
	
	nullpo_retv(md);
	nullpo_retv(sd);
        if(md->state.boss){
	   p.PacketType = monsterhpType;
	   p.GID = md->bl.id;
	   p.HP = md->status.hp;
	   p.MaxHP = md->status.max_hp;

	   clif->send(&p, sizeof(p), &sd->bl, SELF);
        }
}

PD: Don't forget to recompile.


Edited by Nardoth, 16 September 2016 - 06:37 AM.


#3 anjasoleil0

anjasoleil0

    Advanced Member

  • Members
  • PipPipPip
  • 76 posts

Posted 16 September 2016 - 07:09 AM

Try navigating to the function clif_monster_hp_bar in clif.c and add a condition for the mob to be a mvp. Something like md->state.boss

void clif_monster_hp_bar( struct mob_data* md, struct map_session_data *sd ) {
	struct packet_monster_hp p;
	
	nullpo_retv(md);
	nullpo_retv(sd);
        if(md->state.boss){
	   p.PacketType = monsterhpType;
	   p.GID = md->bl.id;
	   p.HP = md->status.hp;
	   p.MaxHP = md->status.max_hp;

	   clif->send(&p, sizeof(p), &sd->bl, SELF);
        }
}

PD: Don't forget to recompile.

 

Where will i put 'md->state.boss'? I don't wanna mess things up. Thanks :D


Try navigating to the function clif_monster_hp_bar in clif.c and add a condition for the mob to be a mvp. Something like md->state.boss

void clif_monster_hp_bar( struct mob_data* md, struct map_session_data *sd ) {
	struct packet_monster_hp p;
	
	nullpo_retv(md);
	nullpo_retv(sd);
        if(md->state.boss){
	   p.PacketType = monsterhpType;
	   p.GID = md->bl.id;
	   p.HP = md->status.hp;
	   p.MaxHP = md->status.max_hp;

	   clif->send(&p, sizeof(p), &sd->bl, SELF);
        }
}

PD: Don't forget to recompile.

 

 

I assume it would look something like this? 

void clif_monster_hp_bar( struct mob_data* md, struct map_session_data *sd ) {
    if( md->state.boss ){
    struct packet_monster_hp p;
 
    nullpo_retv(md);
    nullpo_retv(sd);
    p.PacketType = monsterhpType;
    p.GID = md->bl.id;
    p.HP = md->status.hp;
    p.MaxHP = md->status.max_hp;
    clif->send(&p, sizeof(p), &sd->bl, 

 

I tried it, it still shows normal mob's HP



#4 Nardoth

Nardoth

    Member

  • Members
  • PipPip
  • 26 posts

Posted 16 September 2016 - 07:24 AM

I actually writed it in the code, after the nullpo, you just need to copy and paste. Anyways I checked it, it doesn't work, The function is for older client versions. There are other functions too like clif_hp_meter and the like but I can't figure out how to do it, every mob still has the hp bar.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users


This topic has been visited by 22 user(s)