Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
4c82ab7028
File diff suppressed because it is too large
Load Diff
@ -19469,8 +19469,8 @@
|
|||||||
"Type": 2,
|
"Type": 2,
|
||||||
"Argu": [
|
"Argu": [
|
||||||
424009012,
|
424009012,
|
||||||
1,
|
-1,
|
||||||
1
|
-1
|
||||||
],
|
],
|
||||||
"FollowSK": [],
|
"FollowSK": [],
|
||||||
"SucFollowSK": [],
|
"SucFollowSK": [],
|
||||||
@ -19536,12 +19536,12 @@
|
|||||||
"Where": [],
|
"Where": [],
|
||||||
"Order": "",
|
"Order": "",
|
||||||
"Limit": 10,
|
"Limit": 10,
|
||||||
"ExecuteCnt": 3,
|
"ExecuteCnt": 6,
|
||||||
"Type": 1,
|
"Type": 1,
|
||||||
"Argu": [
|
"Argu": [
|
||||||
1,
|
1,
|
||||||
4,
|
4,
|
||||||
1350
|
1000
|
||||||
],
|
],
|
||||||
"FollowSK": [],
|
"FollowSK": [],
|
||||||
"SucFollowSK": [],
|
"SucFollowSK": [],
|
||||||
|
@ -11968,8 +11968,8 @@
|
|||||||
"ChildSkill": {
|
"ChildSkill": {
|
||||||
"Id": [
|
"Id": [
|
||||||
224009311,
|
224009311,
|
||||||
224009313,
|
224009312,
|
||||||
224009312
|
224009313
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Desc": {
|
"Desc": {
|
||||||
|
@ -191,7 +191,7 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade
|
|||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_EquipmentOnFoundEquipment,
|
Code: pb.ErrorCode_EquipmentOnFoundEquipment,
|
||||||
Title: pb.ErrorCode_EquipmentOnFoundEquipment.ToString(),
|
Title: pb.ErrorCode_EquipmentOnFoundEquipment.ToString(),
|
||||||
Message: fmt.Sprintf("未找到装备 uid:%s id:%d", session.GetUserId(), v),
|
Message: fmt.Sprintf("未找到装备 uid:%s id:%s", session.GetUserId(), v),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -413,6 +413,9 @@ func (this *modelEquipmentComp) upgradeEquipment(equipment *pb.DB_Equipment, equ
|
|||||||
}
|
}
|
||||||
|
|
||||||
if equip.EquipId == 1 {
|
if equip.EquipId == 1 {
|
||||||
|
if len(equipment.AdverbEntry) <= 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
var attrlibrary *cfg.GameEquipAttrlibrarySData
|
var attrlibrary *cfg.GameEquipAttrlibrarySData
|
||||||
r := rand.New(rand.NewSource(configure.Now().Unix()))
|
r := rand.New(rand.NewSource(configure.Now().Unix()))
|
||||||
index := r.Perm(len(equipment.AdverbEntry))[0]
|
index := r.Perm(len(equipment.AdverbEntry))[0]
|
||||||
|
@ -54,24 +54,24 @@ func (this *apiComp) Decompose(session comm.IUserSession, req *pb.ItemsDecompose
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
sale = make([]*cfg.Gameatn, 0, len(itemcf.DecomposeDeplete))
|
// sale = make([]*cfg.Gameatn, 0, len(itemcf.DecomposeDeplete))
|
||||||
for _, v := range itemcf.DecomposeDeplete {
|
// for _, v := range itemcf.DecomposeDeplete {
|
||||||
sale = append(sale, &cfg.Gameatn{
|
// sale = append(sale, &cfg.Gameatn{
|
||||||
A: v.A,
|
// A: v.A,
|
||||||
T: v.T,
|
// T: v.T,
|
||||||
N: v.N * int32(req.Amount),
|
// N: v.N * int32(req.Amount),
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
if errdata = this.module.ConsumeRes(session, sale, true); errdata != nil {
|
// if errdata = this.module.ConsumeRes(session, sale, true); errdata != nil {
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
if req.Amount > item.Amount {
|
if req.Amount > item.Amount {
|
||||||
this.module.Errorf("SellItemCheck over all amount:[%d:%d]", req.Amount, item.Amount)
|
this.module.Errorf("SellItemCheck over all amount:[%d:%d]", req.Amount, item.Amount)
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
Message: fmt.Sprintf("道具数量不足! 道具数量:%s", item.Amount),
|
Message: fmt.Sprintf("道具数量不足! 道具数量:%d", item.Amount),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,8 @@ func (this *apiComp) Useitem(session comm.IUserSession, req *pb.ItemsUseItemReq)
|
|||||||
if errdata = this.module.DispenseRes(session, sale, true); errdata != nil {
|
if errdata = this.module.DispenseRes(session, sale, true); errdata != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case itemuse_synthesis: //合成
|
case itemuse_synthesis: //合成/分解
|
||||||
|
if req.Select == 0 { // 合成
|
||||||
user := this.module.ModuleUser.GetUser(session.GetUserId())
|
user := this.module.ModuleUser.GetUser(session.GetUserId())
|
||||||
reward := this.module.ModuleTools.GetGroupDataByLottery(itemcf.BoxId, user.Vip, user.Lv) // 走新的掉落
|
reward := this.module.ModuleTools.GetGroupDataByLottery(itemcf.BoxId, user.Vip, user.Lv) // 走新的掉落
|
||||||
if reward == nil {
|
if reward == nil {
|
||||||
@ -131,7 +132,7 @@ func (this *apiComp) Useitem(session comm.IUserSession, req *pb.ItemsUseItemReq)
|
|||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ItemsNoEnough,
|
Code: pb.ErrorCode_ItemsNoEnough,
|
||||||
Title: pb.ErrorCode_ItemsNoEnough.ToString(),
|
Title: pb.ErrorCode_ItemsNoEnough.ToString(),
|
||||||
Message: fmt.Sprintf("道具Id:%d", itemcf.Id),
|
Message: fmt.Sprintf("道具Id:%s", itemcf.Id),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -161,7 +162,55 @@ func (this *apiComp) Useitem(session comm.IUserSession, req *pb.ItemsUseItemReq)
|
|||||||
if errdata = this.module.DispenseRes(session, sale, true); errdata != nil {
|
if errdata = this.module.DispenseRes(session, sale, true); errdata != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if item, err = this.module.modelItems.QueryUserPackByGridId(session.GetUserId(), req.GridId); err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if itemcf, err = this.module.configure.GetItemConfigure(item.ItemId); err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ConfigurationException,
|
||||||
|
Title: pb.ErrorCode_ConfigurationException.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if itemcf.DecomposeDeplete == nil || len(itemcf.DecomposeDeplete) == 0 {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ItemsUseNoCanSell,
|
||||||
|
Title: pb.ErrorCode_ItemsUseNoCanSell.ToString(),
|
||||||
|
Message: fmt.Sprintf("道具分解配置未配置! 道具id:%s", itemcf.Id),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if req.Amount > item.Amount {
|
||||||
|
this.module.Errorf("SellItemCheck over all amount:[%d:%d]", req.Amount, item.Amount)
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
|
Message: fmt.Sprintf("道具数量不足! 道具数量:%d", item.Amount),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
sale := make([]*cfg.Gameatn, len(itemcf.Sale))
|
||||||
|
for i, v := range itemcf.DecomposeDeplete {
|
||||||
|
temp := *v
|
||||||
|
sale[i] = &temp
|
||||||
|
sale[i].N = v.N * int32(req.Amount)
|
||||||
|
}
|
||||||
|
if errdata = this.module.DispenseRes(session, sale, true); errdata != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
item.Amount = item.Amount - req.Amount
|
||||||
|
if errdata = this.module.AddItemforGrid(session, req.GridId, -1*int32(req.Amount), true); errdata != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ItemsUseNotSupported,
|
Code: pb.ErrorCode_ItemsUseNotSupported,
|
||||||
|
Loading…
Reference in New Issue
Block a user