Назад

Отображение Hp И Уровень Моба Одновремено

Автор: MiRoTVoReZ: Дата: 09.29.2008

1. Залазим в /src/map/clif.c
2. Находим там примерно на 7146 строке такой код:

case BL_MOB:
{
struct mob_data *md = (struct mob_data *)bl;
nullpo_retr(0, md);

memcpy(WBUFP(buf,6), md->name, NAME_LENGTH);
if (md->guardian_data && md->guardian_data->guild_id) {
WBUFW(buf, 0) = cmd = 0x195;
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_info) {
char mobhp[50], *str_p = mobhp;

WBUFW(buf, 0) = cmd = 0x195;
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%% | ",
md->status.max_hp > 10000?
md->status.hp/(md->status.max_hp/100):
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]
if (str_p != mobhp) {
*(str_p-3) = '\'; //Remove trailing space + pipe.
memcpy(WBUFP(buf,30), mobhp, NAME_LENGTH);
WBUFB(buf,54) = 0;
memcpy(WBUFP(buf,78), mobhp, NAME_LENGTH);
}
}
}
break;


3. Далее в этом коде находим строчку:
str_p += sprintf(str_p, "HP: %u/%u | ", md->status.hp, md->status.max_hp);



4. Заменяем ее на:

str_p += sprintf(str_p, "HP: %u/%u - %d | ", md->status.hp, md->status.max_hp, md->level);


5. Компилируем




PS: Чтобы отображалось жизнь и уровень необходимо иметь show_mob_info = 1 в файле conf/battle/monster.conf

Автор: : Дата: 01.01.1970