Skip to content

SynastriaCoreLib ‐ Attunement

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

The Attunement module contains all functions related to item attunement.

getItemStatus

SynastriaCoreLib.getItemStatus(string: itemLink) -> int

Deprecated.

CheckItemValid

SynastriaCoreLib.CheckItemValid(int|string: itemIdOrLink) -> int

Checks if the specified item is valid for attunement for the current player.

IsItemValid

SynastriaCoreLib.IsItemValid(int|string: itemIdOrLink) -> bool
`
Same as above, but simply returns a true/false.

## GetAttuneProgress
```lua
SynastriaCoreLib.GetAttuneProgress(int|string: itemIdOrLink, nil|int: suffixId, nil|int: forgedType) -> int

Returns the attunement progress for the specified item. The suffixId and forgedType parameters are optional, and only used when the first parameter is an itemId.

GetItemAttuneForge

SynastriaCoreLib.GetItemAttuneForge(int|string: itemIdOrLink) -> int

Get the forged level attuned for a particular item.

Description Value
Unknown / Error -1
None 0
Titanforged 1
Warforged 2
Lightforged 3

IsAttuned

SynastriaCoreLib.IsAttuned(int|string: itemIdOrLink) -> bool

Check if an item is attuned. Uses GetItemAttuneProgress behind the scenes.

HasAttunedAnyVariant

SynastriaCoreLib.HasAttunedAnyVariant(int|string: itemIdOrLink) -> bool

Check if ANY variant of the item is attuned. This could be either a suffix or a forgetype.

HasAttunedAllVariants

SynastriaCoreLib.HasAttunedAllVariants(int|string: itemIdOrLink) -> bool

Check if ALL variants of the item have been attuned. This means all suffixes, and all forgetypes.

IsAttunable

SynastriaCoreLib.IsAttunable(int|string: itemIdOrLink) -> bool

Check if the item is attunable by the current player. Uses IsItemValid behind the scenes. Will return false for already attuned items since you cannot attune an item that's already been attuned.

IsAttunableBySomeone

SynastriaCoreLib.IsAttunableBySomeone(int|string: itemIdOrLink) -> bool

Check if the item can be attuned at all, not necessarily by the current player.

HasAttuneProgress

SynastriaCoreLib.HasAttuneProgress(int|string: itemIdOrLink) -> bool

Check if the attunement progress for an item is greater than 0, yet less than 100.

InProgressItems

SynastriaCoreLib.InProgressItems() -> Iterator

Returns an iterator for use in for .. in for all items that have a progress between 0 and 100.

GetAttunedSuffix

SynastriaCoreLib.GetAttunedSuffix(itemId) -> nil|int

Broken / Deprecated since Client Patch 16. Used to return the one suffix that had been attuned.

GetSuffixName

SynastriaCoreLib.GetSuffixName(int: itemId, int: suffixId) -> nil|string

Returns the suffix name.

GetItemAffixMask

SynastriaCoreLib.GetItemAffixMask(int: itemId) -> int: possibleMask1, int: possibleMask2, int: attunedMask1, int: attunedMask2, int: activeIndex

Returns suffix information about an item. possibleMask1 and possibleMask2 contains information about which suffixes are possible to attune, while attunedMask1 and attunedMask2 contains which have actually been attuned. The activeIndex is which suffix is currently active (according to the priority specified by the player.)

GetItemStats

SynastriaCoreLib.GetItemStats(string: itemLink, int: suffixId) -> table

Deprecated. Broken since Client Patch 16. Get the stats for an item with a particular suffix.

GetItemAttuneOverwrite

SynastriaCoreLib.GetItemAttuneOverwrite(int: itemId) -> nil|table

Returns override stats for certain items. Currently only weapons, but may be expanded in the future.

GetAttuneStatName

SynastriaCoreLib.GetAttuneStatName(int: statId) -> nil|string

Returns the name of a specific stat.

GetItemInfo

SynastriaCoreLib.GetItemInfo(string: itemLink) -> nil|table

Returns a table containing attunement information about the specified item.

Field Type Description
itemId int The item's ID
attuned bool If the item is attuned or not, according to GetAttuneProgress()
progress int The item's attunement progress
suffixMask table{int} The item's suffixMask

GetItemInfoCustom

SynastriaCoreLib.GetItemInfoCustom(int: itemId) -> ...

Same as native GetItemInfo, but returns a bit fewer pieces of information. The benefit its that it doesn't require the item to be loaded/cached on the server.

GetItemExtraCustom

SynastriaCoreLib.GetItemExtraCustom(int: itemId) -> ...

ItemHasRandomSuffix

SynastriaCoreLib.ItemHasRandomSuffix(int: itemId) -> bool

Check if the item has a suffix.

ItemAffixCanRollResist

SynastriaCoreLib.ItemAffixCanRollResist(int: itemId) -> bool

Check if the item can roll a resistance suffix.

ItemHasBaseResist

SynastriaCoreLib.ItemHasBaseResist(int: itemId) -> bool

Check if the item has any base resistance.