Table of Contents

Unicode/Ascii speech request (0xAD)

Moongate Packet Classes

  • UnicodeSpeechPacket (Incoming, Variable, length -1) from src/Moongate.Network.Packets/Incoming/Speech/UnicodeSpeechPacket.cs

Current Moongate Behavior

Moongate currently has packet classes for this opcode.

Packet Build

Type Field
BYTE[1] cmd
BYTE[2] length
BYTE[1] Type
BYTE[2] Color
BYTE[2] Font
BYTE[4] Language (Null Terminated)
  • "enu" - United States English

  • "des" - German Swiss

  • "dea" - German Austria

  • "deu" - German Germany

  • ... for a complete list see langcode.iff

if (Type & 0xc0)

Type Field
BYTE[1,5] Number of distinct Trigger words (NUMWORDS). 12 Bit number, Byte #13 = Bit 11..4 of NUMWORDS, Hi-Nibble of Byte #14 (Bit 7..4) = Bit 0..3 of NUMWORDS
BYTE[1,5] Index to speech.mul. 12 Bit number, Low Nibble of Byte #14 (Bits ..0) = Bits 11..8 of Index, Byte #15 = Bits 7..0 of Index
  • UNKNOWNS = ( (NUMWORDS div 2) *3 ) + (NUMWORDS % 2) - 1. div = Integeger division, % = modulo operation, NUMWORDS >= 1. examples: UNKNOWNS(1)=0, UNKNOWNS(2)=2, UNKNOWNS(3)=3, UNKNOWNS(4)=5, UNKNOWNS(5)=6, UNKNOWNS(6)=8, UNKNOWNS(7)=9, UNKNOWNS(8)=11, UNKNOWNS(9)=12
Type Field
BYTE[UNKNOWNS] Idea behind this is getting speech parsing load client side.

Thus this contains data OSI server use for easier parsing. It's client side hardcoded and exact details are unkown.

Type Field
BYTE[?] Ascii Msg - Null Terminated(blockSize - (15+UNKNOWNS) )

else

  • BYTE[?][2] Unicode Msg - Null Terminated (blockSize - 12)

Subcommand Build

N/A

Notes

For pre 2.0.7 clients Type is always =0xc0.

(different view of it)

If Mode&0xc0 then there are keywords (from speech.mul) present.

Keywords:

  • The first 12 bits = the number of keywords present. The keywords are included right after this, each one is 12 bits also. The keywords are padded to the closest byte. For example, if there are 2 keywords, it will take up 5 bytes. 12bits for the number, and 12 bits for each keyword. 12+12+12=36. Which will be padded 4 bits to 40 bits or 5 bytes.

The various types of text is as follows:

  • 0x00 - Normal 0x01 - Broadcast/System

0x02 - Emote

0x06 - System/Lower Corner

0x07 - Message/Corner With Name

0x08 - Whisper

0x09 - Yell

0x0A - Spell

0x0D - Guild Chat

0x0E - Alliance Chat

0x0F - Command Prompts