PDA

View Full Version : [MU] Xin hỏi về cách Reset Master



luutrunhac
06-03-12, 12:27 AM
Hiện tại mình đang mò 2 file sau nhưng ko biết điều chỉnh làm sao để có thể Reset điểm Master và Level Master thay cho Reset thường và tẩy điểm thường sau khi Reset.
Table chứa thông tin Level và Point của nhân vật là Table Character với Column cLevel và LevelUpPoint.
Table chưa thông tin Level Master và Point Master của nhân vật là Table T_SkillTree_Info và column MASTER_LEVEL, ML_POINT.
Xin cảm ơn và hậu tạ [-O<


taisinh_reset.cl.php

<?php

if (eregi("taisinh_reset.cl.php", $_SERVER['SCRIPT_NAME'])) { die(); }
require("error.php");
require("anti.php");
if(isset($_SESSION['t_k']) && isset($_SESSION['m_k']) && isset($_GET['charid']) && isset($_GET['tslvl'])){
$login = stripslashes($_SESSION['t_k']);
$charid = stripslashes($_GET['charid']);
$id = intval($_GET['tslvl']);
include('mssql.php');
if(strlen($charid) < 4 || strlen($charid) > 10)
{die(char_fail);}
else if(strlen($login) < 4 || strlen($login) > 10)
{die(loiacc);}
else if (eregi("[^a-zA-Z0-9]", $login) || eregi("[^a-zA-Z0-9]", $charid))
{ die(char_fail); }
else
{
include('fuc.php');
$a = mssql_query("SELECT Resets,taisinh FROM Character WHERE AccountID ='".chuvaso($login)."' and Name ='".secure($charid)."'");
$numa = mssql_num_rows($a);
if($numa >= 1){
$cota = mssql_fetch_row($a);
$b = mssql_query("SELECT nganhang_zen,nganhang_chaos FROM MEMB_INFO WHERE memb___id ='".chuvaso($login)."'");
$cotb = mssql_fetch_row($b);
include('cauhinh/taisinh_reset.ch.php');
if($id > $taisinh['maxlvl'])
{die(tslvl);}
else{
for($i=0;$i<$taisinh['maxlvl'];++$i)
{
$rank =$i+1;
switch ($id) {
case $rank:
$upzen =number_format($taisinh['zen']*$rank, "", ",", "");
$upchao =number_format($taisinh['chaos']*$rank, "", ",", "");
$upzenb =number_format($cotb[0]-$upzen, "", ",", "");
$upchaosb =number_format($cotb[1]-$upchao, "", ",", "");
if($cotb[0] < $upzen || $upzenb < 0)
{echo(tszen.number_format($taisinh['zen']));}
if($cotb[1] < $upchao || $upchaosb < 0)
{echo(rechaos.$cotb[1]);}
else if($cotb[0] >= $upzen && $cotb[1] >= $upchao)
{
$up_poin =($taisinh['poin1']*$rank)*($cota[1]+1);
$upts =($cota[1]+1);
$query =mssql_query("
Update Character set cLevel='".$taisinh['lvl']."',LevelUpPoint='$up_poin',Resets='".$taisinh['reset']."',taisinh='$upts' where Name='".secure($charid)."';
Update MEMB_INFO set nganhang_zen='".$upzenb."',nganhang_chaos ='".$upchaosb."' where memb___id ='".chuvaso($login)."'");
if($query)
{echo upts.$upts.'<script type="text/javascript">
$("#bankzen").html("'.number_format($upzenb).'");
$("#bankchaos").html("'.number_format($upchaosb).'");
$("#lvl'.$charid.'").html("'.$taisinh['lvl'].'");
$("#poin'.$charid.'").html("'.number_format($up_poin).'");
$("#rs'.$charid.'").html("'.number_format($taisinh['reset']).'");
$("#ts'.$charid.'").html("'.$upts.'");</script>';}
else{echo bugquery;}
}
break;
}
}
}
}
else{ echo(chardie); }
}
}
?>

Reset_check.php

<?php
if (eregi("reset_check.php", $_SERVER['SCRIPT_NAME'])) { die(""); }
require("error.php");
require("anti.php");
include('cauhinh/bat_mo.php');
if ($modu['resets_taisinh']==0) { echo(khoa_mod); }
else if (isset($_SESSION['t_k']) && isset($_SESSION['m_k']) && isset($_GET['nv']) && isset($_GET['charid'])){
$login = stripslashes($_SESSION['t_k']);
$char_info = stripslashes($_GET['charid']);
include('mssql.php');
include('mysql.php');
if(strlen($char_info) < 4 || strlen($char_info) > 10)
{die(char_fail);}
else if (eregi("[^a-zA-Z0-9]", $login) || eregi("[^a-zA-Z0-9]", $char_info))
{ die(char_fail); }
else
{
include('fuc.php');
include('cauhinh/taisinh_reset.ch.php');
$y = mssql_query("SELECT cLevel,Class,Money,Resets,taisinh,reset_luc FROM Character WHERE Name ='".secure($char_info)."'");
$numy =mssql_num_rows($y);
if($numy ==1){
$coty = mssql_fetch_row($y);
$y1 = mssql_query("SELECT vip FROM MEMB_INFO WHERE memb___id ='".chuvaso($login)."'");
$coty1 = mssql_fetch_row($y1);
if($coty1[0] >=1){$vipreset ="Select Tu,Den,Poin,Lvl,Zen,Chaos,Greation,Blue,Harmony,Ri ng_pt From CauHinh_ResetVip where Tu <='".intval($coty[3])."' and Den >='".intval($coty[3])."'"; }
else{$vipreset ="Select Tu,Den,Poin,Lvl,Zen,Chaos,Greation,Blue,Harmony,Ri ng_pt From CauHinh_Reset where Tu <='".intval($coty[3])."' and Den >='".intval($coty[3])."'"; }

$a = mysql_query($vipreset);
$num_rs = mysql_num_rows($a);

if ( $num_rs >0) {
$ch_rs = mysql_fetch_row($a);
if ( $ch_rs[0] <= $coty[3] && $ch_rs[1] >= $coty[3])
{
$conn=odbc_pconnect($dbmssql['db'],$dbmssql['use'],$dbmssql['pw']);
if (!$conn)
{exit("ODBC Connection Failed: ");}
$sql="SELECT Inventory FROM Character WHERE Name ='".secure($char_info)."'";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
while (odbc_fetch_row($rs))
{
$compname=odbc_result($rs,"Inventory");
$inventory = bin2hex($compname);
$inventory = strtoupper($inventory);
$inventorya = substr($inventory, 384, 3072);
$chaos = 0;
$cre = 0;
$blue = 0;
$dataohoa = 0;
$nhanphuthuy = 0;
for($x=0; $x<96; ++$x)
{
$item = substr($inventorya,$x*32,32);
$codec = substr($item, 0, 32);
$codea = substr($codec,0,5);
$codeb = substr($codec,18,5);
if(($codea =="0F000") and ($codeb == "C0000")){
$delc[$chaos] = $codec;
++$chaos;
}
if(($codea =="16000") and ($codeb == "E0000")){
$delcr[$cre] = $codec;
++$cre;
}
if(($codea =="0E000") and ($codeb == "D0000")){
$del_blue[$blue] = $codec;
++$blue;
}
if(($codea =="2A009") and ($codeb == "E0000")){
$del_har[$dataohoa] = $codec;
++$dataohoa;
}
if(($codea =="14001") and ($codeb == "D0000")){
$del_ringpt[$nhanphuthuy] = $codec;
++$nhanphuthuy;
}
}
}

if ( $capdo_thieu = ($ch_rs[3] - $coty[0]) )
{ $can_capdo = re.' <font color=#FF0000>'.$capdo_thieu.'</font> '.capdo.'<br>'; }
if ( $zen_thieu = ($ch_rs[4] - $coty[2]) )
{ $can_zen = re.' <font color=#FF0000>'.number_format($zen_thieu).'</font> '.zen.'<br>'; }
if ( $chaos_thieu = ($ch_rs[5] - $chaos) )
{ $can_chaos = re.' <font color=#FF0000>'.($chaos_thieu).'</font> Chaos<br>'; }
if ( $cre_thieu = ($ch_rs[6] - $cre) )
{ $can_cre = re.' <font color=#FF0000>'.($cre_thieu).'</font> Creation<br>'; }
if ( $blue_thieu = ($ch_rs[7] - $blue) )
{ $can_blue = re.' <font color=#FF0000>'.($blue_thieu).'</font> Blue<br>'; }
if ( $har_thieu = ($ch_rs[8] - $dataohoa) )
{ $can_har = re.' <font color=#FF0000>'.($har_thieu).'</font> Harmony<br>'; }
if ( $ringpt_thieu = ($ch_rs[9] - $nhanphuthuy) )
{ $can_ringpt = re.' <font color=#FF0000>'.($ringpt_thieu).'</font> Nhẫn Phù Thủy<br>'; }

if ($capdo_thieu <= 0 ){$can_capdo="";}
if ($zen_thieu <= 0 ){$can_zen="";}
if ($chaos_thieu <= 0 ){$can_chaos="";}
if ($cre_thieu <= 0 ){$can_cre="";}
if ($blue_thieu <= 0 ){$can_blue="";}
if ($har_thieu <= 0 ){$can_har="";}
if ($ringpt_thieu <= 0 ){$can_ringpt="";}

if ( $coty[0] < $ch_rs[3] || $coty[2] < $ch_rs[4] || $chaos < $ch_rs[5] || $cre < $ch_rs[6] || $blue < $ch_rs[7] || $dataohoa < $ch_rs[8] || $nhanphuthuy < $ch_rs[9])
{ $reset_view = '
'.$can_capdo.'
'.$can_zen.'
'.$can_chaos.'
'.$can_cre.'
'.$can_blue.'
'.$can_har.'
'.$can_ringpt.''; }
else if ( $coty[0] >= $ch_rs[3] && $coty[2] >= $ch_rs[4] )
{

$gameid = mssql_query("Select GameIDC From AccountCharacter where ID='".chuvaso($login)."' and GameIDC='".chuvaso($char_info)."'");
$time = time();
$rstruoc = ($reset['time']*60)+$coty[5];
$untimers = $reset['time']-(($time-$coty[5])/60);
if ($time < $rstruoc )
{$reset_view = timeleft.'['.date("H:i d-m-Y",$coty[5]).'], <b>'.intval($untimers).'</b> '.timeleft2;}
elseif (mssql_num_rows($gameid)==1)
{$reset_view = gamechange;}
else
{

$new_inventory = $inventory;
for($i=0; $i<$ch_rs[5]; ++$i)
{
$new_inventory = str_replace($delc[$i],"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", $new_inventory);
}

for($j=0; $j<$ch_rs[6]; ++$j)
{
$new_inventory = str_replace($delcr[$j],"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", $new_inventory);
}

for($k=0; $k<$ch_rs[7]; ++$k)
{
$new_inventory = str_replace($del_blue[$k],"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", $new_inventory);
}

for($l=0; $l<$ch_rs[8]; ++$l)
{
$new_inventory = str_replace($del_har[$l],"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", $new_inventory);
}

for($m=0; $m<$ch_rs[9]; ++$m)
{
$new_inventory = str_replace($del_ringpt[$m],"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", $new_inventory);
}

$timtong = mysql_query("SELECT sum(T_Poin) FROM CauHinh_Reset where Den < '".$coty[3]."'");
$tong = mysql_fetch_row($timtong);

$resetpoint=(((($coty[3]-$ch_rs[0]+1)*$ch_rs[2])+$tong[0])+($coty[4]*$taisinh['poin1']));
$resetmoeny = ($coty[2]-$ch_rs[4]);
$uprs =($coty[3]+1);

//elf
if ($coty[1] == 32 || $coty[1] == 33 || $coty[1] == 34 || $coty[1] == 35)
{$Strength=22;$Dexterity=25;$Vitality=20;$Energy=1 5;$MapNumber=3;$MapPosX=175;$MapPosY=100;$Mapdir=4 ;}
//soul
else if ($coty[1] == 0 || $coty[1] == 1 || $coty[1] == 2 || $coty[1] == 3)
{$Strength=18;$Dexterity=18;$Vitality=15;$Energy=3 0;$MapNumber=0;$MapPosX=143;$MapPosY=134;$Mapdir=0 ;}
//Vo Si
else if ($coty[1] == 96 || $coty[1] == 97 || $coty[1] == 98)
{$Strength=18;$Dexterity=18;$Vitality=15;$Energy=3 0;$MapNumber=0;$MapPosX=143;$MapPosY=134;$Mapdir=0 ;}
//bk
else if ($coty[1] == 16 || $coty[1] == 17 || $coty[1] == 18 || $coty[1] == 19)
{$Strength=28;$Dexterity=20;$Vitality=25;$Energy=1 0;$MapNumber=0;$MapPosX=143;$MapPosY=134;$Mapdir=0 ;}
//MG
else if ($coty[1] == 48 || $coty[1] == 49 || $coty[1] == 50)
{$Strength=26;$Dexterity=26;$Vitality=26;$Energy=2 6;$MapNumber=0;$MapPosX=143;$MapPosY=134;$Mapdir=0 ;}
//DL
else if ($coty[1] == 64 || $coty[1] == 65 || $coty[1] == 66)
{$ship="Leadership='".$reset['cmd']."',";$Strength=26;$Dexterity=26;$Vitality=26;$Energy=2 6;$MapNumber=0;$MapPosX=143;$MapPosY=134;$Mapdir=0 ;}
//Sum
else if ($coty[1] == 80 || $coty[1] == 81 || $coty[1] == 82 || $coty[1] == 83)
{$Strength=21;$Dexterity=21;$Vitality=18;$Energy=2 3;$MapNumber=0;$MapPosX=143;$MapPosY=134;$Mapdir=0 ;}
if($coty1[0] >=0){$xoado ="$new_inventory";}
else{$xoado =$code['Inventory'];}
$c = mssql_query("Update Character set cLevel='".$reset['lvl']."',experience='0',LevelUpPoint='".intval($resetpoint)."',Resets='$uprs',strength='$Strength',dexterity='$ Dexterity',vitality='$Vitality',energy='$Energy',$ ship Money='".intval($resetmoeny)."',MapNumber='$MapNumber',MapPosX='$MapPosX',MapPos Y='$MapPosY',MapDir='$Mapdir',reset_luc='$time',In ventory=CONVERT(varbinary(1728), 0x".$xoado.") WHERE Name ='".secure($char_info)."'");
$thang =date("n");
$rs_t =mssql_query("Select Name from ResetT$thang where Name ='".secure($char_info)."'");
$numrs_t =mssql_num_rows($rs_t);
if($numrs_t >=1){
mssql_query("Update ResetT$thang set point =(point+1) where Name ='".secure($char_info)."'");
}
else if($numrs_t ==0){
mssql_query("INSERT INTO ResetT$thang (Name,point) VALUES ('".secure($char_info)."','1')");
}
$reset_view = rsok.$uprs.'<script type="text/javascript">
$("#lvl'.$char_info.'").html("'.$reset['lvl'].'");
$("#poin'.$char_info.'").html("'.number_format($resetpoint).'");
$("#rs'.$char_info.'").html("'.number_format($uprs).'");
</script>'.'. <u class=tro onclick="getlink(\'subpanel\',\'op.php?nv=congdiem&mod=congdiem&name='.$char_info.'&class='.$coty[1].'\');">'.congdiem.'</u>'.$chaos;
}
}
}
}
else{$reset_view= rers; }

for($i=0;$i<$taisinh['maxlvl'];++$i)
{
$rank =$i+1;
$rank2 =($taisinh['rs1']*$rank);
if ( $coty[3] >= $rank2){
$ts1_check ="<a href=\"javascript:void(0)\" class=\"congpoin\" onclick=\"getlink('subpanel','op.php?ok=taisinh_reset.cl&charid=$char_info&tslvl=$rank&nocahe=".rand(1,99999)."');\">".tsok."</a>";
}
else{$ts1_check = "<i class=do>".no_ts."</i>";}
$rsts_show .="<tr>
<td align=left>".t_s.cap.$rank." <b>[".$rank2."]</b> $ts1_check</td>
</tr>";
}
}

echo("<table bgcolor=\"#100f01\" cellpadding=0 cellspacing=15 border=0>
<tr>
<td bgcolor=#100f01 align=center class=\"text\">");
if(empty($char_info)){die(nochar);}
else if ($numy <=0) { echo(chardie); }
else { echo("<b class=do>$char_info</b><fieldset class=fieldset><legend align=center class=subrank>Resets</legend>
<table align=center width=420 cellpadding=0 cellspacing=0 border=0 class=blue>
<tr>
<td align=left>$reset_view</td>
</tr>
</table></fieldset>
<fieldset class=fieldset><legend align=center class=subrank class=\"text\">".t_s."</legend>
<table align=center width=420 cellpadding=0 cellspacing=5 border=0 class=blue>
$rsts_show
</table></fieldset>");
}
echo("</td>
</tr></table>");
}
}
else {echo ($nologin); }
?>