From 22f19839b67406f9f8211d0989170d674ebb7809 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 1 Jun 2023 20:51:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/equipment/api_upgrade.go | 2 ++ modules/equipment/module.go | 25 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/modules/equipment/api_upgrade.go b/modules/equipment/api_upgrade.go index 6e6c7398a..81aaf4129 100644 --- a/modules/equipment/api_upgrade.go +++ b/modules/equipment/api_upgrade.go @@ -216,12 +216,14 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade if conf.Pos < 4 && hero.SuiteId != 0 { hero.Suite1Lv = suite1Lv tasks = append(tasks, comm.GetBuriedParam(comm.Rtype49, 1, hero.Suite1Star, hero.Suite1Lv)) + tasks = append(tasks, comm.GetBuriedParam(comm.Rtype93, 1, hero.SuiteId, suite1Lv)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype43, equipment.Id, equipment.Lv)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype45, equipment.Id, conf.Star, hero.SuiteExtId, hero.Suite2Lv)) } if conf.Pos >= 4 && conf.Pos < 6 && hero.SuiteExtId != 0 { hero.Suite2Lv = suite2Lv tasks = append(tasks, comm.GetBuriedParam(comm.Rtype48, 1, hero.Suite2Star, hero.Suite2Lv)) + tasks = append(tasks, comm.GetBuriedParam(comm.Rtype93, 1, hero.SuiteExtId, suite2Lv)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype45, equipment.Id, conf.Star, hero.SuiteExtId, hero.Suite2Lv)) } code = this.module.ModuleHero.UpdateEquipment(session, hero, equipments) diff --git a/modules/equipment/module.go b/modules/equipment/module.go index 7024f7f48..0a084cee8 100644 --- a/modules/equipment/module.go +++ b/modules/equipment/module.go @@ -187,12 +187,35 @@ func (this *Equipment) NewEquipment(uid, cid string) (code pb.ErrorCode, equip * //创建新的装备 func (this *Equipment) AddEquipment(session comm.IUserSession, equip *pb.DB_Equipment) (code pb.ErrorCode) { var ( - err error + err error + configure *cfg.GameEquipData ) if err = this.modelEquipment.addEquipment(equip); err != nil { code = pb.ErrorCode_DBError return } + if configure, err = this.configure.GetEquipmentConfigureById(equip.CId); err != nil { + code = pb.ErrorCode_ConfigNoFound + return + } + tasks := make([]*pb.BuriedParam, 0) + //随机任务 + tasks = append(tasks, comm.GetBuriedParam(comm.Rtype50, 1, configure.Star)) + tasks = append(tasks, comm.GetBuriedParam(comm.Rtype97, 1, configure.Suittype, configure.Star)) + unm := int32(1) + if equip.AdverbEntry != nil { + unm += int32(len(equip.AdverbEntry)) + } + if equip.Adverbskill != nil { + unm += int32(len(equip.Adverbskill)) + } + tasks = append(tasks, comm.GetBuriedParam(comm.Rtype99, 1, unm, configure.Star)) + if configure.Pos == 7 { + tasks = append(tasks, comm.GetBuriedParam(comm.Rtype103, 1, configure.Star)) + } else if configure.Pos == 6 { + tasks = append(tasks, comm.GetBuriedParam(comm.Rtype101, 1, configure.Star)) + } + go this.ModuleBuried.TriggerBuried(session.GetUserId(), tasks...) this.equipmentsChangePush(session, []*pb.DB_Equipment{equip}) return }