Skip to content

Native Server API ‐ General

Jonas Söderberg edited this page Jul 13, 2024 · 5 revisions

Types

CustomGameDataType

Name Value
PERK_ACQUIRED 1
PERK_LIMIT 2
PERK_ACTIVE 3
PERK_PROG 4
PERK_TASKASSIGN1 6
PERK_TASKASSIGN2 7
PERK_TASKPARTY 9
PERK_OPTIONS 10
ATTUNE_HAS 11
MYTHIC_SELECT 12
RESOURCE_BANK 13
RESOURCE_LAST 14
ATTUNE_RANDOMPROP 15

Consts

Name Value
MAX_ITEMID (current max itemId in the game)

Functions

GetCustomGameDataCount

GetCustomGameDataCount(int: typeId) -> int

GetCustomGameDataIndex

GetCustomGameDataIndex(int: typeId, int: index) -> int|string

GetCustomGameData

GetCustomGameData(int: typeId, int: index) -> int|float

GetItemInfoCustom

GetItemInfoCustom(int: itemId) -> ...|nil

GetItemExtraCustom

GetItemExtraCustom(int: itemId) -> nil|?

CustomGetRaceId

CustomGetRaceId() -> int

CustomGetClassId

CustomGetClassId() -> int

CustomIsClassMask

CustomIsClassMask(int: mask) -> bool

GetItemTagsCustom

GetItemTagsCustom(int: itemId) -> int, ...

Example use:

local itemTags1, itemTags2 = GetItemTagsCustom(itemId)
local isMythicItem = bit.band(itemTags1 or 0, 0x80) ~= 0
local hasRandomAffix = bit.band(itemTags2 or 0, 1) ~= 0
local randomAffixCanRollResist = bit.band(itemTags2 or 0, 2) ~= 0
local itemHasBaseResistWhenAttuned = bit.band(itemTags2 or 0, 4) ~= 0

OpenAttuneSummary

OpenAttuneSummary() -> nil

Opens the attunement window. Note that the stats are not refreshed when the window is opened this way! To refresh the attunement stats, you have to use the spell

OpenPerkMgr

OpenPerkMgr() -> nil

Opens the Perk manager window

OpenResourceSummary

OpenResourceSummary() -> nil

Opens the Resource Bank window