diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 73a8d392..49495d13 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -1691,6 +1691,7 @@ Hero* Creature::SummonHero(Buff* buff, GetAttackDir(), pos ); + hero->hero_level = GetBattleContext()->GetHeroLevel(); } return hero; } diff --git a/server/gameserver/hero.h b/server/gameserver/hero.h index 00874302..28fab48e 100644 --- a/server/gameserver/hero.h +++ b/server/gameserver/hero.h @@ -16,6 +16,7 @@ public: const mt::Hero* meta = nullptr; bool is_pve_boss = false; list_head entry; + int hero_level = 1; Hero(); virtual ~Hero() override; diff --git a/server/gameserver/pbutils.cc b/server/gameserver/pbutils.cc index 0fad2ff1..19b5e07f 100644 --- a/server/gameserver/pbutils.cc +++ b/server/gameserver/pbutils.cc @@ -379,6 +379,7 @@ void Hero::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_data) p->set_dead(dead); p->set_health(GetHP()); p->set_max_health(GetMaxHP()); + p->set_hero_level(hero_level); Creature_FillBuffList(this, hum, p->mutable_buff_list()); Creature_FillEffectList(this, hum, p->mutable_effect_list()); p->set_team_id(team_id); diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index 9e57c194..c625d9e4 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -440,6 +440,7 @@ message MFHeroFull optional float max_health = 13; //最大血量 repeated MFEffect effect_list = 14; //特效列表 optional int32 team_id = 15; //队伍id + optional int32 hero_level = 16; //hero等级 } //载具-部分