Git Product home page Git Product logo

wow-classic-items's Introduction

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

Currently used in production over at:

NexusHub Twinktool

Installation

npm install 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

const Database = require('wow-classic-items')

const items = new Database.Items(options)
const professions = new Database.Professions(options)
const zones = new Database.Zones(options)
const classes = new Database.Classes(options)

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

items[0] // Returns first item
items.filter((i) => i.class === 'Weapon')
items.map((i) => i.itemId)

items.getItemLink(123468) // Returns copy paste-able ingame link
professions.get('Alchemy') // .get returns specified profession

Item Properties

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

The tooltip is built the following way:

[{ 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:

npm install

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

Create directory data/build

mkdir data/build

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

npm run 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:

npm run validate

Test the item class with:

npm test


License

MIT

wow-classic-items's People

Contributors

nakroma avatar albri avatar aylrob avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.