Example #1
0
$i = 0;
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['name']);
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, GetJobname($row['job']));
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['level']);
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['exp'] . ' (' . $nextlevelperc . '%)');
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['honourlevel']);
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['honourexp']);
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['guildname']);
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['chp'] . " / " . $row['mhp']);
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['cmp'] . " / " . $row['mmp']);
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['fame']);
$base_y += 23;
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['ap']);
$base_y += 10;
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['str']);
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['dex']);
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['int']);
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * $i++, imagecolorallocate($image, 0, 0, 0), $font, $row['luk']);
SaveCacheImage($internal_id, 'stats', $image, $id);
if (isset($_GET['debug'])) {
    echo 'Skills:' . "\r\n";
    print_r($skill_stat_addition);
    echo 'Potential items:' . "\r\n";
    print_r($potential_stat_addition);
    echo 'Stats:' . "\r\n";
    print_r($stat_addition);
} else {
    imagepng($image);
}
imagedestroy($image);
$q->free();
}
// Create weaponOverGlove
if ($weaponz == 'weaponOverGlove' || $weaponz == 'weaponOverHand') {
    if (isset($wepnum)) {
        $wep_location = $characterwz . "/Weapon/0" . $nxwep . ".img/" . $wepnum . ".stand" . $stand . ".0.weapon.png";
    } else {
        $wep_location = $characterwz . "/Weapon/0" . $nxwep . ".img/stand" . $stand . ".0.weapon.png";
    }
    add_image($wep_location, $wepx + $weaponx, $wepy + $weapony);
}
// Render name
if (isset($_GET['show_name'])) {
    RenderName($character_data['name'], $image_width / 2, $mainy + 71);
}
if (!isset($_GET['NO_CACHING'])) {
    SaveCacheImage($internal_id, $image_mode, $im, $id);
}
imagepng($im);
imagedestroy($im);
// Function to phrase data into an array
function get_data($itemid)
{
    return GetItemWZInfo($itemid, CURRENT_LOCALE);
}
// Function to add element to the image
function add_image($location, $x, $y)
{
    global $im;
    if (file_exists($location)) {
        $image = imagecreatefrompng($location);
        imagecopy($im, $image, $x, $y, 0, 0, imagesx($image), imagesy($image));
Example #3
0
$q2->free();
$image = imagecreatetruecolor(271, 162);
imagealphablending($image, false);
imagesavealpha($image, true);
$bg_image = imagecreatefrompng("../inc/img/char_bg.png");
imagecopyresampled($image, $bg_image, 0, 0, 0, 0, 271, 386, 271, 386);
imagealphablending($image, true);
// LOAD CHARACTER
$charpos_x = -4;
$charpos_y = 15;
$character_image = LoadPNG("http://" . $domain . "/avatar/" . $charname);
//$character_image = LoadPNG("http://mapler.me/avatar/".$charname);
imagecopyresampled($image, $character_image, $charpos_x, $charpos_y, 0, 0, 128, 128, 128, 128);
// SET NAMETAG
$name = $row['name'];
$x = $charpos_x + 128 / 2;
$y = $charpos_y + 15 + 96;
$startWidth = $x - calculateWidth($name) / 2;
$endWidth = $x + calculateWidth($name) / 2;
ImageTTFText($image, $font_size, 0, $startWidth + 3, $y - 5, imagecolorallocate($image, 255, 255, 255), $font, $name);
$base_x = 152;
$base_y = 55;
$step = 18;
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * 0, imagecolorallocate($image, 0, 0, 0), $font, $row['level']);
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * 1, imagecolorallocate($image, 0, 0, 0), $font, GetJobname($row['job']));
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * 2, imagecolorallocate($image, 0, 0, 0), $font, $row['fame']);
ImageTTFText($image, 9, 0, $base_x, $base_y + $step * 3, imagecolorallocate($image, 0, 0, 0), $font, $row['guildname']);
//ImageTTFText($image, 9, 0, $base_x, $base_y + ($step * 4), imagecolorallocate($image, 0, 0, 0), $font, "HAXCLANZ");
SaveCacheImage($internal_id, 'info', $image, $id);
imagepng($image);
imagedestroy($image);