[Client] Lua Global Functions

Category: LuaScript | Subcategory: Main Global Functions


Global Client Functions

These global Lua functions provide deep control over the client, allowing developers to adjust the game's visual settings, language, UI behavior, and access important data about items, inventory, maps, and monsters.
 

Client Settings and Configuration


GetLanguage()
Returns the current client language. Possible values: "Eng", "Spn", "Por", "Heb", "Tha", "Chn", "Kor".

SetLanguage(value)
Sets the client language dynamically.
value: (string) Language code (e.g., "Eng", "Spn").

GetWindowWidth()
Returns the current window width in pixels.

GetWindowHeight()
Returns the current window height in pixels.

GetFontValue()
Returns the current font size used by the client.

SetFontValue(value)
Sets the font size dynamically.
value: (integer) New font size.

GetResolution()
Returns the current resolution setting.

SetResolution(value)
Sets the client's resolution.
value: (integer) New resolution value.

GetVolume()
Returns the current client audio volume.

SetVolume(value)
Sets the client audio volume.
value: (integer) New volume level.

SetGlowSwitch(value)
Enables or disables the glow effect.
value: (integer) 1 to enable, 0 to disable.

SetMonsterHPBar(value)
Shows or hides the monster HP bar.
value: (integer) 1 to show, 0 to hide.

SetFogSwitch(value)
Enables or disables fog effects.
value: (boolean) true to enable, false to disable.

SetGlowEffect(value)
Disables the full-screen glow effect.
value: (integer) 1 to disable, 0 to enable.

SetWingSwitch(value)
Enables or disables wing visibility.
value: (integer) 1 to disable wings, 0 to enable.

SetViewPlayerItems(value)
Shows or hides other players' equipped items.
value: (integer) 1 to show, 0 to hide.
 

Item Information
 

GetNameByIndex(index)
Returns the base name of an item given its index.

GetCompleteNameByIndex(index, level, exc)
Returns the complete name of an item, including its level and excellent options.

GetWidthByIndex(index)
Returns the item width (slots occupied horizontally).

GetHeightByIndex(index)
Returns the item height (slots occupied vertically).

GetSlotByIndex(index)
Returns the equipment slot type where the item can be equipped.
 

Inventory Interaction
 

GetInventoryMouseSlot()
Returns the inventory slot under the mouse cursor.

GetInventoryMouseItemSlot()
Returns the real item slot under the mouse cursor (offset by inventory structure).

GetInventoryMouseItemIndex()
Returns the item type of the item under the cursor.

GetInventoryMouseItemLevel()
Returns the item level of the item under the cursor.

GetInventoryMouseItemExc()
Returns the excellent options of the item under the cursor.
 

Messaging and Global Texts
 

SendMessageClient(message)
Sends a client-side notice message.
message: (string) Message text to show.

GetGlobalText(index)
Returns a global text string from the client based on index.
 

Map and Monster Data

 

GetMapName(map)
Returns the name of the map by its ID.

GetMonsterName(class)
Returns the monster name based on its class ID.

GetCountParty()
Returns the number of party members currently in the party.
 

Hunting and Experience Tracking
 

GetExpPerMinute()
Returns the player's experience gain per minute as a string.

GetAvaregeExpPerMonster()
Returns the average experience received per monster.

GetLastExpReceive()
Returns the amount of experience from the last monster killed.

GetMediaNextLevel()
Returns the total experience required for the next level.

GetMediaZen()
Returns the average Zen obtained while hunting.

GetLastZen()
Returns the last Zen amount obtained.

GetHuntingLevel()
Returns the player's current hunting level.
 

Chat Command
 

ChatSend(command)
Sends a chat command to the server.
command: (string) Command text.
 

Conclusion

These global functions offer full control over the client from Lua scripts, allowing management of settings like language, screen resolution, volume, visual effects (glow, fog, wings), as well as access to item, inventory, map, monster, and hunting statistics information. Thanks to these functions, script developers have powerful tools to customize the player experience, optimize performance, and adapt the interface to different audiences and resolutions.

Return