Code:
<?php
include "sys_/func_market.inc.php";
function Show65kStats($stat_value)
{
if ($stat_value < 0)
{
$stat_value = $stat_value + 65536;
return $stat_value;
}
return $stat_value;
}
$c_file = file("sys_/muweb_db/".character_tDB.""); foreach ($c_file as $c_info){ $id = clean_variable($_GET['op2']); $c_info = explode("|(*./)|",$c_info); if($c_info[0] == $id){ $found=1; break; } } $req = 5; if($found == 1){ if($c_info[11] < $req){ $new_req = $c_info[11]+1; $new_ranking = "$c_info[0]|(*./)|$c_info[1]|(*./)|$c_info[2]|(*./)|$c_info[3]|(*./)|$c_info[4]|(*./)|$c_info[5]|(*./)|$c_info[6]|(*./)|$c_info[7]|(*./)|$c_info[8]|(*./)|$c_info[9]|(*./)|$c_info[10]|(*./)|$new_req|(*./)|$c_info[12]|(*./)|$c_info[13]|(*./)|$c_info[14]|(*./)|$c_info[15]|(*./)|$c_info[16]|(*./)|$c_info[17]|(*./)|$c_info[18]|(*./)|\n"; $old_db = file("sys_/muweb_db/".character_tDB.""); $new_db = fopen("sys_/muweb_db/".character_tDB."", "w"); foreach($old_db as $old_db_line){ $old_db_arr = explode("|(*./)|", $old_db_line); if($c_info[0] != $old_db_arr[0]){ fwrite($new_db,"$old_db_line"); }else{ fwrite($new_db,$new_ranking); } } fclose($new_db); switch ($c_info[2]){ case 0: case 1: case 2: $cls='01'; break; case 16: case 17: case 18: $cls='02'; break; case 32: case 33: case 34: $cls='03'; break; case 48: case 49: case 50: $cls='04'; break; case 64: case 65: case 66: $cls='05'; break; case 80: case 81: case 82: $cls='06'; break; } switch ($c_info[10]){ case 0: $c_info[10] = "N/A"; break; }
$name = htmlentities(md5_decrypt($c_info[1]));
$sqll= mssql_query("declare @items varbinary(1728);
set @items = (select [Inventory] from [Character] where [Name]='$name');
print @items;");
$sqll=mssql_get_last_message();
$sqll = substr($sqll,2);
$i = -1;
while($i<11) {
$i++;
$excoptempty=0;
$db_item_code[$i]= substr($sqll,(32*$i), 32);
if($db_item_code[$i] != 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'){
$db_item_info[$i] = ItemInfoInventary(substr($sqll,(32*$i), 32));
if($db_item_info[$i] == NULL){
$overlib[$i] = "onmouseover=\"Tip('Unknown Item');\" onmouseout=\"UnTip();\"";
}
else
{
if($db_item_info[$i]['exl'] == NULL){
$excoptempty=1;
}
$db_item_info[$i]['exl']='<font color=green>'.str_replace('^^','<br>', $db_item_info[$i]['exl']).'</font>';
if($db_item_info[$i]['level']){
$db_item_info[$i]['level']=" +".$db_item_info[$i]['level'];
}
else
{
$db_item_info[$i]['level']=NULL;
}
if(!$db_item_info[$i]['level']){
if($db_item_info[$i]['opt']){
$db_item_info[$i]['level']=" +0";
}
}
if($excoptempty==1){
$db_item_info[$i]['exl']='';
}
$title_content[$i]="".$db_item_info[$i]['name']."".$db_item_info[$i]['level']."<br><br><font color=white>Durability: ".$db_item_info[$i]['dur']."<br>Serial ID: ".$db_item_info[$i]['sn']."</font><br><br>".$db_item_info[$i]['luck']."".$db_item_info[$i]['opt']."<br>".$db_item_info[$i]['exl']."";
$overlib[$i] = "onmouseover=\"Tip('$title_content[$i]');\" onmouseout=\"UnTip();\"";
}
}
}
?>
<table width="530" align="center" border="0" cellspacing="0" cellpadding="0">
<tr><td width="140">
<table width="540" align="center" border="0" cellspacing="0" cellpadding="0">
<tr><td align="left" class="full_title"><em><?php print character_name;?> :: <?php print htmlentities(md5_decrypt($c_info[1])) ;?></em></td></tr>
</table></td></tr></table>
<table width="530" align="center" border="0" cellspacing="0" cellpadding="0">
<tr><td width="150" rowspan="11" valign="top"><br><img src="<?php print $muweb['images']; ?>/<?php print $cls; ?>.jpg" width="155" height"147"></td>
<td width="50" rowspan="11"> </td>
<td class="full_title_2"><?php print classe;?> :: <?php print class_list($c_info[2],'long'); ?></td>
</tr>
<tr>
<td class="full_title_2">LvL :: <font color="#ff9900"><?php print $c_info[3]; ?></font> with <font color="#ff0000"><?php print $c_info[4]; ?></font> resets</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<table width="330" align="center" border="0" cellspacing="0" cellpadding="0" class="rankings-table">
<tr><thead>
<td class="full_title_3">Strength</td>
<td class="full_title_3">Agility</td>
<td class="full_title_3">Vitality</td>
<td class="full_title_3">Energy</td
<td class="full_title_3">Command</td
</thead></tr>
<tr class="even">
<td class="full_title_3"><?php print Show65kStats($c_info[5]); ?></td>
<td class="full_title_3"><?php print Show65kStats($c_info[6]); ?></td>
<td class="full_title_3"><?php print Show65kStats($c_info[7]); ?></td>
<td class="full_title_3"><?php print Show65kStats($c_info[8]); ?></td>
<td class="full_title_3"><?php print Show65kStats($c_info[10]); ?></td></tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td class="full_title_3">Life <?php print $c_info[14]; ?>/<?php print $c_info[13]; ?></td>
</tr>
<tr>
<td class="full_title_3">Mana <?php print $c_info[16]; ?>/<?php print $c_info[15]; ?></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td class="full_title_3"><em><?php print last_seen;?><b> <?php print decode_map($c_info[18]); ?></b></em></td>
</tr>
<tr>
<td><span class="r_link"><a href="<?php print $muweb['servername']; ?>-Profile-<?php print $c_info[17]; ?>.html"><?php print click_here_to_view_real_life_profile; ?></a></span></td>
</tr>
<tr>
<td> </td>
</tr>
</table><br>
<table width="298" height="315" border="0" cellpadding="7" cellspacing="0" bordercolor="#FFFFFF" background="template/items/inventory.jpg">
<tr>
<td height="71" colspan="7"> </td>
</tr>
<tr>
<td width="6" rowspan="5"> </td>
<td width="51" height="70" style="background-image:url(<?=$db_item_info[8][thumb];?>);background-position: center center; background-repeat:no-repeat;" <?=$overlib[8];?>></td>
<td width="22"> </td>
<td width="46" style="background-image:url(<?=$db_item_info[2][thumb];?>);background-position: center center; background-repeat:no-repeat;" <?=$overlib[2];?>></td>
<td colspan="2" style="background-image:url(<?=$db_item_info[7][thumb];?>);background-position: center center; background-repeat:no-repeat;" <?=$overlib[7];?>></td>
<td width="7" rowspan="5"> </td>
</tr>
<tr>
<td rowspan="2" style="background-image:url(<?=$db_item_info[0][thumb];?>);background-position: center center; background-repeat:no-repeat;" <?=$overlib[0];?>></td>
<td height="35" style="background-image:url(<?=$db_item_info[9][thumb];?>);background-position: center center; background-repeat:no-repeat;" <?=$overlib[9];?>></td>
<td rowspan="2" style="background-image:url(<?=$db_item_info[3][thumb];?>);background-position: center center; background-repeat:no-repeat;" <?=$overlib[3];?>></td>
<td rowspan="2"> </td>
<td rowspan="2" style="background-image:url(<?=$db_item_info[1][thumb];?>);background-position: center center; background-repeat:no-repeat;" <?=$overlib[1];?>></td>
</tr>
<tr>
<td height="70"> </td>
</tr>
<tr>
<td rowspan="2" style="background-image:url(<?=$db_item_info[5][thumb];?>);background-position: center center; background-repeat:no-repeat;" <?=$overlib[5];?>></td>
<td style="height: 30px; background-image:url(<?=$db_item_info[11][thumb];?>);background-position: center center; background-repeat:no-repeat;" <?=$overlib[11];?>></td>
<td rowspan="2" style="background-image:url(<?=$db_item_info[4][thumb];?>);background-position: center center; background-repeat:no-repeat;" <?=$overlib[4];?>></td>
<td style="height: 30px; background-image:url(<?=$db_item_info[10][thumb];?>);background-position: center center; background-repeat:no-repeat;" <?=$overlib[10];?>></td>
<td width="51" rowspan="2" style="background-image:url(<?=$db_item_info[6][thumb];?>);background-position: center center; background-repeat:no-repeat;" <?=$overlib[6];?>></td>
</tr>
<tr>
<td height="32"> </td>
<td width="19"> </td>
</tr>
<tr>
<td colspan="7" height="7"></td>
</tr>
</table>
<BR>
<?php
$sign_link="http://".$_SERVER['HTTP_HOST'].preg_replace('/\/([^\/]+?)$/', '/', $_SERVER['PHP_SELF'])."Signature-".$id.".jpg";
?>
<table width="530" align="center" border="0" cellspacing="0" cellpadding="0">
<tr><td align="center"><img src="<?php print $sign_link;?>"><BR><BR><input type="text" class="field" readonly size="<?php print strlen($sign_link);?>" value="<?php print $sign_link;?>"></td></tr></table>
<?php echo'<table width="95%"><tr><td colspan="3" align="right"><span class="full_author">Last Update '.decode_time($c_info[12],time(),'long','1 second').' ago</span></td></tr></table>'; ?>
<?php
}else{ global $db_primary; $g_r = $db_primary->Execute("Select mu_id,name,class,clevel,resets,strength,dexterity,vitality,energy,ctlcode,leadership,life,maxlife,mana,maxmana,accountid,mapnumber from character where mu_id=?",array($id)); if(!$g_r){ $g_r = $db_primary->Execute("Select mu_id,name,class,clevel,resets,strength,dexterity,vitality,energy,ctlcode,life,maxlife,mana,maxmana,accountid,mapnumber from character where mu_id=?",array($id)); $no_command = 1; } $s_r = $g_r->fetchrow(); if($s_r[0] == NULL){ header('Location: index.html'); die('redirecting...'); } if($no_command == 1){ $new_ranking = "$s_r[0]|(*./)|".md5_encrypt($s_r[1])."|(*./)|$s_r[2]|(*./)|$s_r[3]|(*./)|$s_r[4]|(*./)|$s_r[5]|(*./)|$s_r[6]|(*./)|$s_r[7]|(*./)|$s_r[8]|(*./)|$s_r[9]|(*./)|0|(*./)|$new_req|(*./)|".time()."|(*./)|$s_r[10]|(*./)|$s_r[11]|(*./)|$s_r[12]|(*./)|$s_r[13]|(*./)|".md5($s_r[14])."|(*./)|$s_r[15]|(*./)|\n"; }else{ $new_ranking = "$s_r[0]|(*./)|".md5_encrypt($s_r[1])."|(*./)|$s_r[2]|(*./)|$s_r[3]|(*./)|$s_r[4]|(*./)|$s_r[5]|(*./)|$s_r[6]|(*./)|$s_r[7]|(*./)|$s_r[8]|(*./)|$s_r[9]|(*./)|$s_r[10]|(*./)|$new_req|(*./)|".time()."|(*./)|$s_r[11]|(*./)|$s_r[12]|(*./)|$s_r[13]|(*./)|$s_r[14]|(*./)|".md5($s_r[15])."|(*./)|$s_r[16]|(*./)|\n"; } $new_req = 0; $old_db = file("sys_/muweb_db/".character_tDB.""); $new_db = fopen("sys_/muweb_db/".character_tDB."", "w"); foreach($old_db as $old_db_line){ $old_db_arr = explode("|(*./)|", $old_db_line); if($c_info[0] != $old_db_arr[0]){ fwrite($new_db,"$old_db_line"); }else{ fwrite($new_db,$new_ranking); } } fclose($new_db); $character_content = ''.updating_info_about_this_character_pleas_wait.'<meta http-equiv="refresh" content="2;URL=">'; } }else{ global $db_primary; $g_r = $db_primary->Execute("Select mu_id,name,class,clevel,resets,strength,dexterity,vitality,energy,ctlcode,leadership,life,maxlife,mana,maxmana,accountid,mapnumber from character where mu_id=?",array($id)); if(!$g_r){ $g_r = $db_primary->Execute("Select mu_id,name,class,clevel,resets,strength,dexterity,vitality,energy,ctlcode,life,maxlife,mana,maxmana,accountid,mapnumber from character where mu_id=?",array($id)); $no_command = 1; } $s_r = $g_r->fetchrow(); if($s_r[0] == NULL){ header('Location: index.html'); die('redirecting...'); } if($no_command == 1){ $new_ranking = "$s_r[0]|(*./)|".md5_encrypt($s_r[1])."|(*./)|$s_r[2]|(*./)|$s_r[3]|(*./)|$s_r[4]|(*./)|$s_r[5]|(*./)|$s_r[6]|(*./)|$s_r[7]|(*./)|$s_r[8]|(*./)|$s_r[9]|(*./)|0|(*./)|0|(*./)|".time()."|(*./)|$s_r[10]|(*./)|$s_r[11]|(*./)|$s_r[12]|(*./)|$s_r[13]|(*./)|".md5($s_r[14])."|(*./)|$s_r[15]|(*./)|\n"; }else{ $new_ranking = "$s_r[0]|(*./)|".md5_encrypt($s_r[1])."|(*./)|$s_r[2]|(*./)|$s_r[3]|(*./)|$s_r[4]|(*./)|$s_r[5]|(*./)|$s_r[6]|(*./)|$s_r[7]|(*./)|$s_r[8]|(*./)|$s_r[9]|(*./)|$s_r[10]|(*./)|0|(*./)|".time()."|(*./)|$s_r[11]|(*./)|$s_r[12]|(*./)|$s_r[13]|(*./)|$s_r[14]|(*./)|".md5($s_r[15])."|(*./)|$s_r[16]|(*./)|\n"; } $new_db = fopen("sys_/muweb_db/".character_tDB."", a); fwrite($new_db,$new_ranking); fclose($new_db); $character_content = ''.collecting_info_about_this_character_pleas_wait.'<meta http-equiv="refresh" content="2;URL=">'; } echo html($character_content);
?>
And where must to change, to reset Dark Lord commands after Reset from site?