public static PacketWriter SendCubes(List <Cube> cubes) { PacketWriter packetWriter = PacketWriter.Of(SendOp.FUNCTION_CUBE); packetWriter.Write(FunctionCubeMode.SendCubes); packetWriter.WriteInt(cubes.Count); foreach (Cube cube in cubes) { packetWriter.WriteUnicodeString($"4_{CoordB.AsHexadecimal(cube.CoordF.ToByte())}"); switch (cube.Item.HousingCategory) { case ItemHousingCategory.Farming: case ItemHousingCategory.Ranching: packetWriter.WriteInt(1); break; default: packetWriter.WriteInt(); break; } packetWriter.WriteByte(); } return(packetWriter); }
public static PacketWriter RemoveCube(LiftableObject liftableObject) { PacketWriter pWriter = PacketWriter.Of(SendOp.LIFTABLE); pWriter.Write(LiftableMode.RemoveCube); pWriter.WriteString($"4_{CoordB.AsHexadecimal(liftableObject.Position.ToByte())}"); return(pWriter); }
public static PacketWriter FailLikeSkill(long characterId, CoordB coordB) { PacketWriter packetWriter = PacketWriter.Of(SendOp.FunctionCube); packetWriter.Write(FunctionCubeMode.FailLifeSkill); packetWriter.WriteLong(characterId); packetWriter.WriteUnicodeString($"4_{coordB.AsHexadecimal()}"); packetWriter.WriteLong(TimeInfo.Now()); return(packetWriter); }
public static PacketWriter UseFurniture(long characterId, CoordB coordB, bool inUse) { PacketWriter packetWriter = PacketWriter.Of(SendOp.FunctionCube); packetWriter.Write(FunctionCubeMode.Furniture); packetWriter.WriteLong(characterId); packetWriter.WriteUnicodeString($"4_{coordB.AsHexadecimal()}"); packetWriter.WriteBool(inUse); return(packetWriter); }
public static PacketWriter UpdateFunctionCube(CoordB coordB, int status, byte unkByte) { PacketWriter packetWriter = PacketWriter.Of(SendOp.FunctionCube); packetWriter.Write(FunctionCubeMode.Add); packetWriter.WriteUnicodeString($"4_{coordB.AsHexadecimal()}"); packetWriter.WriteInt(status); packetWriter.WriteByte(unkByte); return(packetWriter); }
public static PacketWriter UpdateEntityByCoord(LiftableObject liftableObject) { PacketWriter pWriter = PacketWriter.Of(SendOp.LIFTABLE); pWriter.Write(LiftableMode.UpdateEntity); pWriter.WriteString($"4_{CoordB.AsHexadecimal(liftableObject.Position.ToByte())}"); pWriter.WriteByte(); pWriter.WriteInt(liftableObject.Enabled ? 1 : 0); // 1 = enable, 0 = disable pWriter.Write(liftableObject.State); return(pWriter); }
public static PacketWriter SuccessLifeSkill(long characterId, CoordB coordB, int status) { PacketWriter packetWriter = PacketWriter.Of(SendOp.FUNCTION_CUBE); packetWriter.Write(FunctionCubeMode.SuccessLifeSkill); packetWriter.WriteLong(characterId); packetWriter.WriteUnicodeString($"4_{CoordB.AsHexadecimal(coordB)}"); packetWriter.WriteLong(TimeInfo.Now()); packetWriter.WriteInt(status); return(packetWriter); }
public static PacketWriter Drop(LiftableObject liftableObject) { PacketWriter pWriter = PacketWriter.Of(SendOp.LIFTABLE); pWriter.Write(LiftableMode.Drop); pWriter.WriteString($"4_{CoordB.AsHexadecimal(liftableObject.Position.ToByte())}"); pWriter.WriteInt(1); pWriter.WriteUnicodeString(liftableObject.EffectQuestId); pWriter.WriteUnicodeString(liftableObject.EffectQuestState); pWriter.WriteUnicodeString("0"); pWriter.WriteUnicodeString("0"); pWriter.WriteByte(1); return(pWriter); }