diff --git a/modules/gm/api_cmd.go b/modules/gm/api_cmd.go index 68af62b29..73e3fc64d 100644 --- a/modules/gm/api_cmd.go +++ b/modules/gm/api_cmd.go @@ -39,6 +39,7 @@ import ( 23、bingo:viplv,50 24、bingo:cleannpc 31、bingo:jx // 获得所有教习资源 +32、bingo:godlike // 一键超神 */ //参数校验 func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (errdata *pb.ErrorData) { diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index 3eeeb97c1..0ad802d11 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -1,4 +1,3 @@ - package hero import ( @@ -477,3 +476,21 @@ func (this *configureComp) GetHeroByPool(pool string) (hid string, err error) { err = comm.NewNotFoundConfErr(moduleName, hero_cardpool, pool) return } + +// gm 用 不管性能 +func (this *configureComp) GMGetTalentByHeroId(hid string) (data []*cfg.GameHeroTalentData, err error) { + var ( + v interface{} + ) + if v, err = this.GetConfigure(hero_talent); err == nil { + if configure, ok := v.(*cfg.GameHeroTalent); ok { + for _, v1 := range configure.GetDataList() { + if v1.Hid == hid { + data = append(data, v1) + } + } + } + } + err = comm.NewNotFoundConfErr(moduleName, hero_talent, hid) + return +} diff --git a/modules/hero/model_talent.go b/modules/hero/model_talent.go index 798b2efc8..392357dc0 100644 --- a/modules/hero/model_talent.go +++ b/modules/hero/model_talent.go @@ -68,3 +68,11 @@ func (this *ModelTalent) CreateHeroTalent(uid, heroId string) (talent *pb.DBHero err = this.AddList(uid, talent.Id, talent) return } + +// gm 专用 清除所有的天赋 + +func (this *ModelTalent) CleanAllHeroTalent(uid string) (talent *pb.DBHeroTalent, err error) { + + err = this.DelByUId(uid) + return +} diff --git a/modules/hero/module.go b/modules/hero/module.go index e59c915aa..d56130d81 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -703,6 +703,28 @@ func (this *Hero) GetAllMaxHero(session comm.IUserSession) (errdata *pb.ErrorDat "juexProperty": hero.JuexProperty, } + if true { // 满天赋 + //var talent *pb.DBHeroTalent + talnet, _ := this.modelTalent.GetHerotalent(session.GetUserId()) + this.modelTalent.CleanAllHeroTalent(session.GetUserId()) + data, err := this.configure.GMGetTalentByHeroId(hero.HeroID) + if err == nil { + for _, v := range talnet { + if v.HeroId == hero.HeroID { + for _, v2 := range data { + v.Talent[v2.Skillid] = 1 + } + } + } + } + // talent.Talent[req.TalentID] = 1 + // update := make(map[string]interface{}, 0) + // update["talent"] = talent.Talent + // if err = this.module.modelTalent.ChangeHeroTalent(talent, update); err != nil { + // this.module.Errorf("update failed :%v", err) + // } + // this.modelHero.setTalentProperty(hero) + } // 保存数据 err = this.modelHero.ChangeList(session.GetUserId(), hero.Id, _heroMap) if err != nil {