From 71287dce40bbf195033d4d70f0cfbfa9dbc99a6f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 12 Jan 2024 19:25:59 +0800 Subject: [PATCH] 1 --- server/gameserver/hero.cc | 7 +++++++ server/gameserver/human.cc | 6 ++++++ server/gameserver/mt/BattleBasicAttribute.cc | 4 ++-- server/gameserver/mt/BattleBasicAttribute.h | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/server/gameserver/hero.cc b/server/gameserver/hero.cc index 65165fab..71176b3d 100644 --- a/server/gameserver/hero.cc +++ b/server/gameserver/hero.cc @@ -27,6 +27,8 @@ #include "mt/Hero.h" #include "mt/Equip.h" #include "mt/MapThing.h" +#include "mt/BattleBasicAttribute.h" +#include "mt/Map.h" Hero::Hero():Creature() { @@ -86,6 +88,11 @@ void Hero::Initialize() AddSkill(skill_id); } } + if (GetHeroMeta()->GetBasicMeta()) { + SetHeroLevel(1, 0, GetHeroMeta()->GetBasicMeta()->GetGrowMeta(room->GetMapMeta()->map_id())); + } else { + SetHeroLevel(1, 0, nullptr); + } } void Hero::Update(int delta_time) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 38ef3ec5..4d083b14 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -67,6 +67,7 @@ #include "mt/KillPoint.h" #include "mt/Drop.h" #include "mt/MergeItem.h" +#include "mt/BattleBasicAttribute.h" #include "pbutils.h" @@ -109,6 +110,11 @@ void Human::Initialize() observers_.insert(this); SetCurrWeapon(&weapons[0]); SetOxygen(mt::Param::s().dive_oxygen_total); + if (GetHeroMeta()->GetBasicMeta()) { + SetHeroLevel(1, 0, GetHeroMeta()->GetBasicMeta()->GetGrowMeta(room->GetMapMeta()->map_id())); + } else { + SetHeroLevel(1, 0, nullptr); + } } float Human::GetSpeed() diff --git a/server/gameserver/mt/BattleBasicAttribute.cc b/server/gameserver/mt/BattleBasicAttribute.cc index bb0af174..d1b7dc15 100644 --- a/server/gameserver/mt/BattleBasicAttribute.cc +++ b/server/gameserver/mt/BattleBasicAttribute.cc @@ -17,9 +17,9 @@ namespace mt } - const BattleHeroGrow* BattleBasicAttribute::GetGrowMeta(int map_id) + const BattleHeroGrow* BattleBasicAttribute::GetGrowMeta(int map_id) const { - + return nullptr; } } diff --git a/server/gameserver/mt/BattleBasicAttribute.h b/server/gameserver/mt/BattleBasicAttribute.h index 20783153..0b6b949c 100644 --- a/server/gameserver/mt/BattleBasicAttribute.h +++ b/server/gameserver/mt/BattleBasicAttribute.h @@ -15,7 +15,7 @@ namespace mt void Init1(); void Init2(); - const BattleHeroGrow* GetGrowMeta(int map_id); + const BattleHeroGrow* GetGrowMeta(int map_id) const; }; }