Armor

Contracts

Addresses

Name
Mainnet
Testnet

DFK Chain

0xE60480B4083cA9F4d07034Eb30Bc7894114adAC1

0x630706B99c053C727094C952ca685637dFE89c0a

Kaia

0x8740c7509dC22Fc1a2e1Da7d0067A563E4A66f63

0xF7dD05C65537Bb289Ecd737868b4dc978569cc1F

Metis

0x4Bc4BBDF294eeb3017FB4bD7806b6D61D74e85bb

0x7Cb74b35eeE262ca1960E67Dcac6fd47ECbbA6bF

Interface

interface IArmorCoreDiamond {

    // Events
    event Approval(address indexed owner, address indexed operator, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
    event ArmorCreated(address indexed owner, uint256 indexed armorId, tuple(uint256 id, tuple(uint8 armorType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 rawPhysDefense, uint16 physDefScalar, uint16 pDefScalarMax, uint16 rawMagicDefense, uint16 magicDefScalar, uint16 mDefScalarMax, uint16 evasion, uint16 spare1, uint16 spare2) displayDefenseInfo, tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3) stateEnchantments, tuple(uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount, uint16 misc1, uint32 misc2, uint32 misc3, uint32 misc4) bonusInfoExtras) armor);
    event ArmorUpdated(address indexed owner, uint256 indexed armorId, tuple(uint256 id, tuple(uint8 armorType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 rawPhysDefense, uint16 physDefScalar, uint16 pDefScalarMax, uint16 rawMagicDefense, uint16 magicDefScalar, uint16 mDefScalarMax, uint16 evasion, uint16 spare1, uint16 spare2) displayDefenseInfo, tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3) stateEnchantments, tuple(uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount, uint16 misc1, uint32 misc2, uint32 misc3, uint32 misc4) bonusInfoExtras) armor);
    event BonusInfoExtrasUpdated(address indexed owner, uint256 armorId, tuple(uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount, uint16 misc1, uint32 misc2, uint32 misc3, uint32 misc4) bonusInfoExtras);
    event DisplayDefenseInfoUpdated(address indexed owner, uint256 armorId, tuple(uint8 armorType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 rawPhysDefense, uint16 physDefScalar, uint16 pDefScalarMax, uint16 rawMagicDefense, uint16 magicDefScalar, uint16 mDefScalarMax, uint16 evasion, uint16 spare1, uint16 spare2) displayDefenseInfo);
    event Paused(address account);
    event StateEnchantmentsUpdated(address indexed owner, uint256 armorId, tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3) stateEnchantments);
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
    event Unpaused(address account);

    // Functions
    function approve(address operator, uint256 tokenId) payable;
    function balanceOf(address account) view returns (uint256);
    function getApproved(uint256 tokenId) view returns (address);
    function getArmor(uint256 _id) view returns (tuple(uint256 id, tuple(uint8 armorType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 rawPhysDefense, uint16 physDefScalar, uint16 pDefScalarMax, uint16 rawMagicDefense, uint16 magicDefScalar, uint16 mDefScalarMax, uint16 evasion, uint16 spare1, uint16 spare2) displayDefenseInfo, tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3) stateEnchantments, tuple(uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount, uint16 misc1, uint32 misc2, uint32 misc3, uint32 misc4) bonusInfoExtras));
    function getArmors(uint256[] _ids) view returns (tuple(uint256 id, tuple(uint8 armorType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 rawPhysDefense, uint16 physDefScalar, uint16 pDefScalarMax, uint16 rawMagicDefense, uint16 magicDefScalar, uint16 mDefScalarMax, uint16 evasion, uint16 spare1, uint16 spare2) displayDefenseInfo, tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3) stateEnchantments, tuple(uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount, uint16 misc1, uint32 misc2, uint32 misc3, uint32 misc4) bonusInfoExtras)[]);
    function getEquipmentBytes(uint256 _id) view returns (tuple(uint256 id, uint16 equipmentCore, bytes generic1, bytes enchantments, bytes generic3));
    function getStateEnchantments(uint256 _id) view returns (tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3));
    function getUserArmors(address _address) view returns (tuple(uint256 id, tuple(uint8 armorType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 rawPhysDefense, uint16 physDefScalar, uint16 pDefScalarMax, uint16 rawMagicDefense, uint16 magicDefScalar, uint16 mDefScalarMax, uint16 evasion, uint16 spare1, uint16 spare2) displayDefenseInfo, tuple(uint64 equippedTo, uint64 equippableAt, uint16 maxDurability, uint16 durability, uint8 maxRepairs, uint8 remainingRepairs, uint8 equipRequirement, uint8 enchantmentType1, uint8 enchantmentType2, uint8 enchantmentType3, uint16 enchantmentScalar1, uint16 enchantmentScalar2, uint16 enchantmentScalar3) stateEnchantments, tuple(uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount, uint16 misc1, uint32 misc2, uint32 misc3, uint32 misc4) bonusInfoExtras)[]);
    function isApprovedForAll(address account, address operator) view returns (bool);
    function name() view returns (string);
    function ownerOf(uint256 tokenId) view returns (address);
    function pause();
    function paused() view returns (bool);
    function safeTransferFrom(address from, address to, uint256 tokenId) payable;
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) payable;
    function symbol() view returns (string);
    function tokenByIndex(uint256 index) view returns (uint256);
    function tokenOfOwnerByIndex(address owner, uint256 index) view returns (uint256);
    function tokenURI(uint256 tokenId) view returns (string);
    function totalSupply() view returns (uint256);
    function transferFrom(address from, address to, uint256 tokenId) payable;
    function unpause();
    function validateEquipping(tuple(uint256 id, tuple(uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, tuple(uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, tuple(uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) primaryStatGrowth, tuple(uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hpSm, uint16 hpRg, uint16 hpLg, uint16 mpSm, uint16 mpRg, uint16 mpLg) secondaryStatGrowth, tuple(uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing, uint16 craft1, uint16 craft2) professions, tuple(uint256 equippedSlots, uint256 petId, uint256 weapon1Id, uint256 weapon2Id, uint256 offhand1Id, uint256 offhand2Id, uint256 armorId, uint256 accessoryId) equipment) _hero, uint256 _equipmentId, uint8) view returns (bool);
    
}

ABI

Types

Armor

The primary Armor struct contains the item's unique ID on the contract, and three sub-structs that hold the item data.

DisplayDefenseInfo

Name
Type
Description

armorType

The numeric ID defining the armor type (e.g. 1 = Light Armor, etc.)

displayId

uint16

Defines the item's base appearance

rarity

uint16

The item's rarity (0-12). See Rarity.

craftedBy

uint64

The Hero ID of the crafting Hero, or a unique ID for dropped items. See CraftedBy.

dye1

uint8

A unique mapping indicating the primary color variation for some items (0 = no dye). See Dye1.

dye2

uint8

A unique mapping indicating the secondary color variation for some items (0 = no dye). See Dye2.

rawPhysDefense

uint16

The base P.DEF of the armor

physDefScalar

uint16

The scalar value for rawPhysDefense (two-decimal precision multiplier, e.g. 5 = 0.05x)

pDefScalarMax

uint16

The maximum value that can be obtained from the Hero's END * physDefScalar

rawMagicDefense

uint16

The base M.DEF of the armor

magicDefScalar

uint16

The scalar value for rawMagicDefense (two-decimal precision multiplier, e.g. 5 = 0.05x)

mDefScalarMax

uint16

The maximum value that can be obtained from the Hero's WIS * magicDefScalar

evasion

uint16

The base evasion percent granted by the armor. Two-decimal precision with range of -327.67% to 327.67%. Conversion logic is: (1 - 2 * floor(evasion / 32768)) * (evasion % 32768).

spare1

uint16

Currently unused

spare2

uint16

Currently unused

StateEnchantments

Name
Type
Description

equippedTo

uint64

The Hero ID of the Hero that the item is equipped to

equippableAt

uint64

The Unix timestamp when the item is next equippable

maxDurability

uint16

The maximum durability of the item

durability

uint16

The current durability of the item

maxRepairs

uint8

The maximum number of repairs for the item

remainingRepairs

uint8

The remaining number of repairs for the item

equipRequirement

uint8

The Level requirement to equip the item

enchantmentType1

uint8

A mapping of the enchantment type:

  • 0 = no enchantment slot available

  • 1 = empty enchantment slot

enchantmentType2

uint8

A mapping of the enchantment type:

  • 0 = no enchantment slot available

  • 1 = empty enchantment slot

enchantmentType3

uint8

A mapping of the enchantment type:

  • 0 = no enchantment slot available

  • 1 = empty enchantment slot

enchantmentScalar1

uint16

The scalar value of the corresponding enchantment

enchantmentScalar2

uint16

The scalar value of the corresponding enchantment

enchantmentScalar3

uint16

The scalar value of the corresponding enchantment

BonusInfoExtras

Name
Type
Description

bonus1

uint8

A mapping of an item bonus ID (0 = no bonus)

bonus2

uint8

A mapping of an item bonus ID (0 = no bonus)

bonus3

uint8

A mapping of an item bonus ID (0 = no bonus)

bonus4

uint8

A mapping of an item bonus ID (0 = no bonus)

bonus5

uint8

A mapping of an item bonus ID (0 = no bonus)

bonus1Scalar

uint16

The scalar value of the corresponding bonus

bonus2Scalar

uint16

The scalar value of the corresponding bonus

bonus3Scalar

uint16

The scalar value of the corresponding bonus

bonus4Scalar

uint16

The scalar value of the corresponding bonus

bonus5Scalar

uint16

The scalar value of the corresponding bonus

uniqueSettings

uint16

Currently unused

restorationCount

uint8

The number of times the item's remainingRepairs have been restored

misc1

uint16

Currently unused

misc2

uint32

Currently unused

misc3

uint32

Currently unused

misc4

uint32

Currently unused

ArmorType

Armor Type
Value
Usable By

Light

1

  • All Classes

Medium

2

  • Archer

  • Bard

  • Berserker

  • DarkKnight

  • Dragoon

  • DreadKnight

  • Knight

  • Legionnaire

  • Paladin

  • Pirate

  • Shapeshifter

  • SpellBow

  • Warrior

Heavy

3

  • DarkKnight

  • Dragoon

  • DreadKnight

  • Knight

  • Legionnaire

  • Paladin

  • Warrior

All Visages are considered Light Armor, and can by used by any class, regardless of what type of Armor that Hero may be wearing.

Mappings

Armor Details

The armor details correspond to a two-layer mapping by armorType and displayId. Most base data can be found on-chain or through the API. Mappings for additional string data are as follows:

Armor Bonuses

Armor Bonus descriptions correspond to the following mappings. The X in each mapping represents the corresponding bonusScalar value.

Last updated