Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Private Server
You last visited: Today at 23:03

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Converting RAW .crb emblems into images...

Discussion on Converting RAW .crb emblems into images... within the SRO Private Server forum part of the Silkroad Online category.

Reply
 
Old 02/28/2014, 18:27   #16
 
elite*gold: 2
Join Date: Aug 2011
Posts: 833
Received Thanks: 1,130
Quote:
Originally Posted by LastThief* View Post
Time to write my own script :3
Code:
function get_emblem($type, $id) {
	global $site_dir, $db_shard;
	$indir = "C:/SRO_CREST/SRO_CREST/";
	$outdir = $site_dir . "emblem/";
	
	$sql = ($type == 'union') ? "SELECT u.CurCrestRev FROM _AlliedClans u WHERE u.ID = '".$id."'" : "SELECT g.CurCrestRev FROM _Guild g WHERE g.ID = '".$id."'";
	if ( !($result = $db_shard->sql_query($sql)) )
	{
		die('could not query emblem data');
	}
	$row = $db_shard->sql_fetchrow($result);
	$file = ($type == 'union') ? "A64_".$id."_".$row['CurCrestRev'] : "G64_".$id."_".$row['CurCrestRev'];
	
	if(!file_exists($outdir.$file.'.bmp'))
	{
		$begin = "secret";
		$color_list = "secret";
		
		$ary = explode(' ', $begin);
		foreach($ary AS $key)
		{
			$content = $content . pack('H*', $key);
		}
		
		$ary_color = explode('-', $color_list);
		foreach($ary_color AS $key)
		{
			$prt = explode('=', trim($key));
			$convert[$prt[0]] = $prt[1];
		}
		
		$hex = unpack("H*", file_get_contents($indir.$file.'.crb'));
		$ary2 = str_split($hex);
		$count=0;
		foreach($hex as $key)
		{
			$ary2 = str_split($key, 2);
			foreach($ary2 as $key2)
			{
				if(empty($convert[$key2])) $convert[$key2] = '000000';
				$ary3 = str_split($convert[$key2], 2);
				$content = $content . pack("H*", $ary3[0]) . pack("H*", $ary3[1]) . pack("H*", $ary3[2]);
				$count++;
			}
		}
		file_put_contents($outdir.$file.".bmp", $content);
	}
	return $outdir.$file.'.bmp';
}
echo '<img src="'.get_emblem('guild', $guild_id).'" width="16" height="16" />';
echo '<img src="'.get_emblem('union', $guild_id).'" width="16" height="16" />';
That should give you some hints...
Timlock is offline  
Thanks
2 Users
Old 07/17/2015, 21:21   #17
 
elite*gold: 0
Join Date: Apr 2015
Posts: 1
Received Thanks: 0
thanks
thadox is offline  
Reply


Similar Threads Similar Threads
Metin2 png images pack 300+ images
11/15/2014 - Metin2 PServer Guides & Strategies - 9 Replies
Hi, here is 300 piece png images pack, it is mobs, npc, character weapons, house and more images :) Link to download: https://www.rapidshare.com/#!download|306|19862143 22|CirilGyujtemeny.rar|63099 Please take thanks for upload. Password for extract: ciril
Converting to .map
12/25/2013 - CO2 Private Server - 3 Replies
First off, Merry Christmas!! Hope you all have a great day. Second, does anyone know how to make a .map file to go into the server files, not the client. Related to this: HERE
converting
01/27/2009 - Dekaron - 3 Replies
when using winhex after you change the offsets u want how do u convert the winhex file to the files that acclaim uses is there a program? or do i have to get the full version of winhex to do this



All times are GMT +1. The time now is 23:04.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.