Esempio n. 1
0
     }
 } else {
     if ($priem == "survive") {
         if ($db['hp'] > 0) {
             $faiz = $priems["counter"] * 0.005 + $priems["hit"] * 0.01 + $priems["krit"] * 0.01 + $priems["uvarot"] * 0.01 + $priems["block"] * 0.01 + $priems["parry"] * 0.01;
             $hp_add = $db["hp_all"] * $faiz;
             if ($hp_add > $db["hp_all"] * 0.25) {
                 $hp_add = $db["hp_all"] * 0.25;
             }
             $hp_add = ceil($hp_add);
             $new_hp = $db["hp"] + $hp_add;
             if ($new_hp > $db["hp_all"]) {
                 $new_hp = $db["hp_all"];
                 $hp_add = $db["hp_all"] - $db["hp"];
             }
             setHP($login, $new_hp, $db['hp_all']);
             $db["hp"] = $new_hp;
             $phrase_priem = "<span class=date>{$date}</span> <span class={$span}>{$login}</span> понял что его спасение это прием <b>Выжить.<font color=green>+{$hp_add}</font></b> [" . $new_hp . "/" . $db['hp_all'] . "]<br> ";
             battle_log($bid, $phrase_priem);
             mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . (int) $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='" . $priem . "' and '" . $bid . "'");
             mysql_query("UPDATE battle_units SET hit=0,krit=0,uvarot=0,block=0,parry=0,hp=hp-" . (int) $is_pr["hp"] . ",counter=counter-" . (int) $is_pr["all_hit"] . " WHERE player='" . $login . "' and battle_id='" . $bid . "'");
         }
     } else {
         if ($priem == "auto_hit") {
             if ($db['hp'] > 0 && $opponent) {
                 $is_bot = mysql_num_rows(mysql_query("SELECT * FROM bot_temp WHERE battle_id='" . $bid . "' and bot_name='" . $opponent . "' limit 1"));
                 if ($is_bot > 0) {
                     hit_dis($login, $opponent, "01", 0, rand(1, 5), 0, 0, 0, $bid);
                 } else {
                     hit_dis($login, $opponent, "00", 0, rand(1, 5), 0, 0, 0, $bid);
                 }
Esempio n. 2
0
function lose($team, $battle, $phrase)
{
    $date = date("H:i");
    $sql_bat = mysql_query("SELECT zayavka.type,battles.creator_id FROM `battles` LEFT JOIN zayavka on zayavka.creator=battles.creator_id WHERE battles.id={$battle}");
    $B_DAT = mysql_fetch_array($sql_bat);
    mysql_free_result($sql_bat);
    $cr = $B_DAT["creator_id"];
    $zay_type = $B_DAT["type"];
    $boylar = array(3, 4, 101, 5, 6, 102, 11);
    $T = mysql_query("SELECT player,hitted FROM teams WHERE battle_id='" . $cr . "' AND over=0 and team='" . $team . "'");
    while ($DATA = mysql_fetch_array($T)) {
        $player = $DATA["player"];
        $hitted_win = $DATA["hitted"];
        if ($zay_type == 15) {
            mysql_query('UPDATE labirint SET location="29x15", vector="180" WHERE user_id="' . $player . '"');
        }
        if ($zay_type == 88) {
            mysql_query('UPDATE labirint SET location="29x2", vector="180", lose=lose+1 WHERE user_id="' . $player . '"');
        }
        if ($zay_type == 89) {
            mysql_query('UPDATE labirint SET lose=lose+1 WHERE user_id="' . $player . '"');
        }
        //-------------------------------------------------------------------------------------
        $LOSER_QUERY_D = mysql_query("SELECT users.*,zver.energy FROM users LEFT join zver on zver.owner=users.id and zver.sleep=0 WHERE login='" . $player . "'");
        $LOSER_DATA = mysql_fetch_array($LOSER_QUERY_D);
        mysql_free_result($LOSER_QUERY_D);
        $objects = array();
        $objects[0] = $LOSER_DATA["amulet"];
        $objects[1] = $LOSER_DATA["hand_r"];
        $objects[2] = $LOSER_DATA["armour"];
        $objects[3] = $LOSER_DATA["poyas"];
        $objects[4] = $LOSER_DATA["ring1"];
        $objects[5] = $LOSER_DATA["ring2"];
        $objects[6] = $LOSER_DATA["ring3"];
        $objects[7] = $LOSER_DATA["helmet"];
        $objects[8] = $LOSER_DATA["perchi"];
        $objects[9] = $LOSER_DATA["hand_l"];
        $objects[10] = $LOSER_DATA["boots"];
        $objects[11] = $LOSER_DATA["naruchi"];
        $objects[12] = $LOSER_DATA["rubaxa"];
        $objects[13] = $LOSER_DATA["plash"];
        $objects[14] = $LOSER_DATA["mask"];
        $objects[15] = $LOSER_DATA["pants"];
        $objects[16] = $LOSER_DATA["masdrikon"];
        $objects[17] = $LOSER_DATA["rukavic"];
        $damage = 0;
        shuffle($objects);
        foreach ($objects as $key => $value) {
            if ($value == 0) {
                unset($objects[$key]);
            }
        }
        $new_array = array_values($objects);
        $damage = $new_array[0];
        if ($damage != 0) {
            $GET_F_INV = mysql_query("SELECT paltar.name,inv.iznos_max,inv.iznos FROM inv LEFT JOIN paltar on paltar.id=inv.object_id WHERE inv.id=" . $damage);
            $GET_D = mysql_fetch_array($GET_F_INV);
            mysql_free_result($GET_F_INV);
            $iznos_all = $GET_D["iznos_max"];
            $iznos = $GET_D["iznos"] + 1;
            $obj_name = $GET_D["name"];
            $krit_iznos = $iznos_all - 2;
            if ($iznos >= $krit_iznos && $iznos < $iznos_all) {
                talk($player, "Предмет <b>" . $obj_name . "</b> в критическом состоянии!<BR><small>(на правах рекламы) <b>Ремонтная мастерская</b>. Мы даем вторую жизнь старым вещам!</small>", $LOSER_DATA);
            }
            if ($iznos <= $iznos_all) {
                mysql_query("UPDATE inv SET iznos =iznos+1 WHERE id = '" . $damage . "'");
            }
            if ($iznos_all == 1) {
                unWear($player, $damage);
                mysql_query("DELETE FROM inv WHERE id='" . $damage . "'");
                history($player, 'Пришел в негодность', $obj_name, $LOSER_DATA["remote_ip"], "Бой " . $battle);
                talk($player, "Предмет <b>" . $obj_name . "</b> сломался", $LOSER_DATA);
            } else {
                if ($iznos == $iznos_all) {
                    unWear($player, $damage);
                    talk($player, "Предмет <b>" . $obj_name . "</b> нуждается в ремонте!<BR><small>(на правах рекламы) <b>Ремонтная мастерская</b>. Мы даем вторую жизнь старым вещам!</small>", $LOSER_DATA);
                }
            }
        }
        if ($zay_type == 29) {
            #Пещера Воинов
            mysql_query("UPDATE users SET zayava=0 WHERE login='" . $player . "'");
            mysql_query("UPDATE war_team SET lose=1 WHERE player='" . $player . "'");
            say("toroom", "<b>{$player}</b> трагически погиб и покидает турнир.", $player);
        }
        if ($zay_type == 99 || $zay_type == 66) {
            mysql_query("UPDATE users SET bs=0,location='', vector='' WHERE login='" . $player . "'");
            $str = "<span class=date>" . date("d.m.y H:i") . "</span> <script>drwfl('" . $LOSER_DATA['login'] . "','" . $LOSER_DATA['id'] . "','" . $LOSER_DATA['level'] . "','" . $LOSER_DATA['dealer'] . "','" . $LOSER_DATA['orden'] . "','" . $LOSER_DATA['admin_level'] . "','" . $LOSER_DATA['clan_short'] . "','" . $LOSER_DATA['clan'] . "');</script> повержен и выбывает из турнира<BR>";
            mysql_query('UPDATE `deztow_turnir` SET `log` = CONCAT(`log`,"' . $str . '") WHERE `active` = TRUE');
            mysql_Query("DELETE FROM labirint WHERE user_id='" . $player . "'");
            mysql_Query("UPDATE bs_objects SET bs=0,owner='',coord='" . $LOSER_DATA["location"] . "' WHERE owner='" . $player . "'");
            mysql_query("DELETE FROM inv WHERE owner='" . $player . "' and object_razdel='thing' and object_id=24 LIMIT 1");
            say("toroom", "<b>{$player}</b> трагически погиб и покидает турнир.", $player);
        }
        if ($zay_type == 19) {
            //Таинственный Маяк
            $have_hell = mysql_fetch_Array(mysql_Query("SELECT * FROM hellround_pohod WHERE `end` = 0 and `owner`=" . $LOSER_DATA["id"] . ";"));
            $count_wood = $have_hell["volna"];
            for ($i = 0; $i < $count_wood; $i++) {
                mysql_query("INSERT INTO `inv` (`owner`, `object_id`, `object_type`, `object_razdel` ,`iznos`, `iznos_max`) VALUES ('" . $LOSER_DATA['login'] . "', '139','wood','thing','0','1');");
            }
            $count_redkiy = $have_hell["unikal_count"] - 1;
            if ($count_redkiy > 0) {
                for ($i = 0; $i < $count_redkiy; $i++) {
                    mysql_query("INSERT INTO `inv` (`owner`, `object_id`, `object_type`, `object_razdel` ,`iznos`, `iznos_max`) VALUES ('" . $LOSER_DATA['login'] . "', '140','wood','thing','0','1');");
                }
                $str_redkiy = "<b>Редкий Образец</b> x{$count_redkiy}.";
            }
            say("toroom", "<b>" . $LOSER_DATA['login'] . "</b> создал предмет <b>Образец</b> x{$count_wood}. {$str_redkiy}", $LOSER_DATA['login']);
            mysql_Query("UPDATE hellround_pohod SET `end` = 1, `date_out` = " . time() . " WHERE `end` = 0 and `owner`=" . $LOSER_DATA["id"] . ";");
        }
        /*if(in_array($zay_type,$boylar))
        		{
        			//new year
        			//mysql_Query("INSERT INTO inv (owner, object_id, object_type, object_razdel, gift, gift_author, iznos, iznos_max, term) VALUES('".$LOSER_DATA['login']."', '60', 'scroll', 'magic', '1', 'WWW.MEYDAN.AZ', '0', '1', '".(time()+30*24*3600)."');");
        			//talk($LOSER_DATA["login"],"Вы нашли <b>Снежок</b>",$LOSER_DATA);
        			
        			//novruz
        			mysql_Query("INSERT INTO inv (owner, object_id, object_type, object_razdel, gift, gift_author, iznos, iznos_max, term) VALUES('".$LOSER_DATA['login']."', '262', 'scroll', 'magic', '1', 'WWW.MEYDAN.AZ', '0', '1', '".(time()+30*24*3600)."');");
        			talk($LOSER_DATA["login"],"Вы нашли <b>Праздничные яйца</b>",$LOSER_DATA);
        		}*/
        if ($LOSER_DATA["zver_on"]) {
            $exp_minus = rand(1, 4);
            if ($LOSER_DATA["energy"] < $exp_minus) {
                $exp_minus = rand(1, $LOSER_DATA["energy"]);
            }
            mysql_query("UPDATE zver SET energy=energy-{$exp_minus} WHERE owner=" . $LOSER_DATA["id"] . " and sleep=0 ");
        }
        $krov = array("100", "101", "102", "11");
        if (in_array($zay_type, $krov)) {
            $travm = rand(1, 3);
            getTravm($player, $travm);
            include "travm_dis.php";
            $travm_dis = array();
            $travm_dis[1] = $ushib_d_h[rand(0, count($ushib_d_h) - 1)];
            $travm_dis[2] = $ushib_d_c[rand(0, count($ushib_d_c) - 1)];
            $travm_dis[3] = $ushib_d_l[rand(0, count($ushib_d_l) - 1)];
            $phrase = "<span class=date>{$date}</span> <B>" . $player . "</B> получил повреждение: <font color=red>" . $travm_dis[$travm] . "</font>.<BR>";
            battle_log($battle, $phrase);
        }
        if ($zay_type == 20) {
            getTravm($player, 4);
            $phrase = "<span class=date>{$date}</span> <B>" . $player . "</B> получил повреждение: <font color=red>Неличимая травма</font>.<BR>";
            battle_log($battle, $phrase);
        }
        if ($phrase == 0) {
            talk($player, "Бой окончен! Вы проиграли бой. Всего вами нанесено: <b>" . $hitted_win . " HP</b>. Получено опыта: <b>0</b>.", $LOSER_DATA);
        } else {
            if ($phrase == 1) {
                talk($player, "Бой окончен! Ничья! Всего вами нанесено: <b>" . $hitted_win . " HP</b>. Получено опыта: <b>0</b>.", $LOSER_DATA);
            } else {
                if ($phrase == 2) {
                    $travm = rand(1, 3);
                    getTravm($player, $travm);
                    include "travm_dis.php";
                    $travm_dis = array();
                    $travm_dis[1] = $ushib_d_h[rand(0, count($ushib_d_h) - 1)];
                    $travm_dis[2] = $ushib_d_c[rand(0, count($ushib_d_c) - 1)];
                    $travm_dis[3] = $ushib_d_l[rand(0, count($ushib_d_l) - 1)];
                    $phrase = "<span class=date>{$date}</span> <B>" . $player . "</B> получил повреждение: <font color=red>" . $travm_dis[$travm] . "</font>.<BR>";
                    battle_log($battle, $phrase);
                    talk($player, "Бой окончен! Вы проиграли бой. Всего вами нанесено: <b>{$hitted_win} HP</b>. Получено опыта: <b>0</b>.", $LOSER_DATA);
                } else {
                    if ($phrase == 11) {
                        talk($player, "Бой окончен по таймауту! Ничья! Всего вами нанесено: <b>{$hitted_win} HP</b>. Получено опыта: <b>0</b>.", $LOSER_DATA);
                    }
                }
            }
        }
        $all_hp = $LOSER_DATA["hp_all"];
        if ($LOSER_DATA["level"] < 4) {
            setHP($player, $all_hp, $all_hp);
        } else {
            setHP($player, '0', $all_hp);
        }
        $cur_m = $LOSER_DATA["mana"];
        $all_m = $LOSER_DATA["mana_all"];
        setMN($player, $cur_m, $all_m);
    }
    mysql_query("UPDATE users,(SELECT player FROM teams WHERE battle_id='" . $cr . "' AND team='" . $team . "') as upd SET battle='0', " . ($phrase == 1 || $phrase == 11 ? "nich=nich+1" : "lose=lose+1") . ", zayavka=0, battle_opponent='', battle_pos='', battle_team='',fwd='',zver_on=0,oslab=" . (time() + 5 * 60) . " WHERE login=upd.player");
    mysql_query("UPDATE teams SET over = 1 WHERE battle_id='" . $cr . "' and team={$team}");
}
Esempio n. 3
0
File: 1.php Progetto: ehmedov/www
                 } else {
                     if ($res["end_time"] > time()) {
                         $err = "Вы не можете нанести вред на персонажа <B>" . $target . "</B>. Он находится под дейсвием елексира <i>&quotМасло против вампиров&quot</i>";
                     } else {
                         if ($res["battle"] != 0) {
                             $err = "Персонаж <B>" . $target . "</B> находиться в бою! Это заклятие не действует на персонажа !!!";
                         } else {
                             if ($res["hp"] < 0.3 * $res["hp_all"]) {
                                 $err = "Персонаж <B>" . $target . "</B> слишком ослаблен, чтобы применить к нему это заклинание.";
                             } else {
                                 $drink_hp = $res["hp"];
                                 if ($res["hp"] + $db["hp"] >= $db["hp_all"]) {
                                     $drink_hp = $db["hp_all"];
                                 }
                                 setHP($login, $drink_hp, $db["hp_all"]);
                                 setHP($target, 1, $res["hp_all"]);
                                 if ($db["sex"] == "female") {
                                     $pref = "а";
                                 } else {
                                     $pref = "";
                                 }
                                 $err = "Заклятие прокастовано удачно. Вы удачно выпили энергию из персонажа &quot{$target}&quot";
                                 say($target, "Вампир <b>&quot{$login}&quot</b> выпил{$pref} часть вашей энергии!", $target);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Esempio n. 4
0
File: egg.php Progetto: ehmedov/www
            $lose_hp = rand(1, 15);
        }
        $new_hp = $if_bot["hp"] - $lose_hp;
        if ($new_hp <= 0) {
            $new_hp = 0;
            $death = "<span class=date>{$date}</span> <b>" . $target . " мертв</b><br>";
        }
        $phrase = "<span class=date>{$date}</span> <span class={$span}>{$login}</span> кинул ¤йцом в <span class={$span2}>" . $target . "</span>, попав в {$mest_txt} <span class=krit>-{$lose_hp}</span>. [" . $new_hp . "/" . $if_bot["hp_all"] . "]<br>{$death}";
        mysql_Query("UPDATE `bot_temp` SET hp={$new_hp} WHERE id='" . $if_bot["id"] . "'");
    } else {
        $res = mysql_fetch_array(mysql_Query("SELECT * FROM users WHERE login='" . $target . "'"));
        $lose_hp = rand(1, 30);
        $new_hp = $res["hp"] - $lose_hp;
        if ($new_hp <= 0) {
            $new_hp = 0;
            $death = "<span class=date>{$date}</span> <b>" . $target . " мертв</b><br>";
        }
        $phrase = "<span class=date>{$date}</span> <span class={$span}>{$login}</span> кинул ¤йцом в <span class={$span2}>" . $target . "</span>, попав в {$mest_txt} <span class=krit>-{$lose_hp}</span>. [" . $new_hp . "/" . $res["hp_all"] . "]<br>{$death}";
        setHP($res["login"], $new_hp, $res["hp_all"]);
    }
    mysql_query("UPDATE teams SET hitted=hitted+{$lose_hp} WHERE player='" . $login . "'");
    mysql_query("UPDATE users SET battle_opponent='' WHERE login='" . $login . "'");
    battle_log($battle_id, $phrase);
    mysql_query("UPDATE inv SET iznos = iznos+1 WHERE id='" . $id . "'");
    $DAT = mysql_fetch_array(mysql_query("SELECT iznos,iznos_max FROM inv WHERE id = '" . $id . "'"));
    if ($DAT["iznos"] == $DAT["iznos_max"]) {
        mysql_query("UPDATE users SET slot" . $slot . "=0 WHERE login='" . $login . "'");
        mysql_query("DELETE FROM inv WHERE id = '" . $id . "'");
        say($login, "«аклинание <b>&laquo;" . $name . "&raquo;</b> полностью использован!", $login);
    }
}
Esempio n. 5
0
    } else {
        $ww = mysql_fetch_assoc($sql);
        mysql_query("INSERT INTO `inv` (`owner`, `object_id`, `object_type`, `object_razdel` ,`iznos`,  `iznos_max`) VALUES \t('" . $login . "', '" . $ww['object_id'] . "','wood','thing','0','1');");
        mysql_query("DELETE FROM predmet WHERE id='{$get}'");
        $msg = "Вы подняли '" . $ww["name"] . "'";
    }
    mysql_free_result($sql);
}
//------------Восстановление жизни-----------------------
if ($_GET['action'] == 'heal' && $step1['fwd'] == "2x15") {
    $heal = mysql_fetch_array(mysql_query("SELECT * FROM predmet WHERE creator='" . $group_id . "' and type='fontan'"));
    if ($heal["time_s"] < time()) {
        mysql_Query("DELETE FROM predmet WHERE creator='" . $group_id . "' and type='fontan'");
        $time_s = time() + 10 * 60;
        mysql_query("INSERT INTO predmet VALUES (null,'" . $group_id . "','','','fontan'," . $time_s . ")");
        setHP($login, $db['hp_all'], $db['hp_all']);
        $msg = "Оххх... Как хорошо...";
    } else {
        $msg = "Кто-то быстрее...";
    }
}
//---------------------------------------------------
if ($_GET['action'] == 'cerep' && ($step1['fwd'] == "4x27" || $step1['fwd'] == "4x3")) {
    $heal = mysql_fetch_array(mysql_query("SELECT * FROM predmet WHERE creator='" . $group_id . "' and type='cerep' and cord='" . $step1['fwd'] . "'"));
    if (!$heal) {
        mysql_query("INSERT INTO predmet VALUES (null,'" . $group_id . "','" . $step1['fwd'] . "','','cerep',0)");
        mysql_query("INSERT INTO predmet (creator,cord,object_id,type) VALUES ('" . $group_id . "','" . $my_cord . "','90','wood')");
    } else {
        $msg = "Кто-то быстрее...";
    }
}
Esempio n. 6
0
    $_POST['text'] = htmlspecialchars(addslashes(trim($_POST['text'])));
    if (strlen($_POST['text']) < 3) {
        $msg = 'Сообщение не может быть меньше 3 символов';
    } elseif ($db['glava'] != 1) {
        $msg = 'У вас нет на это прав!';
    } else {
        mysql_query("INSERT INTO castle_board SET tribe = '" . $db['clan_short'] . "', user_id = " . $db['id'] . ", msg = '" . $_POST['text'] . "', time = " . time() . "");
        $msg = "Сообщение добавлена!";
    }
}
//************************************************************
if ($_POST["hp_restore"]) {
    if ($db["hp_all"] - $db["hp"] == 0) {
        $msg = "Вы и так здоровы.";
    } else {
        setHP($login, $db["hp_all"], $db["hp_all"]);
        $msg = "Вы удачно восстановили свое здоровье!";
    }
}
//*********************************************************
if ($_POST["mn_restore"]) {
    if ($db["mana_all"] - $db["mana"] == 0) {
        $msg = "Вы и так здоровы.";
    } else {
        setMN($login, $db["mana_all"], $db["mana_all"]);
        $msg = "Вы удачно восстановили свою ману!";
    }
}
//*********************************************************
if ($_POST["lechit"]) {
    if ($db["travm"] != 0) {
Esempio n. 7
0
        $hp_now = $victims[$i]["hp"];
        $hp_all = $victims[$i]["hp_all"];
        $opponenti = $victims[$i]["opponent"];
        $hp_add = ceil(mt_rand($hp_min, $hp_max));
        if ($hp_all - $hp_now < $hp_add) {
            $hp_add = $hp_all - $hp_now;
        }
        $hp_new = $hp_now + $hp_add;
        setHP($opponenti, $hp_new, $hp_all);
        $ret['action'] .= "<span class=date>{$date}</span> <span class={$span}>" . $login . "</span> понимая, что ситуация становится критической, применил прием <span class=magic>" . $is_pr["name"] . "</span> и восстановил здоровье <span class={$span}>" . $opponenti . "</span> на <span class=hitted>+{$hp_add}</span> [{$hp_new}/{$hp_all}]<BR>";
    }
    if ($db["hp"] < $db["hp_all"]) {
        if ($db["hp_all"] - $db["hp"] < $hp_me) {
            $hp_me = $db["hp_all"] - $db["hp"];
        }
        $hp_new_me = $db["hp"] + $hp_me;
        setHP($login, $hp_new_me, $db["hp_all"]);
        $ret['action'] .= "<span class=date>{$date}</span> <span class={$span}>" . $login . "</span> понимая, что ситуация становится критической, применил прием <span class=magic>" . $is_pr["name"] . "</span> и восстановил свое здоровье <span class=hitted>+{$hp_me}</span> [{$hp_new_me}/" . $db["hp_all"] . "]<BR>";
        $yes_me = 1;
    }
    if (count($victims) > 0 || $yes_me == 1) {
        mysql_query("UPDATE battle_units SET hit=hit-" . (int) $is_pr["hit"] . ",krit=krit-" . (int) $is_pr["krit"] . ",uvarot=uvarot-" . (int) $is_pr["uvarot"] . ",block=block-" . (int) $is_pr["block"] . ",hp=hp-" . (int) $is_pr["hp"] . ",counter=counter-" . (int) $is_pr["all_hit"] . " WHERE player='" . $login . "' and battle_id='" . $b_id . "'");
        mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='earthhp6' and battle_id='" . $b_id . "'");
        mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='earthhp7' and battle_id='" . $b_id . "'");
        mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='earthhp8' and battle_id='" . $b_id . "'");
        mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='earthhp9' and battle_id='" . $b_id . "'");
        mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='earthhp10' and battle_id='" . $b_id . "'");
    }
    battle_log($b_id, $ret['action']);
    hit($login, $db["battle_opponent"], 0, 0, 0, 0, $b_id, 0);
}
Esempio n. 8
0
File: 87.php Progetto: ehmedov/www
<?php

include "key.php";
$login = $_SESSION['login'];
$target = htmlspecialchars(addslashes($_POST['target']));
$noname = $_POST['noname'];
if (!empty($target)) {
    $QUERY = mysql_query("SELECT * FROM users WHERE login='" . $target . "'");
    $data = mysql_fetch_array($QUERY);
    if ($data["battle"] != 0) {
        echo "Персонаж <B>" . $target . "</B> находиться в бою!";
    } else {
        setHP($data["login"], $data['hp_all'], $data['hp_all']);
        echo "HP персонажа <b>" . $data["login"] . "</b> успешно восстановлены!";
    }
}
Esempio n. 9
0
        $have_Duxa = mysql_fetch_Array(mysql_query("SELECT hp FROM `battle_units` WHERE player='" . $db["login"] . "' and battle_id=" . $db["battle"]));
        if ($have_Duxa["hp"] >= $duxa) {
            mysql_query("UPDATE `battle_units` SET hp=hp-{$duxa} WHERE player='" . $db["login"] . "' and battle_id=" . $db["battle"]);
            mysql_query("UPDATE inv SET iznos = iznos+1 WHERE id='" . $id . "'");
            $DAT = mysql_fetch_array(mysql_query("SELECT iznos,iznos_max FROM inv WHERE id = '" . $id . "'"));
            if ($DAT["iznos"] == $DAT["iznos_max"]) {
                mysql_query("UPDATE users SET slot" . $slot . "=0 WHERE login='" . $login . "'");
                mysql_query("DELETE FROM inv WHERE id = '" . $id . "'");
                $_SESSION["message"] .= "Заклинание <b>&laquo;" . $name . "&raquo;</b> полностью использован!";
            }
            $hp_now = $db["hp"];
            $hp_all = $db["hp_all"];
            if ($hp_all - $hp_now < $hp_add) {
                $hp_add = $hp_all - $hp_now;
            }
            $hp_new = $hp_now + $hp_add;
            $mana_new = $db["mana"] - $mana;
            $mana_all = $db["mana_all"];
            setHP($login, $hp_new, $hp_all);
            setMN($login, $mana_new, $mana_all);
            $battle_id = $db["battle"];
            $date = date("H:i");
            $span = $db["battle_team"] == 1 ? "p1" : "p2";
            $phrase = "<span class=date>{$date}</span> <span class={$span}>{$login}</span> использовал свиток <b>&laquo;" . $name . "&raquo;</b> и восстановил свое здоровье <span class=hitted>+{$hp_add}</span> [{$hp_new}/{$hp_all}]<br>";
            $t = time();
            battle_log($battle_id, $phrase);
        } else {
            $_SESSION["message"] .= "Не хватает Уровень Духа. Требуется Уровень Духа: {$duxa}";
        }
    }
}
Esempio n. 10
0
                         } else {
                             if ($res["hp"] < $res["hp_all"] / 100 * 25) {
                                 $err = "Персонаж <B>" . $target . "</B> слишком ослаблен, чтобы применить к нему это заклинание.";
                             } else {
                                 $hp_t = $res["hp_all"];
                                 $min_dr_hp = floor($hp_t / 100);
                                 $drink_hp = $res["hp"];
                                 $tar_allhp = $res["hp_all"];
                                 $tar_newhp = 1;
                                 if ($res["hp"] + $db["hp"] > $db["hp_all"]) {
                                     $drink_hp = $db["hp_all"];
                                 } else {
                                     $drink_hp = $res["hp"];
                                 }
                                 setHP($login, $drink_hp, $db["hp_all"]);
                                 setHP($target, $tar_newhp, $tar_allhp);
                                 if ($db["sex"] == "female") {
                                     $pref = "а";
                                 } else {
                                     $pref = "";
                                 }
                                 $err = "Заклятие прокастовано удачно. Вы удачно выпили энергию из персонажа &quot{$target}&quot";
                                 say($target, "<font color=#40404A>Смерть Души <b>&quot{$login}&quot</b> выпил{$pref} часть вашей энергии!</font>", $target);
                             }
                         }
                     }
                 }
             }
         }
     }
 } else {
Esempio n. 11
0
    if ($db["battle_team"] == 1) {
        $span = "p1";
        $span2 = "p2";
    } else {
        $span = "p2";
        $span2 = "p1";
    }
    $victims = array();
    $opponents = mysql_query("SELECT player,id,hp,hp_all FROM teams LEFT JOIN users on users.login=teams.player WHERE teams.battle_id = '" . $creator . "' and login='{$select_target}' and hp>0 and team={$my_team}");
    $opponent = mysql_fetch_array($opponents);
    if ($opponent) {
        $ret['action'] = '';
        $hp_now = $opponent["hp"];
        $hp_all = $opponent["hp_all"];
        $hp_add = ceil(mt_rand($hp_min, $hp_max));
        if ($hp_all - $hp_now < $hp_add) {
            $hp_add = $hp_all - $hp_now;
        }
        $hp_new = $hp_now + $hp_add;
        setHP($select_target, $hp_new, $hp_all);
        $ret['action'] .= "<span class=date>{$date}</span> <span class={$span}>" . $login . "</span> понимая, что ситуация становится критической, применил прием <span class=magic>" . $is_pr["name"] . "</span> и восстановил здоровье <span class={$span}>" . $select_target . "</span> на <span class=hitted>+{$hp_add}</span> [{$hp_new}/{$hp_all}]<BR>";
        mysql_query("UPDATE battle_units SET hit=hit-" . (int) $is_pr["hit"] . ",krit=krit-" . (int) $is_pr["krit"] . ",uvarot=uvarot-" . (int) $is_pr["uvarot"] . ",block=block-" . (int) $is_pr["block"] . ",hp=hp-" . (int) $is_pr["hp"] . ",counter=counter-" . (int) $is_pr["all_hit"] . " WHERE player='" . $login . "' and battle_id='" . $b_id . "'");
        mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='watterhp5' and battle_id='" . $b_id . "'");
        mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='watterhp6' and battle_id='" . $b_id . "'");
        mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='watterhp7' and battle_id='" . $b_id . "'");
        mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='watterhp8' and battle_id='" . $b_id . "'");
        mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='watterhp9' and battle_id='" . $b_id . "'");
        mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='watterhp10' and battle_id='" . $b_id . "'");
        battle_log($b_id, $ret['action']);
    }
}
Esempio n. 12
0
function unpaltar($who, $itm)
{
    $sql_user = mysql_query("SELECT * FROM `users` WHERE login='" . $who . "'");
    $sql_print = mysql_query("SELECT paltar.*,inv.id as id_inv FROM inv LEFT JOIN paltar on inv.object_id=paltar.id WHERE inv.owner='" . $who . "' and inv.id='" . $itm . "' and inv.wear=1");
    $db = mysql_fetch_array($sql_user);
    $item_data = mysql_fetch_array($sql_print);
    if ($item_data) {
        $i_type = $item_data["object"];
        $id_inv = $item_data["id_inv"];
        if ($i_type == "sword" || $i_type == "axe" || $i_type == "fail" || $i_type == "knife" || $i_type == "spear" || $i_type == "shield" || $i_type == "amunition" || $i_type == "staff" || $i_type == "kostyl") {
            if ($db["hand_r"] == $itm) {
                $slot = "hand_r";
            }
            if ($db["hand_l"] == $itm) {
                $slot = "hand_l";
            }
        } else {
            if ($i_type == "ring") {
                if ($db["ring1"] == $itm) {
                    $slot = "ring1";
                } else {
                    if ($db["ring2"] == $itm) {
                        $slot = "ring2";
                    } else {
                        if ($db["ring3"] == $itm) {
                            $slot = "ring3";
                        }
                    }
                }
            } else {
                $slot = $i_type;
            }
        }
        $slot_v = $db[$slot];
        $new_sila = $db["sila"] - $item_data["add_sila"];
        $new_lovkost = $db["lovkost"] - $item_data["add_lovkost"];
        $new_udacha = $db["udacha"] - $item_data["add_udacha"];
        $new_intellekt = $db["intellekt"] - $item_data["add_intellekt"];
        $new_phead = $db["bron_head"] - $item_data["protect_head"];
        $new_parm = $db["bron_arm"] - $item_data["protect_arm"];
        $new_pcorp = $db["bron_corp"] - $item_data["protect_corp"];
        $new_ppoyas = $db["bron_poyas"] - $item_data["protect_poyas"];
        $new_plegs = $db["bron_legs"] - $item_data["protect_legs"];
        $new_mfkrit = $db["krit"] - $item_data["krit"];
        $new_mfantikrit = $db["akrit"] - $item_data["akrit"];
        $new_mfuvorot = $db["uvorot"] - $item_data["uvorot"];
        $new_mfantiuvorot = $db["auvorot"] - $item_data["auvorot"];
        $new_wpmin_h = $item_data["min_attack"];
        $new_wpmax_h = $item_data["max_attack"];
        if ($slot == "hand_l") {
            $new_wpmin = $db["hand_l_hitmin"] - $item_data["min_attack"];
            $new_wpmax = $db["hand_l_hitmax"] - $item_data["max_attack"];
        } else {
            if ($slot == "hand_r") {
                $new_wpmin = $db["hand_r_hitmin"] - $item_data["min_attack"];
                $new_wpmax = $db["hand_r_hitmax"] - $item_data["max_attack"];
            }
        }
        $new_swordvl = $db["sword_vl"] - $item_data["sword_vl"];
        $new_axevl = $db["axe_vl"] - $item_data["axe_vl"];
        $new_failvl = $db["hummer_vl"] - $item_data["fail_vl"];
        $new_knifevl = $db["castet_vl"] - $item_data["knife_vl"];
        $new_spearvl = $db["copie_vl"] - $item_data["spear_vl"];
        $new_staffvl = $db["staff_vl"] - $item_data["staff_vl"];
        $new_mass = $db["mass"] - $item_data["mass"];
        $new_fire = $db["fire_magic"] - $item_data["add_fire"];
        $new_water = $db["water_magic"] - $item_data["add_water"];
        $new_air = $db["air_magic"] - $item_data["add_air"];
        $new_earth = $db["earth_magic"] - $item_data["add_earth"];
        $new_cast = $db["cast"] - $item_data["add_cast"];
        $new_trade = $db["trade"] - $item_data["add_trade"];
        $new_cure = $db["cure"] - $item_data["add_cure"];
        $new_hp = $db["hp_all"] - $item_data["add_hp"];
        $new_mana = $db["mana_all"] - $item_data["add_mana"];
        $hp = $db["hp"];
        $mn = $db["mana"];
        if ($new_hp > $hp) {
            $hp2 = $hp;
        } else {
            $r = $hp - $new_hp;
            $hp2 = $hp - $r;
        }
        if ($new_mana > $mn) {
            $mn2 = $mn;
        } else {
            $k = $mn - $new_mana;
            $mn2 = $mn - $k;
        }
        setHP($who, $hp2, $new_hp);
        setMN($who, $mn2, $new_mana);
        $new_sql = "UPDATE `users` SET sila='" . $new_sila . "',lovkost='" . $new_lovkost . "',udacha='" . $new_udacha . "',hp_all='" . $new_hp . "',";
        $new_sql .= "intellekt='" . $new_intellekt . "', mana_all='" . $new_mana . "',bron_head='" . $new_phead . "',bron_corp='" . $new_pcorp . "',";
        $new_sql .= "bron_legs='" . $new_plegs . "', bron_arm='" . $new_parm . "',bron_poyas='" . $new_ppoyas . "',";
        $new_sql .= "{$slot}='0',sword_vl='" . $new_swordvl . "',axe_vl='" . $new_axevl . "',hummer_vl='" . $new_failvl . "',";
        $new_sql .= "castet_vl='" . $new_knifevl . "',copie_vl='" . $new_spearvl . "',staff_vl='" . $new_staffvl . "',mass='" . $new_mass . "',";
        if ($slot == "hand_r") {
            $new_sql .= "hand_r_type='phisic',hand_r_free='1',hand_r_hitmin='0',hand_r_hitmax='0',";
        } else {
            if ($slot == "hand_l") {
                $new_sql .= "hand_l_type='phisic',hand_l_free='1',hand_l_hitmin='0',hand_l_hitmax='0',";
            }
        }
        $new_sql .= "krit='{$new_mfkrit}',akrit='{$new_mfantikrit}',uvorot='{$new_mfuvorot}',auvorot='{$new_mfantiuvorot}',";
        $new_sql .= "fire_magic='{$new_fire}',water_magic='{$new_water}',";
        $new_sql .= "air_magic='{$new_air}',earth_magic='{$new_earth}',cast='{$new_cast}',trade='{$new_trade}',cure='{$new_cure}'";
        $new_sql .= " WHERE login='" . $who . "'";
        mysql_query($new_sql);
        mysql_query("UPDATE inv SET wear='0',slot='' WHERE id='" . $id_inv . "'");
    }
}
Esempio n. 13
0
<?php

