diff --git a/comm/const.go b/comm/const.go index 2775d07af..1131625e6 100644 --- a/comm/const.go +++ b/comm/const.go @@ -518,11 +518,11 @@ const ( Rtype33 TaskType = 33 //xx个品质为xx以及以上英雄升到xx级 Rtype34 TaskType = 34 //xx个英雄觉醒达到xx阶段 Rtype35 TaskType = 35 //xx英雄觉醒达到xx阶段 - Rtype36 TaskType = 36 //xx位xx品质xx职业英雄(xx阵营)觉醒达到xx阶段 - Rtype37 TaskType = 37 //xx名xx品质英雄满共鸣、等级、觉醒 - Rtype38 TaskType = 38 //xx英雄满级、共鸣、觉醒至最高状态 + Rtype36 TaskType = 36 //xx位xx品质xx职业英雄(xx阵营)觉醒达到xx阶段(检查满级,满共鸣,满觉醒的英雄数量,每有一个进度+1) + Rtype37 TaskType = 37 //xx名xx品质英雄 + Rtype38 TaskType = 38 //xx英雄满级 Rtype39 TaskType = 39 //累计英雄共鸣xx次 - Rtype40 TaskType = 40 //xx个英雄共鸣满xx次 + Rtype40 TaskType = 40 //将xx个英雄共鸣xx次 Rtype41 TaskType = 41 //xx名英雄穿戴xx件xx星级的装备 Rtype42 TaskType = 42 //xx名英雄穿戴xx件xx等级的装备 Rtype43 TaskType = 43 //将xx件装备强化至xx级 diff --git a/modules/hero/api_awaken.go b/modules/hero/api_awaken.go index 65d776515..aa1824544 100644 --- a/modules/hero/api_awaken.go +++ b/modules/hero/api_awaken.go @@ -109,14 +109,29 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c cfg := this.module.configure.GetHeroConfig(_hero.HeroID) if cfg != nil { szTask = append(szTask, comm.GettaskParam(comm.Rtype121, cfg.Race, utils.ToInt32(_hero.HeroID), _hero.JuexingLv)) - szTask = append(szTask, comm.GettaskParam(comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, _hero.JuexingLv)) + //xx英雄满级、共鸣、觉醒至最高状态 nextAwaken := this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1) if nextAwaken == nil { // 达到满级觉醒 if _hero.Lv == this.module.configure.GetHeroMaxLv(_hero.Star) { - szTask = append(szTask, comm.GettaskParam(comm.Rtype37, 1, cfg.Color)) - szTask = append(szTask, comm.GettaskParam(comm.Rtype38, 1)) + // 校验共鸣满级 + var _l int32 + talent, err := this.module.modelTalent.GetHerotalent(session.GetUserId()) + if err == nil { + for _, v := range talent { + if v.HeroId == _hero.HeroID { + _l = int32(len(v.Talent)) + break + } + } + } + if this.module.configure.GetHeroTalentMaxLv(_hero.HeroID) == _l { + szTask = append(szTask, comm.GettaskParam(comm.Rtype37, 1, cfg.Color)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype38, 1)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, _hero.JuexingLv)) + } + } } } diff --git a/modules/hero/api_talentlearn.go b/modules/hero/api_talentlearn.go index 15288fcc1..2227a42d8 100644 --- a/modules/hero/api_talentlearn.go +++ b/modules/hero/api_talentlearn.go @@ -141,11 +141,23 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe szTask = append(szTask, comm.GettaskParam(comm.Rtype123, 1, heroObj.Lv, heroObj.Star)) szTask = append(szTask, comm.GettaskParam(comm.Rtype124, 1)) szTask = append(szTask, comm.GettaskParam(comm.Rtype125, 1, utils.ToInt32(heroObj.HeroID))) - if cfg := this.module.configure.GetHeroConfig(heroObj.HeroID); cfg != nil { + cfg := this.module.configure.GetHeroConfig(heroObj.HeroID) + if cfg != nil { szTask = append(szTask, comm.GettaskParam(comm.Rtype126, 1, cfg.Race)) } szTask = append(szTask, comm.GettaskParam(comm.Rtype127, 1, heroObj.Star)) + nextAwaken := this.module.configure.GetHeroAwakenConfig(heroObj.HeroID, heroObj.JuexingLv+1) + if nextAwaken == nil { // 达到满级觉醒 + if heroObj.Lv == this.module.configure.GetHeroMaxLv(heroObj.Star) { + + if this.module.configure.GetHeroTalentMaxLv(heroObj.HeroID) == int32(len(talent.Talent)) { + szTask = append(szTask, comm.GettaskParam(comm.Rtype37, 1, cfg.Color)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype38, 1)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, heroObj.JuexingLv)) + } + } + } go this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) } diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index a843fda7a..c2b3093ca 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -385,3 +385,13 @@ func (this *configureComp) GetHeroMaxLv(star int32) int32 { return 1 } +func (this *configureComp) GetHeroTalentMaxLv(heroid string) (maxlv int32) { + if v, err := this.GetConfigure(hero_talentbox); err == nil { + if configure, ok := v.(*cfg.GameTalentBox); ok { + + return int32(len(configure.GetDataList())) + } + } + + return 0 +} diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 7e3f200a3..94e43a27c 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -592,14 +592,26 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, hero *pb.DBHero, ex if cfg := this.moduleHero.configure.GetHeroConfig(hero.HeroID); cfg != nil { szTask = append(szTask, comm.GettaskParam(comm.Rtype32, 1, cfg.Color, hero.Lv)) - szTask = append(szTask, comm.GettaskParam(comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, hero.JuexingLv)) //xx英雄满级、共鸣、觉醒至最高状态 nextAwaken := this.moduleHero.configure.GetHeroAwakenConfig(hero.HeroID, hero.JuexingLv+1) if nextAwaken == nil { // 达到满级觉醒 if hero.Lv == this.moduleHero.configure.GetHeroMaxLv(hero.Star) { - szTask = append(szTask, comm.GettaskParam(comm.Rtype37, 1, cfg.Color)) - szTask = append(szTask, comm.GettaskParam(comm.Rtype38, 1)) + var _l int32 + talent, err := this.moduleHero.modelTalent.GetHerotalent(session.GetUserId()) + if err == nil { + for _, v := range talent { + if v.HeroId == hero.HeroID { + _l = int32(len(v.Talent)) + break + } + } + } + if this.moduleHero.configure.GetHeroTalentMaxLv(hero.HeroID) == _l { + szTask = append(szTask, comm.GettaskParam(comm.Rtype37, 1, cfg.Color)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype38, 1)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, hero.JuexingLv)) + } } } } @@ -608,6 +620,7 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, hero *pb.DBHero, ex szTask = append(szTask, comm.GettaskParam(comm.Rtype113, hero.Lv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype33, 1, 1, hero.Lv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype118, hero.Lv, hero.JuexingLv)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype40, 1, 1)) go this.moduleHero.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) //this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype33, 1, 1, hero.Lv) }