项目作者: nexus-devs

项目描述 :
Collection of all WoW Classic and The Burning Crusade Classic items, professions, zones and classes
高级语言: JavaScript
项目地址: git://github.com/nexus-devs/wow-classic-items.git
创建时间: 2019-12-17T13:10:04Z
项目社区:https://github.com/nexus-devs/wow-classic-items

开源协议:MIT License

下载


WoW Classic Items

npm
Discord

This project aims to provide a well-rounded WoW Classic database and to make that available for use in your project,
by scraping Wowhead and the official Blizzard API.

Current content:

  • Items (General properties, icons, tooltips, crafting, sources)
  • Professions
  • Zones
  • Classes


Installation

  1. npm install wow-classic-items
  2. or
  3. yarn add wow-classic-items

This package is currently laid out for node.js, as this is what we’re using in production. However, if you need the database available for another language, simply read in the JSON yourself from /data/json


Usage

  1. const Database = require('wow-classic-items')
  2. const items = new Database.Items(options)
  3. const professions = new Database.Professions(options)
  4. const zones = new Database.Zones(options)
  5. const classes = new Database.Classes(options)

items is functionally identical to an array and can be used as such:

  1. items[0] // Returns first item
  2. items.filter((i) => i.class === 'Weapon')
  3. items.map((i) => i.itemId)
  4. items.getItemLink(123468) // Returns copy paste-able ingame link
  5. professions.get('Alchemy') // .get returns specified profession


Item Properties

  1. [{
  2. itemId: 19019, // Unique Item Id
  3. name: 'Thunderfury, Blessed Blade of the Windseeker', // Display name
  4. icon: 'inv_sword_39', // Display icon
  5. class: 'Weapon', // Item class
  6. subclass: 'Sword', // Item subclass, if available
  7. sellPrice: 255355, // Price for what this item can be sold to a vendor
  8. quality: 'Legendary', // Item quality
  9. itemLevel: 80, // Item level
  10. requiredLevel: 60, // Required level for this item
  11. slot: 'One-Hand', // Item slot
  12. tooltip: [Object], // Item tooltip (see below)
  13. itemLink: '|cffff8000|Hitem:19019::::::::::0|h[Thunderfury, Blessed Blade of the Windseeker]|h|r', // Copy-pasteable ingame item link
  14. uniqueName: 'thunderfury-blessed-blade-of-the-windseeker', // Unique item name
  15. contentPhase: 3, // Content phase in which this item becomes available
  16. vendorPrice: 1312, // Weighted vendor price if this item can be bought from a vendor
  17. source: { // Source, either Boss Drop, Rare Drop, Zone Drop or Quest
  18. category: 'Boss Drop',
  19. name: 'Some Random Boss', // Only set on Boss Drop
  20. zone: [209], // Only set on Zone Drop or Boss Drop
  21. dropChance: 0.33, // Only set on Drops
  22. quests: [{ questId: 256, name: 'Some Random Quest', faction: 'Horde' }] // Only set on Quest
  23. }
  24. }, ...]
Tooltip

The tooltip is built the following way:

  1. [{ label: 'Thunderfury, Blessed Blade of the Windseeker', format: 'Legendary' }, ...]

Each label represents one line in the tooltip. The format field specifies if theres a special formatting:

Format Meaning
Quality If there is a quality (Common, Rare, Legendary…) it specifies the corresponding color of the label.
Misc This also refers to the label color: The item level and flavor text.
alignRight This means that the label is aligned inline to the right of the previous label (for example Armor —— Plate).
indent This means that the label is indented and should be treated as if it was quality Poor (for example in set pieces).

Note that the actual sell price is not included in the tooltip (just the label), so you can format it how you want.


Configuration

Option Default Description
iconSrc 'blizzard' Specifies from which source the item icon URL’s are generated. Valid values are 'blizzard', 'wowhead' and false (in this case only the icon name is returned).


Building and Testing

Install Dependencies:

  1. yarn

Create a file called blizzard_token in the root directory and add your Blizzard API Access token

Create directory data/build

  1. mkdir data/build

Build the item database (default output is /data/build/data.json):

  1. yarn build

The professions database is currently handmade.

After that you can validate the build and/or check the changes between yours and the current one with:

  1. yarn validate

Test the item class with:

  1. yarn test




License

MIT