PHPackages                             buildwars/gw-templates - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. buildwars/gw-templates

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

buildwars/gw-templates
======================

A Guild Wars build template encoder/decoder.

1.0.0(1y ago)211MITPHPPHP ^8.1

Since Jun 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/build-wars/gw-templates)[ Packagist](https://packagist.org/packages/buildwars/gw-templates)[ Docs](https://github.com/build-wars/gw-templates)[ Fund](https://ko-fi.com/codemasher)[ RSS](/packages/buildwars-gw-templates/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

build-wars/gw-templates
=======================

[](#build-warsgw-templates)

A [Guild Wars](https://www.guildwars.com) build template encoder/decoder

[![PHP Version Support](https://camo.githubusercontent.com/d5ec6ebdf16572be98fe6f9feb8e171eceaa8b756f9098ab2df51417b4721543/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6275696c64776172732f67772d74656d706c617465733f6c6f676f3d70687026636f6c6f723d383839324246266c6f676f436f6c6f723d636363)](https://www.php.net/supported-versions.php)[![Packagist version](https://camo.githubusercontent.com/05176d0ea3e1b3b9910920cb7b8fd2aaa44ee7c88a287078d9d987c02367b1eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6275696c64776172732f67772d74656d706c617465732e7376673f6c6f676f3d7061636b6167697374266c6f676f436f6c6f723d636363)](https://packagist.org/packages/buildwars/gw-templates)[![NPM version](https://camo.githubusercontent.com/9ce367a1e16b184c5a469032561a1afc6baef2d447bd121798232452d479b67d/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f406275696c64776172732f67772d74656d706c617465733f6c6f676f3d6e706d266c6f676f436f6c6f723d636363)](https://www.npmjs.com/package/@buildwars/gw-templates)[![License](https://camo.githubusercontent.com/61d5a1058216765a1cc2992f9e6255505df3223818faab2036e7d431787920e1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6275696c642d776172732f67772d74656d706c617465732e737667)](https://github.com/build-wars/gw-templates/blob/main/LICENSE)[![Continuous Integration](https://camo.githubusercontent.com/2457c6c2a5b527c05e60cc2f3942d2e2977ef716855e22fc9fb95f5b8d6ff689/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6275696c642d776172732f67772d74656d706c617465732f63692e796d6c3f6272616e63683d6d61696e266c6f676f3d676974687562266c6f676f436f6c6f723d636363)](https://github.com/build-wars/gw-templates/actions/workflows/ci.yml?query=branch%3Amain)[![CodeCov](https://camo.githubusercontent.com/495fc842456534023878addaa66e09d4287c21c5dec9f55655ca5ecb508874f7/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6275696c642d776172732f67772d74656d706c617465732e7376673f6c6f676f3d636f6465636f76266c6f676f436f6c6f723d636363)](https://codecov.io/github/build-wars/gw-templates)[![Packagist downloads](https://camo.githubusercontent.com/235147bc4650a613b3eb9bd2e8b01001f0fb3be1347fcef43de58547c9cfaefd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6275696c64776172732f67772d74656d706c617465732e7376673f6c6f676f3d7061636b6167697374266c6f676f436f6c6f723d636363)](https://packagist.org/packages/buildwars/gw-templates/stats)

Overview
========

[](#overview)

Features
--------

[](#features)

Encodes and decodes Guild Wars [skill](https://wiki.guildwars.com/wiki/Skill_template_format)and [equipment](https://wiki.guildwars.com/wiki/Equipment_template_format)templates, as well as [paw·ned²](https://memorial.redeemer.biz/pawned2/) team builds.

Requirements
------------

[](#requirements)

- PHP 8.1+
    - `ext-sodium`

alternatively:

- Javascript
    - node.js &gt;= 20
    - a web browser

Documentation
=============

[](#documentation)

PHP: Installation with [composer](https://getcomposer.org)
----------------------------------------------------------

[](#php-installation-with-composer)

### Terminal

[](#terminal)

```
composer require buildwars/gw-templates

```

### composer.json

[](#composerjson)

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

Note: check the [releases](https://github.com/buildwars/gw-templates/releases) for valid versions.

JS: Installation with [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
----------------------------------------------------------------------------------------------

[](#js-installation-with-npm)

### Terminal

[](#terminal-1)

```
npm install @buildwars/gw-templates

```

### package.json

[](#packagejson)

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

Usage
-----

[](#usage)

### Skill templates

[](#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

[](#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

[](#pawned-templates)

**Encode**

```
$pwndTemplate = new PwndTemplate;

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

// add more builds (up to 12)

$pwnd = $pwndTemplate->encode(); // -> pwnd template code
```

```
let pwndTemplate = new PwndTemplate();

pwndTemplate.addBuild(
	'OwFj0xfzITOMMMHMie4O0kxZ6PA',
	'PkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFF',
	['PcZQ8zoRpkC'],
	'',
	'\r\n',
);

// 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
==========

[](#disclaimer)

Use at your own risk!

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

702d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ada3d048807a11e536645fb87da881170b18f34c0c61fa09e34807c5d79e0b89?d=identicon)[codemasher](/maintainers/codemasher)

---

Top Contributors

[![codemasher](https://avatars.githubusercontent.com/u/592497?v=4)](https://github.com/codemasher "codemasher (19 commits)")

---

Tags

guildwarsjavascript-libraryphp-libraryphp8guild wars

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/buildwars-gw-templates/health.svg)

```
[![Health](https://phpackages.com/badges/buildwars-gw-templates/health.svg)](https://phpackages.com/packages/buildwars-gw-templates)
```

###  Alternatives

[hanneskod/classtools

Find, extract and process classes from file system

1319.1M40](/packages/hanneskod-classtools)[david-griffiths/nova-dark-theme

A dark theme for Laravel Nova

71576.9k](/packages/david-griffiths-nova-dark-theme)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
