引导修改

This commit is contained in:
by 2024-11-01 14:24:33 +08:00
parent 0688dc550a
commit c724b12182
2 changed files with 15 additions and 8 deletions

View File

@ -3097,6 +3097,9 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
p.GuideData = make(map[int32]int32) p.GuideData = make(map[int32]int32)
} }
stepId := p.GuideStep + 1 stepId := p.GuideStep + 1
if msg.GuideId != 1 {
stepId = int32(msg.Param[0])
}
pack := &player_proto.SCUpdateAttribute{ pack := &player_proto.SCUpdateAttribute{
OpRetCode: player_proto.OpResultCode_OPRC_Error, OpRetCode: player_proto.OpResultCode_OPRC_Error,
Tp: msg.GetTp(), Tp: msg.GetTp(),
@ -3139,7 +3142,7 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
cfg := PlatformMgrSingleton.GetConfig(p.Platform).GuideConfig.Info[msg.GuideId] cfg := PlatformMgrSingleton.GetConfig(p.Platform).GuideConfig.Info[msg.GuideId]
switch msg.GetTp() { switch msg.GetTp() {
case common.AttributeGuideStep: case common.AttributeGuideStep:
if len(msg.GetParam()) == 0 || msg.GetParam()[0] == 0 || p.GuideStep < 0 { if len(msg.GetParam()) == 0 || msg.GetParam()[0] == 0 {
return nil return nil
} }
if cfg.GetOn() != common.On { if cfg.GetOn() != common.On {
@ -3148,6 +3151,9 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
return nil return nil
} }
if msg.GuideId == 1 { if msg.GuideId == 1 {
if p.GuideStep < 0 {
return nil
}
if p.GuideStep >= model.GameParamData.GuideStepMaxNum { if p.GuideStep >= model.GameParamData.GuideStepMaxNum {
pack.OpRetCode = player_proto.OpResultCode_OPRC_GuideStep_End pack.OpRetCode = player_proto.OpResultCode_OPRC_GuideStep_End
send() send()
@ -3197,7 +3203,7 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
p.GuideData[msg.GuideId] = int32(msg.Param[0]) p.GuideData[msg.GuideId] = int32(msg.Param[0])
if p.GuideData[msg.GuideId] == cfg.AwardStep { if p.GuideData[msg.GuideId] == cfg.AwardStep {
//发奖 //发奖
items := []*model.Item{} var items []*model.Item
for _, award := range cfg.Awards { for _, award := range cfg.Awards {
items = append(items, &model.Item{ items = append(items, &model.Item{
ItemId: award.ItemId, ItemId: award.ItemId,
@ -3210,7 +3216,7 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
Change: items, Change: items,
GainWay: common.GainWayGuide, GainWay: common.GainWayGuide,
Operator: "system", Operator: "system",
Remark: "新手引导奖励", Remark: "完成引导奖励",
}) })
} }
} }

View File

@ -4603,6 +4603,7 @@ func (this *Player) SCGuide() {
GuideId: data.GetGuideId(), GuideId: data.GetGuideId(),
Awards: awards, Awards: awards,
MaxStep: data.MaxStep, MaxStep: data.MaxStep,
AwardStep: data.AwardStep,
} }
pack.Info = append(pack.Info, info) pack.Info = append(pack.Info, info)
} }