summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-05 20:58:27 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-05 20:58:27 +0000
commit30899d3e29a02162c8ece5e0fca0fd05fcd10be1 (patch)
treec0580c2101c51597bcfdbd546ff54cc52fc61fc4 /src/map/clif.c
parent7dca4f40ec19769deb05f315d4e35417cea06a19 (diff)
downloadhercules-30899d3e29a02162c8ece5e0fca0fd05fcd10be1.tar.gz
hercules-30899d3e29a02162c8ece5e0fca0fd05fcd10be1.tar.bz2
hercules-30899d3e29a02162c8ece5e0fca0fd05fcd10be1.tar.xz
hercules-30899d3e29a02162c8ece5e0fca0fd05fcd10be1.zip
- Removed setting mob_show_hp, it's been replaced now by mob_show_info, which can be used to specify what kind of info should be displayed from a mob. Current options are two different formats for Hp display, and current level.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8644 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index a1942d5fc..f60594160 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7852,15 +7852,24 @@ int clif_charnameack (int fd, struct block_list *bl)
WBUFB(buf,30) = 0;
memcpy(WBUFP(buf,54), md->guardian_data->guild_name, NAME_LENGTH);
memcpy(WBUFP(buf,78), md->guardian_data->castle->castle_name, NAME_LENGTH);
- } else if (battle_config.show_mob_hp) {
- char mobhp[50];
+ } else if (battle_config.show_mob_info) {
+ char mobhp[50], *str_p = mobhp;
+
WBUFW(buf, 0) = cmd = 0x195;
- sprintf(mobhp, "HP: %u/%u", md->status.hp, md->status.max_hp);
+ if (battle_config.show_mob_info&4)
+ str_p += sprintf(str_p, "Lv. %d |", md->level);
+ if (battle_config.show_mob_info&1)
+ str_p += sprintf(str_p, "HP: %u/%u |", md->status.hp, md->status.max_hp);
+ if (battle_config.show_mob_info&2)
+ str_p += sprintf(str_p, "HP: %d%% |", 100*md->status.hp/md->status.max_hp);
//Even thought mobhp ain't a name, we send it as one so the client
//can parse it. [Skotlex]
- memcpy(WBUFP(buf,30), mobhp, NAME_LENGTH);
- WBUFB(buf,54) = 0;
- memcpy(WBUFP(buf,78), mobhp, NAME_LENGTH);
+ if (str_p != mobhp) {
+ *(str_p-2) = '\0'; //Remove trailing space + pipe.
+ memcpy(WBUFP(buf,30), mobhp, NAME_LENGTH);
+ WBUFB(buf,54) = 0;
+ memcpy(WBUFP(buf,78), mobhp, NAME_LENGTH);
+ }
}
}
break;