diff --git a/server/gameserver/mt/BattleHeroGrow.cc b/server/gameserver/mt/BattleHeroGrow.cc new file mode 100644 index 00000000..93aeb72f --- /dev/null +++ b/server/gameserver/mt/BattleHeroGrow.cc @@ -0,0 +1,19 @@ +#include "precompile.h" + +#include "mt/BattleHeroGrow.h" + +IMPL_TABLE(mt::BattleHeroGrow) + +namespace mt +{ + + void BattleHeroGrow::Init1() + { + } + + void BattleHeroGrow::Init2() + { + + } + +} diff --git a/server/gameserver/mt/BattleHeroGrow.h b/server/gameserver/mt/BattleHeroGrow.h new file mode 100644 index 00000000..4430bff5 --- /dev/null +++ b/server/gameserver/mt/BattleHeroGrow.h @@ -0,0 +1,20 @@ +#pragma once + +#include "mt/macro.h" +#include "mtb/BattleHeroGrow.h" + +namespace mt +{ + + DECLARE_ID_TABLE(BattleHeroGrow, mtb::BattleHeroGrow, + "battleHeroGrow@battleHeroGrow.json", + "id") + public: + + void Init1(); + void Init2(); + + private: + }; + +} diff --git a/server/gameserver/mt/MetaMgr.cc b/server/gameserver/mt/MetaMgr.cc index be17704c..f529c79b 100644 --- a/server/gameserver/mt/MetaMgr.cc +++ b/server/gameserver/mt/MetaMgr.cc @@ -48,6 +48,7 @@ #include "mt/Condition.h" #include "mt/Distribution.h" #include "mt/LootConfig.h" +#include "mt/BattleHeroGrow.h" #include "app.h" @@ -123,6 +124,7 @@ namespace mt RegMetaTable(res_path_); RegMetaTable(res_path_); RegMetaTable(res_path_); + RegMetaTable(res_path_); } void MetaMgr::Load() diff --git a/server/gameserver/mtb/BattleBasicAttribute.h b/server/gameserver/mtb/BattleBasicAttribute.h index 32504df9..c0bb55fe 100644 --- a/server/gameserver/mtb/BattleBasicAttribute.h +++ b/server/gameserver/mtb/BattleBasicAttribute.h @@ -41,6 +41,7 @@ namespace mtb float vOrigDrain() const { return vOrigDrain_; }; float vOrigTenacity() const { return vOrigTenacity_; }; float vOrigBloDef() const { return vOrigBloDef_; }; + const std::string battleGrowRule() const { return battleGrowRule_; }; bool has_id() const { return __flags__.test(0);}; bool has_pBaseHealth() const { return __flags__.test(1);}; @@ -73,6 +74,7 @@ namespace mtb bool has_vOrigDrain() const { return __flags__.test(28);}; bool has_vOrigTenacity() const { return __flags__.test(29);}; bool has_vOrigBloDef() const { return __flags__.test(30);}; + bool has_battleGrowRule() const { return __flags__.test(31);}; protected: @@ -107,9 +109,10 @@ namespace mtb float vOrigDrain_ = 0.0f; float vOrigTenacity_ = 0.0f; float vOrigBloDef_ = 0.0f; + std::string battleGrowRule_; public: - std::bitset<31> __flags__; + std::bitset<32> __flags__; }; }; diff --git a/server/gameserver/mtb/BattleHeroGrow.h b/server/gameserver/mtb/BattleHeroGrow.h new file mode 100644 index 00000000..a7c9e951 --- /dev/null +++ b/server/gameserver/mtb/BattleHeroGrow.h @@ -0,0 +1,55 @@ +#pragma once + +#include + +namespace mtb +{ + + class BattleHeroGrow + { + public: + + std::shared_ptr GetClass() const; + int id() const { return id_; }; + int invoke() const { return invoke_; }; + int heroId() const { return heroId_; }; + int level() const { return level_; }; + int levelExp() const { return levelExp_; }; + int cumExp() const { return cumExp_; }; + int lootExp() const { return lootExp_; }; + const std::string currentLevelAttribute() const { return currentLevelAttribute_; }; + const std::string currentEquipEffect() const { return currentEquipEffect_; }; + const std::string currentSkillEffect() const { return currentSkillEffect_; }; + const std::string currentSkillDesc() const { return currentSkillDesc_; }; + + bool has_id() const { return __flags__.test(0);}; + bool has_invoke() const { return __flags__.test(1);}; + bool has_heroId() const { return __flags__.test(2);}; + bool has_level() const { return __flags__.test(3);}; + bool has_levelExp() const { return __flags__.test(4);}; + bool has_cumExp() const { return __flags__.test(5);}; + bool has_lootExp() const { return __flags__.test(6);}; + bool has_currentLevelAttribute() const { return __flags__.test(7);}; + bool has_currentEquipEffect() const { return __flags__.test(8);}; + bool has_currentSkillEffect() const { return __flags__.test(9);}; + bool has_currentSkillDesc() const { return __flags__.test(10);}; + + protected: + + int id_ = 0; + int invoke_ = 0; + int heroId_ = 0; + int level_ = 0; + int levelExp_ = 0; + int cumExp_ = 0; + int lootExp_ = 0; + std::string currentLevelAttribute_; + std::string currentEquipEffect_; + std::string currentSkillEffect_; + std::string currentSkillDesc_; + +public: + std::bitset<11> __flags__; + }; + +}; diff --git a/server/gameserver/mtb/mtb.all.cc b/server/gameserver/mtb/mtb.all.cc index a949bf9b..d9a44c4c 100644 --- a/server/gameserver/mtb/mtb.all.cc +++ b/server/gameserver/mtb/mtb.all.cc @@ -49,6 +49,7 @@ #include "mtb/Condition.h" #include "mtb/Distribution.h" #include "mtb/LootConfig.h" +#include "mtb/BattleHeroGrow.h" namespace mtb { @@ -901,7 +902,7 @@ namespace mtb { std::shared_ptr meta_class = nullptr; if (!meta_class) { - meta_class = std::make_shared("BattleBasicAttribute", 31, 0); + meta_class = std::make_shared("BattleBasicAttribute", 32, 0); meta_class->SetSimpleField(0, "id", a8::reflect::ET_INT32, my_offsetof2(BattleBasicAttribute, id_)); meta_class->SetSimpleField(1, "pBaseHealth", a8::reflect::ET_FLOAT, my_offsetof2(BattleBasicAttribute, pBaseHealth_)); meta_class->SetSimpleField(2, "pOrigHealth", a8::reflect::ET_FLOAT, my_offsetof2(BattleBasicAttribute, pOrigHealth_)); @@ -933,6 +934,7 @@ namespace mtb meta_class->SetSimpleField(28, "vOrigDrain", a8::reflect::ET_FLOAT, my_offsetof2(BattleBasicAttribute, vOrigDrain_)); meta_class->SetSimpleField(29, "vOrigTenacity", a8::reflect::ET_FLOAT, my_offsetof2(BattleBasicAttribute, vOrigTenacity_)); meta_class->SetSimpleField(30, "vOrigBloDef", a8::reflect::ET_FLOAT, my_offsetof2(BattleBasicAttribute, vOrigBloDef_)); + meta_class->SetSimpleField(31, "battleGrowRule", a8::reflect::ET_STRING, my_offsetof2(BattleBasicAttribute, battleGrowRule_)); } return meta_class; } @@ -1032,4 +1034,24 @@ namespace mtb return meta_class; } + std::shared_ptr BattleHeroGrow::GetClass() const + { + std::shared_ptr meta_class = nullptr; + if (!meta_class) { + meta_class = std::make_shared("BattleHeroGrow", 11, 0); + meta_class->SetSimpleField(0, "id", a8::reflect::ET_INT32, my_offsetof2(BattleHeroGrow, id_)); + meta_class->SetSimpleField(1, "invoke", a8::reflect::ET_INT32, my_offsetof2(BattleHeroGrow, invoke_)); + meta_class->SetSimpleField(2, "heroId", a8::reflect::ET_INT32, my_offsetof2(BattleHeroGrow, heroId_)); + meta_class->SetSimpleField(3, "level", a8::reflect::ET_INT32, my_offsetof2(BattleHeroGrow, level_)); + meta_class->SetSimpleField(4, "levelExp", a8::reflect::ET_INT32, my_offsetof2(BattleHeroGrow, levelExp_)); + meta_class->SetSimpleField(5, "cumExp", a8::reflect::ET_INT32, my_offsetof2(BattleHeroGrow, cumExp_)); + meta_class->SetSimpleField(6, "lootExp", a8::reflect::ET_INT32, my_offsetof2(BattleHeroGrow, lootExp_)); + meta_class->SetSimpleField(7, "currentLevelAttribute", a8::reflect::ET_STRING, my_offsetof2(BattleHeroGrow, currentLevelAttribute_)); + meta_class->SetSimpleField(8, "currentEquipEffect", a8::reflect::ET_STRING, my_offsetof2(BattleHeroGrow, currentEquipEffect_)); + meta_class->SetSimpleField(9, "currentSkillEffect", a8::reflect::ET_STRING, my_offsetof2(BattleHeroGrow, currentSkillEffect_)); + meta_class->SetSimpleField(10, "currentSkillDesc", a8::reflect::ET_STRING, my_offsetof2(BattleHeroGrow, currentSkillDesc_)); + } + return meta_class; + } + } diff --git a/server/tools/protobuild/mt.proto b/server/tools/protobuild/mt.proto index 838ed444..119ace08 100755 --- a/server/tools/protobuild/mt.proto +++ b/server/tools/protobuild/mt.proto @@ -698,6 +698,7 @@ message BattleBasicAttribute optional float vOrigDrain = 29; optional float vOrigTenacity = 30; optional float vOrigBloDef = 31; + optional string battleGrowRule = 32; } message BattleLevelAttribute @@ -760,3 +761,18 @@ message LootConfig optional string numPara = 3; optional string content = 4; } + +message BattleHeroGrow +{ + optional int32 id = 1; + optional int32 invoke = 2; + optional int32 heroId = 3; + optional int32 level = 4; + optional int32 levelExp = 5; + optional int32 cumExp = 6; + optional int32 lootExp = 7; + optional string currentLevelAttribute = 8; + optional string currentEquipEffect = 9; + optional string currentSkillEffect = 10; + optional string currentSkillDesc = 11; +}