Weapons
Contracts
Addresses
Interface
interface IWeaponCoreDiamond {
event Approval(address indexed owner, address indexed operator, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
event BonusInfoPhysicalAttackUpdated(address indexed owner, uint256 weaponId, (uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 baseDamage, uint8 accuracyRequirement, uint16 pAccuracyAtRequirement, uint8 pScalarStat1, uint8 pScalarStat2, uint8 pScalarStat3, uint8 pScalarValue1, uint8 pScalarValue2, uint8 pScalarValue3, uint16 pScalarMax1, uint16 pScalarMax2, uint16 pScalarMax3, uint16 uniqueSettings, uint8 speedModifier) bonusInfoPhysicalAttack);
event DisplayInfoMagicAttackUpdated(address indexed owner, uint256 weaponId, (uint8 weaponType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 basePotency, uint8 focusRequirement, uint16 mAccuracyAtRequirement, uint8 mScalarStat1, uint8 mScalarStat2, uint8 mScalarStat3, uint8 mScalarValue1, uint8 mScalarValue2, uint8 mScalarValue3, uint16 mScalarMax1, uint16 mScalarMax2, uint16 mScalarMax3, uint8 restorationCount) displayInfoMagicAttack);
event StateEnchantmentsUpdated(address indexed owner, uint256 weaponId, (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 WeaponCreated(address indexed owner, uint256 indexed weaponId, (uint256 id, (uint8 weaponType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 basePotency, uint8 focusRequirement, uint16 mAccuracyAtRequirement, uint8 mScalarStat1, uint8 mScalarStat2, uint8 mScalarStat3, uint8 mScalarValue1, uint8 mScalarValue2, uint8 mScalarValue3, uint16 mScalarMax1, uint16 mScalarMax2, uint16 mScalarMax3, uint8 restorationCount) displayInfoMagicAttack, (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, (uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 baseDamage, uint8 accuracyRequirement, uint16 pAccuracyAtRequirement, uint8 pScalarStat1, uint8 pScalarStat2, uint8 pScalarStat3, uint8 pScalarValue1, uint8 pScalarValue2, uint8 pScalarValue3, uint16 pScalarMax1, uint16 pScalarMax2, uint16 pScalarMax3, uint16 uniqueSettings, uint8 speedModifier) bonusInfoPhysicalAttack) weapon);
event WeaponUpdated(address indexed owner, uint256 indexed weaponId, (uint256 id, (uint8 weaponType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 basePotency, uint8 focusRequirement, uint16 mAccuracyAtRequirement, uint8 mScalarStat1, uint8 mScalarStat2, uint8 mScalarStat3, uint8 mScalarValue1, uint8 mScalarValue2, uint8 mScalarValue3, uint16 mScalarMax1, uint16 mScalarMax2, uint16 mScalarMax3, uint8 restorationCount) displayInfoMagicAttack, (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, (uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 baseDamage, uint8 accuracyRequirement, uint16 pAccuracyAtRequirement, uint8 pScalarStat1, uint8 pScalarStat2, uint8 pScalarStat3, uint8 pScalarValue1, uint8 pScalarValue2, uint8 pScalarValue3, uint16 pScalarMax1, uint16 pScalarMax2, uint16 pScalarMax3, uint16 uniqueSettings, uint8 speedModifier) bonusInfoPhysicalAttack) weapon);
// View Functions
function balanceOf(address account) view returns (uint256);
function getApproved(uint256 tokenId) view returns (address);
function getStateEnchantments(uint256 _id) view returns ((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 getUserWeaponIds(address _address) view returns (uint256[]);
function getUserWeapons(address _address) view returns ((uint256 id, (uint8 weaponType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 basePotency, uint8 focusRequirement, uint16 mAccuracyAtRequirement, uint8 mScalarStat1, uint8 mScalarStat2, uint8 mScalarStat3, uint8 mScalarValue1, uint8 mScalarValue2, uint8 mScalarValue3, uint16 mScalarMax1, uint16 mScalarMax2, uint16 mScalarMax3, uint8 restorationCount) displayInfoMagicAttack, (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, (uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 baseDamage, uint8 accuracyRequirement, uint16 pAccuracyAtRequirement, uint8 pScalarStat1, uint8 pScalarStat2, uint8 pScalarStat3, uint8 pScalarValue1, uint8 pScalarValue2, uint8 pScalarValue3, uint16 pScalarMax1, uint16 pScalarMax2, uint16 pScalarMax3, uint16 uniqueSettings, uint8 speedModifier) bonusInfoPhysicalAttack)[]);
function getWeapon(uint256 _id) view returns ((uint256 id, (uint8 weaponType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 basePotency, uint8 focusRequirement, uint16 mAccuracyAtRequirement, uint8 mScalarStat1, uint8 mScalarStat2, uint8 mScalarStat3, uint8 mScalarValue1, uint8 mScalarValue2, uint8 mScalarValue3, uint16 mScalarMax1, uint16 mScalarMax2, uint16 mScalarMax3, uint8 restorationCount) displayInfoMagicAttack, (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, (uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 baseDamage, uint8 accuracyRequirement, uint16 pAccuracyAtRequirement, uint8 pScalarStat1, uint8 pScalarStat2, uint8 pScalarStat3, uint8 pScalarValue1, uint8 pScalarValue2, uint8 pScalarValue3, uint16 pScalarMax1, uint16 pScalarMax2, uint16 pScalarMax3, uint16 uniqueSettings, uint8 speedModifier) bonusInfoPhysicalAttack));
function getWeapons(uint256[] _ids) view returns ((uint256 id, (uint8 weaponType, uint16 displayId, uint8 rarity, uint64 craftedBy, uint8 dye1, uint8 dye2, uint16 basePotency, uint8 focusRequirement, uint16 mAccuracyAtRequirement, uint8 mScalarStat1, uint8 mScalarStat2, uint8 mScalarStat3, uint8 mScalarValue1, uint8 mScalarValue2, uint8 mScalarValue3, uint16 mScalarMax1, uint16 mScalarMax2, uint16 mScalarMax3, uint8 restorationCount) displayInfoMagicAttack, (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, (uint8 bonus1, uint8 bonus2, uint8 bonus3, uint8 bonus4, uint16 bonusScalar1, uint16 bonusScalar2, uint16 bonusScalar3, uint16 bonusScalar4, uint16 baseDamage, uint8 accuracyRequirement, uint16 pAccuracyAtRequirement, uint8 pScalarStat1, uint8 pScalarStat2, uint8 pScalarStat3, uint8 pScalarValue1, uint8 pScalarValue2, uint8 pScalarValue3, uint16 pScalarMax1, uint16 pScalarMax2, uint16 pScalarMax3, uint16 uniqueSettings, uint8 speedModifier) bonusInfoPhysicalAttack)[]);
function isApprovedForAll(address account, address operator) view returns (bool);
function name() view returns (string);
function ownerOf(uint256 tokenId) view returns (address);
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 validateEquipmentVisageTypeMatch(uint256 _equipmentId, uint256 _visageId) view returns (bool);
function validateEquipping((uint256 id, (uint256 summonedTime, uint256 nextSummonTime, uint256 summonerId, uint256 assistantId, uint32 summons, uint32 maxSummons) summoningInfo, (uint256 statGenes, uint256 visualGenes, uint8 rarity, bool shiny, uint16 generation, uint32 firstName, uint32 lastName, uint8 shinyStyle, uint8 class, uint8 subClass) info, (uint256 staminaFullAt, uint256 hpFullAt, uint256 mpFullAt, uint16 level, uint64 xp, address currentQuest, uint8 sp, uint8 status) state, (uint16 strength, uint16 intelligence, uint16 wisdom, uint16 luck, uint16 agility, uint16 vitality, uint16 endurance, uint16 dexterity, uint16 hp, uint16 mp, uint16 stamina) stats, (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, (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, (uint16 mining, uint16 gardening, uint16 foraging, uint16 fishing, uint16 craft1, uint16 craft2) professions, (uint256 equippedSlots, uint256 petId, uint128 weapon1Id, uint128 weapon1VisageId, uint128 weapon2Id, uint128 weapon2VisageId, uint128 offhand1Id, uint128 offhand1VisageId, uint128 offhand2Id, uint128 offhand2VisageId, uint128 armorId, uint128 armorVisageId, uint128 accessoryId, uint128 accessoryVisageId) equipment) _hero, uint256 _equipmentId, uint8 _slot) view returns (bool);
// State-Changing Functions
function approve(address operator, uint256 tokenId) payable;
function safeTransferFrom(address from, address to, uint256 tokenId) payable;
function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) payable;
function setApprovalForAll(address operator, bool status);
function transferFrom(address from, address to, uint256 tokenId) payable;
}
ABI
Types
Weapon
The primary Weapon
struct contains the item's unique ID on the contract, and three sub-structs that hold the item data.
struct Weapon {
uint256 id;
DisplayInfoMagicAttack displayInfoMagicAttack;
StateEnchantments stateEnchantments;
BonusInfoPhysicalAttack bonusInfoPhysicalAttack;
}
DisplayInfoMagicAttack
struct DisplayInfoMagicAttack {
WeaponType weaponType;
uint16 displayId;
uint8 rarity;
uint64 craftedBy;
uint8 dye1;
uint8 dye2;
uint16 basePotency;
uint8 focusRequirement;
uint16 mAccuracyAtRequirement;
uint8 mScalarStat1;
uint8 mScalarStat2;
uint8 mScalarStat3;
uint8 mScalarValue1;
uint8 mScalarValue2;
uint8 mScalarValue3;
uint16 mScalarMax1;
uint16 mScalarMax2;
uint16 mScalarMax3;
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;
}
BonusInfoPhysicalAttack
struct BonusInfoPhysicalAttack {
uint8 bonus1;
uint8 bonus2;
uint8 bonus3;
uint8 bonus4;
uint16 bonusScalar1;
uint16 bonusScalar2;
uint16 bonusScalar3;
uint16 bonusScalar4;
uint16 baseDamage;
uint8 accuracyRequirement;
uint16 pAccuracyAtRequirement;
uint8 pScalarStat1;
uint8 pScalarStat2;
uint8 pScalarStat3;
uint8 pScalarValue1;
uint8 pScalarValue2;
uint8 pScalarValue3;
uint16 pScalarMax1;
uint16 pScalarMax2;
uint16 pScalarMax3;
uint16 uniqueSettings;
uint8 speedModifier;
}
WeaponType
enum WeaponType {
None,
OneHandedAxe,
TwoHandedAxe,
Bow,
Dagger,
Gloves,
OneHandedMace,
TwoHandedMace,
OneHandedSpear,
TwoHandedSpear,
Staff,
OneHandedSword,
TwoHandedSword,
Wand
}
Mappings
Weapon Details
The weapon details correspond to a two-layer mapping by weaponType
and displayId
. Most base data can be found on-chain or through the API. Mappings for additional string data are as follows:
{
"2": {
"1": {
"name": "Gore Axe",
"description": "A formidable axe fashioned from the spine and rib cage of a mighty boar."
},
"2": {
"name": "Savage Axe",
"description": "A double blade made from battlefield salvage and attached to a bedpost."
},
"3": {
"name": "Bronze Half-Moon Axe",
"description": "A peculiar bronze great-axe that is conveniently shaped for digging graves..."
},
"4": {
"name": "Squire's Halbard",
"description": "A favorite for castle-guards, the giant halberd doubles as a combat deterrant."
}
},
"3": {
"1": {
"name": "Gore Bow",
"description": "A crude recurve bow fashioned from the bones of a mighty boar."
},
"2": {
"name": "Stick 'n String",
"description": "A crude branch-bow with leaves (and berries?) still attached. Blubs beware!"
},
"3": {
"name": "Maple Longbow",
"description": "A stiff bow made of treated maple wood. A bun-hunter's dream!"
},
"4": {
"name": "Squire's Recurve Bow",
"description": "A standard military-issue recurve bow, strung to provide additonal energy on release."
},
"5": {
"name": "Gore Longbow",
"description": "A crude recurve longbow fashioned from the bones of a mighty boar."
}
},
"4": {
"1": {
"name": "Flint Knife",
"description": "Technically a knife, but more accurately a bit of sharp flint attached to a handle with string."
},
"2": {
"name": "Bronze Gladius",
"description": "A bronze small-sword. A popular weapon for gladiators."
},
"3": {
"name": "Squire's Dagger",
"description": "A handy iron dagger designed sturdy for parrying and stabbing."
},
"50000": {
"name": "Gardening Trowel",
"description": "This perfectly balanced gardening trowel has been sharpened to a fine point. Dig a hole and bury your enemies in the dirt!"
}
},
"5": {
"1": {
"name": "Wooden Knuckles",
"description": "Protect your fists with something slightly softer than your fists!"
},
"2": {
"name": "Bronze Caesti",
"description": "Heavy bronze plated gloves reinforced for punching armor."
},
"3": {
"name": "Squire's Gloves",
"description": "Comfortable fitted gloves with sharpened iron knuckle reinforcements."
}
},
"6": {
"1": {
"name": "Driftwood Shillelagh",
"description": "Colloquially known as a bonk-stick, it gets the job done... if the job is bonking."
},
"2": {
"name": "Maple Club",
"description": "A favorite among trolodytes and goblins."
},
"3": {
"name": "Squire's Mace",
"description": "A hard iron mace designed to concuss beasts and men alike."
}
},
"8": {
"1": {
"name": "Sharpened Stick",
"description": "It's a stick. Try not to poke your eye out."
},
"2": {
"name": "Bronze Shortspear",
"description": "A bronze bladed spear that can be easily wielded with a shield."
},
"3": {
"name": "Squire's Light Spear",
"description": "A sharp tipped iron shortspear that is light enough to use with one hand."
}
},
"9": {
"1": {
"name": "Driftwood Pike",
"description": "Someone has sharpened a shabby piece of driftwood for some reason."
},
"2": {
"name": "Bronze Longspear",
"description": "A bronze spear with a triangular blade. Long enough to get the job done."
},
"3": {
"name": "Squire's Heavy Spear",
"description": "An iron longspear that really helps get your point across."
}
},
"10": {
"1": {
"name": "Gore Staff",
"description": "A long and savage staff fashioned out of several bones bound with tanned leather."
},
"2": {
"name": "Gnarled Staff",
"description": "A long knobby tree branch that has been whittled down and taped for comfort."
},
"3": {
"name": "Maple Staff",
"description": "A wooden staff that forks to hold an orb of natural peridot. Great for beginners!"
},
"4": {
"name": "Squire's Staff",
"description": "A sturdy staff with metal embellishments and topped with an amethyst focus."
},
"50000": {
"name": "Walking Stick",
"description": "A sturdy and perfectly balanced oak walking stick. An essential accessory for lengthy foraging trips or fighting off territorial basilisks."
}
},
"11": {
"1": {
"name": "Gore Blade",
"description": "A blade fashioned from the sharpened rib bone of a massive boar."
},
"2": {
"name": "Toy Sword",
"description": "A hastily assembled dull wooden sword. Strikes fear into schoolyard bullies!"
},
"3": {
"name": "Bronze Spatha",
"description": "A broad blade of bronze with a heavy pommel and good balance."
},
"4": {
"name": "Squire's Sword",
"description": "A plain looking iron longsword with a crossguard."
},
"50000": {
"name": "Fishing Rod",
"description": "A sleek fishing rod designed for two purposes: catching fish and kicking ass. And you already caught all the fish."
}
},
"12": {
"1": {
"name": "Eggscalibur",
"description": "A finely crafted greatsword fashioned from the sturdy, sharpened feathers of a hardened rocboc."
},
"2": {
"name": "Igneous Butcher",
"description": "As a joke someone has attached a boulder to a sword hilt. Hard to swing."
},
"3": {
"name": "Bronze Greatsword",
"description": "An extremely heavy bronze blade forged in a single mold, blade and all."
},
"4": {
"name": "Squire's Greatsword",
"description": "A well-crafted iron claymore. The handle is long enough to hold in both hands."
}
},
"13": {
"1": {
"name": "Demon's Drumstick",
"description": "A true oddity of craftsmanship that is equally mouth-watering and powerful."
},
"2": {
"name": "Gnarled Wand",
"description": "A suspicious wand. Why do all the nearby trees seem so bare?"
},
"3": {
"name": "Maple Wand",
"description": "A lacquered maple branch fitted with a small peridot for focusing magic."
},
"4": {
"name": "Squire's Wand",
"description": "An amethyst topped wand. It looks sturdy."
}
}
}
Weapon Bonuses
Weapon Bonus descriptions correspond to the following mappings. The X
in each mapping represents the corresponding bonusScalar
value.
{
1: "Gain X% chance to inflict Banish on hit",
2: "Gain X% chance to inflict Bleed on hit",
3: "Gain X% chance to inflict Blind on hit",
4: "Gain X% chance to inflict Burn on hit",
5: "Gain X% chance to inflict Chill on hit",
6: "Gain X% chance to inflict Confuse on hit",
7: "Gain X% chance to inflict Daze on hit",
8: "Gain X% chance to inflict Disarm on hit",
9: "Gain X% chance to inflict Fear on hit",
10: "Gain X% chance to inflict Intimidate on hit",
11: "Gain X% chance to inflict Poison on hit",
12: "Gain X% chance to inflict Pull on hit",
13: "Gain X% chance to inflict Push on hit",
14: "Gain X% chance to inflict Silence on hit",
15: "Gain X% chance to inflict Sleep on hit",
16: "Gain X% chance to inflict Slow on hit",
17: "Gain X% chance to inflict Stun on hit",
18: "Gain X% chance to inflict Taunt on hit",
19: "Gain X% chance to inflict Daze on basic attack when targeting a channeling enemy",
20: "Increase Block chance by +X%",
21: "Increase Spell Block chance by +X%",
22: "Increase Critical Hit damage multiplier by +X",
23: "Increase Critical Hit chance by +X%",
24: "Critical Hits gain X% Lifesteal",
25: "Gain X% Pierce",
26: "Increase Block damage reduction by X%",
27: "Increase Spell Block damage reduction by X%",
28: "Increase Magical Damage dealt and reduce Healing Potency by X% each",
29: "Increase Healing Potency and reduce Magical Damage dealt by X% each",
30: "Decrease Physical and Magical Defense by X% each"
}
See Also
Last updated