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), ItemCnt: int64(poolexp),
}) })
p.AddPetExp(foi.Winpet, int64(addexp)) p.AddPetExp(foi.Winpet, int64(addexp))
if refPet.Item != 0 { for _, v := range refPet.Item {
count := int64(grand.Intn(2) + 1) count := int64(grand.Intn(2) + 1)
p.ItemAdd(refPet.Item, count) ok := p.ItemAdd(v, count)
items.ItemList = append(items.ItemList, data.ItemInfo{ if ok {
ItemId: refPet.Item, items.ItemList = append(items.ItemList, data.ItemInfo{
ItemCnt: count, ItemId: v,
}) ItemCnt: count,
})
}
} }
p.SendPackCmd(8004, items) p.SendPackCmd(8004, items)
} }

View File

@@ -301,6 +301,7 @@ type FightOverInfo struct {
// 3=isDraw 双方平手 // 3=isDraw 双方平手
// 4=isSysError 系统错误 // 4=isSysError 系统错误
// 5=isNpcEscape 精灵主动逃跑 // 5=isNpcEscape 精灵主动逃跑
Winpet *model.PetInfo `struc:"skip"` Winpet *model.PetInfo `struc:"skip"`
Round uint32 `struc:"skip"` Round uint32 `struc:"skip"`
LastAttavue AttackValue `struc:"skip"` LastAttavue AttackValue `struc:"skip"`

View File

@@ -86,12 +86,13 @@ func (p *Player) GenMonster() {
if xmlres.PetMAP[int(p.OgreInfo.Data[i].ID)].CatchRate != 0 { if xmlres.PetMAP[int(p.OgreInfo.Data[i].ID)].CatchRate != 0 {
if grand.Meet(1, 500) { if grand.Meet(1, 500) {
p.OgreInfo.Data[i].RandomByWeightShiny() p.OgreInfo.Data[i].RandomByWeightShiny()
p.OgreInfo.Data[i].Item = append(p.OgreInfo.Data[i].Item, 400687+int64(xmlres.PetMAP[int(p.OgreInfo.Data[i].ID)].Type))
} }
} }
if ok && len(mapinfo.DropItemIds) > 0 { if ok && len(mapinfo.DropItemIds) > 0 {
p.OgreInfo.Data[i].Item = int64(mapinfo.DropItemIds[grand.Intn(len(mapinfo.DropItemIds))]) p.OgreInfo.Data[i].Item = append(p.OgreInfo.Data[i].Item, int64(mapinfo.DropItemIds[grand.Intn(len(mapinfo.DropItemIds))]))
} }
} }

View File

@@ -32,7 +32,7 @@ type OgrePetInfo struct {
ShinyLen uint32 `json:"-" struc:"sizeof=ShinyInfo"` ShinyLen uint32 `json:"-" struc:"sizeof=ShinyInfo"`
ShinyInfo []data.GlowFilter `json:"ShinyInfo,omitempty"` ShinyInfo []data.GlowFilter `json:"ShinyInfo,omitempty"`
Lv uint32 `struc:"skip"` //等级 Lv uint32 `struc:"skip"` //等级
Item int64 `struc:"skip"` //奖励,如果有的话 Item []int64 `struc:"skip"` //奖励,如果有的话
Ext uint32 `struc:"skip"` //是否变尼尔尼奥 Ext uint32 `struc:"skip"` //是否变尼尔尼奥
} }