修改英雄升级奖励

This commit is contained in:
liwei1dao 2024-01-12 10:27:55 +08:00
parent 5cba1c5aa9
commit b9207793d8

View File

@ -414,7 +414,7 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, heros []*pb.DBHero,
var (
user *pb.DBUser
expConf *cfg.GamePlayerlvData
heroconf *cfg.GameHeroData
preLv int32 //加经验之前的等级
curExp int32 // 加经验之后的经验
curLv int32 // 加经验之后的等级
@ -459,7 +459,13 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, heros []*pb.DBHero,
}
return
}
if heroconf, err = this.module.configure.GetHeroConfig(hero.HeroID); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Message: err.Error(),
}
return
}
var maxExp int32
maxExp = _data.Heroexp
if maxLv <= curLv && curExp >= maxExp { // 加经验之前校验是否达到最大等级
@ -489,6 +495,9 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, heros []*pb.DBHero,
} else { // 升级操作
curExp -= maxExp
curLv += 1 // 经验够了 那么等级+1
if upwardconf, err = this.module.configure.GetHeroLvUpWardData(heroconf.Star, curLv); err == nil {
upwardconfs = append(upwardconfs, upwardconf)
}
_data = this.module.configure.GetHeroLv(curLv)
if _data == nil { // 等级加失败了 回到原来的等级
fullexp = (curExp - maxExp)
@ -530,11 +539,7 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, heros []*pb.DBHero,
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype24, curLv-preLv))
// szTask = append(szTask, comm.GetBuriedParam(comm.Rtype29, 1, hero.Lv, utils.ToInt32(hero.HeroID)))
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype23, hero.HeroID, hero.Star, hero.Lv))
if cfg, _ := this.module.configure.GetHeroConfig(hero.HeroID); cfg != nil {
if upwardconf, err = this.module.configure.GetHeroLvUpWardData(cfg.Star, curLv); err != nil {
upwardconfs = append(upwardconfs, upwardconf)
}
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype32, hero.HeroID, cfg.Color, hero.Lv))
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype32, hero.HeroID, heroconf.Color, hero.Lv))
//xx英雄满级、共鸣、觉醒至最高状态
nextAwaken, _ := this.module.configure.GetHeroAwakenConfig(hero.HeroID, hero.JuexingLv+1)
if nextAwaken == nil { // 达到满级觉醒
@ -550,14 +555,14 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, heros []*pb.DBHero,
}
}
if this.module.configure.GetHeroTalentMaxLv(hero.HeroID) == _l {
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype37, hero.HeroID, cfg.Color))
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype37, hero.HeroID, heroconf.Color))
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype38, hero.HeroID))
iHeroId, _ := strconv.Atoi(hero.HeroID)
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype243, hero.HeroID, int32(iHeroId)))
}
}
}
}
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype111, hero.HeroID, hero.Lv))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype112, 1, hero.Lv))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype113, hero.Lv))