aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


server/mission_key_packet.go (735B)


      1 package main
      2 
      3 import "encoding/binary"
      4 
      5 func missionKeyPacket(owner, playfield uint32, item ownedItem, page uint32, name string) []byte {
      6 	// SimpleItem11 carries its owned placement, template stats and C name.
      7 	var body []byte
      8 	for _, value := range []uint32{11, 50000, owner, playfield, 0, 0} {
      9 		body = binary.BigEndian.AppendUint32(body, value)
     10 	}
     11 	body = append(body, byte(page), byte(item.Slot))
     12 	low, high := item.templateIDs()
     13 	for _, value := range []uint32{5 * 1009, 23, item.Template, 701, item.Quality, 702, low, 703, high, uint32(len(name) + 1)} {
     14 		body = binary.BigEndian.AppendUint32(body, value)
     15 	}
     16 	body = append(body, []byte(name)...)
     17 	body = append(body, 0)
     18 	return n3Packet(0x3b11256f, item.Type, item.ID, body)
     19 }