{"_id":"@buildwars/gw-templates","_rev":"4-0dab012cfc39189a079a9d08f7127e82","name":"@buildwars/gw-templates","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@buildwars/gw-templates","version":"1.0.0","keywords":["guild wars"],"license":"MIT","_id":"@buildwars/gw-templates@1.0.0","maintainers":[{"name":"codemasher","email":"smiley@chillerlan.net"}],"contributors":[{"name":"Contributors"}],"homepage":"https://github.com/build-wars/gw-templates","bugs":{"url":"https://github.com/build-wars/gw-templates/issues"},"dist":{"shasum":"3619f0612f7098d79f04176be1cceb368d87f2ed","tarball":"https://registry.npmjs.org/@buildwars/gw-templates/-/gw-templates-1.0.0.tgz","fileCount":22,"integrity":"sha512-84AXbd3EtFKPi+jyjBx/I5APs5Qw0AU//wMWa1McXwn3J54H+rdvfcEh4yKRyMKMNpm84PtsGoV+02TKmgy1zA==","signatures":[{"sig":"MEUCIQDFjlpWSQ/hStmiZEo7017IrYbQDwzrVSKcMHuzhNId7wIgPpFkrA1HBBd2/glq3GTdAQ8qvtkWwW0s+B/c2zU8FIA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":483540},"main":"lib/main.cjs","type":"module","authors":[{"name":"smiley","email":"smiley@chillerlan.net","homepage":"https://github.com/codemasher"}],"browser":"./lib/browser.js","funding":[{"url":"https://ko-fi.com/codemasher","type":"ko-fi"}],"gitHead":"232e972332890fc3ef9271e30f8392e7b1c033dc","scripts":{"lint":"eslint ./es6 ./tests","test":"mocha","build":"rollup -c rollup.config.dist.js","build-src":"rollup -c rollup.config.src.js","prepublishOnly":"npm run lint && npm run test && rollup -c rollup.config.prepublish.js","test-with-coverage":"c8 mocha"},"_npmUser":{"name":"codemasher","email":"smiley@chillerlan.net"},"repository":{"url":"git+https://github.com/build-wars/gw-templates.git","type":"git"},"_npmVersion":"8.5.2","description":"A Guild Wars build template encoder/decoder.","directories":{},"_nodeVersion":"22.2.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"c8":"~8.0.1","nyc":"~15.1.0","chai":"~5.1.1","node":"~22.2.0","util":"~0.12.5","mocha":"~10.4.0","eslint":"~9.4.0","rollup":"~4.18.0","core-js":"~3.37.1","@babel/preset-env":"~7.24.6","@rollup/plugin-json":"~6.1.0","@babel/eslint-parser":"~7.24.6","@rollup/plugin-babel":"~6.0.4","@rollup/plugin-terser":"~0.4.4"},"_npmOperationalInternal":{"tmp":"tmp/gw-templates_1.0.0_1718295142840_0.5600285987431737","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@buildwars/gw-templates","version":"1.0.1","keywords":["guild wars"],"license":"MIT","_id":"@buildwars/gw-templates@1.0.1","maintainers":[{"name":"codemasher","email":"smiley@chillerlan.net"}],"contributors":[{"name":"Contributors"}],"homepage":"https://github.com/build-wars/gw-templates","bugs":{"url":"https://github.com/build-wars/gw-templates/issues"},"dist":{"shasum":"8df47570b5a3bda10779675b05cde19122caae1e","tarball":"https://registry.npmjs.org/@buildwars/gw-templates/-/gw-templates-1.0.1.tgz","fileCount":14,"integrity":"sha512-kFoFkx0+Z3jyNPemqR8Yr4IeguvI+CljJ4bfSWck3H++vab5xoClPoFyWpb91G9P0qxcyU+sW3gPZFOcvsq6+A==","signatures":[{"sig":"MEQCIFcmREYfI1SbAsGJZv+6+f8mCgH9JNkeXicQut+QNKGPAiBjt1RHoY81xbCup9FpXhMCWPnmQzTix2ObhyUwG7LXxA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":247137},"main":"lib/main.cjs","type":"module","authors":[{"name":"smiley","email":"smiley@chillerlan.net","homepage":"https://github.com/codemasher"}],"browser":"./lib/browser.js","funding":[{"url":"https://ko-fi.com/codemasher","type":"ko-fi"}],"gitHead":"73317c305c21ce4f2abc1f661febb1a1239e844a","scripts":{"lint":"eslint ./es6 ./tests","test":"mocha","build":"rollup -c rollup.config.dist.js","build-src":"rollup -c rollup.config.src.js","prepublishOnly":"npm run lint && npm run test && rollup -c rollup.config.prepublish.js","test-with-coverage":"c8 mocha"},"_npmUser":{"name":"codemasher","email":"smiley@chillerlan.net"},"repository":{"url":"git+https://github.com/build-wars/gw-templates.git","type":"git"},"_npmVersion":"10.9.0","description":"A Guild Wars build template encoder/decoder.","directories":{},"_nodeVersion":"22.2.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"c8":"~8.0.1","nyc":"~17.1.0","chai":"~5.1.1","node":"~22.9.0","util":"~0.12.5","mocha":"~10.7.3","eslint":"~9.11.1","rollup":"~4.24.0","core-js":"~3.38.1","@babel/preset-env":"~7.25.7","@rollup/plugin-json":"~6.1.0","@babel/eslint-parser":"~7.25.7","@rollup/plugin-babel":"~6.0.4","@rollup/plugin-terser":"~0.4.4"},"_npmOperationalInternal":{"tmp":"tmp/gw-templates_1.0.1_1728048985968_0.12413078334026317","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@buildwars/gw-templates","version":"1.1.0","keywords":["guild wars"],"license":"MIT","_id":"@buildwars/gw-templates@1.1.0","maintainers":[{"name":"codemasher","email":"smiley@chillerlan.net"}],"contributors":[{"name":"Contributors"}],"homepage":"https://github.com/build-wars/gw-templates","bugs":{"url":"https://github.com/build-wars/gw-templates/issues"},"dist":{"shasum":"71d78a470bb1d6c6d1699f26961b2f38d2a48ad6","tarball":"https://registry.npmjs.org/@buildwars/gw-templates/-/gw-templates-1.1.0.tgz","fileCount":22,"integrity":"sha512-WggWSy1cqdKqGERlTr8DqMf5Xwy+uAE69fIXdzKcrT0MRfFdrPNsIJaNpRqXL9HjNzorg1zZECatEqpDTNHHkg==","signatures":[{"sig":"MEUCIHU7y2x/K1z2b0vuVLxpXD6ZH3VchRqUY0p18hRiyv5ZAiEAyZZuLLUQwY3e9Bw+67UvRPIM+3zlmWrFdJC7LOUpn6Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":856012},"main":"lib/main.cjs","type":"module","unpkg":"dist/gw-templates-es6.js","authors":[{"name":"smiley","email":"smiley@chillerlan.net","homepage":"https://github.com/codemasher"}],"browser":"lib/browser.js","funding":[{"url":"https://ko-fi.com/codemasher","type":"ko-fi"}],"gitHead":"2be12c76a364f692a3b9f5d7ed31b046089184fb","scripts":{"lint":"eslint ./es6 ./tests","test":"mocha","build":"rollup -c rollup.config.dist.js","build-src":"rollup -c rollup.config.src.js","prepublishOnly":"npm run lint && npm run test && rollup -c rollup.config.prepublish.js","test-with-coverage":"c8 mocha"},"_npmUser":{"name":"codemasher","email":"smiley@chillerlan.net"},"repository":{"url":"git+https://github.com/build-wars/gw-templates.git","type":"git"},"_npmVersion":"12.0.2","description":"A Guild Wars build template encoder/decoder.","directories":{},"_nodeVersion":"26.6.0","allowScripts":{"node@25.9.0":true,"core-js@3.50.0":true},"dependencies":{"windows-1252":"^3.0.4"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^12.0","nyc":"^18.0","chai":"^6.2","node":"^25.9","util":"^0.12","mocha":"^11.7","eslint":"^9.39","rollup":"^4.62","core-js":"^3.50","@babel/preset-env":"^7.29","@rollup/plugin-json":"^6.1","@babel/eslint-parser":"^7.29","@rollup/plugin-babel":"^7.1","@rollup/plugin-terser":"^1.0","@babel/plugin-syntax-import-attributes":"^7.29"},"optionalDependencies":{"@rollup/rollup-linux-x64-gnu":"^4.62"},"_npmOperationalInternal":{"tmp":"tmp/gw-templates_1.1.0_1786224842305_0.8675959554257293","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@buildwars/gw-templates","version":"1.1.1","description":"A Guild Wars build template encoder/decoder.","license":"MIT","homepage":"https://github.com/build-wars/gw-templates","keywords":["guild wars"],"repository":{"type":"git","url":"git+https://github.com/build-wars/gw-templates.git"},"authors":[{"name":"smiley","email":"smiley@chillerlan.net","homepage":"https://github.com/codemasher"}],"contributors":[{"name":"Contributors"}],"bugs":{"url":"https://github.com/build-wars/gw-templates/issues"},"funding":[{"type":"ko-fi","url":"https://ko-fi.com/codemasher"}],"type":"module","main":"lib/main.cjs","browser":"lib/browser.js","unpkg":"dist/gw-templates-es6.js","dependencies":{"windows-1252":"^3.0.4"},"devDependencies":{"@babel/eslint-parser":"^7.29","@babel/plugin-syntax-import-attributes":"^7.29","@babel/preset-env":"^7.29","@rollup/plugin-babel":"^7.1","@rollup/plugin-json":"^6.1","@rollup/plugin-terser":"^1.0","c8":"^12.0","chai":"^6.2","core-js":"^3.50","eslint":"^9.39","mocha":"^11.7","node":"^25.9","nyc":"^18.0","rollup":"^4.62","util":"^0.12"},"optionalDependencies":{"@rollup/rollup-linux-x64-gnu":"^4.62"},"scripts":{"lint":"eslint ./es6 ./tests","build":"rollup -c rollup.config.dist.js","build-src":"rollup -c rollup.config.src.js","test":"mocha","test-with-coverage":"c8 mocha","prepublishOnly":"npm run lint && npm run test && rollup -c rollup.config.prepublish.js"},"allowScripts":{"node@25.9.0":true,"core-js@3.50.0":true},"gitHead":"37318b911992e4a8e5309e154168dfc6fbb20279","_id":"@buildwars/gw-templates@1.1.1","_nodeVersion":"26.6.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-461D1/2LnWVI0T9iHxaTFVxAahPFKi7yhB7RBj/lcU5o/NLy7pLca4ScghNqVXBw3FLmv1gYNBBQzQ9gp0Vp7A==","shasum":"ee639f8ea7afd26930840a17a728d920a78ff73b","tarball":"https://registry.npmjs.org/@buildwars/gw-templates/-/gw-templates-1.1.1.tgz","fileCount":22,"unpackedSize":941887,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDnBisJM97mlzmfpow2RZPh36CDpQc8lXZsCy9hBzeD5wIhAK4FG+EGbiPVuqNLENHKRYgmsAFJon6S7KcfwjlCA9hz"}]},"_npmUser":{"name":"codemasher","email":"smiley@chillerlan.net"},"directories":{},"maintainers":[{"name":"codemasher","email":"smiley@chillerlan.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gw-templates_1.1.1_1786229712621_0.35302682657350015"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-13T16:12:22.759Z","modified":"2026-08-08T22:55:12.959Z","1.0.0":"2024-06-13T16:12:22.989Z","1.0.1":"2024-10-04T13:36:26.169Z","1.1.0":"2026-08-08T21:34:02.485Z","1.1.1":"2026-08-08T22:55:12.793Z"},"bugs":{"url":"https://github.com/build-wars/gw-templates/issues"},"license":"MIT","homepage":"https://github.com/build-wars/gw-templates","keywords":["guild wars"],"repository":{"type":"git","url":"git+https://github.com/build-wars/gw-templates.git"},"description":"A Guild Wars build template encoder/decoder.","contributors":[{"name":"Contributors"}],"maintainers":[{"name":"codemasher","email":"smiley@chillerlan.net"}],"readme":"# build-wars/gw-templates\r\n\r\nA [Guild Wars](https://www.guildwars.com) build template encoder/decoder\r\n\r\n[![PHP Version Support][php-badge]][php]\r\n[![Packagist version][packagist-badge]][packagist]\r\n[![NPM version][npm-badge]][npm]\r\n[![License][license-badge]][license]\r\n[![Continuous Integration][gh-action-badge]][gh-action]\r\n[![CodeCov][coverage-badge]][coverage]\r\n[![Packagist downloads][downloads-badge]][downloads]\r\n\r\n[php-badge]: https://img.shields.io/packagist/php-v/buildwars/gw-templates?logo=php&color=8892BF&logoColor=ccc\r\n[php]: https://www.php.net/supported-versions.php\r\n[packagist-badge]: https://img.shields.io/packagist/v/buildwars/gw-templates.svg?logo=packagist&logoColor=ccc\r\n[packagist]: https://packagist.org/packages/buildwars/gw-templates\r\n[npm-badge]: https://img.shields.io/npm/v/@buildwars/gw-templates?logo=npm&logoColor=ccc\r\n[npm]: https://www.npmjs.com/package/@buildwars/gw-templates\r\n[license-badge]: https://img.shields.io/github/license/build-wars/gw-templates.svg\r\n[license]: https://github.com/build-wars/gw-templates/blob/main/LICENSE\r\n[gh-action-badge]: https://img.shields.io/github/actions/workflow/status/build-wars/gw-templates/ci.yml?branch=main&logo=github&logoColor=ccc\r\n[gh-action]: https://github.com/build-wars/gw-templates/actions/workflows/ci.yml?query=branch%3Amain\r\n[coverage-badge]: https://img.shields.io/codecov/c/github/build-wars/gw-templates.svg?logo=codecov&logoColor=ccc\r\n[coverage]: https://codecov.io/github/build-wars/gw-templates\r\n[downloads-badge]: https://img.shields.io/packagist/dt/buildwars/gw-templates.svg?logo=packagist&logoColor=ccc\r\n[downloads]: https://packagist.org/packages/buildwars/gw-templates/stats\r\n\r\n# Overview\r\n\r\n## Features\r\n\r\nEncodes and decodes Guild Wars [skill](https://wiki.guildwars.com/wiki/Skill_template_format)\r\nand [equipment](https://wiki.guildwars.com/wiki/Equipment_template_format)\r\ntemplates, as well as [paw·ned²](https://memorial.redeemer.biz/pawned2/) team builds.\r\n\r\n\r\n## Requirements\r\n\r\n- PHP 8.1+\r\n  - `ext-sodium`\r\n\r\nalternatively:\r\n\r\n- Javascript\r\n  - node.js >= 24\r\n  - a web browser\r\n\r\n# Documentation\r\n\r\n## PHP: Installation with [composer](https://getcomposer.org)\r\n\r\n### Terminal\r\n```\r\ncomposer require buildwars/gw-templates\r\n```\r\n\r\n### composer.json\r\n```json\r\n{\r\n\t\"require\": {\r\n\t\t\"php\": \"^8.1\",\r\n\t\t\"buildwars/gw-templates\": \"^1.1\"\r\n\t}\r\n}\r\n```\r\n\r\nNote: check the [releases](https://github.com/buildwars/gw-templates/releases) for valid versions.\r\n\r\n## JS: Installation with [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)\r\n\r\n### Terminal\r\n```\r\nnpm install @buildwars/gw-templates\r\n```\r\n\r\n### package.json\r\n```json\r\n{\r\n\t\"dependencies\": {\r\n\t\t\"@buildwars/gw-templates\": \"^1.1\"\r\n\t}\r\n}\r\n```\r\n\r\n### Direct include\r\n\r\nYou can also directly include the library in your HTML:\r\n```html\r\n<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n\t<meta charset=\"UTF-8\"/>\r\n\t<!-- ... -->\r\n</head>\r\n<body>\r\n\t<!-- include the script at the bottom of the html body -->\r\n\t<script type=\"module\">\r\n\t\t// import the script\r\n\t\timport * as templates from 'https://build-wars.github.io/gw-templates/js/gw-templates-es6.js';\r\n\t\t// alternative via unpkg\r\n\t\t// import * as templates from 'https://unpkg.com/@buildwars/gw-templates@1.1.0/dist/gw-templates-es6.js';\r\n\r\n\t\t// do stuff\r\n\t</script>\r\n</body>\r\n</html>\r\n```\r\n\r\nPlease note that the include from GitHub pages represents the development version, which is built on each push to the main branch. Use NPM or unpkg instead for stable versions.\r\n\r\n\r\n## Usage\r\n\r\n### Decode Skill Templates\r\n\r\n**PHP**\r\n```php\r\n$skills = (new SkillTemplate)->decode('OwFj0xfzITOMMMHMie4O0kxZ6PA');\r\n// static convenience methods:\r\n$skills = SkillTemplate::fromTemplate('OwFj0xfzITOMMMHMie4O0kxZ6PA');\r\n$skills = SkillTemplate::fromChatCode('[My Cool Build;OwFj0xfzITOMMMHMie4O0kxZ6PA]');\r\n```\r\n\r\n**JavaScript :coffee:**\r\n```js\r\nlet skills = new SkillTemplate().decode('OwFj0xfzITOMMMHMie4O0kxZ6PA');\r\n// static convenience methods:\r\nskills = SkillTemplate.fromTemplate('OwFj0xfzITOMMMHMie4O0kxZ6PA');\r\nskills = SkillTemplate.fromChatCode('[My Cool Build;OwFj0xfzITOMMMHMie4O0kxZ6PA]');\r\n```\r\n\r\n#### Return\r\n\r\nA call to the `decode()` method returns an array (PHP) or object (JS) similar to the following:\r\n```\r\nArray\r\n(\r\n    [code] => OwFj0xfzITOMMMHMie4O0kxZ6PA\r\n    [prof_pri] => 7\r\n    [prof_sec] => 1\r\n    [attributes] => Array\r\n        (\r\n            [29] => 12\r\n            [31] => 3\r\n            [35] => 12\r\n        )\r\n    [skills] => Array\r\n        (\r\n            [0] => 782\r\n            [1] => 780\r\n            [2] => 775\r\n            [3] => 1954\r\n            [4] => 952\r\n            [5] => 2356\r\n            [6] => 1649\r\n            [7] => 1018\r\n        )\r\n)\r\n```\r\n\r\n\r\n### Encode Skill Templates\r\n\r\n**PHP**\r\n```php\r\n$code = (new SkillTemplate)->encode(\r\n\tprof_pri:   7,\r\n\tprof_sec:   1,\r\n\tattributes: [29 => 12, 31 => 3, 35 => 12],\r\n\tskills:     [782, 780, 775, 1954, 952, 2356, 1649, 1018],\r\n);\r\n// -> base64 skill template\r\n```\r\n\r\n**JavaScript :coffee:**\r\n```js\r\nlet code = new SkillTemplate().encode(\r\n\t7,\r\n\t1,\r\n\t{'29': 12, '31': 3, '35': 12},\r\n\t[782, 780, 775, 1954, 952, 2356, 1649, 1018],\r\n);\r\n// -> base64 skill template\r\n```\r\n\r\nPlease note that the base64 template codes might not necessarily match between decode/encode.\r\n\r\n\r\n### Decode Equipment Templates\r\n\r\n**PHP**\r\n```php\r\n$equipment = (new EquipmentTemplate)->decode('PkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFF');\r\n// static convenience methods:\r\n$equipment = EquipmentTemplate::fromTemplate('PkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFF');\r\n$equipment = EquipmentTemplate::fromChatCode('[My Cool Equipment;PkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFF]');\r\n```\r\n\r\n**JavaScript :coffee:**\r\n```js\r\nlet equipment = new EquipmentTemplate().decode('PkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFF');\r\n// static convenience methods:\r\nequipment = EquipmentTemplate.fromTemplate('PkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFF');\r\nequipment = EquipmentTemplate.fromChatCode('[My Cool Equipment;PkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFF]');\r\n```\r\n\r\n#### Return\r\n\r\nA call to the `decode()` method returns an array (PHP) or object (JS) similar to the following:\r\n```\r\nArray\r\n(\r\n    [0] => Array\r\n        (\r\n            [id] => 279\r\n            [slot] => 0\r\n            [color] => 9\r\n            [mods] => Array\r\n                (\r\n                    [0] => 190\r\n                    [1] => 204\r\n                    [2] => 329\r\n                )\r\n        )\r\n\r\n    ...more items...\r\n)\r\n```\r\nNote: the keys of the returned array are the slot IDs (0-6) - they may not be sequential or ordered\r\n\r\n\r\n### Encode Equipment Templates\r\n\r\n**PHP**\r\n```php\r\n$equipmentTemplate = new EquipmentTemplate;\r\n\r\n// add items (will overwrite previous items with same slot id)\r\n$equipmentTemplate->addItem(\r\n\tid:    279,\r\n\tcolor: 0,\r\n\tmods:  [190, 204, 329],\r\n);\r\n\r\n// ... add more items\r\n\r\n$code = $equipmentTemplate->encode(); // -> base64 equipment template\r\n```\r\n\r\n**JavaScript :coffee:**\r\n```js\r\nlet equipmentTemplate = new EquipmentTemplate();\r\n\r\n// add iems (will overwrite previous items with same slot id)\r\nequipmentTemplate.addItem(279, 0, [190, 204, 329]);\r\n\r\n// ... add more items\r\n\r\nlet code = equipmentTemplate.encode(); // -> base64 equipment template\r\n```\r\n\r\n\r\n### Decode paw·ned² Templates\r\n\r\nThe paw-ned² template:\r\n\r\n```\r\npwnd0000?download paw·ned² @ www.gw-tactics.de Copyright numma_cway aka Redeemer\r\n>aOwFj0xfzITOMMMHMie4O0k6PxZpPkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFFAAACgJAAMM\r\nSAtIFdvdEEKZOAOj4wiM5MXTMm3cZS9dJOu5BpPkppFFEqtEAFEqncAFEaqmAFEaY7/EEaYRIHeqXjEA\r\nAACAgAATMiAtIFNvUy9TbWl0ZQoZOQNEApwT2zQDmemuhQOIDQEQjoPgp5PCicJCDBR6JzigItw4SQkh\r\ntDIIyMgJHeqXjEPPgpghmZ9phOzriUAACIhAAOMyAtIFBhbml4CgZOQNDAcw9QvAIg5ZjOkAcQOBoRoP\r\ngpZQCikJCXBR6JnrgItw0VQkht3KIywCKHeqXjEQPkpwRNz6TjdMvKSBAABMAAONCAtIEluZXAxCgZOQ\r\nNDAawDSvAIg5ZrAFgZAEBoRoPgpZQCikJCXBR6JnrgItw0VQkht3KIywCKHeqXjEQPkpwRNz6TjdMvKS\r\nBAACMBAAONSAtIEluZXAyCgbOAhkQkGZIfMzdwQM0qqSzJnw7iBoPgpZRCi8JiYBR6JXsgI7wMWQkhtD\r\nLISOALHeqXjELPkZwUP9akeKAACgJAALNiAtIEJpUAoZOAWiQyhMp7INN5I8Y5wJOOZNBpPkpxUP96Xf\r\nq4npI908npIDLropIvV3npIDr7npITFAAACEBAAONyAtIFJlc3RvCgXOAOiAyk8gNtehzWilD56MvYpP\r\nkp5EFEKuEAFEqncAFEaqmAFEaY7/EEaYBIHiKbkILPkZAIP9akeKAACgBAAKOCAtIFNUCgYOABCY4xEA\r\nglAj4ngdQVFAQZAoPgpxlne9rPVaYKSPNvMFJYJRmiEKtATRGW7ipI7AAAAAABgNSAtIE1vUApzZWNvb\r\nmRhcnkgcHJvZmVzc2lvbiBhbmQgZWxpdGUgc2tpbGwgYXJlIGZyZWUsIGJhcmJzIGlzIG9wdGlvbmFsY\r\nOgNDwcjvOkk6hWEqtp9H0iaBpPkpBUPbTkiqwmpI900mpIDLbipIvSvmpIDrzmpINBAAADAAgAAMNyAt\r\nIEUvTW8K<\r\n```\r\n\r\n**PHP**\r\n```php\r\n$team = (new PwndTemplate)->decode($pwnd);\r\n// static convenience method:\r\n$team = PwndTemplate::fromTemplate($pwnd);\r\n```\r\n\r\n**JavaScript :coffee:**\r\n```js\r\nlet team = new PwndTemplate().decode(pwnd);\r\n// static convenience method:\r\nteam = PwndTemplate.fromTemplate($pwnd);\r\n```\r\n\r\n#### Return\r\n\r\nA call to the `decode()` method returns an array (PHP) or object (JS) similar to the following:\r\n```\r\nArray\r\n(\r\n    [0] => Array\r\n        (\r\n            [skills] => OwFkMyd534lkDjzzBjoHuDNZcm+D\r\n            [equipment] => PkpxFP9FySqIlpI90MlpIDLfYpI7oMFZpcpMFpoA\r\n            [weaponsets] => Array\r\n                (\r\n                    [0] => PkZATPZjlsI\r\n                    [1] => PcZg8z6QJpC\r\n                    [2] => PgpgnnN4SJNSauVlC\r\n                )\r\n            [templatename] => 1 - WotA\r\n            [description] =>\r\n            [player] => Player\r\n            [attributes] => Array\r\n                (\r\n                    [0] => 4\r\n                    [1] => 0\r\n                    [2] => 1\r\n                    [3] => 1\r\n                    [4] => 0\r\n                )\r\n            [flags] => Array\r\n                (\r\n                    [0]  => false\r\n                    [1]  => false\r\n                    [2]  => false\r\n                    [3]  => false\r\n                    [4]  => false\r\n                    [5]  => false\r\n                    [6]  => false\r\n                    [7]  => false\r\n                    [8]  => false\r\n                    [9]  => false\r\n                    [10] => false\r\n                    [11] => false\r\n                    [12] => false\r\n                    [13] => true\r\n                    [14] => true\r\n                    [15] => true\r\n                )\r\n        )\r\n\r\n        ...more builds...\r\n)\r\n```\r\n\r\n### Encode paw·ned² Templates\r\n\r\n**PHP**\r\n```php\r\n// We're using Windows-1252 encoding here (default: UTF-8)\r\n$pwndTemplate = new PwndTemplate(PwndTemplate::PAWNED_CHARSET_WINDOWS1252);\r\n\r\n$pwndTemplate->addBuild(\r\n\tskills:       'OwFj0xfzITOMMMHMie4O0kxZ6PA',\r\n\tequipment:    'PkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFF',\r\n\tweaponsets:   ['PcZQ8zoRpkC'],\r\n\ttemplatename: '<template/build name>',\r\n\tdescription:  '<description>',\r\n\tplayer:       '<assigned player/hero>',\r\n\tattributes:   [4, 0, 1, 1, 0],\r\n\tflags:        [],\r\n);\r\n\r\n// add more builds (up to 12)\r\n\r\n$pwnd = $pwndTemplate->encode(); // -> pwnd template code\r\n```\r\n\r\n**JS**\r\n```js\r\nlet pwndTemplate = new PwndTemplate(PwndTemplate.PAWNED_CHARSET_WINDOWS1252);\r\n\r\npwndTemplate.addBuild(\r\n\t'OwFj0xfzITOMMMHMie4O0kxZ6PA',\r\n\t'PkpxFP9FzSqIlpI90MlpIDLfopInVBgpILlLlpIFF',\r\n\t['PcZQ8zoRpkC'],\r\n\t'<template/build name>',\r\n\t'<description>',\r\n\t'<assigned player/hero>',\r\n\t[4, 0, 1, 1, 0],\r\n\t[],\r\n);\r\n\r\nlet pwnd = pwndTemplate.encode(); // -> pwnd template code\r\n```\r\n\r\n\r\n\r\n# Disclaimer\r\n\r\nUse at your own risk!\r\n","readmeFilename":"README.md"}