Accessories
Last updated
Last updated
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.
Name | Mainnet | Testnet |
---|---|---|
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();
}
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;
}
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;
}
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;
}
enum EquipmentType {
None,
Accessory,
Shield,
Focus
}
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."
},
"17": {
"name": "Melville's Spectacular Spectacles",
"description": "A truly spectacular feat of engineering, these unique spectacles provide modest protection from the sun and a myriad of sharp objects."
},
"18": {
"name": "Mister Birthday",
"description": "An austere cake that exudes confidence and longevity. A strange force seems to invite you to place it atop your head."
},
"19": {
"name": "Swearing Hat",
"description": "On cold, moonless nights, this hat whispers curses in a long-forgotten tongue."
},
"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."
},
"50004": {
"name": "Super Blub Defender: Blue Mask",
"description": "A mask made by the Super Blub Defender (SBD) Fan Club. This one represents the Blue Defender, who is known for his honesty, compassion, and excellent taste in music."
},
"50005": {
"name": "Super Blub Defender: Yellow Mask",
"description": "A mask made by the Super Blub Defender (SBD) Fan Club. This one represents the Yellow Defender, who is known for her lucky dodges, uncanny lunges, and otherwordly Bloater cakes."
},
"50006": {
"name": "Super Blub Defender: Black Mask",
"description": "A mask made by the Super Blub Defender (SBD) Fan Club. This one represents the Black Defender, who is known for his firm handshake, next-level stealth, and unprompted backflips."
},
"50008": {
"name": "Yellow Panther Mask",
"description": "The mysterious Yellow Panther Clan lives and fights in the shadows. Don their ceremonial mask and join the movement."
},
"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."
},
"50013": {
"name": "Big Red Bear Head",
"description": "It's big, it's red, it's beautiful! Don this furry fashion statement before battle for a healthy dose of ursine intimidation."
},
"50014": {
"name": "Frost Bloater Mask",
"description": "Cold as ice and twice as nice, this frozen fish mask channels the least threatening creature in the frozen tundras of Crystalvale."
},
"50015": {
"name": "Axolotl Mask",
"description": "A musty Axolotl mask with bulging eyes that has gained popularity amongst certain fringe groups. It is very... pink."
},
"50016": {
"name": "Crown of Wisdom",
"description": "A laurel leaf crown of immense power that imbues wisdom and light."
}
},
"2": {
"1": {
"name": "Yolked Bockler",
"description": "A mysterious shield whose dubious origin raises questions about its durability and usefulness."
},
"2": {
"name": "Cutting Board",
"description": "Repurposed wooden planks trying to pass as a shield."
},
"3": {
"name": "Bronze Shield",
"description": "A bronze round-shield with gaps designed to allow a spear or sword to pass through comfortably."
},
"4": {
"name": "Squire's Shield",
"description": "A simple heater shield made of iron. Blocks everything but criticism."
}
}
}
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 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"
}
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Value | Description | Type | Usable By |
---|---|---|---|---|