fix(fight_boss): 修复 boss 战斗中索引为 0 的异常处理逻辑

当 effect 索引为 0 时,跳过无效处理以避免潜在错误。

feat(task): 更新任务奖励与注册参数配置

- 移除任务 37 中的注释项并保留有效奖励
- 修改任务 91 注册参数为 246
- 清空任务 300 的物品奖励列表,并设置类型为 30

refactor(fight_input): 优化 meetpet 初始化条件判断

将多个判断条件拆分为独立 if 判断语句,提高代码可读性。

refactor(effect_service): 移除 Scan 错误检查冗余逻辑

简化数据库查询后的错误处理流程,提升
This commit is contained in:
2025-12-09 11:19:15 +08:00
parent 2598dee881
commit 2633402b52
5 changed files with 24 additions and 10 deletions

View File

@@ -91,6 +91,9 @@ func (h Controller) PlayerFightBoss(data *fight.ChallengeBossInboundInfo, c *pla
idx := gconv.Uint16(v)
// eff := xmlres.EffectMAP[int(idx)]
// args := strings.Split(eff.Args, " ")
if idx == 0 {
continue
}
EID, args := service.Effects.Args(uint32(idx))
mo.EffectInfo = append(mo.EffectInfo, model.PetEffectInfo{

View File

@@ -130,10 +130,20 @@ var meetpet = make(map[int]model.PetInfo)
func initmeetpet() {
meetpet = make(map[int]model.PetInfo)
for i, v := range xmlres.PetMAP {
if v.EvolvesTo == 0 && v.EvolvFlag == 0 && v.ID < 2000 {
r := model.GenPetInfo(int(v.ID), 24, -1, -1, -1, 100)
meetpet[i] = *r
if v.EvolvesTo != 0 {
continue
}
if v.EvolvFlag != 0 {
continue
}
if v.ID > 2000 {
continue
}
r := model.GenPetInfo(int(v.ID), 24, -1, -1, -1, 100)
meetpet[i] = *r
}
}

View File

@@ -227,6 +227,9 @@ func (our *Input) Parseskill(skill *action.SelectSkillAction) {
// t.Alive() //先让效果保持存活
our.EffectCache = append(our.EffectCache, t)
// i.NewEffects = append(i.NewEffects, t)
} else {
println("技能效果不存在", v)
}
temparg = temparg[args:]

View File

@@ -59,7 +59,7 @@ func init() {
RegisterTask(37, 0, []model.ItemInfo{ // 帕诺星系星球测绘
{1, 3000}, // 赛尔豆x3000
// {700452, 1}, // 中型智慧芯片x1
{100178, 1}, // 勘察头盔x1
{100179, 1}, // 勘察护腕x1
{100180, 1}, // 勘察腰带x1
@@ -187,7 +187,7 @@ func init() {
RegisterTask(91, 0, []model.ItemInfo{ // 月光下的约定
{3, 2000}, // 累积经验x2000
{1, 2000}, // 赛尔豆x2000
}, 0)
}, 246)
RegisterTask(93, 0, []model.ItemInfo{ // 云霄星的新来客
{3, 1000}, // 累积经验x1000
@@ -215,7 +215,7 @@ func init() {
}, 0)
RegisterTask(201, 0, []model.ItemInfo{{100062, 1}}, 0) // 教官考核教官指挥棒x1
RegisterTask(300, 0, []model.ItemInfo{{400150, 1}}, 0) // 领取谱尼真身谱尼的精元x1
RegisterTask(300, 0, []model.ItemInfo{}, 300) // 领取谱尼真身谱尼的精元x1
// -------------------------- 带精灵奖励的任务 --------------------------
RegisterTask(28, 0, []model.ItemInfo{}, 102) // 遗迹中的精灵信号奇塔类型102

View File

@@ -17,10 +17,8 @@ func (s *EffectService) Args(id uint32) (int, []int) {
m := cool.DBM(s.Model).Where("se_idx", id)
var tt model.PlayerPetSpecialEffect
err := m.Scan(&tt)
if err != nil {
return 0, nil
}
m.Scan(&tt)
return tt, nil
}, 0)
tt := ret.Interface().(model.PlayerPetSpecialEffect)