npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@buildwars/gw-skilldata

v2.0.0

Published

Guild Wars skill data

Readme

build-wars/gw-skilldata

Guild Wars skill data and skill descriptions for use with template decoders, e.g. in BBCode, Wikis etc.

PHP Version Support Packagist version NPM version License Continuous Integration Coverage Packagist downloads

Overview

Features

  • Guild Wars skill data
    • Skill descriptions for English and German
    • Skill databases for paw·ned²
  • Toolset to add other translations (hopefully maybe)

Most of the release files are built on each push and hosted on GitHub pages: https://github.com/build-wars/gw-skilldata

Requirements

  • PHP 8.1+

alternatively:

  • Javascript
    • node.js >= 24
    • a web browser

Documentation

PHP: Installation with composer

Terminal

composer require buildwars/gw-skilldata

composer.json

{
	"require": {
		"php": "^8.1",
		"buildwars/gw-skilldata": "^2.0"
	}
}

Note: check the releases for valid versions.

JS: Installation with npm

Terminal

npm install @buildwars/gw-skilldata

package.json

{
	"dependencies": {
		"@buildwars/gw-skilldata": "^2.0"
	}
}

Quickstart

PHP

use Buildwars\GWSkillData\SkillDataAwareInterface;
use Buildwars\GWSkillData\SkillDataAwareTrait;
use Buildwars\GWSkillData\SkillDataInterface;
use Buildwars\GWSkillData\SkillLangEnglish;

class MyClass implements SkillDataAwareInterface{
	use SkillDataAwareTrait;

	protected SkillDataInterface $skillDataEnglish;

	public function __construct(string $lang){
		// set the language and initialize $this->skillData
		$this->setSkillDataLanguage($lang);

		// alternatively, you can simply invoke one of the skill language instances
		$this->skillDataEnglish = new SkillLangEnglish;
	}

	public function getSkill(int $skillID, bool $pvp):mixed{
		// $this->skillData is now available
		$data = $this->skillData->get($skillID, $pvp);

		// do stuff with the $data array
		var_dump($data->id);
	}

}

JavaScript :coffee:

JavaScript doesn't have traits, so you will need to implement that part by yourself:

class MyClass{

	#languages = {
		de: SkillLangGerman,
		en: SkillLangEnglish,
	};

	#skillData;

	constructor(lang){
		this.setSkillDataLanguage(lang);
	}

	setSkillDataLanguage(lang){

		if(!this.#languages[lang]){
			throw new Error('invalid language');
		}

		this.#skillData = new this.#languages[lang]();

		return this;
	}

	getSkill(skillID, pvp){
		// this.skillData is now available
		let data = this.#skillData.get(skillID, pvp);

		// do stuff with the data array
		console.log(data.id);
	}

}

Return

A call SkillDataInterface::get(979, false) (PHP) or SkillDataAbstract.get(979, false) (JS) returns a Skill instance that looks similar to the following:

Skill{
	id          = 979
	campaign    = new Campaign(Campaign::NIGHTFALL)
	profession  = new Profession(Profession::MESMER)
	attribute   = new Attribute(Attribute::DOMINATION_MAGIC)
	type        = new Type(Type::HEX_SPELL)
	is_elite    = false
	is_rp       = false
	is_pvp      = false
	pvp_split   = true
	split_id    = 3191
	upkeep      = 0
	energy      = 10
	activation  = 2
	recharge    = 12
	adrenaline  = 0
	sacrifice   = 0
	overcast    = 0
	name        = 'Mistrust'
	description = 'For 6 seconds, the next spell that target foe casts on one of your allies fails and deals 10...100 damage to that foe and all nearby foes.'
	concise     = '(6 seconds.) The next spell that target foe casts on one of your allies fails and deals 10...100 damage to target and nearby foes.'
}

PvP skill redirect

When the $pvp parameter is set to true, SkillDataInterface::get(979, true) will redirect to the PvP version of the given skill if available, and vice versa it will redirect a given PvP skill ID to the PvE version when $pvp is set to false:

Skill{
	id          = 3191
	.
	.
	is_pvp      = true
	pvp_split   = true
	split_id    = 979
	.
	.
	name        = 'Mistrust (PvP)'
	description = 'For 6 seconds, the next spell that target foe casts on one of your allies fails and deals 10...75 damage to that foe and all nearby foes.'
	concise     = '(6 seconds.) The next spell that target foe casts on one of your allies fails and deals 10...75 damage to target and nearby foes.'
}

HTML tags in descriptions

The skill descriptions may contain the custom HTML tags <gray>...</gray> and <sic/> that you can either replace or use to style, for example:

<gray>No effect unless hexed foe attacks.</gray>

Each attack that hits deals +13...30 Holy damage <sic/>

API

(The API is similar for the JavaScript version)

SkillDataInterface

The SkillDataInterface describes the methods available in its inheritors (SkillLangEnglish, SkillLangGerman, [...]).

