What short function names are

Besides calling by group (Player.GetLevel(aIndex), Message.Send(...)...), the file Data\LuaAPI\System\Modules.lua defines an additional set of single-word names, for example GetObjectLevel(aIndex) or NoticeSend(...). These are global functions that only call back GameServer's functions, so either way works; the short names are convenient for writing quickly or porting old scripts.

The tables below are the commonly used names, cross-checked against Modules.lua. The full list is in that file itself (section "2. Short function names"); this file is managed by the system and should not be edited.

Differences to remember

  • Many yes / no style functions in the short-name set return the number 1 / 0 instead of true / false (for example EffectCheck, InventoryDelItemIndex, MapCheckAttr). The corresponding group functions return true / false.
  • The item table obtained with InventoryGetItemTable has both sets of field names: GameServer's names (Skill, Luck, Option, Exc, Ancient, Harmony, Option380, SocketBonus, ExpireDate, Sockets) and the old names (Option1, Option2, Option3, NewOption, SetOption, JoHOption, 380Option, SocketOption1..5, SocketOptionBonus, DurationTime). An empty slot returns nil.
  • Indexes start from 0 in some old names: PartyGetMemberIndex(party, slot) takes slot from 0 (the group function Party.GetMember counts from 1).
  • Gens system: the short names use 1 = Vanert, 2 = Duprian, the opposite of the values stored in GameServer (1 = Duprian, 2 = Vanert); the function GetObjectGensFamily converts back to match.
  • LogColor(color, text): color = 1 writes a red (error) log, other values write a normal log. RandomGetNumber(max) returns an integer from 0 to max - 1.

Table of commonly used names

Object / server

Short nameEquivalent
GetGameServerCode()Server.GetCode()
GetGameServerCurUser(), GetGameServerMaxUser()Server.GetOnlineCount(), Server.GetMaxUser()
GetGameServerVersion()Server.GetVersion()
GetMinUserIndex(), GetMaxUserIndex()the 2 values of Object.GetUserRange()
GetMinMonsterIndex(), GetMaxMonsterIndex()the 2 values of Object.GetMonsterRange()
GetObjectConnected, GetObjectType, GetObjectName, GetObjectClassObject.GetConnectStatus, GetType, GetName, GetClass
GetObjectMap, GetObjectMapX, GetObjectMapYObject.GetMap, GetX, GetY
GetObjectLife, GetObjectMaxLife, GetObjectMana, GetObjectMaxMana, GetObjectBP, GetObjectShield...Object.GetPower / Object.GetMaxPower with POWER_LIFE, POWER_MANA, POWER_STAMINA, POWER_SHIELD
SetObjectLife, SetObjectMaxLife, SetObjectMana...Object.SetPower / Object.SetMaxPower
GetObjectIndexByName(name)Player.GetIndexByName
GetMapName(map)Map.GetName
MapCheckAttr(map, x, y, attr)Map.CheckAttr (returns 1 / 0)

Character: read

Short nameEquivalent
GetObjectAccount, GetObjectAccountID, GetObjectPlayerIDPlayer.GetAccount, GetAccountID, GetCharacterID
GetObjectLevel, GetObjectMasterLevel, GetObjectMajesticLevel, GetObjectToTalLevelPlayer.GetLevel, GetMasterLevel, GetMajesticLevel, GetTotalLevel
GetObjectLevelUpPoint, GetObjectMasterPoint, GetObjectMajesticPointPlayer.GetLevelUpPoint, GetMasterPoint, GetMajesticPoint
GetObjectMoney, GetObjectReset, GetObjectRuudPlayer.GetMoney, GetReset, GetRuud
GetObjectPKCount, GetObjectPKLevel, GetObjectPKTimerPlayer.GetPKCount, GetPKLevel, GetPKTimer
GetObjectStrength, Dexterity, Vitality, Energy, LeadershipPlayer.GetStat(aIndex, STAT_*)
GetObjectTotal*, GetObjectExtra*, GetObjectDefault* (the same 5 stats)Player.GetTotalStat, GetAddStat, GetDefaultStat
GetObjectAccountLevel, GetObjectAccountExpireDatePlayer.GetVIP, Player.GetVIPExpire
GetObjectIpAddress, GetObjectHardwareId, GetPlayerMac, GetPlayerSerialPlayer.GetIP, GetHardwareId, GetMac, GetDiskSerial (the serial is returned as a string)
GetObjectPartyNumber, GetObjectGuildNumber, GetObjectGuildName...Player.GetPartyNumber, GetGuildNumber, GetGuildName...
GetObjectDeathMap, GetObjectDeathMapX, GetObjectDeathMapYThe most recent death location (Player.GetDeathLocation), -1 if none yet
GetObjectMasterReset, GetObjectLangAlways return 0 (the server has no Master Reset and only one language)

Character: write and actions

