New Tibia Outfitter.php
New Tibia Outfitter.php
I've refactored an existing lib (by Kamil Karkus, used by Gesior) to implement some new features like consistent image output and standardize all to 64x64 sprites (transform 32x32 to 64x64).
In this repository have an outifts.zip with all outfits/creatures until 10.79 (thanks to gesior).
With defaults:
<?php
include('Outfit.class.php');
header('Content-type: image/png');
$outfit = new Outfit();
$outfit->render();
Lets change looktype:
<?php
include('Outfit.class.php');
header('Content-type: image/png');
$outfit = new Outfit();
$outfit->looktype = 129;
$outfit->render();
Lets add addons, and see the sexy preset colors:
<?php
include('Outfit.class.php');
header('Content-type: image/png');
$outfit = new Outfit();
$outfit->looktype = 129;
$outfit->addons = 3;
$outfit->body = "red";
$outfit->render();
Now, with all properties:
<?php
include('Outfit.class.php');
header('Content-type: image/png');
$outfit = new Outfit();
$outfit->looktype = 130;
$outfit->direction = 2;
$outfit->movement = 3;
$outfit->addons = 3;
$outfit->mount = 450;
$outfit->head = "flat-emerald"; // preset color
$outfit->body = "#FF9900"; // css-like hex
$outfit->legs = "4FE7A9"; // hex
$outfit->feet = 4; // tibia color table
$outfit->render();
$_GET
with queriefy()<?php
include('Outfit.class.php');
header('Content-type: image/png');
$outfit = new Outfit();
$outfit->queriefy();
$outfit->render();
Queriefy enables properties set by $_GET
with this params:
id
(looktype), addons
, movement
, direction
, mount
, head
, body
, legs
and feet
.
Example: outfit.php?id=128&movement=2&direction=1
But, its a long query with long words. Fortunately you can change these query names by settings.
<?php
include('Outfit.class.php');
header('Content-type: image/png');
$outfit = new Outfit(array('query' => true));
$outfit->render();
<?php
include('Outfit.class.php');
header('Content-type: image/png');
$outfit = new Outfit(array(
'query' => true,
'queries' => array(
'mount' => 'foo'
)
));
$outfit->render();
<?php
include('Outfit.class.php');
header('Content-type: image/png');
$outfit = new Outfit(array(
'query' => true,
'defaults' => array(
'body' => 'red',
'mount' => 322,
'direction' => 2 //right
)
));
$outfit->render();
My term for gesior-style
means that query arguments are a, b, c, d, e etc.
You will need to change queries and enable hexmount
setting
<?php
include('Outfit.class.php');
header('Content-type: image/png');
$outfit = new Outfit(array(
'query' => true,
'hexmount' => true,
'queries' => array(
'looktype' => 'a',
'addons' => 'b',
'head' => 'c',
'body' => 'd',
'legs' => 'e',
'feet' => 'f',
'mount' => 'g',
'direction' => 'h',
'movement' => 'i'
)
));
$outfit->render();
Now you can test outfit.php?a=514&b=2&c=45&d=13&e=65&f=1&g=66083&&h=2&i=3
[Otland post][https://otland.net/threads/new-tibia-outfitter-php.239183/]