diff --git a/common/src/main/scala/net/psforever/packet/game/AvatarImplantMessage.scala b/common/src/main/scala/net/psforever/packet/game/AvatarImplantMessage.scala index 424a14daf..8369a6425 100644 --- a/common/src/main/scala/net/psforever/packet/game/AvatarImplantMessage.scala +++ b/common/src/main/scala/net/psforever/packet/game/AvatarImplantMessage.scala @@ -12,14 +12,31 @@ import scodec.codecs._ * The implant Second Wind is technically an invalid `ImplantType` for this packet. * This owes to the unique activation trigger for that implant - a near-death experience of ~0HP. * @param player_guid the player - * @param unk1 na - * @param unk2 na - * @param implant the implant + * @param action + * 0 : add implant + * with status = 0 to 9 (from ImplantType) + * 1 : remove implant + * seems work with any value in status + * 2 : init implant + * status : 0 to "uninit" + * status : 1 to init + * 3 : activate implant + * status : 0 to desactivate + * status : 1 to activate + * 4 : number of implant slots unlocked + * status : 0 = no implant slot + * status : 1 = first implant slot + "implant message" + * status : 2 or 3 = unlock second & third slots + * 5 : out of stamina message + * status : 0 to stop the lock + * status : 1 to active the lock + * @param implantSlot : from 0 to 2 + * @param status : see action */ final case class AvatarImplantMessage(player_guid : PlanetSideGUID, - unk1 : Int, - unk2 : Int, - implant : ImplantType.Value) + action : Int, + implantSlot : Int, + status : Int) extends PlanetSideGamePacket { type Packet = AvatarImplantMessage def opcode = GamePacketOpcode.AvatarImplantMessage @@ -29,8 +46,8 @@ final case class AvatarImplantMessage(player_guid : PlanetSideGUID, object AvatarImplantMessage extends Marshallable[AvatarImplantMessage] { implicit val codec : Codec[AvatarImplantMessage] = ( ("player_guid" | PlanetSideGUID.codec) :: - ("unk1" | uintL(3)) :: - ("unk2" | uint2L) :: - ("implant" | ImplantType.codec) + ("action" | uintL(3)) :: + ("implantSlot" | uint2L) :: + ("status" | uint4L) ).as[AvatarImplantMessage] } diff --git a/common/src/test/scala/game/AvatarImplantMessageTest.scala b/common/src/test/scala/game/AvatarImplantMessageTest.scala index 166632534..c52d50db0 100644 --- a/common/src/test/scala/game/AvatarImplantMessageTest.scala +++ b/common/src/test/scala/game/AvatarImplantMessageTest.scala @@ -16,14 +16,14 @@ class AvatarImplantMessageTest extends Specification { player_guid mustEqual PlanetSideGUID(3171) unk1 mustEqual 3 unk2 mustEqual 1 - implant mustEqual ImplantType.Targeting + implant mustEqual 1 case _ => ko } } "encode" in { - val msg = AvatarImplantMessage(PlanetSideGUID(3171), 3, 1, ImplantType.Targeting) + val msg = AvatarImplantMessage(PlanetSideGUID(3171), 3, 1, 1) val pkt = PacketCoding.EncodePacket(msg).require.toByteVector pkt mustEqual string