Purpose
When a character enters the game, sends preconfigured notice lines, for example Level: 400 | Master: 200 | Majestic: 50. Each line can have substitution variables, its own font size and color.
How to enable
- The line
LoadModule("WelcomeMessage\\WelcomeMessage")inData\LuaAPI\Main.luamust not be commented out (enabled by default). - Edit
Data\LuaAPI\Includes\WelcomeMessage\Config.lua. - Click Reload LuaAPI.
The module attaches to the OnCharacterEntry event (onPlayerLogin). No SQL needed.
Configuration (Config.lua)
| Key | Value | Default | Meaning |
|---|---|---|---|
Enable | true / false | true | Turns the module on / off. |
Lines | table of lines | 1 sample line | Each element is one notice, sent in order. |
Lines[].Type | 0 / 1 / 2 / 3 | - | 0 = yellow (center of screen), 1 = blue, 2 = guild, 3 = red. |
Lines[].Text | string | - | Content; you can use the variables in the table below. |
Lines[].Size | number | optional (empty = default size) | Font size. |
Lines[].Color | "#RRGGBB" | optional | Text color. Near-white colors (for example #FEFFFF) look like white. |
VipName | table | Normal, Bronze VIP... | Display name of @Vip by VIP level; [-1] = no VIP. |
Variables usable in Text:
| Variable | Value |
|---|---|
@Name, @Account | Character name, account |
@Level, @MasterLevel, @MajesticLevel, @TotalLevel | The levels |
@Reset | Reset count |
@Vip | VIP name from VipName |
@Map, @Server, @Online | Map, GameServer, number of players online |
WelcomeMessageConfig = {
Enable = true,
Lines = {
{ Type = 0, Size = 15, Color = "#FF0000", Text = "Level: @Level | Master: @MasterLevel | Majestic: @MajesticLevel" },
},
VipName = { [-1] = "Normal", [1] = "Bronze VIP", [2] = "Silver VIP", [3] = "Gold VIP", [4] = "Diamond VIP" },
}