合成功能
This commit is contained in:
parent
eb265f69e8
commit
7b76389509
|
@ -324,6 +324,8 @@ const (
|
|||
GainWayClientUpgrade = 115 //客户端升级奖励
|
||||
GainWayLottery = 116 //开奖码抽奖
|
||||
GainWayGuide2 = 117 // 竞技馆引导奖励
|
||||
GainWayCompound = 118 // 道具合成消耗
|
||||
GainWayCompoundGain = 119 // 道具合成获得
|
||||
)
|
||||
|
||||
// 后台选择 金币变化类型 的充值 类型id号起始
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -369,7 +369,7 @@ type CSUpBagInfo struct {
|
|||
|
||||
ItemId int32 `protobuf:"varint,1,opt,name=ItemId,proto3" json:"ItemId,omitempty"` //物品ID
|
||||
ItemNum int32 `protobuf:"varint,2,opt,name=ItemNum,proto3" json:"ItemNum,omitempty"` //物品数量
|
||||
Opt int32 `protobuf:"varint,3,opt,name=Opt,proto3" json:"Opt,omitempty"` //操作 0.使用 1.赠送 2.出售 3.兑换 4.分解
|
||||
Opt int32 `protobuf:"varint,3,opt,name=Opt,proto3" json:"Opt,omitempty"` //操作 0.使用 1.赠送 2.出售 3.兑换 4.分解 5.合成
|
||||
AcceptSnId int32 `protobuf:"varint,4,opt,name=AcceptSnId,proto3" json:"AcceptSnId,omitempty"` //被赠送玩家id
|
||||
NowEffect int32 `protobuf:"varint,5,opt,name=NowEffect,proto3" json:"NowEffect,omitempty"` //0.竖版 1.横版
|
||||
ShowId int64 `protobuf:"varint,6,opt,name=ShowId,proto3" json:"ShowId,omitempty"` // 邮件显示位置 0 所有大厅都显示 1 主大厅显示 2 len大厅显示 4 fish大厅显示
|
||||
|
|
|
@ -65,7 +65,7 @@ message SCBagInfo {
|
|||
message CSUpBagInfo {
|
||||
int32 ItemId = 1;//物品ID
|
||||
int32 ItemNum = 2;//物品数量
|
||||
int32 Opt = 3;//操作 0.使用 1.赠送 2.出售 3.兑换 4.分解
|
||||
int32 Opt = 3;//操作 0.使用 1.赠送 2.出售 3.兑换 4.分解 5.合成
|
||||
int32 AcceptSnId = 4;//被赠送玩家id
|
||||
int32 NowEffect = 5;//0.竖版 1.横版
|
||||
int64 ShowId = 6;// 邮件显示位置 0 所有大厅都显示 1 主大厅显示 2 len大厅显示 4 fish大厅显示
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -885,6 +885,8 @@ message DB_GameItem {
|
|||
|
||||
map<int64, int64> Gain = 19;
|
||||
|
||||
map<int64, int64> Compound = 20;
|
||||
|
||||
}
|
||||
|
||||
message DB_GameItemArray {
|
||||
|
|
|
@ -451,6 +451,52 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
|
|||
pack.NowItemNum = item.ItemNum
|
||||
}
|
||||
}
|
||||
case ItemCanCompound:
|
||||
logger.Logger.Trace("道具合成", msg.ItemId)
|
||||
itemInfo := srvdata.GameItemMgr.Get(p.Platform, msg.ItemId)
|
||||
if msg.ItemNum > 0 && itemInfo != nil {
|
||||
_, _, isF := BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Change: []*model.Item{
|
||||
{
|
||||
ItemId: msg.GetItemId(),
|
||||
ItemNum: int64(-msg.GetItemNum()),
|
||||
},
|
||||
},
|
||||
GainWay: common.GainWayItemFen,
|
||||
Operator: "system",
|
||||
Remark: fmt.Sprintf("道具合成%v消耗", msg.GetItemId()),
|
||||
})
|
||||
if isF {
|
||||
pack.RetCode = bag.OpResultCode_OPRC_Sucess
|
||||
var changeItems []*model.Item
|
||||
for k, v := range itemInfo.GetCompound() {
|
||||
if v > 0 {
|
||||
changeItems = append(changeItems, &model.Item{
|
||||
ItemId: int32(k),
|
||||
ItemNum: int64(msg.GetItemNum()) / v,
|
||||
})
|
||||
}
|
||||
}
|
||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Change: changeItems,
|
||||
Cost: []*model.Item{
|
||||
{
|
||||
ItemId: msg.GetItemId(),
|
||||
ItemNum: int64(msg.GetItemNum()),
|
||||
},
|
||||
},
|
||||
GainWay: common.GainWayItemFenGain,
|
||||
Operator: "system",
|
||||
Remark: "道具合成获得",
|
||||
})
|
||||
pack.NowItemId = item.ItemId
|
||||
pack.NowItemNum = item.ItemNum
|
||||
}
|
||||
}
|
||||
}
|
||||
send()
|
||||
return nil
|
||||
|
|
|
@ -37,6 +37,7 @@ const (
|
|||
ItemCanSell //可以出售
|
||||
ItemCanExchange //可以兑换
|
||||
ItemCanFen //可以分解
|
||||
ItemCanCompound //可以合成
|
||||
ItemMax
|
||||
)
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue