引导修改

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

View File

@ -4598,11 +4598,12 @@ func (this *Player) SCGuide() {
awards = append(awards, item)
}
info := &playerproto.GuideInfo{
On: data.GetOn(),
Skip: data.GetSkip(),
GuideId: data.GetGuideId(),
Awards: awards,
MaxStep: data.MaxStep,
On: data.GetOn(),
Skip: data.GetSkip(),
GuideId: data.GetGuideId(),
Awards: awards,
MaxStep: data.MaxStep,
AwardStep: data.AwardStep,
}
pack.Info = append(pack.Info, info)
}