上传兑换任务

This commit is contained in:
liwei 2023-07-27 18:08:02 +08:00
parent 2b138edc69
commit 9abc06944c
6 changed files with 175 additions and 18 deletions

View File

@ -525,7 +525,7 @@
"DisableCamp": [],
"DefaultHero": 0,
"ChoseHero": [
"44004"
"25001"
],
"DisableHero": [],
"LockSlots": [],

View File

@ -8,7 +8,7 @@
"score": 1,
"rank_low": 0,
"rank_up": 1500000,
"hp": 1,
"hp": 20,
"drop": 10001001,
"grade": "gh_img_a"
},
@ -21,7 +21,7 @@
"score": 1,
"rank_low": 1500001,
"rank_up": 3000000,
"hp": 2,
"hp": 20,
"drop": 10001002,
"grade": "gh_img_b"
},
@ -34,7 +34,7 @@
"score": 1,
"rank_low": 3000001,
"rank_up": 4500000,
"hp": 3,
"hp": 20,
"drop": 10001003,
"grade": "gh_img_c"
},
@ -47,7 +47,7 @@
"score": 1,
"rank_low": 4500001,
"rank_up": 6000000,
"hp": 4,
"hp": 20,
"drop": 10001003,
"grade": "gh_img_d"
},
@ -60,7 +60,7 @@
"score": 1,
"rank_low": 6000001,
"rank_up": 9000000,
"hp": 5,
"hp": 20,
"drop": 10001003,
"grade": "gh_img_e"
},
@ -73,7 +73,7 @@
"score": 1,
"rank_low": 9000001,
"rank_up": 12000000,
"hp": 6,
"hp": 20,
"drop": 10001003,
"grade": "gh_img_ex3"
},
@ -86,7 +86,7 @@
"score": 1,
"rank_low": 12000001,
"rank_up": 15000000,
"hp": 7,
"hp": 20,
"drop": 10001003,
"grade": "gh_img_s"
},
@ -99,7 +99,7 @@
"score": 1,
"rank_low": 15000001,
"rank_up": 18000000,
"hp": 8,
"hp": 20,
"drop": 10001003,
"grade": "gh_img_ss"
},
@ -112,7 +112,7 @@
"score": 1,
"rank_low": 18000001,
"rank_up": 21000000,
"hp": 9,
"hp": 20,
"drop": 10001003,
"grade": "gh_img_sss"
},
@ -125,7 +125,7 @@
"score": 1,
"rank_low": 21000001,
"rank_up": -1,
"hp": 10,
"hp": 20,
"drop": 10001003,
"grade": "gh_img_sss1"
}

View File

@ -14683,7 +14683,7 @@
{
"id": "10000036",
"name": {
"key": "item_item_name_347",
"key": "item_item_name_369",
"text": "石阵玩法货币"
},
"usetype": 1,
@ -14702,8 +14702,8 @@
"decompose_deplete": [],
"decompose_get": [],
"access": [],
"use_skip": 0,
"upper_limit": 0,
"use_skip": 11001,
"upper_limit": 999,
"img": "item_10000035",
"intr": {
"key": "item_item_intr_378",
@ -14716,5 +14716,79 @@
"n": 1000
}
]
},
{
"id": "10000037",
"name": {
"key": "item_item_name_370",
"text": "石阵天赋树货币"
},
"usetype": 1,
"color": 5,
"bagtype": 1,
"index": 1,
"special_type": 0,
"time": 0,
"reddottype": 0,
"effects": "",
"modelName": "",
"box_id": 0,
"synthetize_num": 0,
"synthetize_deplete": [],
"synthetize_get": [],
"decompose_deplete": [],
"decompose_get": [],
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "item_10000035",
"intr": {
"key": "item_item_intr_379",
"text": "暂无包装"
},
"sale": [
{
"a": "attr",
"t": "gold",
"n": 1000
}
]
},
{
"id": "10000038",
"name": {
"key": "item_item_name_371",
"text": "石阵周常积分"
},
"usetype": 1,
"color": 5,
"bagtype": 1,
"index": 1,
"special_type": 0,
"time": 0,
"reddottype": 0,
"effects": "",
"modelName": "",
"box_id": 0,
"synthetize_num": 0,
"synthetize_deplete": [],
"synthetize_get": [],
"decompose_deplete": [],
"decompose_get": [],
"access": [],
"use_skip": 11001,
"upper_limit": 999,
"img": "item_10000035",
"intr": {
"key": "item_item_intr_380",
"text": "暂无包装"
},
"sale": [
{
"a": "attr",
"t": "gold",
"n": 1000
}
]
}
]

