diff --git a/worldsrv/player.go b/worldsrv/player.go index 3716efa..c481b2d 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -4339,6 +4339,31 @@ func (this *Player) RandRobotVip(scene *Scene) { this.VIP = int32(vip) } +func (this *Player) RandRobotPetSkillLevel() { + //随机机器人宠物技能等级 + if this.Pets.SkillInfo == nil { + this.Pets.SkillInfo = make(map[int32]map[int32]int32) + for petId, _ := range this.Pets.ModUnlock { + skillLevel := int32(0) + if this.VIP < 1 { + skillLevel = rand.Int31n(2) + } else if this.VIP >= 1 && this.VIP <= 3 { + skillLevel = rand.Int31n(3) + 1 + } else if this.VIP >= 4 && this.VIP <= 6 { + skillLevel = rand.Int31n(4) + 2 + } else if this.VIP >= 7 && this.VIP <= 9 { + skillLevel = rand.Int31n(4) + 3 + } else if this.VIP >= 10 && this.VIP <= 12 { + skillLevel = rand.Int31n(5) + 4 + } else if this.VIP >= 13 && this.VIP <= 16 { + skillLevel = rand.Int31n(6) + 5 + } + this.Pets.SkillInfo[petId] = make(map[int32]int32) + this.Pets.SkillInfo[petId][10001] = skillLevel + } + } +} + // BindTelReward 发送绑定手机号奖励 func (this *Player) BindTelReward() { // todo 奖励限额;ip日期最多赠送多少奖励 diff --git a/worldsrv/scene.go b/worldsrv/scene.go index d033876..4c3edee 100644 --- a/worldsrv/scene.go +++ b/worldsrv/scene.go @@ -451,7 +451,8 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool { this.robotNum++ p.RobotRandName() p.RandRobotVip(this) - + //随机机器人宠物技能等级 + p.RandRobotPetSkillLevel() name := this.GetSceneName() logger.Logger.Tracef("(this *Scene) PlayerEnter(%v) robot(%v) robotlimit(%v)", name, this.robotNum, this.robotLimit) }