diff options
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 0d6055b13..d8fefa61a 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2068,11 +2068,17 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage) { if (battle_config.show_mob_info&3) clif->charnameack (0, &md->bl); + +#if PACKETVER >= 20131223 + // Resend ZC_NOTIFY_MOVEENTRY to Update the HP + if (battle_config.show_monster_hp_bar) + clif->set_unit_walking(&md->bl, NULL, unit->bl2ud(&md->bl), AREA); +#endif if (!src) return; -#if PACKETVER >= 20120404 +#if (PACKETVER >= 20120404 && PACKETVER < 20131223) if (battle_config.show_monster_hp_bar && !(md->status.mode&MD_BOSS)) { int i; for(i = 0; i < DAMAGELOG_SIZE; i++){ // must show hp bar to all char who already hit the mob. @@ -2741,39 +2747,39 @@ int mob_random_class (int *value, size_t count) /*========================================== * Change mob base class *------------------------------------------*/ -int mob_class_change (struct mob_data *md, int class_) -{ +int mob_class_change (struct mob_data *md, int class_) { + int64 tick = timer->gettick(), c = 0; int i, hp_rate; nullpo_ret(md); - if( md->bl.prev == NULL ) + if (md->bl.prev == NULL) return 0; - //Disable class changing for some targets... + // Disable class changing for some targets... if (md->guardian_data) - return 0; //Guardians/Emperium + return 0; // Guardians/Emperium - if( mob_is_treasure(md) ) - return 0; //Treasure Boxes + if (mob_is_treasure(md)) + return 0; // Treasure Boxes - if( md->special_state.ai > AI_ATTACK ) - return 0; //Marine Spheres and Floras. + if (md->special_state.ai > AI_ATTACK) + return 0; // Marine Spheres and Floras. - if( mob->is_clone(md->class_) ) - return 0; //Clones + if (mob->is_clone(md->class_)) + return 0; // Clones - if( md->class_ == class_ ) - return 0; //Nothing to change. + if (md->class_ == class_) + return 0; // Nothing to change. hp_rate = get_percentage(md->status.hp, md->status.max_hp); md->class_ = class_; md->db = mob->db(class_); - if (battle_config.override_mob_names==1) - memcpy(md->name,md->db->name,NAME_LENGTH); + if (battle_config.override_mob_names == 1) + memcpy(md->name, md->db->name, NAME_LENGTH); else - memcpy(md->name,md->db->jname,NAME_LENGTH); + memcpy(md->name, md->db->jname, NAME_LENGTH); mob_stop_attack(md); mob_stop_walking(md, STOPWALKING_FLAG_NONE); @@ -2813,8 +2819,13 @@ void mob_heal(struct mob_data *md, unsigned int heal) { if (battle_config.show_mob_info&3) clif->charnameack (0, &md->bl); +#if PACKETVER >= 20131223 + // Resend ZC_NOTIFY_MOVEENTRY to Update the HP + if (battle_config.show_monster_hp_bar) + clif->set_unit_walking(&md->bl, NULL, unit->bl2ud(&md->bl), AREA); +#endif -#if PACKETVER >= 20120404 +#if (PACKETVER >= 20120404 && PACKETVER < 20131223) if (battle_config.show_monster_hp_bar && !(md->status.mode&MD_BOSS)) { int i; for(i = 0; i < DAMAGELOG_SIZE; i++){ // must show hp bar to all char who already hit the mob. |