This commit is contained in:
liwei1dao 2023-09-28 16:16:22 +08:00
commit d25970f9d6
13 changed files with 211 additions and 197 deletions

View File

@ -14345,7 +14345,7 @@
"type_sp": 1,
"tasktxt": {
"key": "buried_buried_condi_tasktxt_494",
"text": "击败阴影战士"
"text": "搜集{1}{0}个,有完美通关奖励"
},
"type": 187,
"valid": 0,
@ -14377,7 +14377,7 @@
"type_sp": 1,
"tasktxt": {
"key": "buried_buried_condi_tasktxt_495",
"text": "击败阴影战士"
"text": "搜集{1}{0}个,有完美通关奖励"
},
"type": 187,
"valid": 0,

View File

@ -33790,7 +33790,7 @@
"key": "circularcamptower_Sheet1_name_display_1",
"text": "第1层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000002,
@ -33833,7 +33833,7 @@
"key": "circularcamptower_Sheet1_name_display_2",
"text": "第2层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000003,
@ -33876,7 +33876,7 @@
"key": "circularcamptower_Sheet1_name_display_3",
"text": "第3层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000004,
@ -33919,7 +33919,7 @@
"key": "circularcamptower_Sheet1_name_display_4",
"text": "第4层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000005,
@ -33962,7 +33962,7 @@
"key": "circularcamptower_Sheet1_name_display_5",
"text": "第5层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000006,
@ -34005,7 +34005,7 @@
"key": "circularcamptower_Sheet1_name_display_6",
"text": "第6层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000007,
@ -34048,7 +34048,7 @@
"key": "circularcamptower_Sheet1_name_display_7",
"text": "第7层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000008,
@ -34091,7 +34091,7 @@
"key": "circularcamptower_Sheet1_name_display_8",
"text": "第8层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000009,
@ -34134,7 +34134,7 @@
"key": "circularcamptower_Sheet1_name_display_9",
"text": "第9层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000010,
@ -34177,7 +34177,7 @@
"key": "circularcamptower_Sheet1_name_display_10",
"text": "第10层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000011,
@ -34220,7 +34220,7 @@
"key": "circularcamptower_Sheet1_name_display_11",
"text": "第11层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000012,
@ -34263,7 +34263,7 @@
"key": "circularcamptower_Sheet1_name_display_12",
"text": "第12层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000013,
@ -34306,7 +34306,7 @@
"key": "circularcamptower_Sheet1_name_display_13",
"text": "第13层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000014,
@ -34349,7 +34349,7 @@
"key": "circularcamptower_Sheet1_name_display_14",
"text": "第14层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000015,
@ -34392,7 +34392,7 @@
"key": "circularcamptower_Sheet1_name_display_15",
"text": "第15层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000016,
@ -34435,7 +34435,7 @@
"key": "circularcamptower_Sheet1_name_display_16",
"text": "第16层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000017,
@ -34478,7 +34478,7 @@
"key": "circularcamptower_Sheet1_name_display_17",
"text": "第17层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000018,
@ -34521,7 +34521,7 @@
"key": "circularcamptower_Sheet1_name_display_18",
"text": "第18层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000019,
@ -34564,7 +34564,7 @@
"key": "circularcamptower_Sheet1_name_display_19",
"text": "第19层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000020,
@ -34607,7 +34607,7 @@
"key": "circularcamptower_Sheet1_name_display_20",
"text": "第20层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000021,
@ -34650,7 +34650,7 @@
"key": "circularcamptower_Sheet1_name_display_21",
"text": "第21层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000022,
@ -34693,7 +34693,7 @@
"key": "circularcamptower_Sheet1_name_display_22",
"text": "第22层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000023,
@ -34736,7 +34736,7 @@
"key": "circularcamptower_Sheet1_name_display_23",
"text": "第23层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000024,
@ -34779,7 +34779,7 @@
"key": "circularcamptower_Sheet1_name_display_24",
"text": "第24层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 11000025,
@ -34822,7 +34822,7 @@
"key": "circularcamptower_Sheet1_name_display_25",
"text": "第25层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000001,
@ -34865,7 +34865,7 @@
"key": "circularcamptower_Sheet1_name_display_1",
"text": "第1层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000002,
@ -34908,7 +34908,7 @@
"key": "circularcamptower_Sheet1_name_display_2",
"text": "第2层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000003,
@ -34951,7 +34951,7 @@
"key": "circularcamptower_Sheet1_name_display_3",
"text": "第3层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000004,
@ -34994,7 +34994,7 @@
"key": "circularcamptower_Sheet1_name_display_4",
"text": "第4层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000005,
@ -35037,7 +35037,7 @@
"key": "circularcamptower_Sheet1_name_display_5",
"text": "第5层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000006,
@ -35080,7 +35080,7 @@
"key": "circularcamptower_Sheet1_name_display_6",
"text": "第6层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000007,
@ -35123,7 +35123,7 @@
"key": "circularcamptower_Sheet1_name_display_7",
"text": "第7层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000008,
@ -35166,7 +35166,7 @@
"key": "circularcamptower_Sheet1_name_display_8",
"text": "第8层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000009,
@ -35209,7 +35209,7 @@
"key": "circularcamptower_Sheet1_name_display_9",
"text": "第9层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000010,
@ -35252,7 +35252,7 @@
"key": "circularcamptower_Sheet1_name_display_10",
"text": "第10层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000011,
@ -35295,7 +35295,7 @@
"key": "circularcamptower_Sheet1_name_display_11",
"text": "第11层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000012,
@ -35338,7 +35338,7 @@
"key": "circularcamptower_Sheet1_name_display_12",
"text": "第12层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000013,
@ -35381,7 +35381,7 @@
"key": "circularcamptower_Sheet1_name_display_13",
"text": "第13层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000014,
@ -35424,7 +35424,7 @@
"key": "circularcamptower_Sheet1_name_display_14",
"text": "第14层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000015,
@ -35467,7 +35467,7 @@
"key": "circularcamptower_Sheet1_name_display_15",
"text": "第15层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000016,
@ -35510,7 +35510,7 @@
"key": "circularcamptower_Sheet1_name_display_16",
"text": "第16层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000017,
@ -35553,7 +35553,7 @@
"key": "circularcamptower_Sheet1_name_display_17",
"text": "第17层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000018,
@ -35596,7 +35596,7 @@
"key": "circularcamptower_Sheet1_name_display_18",
"text": "第18层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000019,
@ -35639,7 +35639,7 @@
"key": "circularcamptower_Sheet1_name_display_19",
"text": "第19层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000020,
@ -35682,7 +35682,7 @@
"key": "circularcamptower_Sheet1_name_display_20",
"text": "第20层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000021,
@ -35725,7 +35725,7 @@
"key": "circularcamptower_Sheet1_name_display_21",
"text": "第21层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000022,
@ -35768,7 +35768,7 @@
"key": "circularcamptower_Sheet1_name_display_22",
"text": "第22层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000023,
@ -35811,7 +35811,7 @@
"key": "circularcamptower_Sheet1_name_display_23",
"text": "第23层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000024,
@ -35854,7 +35854,7 @@
"key": "circularcamptower_Sheet1_name_display_24",
"text": "第24层"
},
"model_display": 0
"model_display": 34006
},
{
"id": 12000025,
@ -35897,6 +35897,6 @@
"key": "circularcamptower_Sheet1_name_display_25",
"text": "第25层"
},
"model_display": 0
"model_display": 34006
}
]

