Scripts.
This document provides a collection scripts that can be used to interact with the game server. Each script includes a description of its purpose, usage, and an example of how to use it.
GetMinUserIndex()
-- Function to get the minimum user index
-- Usage: Get min / max user to get the range of the object index
function ExampleGetMinimumUserIndex()
local minUserIndex = GetMinUserIndex()
logPrint(string.format("The minimum user index is: %d", minUserIndex))
return minUserIndex
end
GetMaxUserIndex()
-- Function to get the maximum user index
-- Usage: Get min / max user to get the range of the object index
function ExapleGetMaximumUserIndex()
local maxUserIndex = GetMaxUserIndex()
logPrint(string.format("The maximum user index is: %d", maxUserIndex))
return maxUserIndex
end
GetMinMonsterIndex()
-- Function to get the minimum monster index
-- Usage: Get min / max monster to get the range of the object index
function ExampleGetMinimumMonsterIndex()
local minMonsterIndex = GetMinMonsterIndex()
logPrint(string.format("The minimum monster index is: %d", minMonsterIndex))
return minMonsterIndex
end
GetMaxMonsterIndex()
-- Function to get the maximum monster index
-- Usage: Get min / max monster to get the range of the object index
function ExampleGetMaximumMonsterIndex()
local maxMonsterIndex = GetMaxMonsterIndex()
logPrint(string.format("The maximum monster index is: %d", maxMonsterIndex))
return maxMonsterIndex
end
GetGameServerCode()
-- Function to get the game server code
-- Usage: Get the current server code, for example: 0 = Normal, 1 = Test, 2 = Dev, 3 = Event
-- Usage: Lock actions based on server code
function ExampleGetGameServerCodeValue()
local serverCode = GetGameServerCode()
logPrint(string.format("The game server code is: %d", serverCode))
return serverCode
end
GetGameServerLang()
-- Function to get the game server language
-- Usage: Get the current server language, for example: 0 = English, 1 = Korean, 2 = Japanese, 3 = Chinese
function ExampleGetGameServerLang()
local serverLanguage = GetGameServerLang()
logPrint(string.format("The game server language is: %s", serverLanguage))
return serverLanguage
end
GetGameServerCode()
-- Function to get the game server code
-- Usage: Get the current server code, for example: 0 = Normal, 1 = Test, 2 = Dev, 3 = Event
function ExampleGetGameServerCodeValue()
local serverCode = GetGameServerCode()
logPrint(string.format("The game server code is: %d", serverCode))
return serverCode
end
GetGameServerLang()
-- Function to get the game server language
-- Usage: Get the current server language, for example: 0 = English, 1 = Korean, 2 = Japanese, 3 = Chinese
function ExampleGetGameServerLang()
local serverLanguage = GetGameServerLang()
logPrint(string.format("The game server language is: %s", serverLanguage))
return serverLanguage
end
GetObjectConnected(aIndex: int)
-- Function to get the connection state of an object
-- Usage: Check if the object is connected to the game server
function ExampleCheckObjectConnection(aIndex)
--[[
OBJECT_OFFLINE = 0
OBJECT_CONNECTED = 1
OBJECT_LOGGED = 2
OBJECT_ONLINE = 3
]]
local connectionState = GetObjectConnected(aIndex)
logPrint(string.format("The connection state of object %d is: %d", aIndex, connectionState))
return connectionState
end
GetObjectIpAddress(aIndex: int)
-- Function to get the IP address of an object
-- Usage: Get the IP address of the object
function ExampleGetObjectIP(aIndex)
local ipAddress = GetObjectIpAddress(aIndex)
logPrint(string.format("The IP address of object %d is: %s", aIndex, ipAddress))
return ipAddress
end
GetObjectLang(aIndex: int)
-- Function to get the language of an object
-- Usage: Get the language of the object
function ExampleGetObjectLanguage(aIndex)
local objectLanguage = GetObjectLang(aIndex)
logPrint(string.format("The language of object %d is: %s", aIndex, objectLanguage))
return objectLanguage
end
GetObjectType(aIndex: int)
-- Function to get the type of an object
-- Usage: Get the type of the object
function ExampleGetObjectTypeValue(aIndex)
--[[
OBJECT_NONE = 0
OBJECT_USER = 1
OBJECT_MONSTER = 2
OBJECT_NPC = 3
OBJECT_ITEM = 5
]]
local objectType = GetObjectType(aIndex)
logPrint(string.format("The type of object %d is: %d", aIndex, objectType))
return objectType
end
GetObjectAccount(aIndex: int)
-- Function to get the account of an object
-- Usage: Get the account of the object
function ExampleGetObjectAccountName(aIndex)
local accountName = GetObjectAccount(aIndex)
logPrint(string.format("The account of object %d is: %s", aIndex, accountName))
return accountName
end
GetGetObjectName(aIndex: int)
-- Function to get the name of an object
-- Usage: Get the name of the object
function ExampleGetObjectNameValue(aIndex)
local objectName = GetObjectName(aIndex)
logPrint(string.format("The name of object %d is: %s", aIndex, objectName))
return objectName
end
GetObjectPersonalCode(aIndex: int)
-- Function to get the personal code of an object
-- Usage: Get the personal code of the object
function ExampleGetObjectPersonalCodeValue(aIndex)
local personalCode = GetObjectPersonalCode(aIndex)
logPrint(string.format("The personal code of object %d is: %s", aIndex, personalCode))
return personalCode
end
GetObjectClass(aIndex: int)
-- Function to get the class of an object
-- Usage: Get the class of the object
function ExampleGetObjectClassValue(aIndex)
--[[
CLASS_DW = 0
CLASS_DK = 1
CLASS_FE = 2
CLASS_MG = 3
CLASS_DL = 4
CLASS_SU = 5
CLASS_RF = 6
CLASS_GL = 7
CLASS_RW = 8
CLASS_SL = 9
CLASS_GC = 10
CLASS_KM = 11
CLASS_LM = 12
CLASS_IK = 13
]]
local objectClass = GetObjectClass(aIndex)
logPrint(string.format("The class of object %d is: %d", aIndex, objectClass))
return objectClass
end
GetObjectChangeUp(aIndex: int)
-- Function to get the evolution of an object
-- Usage: Get the evolution of the object
function ExampleGetObjectEvolution(aIndex)
local evolution = GetObjectChangeUp(aIndex)
logPrint(string.format("The evolution of object %d is: %d", aIndex, evolution))
return evolution
end
GetObjectLevel(aIndex: int)
-- Function to get the level of an object
-- Usage: Get the level of the object
function ExampleGetObjectLevel(aIndex)
local level = GetObjectLevel(aIndex)
logPrint(string.format("The level of object %d is: %d", aIndex, level))
return level
end
GetObjectLevelUpPoint(aIndex: int)
-- Function to get the level up points of an object
-- Usage: Get the level up points of the object
function ExampleGetObjectLevelUpPoints(aIndex)
local levelUpPoints = GetObjectLevelUpPoint(aIndex)
logPrint(string.format("The level up points of object %d are: %d", aIndex, levelUpPoints))
return levelUpPoints
end
GetObjectMoney(aIndex: int)
-- Function to get the money (zen) of an object
-- Usage: Get the money (zen) of the object
function ExampleGetObjectMoneyValue(aIndex)
local money = GetObjectMoney(aIndex)
logPrint(string.format("The money (zen) of object %d is: %d", aIndex, money))
return money
end
GetObjectRuud(aIndex: int)
-- Function to get the ruud amount of an object
-- Usage: Get the ruud amount of the object
function ExampleGetObjectRuud(aIndex)
local ruud = GetObjectRuud(aIndex)
logPrint(string.format("The ruud amount of object %d is: %d", aIndex, ruud))
return ruud
end
GetObjectStrength(aIndex: int)
-- Function to get the strength of an object
-- Usage: Get the strength of the object
function ExampleGetObjectStrengthValue(aIndex)
local strength = GetObjectStrength(aIndex)
logPrint(string.format("The strength of object %d is: %d", aIndex, strength))
return strength
end
GetObjectDexterity(aIndex: int)
-- Function to get the dexterity of an object
-- Usage: Get the dexterity of the object
function ExampleGetObjectDexterityValue(aIndex)
local dexterity = GetObjectDexterity(aIndex)
logPrint(string.format("The dexterity of object %d is: %d", aIndex, dexterity))
return dexterity
end
GetObjectVitality(aIndex: int)
-- Function to get the vitality of an object
-- Usage: Get the vitality of the object
function ExampleGetObjectVitalityValue(aIndex)
local vitality = GetObjectVitality(aIndex)
logPrint(string.format("The vitality of object %d is: %d", aIndex, vitality))
return vitality
end
GetObjectEnergy(aIndex: int)
-- Function to get the energy of an object
-- Usage: Get the energy of the object
function ExampleGetObjectEnergyValue(aIndex)
local energy = GetObjectEnergy(aIndex)
logPrint(string.format("The energy of object %d is: %d", aIndex, energy))
return energy
end
GetObjectLeadership(aIndex: int)
-- Function to get the leadership of an object
-- Usage: Get the leadership of the object
function ExampleGetObjectLeadershipValue(aIndex)
local leadership = GetObjectLeadership(aIndex)
logPrint(string.format("The leadership of object %d is: %d", aIndex, leadership))
return leadership
end
GetObjectExtraStrength(aIndex: int)
-- Function to get the extra strength of an object
-- Usage: Get the extra strength of the object
function ExampleGetObjectExtraStrengthValue(aIndex)
local extraStrength = GetObjectExtraStrength(aIndex)
logPrint(string.format("The extra strength of object %d is: %d", aIndex, extraStrength))
return extraStrength
end
GetObjectExtraDexterity(aIndex: int)
-- Function to get the extra dexterity of an object
-- Usage: Get the extra dexterity of the object
function ExampleGetObjectExtraDexterityValue(aIndex)
local extraDexterity = GetObjectExtraDexterity(aIndex)
logPrint(string.format("The extra dexterity of object %d is: %d", aIndex, extraDexterity))
return extraDexterity
end
GetObjectExtraVitality(aIndex: int)
-- Function to get the extra vitality of an object
-- Usage: Get the extra vitality of the object
function ExampleGetObjectExtraVitality(aIndex)
local extraVitality = GetObjectExtraVitality(aIndex)
logPrint(string.format("The extra vitality of object %d is: %d", aIndex, extraVitality))
return extraVitality
end
GetObjectExtraEnergy(aIndex: int)
-- Function to get the extra energy of an object
-- Usage: Get the extra energy of the object
function ExampleGetObjectExtraEnergyValue(aIndex)
local extraEnergy = GetObjectExtraEnergy(aIndex)
logPrint(string.format("The extra energy of object %d is: %d", aIndex, extraEnergy))
return extraEnergy
end
GetObjectExtraLeadership(aIndex: int)
-- Function to get the extra leadership of an object
-- Usage: Get the extra leadership of the object
function ExampleGetObjectExtraLeadershipValue(aIndex)
local extraLeadership = GetObjectExtraLeadership(aIndex)
logPrint(string.format("The extra leadership of object %d is: %d", aIndex, extraLeadership))
return extraLeadership
end
GetObjectDefaultStrength(aIndex: int)
-- Function to get the default strength of an object
-- Usage: Get the default strength of the object
function ExampleGetObjectDefaultStrengthValue(aIndex)
local defaultStrength = GetObjectDefaultStrength(aIndex)
logPrint(string.format("The default strength of object %d is: %d", aIndex, defaultStrength))
return defaultStrength
end
GetObjectDefaultDexterity(aIndex: int)
-- Function to get the default dexterity of an object
-- Usage: Get the default dexterity of the object
function ExampleGetObjectDefaultDexterityValue(aIndex)
local defaultDexterity = GetObjectDefaultDexterity(aIndex)
logPrint(string.format("The default dexterity of object %d is: %d", aIndex, defaultDexterity))
return defaultDexterity
end
GetObjectDefaultVitality(aIndex: int)
-- Function to get the default vitality of an object
-- Usage: Get the default vitality of the object
function ExampleGetObjectDefaultVitalityValue(aIndex)
local defaultVitality = GetObjectDefaultVitality(aIndex)
logPrint(string.format("The default vitality of object %d is: %d", aIndex, defaultVitality))
return defaultVitality
end
GetObjectDefaultEnergy(aIndex: int)
-- Function to get the default energy of an object
-- Usage: Get the default energy of the object
function ExampleGetObjectDefaultEnergyValue(aIndex)
local defaultEnergy = GetObjectDefaultEnergy(aIndex)
logPrint(string.format("The default energy of object %d is: %d", aIndex, defaultEnergy))
return defaultEnergy
end
GetObjectDefaultLeadership(aIndex: int)
-- Function to get the default leadership of an object
-- Usage: Get the default leadership of the object
function ExampleGetObjectDefaultLeadershipValue(aIndex)
local defaultLeadership = GetObjectDefaultLeadership(aIndex)
logPrint(string.format("The default leadership of object %d is: %d", aIndex, defaultLeadership))
return defaultLeadership
end
GetObjectLive(aIndex: int)
-- Function to get the live state of an object
-- Usage: Get the live state of the object
function ExampleGetObjectLiveState(aIndex)
local liveState = GetObjectLive(aIndex)
logPrint(string.format("The live state of object %d is: %d", aIndex, liveState))
return liveState
end
GetObjectLife(aIndex: int)
-- Function to get the current life of an object
-- Usage: Get the current life of the object
function ExampleGetObjectLifeValue(aIndex)
local life = GetObjectLife(aIndex)
logPrint(string.format("The current life of object %d is: %d", aIndex, life))
return life
end
GetObjectMaxLife(aIndex: int)
-- Function to get the maximum life of an object
-- Usage: Get the maximum life of the object
function ExampleGetObjectMaxLifeValue(aIndex)
local maxLife = GetObjectMaxLife(aIndex)
logPrint(string.format("The maximum life of object %d is: %d", aIndex, maxLife))
return maxLife
end
GetObjectMana(aIndex: int)
-- Function to get the current mana of an object
-- Usage: Get the current mana of the object
function ExampleGetObjectManaValue(aIndex)
local mana = GetObjectMana(aIndex)
logPrint(string.format("The current mana of object %d is: %d", aIndex, mana))
return mana
end
GetObjectMaxMana(aIndex: int)
-- Function to get the maximum mana of an object
-- Usage: Get the maximum mana of the object
function ExampleGetObjectMaxManaValue(aIndex)
local maxMana = GetObjectMaxMana(aIndex)
logPrint(string.format("The maximum mana of object %d is: %d", aIndex, maxMana))
return maxMana
end
GetObjectBP(aIndex: int)
-- Function to get the current BP of an object
-- Usage: Get the current BP of the object
function ExampleGetObjectBPValue(aIndex)
local bp = GetObjectBP(aIndex)
logPrint(string.format("The current BP of object %d is: %d", aIndex, bp))
return bp
end
GetObjectShield(aIndex: int)
-- Function to get the current shield (SD) of an object
-- Usage: Get the current shield (SD) of the object
function ExampleGetObjectShieldValue(aIndex)
local shield = GetObjectShield(aIndex)
logPrint(string.format("The current shield (SD) of object %d is: %d", aIndex, shield))
return shield
end
GetObjectPKCount(aIndex: int)
-- Function to get the PK count of an object
-- Usage: Get the PK count of the object
function ExampleGetObjectPKCountValue(aIndex)
local pkCount = GetObjectPKCount(aIndex)
logPrint(string.format("The PK count of object %d is: %d", aIndex, pkCount))
return pkCount
end
GetObjectPKLevel(aIndex: int)
-- Function to get the PK level of an object
-- Usage: Get the PK level of the object
function ExampleGetObjectPKLevelValue(aIndex)
local pkLevel = GetObjectPKLevel(aIndex)
logPrint(string.format("The PK level of object %d is: %d", aIndex, pkLevel))
return pkLevel
end
GetObjectPKTimer(aIndex: int)
-- Function to get the PK timer of an object
-- Usage: Get the PK timer of the object
function ExampleGetObjectPKTimerValue(aIndex)
local pkTimer = GetObjectPKTimer(aIndex)
logPrint(string.format("The PK timer of object %d is: %d", aIndex, pkTimer))
return pkTimer
end
GetObjectMap(aIndex: int)
-- Function to get the current map of an object
-- Usage: Get the current map of the object
function ExampleGetObjectMapValue(aIndex)
local map = GetObjectMap(aIndex)
logPrint(string.format("The current map of object %d is: %d", aIndex, map))
return map
end
GetObjectMapX(aIndex: int)
-- Function to get the current X position of an object
-- Usage: Get the current X position of the object
function ExampleGetObjectMapXValue(aIndex)
local mapX = GetObjectMapX(aIndex)
logPrint(string.format("The current X position of object %d is: %d", aIndex, mapX))
return mapX
end
GetObjectMapY(aIndex: int)
-- Function to get the current Y position of an object
-- Usage: Get the current Y position of the object
function ExampleGetObjectMapYValue(aIndex)
local mapY = GetObjectMapY(aIndex)
logPrint(string.format("The current Y position of object %d is: %d", aIndex, mapY))
return mapY
end
GetObjectDeathMap(aIndex: int)
-- Function to get the death map of an object
-- Usage: Get the death map of the object
function ExampleGetObjectDeathMapValue(aIndex)
local deathMap = GetObjectDeathMap(aIndex)
logPrint(string.format("The death map of object %d is: %d", aIndex, deathMap))
return deathMap
end
GetObjectDeathMapX(aIndex: int)
-- Function to get the death position X of an object
-- Usage: Get the death position X of the object
function ExampleGetObjectDeathMapXValue(aIndex)
local deathMapX = GetObjectDeathMapX(aIndex)
logPrint(string.format("The death position X of object %d is: %d", aIndex, deathMapX))
return deathMapX
end
GetObjectDeathMapY(aIndex: int)
-- Function to get the death position Y of an object
-- Usage: Get the death position Y of the object
function ExampleGetObjectDeathMapYValue(aIndex)
local deathMapY = GetObjectDeathMapY(aIndex)
logPrint(string.format("The death position Y of object %d is: %d", aIndex, deathMapY))
return deathMapY
end
GetObjectAuthority(aIndex: int)
-- Function to get the authority value of an object
-- Usage: Get the authority value of the object
function ExampleGetObjectAuthorityValue(aIndex)
local authority = GetObjectAuthority(aIndex)
logPrint(string.format("The authority value of object %d is: %d", aIndex, authority))
return authority
end
GetObjectPartyNumber(aIndex: int)
-- Function to get the party number of an object
-- Usage: Get the party number of the object
function ExampleGetObjectPartyNumberValue(aIndex)
local partyNumber = GetObjectPartyNumber(aIndex)
logPrint(string.format("The party number of object %d is: %d", aIndex, partyNumber))
return partyNumber
end
GetObjectGuildNumber(aIndex: int)
-- Function to get the guild number of an object
-- Usage: Get the guild number of the object
function ExampleGetObjectGuildNumberValue(aIndex)
local guildNumber = GetObjectGuildNumber(aIndex)
logPrint(string.format("The guild number of object %d is: %d", aIndex, guildNumber))
return guildNumber
end
GetObjectGuildStatus(aIndex: int)
-- Function to get the guild status of an object
-- Usage: Get the guild status of the object
function ExampleGetObjectGuildStatusValue(aIndex)
local guildStatus = GetObjectGuildStatus(aIndex)
logPrint(string.format("The guild status of object %d is: %d", aIndex, guildStatus))
return guildStatus
end
GetObjectGuildName(aIndex: int)
-- Function to get the guild name of an object
-- Usage: Get the guild name of the object
function ExampleGetObjectGuildNameValue(aIndex)
local guildName = GetObjectGuildName(aIndex)
logPrint(string.format("The guild name of object %d is: %s", aIndex, guildName))
return guildName
end
GetObjectGuildRelationship(aIndex: int, bIndex: int)
-- Function to get the guild relationship with another object
-- Usage: Get the guild relationship with another object
function ExampleGetObjectGuildRelationshipValue(aIndex, bIndex)
local guildRelationship = GetObjectGuildRelationship(aIndex, bIndex)
logPrint(string.format("The guild relationship between object %d and object %d is: %d", aIndex, bIndex, guildRelationship))
return guildRelationship
end
GetObjectGuildUnionNumber(aIndex: int)
-- Function to get the guild union number of an object
-- Usage: Get the guild union number of the object
function ExampleGetObjectGuildUnionNumberValue(aIndex)
local guildUnionNumber = GetObjectGuildUnionNumber(aIndex)
logPrint(string.format("The guild union number of object %d is: %d", aIndex, guildUnionNumber))
return guildUnionNumber
end
GetObjectGuildUnionName(aIndex: int)
-- Function to get the guild union name of an object
-- Usage: Get the guild union name of the object
function ExampleGetObjectGuildUnionNameValue(aIndex)
local guildUnionName = GetObjectGuildUnionName(aIndex)
logPrint(string.format("The guild union name of object %d is: %s", aIndex, guildUnionName))
return guildUnionName
end
GetObjectChange(aIndex: int)
-- Function to get the transformation number of an object
-- Usage: Get the transformation number of the object
function ExampleGetObjectTransformation(aIndex)
local transformation = GetObjectChange(aIndex)
logPrint(string.format("The transformation number of object %d is: %d", aIndex, transformation))
return transformation
end
GetObjectInterface(aIndex: int)
-- Function to get the interface state of an object
-- Usage: Get the interface state of the object
-- Example: allow / disallow actions based on the interface state
function ExampleGetObjectInterfaceState(aIndex)
local interfaceState = GetObjectInterface(aIndex)
logPrint(string.format("The interface state of object %d is: %d", aIndex, interfaceState))
return interfaceState
end
GetObjectMasterLevel(aIndex: int)
-- Function to get the master level of an object
-- Usage: Get the master level of the object
function ExampleGetObjectMasterLevelValue(aIndex)
local masterLevel = GetObjectMasterLevel(aIndex)
logPrint(string.format("The master level of object %d is: %d", aIndex, masterLevel))
return masterLevel
end
GetObjectMasterPoint(aIndex: int)
-- Function to get the master points of an object
-- Usage: Get the master points of the object
function ExampleGetObjectMasterPoints(aIndex)
local masterPoints = GetObjectMasterPoint(aIndex)
logPrint(string.format("The master points of object %d are: %d", aIndex, masterPoints))
return masterPoints
end
GetObjectMasterPointExt(aIndex: int)
-- Function to get the extended master points of an object
-- Usage: Get the extended master points of the object
function ExampleGetObjectMasterPointExtValue(aIndex)
local masterPointExt = GetObjectMasterPointExt(aIndex)
logPrint(string.format("The extended master points of object %d are: %d", aIndex, masterPointExt))
return masterPointExt
end
GetObjectAccountLevel(aIndex: int)
-- Function to get the account level of an object
-- Usage: Get the account level of the object (Vip, free)
function ExampleGetObjectAccountLevelValue(aIndex)
local accountLevel = GetObjectAccountLevel(aIndex)
logPrint(string.format("The account level of object %d is: %d", aIndex, accountLevel))
return accountLevel
end
GetObjectAccountExpireDate(aIndex: int)
-- Function to get the account expiration date of an object
-- Usage: Get the account expiration date of the object
function ExampleGetObjectAccountExpireDateValue(aIndex)
local accountExpireDate = GetObjectAccountExpireDate(aIndex)
logPrint(string.format("The account expiration date of object %d is: %s", aIndex, accountExpireDate))
return accountExpireDate
end
GetObjectReset(aIndex: int)
-- Function to get the reset amount of an object
-- Usage: Get the reset amount of the object
function ExampleGetObjectResetValue(aIndex)
local resetAmount = GetObjectReset(aIndex)
logPrint(string.format("The reset amount of object %d is: %d", aIndex, resetAmount))
return resetAmount
end
GetObjectMasterReset(aIndex: int)
-- Function to get the master reset amount of an object
-- Usage: Get the master reset amount of the object
function ExampleGetObjectMasterResetValue(aIndex)
local masterResetAmount = GetObjectMasterReset(aIndex)
logPrint(string.format("The master reset amount of object %d is: %d", aIndex, masterResetAmount))
return masterResetAmount
end
GetObjectGensRank(aIndex: int)
-- Function to get the gens global rank of an object
-- Usage: Get the gens global rank of the object
function ExampleGetObjectGensRankValue(aIndex)
local gensRank = GetObjectGensRank(aIndex)
logPrint(string.format("The gens global rank of object %d is: %d", aIndex, gensRank))
return gensRank
end
GetObjectGensSymbol(aIndex: int)
-- Function to get the gens patent symbol number of an object
-- Usage: Get the gens patent symbol number of the object
function ExampleGetObjectGensSymbolValue(aIndex)
local gensSymbol = GetObjectGensSymbol(aIndex)
logPrint(string.format("The gens patent symbol number of object %d is: %d", aIndex, gensSymbol))
return gensSymbol
end
GetObjectGensFamily(aIndex: int)
-- Function to get the gens family of an object
-- Usage: Get the gens family of the object
function ExampleGetObjectGensFamilyValue(aIndex)
--[[
Return object gens family (0=None/1=Varnert/2=Duprian).
]]
local gensFamily = GetObjectGensFamily(aIndex)
logPrint(string.format("The gens family of object %d is: %d", aIndex, gensFamily))
return gensFamily
end
GetObjectGensContribution(aIndex: int)
-- Function to get the gens contribution amount of an object
-- Usage: Get the gens contribution amount of the object
function ExampleGetObjectGensContributionValue(aIndex)
local gensContribution = GetObjectGensContribution(aIndex)
logPrint(string.format("The gens contribution amount of object %d is: %d", aIndex, gensContribution))
return gensContribution
end
GetObjectCSGuildSide(aIndex: int)
-- Function to get the Castle Siege guild side of an object
-- Usage: Get the Castle Siege guild side of the object
function ExampleGetObjectCSGuildSideValue(aIndex)
local csGuildSide = GetObjectCSGuildSide(aIndex)
logPrint(string.format("The Castle Siege guild side of object %d is: %d", aIndex, csGuildSide))
return csGuildSide
end
GetObjectOfflineFlag(aIndex: int)
-- Function to get the offline flag of an object
-- Usage: Get the offline flag of the object
function ExampleGetObjectOfflineFlagValue(aIndex)
--[[
Return object offline flag (0=Online/1=Off-Attack/Off-Store).
]]
local offlineFlag = GetObjectOfflineFlag(aIndex)
logPrint(string.format("The offline flag of object %d is: %d", aIndex, offlineFlag))
return offlineFlag
end
GetObjectIndexByName(aString: string)
-- Function to get the object index by name
-- Usage: Get the object index by name
function ExampleGetObjectIndexByNameValue(aString)
local objectIndex = GetObjectIndexByName(aString)
logPrint(string.format("The index of object named %s is: %d", aString, objectIndex))
return objectIndex
end
SetObjectLevel(aIndex: int, aValue: int)
-- Function to set the level of an object
-- Usage: Set the level of the object
function ExampleSetObjectLevelValue(aIndex, aValue)
SetObjectLevel(aIndex, aValue)
logPrint(string.format("The level of object %d has been set to: %d", aIndex, aValue))
end
SetObjectLevelUpPoint(aIndex: int, aValue: int)
-- Function to set the level up points of an object
-- Usage: Set the level up points of the object
function ExampleSetObjectLevelUpPoints(aIndex, aValue)
SetObjectLevelUpPoint(aIndex, aValue)
logPrint(string.format("The level up points of object %d have been set to: %d", aIndex, aValue))
end
SetObjectMoney(aIndex: int, aValue: int)
-- Function to set the money (zen) of an object
-- Usage: Set the money (zen) of the object
function ExampleSetObjectMoneyValue(aIndex, aValue)
SetObjectMoney(aIndex, aValue)
logPrint(string.format("The money (zen) of object %d has been set to: %d", aIndex, aValue))
end
SetObjectRuud(aIndex: int, aValue: int)
-- Function to set the ruud amount of an object
-- Usage: Set the ruud amount of the object
function ExampleSetObjectRuudValue(aIndex, aValue)
SetObjectRuud(aIndex, aValue)
logPrint(string.format("The ruud amount of object %d has been set to: %d", aIndex, aValue))
end
SetObjectStrength(aIndex: int, aValue: int)
-- Function to set the strength of an object
-- Usage: Set the strength of the object
function ExampleSetObjectStrengthValue(aIndex, aValue)
SetObjectStrength(aIndex, aValue)
logPrint(string.format("The strength of object %d has been set to: %d", aIndex, aValue))
end
SetObjectDexterity(aIndex: int, aValue: int)
-- Function to set the dexterity of an object
-- Usage: Set the dexterity of the object
function ExampleSetObjectDexterityValue(aIndex, aValue)
SetObjectDexterity(aIndex, aValue)
logPrint(string.format("The dexterity of object %d has been set to: %d", aIndex, aValue))
end
SetObjectVitality(aIndex: int, aValue: int)
-- Function to set the vitality of an object
-- Usage: Set the vitality of the object
function ExampleSetObjectVitalityValue(aIndex, aValue)
SetObjectVitality(aIndex, aValue)
logPrint(string.format("The vitality of object %d has been set to: %d", aIndex, aValue))
end
SetObjectEnergy(aIndex: int, aValue: int)
-- Function to set the energy of an object
-- Usage: Set the energy of the object
function ExampleSetObjectEnergyValue(aIndex, aValue)
SetObjectEnergy(aIndex, aValue)
logPrint(string.format("The energy of object %d has been set to: %d", aIndex, aValue))
end
SetObjectLeadership(aIndex: int, aValue: int)
-- Function to set the leadership of an object
-- Usage: Set the leadership of the object
function ExampleSetObjectLeadershipValue(aIndex, aValue)
SetObjectLeadership(aIndex, aValue)
logPrint(string.format("The leadership of object %d has been set to: %d", aIndex, aValue))
end
PermissionCheck(aIndex: int, aValue: int)
-- Function to check user permission
-- Usage: Check if the user has a specific permission
function ExampleCheckUserPermission(aIndex, aValue)
--[[
Permission list:
1 = Move Item.
2 = Sell Item.
3 = Buy Item.
4 = Use Item.
5 = Drop Item.
6 = Pick Item.
7 = Open Trade.
8 = Open Personal Shop.
9 = Use Chaos Machine.
10 = Open Cash Shop.
11 = Use Chat.
12 = Move character.
Return (1) if the user has the chosen permission, (0) if not.
]]
local hasPermission = PermissionCheck(aIndex, aValue)
logPrint(string.format("User %d has permission %d: %d", aIndex, aValue, hasPermission))
return hasPermission
end
PermissionInsert(aIndex: int, aValue: int)
-- Function to insert a permission to a user
-- Usage: Grant a permission to a user
function ExampleInsertUserPermission(aIndex, aValue)
PermissionInsert(aIndex, aValue)
logPrint(string.format("Permission %d has been granted to user %d", aValue, aIndex))
end
PermissionRemove(aIndex: int, aValue: int)
-- Function to remove a permission from a user
-- Usage: Remove a permission from a user
function ExampleRemoveUserPermission(aIndex, aValue)
PermissionRemove(aIndex, aValue)
logPrint(string.format("Permission %d has been removed from user %d", aValue, aIndex))
end
PKLevelSend(aIndex: int, pkLevel: int)
-- Function to send PK level
-- Usage: Send the PK level to the user
function ExampleSendPKLevel(aIndex, pkLevel)
PKLevelSend(aIndex, pkLevel)
logPrint(string.format("PK level %d has been sent to user %d", pkLevel, aIndex))
end
PostSend(type: int, messageIndex: int, username: string, message: string)
-- Function to send a post message
-- Usage: Send a post message to the user
function ExampleSendPost(type, messageIndex, username, message)
PostSend(type, messageIndex, username, message)
logPrint(string.format("Post message from user %d: %s", aIndex, message))
end
RandomGetNumber(max: int)
-- Function to get a random number within a range
-- Usage: Get a random number between 0 and the specified maximum
function ExampleGetRandomNumber(max)
local number = RandomGetNumber(max)
logPrint(string.format("Random number between 0 and %d: %d", max, number))
return number
end
RandomGetSingle(max: float)
-- Function to get a random single precision float
-- Usage: Get a random single precision float between 0 and the specified maximum
function ExampleGetRandomSingle(max)
local number = RandomGetSingle(max)
logPrint(string.format("Random single precision float between 0 and %d: %f", max, number))
return number
end
RuudSend(aIndex: int, points: int)
-- Function to send Ruud points
-- Usage: Send Ruud points to the user
function ExampleSendRuudPoints(aIndex, points)
RuudSend(aIndex, points)
logPrint(string.format("Ruud points %d have been sent to user %d", points, aIndex))
end
SkinChangeSend(aIndex: int, skinId: int)
-- Function to change the skin of an object
-- Usage: Change the skin of the object
function ExampleChangeSkin(aIndex, skinId)
SkinChangeSend(aIndex, skinId)
logPrint(string.format("Skin of user %d has been changed to %d", aIndex, skinId))
end
TimerStartSend(timerId: int, duration: int)
-- Function to start a timer
-- Usage: Start a timer for a specific duration
function ExampleStartTimer(timerId, duration)
TimerStartSend(timerId, duration)
logPrint(string.format("Timer %d has been started for duration %d", timerId, duration))
end
UserDisconnect(aIndex: int)
-- Function to disconnect a user
-- Usage: Disconnect a user from the game
function ExampleDisconnectUser(aIndex)
UserDisconnect(aIndex)
logPrint(string.format("User %d has been disconnected", aIndex))
end
UserGameLogout(aIndex: int, value: int)
-- Function to log out a user from the game
-- Usage: Log out a user from the game
function ExampleLogoutUser(aIndex, value)
--[[
value = Logout type (0=Close Game,1=Select Char,2=Select Server).
]]
UserGameLogout(aIndex, value)
logPrint(string.format("User %d has been logged out from the game", aIndex))
end
UserCalcAttribute(aIndex: int)
-- Function to calculate user attributes
-- Usage: Recalculate the attributes of the user
function ExampleCalculateUserAttributes(aIndex)
UserCalcAttribute(aIndex)
logPrint(string.format("Attributes for user %d have been calculated", aIndex))
end
UserInfoSend(aIndex: int)
-- Function to send user information
-- Usage: Send information about the user
function ExampleSendUserInfo(aIndex)
UserInfoSend(aIndex)
logPrint(string.format("Information for user %d has been sent", aIndex))
end
UserActionSend(aIndex: int, tartgetIndex: int, actionId: int)
-- Function to send user action
-- Usage: Send an action to the user
function ExampleSendUserAction(aIndex, tartgetIndex, actionId)
UserActionSend(aIndex, tartgetIndex, actionId)
logPrint(string.format("Action %d has been sent to user %d", actionId, aIndex))
end
UserSetAccountLevel(aIndex: int, level: int, duration: int)
-- Function to set user account level
-- Usage: Set the account level of the user for a specific duration
function ExampleSetUserAccountLevel(aIndex, level, duration)
UserSetAccountLevel(aIndex, level, duration)
logPrint(string.format("Account level %d has been set for user %d", level, aIndex))
end
UserWarehouseOpen(aIndex: int)
-- Function to open user warehouse
function ExampleOpenUserWarehouse(aIndex)
UserWarehouseOpen(aIndex)
logPrint(string.format("Warehouse for user %d has been opened", aIndex))
end
UserUpdateViewport(aIndex: int)
-- Function to update user viewport
-- Usage: Update the viewport of the user
function ExampleUpdateUserViewport(aIndex)
UserUpdateViewport(aIndex)
logPrint(string.format("Viewport for user %d has been updated", aIndex))
end
UserGetOptionTable(aIndex: int)
-- Function to get user option table
-- Usage: Get the option table of the user
function ExampleGetUserOptionTable(aIndex)
--[[
Table elements: AddDamage, AddPhysiDamage, AddMagicDamage, AddCurseDamage, AddDefense, AddElementalDamage, AddElementalDefense, AddSpeed, AddMaxHP, AddMaxMP, AddMaxBP, AddMaxSD, AddHPRecoveryRate, AddMPRecoveryRate, AddBPRecoveryRate, AddSDRecoveryRate, AddDamageReduction, AddDamageDecrease, AddDamageReflect, AddCriticalDamage, AddExcellentDamage, AddCriticalDamageRate, AddExcellentDamageRate, AddIgnoreDefenseRate, AddDoubleDamageRate, AddTripleDamageRate, AddFullDamageReflectRate, AddDefensiveFullHPRestoreRate, AddDefensiveFullSDRestoreRate, AddOffensiveFullHPRestoreRate, AddOffensiveFullSDRestoreRate, MulDamage, MulPhysiDamage, MulMagicDamage, MulCurseDamage, MulDefense, MulElementalDamage, MulElementalDefense, MulMaxHP, MulMaxMP, MulMaxBP, MulMaxSD
]]
local optionTable = UserGetOptionTable(aIndex)
logPrint(string.format("Option table for user %d: %s", aIndex, optionTable))
return optionTable
end
UserSetOptionTable(aIndex: int, optionTable: array)
-- Function to set user option table
-- Usage: Set the option table of the user
function ExampleSetUserOptionTable(aIndex, optionTable)
UserSetOptionTable(aIndex, optionTable)
logPrint(string.format("Option table for user %d has been set to: %s", aIndex, optionTable))
end