public static byte[] CastSpell(byte spell) { PacketWriter writer = new PacketWriter(0x12); writer.WriteBlockSize(); writer.Write((byte)0x56); writer.WriteAsciiString(spell.ToString()); return writer.GetBytes(); }
/// <summary> /// Packet will not contain passwords and starting locations. Flags will be set to 0x00. /// </summary> /// <param name="characters">List of characters.</param> public static byte[] CharacterList(params string[] characters) { PacketWriter writer = new PacketWriter(0xA9); writer.WriteBlockSize(); writer.Write((byte)5); for (int i = 0; i < 5; i++) { if (i < characters.Length) { writer.WriteAsciiString(characters[i], 30); writer.WriteBytes(0, 30); } else { writer.WriteBytes(0, 60); } } writer.WriteBytes(0, 2); return writer.GetBytes(); }
public static byte[] CharacterSpeechUnicode(uint serial, ushort model, string name, SpeechType type, SpeechFont font, ushort color, string text) { // For security reasons if (text.Length > Core.MaxSpeechLenght) text = text.Remove(Core.MaxSpeechLenght); PacketWriter writer = new PacketWriter(0xAE); writer.WriteBlockSize(); writer.Write(serial); writer.Write(model); writer.Write((byte)type); writer.Write(color); writer.Write((ushort)font); writer.WriteAsciiString("CSY", 4); writer.WriteAsciiString(name, 30); writer.WriteUnicodeString(text); return writer.GetBytes(); }
public static byte[] UseSkill(ushort skill) { PacketWriter writer = new PacketWriter(0x12); writer.WriteBlockSize(); writer.Write((byte)0x24); writer.WriteAsciiString(String.Format("{0} 0", skill)); return writer.GetBytes(); }
public static byte[] SpeechRequestUnicode(SpeechType type, SpeechFont font, ushort color, string text) { // For security reasons if (text.Length > Core.MaxSpeechLenght) text = text.Remove(Core.MaxSpeechLenght); PacketWriter writer = new PacketWriter(0xAD); writer.WriteBlockSize(); writer.Write((byte)type); writer.Write(color); writer.Write((ushort)font); writer.WriteAsciiString("CSY", 4); writer.WriteUnicodeString(text); return writer.GetBytes(); }
/// <summary> /// Used only for "bow" and "salute" animations. /// </summary> public static byte[] PerformAnimation(string animationName) { PacketWriter writer = new PacketWriter(0x12); writer.WriteBlockSize(); writer.Write((byte)0xC7); writer.WriteAsciiString(animationName.ToLowerInvariant()); return writer.GetBytes(); }