Skip to content

Notice & Chat Functions


GCNoticeSend(aIndex, type, message)

Sends a notice message to a specific player.

  • Parameters:
    • aIndex (integer): Player index.
    • type (integer): Notice type (see table below).
    • message (string): Message text.
  • Returns: void
Type Display
0 Normal (chat area)
1 Blue popup (center screen)
2 Guild notice
3 Top scroll notice
4 Red popup (center screen)
GCNoticeSend(aIndex, 1, "Blue popup message")
GCNoticeSend(aIndex, 0, "Normal chat message")

GCNoticeSendToAll(type, message)

Sends a notice message to all connected players.

  • Parameters:
    • type (integer): Notice type (same as GCNoticeSend).
    • message (string): Message text.
  • Returns: void
GCNoticeSendToAll(0, "Server will restart in 5 minutes!")

GCChatTargetSend(lpObj, targetIndex, message)

Sends a chat message from one object to another. Commonly used for NPC dialog.

  • Parameters:
    • lpObj (GameObject): Source object (NPC or player).
    • targetIndex (integer): Target player index.
    • message (string): Message text.
  • Returns: void
GCChatTargetSend(npc, player.Index, "Hello, adventurer!")

PostSend(type, messageIndex, playerName, message)

Sends a message through the post system (global/local announcements visible to all players).

  • Parameters:
    • type (integer): Post type (0-3 = local, 4-7 = global).
    • messageIndex (integer): Message template index.
    • playerName (string): Sender name displayed in the post.
    • message (string): Message content.
  • Returns: boolean
PostSend(0, 0, "System", "Event starting in Lorencia!")
PostSend(4, 0, "System", "Global announcement!")

GetMessage(aIndex, msgId)

Retrieves a text string from the multilanguage XML files (English.xml, Spanish.xml, etc.) based on the player's configured language. The message ID corresponds to the ID attribute in the <Msg> tags of the language XML.

  • Parameters:
    • aIndex (integer): Player index (used to determine the player's language).
    • msgId (integer): Message ID as defined in the language XML files.
  • Returns: string — The localized message text, or "" if the ID is not found.
-- XML: <Msg ID="2000" Text="Deposit successful!" />
local msg = GetMessage(aIndex, 2000)
GCNoticeSend(aIndex, 1, msg)  -- Shows message in the player's language

GetMapName(aIndex, mapIndex)

Retrieves the localized map name from the multilanguage XML files based on the player's configured language.

  • Parameters:
    • aIndex (integer): Player index (used to determine the player's language).
    • mapIndex (integer): Map index number.
  • Returns: string — The localized map name, or "" if not found.
local mapName = GetMapName(aIndex, 0)  -- e.g. "Lorencia"
GCNoticeSend(aIndex, 1, "Welcome to " .. mapName)