From e60e272a9a87bf4d5b9b43220809685a4a447920 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Wed, 24 Jul 2024 15:18:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E6=9C=BA=E5=99=A8=E4=BA=BA?= =?UTF-8?q?=E5=AE=A0=E7=89=A9=E6=8A=80=E8=83=BD=E7=AD=89=E7=BA=A7=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/player.go | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/worldsrv/player.go b/worldsrv/player.go index c481b2d..f9f5e96 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -4341,26 +4341,24 @@ func (this *Player) RandRobotVip(scene *Scene) { 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 + 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 } }