战斗修改

This commit is contained in:
2025-09-29 02:40:35 +08:00
parent 7df70f2375
commit 91d0d29ec9
28 changed files with 332 additions and 281 deletions

View File

@@ -184,3 +184,22 @@ func (h Controller) SetPetExp(data *pet.PetSetExpInboundInfo, c *player.Player)
return &pet.PetSetExpOutboundInfo{}, 0
}
func (h Controller) SetPetSkill(data *pet.ChangeSkillInfo, c *player.Player) (result *pet.ChangeSkillOutInfo, err errorcode.ErrorCode) {
_, onpet, ok := FindWithIndex(c.Info.PetList, func(item model.PetInfo) bool {
return item.CatchTime == data.CatchTime
})
if ok {
for i := 0; i < 4; i++ {
if onpet.SkillList[i].ID == data.HasSkill {
onpet.SkillList[i].ID = data.ReplaceSkill
onpet.SkillList[i].PP = uint32(xmlres.SkillMap[int(onpet.SkillList[i].ID)].MaxPP)
}
}
}
return &pet.ChangeSkillOutInfo{
CatchTime: data.CatchTime,
}, 0
}