View File

@ -23494,5 +23494,29 @@
"playerlvmin": 0,
"playerlvmax": 0,
"notice": 0
},
{
"id": 980,
"lotteryid": 21141101,
"description": "石阵秘境战斗事件",
"type": 2,
"groupwt": 1000,
"groupid": 10001,
"subtype": 1,
"groupnum": 1,
"itemid": {
"a": "item",
"t": "10000037",
"n": 1
},
"itemdes": "石阵天赋树货币",
"itemwt": 1000,
"min": 5,
"max": 10,
"VIPmin": 0,
"VIPmax": 15,
"playerlvmin": 0,
"playerlvmax": 0,
"notice": 0
}
]

View File

@ -234,5 +234,55 @@
"lose": [],
"jump": 0,
"num": 0
},
{
"key": 11,
"taskstarID": 100110,
"lv": 1,
"taskendID": 20090,
"npc": [
"GameMain",
"功能入口-烹饪"
],
"chosetxt": {
"key": "chosetxt_11",
"text": "买乳猪4"
},
"chosetype": 2,
"chosenum": 0,
"startstory": 50020010,
"constory": 50020030,
"get": [
1001
],
"aginstory": 12980,
"lose": [],
"jump": 0,
"num": 0
},
{
"key": 12,
"taskstarID": 100120,
"lv": 1,
"taskendID": 20090,
"npc": [
"GameMain",
"功能入口-烹饪"
],
"chosetxt": {
"key": "chosetxt_12",
"text": "买乳猪5"
},
"chosetype": 2,
"chosenum": 0,
"startstory": 50020010,
"constory": 50020030,
"get": [
1001
],
"aginstory": 12980,
"lose": [],
"jump": 0,
"num": 0
}
]

View File

@ -19,6 +19,7 @@ func (this *apiComp) Exchange(session comm.IUserSession, req *pb.WTaskExchangeRe
confs []*cfg.GameWorldDealData
need []*cfg.Gameatn
money []*cfg.Gameatn
award []*pb.UserAssets
err error
)
if errdata = this.ExchangeCheck(session, req); errdata != nil {
@ -53,17 +54,25 @@ func (this *apiComp) Exchange(session comm.IUserSession, req *pb.WTaskExchangeRe
return
}
need = append(need, confs[i].Item...)
money = append(need, confs[i].Money...)
money = append(money, confs[i].Money...)
info.Exchange[v]++
}
if errdata = this.module.ConsumeRes(session, need, true); errdata != nil {
if errdata = this.module.ConsumeRes(session, money, true); errdata != nil {
return
}
if errdata = this.module.DispenseRes(session, money, true); errdata != nil {
if errdata = this.module.DispenseRes(session, need, true); errdata != nil {
return
}
for _, v := range need {
award = append(award, &pb.UserAssets{
A: v.A,
T: v.T,
N: v.N,
})
}
if err = this.module.modelwtask.Change(session.GetUserId(), map[string]interface{}{
"exchange": info.Exchange,
@ -75,6 +84,6 @@ func (this *apiComp) Exchange(session comm.IUserSession, req *pb.WTaskExchangeRe
}
return
}
session.SendMsg(string(this.module.GetType()), "exchange", &pb.WTaskExchangeReq{Eid: req.Eid})
session.SendMsg(string(this.module.GetType()), "exchange", &pb.WTaskExchangeResp{Eid: req.Eid, Award: award})
return
}