diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 9c995f191..d3fb8a43d 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -488,7 +488,10 @@ func (this *ModelHero) PropertyCompute(hero *pb.DBHero) { comm.Cridam: int32(growCfg.Cridam), //暴击伤害 comm.Effre: int32(growCfg.Effre), //效果抵抗 } - this.resetTalentProperty(hero) + + if hero.Id != "" { // objID 为空表示是怪物对象 不享受天赋属性加成 + this.resetTalentProperty(hero) + } } //重新计算英雄属性 @@ -688,7 +691,8 @@ func (this *ModelHero) GetRandHeroIdBypool(sz []int32) int32 { return 0 } -func (this *ModelHero) InitTempHero(heroCfgId string, star, lv int32) *pb.DBHero { +// 初始化怪物属性 +func (this *ModelHero) InitMonsterHero(heroCfgId string, star, lv int32) *pb.DBHero { heroCfg := this.moduleHero.configure.GetHeroConfig(heroCfgId) if heroCfg == nil { this.moduleHero.Errorf("%v hero not found from config %v", heroCfgId) @@ -715,6 +719,7 @@ func (this *ModelHero) InitTempHero(heroCfgId string, star, lv int32) *pb.DBHero } this.PropertyCompute(newHero) this.initHeroSkill(newHero) + return newHero } diff --git a/modules/hero/module.go b/modules/hero/module.go index 3ddca05b5..92125aad2 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -399,7 +399,7 @@ func (this *Hero) KungFuHero(session comm.IUserSession, heroObjID string, bKongf // 创建怪物英雄 func (this *Hero) CreateMonster(heroCid string, star, lv int32) (hero *pb.DBHero) { - hero = this.modelHero.InitTempHero(heroCid, star, lv) + hero = this.modelHero.InitMonsterHero(heroCid, star, lv) return }