Guild Wars Template Decoder
7/04/2007About
Guild Wars has recently had a build template system added to the game. With this system your builds are stored in a text file in the form of a base64 encoded string. I’ve written this little class to decode the string into its component data.
Please note this class requires PHP 5 or higher, it will not work on PHP 3 or 4.
Download
Latest Version: 1.2
Guild Wars Template Decoder V1.2
Usage
Using the code is as simple as extracting the php file into your website or script’s directory and using code similar to this:
-
<?php
-
include(‘gwtemplate.php’);
-
try {
-
$gw = new GWTemplate(‘AxNREp8XH/CgJwEBBAAAXmAA’);
-
$gw->secondary = 1; // Change secondary profession to Warrior
-
$gw->save();
-
$gw->code = ‘AZMSpaqo7Ajfw1YesPmrUhl3′; // set a new build template code
-
$gw->load(); // load the new build template code.
-
foreach($gw->skills as $skill) { // loop through skills for the build
-
}
-
foreach($gw->attribs as $attrib) { // loop through attributes for the build
-
}
-
} catch (Exception $e) {
-
}
-
?>
The public class members primary, secondary, attribs and skills contain the primary proffession, secondary profession, attributes and their values and the skills for the build respectively.