1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-02-23 03:56:27 +08:00
committed by cnb
parent a942032bf0
commit a5e378073c
4 changed files with 13 additions and 8 deletions

View File

@@ -210,15 +210,18 @@ func (Controller) OnPlayerFightNpcMonster(data1 *fight.FightNpcMonsterInboundInf
ItemCnt: int64(poolexp),
})
p.AddPetExp(foi.Winpet, int64(addexp))
if refPet.Item != 0 {
for _, v := range refPet.Item {
count := int64(grand.Intn(2) + 1)
p.ItemAdd(refPet.Item, count)
items.ItemList = append(items.ItemList, data.ItemInfo{
ItemId: refPet.Item,
ItemCnt: count,
})
ok := p.ItemAdd(v, count)
if ok {
items.ItemList = append(items.ItemList, data.ItemInfo{
ItemId: v,
ItemCnt: count,
})
}
}
p.SendPackCmd(8004, items)
}