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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@buildwars/gw-templates

v1.0.1

Published

A Guild Wars build template encoder/decoder.

Downloads

2

Readme

build-wars/gw-templates

A Guild Wars build template encoder/decoder

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

Overview

Features

Encodes and decodes Guild Wars skill and equipment templates, as well as paw·ned² team builds.

Requirements

  • PHP 8.1+
    • ext-sodium

alternatively:

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

Documentation

PHP: Installation with composer

Terminal

composer require buildwars/gw-templates

composer.json

{
	"require": {
		"php": "^8.1",
		"buildwars/gw-templates": "^1.0"
	}
}

Note: check the releases for valid versions.

JS: Installation with npm

Terminal

npm install @buildwars/gw-templates

package.json

{
	"dependencies": {
		"@buildwars/gw-templates": "^1.0"
	}
}

Usage

Skill templates

Encode

$code = (new SkillTemplate)->encode(
	prof_pri:   7,
	prof_sec:   1,
	attributes: [29 => 12, 31 => 3, 35 => 12],
	skills:     [782, 780, 775, 1954, 952, 2356, 1649, 1018],
);
// -> base64 skill template
let code = new SkillTemplate().encode(
	7,
	1,
	{'29': 12, '31': 3, '35': 12},
	[782, 780, 775, 1954, 952, 2356, 1649, 1018],
);
// -> base64 skill template

Decode

$skills = (new SkillTemplate)->decode('OwFj0xfzITOMMMHMie4O0kxZ6PA');
let skills = new SkillTemplate().decode('OwFj0xfzITOMMMHMie4O0kxZ6PA');
Array
(
    [code] => OwFj0xfzITOMMMHMie4O0kxZ6PA
    [prof_pri] => 7
    [prof_sec] => 1
    [attributes] => Array
        (
            [29] => 12
            [31] => 3
            [35] => 12
        )
    [skills] => Array
        (
            [0] => 782
            [1] => 780
            [2] => 775
            [3] => 1954
            [4] => 952
            [5] => 2356
            [6] => 1649
            [7] => 1018
        )
)

Please note that the codes might not necessarily match between decode/encode.

Equipment templates

Encode

$equipmentTemplate = new EquipmentTemplate;

// add iems (will overwrite previous items with same slot id)
$equipmentTemplate->addItem(
	id:    279,
	color: 0,
	mods:  [190, 204, 329],
);

// ... add more items

$code = $equipmentTemplate->encode(); // -> base64 equipment template
let equipmentTemplate = new EquipmentTemplate();

// add iems (will overwrite previous items with same slot id)
equipmentTemplate.addItem(279, 0, [190, 204, 329]);

// ... add more items

let code = equipmentTemplate.encode(); // -> base64 equipment template

Decode

$equipment = (new EquipmentTemplate)->decode('PkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFF');
let equipment = new EquipmentTemplate().decode('PkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFF');

Note: the keys of the returned array are the slot IDs (0-6) - they may not be sequential or ordered

Array
(
    [0] => Array
        (
            [id] => 279
            [slot] => 0
            [color] => 9
            [mods] => Array
                (
                    [0] => 190
                    [1] => 204
                    [2] => 329
                )
        )

    ...more items...
)

paw·ned² templates

Encode

$pwndTemplate = new PwndTemplate;

$pwndTemplate->addBuild(
	skills:      'OwFj0xfzITOMMMHMie4O0kxZ6PA',
	equipment:   'PkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFF',
	weaponsets:  ['PcZQ8zoRpkC'],
	player:      '<assigned player/hero>',
	description: "<build name>\r\n<description>",
);

// add more builds (up to 12)

$pwnd = $pwndTemplate->encode(); // -> pwnd template code
let pwndTemplate = new PwndTemplate();

pwndTemplate.addBuild(
	'OwFj0xfzITOMMMHMie4O0kxZ6PA',
	'PkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFF',
	['PcZQ8zoRpkC'],
	'<assigned player/hero>',
	'<build name>\r\n<description>',
);

// add more builds (up to 12)

let pwnd = pwndTemplate.encode(); // -> pwnd template code

Decode

The paw-ned² template:

pwnd0000?download paw·ned² @ www.gw-tactics.de Copyright numma_cway aka Redeemer
>aOwFj0xfzITOMMMHMie4O0k6PxZpPkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFFAAACgJAAMM
SAtIFdvdEEKZOAOj4wiM5MXTMm3cZS9dJOu5BpPkppFFEqtEAFEqncAFEaqmAFEaY7/EEaYRIHeqXjEA
AACAgAATMiAtIFNvUy9TbWl0ZQoZOQNEApwT2zQDmemuhQOIDQEQjoPgp5PCicJCDBR6JzigItw4SQkh
tDIIyMgJHeqXjEPPgpghmZ9phOzriUAACIhAAOMyAtIFBhbml4CgZOQNDAcw9QvAIg5ZjOkAcQOBoRoP
gpZQCikJCXBR6JnrgItw0VQkht3KIywCKHeqXjEQPkpwRNz6TjdMvKSBAABMAAONCAtIEluZXAxCgZOQ
NDAawDSvAIg5ZrAFgZAEBoRoPgpZQCikJCXBR6JnrgItw0VQkht3KIywCKHeqXjEQPkpwRNz6TjdMvKS
BAACMBAAONSAtIEluZXAyCgbOAhkQkGZIfMzdwQM0qqSzJnw7iBoPgpZRCi8JiYBR6JXsgI7wMWQkhtD
LISOALHeqXjELPkZwUP9akeKAACgJAALNiAtIEJpUAoZOAWiQyhMp7INN5I8Y5wJOOZNBpPkpxUP96Xf
q4npI908npIDLropIvV3npIDr7npITFAAACEBAAONyAtIFJlc3RvCgXOAOiAyk8gNtehzWilD56MvYpP
kp5EFEKuEAFEqncAFEaqmAFEaY7/EEaYBIHiKbkILPkZAIP9akeKAACgBAAKOCAtIFNUCgYOABCY4xEA
glAj4ngdQVFAQZAoPgpxlne9rPVaYKSPNvMFJYJRmiEKtATRGW7ipI7AAAAAABgNSAtIE1vUApzZWNvb
mRhcnkgcHJvZmVzc2lvbiBhbmQgZWxpdGUgc2tpbGwgYXJlIGZyZWUsIGJhcmJzIGlzIG9wdGlvbmFsY
OgNDwcjvOkk6hWEqtp9H0iaBpPkpBUPbTkiqwmpI900mpIDLbipIvSvmpIDrzmpINBAAADAAgAAMNyAt
IEUvTW8K<
$team = (new PwndTemplate)->decode($pwnd);
let team = new PwndTemplate().decode(pwnd);
Array
(
    [0] => Array
        (
            [skills] => OwFj0xfzITOMMMHMie4O0k6PxZ
            [equipment] => PkpxFP9FzSqAA5AAJBAZBApBAJ
            [weaponsets] => Array
                (
                    [0] =>
                    [1] =>
                    [2] =>
                )
            [player] => Player
            [description] => 1 - WotA
        )

    ...more builds...
)

Disclaimer

Use at your own risk!