Jump to content

Recommended Posts

Posted

Hi!

 

This is two scripts thats I use in my web for some time.

 

Now I want to share with all you  ::)

 

 

It shows something like:

1   PlayerName  (ClanCrest)ClanName  (AllyCrest)AllyName  PvP or PK Number

2   PlayerName  (ClanCrest)ClanName  (AllyCrest)AllyName  PvP or PK Number

...

 

 

First this is the crest.php

 

(If you get any error with this file, please, consult this post: http://www.maxcheaters.com/forum/index.php?topic=99196.msg1072861#msg1072861)

 

<?


if(!empty($_GET['clan_crest'])){
$name = 'Crest';
$crest = $_GET['clan_crest'];
}
else if(!empty($_GET['ally_crest'])){
$name = 'AllyCrest';
$crest = $_GET['ally_crest'];
}
else
die('No Crest!');


$file = fopen('/home/admin/gameserver/data/crests/'.$name.'_'.$crest.'.bmp', 'r'); //fopen($filename,'rb');

$dds = fread($file,4);


if ($dds!=='DDS ') die("Error: no hay imagen DDS");


//DDS header

$hdrSize = readInt($file);

$hdrFlags = readInt($file);

$imgHeight = readInt($file)-4;

$imgWidth = readInt($file);

$imgPitch = readShort($file);



//DXT1 header

fseek($file, 84);

$dxt1 = fread($file,4);

if ($dxt1!=='DXT1') die("Error: no es formato DX1");


//here we go

fseek($file, 128);

header ("Content-type: image/png");

$img=imagecreatetruecolor($imgWidth,$imgHeight);


for ($y=-1; $y<$imgHeight/4; $y++)

{

 for ($x=0; $x<$imgWidth/4; $x++)

 {

   $color0_16 = readShort($file);

   $color1_16 = readShort($file);

   $r0 = ($color0_16 >> 11) << 3;

   $g0 = (($color0_16 >> 5) & 63) << 2;

   $b0 = ($color0_16 & 31) << 3;

   $r1 = ($color1_16 >> 11) << 3;

   $g1 = (($color1_16 >> 5) & 63) << 2;

   $b1 = ($color1_16 & 31) << 3;

   $color0_32 = imagecolorallocate($img,$r0,$g0,$b0);

   $color1_32 = imagecolorallocate($img,$r1,$g1,$b1);

   $color01_32 = imagecolorallocate($img,$r0/2+$r1/2,$g0/2+$g1/2,$b0/2+$b1/2);

   $black = imagecolorallocate($img,0,0,0);

   $data = readInt($file);

   for ($yy=0;$yy<4;$yy++)

   {

     for ($xx=0;$xx<4;$xx++)

     {

       $bb = $data & 3;

       $data = $data >> 2;

       switch ($bb)

       {

         case 0: $c = $color0_32; break;

         case 1: $c = $color1_32; break;

         case 2: $c = $color01_32; break;

         default: $c = $black; break;

       }

       imagesetpixel($img,$x*4+$xx,$y*4+$yy,$c);

     }

   }

 }

}



imagepng($img);



## Functions needed

function readInt($file)

{

 $b4 = ord(fgetc($file));

 $b3 = ord(fgetc($file));

 $b2 = ord(fgetc($file));

 $b1 = ord(fgetc($file));

 return ($b1<<24)|($b2<<16)|($b3<<8)|$b4;

}



function readShort($file)

{

 $b2 = ord(fgetc($file));

 $b1 = ord(fgetc($file));

 return ($b1<<8)|$b2;

}


?> 

 

This is the connection.php file:

 

<?php
$db_user = "USER";
$db_pass = "PASS";
$db_name = "l2jdb";
$db_serv = "localhost";
$db_port = "3306";
$res = mysql_connect ( $db_serv, $db_user, $db_pass, $db_port ) or die ("Coudn't connect to [$db_serv]");
mysql_select_db ( $db_name );
?>

 

Pkkills.php

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body,td,th {
color: #CCCCCC;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
body {
background-color: #000000;
}
-->
</style>
</head>
<body>
<table style="border: 1px solid; border-color: #444444; background-color:#222222;" align="center" width="100%">
  <tr>
    <th class='Stil7' colspan="5">Top 100 PK</th>
  </tr>
  <tr>
    <th width="5%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Rank </th>
    <th width="35%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Name </th>
    <th width="19%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Clan </th>
    <th width="19%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Ally </th>
    <th width="20%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> PK's </th>
  </tr>

  <?php 
require("Connection.php");
$activity = mysql_query("SELECT char_name,pkkills,clan_name as 'pname', ally_name as 'aname', clanid, clan_data.crest_id as 'pcrest', ally_crest_id as 'acrest' FROM characters LEFT JOIN clan_data ON clan_data.clan_Id = characters.clanId Where ((pkkills >=1) AND (accesslevel = 0)) ORDER BY pkkills DESC, char_name ASC limit 100");
$i = 1;

while($row = mysql_fetch_array($activity))

{
	if (!($i%2)) echo "<tr bgcolor='#000000' align='center'>";
	else
	echo "<tr bgcolor='#161616' align='center'>";
	echo "<td>"."<center>".$i."</center>"."</td>";
	echo "<td>"."<center>".$row['char_name']."</center>"."</td>";
	echo "<td align='left'>";
	    if ($row['pcrest'] != 0) echo "<img src='crest.php?clan_crest=".$row['pcrest']."'/> ".$row['pname']."";
	echo "</td>";
	echo "<td align='left'>";
	    if ($row['acrest'] != 0) echo "<img src='crest.php?ally_crest=".$row['acrest']."'/> ".$row['aname']."";
	echo "</td>";
	echo "<td>"."<center>".$row['pkkills']."</center>"."</td>";
	$i++;
}
?>
</table>
</body>
</html>

 

PvPKills.php

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<style type="text/css">
<!--
body,td,th {
color: #CCCCCC;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
body {
background-color: #000000;
}
-->
</style>
<body>
<table style="border: 1px solid; border-color: #444444; background-color:#222222;" align="center" width="100%">
  <tr>
    <th class='Stil7' colspan="5">Top 100 PvP</th>
  </tr>
  <tr>
    <th width="5%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Rank </th>
    <th width="35%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Nombre </th>
    <th width="19%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Clan</th>
    <th width="19%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Ally</th>
    <th width="20%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> PvP's </th>
  </tr>
  <?php 
require("Connection.php");
$activity = mysql_query("SELECT char_name,pvpkills,clan_name as 'pname', ally_name as 'aname', clan_data.crest_id as 'pcrest', ally_crest_id as 'acrest' FROM characters LEFT JOIN clan_data ON clan_data.clan_Id = characters.clanId Where ((pvpkills >=1) AND (accesslevel = 0)) ORDER BY pvpkills DESC, char_name ASC limit 100");
$i = 1;
while($row = mysql_fetch_array($activity))
{
	    if (!($i%2)) echo "<tr bgcolor='#000000' align='center'>";
else
echo "<tr bgcolor='#161616' align='center'>";
	echo "<td>"."<center>".$i."</center>"."</td>";
	echo "<td>"."<center>".$row['char_name']."</center>"."</td>";
	echo "<td align='left'>";
	    if ($row['pcrest'] != 0) echo "<img src='crest.php?clan_crest=".$row['pcrest']."'/> ".$row['pname']."";
	echo "</td>";
	echo "<td align='left'>";
	    if ($row['acrest'] != 0) echo "<img src='crest.php?ally_crest=".$row['acrest']."'/> ".$row['aname']."";
	echo "</td>";
	echo "<td>"."<center>".$row['pvpkills']."</center>"."</td>";
	$i++;
}
?>
</table>
</body>
</html>

  • 2 weeks later...
Posted

I made the JSP one ;)

 

<%@ page import="java.awt.*" %>
<%@ page import="java.awt.image.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="javax.imageio.*" %>
<%!

public int readInt(RandomAccessFile ra)
throws IOException
{
int b4 = (int) ra.read();
int b3 = (int) ra.read();
int b2 = (int) ra.read();
int b1 = (int) ra.read();
return (b1 << 24) | (b2 << 16) | (b3 << 8) | b4;
}

public int readShort(RandomAccessFile ra)
throws IOException
{
int b2 = (int) ra.read();
int b1 = (int) ra.read();
return ((b1 << 8) | b2);
}

%>

<%
File file = new File("Crest_268619650.bmp");
//File file = new File("Crest_268607245.bmp");
RandomAccessFile ra = new RandomAccessFile(file, "r");
byte[] content = new byte[4];
ra.read(content, 0, 4);

String ddsSTR = new String(content);
if (ddsSTR.intern() != "DDS ")
{
out.print("Error, NO DDS");
return;
}

readInt(ra); //int size = readInt(ra);
readInt(ra); //int flags = readInt(ra);
int height = readInt(ra) - 4;
int width = readInt(ra);
readShort(ra); //int extra = readShort(ra);

ra.seek(84);

int dxt1 = ra.read(content, 0, 4);
String dxt1STR = new String(content);
if (dxt1STR.intern() != "DXT1")
{
out.print("Error, NO DXT1");
return;
}

ra.seek(128);

response.setContentType("image/png");
BufferedImage buffer = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
for (int y = -1; y < (height / 4); y++)
{
for (int x = 0; x < (width / 4); x++)
{
	int color0_16 = readShort(ra);
	int color1_16 = readShort(ra);
	int r0 = (color0_16 >> 11) << 3;
	int g0 = ((color0_16 >> 5) & 63) << 2;
	int b0 = (color0_16 & 31) << 3;
	int r1 = (color1_16 >> 11) << 3;
	int g1 = ((color1_16 >> 5) & 63) << 2;
	int b1 = (color1_16 & 31) << 3;
	int color0_32 = new Color(r0, g0, b0).getRGB();
	int color1_32 = new Color(r1, g1, b1).getRGB();
	int color2_32 = new Color((r0 / 2) + (r1 / 2), (g0 / 2) + (g1 / 2), (b0 / 2) + (b1 / 2)).getRGB();
	int black = new Color(0, 0, 0).getRGB();
	int data = readInt(ra);

	for (int yy = 0; yy < 4; yy++)
	{
		for (int xx = 0; xx < 4; xx++)
		{
			int bb = data & 3;
			data = data >> 2;
			int color = 0;
			switch(bb)
			{
				case 0:
					color = color0_32;
					break;
				case 1:
					color = color1_32;
					break;
				case 2:
					color = color2_32;
					break;
				default:
					color = black;
					break;
			}
			int locX = x * 4 + xx;
			int locY = y * 4 + yy;
			buffer.setRGB(Math.abs(locX), Math.abs(locY), color);
		}
	}
}
}

OutputStream os = response.getOutputStream();
ImageIO.write(buffer, "png", os);

%>

  • 2 months later...
Posted

I made the JSP one ;)

 

<%@ page import="java.awt.*" %>
<%@ page import="java.awt.image.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="javax.imageio.*" %>
<%!

public int readInt(RandomAccessFile ra)
throws IOException
{
int b4 = (int) ra.read();
int b3 = (int) ra.read();
int b2 = (int) ra.read();
int b1 = (int) ra.read();
return (b1 << 24) | (b2 << 16) | (b3 << 8) | b4;
}

public int readShort(RandomAccessFile ra)
throws IOException
{
int b2 = (int) ra.read();
int b1 = (int) ra.read();
return ((b1 << 8) | b2);
}

%>

<%
File file = new File("Crest_268619650.bmp");
//File file = new File("Crest_268607245.bmp");
RandomAccessFile ra = new RandomAccessFile(file, "r");
byte[] content = new byte[4];
ra.read(content, 0, 4);

String ddsSTR = new String(content);
if (ddsSTR.intern() != "DDS ")
{
out.print("Error, NO DDS");
return;
}

readInt(ra); //int size = readInt(ra);
readInt(ra); //int flags = readInt(ra);
int height = readInt(ra) - 4;
int width = readInt(ra);
readShort(ra); //int extra = readShort(ra);

ra.seek(84);

int dxt1 = ra.read(content, 0, 4);
String dxt1STR = new String(content);
if (dxt1STR.intern() != "DXT1")
{
out.print("Error, NO DXT1");
return;
}

ra.seek(128);

response.setContentType("image/png");
BufferedImage buffer = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
for (int y = -1; y < (height / 4); y++)
{
for (int x = 0; x < (width / 4); x++)
{
	int color0_16 = readShort(ra);
	int color1_16 = readShort(ra);
	int r0 = (color0_16 >> 11) << 3;
	int g0 = ((color0_16 >> 5) & 63) << 2;
	int b0 = (color0_16 & 31) << 3;
	int r1 = (color1_16 >> 11) << 3;
	int g1 = ((color1_16 >> 5) & 63) << 2;
	int b1 = (color1_16 & 31) << 3;
	int color0_32 = new Color(r0, g0, b0).getRGB();
	int color1_32 = new Color(r1, g1, b1).getRGB();
	int color2_32 = new Color((r0 / 2) + (r1 / 2), (g0 / 2) + (g1 / 2), (b0 / 2) + (b1 / 2)).getRGB();
	int black = new Color(0, 0, 0).getRGB();
	int data = readInt(ra);

	for (int yy = 0; yy < 4; yy++)
	{
		for (int xx = 0; xx < 4; xx++)
		{
			int bb = data & 3;
			data = data >> 2;
			int color = 0;
			switch(bb)
			{
				case 0:
					color = color0_32;
					break;
				case 1:
					color = color1_32;
					break;
				case 2:
					color = color2_32;
					break;
				default:
					color = black;
					break;
			}
			int locX = x * 4 + xx;
			int locY = y * 4 + yy;
			buffer.setRGB(Math.abs(locX), Math.abs(locY), color);
		}
	}
}
}

OutputStream os = response.getOutputStream();
ImageIO.write(buffer, "png", os);

%>

for what is this?

 

And, mrchucky can you put a class info from characteres and make a file for heroes too?

 

thx guy!

  • 3 weeks later...
  • 2 weeks later...
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Posts

    • Server mid rate craft PvP   CLIENTE INTERLUDE Website server Discord olympus x25 &nbsp;server 🇧🇷🇦🇷🇨🇱🇬🇷🇲🇽🇵🇪🇸🇰🇪🇸🇺🇾 Server mid rate craft PvP 🔱CLIENTE INTERLUDE🔱 🔅xpx25 🔅Sp x25 🔅Adena x15 🔅Droop x2 🔅Spoil x2 🔅Raidboss xp x2 🔅Raidboss sp x2 🔅Raidboss droop x1 🔅All Rate quest reward  x1 ⚠️All Quest drop reward. x1 🔅Manor x 3 🔅Seal stone x1 🛡️🗡️INFO GRADO S🗡️🛡️ ⚠️Inicia desabilitado drop/spoil/quest. 🔱PROFESIONES/SUBCLASS🔱 🛡️1st profession - 50medal 🛡️2nd profession - 500 medal 🛡️3rd profession - 1k medal +30kk adena 🛡️Sub class - Quest. No necesita matar raids. ⚙️Configuraciones⚙️ 🛡️Gmshop  grade - B. 🛡️Grade A-S Craft - yes x1 chance 🛡️Globlal teleport - yes 🛡️Buffer 1hora. 🛡️Buffer slot 24(+4divine)+12 dances-song 🛡️Auto learn skils - yes 🛡️Autoloot - yes 🛡️Mana potion recarga 1000 ,9segundos delay. 🛡️Champions system:     ▫️lvl 30 - 76     ▫️chance respawn 0.5%.     ▫️adena x20 🛡️Max lvl party 14 lvl. 🛡️Festive sweeper on. 🛡️Max client pc 2. 🛡️Raid boss respawn retail. 🛡️Nobleza quest - yes. 🛡️Barakiel respawn 6 horas + -30 min. 🛡️Olimpiada duracion 14 dias. 🛡️Olimpiada de 18:00 a 00:00 🛡️Safe enchant +3 🛡️Normal enchant scroll 50% ⚠️+11-16 chance 30% 🛡️Bleesed enchant scroll 55% ⚠️+11-16 chance 35% 🛡️Rate dinamico x1 lvl 77-80   🛡️🗡️CLANES INFO🗡️🛡️ 🔅Crear clan min. level 20 🔅Max Alianzas 1 🔅Duracion penalidades clan / alianzas 8 horas. 🔅Cambio de lider 24 horas. 🛡️⚔️ ASEDIOS ⚔️🛡️ 🔅Cada 2 semanas. 🔅Proteccion hwid 1 pc. 🔅Clanes registrados. acceden a zona de asedio. 🔅Castillo asediable Aden. 🔅Reward 1000 FA 🔅Horario 16:00 GMT-3 🎊PACK DE INICIO🎊 🔅Start set - armor\weapon no grade. 🔅Level 20  - 5 shadow cuppon grado D 🔅Level 40 - 5 shadow cuppon grado C 🔅Free Autofarm 24 horas. 💰 INFO PREMIUM 💰 🔅Free autofarm. 🔅xp x30 🔅sp x30 🔅adena x17 🔅drop x4 🔅spoil x4 🔅enchant +2% 🔅seal stone x1 🔅Altb Gk-Gmshop/buffe ⚔️ RAID  BOSS INFO ⚔️ 🔅Raid boss 70 ++ respawn 5 días despues. 🔅Raid boss 75 ++ respawn 15 días despues 🔅Drop LETTER L2DAY para tradear en GMshop. ⚔️ INFO SEVEN SING ⚔️ 🔅Inicio del drop Seal stones dia 5 de iniciado el server. 🎊 EPIC RAID INFO 🎊 🔅Queen Ant (lvl 40)respawn Lunes a Viernes 22:00 GMT-3 drop chance 30%. 🔅Core (lvl 80)respawn Martes-miercoles 20:20 GMT-3 drop chance 100%. 🔅Orfen (lvl 80)respawn Martes-miercoles 21:00 GMT-3 drop chance 100%. 🔅Zaken (lvl 80)respawn Jueves 23:00 GMT-3 drop chance 100%. 🔅Frintezza (lvl 80)respawn Viernes 23:00 GMT-3 drop chance 100%. 🔅Baium (lvl 80)respawn Sabado 22:00 GMT-3 drop chance 100%. 🔅Valakas (lvl 80)respawn Domingo 20:00 GMT-3 drop chance 100%. 🔅Antharas (lvl 80)respawn Domingo 22:00 GMT-3 drop chance 100%.
    • The server is running in l2house.com.ar with C4 mode and in L2Tekila within the same login you can also test it in C5, if you want me to raise another chronicle to test, just let me know.
    • video nice song TopGear  gaming 1990    ....  
    • I have a system where Accounts are saved on login screen for fast login. I am playing a server where this feature is not on the logic screen. How I can try to add this feature to the system? I don't know what files I would have to touch.   Thanks!!
  • Topics

×
×
  • Create New...