Файл: cron/pdz/pdz_boss10.php
Строк: 115
<?
define('PROTECTOR', 1);
$db_host = "localhost";
$db_user = "aweik_sidonias";
$db_table = "aweik_sidonias";
$db_pass = "08091993Lex";
$connect = @ mysql_pconnect($db_host, $db_user, $db_pass) or die('cannot connect to server');
@ mysql_select_db($db_table) or die('cannot connect to db');
@ mysql_query("SET NAMES 'utf8'", $connect);
sleep(45);
$boss=mysql_num_rows(mysql_query("SELECT * FROM `pdz_mob` WHERE `skill`!='0' and `time_skill`<'".time()."'"));
if($boss!=0)
{
$bs=mysql_fetch_array(mysql_query("SELECT * FROM `pdz_mob` WHERE `skill`!='0' and `time_skill`<'".time()."'"));
if($bs['skill']==1 or $bs['skill']==5 or $bs['skill']==9)
{
$mobsq=mysql_query("SELECT * FROM `pdz_usr` WHERE `arr`='".$bs['arr']."' and `status`!='2'");
while($lus=mysql_fetch_array($mobsq))
{
$us=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$lus['usr']."'"));
$att=round($lus['hp']/100*15);
$hp=$lus['hp']-$att;
$time=time()+120;
mysql_query("UPDATE `pdz_usr` SET `hp`='".$hp."', `att2`='".$dmg."' WHERE `id`='".$lus['id']."'");
mysql_query("UPDATE `pdz_mob` SET `time_skill`='".$time."' WHERE `id`='".$bs['id']."'");
if($lus['tip']=='usr')
{
$ssb=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$lus['usr']."'"));
$en_namet=' <img src=img/main/c'.$ssb['klass'].'.png> <img src=img/main/r'.$ssb['rasa'].'.png><font color=#ff0000>'.$ssb['usr'].'</font>';
}
if($lus['tip']=='pit')
{
$ssb=mysql_fetch_array(mysql_query("SELECT * FROM `pit` WHERE `id`='".$lus['pit']."' and `usr`='".$lus['usr']."'"));
$en_namet=' <font color=#ff9900>'.$ssb['name'].'</font>';
}
$slog='<img src=img/main/b23.png> <font color=#ff0000><font color=#00ff99>'.$bs['name'].'</font> использовала навык <font color=#ffffff>Бездна</font> '.$en_namet.' -'.$att.'</font>.';
mysql_query("INSERT INTO `log_pdz` SET
`id`='',
`usr`='".$lus['usr']."',
`text`='".$slog."',
`pdz`='".$pdz_kom['id']."'
");
}
}
if($bs['skill']==2 or $bs['skill']==6 or $bs['skill']==10)
{
$hg=$pdz_kom['lvl']*50;
$hp=$bs['hp']+$hg;
$time=time()+45;
mysql_query("UPDATE `pdz_mob` SET `hp`='".$hp."', `time_skill`='".$time."' WHERE `id`='".$bs['id']."'");
$mobsq=mysql_query("SELECT * FROM `pdz_usr` WHERE `arr`='".$bs['arr']."' and `status`!='2'");
while($lus=mysql_fetch_array($mobsq))
{
$slog='<img src=img/main/b23.png> <font color=#ff0000><font color=#00ff99>'.$bs['name'].'</font> использовала навык <font color=#ffffff>Отпущение</font> и востановил +'.$hg.'хп</font>.';
mysql_query("INSERT INTO `log_pdz` SET
`id`='',
`usr`='".$lus['usr']."',
`text`='".$slog."',
`pdz`='".$pdz_kom['id']."'
");
}
}
if($bs['skill']==3 or $bs['skill']==7 or $bs['skill']==11)
{
$mobsq=mysql_query("SELECT * FROM `pdz_usr` WHERE `arr`='".$bs['arr']."' and `status`!='2' and `tip`='usr'");
while($lus=mysql_fetch_array($mobsq))
{
$us=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$lus['usr']."'"));
$tef=time()+12;
$time=time()+90;
mysql_query("UPDATE `pdz_usr` SET `sfer_5_time`='".$tef."' WHERE `id`='".$lus['id']."'");
mysql_query("UPDATE `pdz_mob` SET `time_skill`='".$time."' WHERE `id`='".$bs['id']."'");
$ssb=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$lus['usr']."'"));
$en_namet=' <img src=img/main/c'.$ssb['klass'].'.png> <img src=img/main/r'.$ssb['rasa'].'.png><font color=#ff0000>'.$ssb['usr'].'</font>';
$slog='<img src=img/main/b23.png> <font color=#ff0000><font color=#00ff99>'.$bs['name'].'</font> использовала навык <font color=#ffffff>Порализация</font> '.$en_namet.' оглушен на 12с.</font>.';
mysql_query("INSERT INTO `log_pdz` SET
`id`='',
`usr`='".$lus['usr']."',
`text`='".$slog."',
`pdz`='".$pdz_kom['id']."'
");
}
}
if($bs['skill']==4 or $bs['skill']==8 or $bs['skill']==12)
{
$mobsq=mysql_query("SELECT * FROM `pdz_usr` WHERE `arr`='".$bs['arr']."' and `status`!='2'");
while($lus=mysql_fetch_array($mobsq))
{
$us=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$lus['usr']."'"));
$att=$pdz_kom['lvl']*20;
$hp=$lus['hp']-$att;
if($hp<=0){$hp=0;}
$time=time()+90;
mysql_query("UPDATE `pdz_usr` SET `hp`='".$hp."', `att2`='".$dmg."' WHERE `id`='".$lus['id']."'");
mysql_query("UPDATE `pdz_mob` SET `time_skill`='".$time."' WHERE `id`='".$bs['id']."'");
if($lus['tip']=='usr')
{
$ssb=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$lus['usr']."'"));
$en_namet=' <img src=img/main/c'.$ssb['klass'].'.png> <img src=img/main/r'.$ssb['rasa'].'.png><font color=#ff0000>'.$ssb['usr'].'</font>';
}
if($lus['tip']=='pit')
{
$ssb=mysql_fetch_array(mysql_query("SELECT * FROM `pit` WHERE `id`='".$lus['pit']."' and `usr`='".$lus['usr']."'"));
$en_namet=' <font color=#ff9900>'.$ssb['name'].'</font>';
}
$slog='<img src=img/main/b23.png> <font color=#ff0000><font color=#00ff99>'.$bs['name'].'</font> использовала навык <font color=#ffffff>Кара</font> '.$en_namet.' -'.$att.'</font>.';
mysql_query("INSERT INTO `log_pdz` SET
`id`='',
`usr`='".$lus['usr']."',
`text`='".$slog."',
`pdz`='".$pdz_kom['id']."'
");
if($hp==0)
{
$lgf='<img src=img/main/b23.png> <font color=#ff0000><font color=#00ff99>'.$ens['name'].'</font> сокрушил '.$en_namet.'</font>.';
mysql_query("INSERT INTO `log_pdz` SET
`id`='',
`usr`='".$lus['usr']."',
`text`='".$lgf."',
`pdz`='".$pdz_kom['id']."'
");
if($lus['tip']!='pit')
{
mysql_query("UPDATE `pdz_usr` SET `status`='2' WHERE `id`='".$lus['id']."'");
}
else
{
mysql_query("DELETE FROM `pdz_usr` WHERE `id`='".$lus['id']."'");
}
}
}
}
}
?>