设置满天赋
This commit is contained in:
parent
428e3030b9
commit
cd2e9e18ac
@ -39,6 +39,7 @@ import (
|
|||||||
23、bingo:viplv,50
|
23、bingo:viplv,50
|
||||||
24、bingo:cleannpc
|
24、bingo:cleannpc
|
||||||
31、bingo:jx // 获得所有教习资源
|
31、bingo:jx // 获得所有教习资源
|
||||||
|
32、bingo:godlike // 一键超神
|
||||||
*/
|
*/
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (errdata *pb.ErrorData) {
|
func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (errdata *pb.ErrorData) {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
package hero
|
package hero
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -477,3 +476,21 @@ func (this *configureComp) GetHeroByPool(pool string) (hid string, err error) {
|
|||||||
err = comm.NewNotFoundConfErr(moduleName, hero_cardpool, pool)
|
err = comm.NewNotFoundConfErr(moduleName, hero_cardpool, pool)
|
||||||
return
|
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
|
||||||
|
}
|
||||||
|
@ -68,3 +68,11 @@ func (this *ModelTalent) CreateHeroTalent(uid, heroId string) (talent *pb.DBHero
|
|||||||
err = this.AddList(uid, talent.Id, talent)
|
err = this.AddList(uid, talent.Id, talent)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// gm 专用 清除所有的天赋
|
||||||
|
|
||||||
|
func (this *ModelTalent) CleanAllHeroTalent(uid string) (talent *pb.DBHeroTalent, err error) {
|
||||||
|
|
||||||
|
err = this.DelByUId(uid)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -703,6 +703,28 @@ func (this *Hero) GetAllMaxHero(session comm.IUserSession) (errdata *pb.ErrorDat
|
|||||||
"juexProperty": hero.JuexProperty,
|
"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)
|
err = this.modelHero.ChangeList(session.GetUserId(), hero.Id, _heroMap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user