From c024df93866316fdb9e0375828c9640e705237cc Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Tue, 23 Jul 2024 14:36:16 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BA=E5=AE=A0=E7=89=A9=E6=8A=80=E8=83=BD=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/player.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/worldsrv/player.go b/worldsrv/player.go index 09c34d2..9e83981 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -320,6 +320,15 @@ func (this *Player) OnLogined() { this.VIP = rand.Int31n(6) + 1 //机器人随机vip和头像 this.RobRandVip() + //随机机器人宠物技能等级 + if this.Pets.SkillInfo == nil { + this.Pets.SkillInfo = make(map[int32]map[int32]int32) + for petId, _ := range this.Pets.ModUnlock { + skillLevel := rand.Int31n(10) + 1 + this.Pets.SkillInfo[petId] = make(map[int32]int32) + this.Pets.SkillInfo[petId][10001] = skillLevel + } + } } this.VipExtra = VipMgrSington.GetVipPointsExtra(this.Platform, this.VIP) From b6477c60efd685034648482c09e9fcc9ecfd8ef3 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Tue, 23 Jul 2024 14:57:55 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BA=E5=AE=A0=E7=89=A9=E6=8A=80=E8=83=BD=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/player.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/worldsrv/player.go b/worldsrv/player.go index d7bf4ee..22382ea 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -324,7 +324,21 @@ func (this *Player) OnLogined() { if this.Pets.SkillInfo == nil { this.Pets.SkillInfo = make(map[int32]map[int32]int32) for petId, _ := range this.Pets.ModUnlock { - skillLevel := rand.Int31n(10) + 1 + 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 } From 1322a09297bbfd1b114d8519a8b28ae3b10698a1 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Tue, 23 Jul 2024 15:11:00 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BA=E5=AE=A0=E7=89=A9=E6=8A=80=E8=83=BD=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/player.go | 50 ++++++++++++++++++++++++---------------------- worldsrv/scene.go | 3 ++- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/worldsrv/player.go b/worldsrv/player.go index 22382ea..97d219e 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -317,32 +317,9 @@ func (this *Player) OnLogined() { this.dirty = true } } else { - this.VIP = rand.Int31n(6) + 1 + this.VIP = rand.Int31n(16) + 1 //机器人随机vip和头像 this.RobRandVip() - //随机机器人宠物技能等级 - 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.VipExtra = VipMgrSington.GetVipPointsExtra(this.Platform, this.VIP) @@ -4362,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) } From 77c2e5683c7d7cd21131f9037f6748fb314bba4c Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Tue, 23 Jul 2024 15:11:49 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BA=E5=AE=A0=E7=89=A9=E6=8A=80=E8=83=BD=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/player.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldsrv/player.go b/worldsrv/player.go index 97d219e..c481b2d 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -317,7 +317,7 @@ func (this *Player) OnLogined() { this.dirty = true } } else { - this.VIP = rand.Int31n(16) + 1 + this.VIP = rand.Int31n(6) + 1 //机器人随机vip和头像 this.RobRandVip() }