View File

@ -3013,7 +3013,7 @@
"animation": [],
"hide": 0,
"destroy": 1,
"progress": 1,
"progress": 0,
"stroyshow": 0,
"frontstoryid": 10240,
"afterstoryid": 0,
@ -3140,7 +3140,7 @@
],
"BattleReadyID": 204,
"FormatList": [
122011
121011
],
"helphero": [],
"banhero": [],
@ -3252,7 +3252,7 @@
],
"BattleReadyID": 206,
"FormatList": [
122021
121021
],
"helphero": [
"33002"
@ -3366,7 +3366,7 @@
],
"BattleReadyID": 206,
"FormatList": [
122031
121031
],
"helphero": [
"33002"
@ -3485,7 +3485,7 @@
],
"BattleReadyID": 208,
"FormatList": [
122041
121041
],
"helphero": [
"33002"
@ -3679,7 +3679,7 @@
],
"BattleReadyID": 206,
"FormatList": [
122051
121051
],
"helphero": [
"33002"
@ -4240,7 +4240,7 @@
],
"BattleReadyID": 137,
"FormatList": [
122061
121061
],
"helphero": [],
"banhero": [
@ -4354,7 +4354,7 @@
],
"BattleReadyID": 137,
"FormatList": [
122061
121061
],
"helphero": [],
"banhero": [
@ -4468,7 +4468,7 @@
],
"BattleReadyID": 137,
"FormatList": [
122061
121061
],
"helphero": [],
"banhero": [
@ -4582,7 +4582,7 @@
],
"BattleReadyID": 137,
"FormatList": [
122071
121071
],
"helphero": [],
"banhero": [
@ -4696,7 +4696,7 @@
],
"BattleReadyID": 137,
"FormatList": [
122071
121071
],
"helphero": [],
"banhero": [
@ -4810,7 +4810,7 @@
],
"BattleReadyID": 137,
"FormatList": [
122071
121071
],
"helphero": [],
"banhero": [
@ -5234,7 +5234,7 @@
],
"BattleReadyID": 205,
"FormatList": [
122081
121081
],
"helphero": [],
"banhero": [

View File

@ -232714,7 +232714,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.5,
"defpro": 1,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232734,7 +232734,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.5,
"defpro": 1,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232754,7 +232754,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.5,
"defpro": 1,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232774,7 +232774,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.5,
"defpro": 1,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232794,7 +232794,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.5,
"defpro": 1,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232814,7 +232814,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.3,
"defpro": 0.8,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232834,7 +232834,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.2,
"defpro": 0.8,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232854,7 +232854,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.2,
"defpro": 0.8,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232874,7 +232874,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.2,
"defpro": 0.8,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232894,7 +232894,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.3,
"defpro": 0.8,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232914,7 +232914,7 @@
"lv": 5,
"hppro": 0.2,
"atkpro": 0.5,
"defpro": 0.8,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232934,7 +232934,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.5,
"defpro": 0.8,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232954,7 +232954,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.5,
"defpro": 0.8,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232974,7 +232974,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.5,
"defpro": 0.8,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,
@ -232994,7 +232994,7 @@
"lv": 2,
"hppro": 0.2,
"atkpro": 0.5,
"defpro": 0.8,
"defpro": 0.1,
"skill1": 1,
"skill2": 1,
"skill3": 1,

View File

@ -237,11 +237,11 @@
},
"main": [
{
"key": 1,
"param": 1
"key": 3,
"param": 20012
}
],
"wkqbx": 0,
"wkqbx": 2,
"kqbx": 0,
"img": "zc_icon_01",
"prompt": {

View File

@ -306,7 +306,7 @@
"completetask": [
12070042
],
"deliver_npc": 0,
"deliver_npc": 100428,
"taskend_removeitem": [],
"auto_accept": 0,
"tasktips": 0,
@ -990,7 +990,7 @@
},
"npctxt": {
"key": "worldtask_world_task_npctxt_29",
"text": "听听阿宝的新想法"
"text": "和骇客蜘聊聊"
},
"get_item": [],
"trigger": 0,
@ -1040,15 +1040,15 @@
"icon": "25001",
"task_name": {
"key": "worldtask_world_task_task_name_34",
"text": "波比的邀请"
"text": "升级设备"
},
"task_details": {
"key": "worldtask_world_task_task_details_34",
"text": "波比正在举办音乐派对彩排活动,快去加入吧。"
"text": "事情搞了一段落,接下来我们需要一些能强化力量的方法"
},
"npctxt": {
"key": "worldtask_world_task_npctxt_34",
"text": "寻找波比与云朵先生"
"text": "和骇客蜘聊聊"
},
"get_item": [],
"trigger": 0,
@ -1106,7 +1106,7 @@
},
"npctxt": {
"key": "worldtask_world_task_npctxt_40",
"text": "和戈伯对话"
"text": "和骇客蜘聊聊"
},
"get_item": [],
"trigger": 0,