| Method | Return | Description | |-------------------------------------------------------------------|-----------|------------------------------------------------------------------------------------------| | get(int $id, bool $pvp = false) | Skill | Returns the data for the given skill ID, including descriptions for the current language | | getAll(array $IDs, bool $pvp = false) | Skill[] | Returns an array with the skill data for each of the given skill IDs | | getByCampaign(Campaign\|int $campaign, bool $pvp = false) | Skill[] | Returns all skills for the given campaign ID | | getByProfession(Profession\|int $profession, bool $pvp = false) | Skill[] | Returns all skills for the given profession ID | | getByAttribute(Attribute\|int $attribute, bool $pvp = false) | Skill[] | Returns all skills for the given attribute ID | | getByType(Type\|int $type, bool $pvp = false) | Skill[] | Returns all skills for the given skill type ID | | getByTypeWithSubtypes(Type\|int $type, bool $pvp = false) | Skill[] | Returns all skills for the given skill type ID and its subtypes (if any) | | getElite(bool $pvp = false) | Skill[] | Returns all elite skills | | getRoleplay() | Skill[] | Returns all roleplay skills | | getIDs(bool $pvp = false) | int[] | Returns a list of all skill IDs, either Pve or PvP |

Skill

The Skill object holds all skill data for the given skill ID and language. The names for the public (readonly) properties can be found in the constants SkillDataInterface::KEYS_DESC and SkillDataInterface::KEYS_DATA (PHP), or in Skill.KEYS_DESC and Skill.KEYS_DATA (JS). Some of the properties hold instances of the objects described below. This class is not meant to be invoked as standalone, but as return value for the SkillDataInterface methods.

| Method | Return | Description | |--------------------------------------------------------------|-----------|--------------------------------------------------------------------------------------| | toArray() | mixed[] | Returns a pure array representation (key-value object in JS) of the Skill instance | | getFieldName(string $field, Lang\|string $lang = Lang::EN) | string | Returns the display name for the given field (PHP only) |

Lang

The Lang object holds the language information used for translatable strings. An instance of this object can be used as paramter in various methods.

| Method | Return | Description | |-------------|----------|----------------------------------------------------| | getName() | string | Returns the readable name of the given language ID |

DataObjectAbstract

The DataObjectAbstract class is the abstract parent of the classes listed below.

| Method | Return | Description | |------------------|--------|-----------------------------------------------------------| | getName() | bool | Returns the readable name of the given ID | | is(int $id) | bool | Checks whether the object ID is equal to the given ID | | in(array $ids) | bool | Checks whether the object ID is in the given array of IDs |

Attribute

The Attribute class encapsulates all skill attribute related static data.

| Method | Return | Description | |---------------------------------------------------------------------------------------|--------------|---------------------------------------------------------------------------------------------| | setLevel(int $level) | self | Sets the attribute level | | addLevel(int $level) | self | Adds the given amount to the current attribute level | | getLevel() | int | Returns the current attribute level | | getProfession() | Profession | Returns the profession for the current attribute | | getProfessionID() | int | Returns the profession ID for the current attribute | | getMaxValue() | int | Returns the internal max value for the current attribute | | getByProfession(Profession\|int $profession) | int[] | Returns all attributes for the given profession | | isPrimary() | bool | Checks whether the current attribute is a primary attribute | | clamp(int\|null $level = null) | int | Clamps the given value to the internal max value for the current attribute | | getProgressionFunction() | Closure | Returns the progression function for the given title rank or attribute | | getProgressionValue(int\|string $val0, int\|string $val15, int\|null $level = null) | int | Calculates the value for the given val0-val15 progression for the given attribute and level | | getProgressionTable(int $val0, int $val15, int\|null $max = null) | int[] | Creates a progression table for the values 0 to attribute-max of the given val0 and val15 |

Campaign

The Campaign class encapsulates all campaign related static data.

| Method | Return | Description | |------------------------------------------------------|----------|----------------------------------------------------------------------| | getContinentName(Lang\| string\|null $lang = null) | string | Returns the readable name of the continent for the given campaign ID |

Profession

The Profession class encapsulates all profession related static data.

| Method | Return | Description | |--------------------------------------------|-------------|------------------------------------------------------------| | getAbbr(Lang\|string\|null $lang = null) | string | Returns the short name for the fiven profession ID | | getPrimaryAttribute(int $level = 0) | Attribute | Returns the primary attribute of the current profession | | getPrimaryAttributeID() | int | Returns the primary attribute ID of the current profession | | getAttributes() | int[] | Returns all attributes for the current profession |

Type

The Type class encapsulates all skill type related static data.

| Method | Return | Description | |------------------|---------|------------------------------------------------------------------------| | withSubtypes() | int[] | Returns the IDs for the given skill type including all of its subtypes |

Disclaimer

Use at your own risk!

Licensing