Short nameEquivalent
SetObjectLevel, SetObjectMasterLevel, SetObjectMajesticLevelPlayer.SetLevel, SetMasterLevel, SetMajesticLevel
SetObjectMoney, ChangeObjectReset / SetObjectReset, SetObjectRuudPlayer.SetMoney, SetReset, SetRuud
SetObjectStrength... SetObjectLeadershipPlayer.SetStat(aIndex, STAT_*, value)
UserCalcAttribute / CalculateCharacter, UserInfoSend, LevelUpSendPlayer.ReCalc, Player.SendInfo, Player.SendLevelUp
UserDisconnect, UserGameLogoutPlayer.Disconnect, Player.Logout
MoveUser, MoveUserExPlayer.MoveGate, Player.MoveTo
UserWarehouseOpenPlayer.OpenWarehouse
SetWindowTextPlayer.SetWindowText
UserGetOptionTable, UserSetOptionTablePlayer.GetOptionTable, Player.SetOptionTable
PermissionCheck / Insert / Remove(aIndex, perm)Temporary permissions (not saved): 1 move item, 2 sell, 3 buy, 4 use item, 5 drop, 6 pick up, 7 trade, 8 open personal store, 10 Cash Shop, 11 chat, 12 teleport; other numbers are invalid

Messages, currency, log

Short nameEquivalent
NoticeSend, NoticeSendToAll, NoticeGlobalSendMessage.Send, Message.SendAll, Message.SendGlobal
MessageSend, MessageSendToAll, ChatTargetSendMessage.Box, Message.BoxAll, Message.NpcSay
CashShopGetPoint, CashShopAddPoint, CashShopSubPointCoin.Get, Coin.Add, Coin.Sub
LogPrint(text), LogColor(color, text)Log.Add, Log.AddC (when color = 1)
CommandGetArgNumber, CommandGetArgStringUtil.ArgNumber, Util.ArgString
SQLAsyncQueryDB.Query
ConfigReadNumber(section, key, path), ConfigReadString, ConfigSaveStringConfig.ReadNumber (default 0), Config.ReadString (default empty string), Config.SaveString

Inventory and items

Short nameEquivalent
InventoryGetItemTable(aIndex, slot)Player.GetItem + adds the old field names
InventoryGetItemIndex, InventoryGetItemCount(aIndex, item, level)The item code of the slot (-1 if empty) / Inventory.CountItem (default level -1 = any level)
InventoryDelItemIndex, InventoryDelItemCountInventory.DeleteSlot, Inventory.DeleteItems (returns 1 / 0)
InventoryGetFreeSlotCount, InventoryCheckSpaceByItem, InventoryCheckSpaceBySizeInventory.FreeSlots, Inventory.HasSpaceForItem, Inventory.HasSpace
InventoryGetWearSize, InventoryGetMainSize, InventoryGetFullSizeThe values of Inventory.GetSizes()
InventorySetItemTable(aIndex, slot, t)Inventory.SetItem (also accepts the old field names)
EventInventory*, MuunInventory*Event inventory / Muun inventory: read and count items
ItemGive, ItemDropItem.GiveBag, Item.DropBag (give / drop by item bag)
ItemGiveEx, ItemDropEx, CreateItem, InsertItem_GremoryCase, InsertItem_GremoryCaseExCreate an item with all attributes (long parameter list, see the comments in Modules.lua); converted to Item.Give / Item.GremoryAdd
IsItem, IsSocketItem, IsElementalItem, IsPentagramItem, GetItemKindAItem.IsValid, IsSocket, IsElemental, IsPentagram, GetKindA
GetBagItemLevel, GetAncientOpt, GetRandomValue(max)Item.RandomLevel, Item.RandomAncientOption, a random number 0..max-1

Monsters, effects, party

Short nameEquivalent
MonsterCreate(class, map, x, y, dir), MonsterCreateEx, MonsterDeleteMonster.Create (dir defaults to -1), Monster.CreateEx, Monster.Delete
MonsterSummonCreate, MonsterSummonDeletePlayer.SummonMonster, Player.KillSummon
EffectAdd(aIndex, mode, effect, seconds)Buff.Add; when mode = 1, seconds is the expiry timestamp (a point in time), not a number of seconds
EffectDel, EffectCheck, EffectClearBuff.Remove, Buff.Has (returns 1 / 0), Buff.Clear
PartyGetMemberCount, PartyGetMemberIndexParty.GetCount, Party.GetMember

Unsupported placeholder names

The following names exist in Modules.lua but are not supported. Calling them raises the error name() is not supported by LuaAPI (it only stops the calling function, without affecting other modules):

GetObjectMaxNormalPoints, GetObjectPassword, GetObjectPersonalCode, EventInventorySetItemTable, EventInventoryDelItemIndex, EventInventoryDelItemCount, MuunInventorySetItemTable, MuunInventoryDelItemCount, AddItemBag, PartyCreate, PartyDelete, PartyAddMember, PartyDelMember, SendRgbChat.