package controller import ( "blazing/common/data/entity" "blazing/common/socket/errorcode" "blazing/common/socket/handler" "blazing/logic/service/fight" "blazing/modules/blazing/model" ) func (h Controller) OnPlayerFightNpcMonster(data *fight.FightNpcMonsterInboundInfo, c *entity.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) { c.IsFighting = true t1 := handler.NewTomeeHeader(2503, c.UserID) ttt := fight.NoteReadyToFightInfo{ FightId: 3, } ttt.OurInfo = fight.FightUserInfo{UserID: c.UserID} ttt.OurPetList = []fight.ReadyFightPetInfo{{ID: 300, Level: 100, MaxHp: 100, Hp: 100, SkillListLen: 4, }} for i := 0; i < 4; i++ { ttt.OurPetList[0].SkillList[i] = model.SkillInfo{ID: 10001, Pp: 1} } ttt.OpponentInfo = fight.FightUserInfo{UserID: 0} ttt.OpponentPetList = []fight.ReadyFightPetInfo{{ID: 1, Level: 100, MaxHp: 100, SkillListLen: 4, Hp: 100}} for i := 0; i < 4; i++ { ttt.OpponentPetList[0].SkillList[i] = model.SkillInfo{ID: 10001, Pp: 1} } c.SendPack(t1.Pack(&ttt)) return nil, -1 } func (h Controller) OnReadyToFight(data *fight.ReadyToFightInboundInfo, c *entity.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) { t1 := handler.NewTomeeHeader(2504, c.UserID) rett := fight.FightStartOutboundInfo{ IsCanAuto: 0, Info1: fight.FightPetInfo{PetID: 300, UserID: c.UserID, Hp: 1000, MaxHp: 1000, Level: 1, CatchTime: 0, Catchable: 1, BattleLV: [6]byte{1, 1, 1, 1, 1, 1}, }, Info2: fight.FightPetInfo{ UserID: 0, PetID: 1, Hp: 1000, MaxHp: 1000, Level: 1, CatchTime: 0, Catchable: 1, BattleLV: [6]byte{1, 1, 1, 1, 1, 1}}, } c.SendPack(t1.Pack(&rett)) return nil, -1 }