diff --git a/logic/controller/fight_boss野怪和地图怪.go b/logic/controller/fight_boss野怪和地图怪.go index 9ddd07e16..c2e5714f1 100644 --- a/logic/controller/fight_boss野怪和地图怪.go +++ b/logic/controller/fight_boss野怪和地图怪.go @@ -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) } diff --git a/logic/service/fight/info/info.go b/logic/service/fight/info/info.go index 2736befe6..02cd955c3 100644 --- a/logic/service/fight/info/info.go +++ b/logic/service/fight/info/info.go @@ -301,6 +301,7 @@ type FightOverInfo struct { // 3=isDraw 双方平手 // 4=isSysError 系统错误 // 5=isNpcEscape 精灵主动逃跑 + Winpet *model.PetInfo `struc:"skip"` Round uint32 `struc:"skip"` LastAttavue AttackValue `struc:"skip"` diff --git a/logic/service/player/Monster.go b/logic/service/player/Monster.go index 4c537b545..363fc730b 100644 --- a/logic/service/player/Monster.go +++ b/logic/service/player/Monster.go @@ -86,12 +86,13 @@ func (p *Player) GenMonster() { if xmlres.PetMAP[int(p.OgreInfo.Data[i].ID)].CatchRate != 0 { if grand.Meet(1, 500) { 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 { - 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))])) } } diff --git a/logic/service/player/player.go b/logic/service/player/player.go index 1ced65199..f57c820df 100644 --- a/logic/service/player/player.go +++ b/logic/service/player/player.go @@ -32,7 +32,7 @@ type OgrePetInfo struct { ShinyLen uint32 `json:"-" struc:"sizeof=ShinyInfo"` ShinyInfo []data.GlowFilter `json:"ShinyInfo,omitempty"` Lv uint32 `struc:"skip"` //等级 - Item int64 `struc:"skip"` //奖励,如果有的话 + Item []int64 `struc:"skip"` //奖励,如果有的话 Ext uint32 `struc:"skip"` //是否变尼尔尼奥 }