设置满天赋

This commit is contained in:
meixiongfeng 2023-07-06 22:59:21 +08:00
parent 428e3030b9
commit cd2e9e18ac
4 changed files with 49 additions and 1 deletions

View File

@ -39,6 +39,7 @@ import (
23bingo:viplv,50
24bingo:cleannpc
31bingo:jx // 获得所有教习资源
32bingo:godlike // 一键超神
*/
//参数校验
func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (errdata *pb.ErrorData) {

View File

@ -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
}

View File

@ -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
}

View File

@ -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 {