Файл: b_totem.php
Строк: 1428
<?
define('PROTECTOR', 1);
$textl='Битва';
include('files/db.php');
include($path.'files/auth.php');
if ($user_id==0){
header('location: index.php');exit;
}
$lv=time();
$last=date('d.m.Y - H:i:s');
mysql_query("UPDATE `users` SET
`lv`='".$lv."',
`last`='".$last."',
`mesto`='".$textl."'
WHERE `id`='".$udata['id']."'");
$mobs=mysql_query("SELECT * FROM `craft` WHERE `usr`='".$udata['id']."'");
$rows=mysql_num_rows($mobs);
if($rows!=0)
{
header('location: work.php');exit;
}
$mobs1=mysql_query("SELECT * FROM `arena_usr` WHERE `usr`='".$udata['id']."'");
$rows1=mysql_num_rows($mobs1);
if($rows1!=0)
{
header('location: arena.php');exit;
}
$mobs2=mysql_query("SELECT * FROM `avan_usr` WHERE `usr`='".$udata['id']."'");
$rows2=mysql_num_rows($mobs2);
if($rows2!=0)
{
header('location: avan.php');exit;
}
$mobs3=mysql_query("SELECT * FROM `battle` WHERE `usr`='".$udata['id']."'");
$rows3=mysql_num_rows($mobs3);
if($rows3!=0)
{
header('location: battle.php');exit;
}
$mobs4=mysql_query("SELECT * FROM `ohota` WHERE `usr`='".$udata['id']."'");
$rows4=mysql_num_rows($mobs4);
if($rows4!=0)
{
header('location: b_oh.php');exit;
}
$mobs5=mysql_query("SELECT * FROM `okr_usr` WHERE `usr`='".$udata['id']."'");
$rows5=mysql_num_rows($mobs5);
if($rows5!=0)
{
header('location: b_okr.php');exit;
}
$mobs7=mysql_query("SELECT * FROM `terr_usr` WHERE `usr`='".$udata['id']."'");
$rows7=mysql_num_rows($mobs7);
if($rows7!=0)
{
header('location: terr_b.php');exit;
}
$bat=mysql_query("SELECT * FROM `clan_totem_usr` WHERE `usr`='".$udata['id']."' and `tip`!='pit'");
$num=mysql_num_rows($bat);
if($num==0)
{
header('location: game.php');exit;
}
else
{
$bt=mysql_fetch_array($bat);
$gi=mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id`='".$udata['clan']."'"));
$gus=mysql_fetch_array(mysql_query("SELECT * FROM `clan_users` WHERE `clan`='".$gi['id']."' and `usr`='".$udata['id']."'"));
$lvl=$udata['lvl']+1;
$exzn=mysql_num_rows(mysql_query("SELECT * FROM `lvl` WHERE `lvl`='".$lvl."'"));
if($exzn!=0)
{
$ex=mysql_fetch_array(mysql_query("SELECT * FROM `lvl` WHERE `lvl`='".$lvl."'"));
if($udata['exp']>=$ex['exp'])
{
$kl=$udata['lvl']+1;
if($udata['klass']==1)
{
$hp=$udata['hp1']+2;
$sila=$udata['sila1']+3;
$arm=$udata['arm1']+1;
}
if($udata['klass']==2)
{
$hp=$udata['hp1']+3;
$sila=$udata['sila1']+1;
$arm=$udata['arm1']+2;
}
if($udata['klass']==3)
{
$hp=$udata['hp1']+1;
$sila=$udata['sila1']+2;
$arm=$udata['arm1']+3;
}
mysql_query("UPDATE `users` SET `lvl`='".$kl."', `hp1`='".$hp."', `sila1`='".$sila."', `arm1`='".$arm."' WHERE `id`='".$udata['id']."'");
if($udata['ref']!=0)
{
$refer=mysql_query("SELECT * FROM `users` WHERE `id`='".$udata['ref']."'");
$ref=mysql_fetch_array($refer);
if($kl==30)
{
$ref_m=$ref['money']+100;
mysql_query("UPDATE `users` SET `money`='".$ref_m."' WHERE `id`='".$ref['id']."'");
$rows211=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$ref['id']."' and `usr2`='0'"));
if($rows211==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$ref['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$ref['id']."'");
}
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
$text='<font color=#cccccc>Ваш реферал '.$udata['usr'].' прокачался до 30 уровня. За это вы получаете <img src=img/main/p5.png>100.</font>
';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows21['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$ref['id']."'
");
}
if($kl==40)
{
$ref_m=$ref['jem']+5;
mysql_query("UPDATE `users` SET `jem`='".$ref_m."' WHERE `id`='".$ref['id']."'");
$rows211=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$ref['id']."' and `usr2`='0'"));
if($rows211==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$ref['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$ref['id']."'");
}
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
$text='<font color=#cccccc>Ваш реферал '.$udata['usr'].' прокачался до 40 уровня. За это вы получаете <img src=img/main/p13.png>5.</font>
';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows21['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$ref['id']."'
");
}
if($kl==45)
{
$ref_m=$ref['jem']+15;
mysql_query("UPDATE `users` SET `jem`='".$ref_m."' WHERE `id`='".$ref['id']."'");
$rows211=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$ref['id']."' and `usr2`='0'"));
if($rows211==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$ref['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$ref['id']."'");
}
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
$text='<font color=#cccccc>Ваш реферал '.$udata['usr'].' прокачался до 45 уровня. За это вы получаете <img src=img/main/p13.png>15.</font>
';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows21['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$ref['id']."'
");
}
if($kl==50)
{
$ref_m=$ref['jem']+30;
mysql_query("UPDATE `users` SET `jem`='".$ref_m."' WHERE `id`='".$ref['id']."'");
$rows211=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='".$ref['id']."' and `usr2`='0'"));
if($rows211==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='".$ref['id']."',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='".$ref['id']."'");
}
$rows21=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='".$ref['id']."'"));
$text='<font color=#cccccc>Ваш реферал '.$udata['usr'].' прокачался до 50 уровня. За это вы получаете <img src=img/main/p13.png>30.</font>
';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows21['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='".$ref['id']."'
");
}
}
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$udata['hp']."', `arm`='".$udata['arm']."', `sila`='".$udata['sila']."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='Ваш уровень повысился до ".$lvl."!'
");
header('location: ?');exit;
}}
if(isset($_GET['leave']))
{
if($bt['status']!=0)
{
mysql_query("DELETE FROM `clan_totem_usr` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `log_totem` WHERE `usr`='".$udata['id']."'");
mysql_query("UPDATE `mag` SET
`time`='0' WHERE `usr`='".$udata['id']."'");
$slava=$gi['slava']+$gus['slava'];
mysql_query("UPDATE `clan` SET `slava`='".$slava."' WHERE `id`='".$gi['id']."'");
mysql_query("UPDATE `clan_users` SET `slava`='0' WHERE `id`='".$gus['id']."'");
}
else
{
mysql_query("DELETE FROM `clan_totem_usr` WHERE `usr`='".$udata['id']."'");
mysql_query("DELETE FROM `log_totem` WHERE `usr`='".$udata['id']."'");
mysql_query("UPDATE `mag` SET
`time`='0' WHERE `usr`='".$udata['id']."'");
$slava=$gi['slava']+$gus['slava'];
mysql_query("UPDATE `clan` SET `slava`='".$slava."' WHERE `id`='".$gi['id']."'");
mysql_query("UPDATE `clan_users` SET `slava`='0' WHERE `id`='".$gus['id']."'");
}
header('location: ?');exit;
}
if(isset($_GET['enemy']))
{
$id=mysql_real_escape_string($_GET['enemy']);
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `clan_totem_usr` WHERE `status`='0' and `b`='".$bt['b']."' and `arr`='".$bt['arr']."' and `kom`!='".$bt['kom']."' and `id`='".$id."'"));
if($enemy!=0)
{
mysql_query("UPDATE `clan_totem_usr` SET `enemy`='".$id."' WHERE `id`='".$bt['id']."'");
}
header('location: ?');exit;
}
if(isset($_GET['elic']))
{
$els=mysql_real_escape_string($_GET['elic']);
$elic=mysql_query("SELECT * FROM `elic` WHERE `id`='".$els."' and `usr`='".$udata['id']."' and `status`='on'");
$cd=mysql_num_rows($elic);
if($cd==0)
{
header('location: ?');exit;
}
else
{
$el=mysql_fetch_array($elic);
if($el['time']>time())
{
$lg='<img src=img/main/e22.png> <font color=#999999>Зелье еще не готово.</font>';
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
header('location: ?');exit;
}
if($bt['hp']==$udata['hp'] or $bt['hp']==0)
{
$lg='<img src=img/main/e22.png> <font color=#999999>нет эффекта.</font>';
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='".$lg."'
");
header('location: ?');exit;
}
$hp=$bt['hp']+$el['ef'];
if($hp>$udata['hp'])
{
$hp=$udata['hp'];
}
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hp."' WHERE `id`='".$bt['id']."'");
$elk=$el['kol']-1;
if($elk==0)
{
mysql_query("DELETE FROM `elic` WHERE `id`='".$el['id']."'");
}
else
{
$time=time()+$el['rest'];
mysql_query("UPDATE `elic` SET `kol`='".$elk."', `time`='".$time."' WHERE `id`='".$el['id']."'");
}
if($el['ef']!=20000)
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/p21.png> <font color=#009900>Ты испил зелья и исцелился +".$el['ef']." <img src=img/main/p6.png></font>'
");
}
else
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/p21.png> <font color=#009900>Ты испил зелья и ваше здоровье востановилось <img src=img/main/p6.png></font>'
");
}
$ds=$udata['dost3a']+1;
mysql_query("UPDATE `users` SET `dost3a`='".$ds."' WHERE `id`='".$udata['id']."'");
header('location: ?');exit;
}
}
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `clan_totem_usr` WHERE `status`='0' and `b`='".$bt['b']."' and `arr`='".$bt['arr']."' and `kom`!='".$bt['kom']."' and `id`='".$bt['enemy']."'"));
if($enemy==0 and $bt['enemy']!=0)
{
mysql_query("UPDATE `clan_totem_usr` SET `enemy`='0' WHERE `id`='".$bt['id']."'");
if(isset($_GET['kick']))
{
header('location: ?kick');exit;
}
elseif(isset($_GET['mag']))
{
header('location: ?mag='.$_GET['mag'].'');exit;
}
header('location: ?');exit;
}
$bts=mysql_fetch_array(mysql_query("SELECT * FROM `clan_totem_usr` WHERE `id`='".$bt['enemy']."'"));
if($bts['tip']=='str')
{
$ussb=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$bts['usr']."'"));
$en_name=' <img src=img/main/c'.$ussb['klass'].'.png> <img src=img/main/r'.$ussb['rasa'].'.png><font color=#ff0000>'.$ussb['usr'].'</font>';
if($ussb['ava']==0)
{
$img='<img src=img/pers/'.$ussb['klass'].''.$ussb['pol'].'.png>
';
}
else
{
$img='<img src=img/pers/ava/'.$ussb['ava'].'.png>';
}
}
if($bts['tip']=='pit')
{
$ussb=mysql_fetch_array(mysql_query("SELECT * FROM `pit` WHERE `id`='".$bts['pit']."' and `usr`='".$bts['usr']."'"));
$en_name=' <font color=#ff9900>'.$ussb['name'].'</font>';
$img='<img src=img/pit/'.$ussb['tip'].'/'.$ussb['img'].'.jpg width=90px>';
}
if(isset($_GET['kick']))
{
if($bt['status']==0 and $bt['enemy']!=0)
{
$max_sila=$bt['sila'];
$min_sila=round($max_sila/100*10);if($min_sila<1){$min_sila=1;}
$blok=$ussb['blok'];
$krit=$udata['krit'];
$arm=$bts['arm'];
if($bt['sfer_3_time']>=time())
{$baf_3=$bt['sfer_3_ef'];}else{$baf_3=0;}//усиление
if($bts['sfer_4_time']>=time())
{$baf_4=$bts['sfer_4_ef'];}else{$baf_4=0;}//пробивание
if($bt['sfer_5_time']>=time())
{$baf_5=$bt['sfer_5_time']-time();}else{$baf_5=0;}//стан
if($bts['sfer_6_time']>=time())
{$baf_6=$bts['sfer_6_ef'];}else{$baf_6=0;}//оборона
if($bts['sfer_10_time']>=time())
{$baf_10=$bts['sfer_10_ef'];}else{$baf_10=0;}//пламя
if($bt['sfer_11_time']>=time())
{$baf_11=$bt['sfer_11_ef'];}else{$baf_11=0;}//ослабление
if($bt['sfer_12_time']>=time())
{$baf_12=$bt['sfer_12_ef'];}else{$baf_12=0;}//барьер
$time=$bt['time_us'];
if($time>time())
{
$sek=$time-time();
if($sek>=5){$prom=1;}
elseif($sek==4){$prom=0;$max_sila=round($max_sila-$max_sila/100*rand(70,80));$min_sila=round($min_sila/4);}
elseif($sek==3){$prom=0;$max_sila=round($max_sila-$max_sila/100*rand(50,70));$min_sila=round($min_sila/3);}
elseif($sek==2 or $sek==1){$prom=0;$max_sila=round($max_sila-$max_sila/100*rand(20,50));$min_sila=round($min_sila/2);}
}
if($baf_5!=0)
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b1.png><font color=#999999>Вы оглушены еще ".$baf_5."сек.</font>'
");
}
else
{
if($prom==1)
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b1.png><font color=#999999>Промах!</font>'
");
}
else
{
$sila=$max_sila;
$sila=round($sila+$sila/100*$baf_3);
$arm=round($arm-$arm/100*$baf_4);
$sila=$sila-$arm;
if($sila<$min_sila){$sila=round($min_sila-$min_sila/100*$baf_11);}
$sila=round($sila-$sila/100*$baf_6);
if($sila<1){$sila=1;}
$kr=rand(1,100);if($kr<=$krit){$sila=$sila*2;$k_sila=1;}else{$k_sila=0;}
$bl=rand(1,100);if($bl<=$blok){$blok_us=1;}else{$blok_us=0;}
$sila=round($sila-$sila/100*$baf_11);
if($blok_us==1)
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b23.png>".$en_name."<font color=#990000> заблокировал вашу атаку</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$ussb['id']."',
`text`='<img src=img/main/b23.png><font color=#cccccc>Вы заблокировали атаку <img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font></font>'
");
}
$att=0;
$att2=0;
}
else
{
if($k_sila==1)
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000>Вы наносите критический удар ".$en_name." <b>-".$sila."</b></font>'
");
if($bts['tip']!="mob")
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$ussb['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> наносит вам критический удар <b>-".$sila."</b></font>'
");
}
}
else
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#00ff99>Вы наносите удар ".$k." ".$en_name." -".$sila."</font>'
");
if($bts['tip']!="mob")
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$ussb['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> наносит вам удар -".$sila."</font>'
");
}
}
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$yrs=$bts['hp'];
$exp=$bts['hp'];
$hp=0;
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b7.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> сокрушает вас</font>'
");
}
if($bts['tip']=="str")
{
$nai=$udata['reit_nai']+1;
$ds=$udata['dost1a']+1;
mysql_query("UPDATE `users` SET `reit_nai`='".$nai."', `dost1a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `status`='2' WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+5;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
$slava=$gus['slava']+1;
mysql_query("UPDATE `clan_users` SET `slava`='".$slava."' WHERE `id`='".$gus['id']."'");
$kil=$gus['reit_b']+1;
mysql_query("UPDATE `clan_users` SET `b_kill`='".$kil."' WHERE `id`='".$gus['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>5</font>'
");
}
else
{
$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("DELETE FROM `clan_totem_usr` WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+1;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>1</font>'
");
}
}
else
{
$yrs=$sila;
$exp=$sila;
$hp=$hp;
if($baf_10!=0)
{
$yr=round($sila/100*$baf_10);
$yr=round($yr-$yr/100*$baf_12);
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000>Вас обожгло заклинание возврата -".$yr."</font>'
");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b8.png><font color=#00ff00>заклинание возврата обожгло <img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> -".$yr."</font>'
");
$hps=$bt['hp']-$yr;
if($hps<1){$hps=1;}
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hps."', `att2`='".$yr."' WHERE `id`='".$bt['id']."'");
}
}
$yrs=$bt['ur']+$yrs;
mysql_query("UPDATE `clan_totem_usr` SET `ur`='".$yrs."', `att`='".$att."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
if($udata['lvl']<16)
{$vrs=5;}
if($udata['lvl']>15 and $udata['lvl']<31)
{$vrs=4;}
if($udata['lvl']>30 and $udata['lvl']<39)
{$vrs=2;}
if($udata['lvl']>38)
{$vrs=1;}
$exp=$exp*$vrs;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
$t=time()+7;
mysql_query("UPDATE `clan_totem_usr` SET `time_us`='".$t."', `att`='".$att."' WHERE `id`='".$bt['id']."'");
}
}
header('location: ?');exit;
}
if(isset($_GET['mag']))
{
$m=mysql_real_escape_string($_GET['mag']);
$tn=time();
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `mag`='".$m."' and `time`<='".$tn."' and `status`='on'");
$rows=mysql_num_rows($mobs);
if($rows!=0)
{
$skill=mysql_fetch_array($mobs);
if($bt['sfer_5_time']>=time())
{$baf_5=$bt['sfer_5_time']-time();}else{$baf_5=0;}//стан
if($baf_5!=0)
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b1.png><font color=#999999>Вы оглушены еще ".$baf_5."сек.</font>'
");
header('location: ?');exit;
}
if($m==3)
{
$sila=3*$skill['lvl'];
$tm=time()+90;
$ts=time()+60;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='3' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `sfer_3_time`='".$ts."', `sfer_3_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание усиления</font>, физические атаки +".$sila."% урона.</font>'
");
$enus=mysql_query("SELECT * FROM `clan_totem_usr` WHERE `enemy`='".$bt['id']."'");
$n_enus=mysql_num_rows($enus);
if($n_enus!=0)
{
while($eb=mysql_fetch_array($enus))
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$eb['usr']."',
`text`='<img src=img/main/b10.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> использовал <font color=#0099ff>Заклинание усиления</font>, физические атаки +".$sila."% урона.</font>'
");
}
}
}
if($m==4)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($skill['lvl']==1)
{$sila=10;}
if($skill['lvl']==2)
{$sila=15;}
if($skill['lvl']==3)
{$sila=20;}
if($skill['lvl']==4)
{$sila=25;}
if($skill['lvl']==5)
{$sila=30;}
if($skill['lvl']==6)
{$sila=35;}
if($skill['lvl']==7)
{$sila=45;}
if($skill['lvl']==8)
{$sila=55;}
if($skill['lvl']==9)
{$sila=65;}
if($skill['lvl']==10)
{$sila=75;}
$tm=time()+60;
$ts=time()+40;
mysql_query("UPDATE `mag` SET`time`='".$tm."' WHERE `mag`='4' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `sfer_4_time`='".$ts."', `sfer_4_ef`='".$sila."' WHERE `id`='".$bts['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание пробивания</font>, ".$en_name." -".$sila."% брони.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> использовал <font color=#0099ff>Заклинание пробивания</font>, ваша броня -".$sila."%.</font>'
");
}
}
}
if($m==6)
{
if($skill['lvl']==1)
{$sila=10;}
if($skill['lvl']==2)
{$sila=15;}
if($skill['lvl']==3)
{$sila=20;}
if($skill['lvl']==4)
{$sila=25;}
if($skill['lvl']==5)
{$sila=30;}
if($skill['lvl']==6)
{$sila=35;}
if($skill['lvl']==7)
{$sila=45;}
if($skill['lvl']==8)
{$sila=55;}
if($skill['lvl']==9)
{$sila=65;}
if($skill['lvl']==10)
{$sila=75;}
$tm=time()+90;
$ts=time()+30;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='6' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `sfer_6_time`='".$ts."', `sfer_6_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание обороны</font>, +".$sila."% защиты от физических атак.</font>'
");
$enus=mysql_query("SELECT * FROM `clan_totem_usr` WHERE `enemy`='".$bt['id']."'");
$n_enus=mysql_num_rows($enus);
if($n_enus!=0)
{
while($eb=mysql_fetch_array($enus))
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$eb['usr']."',
`text`='<img src=img/main/b10.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> использовал <font color=#0099ff>Заклинание обороны</font>, +".$sila."% от физических атак.</font>'
");
}
}
}
if($m==10)
{
$sila=5*$skill['lvl'];
$tm=time()+60;
$ts=time()+30;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='10' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `sfer_10_time`='".$ts."', `sfer_10_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание возврата</font>, ".$sila."% урона возвращается противнику.</font>'
");
$enus=mysql_query("SELECT * FROM `clan_totem_usr` WHERE `enemy`='".$bt['id']."'");
$n_enus=mysql_num_rows($enus);
if($n_enus!=0)
{
while($eb=mysql_fetch_array($enus))
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$eb['usr']."',
`text`='<img src=img/main/b10.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> использовал <font color=#0099ff>Заклинание возврата</font>, ".$sila."% возвращается противнику.</font>'
");
}
}
}
if($m==11)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
$sila=5*$skill['lvl'];
$tm=time()+30;
$ts=time()+20;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='11' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `sfer_11_time`='".$ts."', `sfer_11_ef`='".$sila."' WHERE `id`='".$bts['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание ослабления</font>, ".$en_name." -".$sila."% урона.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> использовал <font color=#0099ff>Заклинание ослабления</font>, ваш урон -".$sila."%.</font>'
");
}
}
}
if($m==12)
{
if($skill['lvl']==1)
{$sila=7;}
if($skill['lvl']==2)
{$sila=15;}
if($skill['lvl']==3)
{$sila=22;}
if($skill['lvl']==4)
{$sila=30;}
if($skill['lvl']==5)
{$sila=37;}
if($skill['lvl']==6)
{$sila=45;}
if($skill['lvl']==7)
{$sila=52;}
if($skill['lvl']==8)
{$sila=60;}
if($skill['lvl']==9)
{$sila=67;}
if($skill['lvl']==10)
{$sila=75;}
$tm=time()+60;
$ts=time()+20;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='12' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `sfer_12_time`='".$ts."', `sfer_12_ef`='".$sila."' WHERE `id`='".$bt['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание барьера</font>, +".$sila."% защиты от заклинаний.</font>'
");
$enus=mysql_query("SELECT * FROM `clan_totem_usr` WHERE `enemy`='".$bt['id']."'");
$n_enus=mysql_num_rows($enus);
if($n_enus!=0)
{
while($eb=mysql_fetch_array($enus))
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$eb['usr']."',
`text`='<img src=img/main/b10.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> использовал <font color=#0099ff>Заклинание барьера</font>, +".$sila."% защиты от заклинаний.</font>'
");
}
}
}
if($m==1)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['sfer_12_ef'];}else{$baf_12=0;}//барьер
$sila=5*$skill['lvl']+5;
$sila=round($sila-$sila/100*$baf_12);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+5;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='1' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание атаки</font>, ".$en_name." -".$sila."хп.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> использовал <font color=#0099ff>Заклинание атаки</font> -".$sila."хп.</font>'
");
}
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$yrs=$bts['hp'];
$exp=$bts['hp'];
$hp=0;
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b7.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> сокрушает вас</font>'
");
}
if($bts['tip']=="str")
{
$nai=$udata['reit_nai']+1;
$ds=$udata['dost1a']+1;
mysql_query("UPDATE `users` SET `reit_nai`='".$nai."', `dost1a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `status`='2' WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+5;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
$slava=$gus['slava']+1;
mysql_query("UPDATE `clan_users` SET `slava`='".$slava."' WHERE `id`='".$gus['id']."'");
$kil=$gus['reit_b']+1;
mysql_query("UPDATE `clan_users` SET `b_kill`='".$kil."' WHERE `id`='".$gus['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>5</font>'
");
}
else
{
$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("DELETE FROM `clan_totem_usr` WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+1;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>1</font>'
");
}
}
else
{
$yrs=$sila;
$exp=$sila;
$hp=$hp;
if($baf_10!=0)
{
$yr=round($sila/100*$baf_10);
$yr=round($yr-$yr/100*$baf_12);
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000>Вас обожгло заклинание возврата -".$yr."</font>'
");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b8.png><font color=#00ff00>заклинание возврата обожгло <img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> -".$yr."</font>'
");
$hps=$bt['hp']-$yr;
if($hps<1){$hps=1;}
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hps."', `att2`='".$yr."' WHERE `id`='".$bt['id']."'");
}
}
$yrs=$bt['ur']+$yrs;
mysql_query("UPDATE `clan_totem_usr` SET `ur`='".$yrs."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `att`='".$att."' WHERE `id`='".$bt['id']."'");
if($udata['lvl']<16)
{$vrs=5;}
if($udata['lvl']>15 and $udata['lvl']<31)
{$vrs=4;}
if($udata['lvl']>30 and $udata['lvl']<39)
{$vrs=2;}
if($udata['lvl']>38)
{$vrs=1;}
$exp=$exp*$vrs;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
if($m==2)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['sfer_12_ef'];}else{$baf_12=0;}//барьер
if($skill['lvl']==1)
{$sila=rand(10,100);}
if($skill['lvl']==2)
{$sila=rand(30,200);}
if($skill['lvl']==3)
{$sila=rand(50,300);}
if($skill['lvl']==4)
{$sila=rand(70,400);}
if($skill['lvl']==5)
{$sila=rand(90,500);}
if($skill['lvl']==6)
{$sila=rand(110,600);}
if($skill['lvl']==7)
{$sila=rand(130,700);}
if($skill['lvl']==8)
{$sila=rand(150,800);}
if($skill['lvl']==9)
{$sila=rand(170,900);}
if($skill['lvl']==10)
{$sila=rand(190,1000);}
$sila=round($sila-$sila/100*$baf_12);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+50;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='2' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание случайности</font>, ".$en_name." -".$sila."хп.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> использовал <font color=#0099ff>Заклинание случайности</font> -".$sila."хп.</font>'
");
}
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$yrs=$bts['hp'];
$exp=$bts['hp'];
$hp=0;
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b7.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> сокрушает вас</font>'
");
}
if($bts['tip']=="str")
{
$nai=$udata['reit_nai']+1;
$ds=$udata['dost1a']+1;
mysql_query("UPDATE `users` SET `reit_nai`='".$nai."', `dost1a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `status`='2' WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+5;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
$slava=$gus['slava']+1;
mysql_query("UPDATE `clan_users` SET `slava`='".$slava."' WHERE `id`='".$gus['id']."'");
$kil=$gus['reit_b']+1;
mysql_query("UPDATE `clan_users` SET `b_kill`='".$kil."' WHERE `id`='".$gus['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>5</font>'
");
}
else
{
$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("DELETE FROM `clan_totem_usr` WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+1;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>1</font>'
");
}
}
else
{
$yrs=$sila;
$exp=$sila;
$hp=$hp;
if($baf_10!=0)
{
$yr=round($sila/100*$baf_10);
$yr=round($yr-$yr/100*$baf_12);
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000>Вас обожгло заклинание возврата -".$yr."</font>'
");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b8.png><font color=#00ff00>заклинание возврата обожгло <img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> -".$yr."</font>'
");
$hps=$bt['hp']-$yr;
if($hps<1){$hps=1;}
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hps."', `att2`='".$yr."' WHERE `id`='".$bt['id']."'");
}
}
$yrs=$bt['ur']+$yrs;
mysql_query("UPDATE `clan_totem_usr` SET `ur`='".$yrs."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `att`='".$att."' WHERE `id`='".$bt['id']."'");
if($udata['lvl']<16)
{$vrs=5;}
if($udata['lvl']>15 and $udata['lvl']<31)
{$vrs=4;}
if($udata['lvl']>30 and $udata['lvl']<39)
{$vrs=2;}
if($udata['lvl']>38)
{$vrs=1;}
$exp=$exp*$vrs;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
if($m==13)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['sfer_12_ef'];}else{$baf_12=0;}//барьер
$sila=3*$skill['lvl'];
$sila=round($bts['hp']/100*$sila);
$sila=round($sila-$sila/100*$baf_12);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+60;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='13' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание сингулярности</font>, ".$en_name." -".$sila."хп.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> использовал <font color=#0099ff>Заклинание сингулярности</font> -".$sila."хп.</font>'
");
}
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$yrs=$bts['hp'];
$exp=$bts['hp'];
$hp=0;
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b7.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> сокрушает вас</font>'
");
}
if($bts['tip']=="str")
{
$nai=$udata['reit_nai']+1;
$ds=$udata['dost1a']+1;
mysql_query("UPDATE `users` SET `reit_nai`='".$nai."', `dost1a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `status`='2' WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+5;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
$slava=$gus['slava']+1;
mysql_query("UPDATE `clan_users` SET `slava`='".$slava."' WHERE `id`='".$gus['id']."'");
$kil=$gus['reit_b']+1;
mysql_query("UPDATE `clan_users` SET `b_kill`='".$kil."' WHERE `id`='".$gus['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>5</font>'
");
}
else
{
$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("DELETE FROM `clan_totem_usr` WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+1;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>1</font>'
");
}
}
else
{
$yrs=$sila;
$exp=$sila;
$hp=$hp;
if($baf_10!=0)
{
$yr=round($sila/100*$baf_10);
$yr=round($yr-$yr/100*$baf_12);
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000>Вас обожгло заклинание возврата -".$yr."</font>'
");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b8.png><font color=#00ff00>заклинание возврата обожгло <img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> -".$yr."</font>'
");
$hps=$bt['hp']-$yr;
if($hps<1){$hps=1;}
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hps."', `att2`='".$yr."' WHERE `id`='".$bt['id']."'");
}
}
$yrs=$bt['ur']+$yrs;
mysql_query("UPDATE `clan_totem_usr` SET `ur`='".$yrs."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `att`='".$att."' WHERE `id`='".$bt['id']."'");
if($udata['lvl']<16)
{$vrs=5;}
if($udata['lvl']>15 and $udata['lvl']<31)
{$vrs=4;}
if($udata['lvl']>30 and $udata['lvl']<39)
{$vrs=2;}
if($udata['lvl']>38)
{$vrs=1;}
$exp=$exp*$vrs;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
if($m==14)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['sfer_12_ef'];}else{$baf_12=0;}//барьер
$sila=50*$skill['lvl'];
$sila=round($sila-$sila/100*$baf_12);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+40;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='14' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание хаоса</font>, ".$en_name." -".$sila."хп.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> использовал <font color=#0099ff>Заклинание хаоса</font> -".$sila."хп.</font>'
");
}
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$yrs=$bts['hp'];
$exp=$bts['hp'];
$hp=0;
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b7.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> сокрушает вас</font>'
");
}
if($bts['tip']=="str")
{
$nai=$udata['reit_nai']+1;
$ds=$udata['dost1a']+1;
mysql_query("UPDATE `users` SET `reit_nai`='".$nai."', `dost1a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `status`='2' WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+5;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
$slava=$gus['slava']+1;
mysql_query("UPDATE `clan_users` SET `slava`='".$slava."' WHERE `id`='".$gus['id']."'");
$kil=$gus['reit_b']+1;
mysql_query("UPDATE `clan_users` SET `b_kill`='".$kil."' WHERE `id`='".$gus['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>5</font>'
");
}
else
{
$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("DELETE FROM `clan_totem_usr` WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+1;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>1</font>'
");
}
}
else
{
$yrs=$sila;
$exp=$sila;
$hp=$hp;
if($baf_10!=0)
{
$yr=round($sila/100*$baf_10);
$yr=round($yr-$yr/100*$baf_12);
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000>Вас обожгло заклинание возврата -".$yr."</font>'
");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b8.png><font color=#00ff00>заклинание возврата обожгло <img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> -".$yr."</font>'
");
$hps=$bt['hp']-$yr;
if($hps<1){$hps=1;}
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hps."', `att2`='".$yr."' WHERE `id`='".$bt['id']."'");
}
}
$yrs=$bt['ur']+$yrs;
mysql_query("UPDATE `clan_totem_usr` SET `ur`='".$yrs."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `att`='".$att."' WHERE `id`='".$bt['id']."'");
if($udata['lvl']<16)
{$vrs=5;}
if($udata['lvl']>15 and $udata['lvl']<31)
{$vrs=4;}
if($udata['lvl']>30 and $udata['lvl']<39)
{$vrs=2;}
if($udata['lvl']>38)
{$vrs=1;}
$exp=$exp*$vrs;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
if($m==7)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['sfer_12_ef'];}else{$baf_12=0;}//барьер
if($skill['lvl']==1)
{$sila=70;}
if($skill['lvl']==2)
{$sila=140;}
if($skill['lvl']==3)
{$sila=210;}
if($skill['lvl']==4)
{$sila=280;}
if($skill['lvl']==5)
{$sila=350;}
if($skill['lvl']==6)
{$sila=420;}
if($skill['lvl']==7)
{$sila=500;}
if($skill['lvl']==8)
{$sila=600;}
if($skill['lvl']==9)
{$sila=700;}
if($skill['lvl']==10)
{$sila=800;}
$sila=round($sila-$sila/100*$baf_12);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+50;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='7' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание молнии</font>, ".$en_name." -".$sila."хп.</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> использовал <font color=#0099ff>Заклинание молнии</font>, -".$sila."хп.</font>'
");
}
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$yrs=$bts['hp'];
$exp=$bts['hp'];
$hp=0;
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b7.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> сокрушает вас</font>'
");
}
if($bts['tip']=="str")
{
$nai=$udata['reit_nai']+1;
$ds=$udata['dost1a']+1;
mysql_query("UPDATE `users` SET `reit_nai`='".$nai."', `dost1a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `status`='2' WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+5;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
$slava=$gus['slava']+1;
mysql_query("UPDATE `clan_users` SET `slava`='".$slava."' WHERE `id`='".$gus['id']."'");
$kil=$gus['reit_b']+1;
mysql_query("UPDATE `clan_users` SET `b_kill`='".$kil."' WHERE `id`='".$gus['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>5</font>'
");
}
else
{
$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("DELETE FROM `clan_totem_usr` WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+1;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>1</font>'
");
}
}
else
{
$yrs=$sila;
$exp=$sila;
$hp=$hp;
if($baf_10!=0)
{
$yr=round($sila/100*$baf_10);
$yr=round($yr-$yr/100*$baf_12);
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000>Вас обожгло заклинание возврата -".$yr."</font>'
");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b8.png><font color=#00ff00>заклинание возврата обожгло <img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> -".$yr."</font>'
");
$hps=$bt['hp']-$yr;
if($hps<1){$hps=1;}
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hps."', `att2`='".$yr."' WHERE `id`='".$bt['id']."'");
}
}
$yrs=$bt['ur']+$yrs;
mysql_query("UPDATE `clan_totem_usr` SET `ur`='".$yrs."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `att`='".$att."' WHERE `id`='".$bt['id']."'");
if($udata['lvl']<16)
{$vrs=5;}
if($udata['lvl']>15 and $udata['lvl']<31)
{$vrs=4;}
if($udata['lvl']>30 and $udata['lvl']<39)
{$vrs=2;}
if($udata['lvl']>38)
{$vrs=1;}
$exp=$exp*$vrs;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
if($m==9)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['sfer_12_ef'];}else{$baf_12=0;}//барьер
$sila=40*$skill['lvl'];
$sh=$sila/2;
$sila=round($sila-$sila/100*$baf_12);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+30;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='9' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание вампира</font>, ".$en_name." -".$sila."хп, ваше хп + ".$sh."</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> использовал <font color=#0099ff>Заклинание вампира</font>, -".$sila."хп, востановив свое хп + ".$sh."</font>'
");
}
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$yrs=$bts['hp'];
$exp=$bts['hp'];
$hp=0;
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b7.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> сокрушает вас</font>'
");
}
if($bts['tip']=="str")
{
$nai=$udata['reit_nai']+1;
$ds=$udata['dost1a']+1;
mysql_query("UPDATE `users` SET `reit_nai`='".$nai."', `dost1a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `status`='2' WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+5;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
$slava=$gus['slava']+1;
mysql_query("UPDATE `clan_users` SET `slava`='".$slava."' WHERE `id`='".$gus['id']."'");
$kil=$gus['reit_b']+1;
mysql_query("UPDATE `clan_users` SET `b_kill`='".$kil."' WHERE `id`='".$gus['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>5</font>'
");
}
else
{
$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("DELETE FROM `clan_totem_usr` WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+1;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>1</font>'
");
}
}
else
{
$yrs=$sila;
$exp=$sila;
$hp=$hp;
if($baf_10!=0)
{
$yr=round($sila/100*$baf_10);
$yr=round($yr-$yr/100*$baf_12);
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000>Вас обожгло заклинание возврата -".$yr."</font>'
");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b8.png><font color=#00ff00>заклинание возврата обожгло <img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> -".$yr."</font>'
");
$hps=$bt['hp']-$yr;
if($hps<1){$hps=1;}
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hps."', `att2`='".$yr."' WHERE `id`='".$bt['id']."'");
}
}
$yrs=$bt['ur']+$yrs;
mysql_query("UPDATE `clan_totem_usr` SET `ur`='".$yrs."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
$hps=$bt['hp']+$sh;
if($hps>$udata['hp'])
{
$hps=$udata['hp'];
}
mysql_query("UPDATE `clan_totem_usr` SET `att`='".$att."', `hp`='".$hps."' WHERE `id`='".$bt['id']."'");
if($udata['lvl']<16)
{$vrs=5;}
if($udata['lvl']>15 and $udata['lvl']<31)
{$vrs=4;}
if($udata['lvl']>30 and $udata['lvl']<39)
{$vrs=2;}
if($udata['lvl']>38)
{$vrs=1;}
$exp=$exp*$vrs;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
if($m==8)
{
$sila=80*$skill['lvl'];
$tm=time()+40;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='8' and `usr`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание исциления</font> ваше хп + ".$sila."</font>'
");
$hps=$bt['hp']+$sila;
if($hps>$udata['hp'])
{
$hps=$udata['hp'];
}
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hps."' WHERE `id`='".$bt['id']."'");
}
if($m==5)
{
if($bt['status']==0 and $bt['enemy']!=0)
{
if($bts['sfer_12_time']>=time())
{$baf_12=$bts['sfer_12_ef'];}else{$baf_12=0;}//барьер
if($skill['lvl']==1)
{$sila=15;$t=5;}
if($skill['lvl']==2)
{$sila=30;$t=6;}
if($skill['lvl']==3)
{$sila=45;$t=7;}
if($skill['lvl']==4)
{$sila=60;$t=8;}
if($skill['lvl']==5)
{$sila=75;$t=9;}
if($skill['lvl']==6)
{$sila=90;$t=10;}
if($skill['lvl']==7)
{$sila=105;$t=11;}
if($skill['lvl']==8)
{$sila=120;$t=12;}
if($skill['lvl']==9)
{$sila=135;$t=14;}
if($skill['lvl']==10)
{$sila=150;$t=15;}
$sila=round($sila-$sila/100*$baf_12);
if($bt['mag_mast_time']>=time())
{$sila=round($sila+$sila/100*$bt['mag_mast']);}
$tm=time()+60;
$ts=time()+$t;
mysql_query("UPDATE `mag` SET `time`='".$tm."' WHERE `mag`='5' and `usr`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `sfer_5_time`='".$ts."' WHERE `id`='".$bts['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b10.png><font color=#009900>Вы использовали <font color=#0099ff>Заклинание стана</font>, ".$en_name." -".$sila."хп, +".$t."сек. оглушение</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b10.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> использовал <font color=#0099ff>Заклинание стана</font>, -".$sila."хп, +".$t."сек. оглушения</font>'
");
}
$att=$sila;
$att2=$sila;
$hp=$bts['hp']-$sila;
if($hp<=0)
{
$yrs=$bts['hp'];
$exp=$bts['hp'];
$hp=0;
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b7.png><font color=#ffff00>Вы сокрушаете ".$en_name."</font>'
");
if($bts['tip']!='mob')
{
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b7.png><font color=#ff0000><img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> сокрушает вас</font>'
");
}
if($bts['tip']=="str")
{
$nai=$udata['reit_nai']+1;
$ds=$udata['dost1a']+1;
mysql_query("UPDATE `users` SET `reit_nai`='".$nai."', `dost1a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `status`='2' WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+5;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
$slava=$gus['slava']+1;
mysql_query("UPDATE `clan_users` SET `slava`='".$slava."' WHERE `id`='".$gus['id']."'");
$kil=$gus['reit_b']+1;
mysql_query("UPDATE `clan_users` SET `b_kill`='".$kil."' WHERE `id`='".$gus['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>5</font>'
");
}
else
{
$nai=$udata['reit_oh']+1;
$ds=$udata['dost2a']+1;
mysql_query("UPDATE `users` SET `reit_oh`='".$nai."', `dost2a`='".$ds."' WHERE `id`='".$udata['id']."'");
mysql_query("DELETE FROM `clan_totem_usr` WHERE `id`='".$bts['id']."'");
$mon=$udata['money']+1;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/e28.png><font color=#00ff00>Вы получили <img src=img/main/p5.png>1</font>'
");
}
}
else
{
$yrs=$sila;
$exp=$sila;
$hp=$hp;
if($baf_10!=0)
{
$yr=round($sila/100*$baf_10);
$yr=round($yr-$yr/100*$baf_12);
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$udata['id']."',
`text`='<img src=img/main/b8.png><font color=#ff0000>Вас обожгло заклинание возврата -".$yr."</font>'
");
mysql_query("INSERT INTO `log_totem` SET
`id`='',
`usr`='".$bts['usr']."',
`text`='<img src=img/main/b8.png><font color=#00ff00>заклинание возврата обожгло <img src=img/main/c".$udata['klass'].".png> <img src=img/main/r".$udata['rasa'].".png><font color=#ff9900>".$udata['usr']."</font> -".$yr."</font>'
");
$hps=$bt['hp']-$yr;
if($hps<1){$hps=1;}
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hps."', `att2`='".$yr."' WHERE `id`='".$bt['id']."'");
}
}
$yrs=$bt['ur']+$yrs;
mysql_query("UPDATE `clan_totem_usr` SET `ur`='".$yrs."' WHERE `id`='".$bt['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `hp`='".$hp."', `att2`='".$att2."' WHERE `id`='".$bts['id']."'");
mysql_query("UPDATE `clan_totem_usr` SET `att`='".$att."' WHERE `id`='".$bt['id']."'");
if($udata['lvl']<16)
{$vrs=5;}
if($udata['lvl']>15 and $udata['lvl']<31)
{$vrs=4;}
if($udata['lvl']>30 and $udata['lvl']<39)
{$vrs=2;}
if($udata['lvl']>38)
{$vrs=1;}
$exp=$exp*$vrs;
$vipss=mysql_query("SELECT * FROM `vip` WHERE `usr`='".$udata['id']."'");
$nvips=mysql_num_rows($vipss);
if($nvips!=0)
{
$exp=round($exp+$exp/100*30);
}
$exp=$udata['exp']+$exp;
mysql_query("UPDATE `users` SET `exp`='".$exp."' WHERE `id`='".$udata['id']."'");
}
}
}
header('location: ?');exit;
}
include('b_totem2.php');
include('files/head.php');
echo '
<div class="v2 brs bls v8 bts bbs p v12"><font color=#00ccff>
<img src=img/main/p6.png>'.$bt['hp'].' | '.$hpw.'
<font color=#ff0000>'.$bt['att'].'</font> | <font color=#ff0000>'.$bt['att2'].'</font>';
if($bt['enemy']!=0)
{
echo' | '.$en_name.' <img src=img/main/p6.png>'.$bts['hp'].'';
}
$q = mysql_query("SELECT COUNT(*) FROM `msg_kont` WHERE `usr1` = '".$udata['id']."' AND `read` = '1';");
$new_mail = mysql_result($q, 0);
if($new_mail > 0)
{
echo"
<a href="mail.php"><img src=img/main/e1.png></a>";
}
if($udata['clan']!=0)
{
$fridaa=mysql_query("SELECT * FROM `sectors` WHERE `clan`='".$udata['clan']."' and `att_clan`!='0'");
$fra=mysql_num_rows($fridaa);
if($fra!=0)
{
echo'<a href=clan.php?gi=ter><img src=img/main/st.png></a>';
}
}
echo'<br>Состояние: </font> ';
$k1=mysql_num_rows(mysql_query("SELECT * FROM `clan_totem_usr` WHERE `status`='0' and `b`='".$bt['b']."' and `arr`='".$bt['arr']."' and `kom`='".$gi['id']."'"));
$k2=mysql_num_rows(mysql_query("SELECT * FROM `clan_totem_usr` WHERE `status`='0' and `b`='".$bt['b']."' and `arr`='".$bt['arr']."' and `kom`!='".$gi['id']."'"));
echo '<img src=img/main/r1.png><font color=#00ff00>('.$k1.')</font> - <img src=img/main/r2.png><font color=#ff0000>('.$k2.')</font><br>';
echo'</div>';
$giza=mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id`='".$udata['clan']."'"));
if($giza['gorn_time']>time() and $udata['gorn']==1)
{
echo '<div class="v6 rr rt rl p">'.$giza['gorn'].'<br>
<img src=img/main/e55.png><a href=clan.php?gorn_def>Закрыть</a>
</div>';
}
echo '<div class=v8><div class="v3 bts brs bls b p v12">Бой</div><div class="v2 bts brs bls bbs p t2">';
if($bt['status']==0)
{
if($bt['enemy']==0)
{
echo '<table>
<tr>
<td><img src=img/mob/0.jpg></td>
<td> -<i>Нет противника.</i></td>
</tr>
</table>';
$tn=time();
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `status`='on' ORDER BY `id`");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
}
else
{
while($mag=mysql_fetch_array($mobs))
{
if($mag['mag']==1)
{
$name='заклинание удара';
}
if($mag['mag']==2)
{
$name='заклинание случайности';
}
if($mag['mag']==3)
{
$name='заклинание усиления';
}
if($mag['mag']==4)
{
$name='заклинание пробивания';
}
if($mag['mag']==5)
{
$name='заклинание стана';
}
if($mag['mag']==6)
{
$name='заклинание обороны';
}
if($mag['mag']==7)
{
$name='заклинание молний';
}
if($mag['mag']==8)
{
$name='заклинание исцеления';
}
if($mag['mag']==9)
{
$name='заклинание вампира';
}
if($mag['mag']==10)
{
$name='заклинание возврата';
}
if($mag['mag']==11)
{
$name='заклинание ослабления';
}
if($mag['mag']==12)
{
$name='заклинание барьера';
}
if($mag['mag']==13)
{
$name='заклинание сингулярности';
}
if($mag['mag']==14)
{
$name='заклинание хаоса';
}
if($mag['time']<=$tn)
{
echo '<a href=?mag='.$mag['mag'].'>
<div class="v2s p"><img src=img/main/b10.png> <font color=#ffff00>'.$name.'</font></div></a>';
}
else
{
$mag['time']=$mag['time']-time();
$mag['time']=$mag['time']." с.";
echo '<a href=?mag='.$mag['mag'].'>
<div class="v2s p"><img src=img/main/b10.png> <font color=#555500>'.$name.'</font><font color=#ffffff> ['.$mag['time'].']</font></div></a>';
}
}
}
$eq=mysql_query("SELECT * FROM `elic` WHERE `usr`='".$udata['id']."' and `tip`='hp' and `status`='on'");
$rowse=mysql_num_rows($eq);
if($rowse==0)
{
}
else
{
while($el=mysql_fetch_array($eq))
{
if($el['time']<=$tn)
{
echo '<img src=img/elic/'.$el['tip'].''.$el['ef'].'.png> <a href=?elic='.$el['id'].'>пить</a> ';
}
else
{
$el['time']=$el['time']-time();
if($el['time']<60){
$el['time']=$el['time']." с.</font>";
}
echo '<img src=img/elic/'.$el['tip'].''.$el['ef'].'.png> '.$el['time'].' ';
}
}
}
}
else
{
echo '<table>
<tr>
<td>'.$img.'</td>
<td> -<i>'.$en_name.'</i><br>
<img src=img/main/p6.png>'.$bts['hp'].'
</td>
</tr>
</table>';
echo '<a href=?kick>
<div class="v2s p"><img src=img/main/b8.png> <font color=#ffff00>бить '.$en_name.'</font></div></a>';
$tn=time();
$mobs=mysql_query("SELECT * FROM `mag` WHERE `usr`='".$udata['id']."' and `status`='on' ORDER BY `id`");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
}
else
{
while($mag=mysql_fetch_array($mobs))
{
if($mag['mag']==1)
{
$name='заклинание удара';
}
if($mag['mag']==2)
{
$name='заклинание случайности';
}
if($mag['mag']==3)
{
$name='заклинание усиления';
}
if($mag['mag']==4)
{
$name='заклинание пробивания';
}
if($mag['mag']==5)
{
$name='заклинание стана';
}
if($mag['mag']==6)
{
$name='заклинание обороны';
}
if($mag['mag']==7)
{
$name='заклинание молний';
}
if($mag['mag']==8)
{
$name='заклинание исцеления';
}
if($mag['mag']==9)
{
$name='заклинание вампира';
}
if($mag['mag']==10)
{
$name='заклинание возврата';
}
if($mag['mag']==11)
{
$name='заклинание ослабления';
}
if($mag['mag']==12)
{
$name='заклинание барьера';
}
if($mag['mag']==13)
{
$name='заклинание сингулярности';
}
if($mag['mag']==14)
{
$name='заклинание хаоса';
}
if($mag['time']<=$tn)
{
echo '<a href=?mag='.$mag['mag'].'>
<div class="v2s p"><img src=img/main/b10.png> <font color=#ffff00>'.$name.'</font></div></a>';
}
else
{
$mag['time']=$mag['time']-time();
$mag['time']=$mag['time']." с.";
echo '<a href=?mag='.$mag['mag'].'>
<div class="v2s p"><img src=img/main/b10.png> <font color=#555500>'.$name.'</font><font color=#ffffff> ['.$mag['time'].']</font></div></a>';
}
}
}
$eq=mysql_query("SELECT * FROM `elic` WHERE `usr`='".$udata['id']."' and `tip`='hp' and `status`='on'");
$rowse=mysql_num_rows($eq);
if($rowse==0)
{
}
else
{
while($el=mysql_fetch_array($eq))
{
if($el['time']<=$tn)
{
echo '<img src=img/elic/'.$el['tip'].''.$el['ef'].'.png> <a href=?elic='.$el['id'].'>пить</a> ';
}
else
{
$el['time']=$el['time']-time();
if($el['time']<60){
$el['time']=$el['time']." с.</font>";
}
echo '<img src=img/elic/'.$el['tip'].''.$el['ef'].'.png> '.$el['time'].' ';
}
}
}
}
echo '<br><br>';
}
elseif($bt['status']==2)
{
echo '<center><font color=#ff0000>Вы погибли. Для вас этот бой окончен.</font></center>';
}
echo '<br> <img src=img/main/p11.png> <a href=?leave><font color=#0099ff>Покинуть бой</font></a>';
echo '</div></div>';
$enemy=mysql_num_rows(mysql_query("SELECT * FROM `clan_totem_usr` WHERE `status`='0' and `b`='".$bt['b']."' and `arr`='".$bt['arr']."' and `kom`!='".$bt['kom']."'"));
if($enemy!=0)
{
echo '<div class=v8><div class="v3 bts brs bls b p v12">Противники</div><div class="v2 bts brs bls bbs p t2">';
$eny=mysql_query("SELECT * FROM `clan_totem_usr` WHERE `status`='0' and `b`='".$bt['b']."' and `arr`='".$bt['arr']."' and `kom`!='".$bt['kom']."'");
while($en=mysql_fetch_array($eny))
{
if($en['tip']=='str')
{
$uss=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$en['usr']."'"));
echo ' <img src=img/main/c'.$uss['klass'].'.png> <img src=img/main/r'.$uss['rasa'].'.png> <a href=?enemy='.$en['id'].'><font color=#ffff00>'.$uss['usr'].'</font></a> [<img src=img/main/p6.png><font color=#ff0000>'.$en['hp'].'</font>] <img src=img/main/p10.png>'.$uss['lvl'].', ';
}
if($en['tip']=='pit')
{
$uss=mysql_fetch_array(mysql_query("SELECT * FROM `pit` WHERE `id`='".$en['pit']."' and `usr`='".$en['usr']."'"));
echo ' <a href=?enemy='.$en['id'].'><font color=#ff9900>'.$uss['name'].'</font></a> [<img src=img/main/p6.png><font color=#ff0000>'.$en['hp'].'</font>] <img src=img/main/p10.png>'.$uss['lvl'].', ';
}
}
echo '</div></div>';
}
$mobs=mysql_query("SELECT * FROM `log_totem` WHERE `usr`='".$udata['id']."' ORDER BY `id` DESC LIMIT 10");
$rows=mysql_num_rows($mobs);
if($rows==0)
{
}
else
{
echo '<div class=v8><div class="v3 bts brs bls b p v12">Лог боя:</div><div class="v2 bts brs bls bbs p t2">';
while($log=mysql_fetch_array($mobs))
{
echo $log['text'].'<br>';
}
}
}
echo '</div></div>';
include('files/dwn.php');
?>