Artifact traits and spell ID's

API Discussion
Hello,

I am trying to retrieve data regarding the artifact weapon, but I am a bit confused.

When I want to retrieve the traits of my weapon, I get something in the lines of this:

"artifactTraits": [{
"id": 1336,
"rank": 1
}, {
"id": 873,
"rank": 3
}, {
"id": 877,
"rank": 1
}, {
"id": 872,
"rank": 3
}, {
"id": 874,
"rank": 4
}, {
"id": 875,
"rank": 4
}, {
"id": 878,
"rank": 1
}, {
"id": 869,
"rank": 1
}],


But those ID's don't seem to be found anywhere among the spells. For example, Hati's Bond spell ID is 197344, but that id is not shown among the list of traits of my weapon. I found that the ID of that spell can be found inside the item API (in my case, the Titanstrike with ID 128861), but that seems to be the only trait that is defined there:

"itemSpells": [{
"spellId": 197886,
"spell": {
"id": 197886,
"name": "7.0 Artifacts - All Weapons - General Weapon Equipped Passive (CSA)",
"icon": "trade_archaeology_nerubian_artifactfragment",
"description": "",
"castTime": "Passive"
},
"nCharges": 0,
"consumable": false,
"categoryId": 0,
"trigger": "ON_EQUIP"
}, {
"spellId": 212009,
"spell": {
"id": 212009,
"name": "Titanstrike",
"icon": "trade_engineering",
"description": "",
"range": "100 yd range",
"castTime": "Instant",
"cooldown": "1.5 sec cooldown"
},
"nCharges": 0,
"consumable": false,
"categoryId": 0,
"trigger": "ON_LOOTED"
}, {
"spellId": 197344,
"spell": {
"id": 197344,
"name": "Hati's Bond",
"icon": "ability_hunter_ferociousinspiration",
"description": "Hati will now fight for you as a companion.",
"castTime": "Passive"
},
"nCharges": 0,
"consumable": false,
"categoryId": 0,
"trigger": "ON_EQUIP"
}],


How can I retrieve data regarding the traits on the artifact weapon (like the name, icon, description) and link them to my character data?

Could someone explain me? Thank you (sorry for my poor english).
Here's a JSON file to map traits and ranks to spell IDs.
https://gist.github.com/erorus/06eda88ed9eaf18ad7b4c9cf62eda528

For example, trait 873 rank 3 is spell 197140. Pop that into:
https://us.api.battle.net/wow/spell/197140?apikey=<key>
and get:
{
"id": 197140,
"name": "Spitting Cobras",
"icon": "ability_hunter_snaketrap",
"description": "Increases damage dealt by Cobra Shot by 3%.",
"castTime": "Passive"
}

For some traits, the rank alters the description in ways the spell API doesn't support, but it'll get you close.
Thank you very much @erorus.

Was there a reason for which artifact traits id's needed to be different than the spell id's?
Hey Erorus, how did you gather that data? I'd love to know so I can help point other users in the right direction in the future -- giving someone a pile of fish vs. teaching them to fish, ya know?

ヽ(  ̄∇ ̄)人( ̄∇ ̄ )ノ
there is no data from blizzard i've found for this data. our site did it by hand..

grab ids from users, check what traits they had and their rank.
compare that data to other users of the same class.

repeat.. :(
09/21/2016 10:37 AMPosted by Aurifex
Hey Erorus, how did you gather that data? I'd love to know so I can help point other users in the right direction in the future -- giving someone a pile of fish vs. teaching them to fish, ya know?

ヽ(  ̄∇ ̄)人( ̄∇ ̄ )ノ


You're not gonna like it. You'll need a CASC extractor to grab DBFilesClient\ArtifactPowerRank.db2, and my handy DB2 reader PHP class on Github.

<?php

require_once __DIR__ . '/src/autoload.php';

use \Erorus\DB2\Reader;

$reader = new Reader('ArtifactPowerRank.db2');
$reader->setFieldNames([
'spell',
'effectpoints',
'power',
'unk',
'rank',
]);

$j = [];
foreach ($reader->generateRecords() as $record) {
$j[$record['power']][$record['rank']] = $record['spell'];
}
ksort($j);
echo str_replace('}', "\n}",
preg_replace('/"\d+"/', "\n\$0", json_encode($j)));
Figured it was either something like that or some an addon that dumped data. Alas, it is what it is. Assuming you've got no objection, I'm going to add your dump to the Community Created Libraries and Resources thread.

EDIT: Forgot to say, I'll ask about getting this data exposed via an API.
On WoW Client you can run this code to get the details:

/run for p=1,1500 do local spellId,_,_,maxRank,_,x,y,_,isStart,isGoldMedal,isFinal = C_ArtifactUI.GetPowerInfo(p); if (spellId ~= nil) then print(p, spellId, maxRank, x, y, isStart, isGoldMedal, isFinal) end end;

Join the Conversation

Return to Forum