Files
bl/logic/service/task/task.go
昔念 9ae66a42d1 ```
fix(fight_boss): 修复NPC战斗中宠物ID和闪光属性处理逻辑

- 在NPC战斗中,当refPet.Ext不为0时,正确设置refPet.Id
- 当refPet.Ext不为0且满足随机条件时,为怪物添加随机闪光属性
- 修正了宠物信息生成时的ID使用逻辑

fix(monster): 修正注释说明稀有精灵概率计算

- 更新注释说明,明确单个ID固定刷出时的概率变尼尔尼奥不是稀有精灵

refactor(player): 重构宠物闪光属性随机生成逻辑

- 简化OgrePetInfo.RandSHiny方法的条件判断逻辑
- 统一闪光属性随机生成的处理方式

fix(task): 修复任务奖励物品信息返回

- 修正任务奖励
2026-01-01 00:30:09 +08:00

37 lines
908 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package task
import (
"blazing/common/data"
"blazing/modules/blazing/model"
"blazing/modules/config/service"
)
type TaskResult struct {
Pet *model.PetInfo `json:"petTypeId" description:"发放的精灵ID"` // 发放的精灵ID
ItemList []data.ItemInfo `json:"itemList" description:"发放物品的数组"` // 发放物品的数组,
}
func GetTaskInfo(id, ot uint32) *TaskResult {
ret := &TaskResult{}
r := service.NewTaskService().Get(id, ot)
if r == nil {
return nil
}
pet := service.NewPetRewardService().Get(r.ElfRewardIds)
if pet != nil {
ret.Pet = model.GenPetInfo(int(pet.MonID), int(pet.Lv), int(pet.Nature), int(pet.Effect), int(pet.DV), nil)
}
for _, itemID := range r.ItemRewardIds {
iteminfo := service.NewItemService().GetItemCount(itemID)
ret.ItemList = append(ret.ItemList, data.ItemInfo{ItemId: iteminfo.ItemId, ItemCnt: iteminfo.ItemCnt})
}
return ret
}