上传任务41和42 的数据插入机制
This commit is contained in:
parent
56c0671fd2
commit
e42fa2b91f
@ -31,6 +31,7 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
|
|||||||
suits []*pb.DB_EquipmentSuit
|
suits []*pb.DB_EquipmentSuit
|
||||||
suit *pb.DB_EquipmentSuit
|
suit *pb.DB_EquipmentSuit
|
||||||
equipNum int32
|
equipNum int32
|
||||||
|
minstar, minlv int32 = int32(99999), int32(99999)
|
||||||
hero *pb.DBHero
|
hero *pb.DBHero
|
||||||
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
|
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
|
||||||
)
|
)
|
||||||
@ -78,6 +79,12 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if minstar < confs[i].Color {
|
||||||
|
minstar = confs[i].Color
|
||||||
|
}
|
||||||
|
if minlv < equipments[i].Lv {
|
||||||
|
minlv = equipments[i].Lv
|
||||||
|
}
|
||||||
if suitconfs[i], err = this.module.configure.getEquipSuit(confs[i].Suittype); err != nil {
|
if suitconfs[i], err = this.module.configure.getEquipSuit(confs[i].Suittype); err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ConfigNoFound,
|
Code: pb.ErrorCode_ConfigNoFound,
|
||||||
@ -85,8 +92,7 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
|
|||||||
Message: err.Error(),
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype41, 1, confs[i].InitLv))
|
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype42, 1, equipments[i].Lv))
|
|
||||||
suit = nil
|
suit = nil
|
||||||
for _, suit = range suits {
|
for _, suit = range suits {
|
||||||
if suit.Suitid == confs[i].Suittype && !suit.Effect { //找到一个未生效的套装
|
if suit.Suitid == confs[i].Suittype && !suit.Effect { //找到一个未生效的套装
|
||||||
@ -98,7 +104,7 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
|
|||||||
suit = &pb.DB_EquipmentSuit{
|
suit = &pb.DB_EquipmentSuit{
|
||||||
Suitid: confs[i].Suittype,
|
Suitid: confs[i].Suittype,
|
||||||
Eids: []string{v},
|
Eids: []string{v},
|
||||||
Str: confs[i].InitLv,
|
Str: confs[i].Color,
|
||||||
Lv: equipments[i].Lv,
|
Lv: equipments[i].Lv,
|
||||||
Effect: false,
|
Effect: false,
|
||||||
}
|
}
|
||||||
@ -112,8 +118,8 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
|
|||||||
suits = append(suits, suit)
|
suits = append(suits, suit)
|
||||||
} else {
|
} else {
|
||||||
suit.Eids = append(suit.Eids, v)
|
suit.Eids = append(suit.Eids, v)
|
||||||
if suit.Str < confs[i].InitLv {
|
if suit.Str < confs[i].Color {
|
||||||
suit.Str = confs[i].InitLv
|
suit.Str = confs[i].Color
|
||||||
}
|
}
|
||||||
if suit.Lv < equipments[i].Lv {
|
if suit.Lv < equipments[i].Lv {
|
||||||
suit.Lv = equipments[i].Lv
|
suit.Lv = equipments[i].Lv
|
||||||
@ -202,6 +208,9 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype41, equipNum, minstar))
|
||||||
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype42, equipNum, minstar))
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype5, equipNum, utils.ToInt32(hero.HeroID)))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype5, equipNum, utils.ToInt32(hero.HeroID)))
|
||||||
|
|
||||||
if len(tasks) > 0 {
|
if len(tasks) > 0 {
|
||||||
|
@ -64,7 +64,7 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
//找到下一个等级的相关配置
|
//找到下一个等级的相关配置
|
||||||
if intensify, err = this.module.configure.GetEquipmentIntensifyConfigureById(conf.EquipId, conf.InitLv, equipment.Lv); err != nil || intensify.Need == nil || len(intensify.Need) == 0 {
|
if intensify, err = this.module.configure.GetEquipmentIntensifyConfigureById(conf.EquipId, conf.Color, equipment.Lv); err != nil || intensify.Need == nil || len(intensify.Need) == 0 {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_EquipmentLvlimitReached,
|
Code: pb.ErrorCode_EquipmentLvlimitReached,
|
||||||
Title: pb.ErrorCode_EquipmentLvlimitReached.ToString(),
|
Title: pb.ErrorCode_EquipmentLvlimitReached.ToString(),
|
||||||
@ -238,7 +238,7 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade
|
|||||||
suit = &pb.DB_EquipmentSuit{
|
suit = &pb.DB_EquipmentSuit{
|
||||||
Suitid: confs[i].Suittype,
|
Suitid: confs[i].Suittype,
|
||||||
Eids: []string{v},
|
Eids: []string{v},
|
||||||
Str: confs[i].InitLv,
|
Str: confs[i].Color,
|
||||||
Lv: equipments[i].Lv,
|
Lv: equipments[i].Lv,
|
||||||
Effect: false,
|
Effect: false,
|
||||||
}
|
}
|
||||||
@ -249,8 +249,8 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade
|
|||||||
suits = append(suits, suit)
|
suits = append(suits, suit)
|
||||||
} else {
|
} else {
|
||||||
suit.Eids = append(suit.Eids, v)
|
suit.Eids = append(suit.Eids, v)
|
||||||
if suit.Str < confs[i].InitLv {
|
if suit.Str < confs[i].Color {
|
||||||
suit.Str = confs[i].InitLv
|
suit.Str = confs[i].Color
|
||||||
}
|
}
|
||||||
if suit.Lv < equipments[i].Lv {
|
if suit.Lv < equipments[i].Lv {
|
||||||
suit.Lv = equipments[i].Lv
|
suit.Lv = equipments[i].Lv
|
||||||
@ -259,7 +259,7 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade
|
|||||||
suit.Effect = true
|
suit.Effect = true
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype93, 1, suit.Suitid, suit.Lv))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype93, 1, suit.Suitid, suit.Lv))
|
||||||
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype43, equipment.Id, equipment.Lv))
|
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype43, equipment.Id, equipment.Lv))
|
||||||
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype45, equipment.Id, conf.InitLv, suit.Suitid, suit.Lv))
|
tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype45, equipment.Id, conf.Color, suit.Suitid, suit.Lv))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ func (this *apiComp) Wash(session comm.IUserSession, req *pb.EquipmentWashReq) (
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
gole := this.module.ModuleTools.GetGlobalConf().EquipmentConsumption[conf.InitLv-1]
|
gole := this.module.ModuleTools.GetGlobalConf().EquipmentConsumption[conf.Color-1]
|
||||||
if errdata = this.module.ConsumeRes(session, []*cfg.Gameatn{{A: comm.AttrType, T: comm.ResGold, N: gole}}, true); errdata != nil {
|
if errdata = this.module.ConsumeRes(session, []*cfg.Gameatn{{A: comm.AttrType, T: comm.ResGold, N: gole}}, true); errdata != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -111,8 +111,8 @@ func (this *modelEquipmentComp) AddEquipments(session comm.IUserSession, cIds ma
|
|||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
//随机任务
|
//随机任务
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype50, 1, c.InitLv))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype50, 1, c.Color))
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype97, 1, c.Suittype, c.InitLv))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype97, 1, c.Suittype, c.Color))
|
||||||
unm := int32(1)
|
unm := int32(1)
|
||||||
if equipment.AdverbEntry != nil {
|
if equipment.AdverbEntry != nil {
|
||||||
unm += int32(len(equipment.AdverbEntry))
|
unm += int32(len(equipment.AdverbEntry))
|
||||||
@ -120,11 +120,11 @@ func (this *modelEquipmentComp) AddEquipments(session comm.IUserSession, cIds ma
|
|||||||
if equipment.Adverbskill != nil {
|
if equipment.Adverbskill != nil {
|
||||||
unm += int32(len(equipment.Adverbskill))
|
unm += int32(len(equipment.Adverbskill))
|
||||||
}
|
}
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype99, 1, unm, c.InitLv))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype99, 1, unm, c.Color))
|
||||||
if c.Pos == 7 {
|
if c.Pos == 7 {
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype103, 1, c.InitLv))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype103, 1, c.Color))
|
||||||
} else if c.Pos == 6 {
|
} else if c.Pos == 6 {
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype101, 1, c.InitLv))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype101, 1, c.Color))
|
||||||
}
|
}
|
||||||
add[equipment.Id] = equipment
|
add[equipment.Id] = equipment
|
||||||
change = append(change, equipment)
|
change = append(change, equipment)
|
||||||
|
@ -245,8 +245,8 @@ func (this *Equipment) AddEquipment(session comm.IUserSession, equip *pb.DB_Equi
|
|||||||
}
|
}
|
||||||
tasks := make([]*pb.BuriedParam, 0)
|
tasks := make([]*pb.BuriedParam, 0)
|
||||||
//随机任务
|
//随机任务
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype50, 1, configure.InitLv))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype50, 1, configure.Color))
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype97, 1, configure.Suittype, configure.InitLv))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype97, 1, configure.Suittype, configure.Color))
|
||||||
unm := int32(1)
|
unm := int32(1)
|
||||||
if equip.AdverbEntry != nil {
|
if equip.AdverbEntry != nil {
|
||||||
unm += int32(len(equip.AdverbEntry))
|
unm += int32(len(equip.AdverbEntry))
|
||||||
@ -254,11 +254,11 @@ func (this *Equipment) AddEquipment(session comm.IUserSession, equip *pb.DB_Equi
|
|||||||
if equip.Adverbskill != nil {
|
if equip.Adverbskill != nil {
|
||||||
unm += int32(len(equip.Adverbskill))
|
unm += int32(len(equip.Adverbskill))
|
||||||
}
|
}
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype99, 1, unm, configure.InitLv))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype99, 1, unm, configure.Color))
|
||||||
if configure.Pos == 7 {
|
if configure.Pos == 7 {
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype103, 1, configure.InitLv))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype103, 1, configure.Color))
|
||||||
} else if configure.Pos == 6 {
|
} else if configure.Pos == 6 {
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype101, 1, configure.InitLv))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype101, 1, configure.Color))
|
||||||
}
|
}
|
||||||
go this.ModuleBuried.TriggerBuried(session.GetUserId(), tasks...)
|
go this.ModuleBuried.TriggerBuried(session.GetUserId(), tasks...)
|
||||||
this.equipmentsChangePush(session, []*pb.DB_Equipment{equip})
|
this.equipmentsChangePush(session, []*pb.DB_Equipment{equip})
|
||||||
@ -474,7 +474,7 @@ func (this *Equipment) GetForgeEquip(session comm.IUserSession, suiteId int32, p
|
|||||||
}
|
}
|
||||||
if pos != -1 {
|
if pos != -1 {
|
||||||
for _, v := range configures {
|
for _, v := range configures {
|
||||||
if v.Pos == pos && v.InitLv == lv {
|
if v.Pos == pos && v.Color == lv {
|
||||||
if eruip, err = this.modelEquipment.newEquipment(session.GetUserId(), v, dyweight, isepic); err == nil {
|
if eruip, err = this.modelEquipment.newEquipment(session.GetUserId(), v, dyweight, isepic); err == nil {
|
||||||
errdata = this.AddEquipment(session, eruip)
|
errdata = this.AddEquipment(session, eruip)
|
||||||
// this.equipmentsChangePush(session, []*pb.DB_Equipment{eruip})
|
// this.equipmentsChangePush(session, []*pb.DB_Equipment{eruip})
|
||||||
@ -498,7 +498,7 @@ func (this *Equipment) GetForgeEquip(session comm.IUserSession, suiteId int32, p
|
|||||||
} else {
|
} else {
|
||||||
lvs = make([]*cfg.GameEquipData, 0)
|
lvs = make([]*cfg.GameEquipData, 0)
|
||||||
for _, v := range configures {
|
for _, v := range configures {
|
||||||
if v.InitLv == lv {
|
if v.Color == lv {
|
||||||
lvs = append(lvs, v)
|
lvs = append(lvs, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
|
|||||||
if v.A == "equp" {
|
if v.A == "equp" {
|
||||||
for _, star := range req.Star {
|
for _, star := range req.Star {
|
||||||
cfg := this.configure.GetEquipmentConfigureById(v.T)
|
cfg := this.configure.GetEquipmentConfigureById(v.T)
|
||||||
if cfg != nil && star == cfg.InitLv { // 自动出售 转换成其他道具
|
if cfg != nil && star == cfg.Color { // 自动出售 转换成其他道具
|
||||||
if len(cfg.Sale) != 0 {
|
if len(cfg.Sale) != 0 {
|
||||||
bFound = true
|
bFound = true
|
||||||
del = append(del, cfg.Id)
|
del = append(del, cfg.Id)
|
||||||
|
@ -71,7 +71,7 @@ func (this *modelAtlas) CheckActivateEquipAtlas(uid string, Equip []*pb.DB_Equip
|
|||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
id := v.CId
|
id := v.CId
|
||||||
lv := equipConf.InitLv
|
lv := equipConf.Color
|
||||||
quality := int32(len(v.AdverbEntry))
|
quality := int32(len(v.AdverbEntry))
|
||||||
// 装备id 转图鉴id
|
// 装备id 转图鉴id
|
||||||
if conf := this.module.configure.GetEquipmentConfigureById(id); conf != nil {
|
if conf := this.module.configure.GetEquipmentConfigureById(id); conf != nil {
|
||||||
|
@ -115,7 +115,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
|
|||||||
if v.A == "equp" {
|
if v.A == "equp" {
|
||||||
for _, star := range req.Star {
|
for _, star := range req.Star {
|
||||||
cfg := this.configure.GetEquipmentConfigureById(v.T)
|
cfg := this.configure.GetEquipmentConfigureById(v.T)
|
||||||
if cfg != nil && star == cfg.InitLv { // 自动出售 转换成其他道具
|
if cfg != nil && star == cfg.Color { // 自动出售 转换成其他道具
|
||||||
if len(cfg.Sale) != 0 {
|
if len(cfg.Sale) != 0 {
|
||||||
bFound = true
|
bFound = true
|
||||||
del = append(del, cfg.Id)
|
del = append(del, cfg.Id)
|
||||||
|
Loading…
Reference in New Issue
Block a user