diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-10-27 04:52:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-10-30 04:39:52 +0300 |
commit | aa8466c0b83f12599305032df5c86b8ec59ae444 (patch) | |
tree | 1a006e6b1bfc5d710549f55af0493868ac333682 /src/map/clif.c | |
parent | 9519c40b00802dfb22070884820ab4a26d7c5ba5 (diff) | |
download | hercules-aa8466c0b83f12599305032df5c86b8ec59ae444.tar.gz hercules-aa8466c0b83f12599305032df5c86b8ec59ae444.tar.bz2 hercules-aa8466c0b83f12599305032df5c86b8ec59ae444.tar.xz hercules-aa8466c0b83f12599305032df5c86b8ec59ae444.zip |
Add monster spawn boss flag for miniboss: miniboss_monster
also fix boss_monster flag for works as mvp and not like mini boss.
unhide boss flag if hp bar disabled.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 088c92ea8..1b7d94ca9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1067,14 +1067,17 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu #endif #if PACKETVER >= 20120221 if (battle_config.show_monster_hp_bar && bl->type == BL_MOB && status_get_hp(bl) < status_get_max_hp(bl)) { - const struct mob_data *md = BL_UCCAST(BL_MOB, bl); p.maxHP = status_get_max_hp(bl); p.HP = status_get_hp(bl); - p.isBoss = (md->spawn != NULL && md->spawn->state.boss) ? 1 : 0; } else { p.maxHP = -1; p.HP = -1; - p.isBoss = 0; + } + if (bl->type == BL_MOB) { + const struct mob_data *md = BL_UCCAST(BL_MOB, bl); + p.isBoss = (md->spawn != NULL) ? md->spawn->state.boss : BTYPE_NONE; + } else { + p.isBoss = BTYPE_NONE; } #endif #if PACKETVER >= 20150513 @@ -1216,14 +1219,17 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) { #endif #if PACKETVER >= 20120221 if (battle_config.show_monster_hp_bar && bl->type == BL_MOB && status_get_hp(bl) < status_get_max_hp(bl)) { - const struct mob_data *md = BL_UCCAST(BL_MOB, bl); p.maxHP = status_get_max_hp(bl); p.HP = status_get_hp(bl); - p.isBoss = (md->spawn != NULL && md->spawn->state.boss) ? 1 : 0; } else { p.maxHP = -1; p.HP = -1; - p.isBoss = 0; + } + if (bl->type == BL_MOB) { + const struct mob_data *md = BL_UCCAST(BL_MOB, bl); + p.isBoss = (md->spawn != NULL) ? md->spawn->state.boss : BTYPE_NONE; + } else { + p.isBoss = BTYPE_NONE; } #endif #if PACKETVER >= 20150513 @@ -1315,14 +1321,17 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd, #endif #if PACKETVER >= 20120221 if (battle_config.show_monster_hp_bar && bl->type == BL_MOB && status_get_hp(bl) < status_get_max_hp(bl)) { - const struct mob_data *md = BL_UCCAST(BL_MOB, bl); p.maxHP = status_get_max_hp(bl); p.HP = status_get_hp(bl); - p.isBoss = (md->spawn != NULL && md->spawn->state.boss) ? 1 : 0; } else { p.maxHP = -1; p.HP = -1; - p.isBoss = 0; + } + if (bl->type == BL_MOB) { + const struct mob_data *md = BL_UCCAST(BL_MOB, bl); + p.isBoss = (md->spawn != NULL) ? md->spawn->state.boss : BTYPE_NONE; + } else { + p.isBoss = BTYPE_NONE; } #endif #if PACKETVER >= 20150513 |