You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

62 lines
2.2 KiB

using Org.BouncyCastle.Ocsp;
using ProtoCSStruct;
using Sog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Game
{
public class LevelSvc
{
public static void OnLevelUp(PlayerOnGame player)
{
//7 巅峰等级 巅峰起始等级 51
//8 巅峰等级 每个巅峰等级提供天赋点数 1
int plevel = CommParamDescMgr.Instance.PeakLvStart.int_val;
int lv = player.RoleData.Knight.DbHero.Level;
TalentSvc.AddTalentPoint(player, 1);
if(lv < plevel)
{
TaskEXEvent.ToLevelUp(player);
}
else
{
player.RoleData.Knight.DbHero.LevelData.FreePoint += CommParamDescMgr.Instance.PeakLvPointNum.int_val;
var sync = new CSPeakLevelSync();
sync.Data.CopyFrom(ref player.RoleData.Knight.DbHero.LevelData);
player.SendToClient((int)CSGameMsgID.PeaklevelSync, ref sync);
}
}
public static void CalcLevelProps(ref DBRoleData roleDat, RoleProp roleProp)
{
foreach (var item in CSPropIDTypeDescMgr.Instance.ItemTable)
{
var basep = item.Value.baseProp;
if(basep > 0)
{
roleProp.AddProp(item.Value.type, basep);
}
}
int level = roleDat.Knight.DbHero.Level;
var desc = LevelDescMgr.Instance.GetConfig(level);
if (desc != null)
{
roleProp.AddProp(PropertyDef.HpFixedIncrease, desc.hp);
roleProp.AddProp(PropertyDef.AtkFixedIncrease, desc.atk);
roleProp.AddProp(PropertyDef.DefFixedIncrease, desc.def);
}
for(int i = 0;i < roleDat.Knight.DbHero.LevelData.AddPoint.Count; i++)
{
ref var ap = ref roleDat.Knight.DbHero.LevelData.AddPoint[i];
var pdesc = PeakLevelDescMgr.Instance.GetConfig(ap.Id);
roleProp.AddProp(pdesc.propIdType, pdesc.propValue * ap.Value);
}
}
}
}