$login = $_SESSION["login"];
if ($db["battle"] && !$db["hp"]) {
    mysql_query("UPDATE inv SET iznos = iznos+1 WHERE id='" . $id . "'");
    $S_INV = mysql_query("SELECT iznos,iznos_max FROM inv WHERE id = '" . $id . "' limit 1");
    $DAT = mysql_fetch_array($S_INV);
    if ($DAT["iznos"] == $DAT["iznos_max"]) {
        mysql_query("UPDATE users SET slot" . $slot . "=0 WHERE login='" . $login . "'");
        mysql_query("DELETE FROM inv WHERE id = '" . $id . "'");
        $_SESSION["message"] = "Заклинание <b>&laquo;" . $name . "&raquo;</b> полностью использован!";
    }
    $login = $_SESSION['login'];
    $hp_all = $db["hp_all"];
    $mana_new = $db["mana"] - $mana;
    $mana_all = $db["mana_all"];
    setHP($login, $hp_all, $hp_all);
    setMN($login, $mana_new, $mana_all);
    $battle_id = $db["battle"];
    mysql_query("UPDATE battle_units SET hp=" . (ceil($db["level"] / 2 + 5) + $db["duxovnost"]) . " WHERE player='" . $login . "' and battle_id='" . $battle_id . "'");
    mysql_query("DELETE FROM hit_temp WHERE attack='" . $login . "' OR defend='" . $login . "'");
    $date = date("H:i");
    $span = $db["battle_team"] == 1 ? "p1" : "p2";
    $phrase = "<span class=date>{$date}</span> <span class={$span}>{$login}</span> внезапно исцелился...<br>";
    $t = time();
    battle_log($battle_id, $phrase);
}
Esempio n. 14
0
        }
    }
    $n = rand(1, 3);
    //kolichestvo
    $n2 = count($victims);
    if ($n2 < $n) {
        $n = $n2;
    }
    $i = 0;
    $ret['action'] = '';
    shuffle($victims);
    for ($i = 0; $i < $n; $i++) {
        $hp_now = $victims[$i]["hp"];
        $hp_all = $victims[$i]["hp_all"];
        $opponenti = $victims[$i]["opponent"];
        $hp_add = ceil(mt_rand($hp_min, $hp_max));
        if ($hp_all - $hp_now < $hp_add) {
            $hp_add = $hp_all - $hp_now;
        }
        $hp_new = $hp_now + $hp_add;
        setHP($opponenti, $hp_new, $hp_all);
        $ret['action'] .= "<span class=date>{$date}</span> <span class={$span}>" . $login . "</span> понимая, что ситуация становится критической, применил прием <span class=magic>" . $is_pr["name"] . "</span> и восстановил здоровье <span class={$span}>" . $opponenti . "</span> на <span class=hitted>+{$hp_add}</span> [{$hp_new}/{$hp_all}]<BR>";
    }
    mysql_query("UPDATE battle_units SET hit=hit-" . (int) $is_pr["hit"] . ",krit=krit-" . (int) $is_pr["krit"] . ",uvarot=uvarot-" . (int) $is_pr["uvarot"] . ",block=block-" . (int) $is_pr["block"] . ",hp=hp-" . (int) $is_pr["hp"] . ",counter=counter-" . (int) $is_pr["all_hit"] . " WHERE player='" . $login . "' and battle_id='" . $b_id . "'");
    mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='airhp7' and battle_id='" . $b_id . "'");
    mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='airhp8' and battle_id='" . $b_id . "'");
    mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='airhp9' and battle_id='" . $b_id . "'");
    mysql_query("UPDATE person_on SET pr_active=1,pr_wait_for=" . $is_pr["wait"] . " WHERE id_person='" . $db["id"] . "' and pr_name='airhp10' and battle_id='" . $b_id . "'");
    battle_log($b_id, $ret['action']);
    hit($login, $target, 0, 0, 0, 0, $b_id, 0);
}