Accessories

The AccessoryCore contract holds NFTs and data for items that are used in both the Offhand1 and Offhand2 Hero Equipment slots, as well as the Accessory slot. Both of these item types share the same base types.

Contracts

Addresses

Interface

interface IAccessoryCoreDiamond {

    // Events
    event AccessoryCreated(address indexed owner, uint256 indexed accessoryId, tuple(uint256 id, tuple(uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount) displayBonusInfo, 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) accessory);
    event AccessoryUpdated(address indexed owner, uint256 indexed accessoryId, tuple(uint256 id, tuple(uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount) displayBonusInfo, 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) accessory);
    event Approval(address indexed owner, address indexed operator, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
    event DisplayBonusInfoUpdated(address indexed owner, uint256 accessoryId, tuple(uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount) displayBonusInfo);
    event Paused(address account);
    event StateEnchantmentsUpdated(address indexed owner, uint256 accessoryId, 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 getAccessories(uint256[] _ids) view returns (tuple(uint256 id, tuple(uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount) displayBonusInfo, 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)[]);
    function getAccessory(uint256 _id) view returns (tuple(uint256 id, tuple(uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount) displayBonusInfo, 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));
    function getApproved(uint256 tokenId) view returns (address);
    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 getUserAccessories(address _address) view returns (tuple(uint256 id, tuple(uint8 equipmentType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint8 bonus5, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 bonusScalar5, uint16 uniqueSettings, uint8 restorationCount) displayBonusInfo, 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)[]);
    function getUserAccessoryIds(address _address) view returns (uint256[]);
    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();

}

ABI

Types

Accessory

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

struct Accessory {
    uint256 id;
    DisplayBonusInfo displayBonusInfo;
    StateEnchantments stateEnchantments;
}

DisplayBonusInfo

struct DisplayBonusInfo {
    EquipmentType equipmentType;
    uint16 displayId;
    uint8 rarity;
    uint64 craftedBy;
    uint8 dye1;
    uint8 dye2;
    uint8 bonus1;
    uint8 bonus2;
    uint8 bonus3;
    uint8 bonus4;
    uint8 bonus5;
    uint16 bonusScalar1;
    uint16 bonusScalar2;
    uint16 bonusScalar3;
    uint16 bonusScalar4;
    uint16 bonusScalar5;
    uint16 uniqueSettings;
    uint8 restorationCount;
}

StateEnchantments

struct StateEnchantments {
    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;
}

EquipmentType

enum EquipmentType {
    None,
    Accessory,
    Shield,
    Focus
}

Mappings

Equipment Details

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

{
  "1": {
    "1": {
      "name": "Skali's Eye",
      "description": "An ancient medallion fashioned from the fragments of an emerald blessed by Skali herself. Your vision seems to sharpen while wearing it..."
    },
    "2": {
      "name": "Tal's Curio",
      "description": "A silver medallion worn by Tal's Disciples that wards off evil."
    },
    "3": {
      "name": "Elgrin's Aegis",
      "description": "Elgrin's High Priests were considered invulnerable in battle while wielding enchanted totems. Similarly, this Aegis hardens the skin of anyone who wears it."
    },
    "4": {
      "name": "Secondhand Pants",
      "description": "A fine pair of pre-digested pants. They're a bit loose around the waist."
    },
    "5": {
      "name": "Charger's Mask",
      "description": "Even with decreased visibility, this mask fills the wearer with an overpowering thirst for vengeance. Its style could most appropriately be categorized as \"crazy chic\"."
    },
    "6": {
      "name": "Conical Cap of Remembrance",
      "description": "A ceremonial hat worn at parties, celebrations and, less appropriately, in battle."
    },
    "7": {
      "name": "Gored Gourd",
      "description": "A gourd gored by a bored boar."
    },
    "8": {
      "name": "Ring of Dueling",
      "description": "A lustrous gold ring which surrounds its wearer with a palpable aura of luck."
    },
    "9": {
      "name": "Bronze Champion's Crown",
      "description": "A prized emerald-hued crown awarded to the Duel Champion with the third-longest Champion streak for the season. Heroes adorned with this accessory seem to have greater control over their environments."
    },
    "10": {
      "name": "Silver Champion's Crown",
      "description": "A prized royal blue crown awarded to the Duel Champion with the second-longest Champion streak for the season. Heroes adorned with this accessory seem to have greater control over their environments."
    },
    "11": {
      "name": "Gold Champion's Crown",
      "description": "A prized burgundy crown awarded to the Duel Champion with the longest Champion streak for the season. Heroes adorned with this accessory appear to have greater control over their environments."
    },
    "12": {
      "name": "Champion's Medal",
      "description": "A badge of honor for those brave enough to claim it and a warning for those foolish enough to challenge them."
    },
    "13": {
      "name": "Cooler Head",
      "description": "Its wearers always seem to prevail."
    },
    "14": {
      "name": "Boc-Knight Helm",
      "description": "This protective headgear fashioned from the beak of a mighty rocboc fills its wearer with the inexplicable urge to peck."
    },
    "15": {
      "name": "Ancient Wood Dragon Mask",
      "description": "This lovingly crafted mask celebrates the enduring spirit of Gaia's fierce and primal dragon warriors from ages long past."
    },
    "16": {
      "name": "Bunbun Bonnet",
      "description": "An exquisite bonnet made from the finest faux fur and featured in Yara's latest line of bunbun fashions."
    },
    "50000": {
      "name": "Bloater Mask",
      "description": "This iconic fish mask exudes an air of sophistication and mystique. No bloaters were harmed in the making of this item."
    },
    "50001": {
      "name": "Plague Mask",
      "description": "A clever mask designed to keep the plague out and the good vibes in."
    },
    "50002": {
      "name": "Super Blub Defender: Red Mask",
      "description": "A mask made by the Super Blub Defender (SBD) Fan Club. This one represents the Red Defender, who is known for his bravery, virtue, and mastery of Togwan-do."
    },
    "50003": {
      "name": "Super Blub Defender: Pink Mask",
      "description": "A mask made by the Super Blub Defender (SBD) Fan Club. This one represents the Pink Defender, who is known for her biting wit, nibbling charm, and chomping mastication."
    },
    "50009": {
      "name": "Chef Hat",
      "description": "A chef should always be prepared for furious fighting or fierce fileting. This is the perfect hat for adventures both in and out of the kitchen."
    },
    "50010": {
      "name": "Dark Summoner Mask",
      "description": "When they're not sacrificing Heroes in a nonstop stream of dark rituals that push Gaia further and further towards an inescapable corruption, the Dark Summoner is looking fit and fancy-free in this sleek mask wrap."
    },
    "50011": {
      "name": "Rolando Mask",
      "description": "Show your Rolando pride by walking a mile in his head! Perfect for adding a ribbit of fun to any occasion."
    },
    "50012": {
      "name": "Doug Hype Shades",
      "description": "Get a fresh view of the world with these stylish, hype-tinted glasses."
    }
  },
  "2": {
    "1": {
      "name": "Yolked Bockler",
      "description": "A mysterious shield whose dubious origin raises questions about its durability and usefulness."
    }
  }
}

Accessory Bonuses

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

For Bonuses with both X and Y values, these are determined by using bitwise operators against the uint16 bonusScalar value as follows:

  • X = bonusScalar & 255

  • Y = bonusScalar >> 8

{
    1: "Increase Physical Accuracy by +X%",
    2: "Increase Magical Accuracy by +X%",
    3: "Increase Block chance by +X%",
    4: "Increase Spell Block chance by +X%",
    5: "Increase Speed by X%",
    6: "Increase Evasion by X%",
    7: "Increase Status Effect Resistance by +X%",
    8: "Increase Banish Resistance by +X%",
    9: "Increase Bleed Resistance by +X%",
    10: "Increase Blind Resistance by +X%",
    11: "Increase Burn Resistance by +X%",
    12: "Increase Chill Resistance by +X%",
    13: "Increase Confuse Resistance by +X%",
    14: "Increase Daze Resistance by +X%",
    15: "Increase Disarm Resistance by +X%",
    16: "Increase Fear Resistance by +X%",
    17: "Increase Intimidate Resistance by +X%",
    18: "Increase Poison Resistance by +X%",
    19: "Increase Pull Resistance by +X%",
    20: "Increase Push Resistance by +X%",
    21: "Increase Silence Resistance by +X%",
    22: "Increase Sleep Resistance by +X%",
    23: "Increase Slow Resistance by +X%",
    24: "Increase Stun Resistance by +X%",
    25: "Increase Taunt Resistance by +X%",
    26: "Increase Critical Hit Multiplier by +X",
    27: "Increase Physical Defense by +X%",
    28: "Increase Magical Defense by +X%",
    29: "Decrease Physical Accuracy by -X%",
    30: "Decrease Magical Accuracy by -X%",
    31: "Increase Physical Damage by +X%",
    32: "Increase Magical Damage by +X%",
    33: "Gain +X% Riposte",
    230: "Add +X to Duel Score when Dueling",
    231: "Gain a roll for +X-Y added to Duel Score when Dueling",
    232: "Gain +X% chance for matching background to appear when defending Duel champion",
    233: "Add +X to Duel Score when defending Duel champion",
    234: "Gain a roll for +X-Y added to Duel Score when defending Duel champion"
}

Offhand Bonuses

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

{
    1: "Increase Block chance by +X%",
    2: "Increase Block damage reduction by +X%",
    3: "Increase Spell Block chance by +X%",
    4: "Increase Spell Block damage reduction by +X%",
    5: "Gain +X% Riposte"
}

Last updated