session_start(); include "conf.php"; if($fuck==1){print "";} include "functions.php"; ?> $data = mysql_connect($base_name, $base_user, $base_pass); mysql_select_db($db_name,$data); mysql_query("SET CHARSET cp1251"); if (ereg("[<>\\/-]",$act)) {print "?!"; exit();} $act=htmlspecialchars($act); $sql = "SELECT * FROM characters WHERE login='$login'"; $result = mysql_query($sql); $db = mysql_fetch_array($result); $creator = $db["battle_pos"]; $opponent = $db["battle_opponent"]; $bid = $db["battle"]; $team = $db["battle_team"]; function showHPMPop($who){ $result = mysql_query("SELECT * FROM characters WHERE login='$who'"); mysql_query("SET CHARSET cp1251"); $db = mysql_fetch_array($result); if (ereg("[<>\\/-]",$log)) {print "?!"; exit();} $log=htmlspecialchars($log); $level=$db["level"]; $wis=$db["wis"]; $hp[0]=$db["hp"]; $hp[1]=$db["hp_all"]; $mp[0]=$db["mp"]; $mp[1]=$db["mp_all"]; $orden_d = $db["orden"]; $clan_s = $db["clan_short"]; $clan_f = $db["clan"]; $travm = $db["travm"]; $rang = $db["rang"]; $pl1 = str_replace(" ","%20",$who); if($travm!=0){ $travm_i = ""; } else{$travm_i="";} if($orden_d==1){$orden_dis="Белое братство";} else if($orden_d==2){$orden_dis="Темное братство";} else if($orden_d==3){$orden_dis="Нейтральное братство";} else if($orden_d==4){$orden_dis="Алхимик";} else if($orden_d==5){$orden_dis="Тюремный заключеный";} if(empty($clan_s)){$clan="";} else{$clan="";} if(empty($orden_d)){$orden="";} else{ if ($orden_d==2) {$orden="";} else{$orden="";} if ($orden_d==1) {$orden="";} } print "
showHPMP($login); showPlayer($login); ?> |
if($winer!=0 AND $loser!=0){
$b = 0;
}
if($b == 1){
showHeader($login);
}
if($act == "magic"){
$GET_DAT = mysql_query("SELECT * FROM inv WHERE id='$scroll' AND owner='$login'");
$SCROLL = mysql_fetch_array($GET_DAT);
$obj_id = $SCROLL["object_id"];
$GET_SCROLL = mysql_query("SELECT * FROM scroll WHERE id='$obj_id'");
$SCROLL_DATA = mysql_fetch_array($GET_SCROLL);
$name = $SCROLL_DATA["name"];
$min_v = $SCROLL_DATA["min_wis"];
$min_i = $SCROLL_DATA["min_int"];
$min_l = $SCROLL_DATA["min_level"];
$tear_max = $SCROLL_DATA["tear_max"];
$iznos = $SCROLL["iznos"];
$orden = $SCROLL_DATA["orden"];
$mp = $SCROLL_DATA["mp"];
$school = $SCROLL_DATA["school"];
$file = $SCROLL_DATA["file"];
if($min_i == ''){$min_i=0;}
if(!empty($orden)){
if($orden == $db["orden"]){
$ordens = 1;
}
else{
$ordens = 0;
}
}
else{
$ordens = 1;
}
if($db["int"]>=$min_i && $db["wis"]>=$min_v && $db["level"]>=$min_l && $ordens == 1 && $db["mp"]>=$mp){
$cast_d = $db["cast"];
$cast = floor(($cast_d/100 + 1)*70.9);
$cast_suc=array();
for($i=0;$i<=$cast;$i++){
$cast_suc[$i]=$i;
}
for($i=$cast+1;$i<=100;$i++){
$cast_suc[$i]="empty";
}
$cast_numer=rand(0,100);
$is_cast="0";
for($i=0;$i<=100;$i++){
if($cast_numer==$cast_suc[$i]){
$is_cast="1";
}
}
if($is_cast == "0"){
print " Вам неудалось прокастовать это заклинание! "; print "вернуться"; $S = mysql_query("UPDATE inv SET iznos = iznos+1 WHERE id=$scroll"); $S_INV = mysql_query("SELECT * FROM inv WHERE id = $scroll"); $DAT = mysql_fetch_array($S_INV); $iznos = $DAT["iznos"]; $tear_max = $DAT["tear_max"]; $iznos_k = $iznos+1; if($iznos_k>=$tear_max){ $S_D = mysql_query("DELETE FROM inv WHERE id = $scroll"); } $SQL = mysql_query("UPDATE characters SET cast = cast+0.1 WHERE login='$login'"); } else{ include "magic/$file"; } } else{ print " У Вас недостаточно параметров для кастования этого заклятия! "; print "вернуться"; } } if($db["hp"]<=0 AND $b == 1){ print "Для вас бой окончен. Ожидаем окончания поединка... "; print " "; print " "; print " "; print " "; print " ",$dis_file[0]); $c = count($dis)-1; if($c>30){$b = $c; $e = $c-30; $l = 1;} else{$b = $c; $e = 0; $l = 0;} for($i = $b;$i >= $e;$i--){ print "$dis[$i] "; } if($l == 1){ print " Вырезано для уменьшения объема. Полный лог боя здесь. "; } if($team == 1){ $P_HIT = mysql_query("SELECT * FROM team1 WHERE battle_id='$creator' AND player='$login'"); } else if($team == 2){ $P_HIT = mysql_query("SELECT * FROM team2 WHERE battle_id='$creator' AND player='$login'"); } $P_HDATA = mysql_fetch_array($P_HIT); $hitted = $P_HDATA["hitted"]; print " |
if($opponent!='' AND $db["hp"]>0){ $bot = 0; $BOT_L = mysql_query("SELECT * FROM bot_temp WHERE battle_id='$bid'"); while($BOT_D = mysql_fetch_array($BOT_L)){ if($BOT_D["bot_name"] == $opponent){ $bot = 1; $prototype = $BOT_D["prototype"]; } } if($bot == 0){ showHPMPop($opponent); showPlayer($opponent); } else if($bot == 1){ showHPMPBot($opponent,$bid); showPlayer($prototype); } } else{ $num = rand(1,21); print ""; } ?> |