View File

@ -89,7 +89,6 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha
if score >= v.ScoreLow && score <= v.ScoreUp {
for _, v1 := range v.RewardDrop {
reward := this.module.ModuleTools.GetGroupDataByLottery(v1, userinfo.Vip, userinfo.Lv)
//reward := this.module.configure.GetDropReward(v1) // 获取掉落奖励
if errdata = this.module.DispenseRes(session, reward, true); errdata != nil {
return
}

View File

@ -114,7 +114,6 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
this.module.CheckRank(session.GetUserId(), req.BossType, req.Difficulty, req.Report)
}
// 发放通关随机奖励
//reward = this.module.configure.GetDropReward(cfgHunting.Drop) // 获取掉落奖励
user, err := this.module.ModuleUser.GetUser(session.GetUserId())
if err != nil {
errdata = &pb.ErrorData{

View File

@ -250,7 +250,6 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
// 检查是否命中双倍打造
for i := 0; i < int(req.Count); i++ {
res := this.module.ModuleTools.GetGroupDataByLottery(newdrop, user.Vip, user.Lv)
//res := this.module.configure.GetDropReward(newdrop)
if ok := this.module.modelStove.CheckForgetwoEquip(req.ReelId, stove.Data[req.ReelId].Lv, addProbability); ok {
resReward = append(resReward, res...)
}

View File

@ -51,7 +51,8 @@ func (this *Activity) Start() (err error) {
return
}
timer := time.NewTicker(time.Second * 1)
this.LoadActivityData()
this.LoadActivityData("")
go func() {
locp:
for {
@ -68,22 +69,64 @@ func (this *Activity) Start() (err error) {
return
}
func (this *Activity) LoadActivityData() {
if c, err := this.DB.Find(core.SqlTable(this.TableName), bson.M{}); err != nil {
return
} else {
this.hlock.Lock()
defer this.hlock.Unlock()
this.activity = make(map[pb.HdType]*pb.DBHuodong)
for c.Next(context.Background()) {
hd := &pb.DBHuodong{}
if err = c.Decode(hd); err != nil {
this.module.Errorf("err:%v", err)
continue
func (this *Activity) LoadActivityData(id string) {
if id == "" { // 查所有的
if c, err := this.DB.Find(core.SqlTable(this.TableName), bson.M{}); err != nil {
return
} else {
this.hlock.Lock()
defer this.hlock.Unlock()
this.activity = make(map[pb.HdType]*pb.DBHuodong)
for c.Next(context.Background()) {
hd := &pb.DBHuodong{}
if err = c.Decode(hd); err != nil {
this.module.Errorf("err:%v", err)
continue
}
this.activity[hd.Itype] = hd
}
}
} else {
var hd *pb.DBHuodong
this.DB.FindOne(core.SqlTable(this.TableName), bson.M{"_id": id}).Decode(&hd)
this.hlock.Lock()
if this.activity == nil {
this.activity = make(map[pb.HdType]*pb.DBHuodong)
}
this.activity[hd.Itype] = hd
this.hlock.Unlock()
// rpc 通知
if configure.Now().Unix() <= hd.Etime && configure.Now().Unix() >= hd.Stime {
if err := this.service.RpcCall(
context.Background(),
comm.Service_Worker,
string(comm.Rpc_ActivityStar),
pb.RPCGeneralReqB1{
Param1: "starActivity",
Param2: []string{hd.Id},
},
nil,
); err != nil {
this.module.Errorln(err)
}
}
if configure.Now().Unix() > hd.Etime {
if err := this.service.RpcCall(
context.Background(),
comm.Service_Worker,
string(comm.Rpc_ActivityOver),
pb.RPCGeneralReqB1{
Param1: "endActivity",
Param2: []string{hd.Id},
},
nil,
); err != nil {
this.module.Errorln(err)
}
this.activity[hd.Itype] = hd
}
}
}
func (this *Activity) CheckActivityData() {

View File

@ -98,8 +98,8 @@ func (this *Timer) getDBModelByUid(uid, tableName string) (model *db.DBModel, er
}
// 重新加载活动数据
func (this *Timer) ReloadActivityData() {
this.activity.LoadActivityData()
func (this *Timer) ReloadActivityData(id string) {
this.activity.LoadActivityData(id)
}
// 日志

View File

@ -44,13 +44,13 @@ type MCompConfigure struct {
// 新掉落表
_group map[int64][]int32 // key 小组ID value cid
// 类型为1 的数据 该大组中的小组为权重掉落必定从N个小组中随机出1个小组
_lotteryType1 map[int32][]int32 // key 大组ID value cid
_lotteryType1 map[int32][]*cfg.GameLotteryData // key 大组ID value cid
// 类型为2 的数据 有多个小组ID
_lotteryType2 map[int32][]int32 // key 大组ID value 小组ID
_lotteryType2 map[int32][]*cfg.GameLotteryData // key 大组ID value 小组ID
// 小组类型为1
_groupType1 map[int64][]int32 //value cid
_groupType1 map[int64][]*cfg.GameLotteryData //value cid
// 小组类型为2
_groupType2 map[int64][]int32 //value cid
_groupType2 map[int64][]*cfg.GameLotteryData //value cid
//Btype map[int32]int32
Stype map[int64]int32 // subtype
SNum map[int64]int32 // 小组产出数量
@ -80,10 +80,10 @@ func (this *MCompConfigure) Init(service core.IService, module core.IModule, com
configure.RegisterConfigure(game_sign, cfg.NewGameSign, this.LoadSignData)
configure.RegisterConfigure(game_price, cfg.NewGamePricegroup, this.LoadPriceGroup)
this._group = make(map[int64][]int32, 0)
this._lotteryType1 = make(map[int32][]int32, 0)
this._lotteryType2 = make(map[int32][]int32, 0)
this._groupType1 = make(map[int64][]int32, 0)
this._groupType2 = make(map[int64][]int32, 0)
this._lotteryType1 = make(map[int32][]*cfg.GameLotteryData, 0)
this._lotteryType2 = make(map[int32][]*cfg.GameLotteryData, 0)
this._groupType1 = make(map[int64][]*cfg.GameLotteryData, 0)
this._groupType2 = make(map[int64][]*cfg.GameLotteryData, 0)
//this.Btype = make(map[int32]int32, 0)
this.Stype = make(map[int64]int32, 0)
this.SNum = make(map[int64]int32, 0)
@ -98,17 +98,14 @@ func (this *MCompConfigure) LoadGroupData() {
this.hlock.Lock()
defer this.hlock.Unlock()
this._group = make(map[int64][]int32, 0)
this._lotteryType1 = make(map[int32][]int32, 0)
this._lotteryType2 = make(map[int32][]int32, 0)
this._groupType1 = make(map[int64][]int32, 0)
this._groupType2 = make(map[int64][]int32, 0)
this._lotteryType1 = make(map[int32][]*cfg.GameLotteryData, 0)
this._lotteryType2 = make(map[int32][]*cfg.GameLotteryData, 0)
this._groupType1 = make(map[int64][]*cfg.GameLotteryData, 0)
this._groupType2 = make(map[int64][]*cfg.GameLotteryData, 0)
//this.Btype = make(map[int32]int32, 0)
this.Stype = make(map[int64]int32, 0)
this.SNum = make(map[int64]int32, 0)
var tmp1 int64
var tmp2 int64
var itype int32
var subtype int32
var groupwt int32
var groupid int32
for _, value := range configure.GetDataList() {
@ -130,11 +127,6 @@ func (this *MCompConfigure) LoadGroupData() {
groupwt = value.Groupwt
}
if value.Subtype == 0 {
value.Subtype = subtype
} else {
subtype = value.Subtype
}
// 数据安全校验
if value.Min > value.Max {
log.Errorf("value.Min:%d > value.Max :%d ", value.Min, value.Max)
@ -157,23 +149,16 @@ func (this *MCompConfigure) LoadGroupData() {
}
if value.Type == 1 {
if tmp1 != key {
this._lotteryType1[value.Lotteryid] = append(this._lotteryType1[value.Lotteryid], value.Id)
tmp1 = key
}
this._lotteryType1[value.Lotteryid] = append(this._lotteryType1[value.Lotteryid], value)
}
if value.Type == 2 {
if tmp2 != key {
this._lotteryType2[value.Lotteryid] = append(this._lotteryType2[value.Lotteryid], value.Id)
tmp2 = key
}
this._lotteryType2[value.Lotteryid] = append(this._lotteryType2[value.Lotteryid], value)
}
if this.Stype[key] == 1 { // 小组ID为1
this._groupType1[key] = append(this._groupType1[key], value.Id)
this._groupType1[key] = append(this._groupType1[key], value)
} else if this.Stype[key] == 2 {
this._groupType2[key] = append(this._groupType2[key], value.Id)
this._groupType2[key] = append(this._groupType2[key], value)
}
}
return
@ -199,18 +184,15 @@ func (this *MCompConfigure) GetGroupDataByLottery(lotteryId int32, vipLv int32,
szID []int32 // 小组ID 数组
groupID int32
)
this.module.Debugf("config lotterId:%d, vipLv:%d, lv :%d", lotteryId, vipLv, lv)
// 随机小组id
for _, v := range this._lotteryType1[lotteryId] {
if _data := this.GetLotterConfById(v); _data != nil {
if (_data.Playerlvmax == 0 || (_data.Playerlvmin <= lv && lv <= _data.Playerlvmax)) && (_data.VIPmax == 0 || (_data.VIPmin <= vipLv && vipLv <= _data.VIPmax)) { // 过滤等级等条件
if _data.Groupid != 0 {
szW = append(szW, _data.Groupwt)
szID = append(szID, _data.Groupid)
}
for _, _data := range this._lotteryType1[lotteryId] {
if (_data.Playerlvmax == 0 || (_data.Playerlvmin <= lv && lv <= _data.Playerlvmax)) && (_data.VIPmax == 0 || (_data.VIPmin <= vipLv && vipLv <= _data.VIPmax)) { // 过滤等级等条件
if _data.Groupid != 0 {
szW = append(szW, _data.Groupwt)
szID = append(szID, _data.Groupid)
}
}
}
if len(szW) > 0 {
@ -221,15 +203,15 @@ func (this *MCompConfigure) GetGroupDataByLottery(lotteryId int32, vipLv int32,
if this.Stype[key] == 1 { // 该小组的道具为权重掉落必定从N个道具中随机出1个道具
for i := 0; i < int(this.SNum[key]); i++ {
sztW := make([]int32, 0)
sztID := make([]int32, 0)
for _, v := range this._groupType1[key] {
if _data := this.GetLotterConfById(v); _data != nil { // 权重赋值
sztW = append(sztW, _data.Itemwt)
sztID = append(sztID, _data.Id)
}
sztID := make([]*cfg.GameLotteryData, 0)
for _, _data := range this._groupType1[key] {
sztW = append(sztW, _data.Itemwt)
sztID = append(sztID, _data)
}
index := comm.GetRandW(sztW)
_data := this.GetLotterConfById(sztID[index])
if len(sztW) == 0 {
continue
}
_data := sztID[comm.GetRandW(sztW)]
count := comm.GetRandNum(_data.Min, _data.Max)
// 随机获得的数量
items = append(items, &cfg.Gameatn{
@ -240,18 +222,16 @@ func (this *MCompConfigure) GetGroupDataByLottery(lotteryId int32, vipLv int32,
}
} else if this.Stype[key] == 2 { // 该小组中的道具为概率掉落,每个道具都会随机一次是否会掉落(单位为千分比)
for _, v := range this._groupType2[key] {
if _data := this.GetLotterConfById(v); _data != nil { // 权重赋值
if _data.Itemwt >= comm.GetRandNum(0, 1000) { // 命中
count := comm.GetRandNum(_data.Min, _data.Max)
items = append(items, &cfg.Gameatn{
A: _data.Itemid.A,
T: _data.Itemid.T,
N: _data.Itemid.N * count, // 小组产出数量
})
}
for _, _data := range this._groupType2[key] {
if _data.Itemwt >= comm.GetRandNum(0, 1000) { // 命中
count := comm.GetRandNum(_data.Min, _data.Max)
items = append(items, &cfg.Gameatn{
A: _data.Itemid.A,
T: _data.Itemid.T,
N: _data.Itemid.N * count, // 小组产出数量
})
}
}
}
@ -260,13 +240,11 @@ func (this *MCompConfigure) GetGroupDataByLottery(lotteryId int32, vipLv int32,
// 每个小组id 都随机取一次
szW = make([]int32, 0)
szID = make([]int32, 0)
for _, v := range this._lotteryType2[lotteryId] {
if _data := this.GetLotterConfById(v); _data != nil {
if (_data.Playerlvmax == 0 || (_data.Playerlvmin <= lv && lv <= _data.Playerlvmax)) && (_data.VIPmax == 0 || (_data.VIPmin <= vipLv && vipLv <= _data.VIPmax)) { // 过滤等级等条件
if _data.Groupid != 0 {
szW = append(szW, _data.Groupwt)
szID = append(szID, _data.Groupid)
}
for _, _data := range this._lotteryType2[lotteryId] {
if (_data.Playerlvmax == 0 || (_data.Playerlvmin <= lv && lv <= _data.Playerlvmax)) && (_data.VIPmax == 0 || (_data.VIPmin <= vipLv && vipLv <= _data.VIPmax)) { // 过滤等级等条件
if _data.Groupid != 0 {
szW = append(szW, _data.Groupwt)
szID = append(szID, _data.Groupid)
}
}
}
@ -279,16 +257,16 @@ func (this *MCompConfigure) GetGroupDataByLottery(lotteryId int32, vipLv int32,
if this.Stype[key] == 1 { // 随机一组数据
for i := 0; i < int(this.SNum[key]); i++ {
sztW := make([]int32, 0)
sztID := make([]int32, 0)
for _, v := range this._groupType1[key] {
if _data := this.GetLotterConfById(v); _data != nil { // 权重赋值
sztW = append(sztW, _data.Itemwt)
sztID = append(sztID, _data.Id)
}
sztID := make([]*cfg.GameLotteryData, 0)
for _, _data := range this._groupType1[key] {
sztW = append(sztW, _data.Itemwt)
sztID = append(sztID, _data)
}
index := comm.GetRandW(sztW)
_data := this.GetLotterConfById(sztID[index])
//fmt.Printf("获得最终的道具 :%d", _data.Id)
if len(sztW) > 0 {
continue
}
_data := sztID[comm.GetRandW(sztW)]
count := comm.GetRandNum(_data.Min, _data.Max)
// 随机获得的数量
items = append(items, &cfg.Gameatn{
@ -298,17 +276,14 @@ func (this *MCompConfigure) GetGroupDataByLottery(lotteryId int32, vipLv int32,
})
}
} else if this.Stype[key] == 2 {
for _, v := range this._groupType2[key] {
if _data := this.GetLotterConfById(v); _data != nil { // 权重赋值
if _data.Itemwt >= comm.GetRandNum(1, 1000) { // 命中
count := comm.GetRandNum(_data.Min, _data.Max)
items = append(items, &cfg.Gameatn{
A: _data.Itemid.A,
T: _data.Itemid.T,
N: _data.Itemid.N * count, // 小组产出数量
})
}
for _, _data := range this._groupType2[key] {
if _data.Itemwt >= comm.GetRandNum(1, 1000) { // 命中
count := comm.GetRandNum(_data.Min, _data.Max)
items = append(items, &cfg.Gameatn{
A: _data.Itemid.A,
T: _data.Itemid.T,
N: _data.Itemid.N * count, // 小组产出数量
})
}
}
}
@ -448,8 +423,7 @@ func (this *MCompConfigure) GetDropReward(dropId int32) (result []*cfg.Gameatn)
for _, value := range data {
szW = append(szW, value.P)
}
index := comm.GetRandW(szW)
result = append(result, data[index].Prize...)
result = append(result, data[comm.GetRandW(szW)].Prize...)
return
}

View File

@ -45,5 +45,5 @@ func (this *Api_Comp) ActivityNotify(c *engine.Context) {
Title: pb.ErrorCode_Success.ToString(),
}
// 通知更新活动
this.module.modelweb.ReloadActivityData()
this.module.modelweb.ReloadActivityData(req.Id)
}