Пример #1
0
mysql_select_db($db_name) or die('Ошибка входа в базу данных');
$login = $_SESSION["login"];
echo '<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"  xml:lang="en">';
if ($break == 1) {
    Header("Location: index.php");
    die;
}
$have_ses = mysql_fetch_Array(mysql_Query("SELECT count(*) FROM online WHERE uniqPCID='" . session_id() . "' and login='******'"));
if (!$have_ses[0]) {
    Header("Location: index.php?logout=" . md5(time()));
    die;
}
$db = mysql_fetch_array(mysql_query("SELECT users.*,zver.id as zver_count,zver.obraz as zver_obraz,zver.level as zver_level,zver.name as zver_name,zver.type as zver_type FROM `users` LEFT join zver on zver.owner=users.id  and zver.sleep=0 WHERE login='******'"));
effects($db["id"], $effect);
######################################################
TestBattle($db);
testPrision($db);
testCureTravm($login);
if ($db["exp"] >= $db["next_up"]) {
    testUps($db);
}
if ($db["zver_count"]) {
    $zver_db = mysql_fetch_assoc(mysql_query("SELECT * FROM zver WHERE id=" . $db["zver_count"]));
    if ($zver_db["exp"] >= $zver_db["next_up"]) {
        testZverUp($zver_db, $db["login"]);
    }
}
######################################################
if ($db["son"] == 0) {
Пример #2
0
function showPlayer_inv($myinfo)
{
    $item = array();
    $descr = array();
    $item['amulet'] = "slot/amulet0.gif";
    $item['naruchi'] = "slot/naruchi0.gif";
    $item['hand_r'] = "slot/weapon0.gif";
    $item['armour'] = "slot/armour0.gif";
    $item['rubaxa'] = "slot/armour0.gif";
    $item['plash'] = "slot/armour0.gif";
    $item['poyas'] = "slot/belt0.gif";
    $item['helmet'] = "slot/helmet0.gif";
    $item['mask'] = "slot/helmet0.gif";
    $item['masdrikon'] = "slot/helmet0.gif";
    $item['perchi'] = "slot/arm0.gif";
    $item['rukavic'] = "slot/arm0.gif";
    $item['ring1'] = "slot/ring0.gif";
    $item['ring2'] = "slot/ring0.gif";
    $item['ring3'] = "slot/ring0.gif";
    $item['pants'] = "slot/pants0.gif";
    $item['hand_l'] = "slot/wp0.gif";
    $item['boots'] = "slot/boot0.gif";
    $descr['amulet'] = "<b>Пустой слот амулет</b>";
    $descr['naruchi'] = "<b>Пустой слот наручи</b>";
    $descr['hand_r'] = "<b>Пустой слот правая рука</b>";
    $descr['armour'] = "<b>Пустой слот броня</b>";
    $descr['rubaxa'] = "<b>Пустой слот броня</b>";
    $descr['plash'] = "<b>Пустой слот броня</b>";
    $descr['poyas'] = "<b>Пустой слот пояс</b>";
    $descr['helmet'] = "<b>Пустой слот шлем</b>";
    $descr['mask'] = "<b>Пустой слот шлем</b>";
    $descr['masdrikon'] = "<b>Пустой слот шлем</b>";
    $descr['perchi'] = "<b>Пустой слот перчатки</b>";
    $descr['rukavic'] = "<b>Пустой слот перчатки</b>";
    $descr['ring1'] = "<b>Пустой слот кольцо</b>";
    $descr['ring2'] = "<b>Пустой слот кольцо</b>";
    $descr['ring3'] = "<b>Пустой слот кольцо</b>";
    $descr['pants'] = "<b>Пустой слот поножи</b>";
    $descr['hand_l'] = "<b>Пустой слот левая рука</b>";
    $descr['boots'] = "<b>Пустой слот обувь</b>";
    effects($myinfo["id"], $effect);
    $myinfo['sila'] = $myinfo['sila'] + $effect["add_sila"];
    $myinfo['lovkost'] = $myinfo['lovkost'] + $effect["add_lovkost"];
    $myinfo['udacha'] = $myinfo['udacha'] + $effect["add_udacha"];
    $myinfo['intellekt'] = $myinfo['intellekt'] + $effect["add_intellekt"];
    $sql = mysql_query("SELECT * FROM inv WHERE wear=1 and object_razdel='obj' and owner='" . $myinfo["login"] . "'");
    while ($dat = mysql_fetch_array($sql)) {
        $slot = $dat['slot'];
        $obj_id = $dat["object_id"];
        $iznos = $dat["iznos"];
        $iznos_all = $dat["iznos_max"];
        $gravirovka = $dat["gravirovka"];
        $is_modified = $dat["is_modified"];
        $is_personal = $dat['is_personal'];
        $personal_owner = $dat['personal_owner'];
        $wear_sex = $dat["sex"];
        $name = $dat["name"];
        $art = $dat["art"];
        $podzemka = $dat["podzemka"];
        $need_orden = $dat["need_orden"];
        $img = $dat["img"];
        $is_runa = $dat["runas"];
        $del_time = $dat["term"];
        $edited = $dat["edited"];
        $min_sila = $dat["min_sila"];
        $min_lovkost = $dat["min_lovkost"];
        $min_udacha = $dat["min_udacha"];
        $min_vinoslivost = $dat["min_power"];
        $min_intellekt = $dat["min_intellekt"];
        $min_vospriyatie = $dat["min_vospriyatie"];
        $add_vinoslivost = $dat["add_hp"];
        $add_mana = $dat["add_mana"];
        $bron_head = $dat["protect_head"];
        $bron_corp = $dat["protect_corp"];
        $bron_leg = $dat["protect_legs"];
        $bron_poyas = $dat["protect_poyas"];
        $min_attack = $dat["min_attack"];
        $max_attack = $dat["max_attack"];
        $itm = $dat["id"];
        if (($myinfo['sila'] < $min_sila || $myinfo['lovkost'] < $min_lovkost || $myinfo['udacha'] < $min_udacha || $myinfo['power'] < $min_vinoslivost || $myinfo['intellekt'] < $min_intellekt || $myinfo['vospriyatie'] < $min_vospriyatie || $wear_sex != "" && $myinfo['sex'] != $wear_sex || $need_orden != 0 && $myinfo['orden'] != $need_orden) && $dat["object_type"] != "kostyl") {
            unWear($myinfo['login'], $itm);
        } else {
            if ($myinfo['bs'] != 1 && $dat["bs"] == 1) {
                unWear($myinfo['login'], $itm);
            } else {
                if ($del_time != "" && $del_time < time()) {
                    unWear($myinfo['login'], $itm);
                    mysql_Query("DELETE FROM inv WHERE id={$itm}");
                    if (mysql_affected_rows() > 0) {
                        talk($myinfo["login"], "Закончился срок аренды <b>" . $name . "</b>", $myinfo);
                        history($myinfo["login"], "Закончился срок аренды", $name, $myinfo["remote_ip"], "showPlayer_inv");
                    }
                } else {
                    $desc = "";
                    $artimg = "";
                    $ordimg = "";
                    if ($is_personal) {
                        $desc .= "<img src=img/icon/personal.gif border=0> ";
                    }
                    if ($art) {
                        $desc .= "<img src=img/icon/artefakt.gif border=0> ";
                    }
                    if ($podzemka) {
                        $desc .= "<img src=img/icon/podzemka.gif border=0> ";
                    }
                    if ($need_orden) {
                        $desc .= "<img src=img/orden/{$need_orden}/0.gif border=0> ";
                    }
                    if ($is_runa) {
                        $desc .= "<img src=img/icon/runa.gif border=0> ";
                    }
                    $desc .= "<b>{$name} " . ($is_modified ? " +{$is_modified}" : "") . " ({$iznos}/{$iznos_all})</b>";
                    if ($dat["add_xp"] > 0) {
                        $desc .= "<br>• Подогнано: " . $dat["add_xp"] . " HP";
                    }
                    if ($gravirovka != "") {
                        $desc .= "<br>• Выгравирована надпись: " . $gravirovka;
                    }
                    if ($add_vinoslivost) {
                        $desc .= "<br>• Уровень ХП: +" . ($add_vinoslivost + $dat["add_xp"]);
                    }
                    if ($add_mana) {
                        $desc .= "<br>• Уровень маны: +{$add_mana}";
                    }
                    if ($bron_head) {
                        $desc .= "<br>• Броня головы: +{$bron_head}";
                    }
                    if ($bron_corp) {
                        $desc .= "<br>• Броня корпуса: +{$bron_corp}";
                    }
                    if ($bron_poyas) {
                        $desc .= "<br>• Броня пояса: +{$bron_poyas}";
                    }
                    if ($bron_leg) {
                        $desc .= "<br>• Броня ног: +{$bron_leg}";
                    }
                    if ($min_attack) {
                        $desc .= "<br>• Мин. урон: " . ($min_attack + $is_modified);
                    }
                    if ($max_attack) {
                        $desc .= "<br>• Макс. урон: " . ($max_attack + $is_modified);
                    }
                    if ($del_time != "") {
                        $desc .= "<BR><b>Аренда: до " . date('d.m.y H:i:s', $del_time) . "</b>";
                    }
                    if ($is_personal) {
                        $desc .= "<br><br><font color=brown>Личное оружие персонажа <b>{$personal_owner}</b></font>";
                    }
                }
            }
        }
        $descr[$slot] = $desc;
        $item[$slot] = $dat['img'];
        $item_unwear[$slot] = $itm;
    }
    mysql_free_result($sql);
    $inff = "<b>Информация о " . $myinfo["login"] . " [" . $myinfo["level"] . "]</b><br>• Сила: " . $myinfo["sila"] . "<br>• Ловкость: " . $myinfo["lovkost"] . "<br>• Удача: " . $myinfo["udacha"] . "<br>• Выносливость: " . $myinfo[power] . "<br>";
    if ($myinfo["level"]) {
        $inff .= "• Интеллект: " . $myinfo["intellekt"] . "<br>";
        $inff .= "• Восприятие: " . $myinfo["vospriyatie"] . "<br>";
    }
    if ($myinfo["level"] > 9) {
        $inff .= "• Духовность: " . $myinfo["duxovnost"] . "<br>";
    }
    echo "<table border=0 width=220 cellpadding=0 cellspacing=0>\n\t <tr>\n\t    <td width=60 height=220 valign=top>\n\t\t\t<script>";
    if ($item_unwear['masdrikon']) {
        echo "view_item('items/" . $item['masdrikon'] . "',60,60,'" . $descr['masdrikon'] . ($item_unwear['helmet'] ? "<hr color=#504F4C size=1 width=50%>" . $descr['helmet'] : "") . ($item_unwear['mask'] ? "<hr color=#504F4C size=1 width=50%>" . $descr['mask'] : "") . "','" . $style['masdrikon'] . "','" . $item_view['masdrikon'] . "');\n";
    } else {
        if ($item_unwear['helmet']) {
            echo "view_item('items/" . $item['helmet'] . "',60,60,'" . $descr['helmet'] . ($item_unwear['mask'] ? "<hr color=#504F4C size=1 width=50%>" . $descr['mask'] : "") . "','" . $style['helmet'] . "','" . $item_view['helmet'] . "');\n";
        } else {
            echo "view_item('items/" . $item['mask'] . "',60,60,'" . $descr['mask'] . "','" . $style['mask'] . "','" . $item_view['mask'] . "');\n";
        }
    }
    echo "\n\t\t\t\tview_item_inv('items/" . $item['naruchi'] . "',60,30,'" . $descr['naruchi'] . "','" . $item_unwear['naruchi'] . "');\n\t\t\t\tview_item_inv('items/" . $item['hand_r'] . "',60,60,'" . $descr['hand_r'] . "','" . $item_unwear['hand_r'] . "');";
    if ($item_unwear['plash']) {
        echo "view_item_inv('items/" . $item['plash'] . "',60,80,'" . $descr['plash'] . ($item_unwear['armour'] ? "<hr color=#504F4C size=1 width=50%>" . $descr['armour'] : "") . ($item_unwear['rubaxa'] ? "<hr color=#504F4C size=1 width=50%>" . $descr['rubaxa'] : "") . "','" . $item_unwear['plash'] . "');";
    } else {
        if ($item_unwear['armour']) {
            echo "view_item_inv('items/" . $item['armour'] . "',60,80,'" . $descr['armour'] . ($item_unwear['rubaxa'] ? "<hr color=#504F4C size=1 width=50%>" . $descr['rubaxa'] : "") . "','" . $item_unwear['armour'] . "');";
        } else {
            echo "view_item_inv('items/" . $item['rubaxa'] . "',60,80,'" . $descr['rubaxa'] . "','" . $item_unwear['rubaxa'] . "');";
        }
    }
    echo "view_item_inv('items/" . $item['poyas'] . "',60,30,'" . $descr['poyas'] . "','" . $item_unwear['poyas'] . "');\n\t\t\t</script>\n\t\t</td>\n\t\t<td width=140 height=220 valign=top>\n\t\t\t<div style=\"position:relative; z-index:0; width:140px; height:220px;\">";
    if ($myinfo["zver_count"]) {
        echo "<div style=\"position:absolute; left:85px; top:134px; width:55px; height:86px; z-index:1\"><a href='main.php?act=animal'><img src='img/" . $myinfo["zver_obraz"] . "' width=55 alt='" . $myinfo["zver_name"] . " [" . $myinfo["zver_level"] . "] (перейти к настройкам)'></a></div>";
    }
    echo "<script>\n\t\t\t\tview_item('obraz/" . $myinfo["obraz"] . "',140,220,'" . $inff . "');\n\t\t\t\tview_item('wp/banner.gif',140,40,'WWW.MEYDAN.AZ');\n\n\t\t\t</script>\n\t\t\t</div>\t\t\n\t\t</td>\n\t\t<td width=60 height=220 valign=top>\n\t\t\t<script>";
    echo "\n\t\t\t\tview_item_inv('items/" . $item['amulet'] . "',60,20,'" . $descr['amulet'] . "','" . $item_unwear['amulet'] . "');\n\t\t\t\tview_item_inv('items/" . $item['ring1'] . "',20,20,'" . $descr['ring1'] . "','" . $item_unwear['ring1'] . "');\n\t\t\t\tview_item_inv('items/" . $item['ring2'] . "',20,20,'" . $descr['ring2'] . "','" . $item_unwear['ring2'] . "');\n\t\t\t\tview_item_inv('items/" . $item['ring3'] . "',20,20,'" . $descr['ring3'] . "','" . $item_unwear['ring3'] . "');\n\t\t\t\tview_item_inv('items/" . $item['perchi'] . "',60,40,'" . $descr['perchi'] . "','" . $item_unwear['perchi'] . "');\n\t\t\t\tview_item_inv('items/" . $item['hand_l'] . "',60,60,'" . $descr['hand_l'] . "','" . $item_unwear['hand_l'] . "');\n\t\t\t\tview_item_inv('items/" . $item['pants'] . "',60,80,'" . $descr['pants'] . "','" . $item_unwear['pants'] . "');\n\t\t\t\tview_item_inv('items/" . $item['boots'] . "',60,40,'" . $descr['boots'] . "','" . $item_unwear['boots'] . "');\n\t\t\t</script>\n\t\t</td>\n\t</tr>\n\t</table>";
}
Пример #3
0
     } else {
         if ($power >= 75) {
             $def_protect_mag = 75;
         } else {
             if ($power >= 50) {
                 $def_protect_mag = 50;
             } else {
                 if ($power >= 25) {
                     $def_protect_mag = 25;
                 }
             }
         }
     }
 }
 $protect_mag = $protect_mag + $power * 1.5 + $def_protect_mag;
 effects($users_id, $effect);
 $def_priem = array();
 $d_pr = mysql_query("SELECT pr_name FROM person_on WHERE id_person=" . $users_id . " and battle_id={$b_id} and pr_active=2 and pr_cur_uses>0");
 while ($defend_priem = mysql_fetch_array($d_pr)) {
     $def_priem[] = $defend_priem["pr_name"];
 }
 if ($hp_now > 0) {
     $pers_uron = calc_mag($db, "air_magic");
     $uron = $pers_uron + rand($damage_min, $damage_max);
     $uron = $uron - ($protect_air + $effect["protect_air"]) - ($protect_mag + $effect["add_mg_bron"]) / 4;
     if (in_Array("protair", $def_priem)) {
         $uron = $uron / 2;
         mysql_query("UPDATE person_on SET pr_cur_uses=pr_cur_uses-1 WHERE id_person='" . $users_id . "' and battle_id=" . $b_id . " and pr_name='protair'");
         $my_res = mysql_fetch_array(mysql_query("SELECT pr_cur_uses FROM person_on WHERE id_person=" . $users_id . " and battle_id=" . $b_id . " and pr_name='protair'"));
         if ($my_res["pr_cur_uses"] == 1) {
             mysql_query("UPDATE person_on SET pr_active=1 WHERE id_person='" . $users_id . "' and battle_id=" . $b_id . " and pr_name='protair'");
Пример #4
0
function wear($who, $itm)
{
    $db = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE login='******'"));
    effects($db["id"], $effect);
    $item_data = mysql_fetch_array(mysql_query("SELECT * FROM inv WHERE owner='" . $who . "' and id='" . $itm . "' and object_razdel='obj' and wear=0"));
    if ($item_data) {
        $i_type = $item_data["object"];
        /*тип предмета*/
        $wearable = 0;
        if ($db["sila"] + $effect["add_sila"] >= $item_data["min_sila"] && $db["lovkost"] + $effect["add_lovkost"] >= $item_data["min_lovkost"] && $db["udacha"] + $effect["add_udacha"] >= $item_data["min_udacha"] && $db["power"] >= $item_data["min_power"] && $db["intellekt"] + $effect["add_intellekt"] >= $item_data["min_intellekt"] && $db["vospriyatie"] >= $item_data["min_vospriyatie"] && $db["level"] >= $item_data["min_level"] && $db["sword_vl"] + $effect["add_sword_vl"] >= $item_data["min_sword_vl"] && $db["staff_vl"] + $effect["add_staff_vl"] >= $item_data["min_staff_vl"] && $db["axe_vl"] + $effect["add_axe_vl"] >= $item_data["min_axe_vl"] && $db["hummer_vl"] + $effect["add_hummer_vl"] >= $item_data["min_fail_vl"] && $db["castet_vl"] + $effect["add_castet_vl"] >= $item_data["min_knife_vl"] && $db["copie_vl"] + $effect["add_copie_vl"] >= $item_data["min_spear_vl"] && $db["water_magic"] + $effect["add_water_magic"] >= $item_data["min_water"] && $db["earth_magic"] + $effect["add_earth_magic"] >= $item_data["min_earth"] && $db["fire_magic"] + $effect["add_fire_magic"] >= $item_data["min_fire"] && $db["air_magic"] + $effect["add_air_magic"] >= $item_data["min_air"]) {
            $wearable = 1;
        }
        if ($item_data["object_type"] == "kostyl") {
            $wearable = 1;
        }
        if ($item_data["iznos"] >= $item_data["iznos_max"]) {
            $wearable = 0;
        }
        if ($db['bs'] == 0 && $item_data["bs"] == 1) {
            $wearable = 0;
        }
        if ($db['bs'] == 1 && $item_data["bs"] == 0) {
            $wearable = 0;
        }
        if ($item_data["second_hand"] == 1) {
            if ($db["two_hand"] == 1) {
                unWear($who, $db["hand_r"]);
                wear($who, $itm);
                die;
            } else {
                if ($db["hand_r_free"] == 1) {
                    $slot = "hand_r";
                } else {
                    if ($db["hand_r_free"] == 0 && $db["hand_l_free"] == 1) {
                        $slot = "hand_l";
                    } else {
                        if ($db["hand_r_free"] == 0 && $db["hand_l_free"] == 0) {
                            unWear($who, $db["hand_r"]);
                            wear($who, $itm);
                            die;
                        }
                    }
                }
            }
            $w_type = $item_data["object_type"];
            /*тип оружия*/
        } else {
            if ($item_data["two_hand"] == 1) {
                if ($db["hand_r_free"] == 1 && $db["hand_l_free"] == 1) {
                    $slot = "hand_r";
                } else {
                    if ($db["hand_r_free"] == 1 && $db["hand_l_free"] == 0) {
                        unWear($who, $db["hand_l"]);
                        wear($who, $itm);
                        die;
                    } else {
                        if ($db["hand_r_free"] == 0 && $db["hand_l_free"] == 1) {
                            unWear($who, $db["hand_r"]);
                            wear($who, $itm);
                            die;
                        } else {
                            if ($db["hand_r_free"] == 0 && $db["hand_l_free"] == 0) {
                                unWear($who, $db["hand_r"]);
                                unWear($who, $db["hand_l"]);
                                wear($who, $itm);
                                die;
                            }
                        }
                    }
                }
                $w_type = $item_data["object_type"];
                /*тип оружия*/
            } else {
                if ($item_data["object_type"] == "sword" || $item_data["object_type"] == "axe" || $item_data["object_type"] == "fail" || $item_data["object_type"] == "spear" || $item_data["object_type"] == "knife" || $item_data["object_type"] == "kostyl") {
                    if ($item_data["second_hand"] == 0) {
                        if ($db["two_hand"] == 1) {
                            unWear($who, $db["hand_r"]);
                            wear($who, $itm);
                            die;
                        } else {
                            if ($db["hand_r_free"] == 0) {
                                unWear($who, $db["hand_r"]);
                                wear($who, $itm);
                                die;
                            } else {
                                $slot = "hand_r";
                            }
                        }
                    }
                    $w_type = $item_data["object_type"];
                    /*тип оружия*/
                } else {
                    if ($item_data["object_type"] == "shield" || $item_data["object_type"] == "amunition") {
                        if ($db["two_hand"] == 1) {
                            unWear($who, $db["hand_r"]);
                            wear($who, $itm);
                            die;
                        } else {
                            if ($db["hand_l_free"] == 1) {
                                $slot = "hand_l";
                            } else {
                                if ($db["hand_l_free"] == 0) {
                                    unWear($who, $db["hand_l"]);
                                    wear($who, $itm);
                                    die;
                                }
                            }
                        }
                        $w_type = $item_data["object_type"];
                        /*тип оружия*/
                    } else {
                        if ($item_data["object_type"] == "ring") {
                            if (!$db["ring1"]) {
                                $slot = "ring1";
                            } else {
                                if (!$db["ring2"]) {
                                    $slot = "ring2";
                                } else {
                                    if (!$db["ring3"]) {
                                        $slot = "ring3";
                                    } else {
                                        unWear($who, $db["ring1"]);
                                        wear($who, $itm);
                                        die;
                                    }
                                }
                            }
                            $wear_type = "paltar";
                        } else {
                            if ($db[$item_data["object_type"]] != 0) {
                                unWear($who, $db[$item_data["object_type"]]);
                                wear($who, $itm);
                                die;
                            }
                            $slot = $item_data["object_type"];
                            /*тип оружия*/
                            $wear_type = "paltar";
                        }
                    }
                }
            }
        }
        if ($item_data["need_orden"] != 0 && $db["orden"] != $item_data["need_orden"]) {
            $_SESSION["message"] = "Ваша склонность не позволяет одеть эту вещь.";
        } else {
            if ($item_data["sex"] != "" && $db["sex"] != $item_data["sex"]) {
                $_SESSION["message"] = "Ваша пол не позволяет одеть эту вещь.";
            } else {
                if ($wearable == 1) {
                    $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_duxovnost = $db["duxovnost"] + $item_data["add_duxovnost"];
                    $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["add_sword_vl"];
                    $new_axevl = $db["axe_vl"] + $item_data["add_axe_vl"];
                    $new_failvl = $db["hummer_vl"] + $item_data["add_fail_vl"];
                    $new_knifevl = $db["castet_vl"] + $item_data["add_knife_vl"];
                    $new_spearvl = $db["copie_vl"] + $item_data["add_spear_vl"];
                    $new_staffvl = $db["staff_vl"] + $item_data["add_staff_vl"];
                    $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_svet = $db["svet_magic"] + $item_data["add_svet"];
                    $new_tma = $db["tma_magic"] + $item_data["add_tma"];
                    $new_gray = $db["gray_magic"] + $item_data["add_gray"];
                    $protect_rej = $db["protect_rej"] + $item_data["protect_rej"];
                    $protect_drob = $db["protect_drob"] + $item_data["protect_drob"];
                    $protect_kol = $db["protect_kol"] + $item_data["protect_kol"];
                    $protect_rub = $db["protect_rub"] + $item_data["protect_rub"];
                    $protect_fire = $db["protect_fire"] + $item_data["protect_fire"];
                    $protect_water = $db["protect_water"] + $item_data["protect_water"];
                    $protect_air = $db["protect_air"] + $item_data["protect_air"];
                    $protect_earth = $db["protect_earth"] + $item_data["protect_earth"];
                    $protect_svet = $db["protect_svet"] + $item_data["protect_svet"];
                    $protect_tma = $db["protect_tma"] + $item_data["protect_tma"];
                    $protect_gray = $db["protect_gray"] + $item_data["protect_gray"];
                    $protect_mag = $db["protect_mag"] + $item_data["protect_mag"];
                    $protect_udar = $db["protect_udar"] + $item_data["protect_udar"];
                    $shieldblock = $db["shieldblock"] + $item_data["shieldblock"];
                    $parry = $db["parry"] + $item_data["parry"];
                    $counter = $db["counter"] + $item_data["counter"];
                    $add_rej = $db["add_rej"] + $item_data["add_rej"];
                    $add_drob = $db["add_drob"] + $item_data["add_drob"];
                    $add_kol = $db["add_kol"] + $item_data["add_kol"];
                    $add_rub = $db["add_rub"] + $item_data["add_rub"];
                    $add_fire_att = $db["add_fire_att"] + $item_data["add_fire_att"];
                    $add_air_att = $db["add_air_att"] + $item_data["add_air_att"];
                    $add_watet_att = $db["add_watet_att"] + $item_data["add_watet_att"];
                    $add_earth_att = $db["add_earth_att"] + $item_data["add_earth_att"];
                    $ms_udar = $db["ms_udar"] + $item_data["ms_udar"];
                    $ms_krit = $db["ms_krit"] + $item_data["ms_krit"];
                    $ms_mag = $db["ms_mag"] + $item_data["ms_mag"];
                    $ms_fire = $db["ms_fire"] + $item_data["ms_fire"] + $item_data["ms_mag"];
                    $ms_water = $db["ms_water"] + $item_data["ms_water"] + $item_data["ms_mag"];
                    $ms_air = $db["ms_air"] + $item_data["ms_air"] + $item_data["ms_mag"];
                    $ms_earth = $db["ms_earth"] + $item_data["ms_earth"] + $item_data["ms_mag"];
                    $ms_svet = $db["ms_svet"] + $item_data["ms_svet"] + $item_data["ms_mag"];
                    $ms_tma = $db["ms_tma"] + $item_data["ms_tma"] + $item_data["ms_mag"];
                    $ms_gray = $db["ms_gray"] + $item_data["ms_gray"] + $item_data["ms_mag"];
                    $ms_rej = $db["ms_rej"] + $item_data["ms_rej"];
                    $ms_drob = $db["ms_drob"] + $item_data["ms_drob"];
                    $ms_kol = $db["ms_kol"] + $item_data["ms_kol"];
                    $ms_rub = $db["ms_rub"] + $item_data["ms_rub"];
                    $new_cost = $item_data["art"] > 0 ? $item_data["gos_price"] * 20 : $item_data["gos_price"];
                    $proboy = $db["proboy"] + $item_data["proboy"];
                    $add_oruj = $db["add_oruj"] + $item_data["add_oruj"];
                    $new_mana = $db["mana_all"] + $item_data["add_mana"];
                    $new_hp = $db["hp_all"] + $item_data["add_xp"] + $item_data["add_hp"];
                    $now_hp = $db["hp"];
                    $now_mn = $db["mana"];
                    setHP($who, $now_hp, $new_hp);
                    setMN($who, $now_mn, $new_mana);
                    $new_sql = "UPDATE `users` SET sila='{$new_sila}', lovkost='{$new_lovkost}', udacha='{$new_udacha}', intellekt='{$new_intellekt}', duxovnost='{$new_duxovnost}', ";
                    $new_sql .= "hp_all='{$new_hp}', mana_all='{$new_mana}',";
                    $new_sql .= "bron_head='{$new_phead}', bron_corp='{$new_pcorp}', bron_legs='{$new_plegs}', bron_arm='{$new_parm}', bron_poyas='{$new_ppoyas}',";
                    $new_sql .= "{$slot}='" . $item_data["id"] . "', sword_vl='{$new_swordvl}', axe_vl='{$new_axevl}', hummer_vl='{$new_failvl}', castet_vl='{$new_knifevl}', copie_vl='{$new_spearvl}', staff_vl='{$new_staffvl}',";
                    if ($slot == "hand_r") {
                        $new_sql .= "hand_r_type='{$w_type}', hand_r_free='0', hand_r_hitmin='{$new_wpmin}', hand_r_hitmax='{$new_wpmax}',";
                    } else {
                        if ($slot == "hand_l") {
                            $new_sql .= "hand_l_type='{$w_type}', hand_l_free='0', hand_l_hitmin='{$new_wpmin}', hand_l_hitmax='{$new_wpmax}',";
                        }
                    }
                    $new_sql .= "protect_rej='{$protect_rej}', protect_drob='{$protect_drob}', protect_kol='{$protect_kol}', protect_rub='{$protect_rub}', ";
                    $new_sql .= "protect_fire='{$protect_fire}', protect_water='{$protect_water}', protect_air='{$protect_air}', protect_earth='{$protect_earth}', protect_svet='{$protect_svet}', protect_tma='{$protect_tma}', protect_gray='{$protect_gray}', ";
                    $new_sql .= "protect_mag='{$protect_mag}', protect_udar='{$protect_udar}', shieldblock='{$shieldblock}', ";
                    $new_sql .= "parry='{$parry}', counter='{$counter}', ";
                    //$new_sql.="add_rej='$add_rej', add_drob='$add_drob', add_kol='$add_kol', add_rub='$add_rub', ";
                    //$new_sql.="add_fire_att='$add_fire_att', add_air_att='$add_air_att', add_watet_att='$add_watet_att', add_earth_att='$add_earth_att', ";
                    $new_sql .= "ms_udar='{$ms_udar}', ms_krit='{$ms_krit}', ms_mag='{$ms_mag}', ";
                    $new_sql .= "ms_fire='{$ms_fire}', ms_water='{$ms_water}', ms_air='{$ms_air}', ms_earth='{$ms_earth}', ms_svet='{$ms_svet}', ms_tma='{$ms_tma}', ms_gray='{$ms_gray}', ";
                    $new_sql .= "ms_rej='{$ms_rej}', ms_drob='{$ms_drob}', ms_kol='{$ms_kol}', ms_rub='{$ms_rub}', ";
                    $new_sql .= "proboy='{$proboy}', add_oruj='{$add_oruj}', ";
                    $new_sql .= "krit='{$new_mfkrit}', akrit='{$new_mfantikrit}', uvorot='{$new_mfuvorot}', auvorot='{$new_mfantiuvorot}', ";
                    $new_sql .= "fire_magic='{$new_fire}', water_magic='{$new_water}', air_magic='{$new_air}', earth_magic='{$new_earth}', ";
                    $new_sql .= "svet_magic='{$new_svet}',tma_magic='{$new_tma}',gray_magic='{$new_gray}',";
                    $new_sql .= $wear_type != "paltar" ? "two_hand=" . $item_data["two_hand"] . "," : "";
                    $new_sql .= "cost=cost+{$new_cost}";
                    $new_sql .= " WHERE login='******'";
                    mysql_query($new_sql);
                    mysql_query("UPDATE `inv` SET wear=1,slot='" . $slot . "' WHERE id='" . $itm . "'");
                }
            }
        }
    }
    Header("Location: inv.php?otdel=obj&tmp=" . md5(time()));
}
Пример #5
0
     }
 }
 $n = rand(3, 5);
 //kolichestvo udarov
 $n2 = count($victims);
 if ($n2 < $n) {
     $n = $n2;
 }
 $i = $ret['uron'] = 0;
 $phrase = '';
 $pers_uron = calc_mag($db, "water_magic");
 $f = $pers_uron + $damage_min;
 $g = $pers_uron + $damage_max;
 shuffle($victims);
 for ($i = 0; $i < $n; $i++) {
     effects($victims[$i]["id"], $effect);
     $def_priem = array();
     $d_pr = mysql_query("SELECT pr_name FROM person_on WHERE id_person=" . $victims[$i]["id"] . " and battle_id={$b_id} and pr_active=2 and pr_cur_uses>0");
     while ($defend_priem = mysql_fetch_array($d_pr)) {
         $def_priem[] = $defend_priem["pr_name"];
     }
     $uron = mt_rand($f, $g);
     if ($victims[$i]["power"] >= 125) {
         $def_protect_mag = 150;
     } else {
         if ($victims[$i]["power"] >= 100) {
             $def_protect_mag = 100;
         } else {
             if ($victims[$i]["power"] >= 75) {
                 $def_protect_mag = 75;
             } else {
Пример #6
0
function calc_mag($pers, $magic_type)
{
    effects($pers["id"], $effect);
    $pers["intellekt"] = $pers["intellekt"] + $effect["add_intellekt"];
    //----------------------ZVER BONUS------------------------------------------------
    if ($pers["zver_on"] == 1 && $pers["zver_type"] == "snake") {
        if ($pers["zver_level"] < 6) {
            $add_ms_mag = $pers["zver_level"];
        } else {
            if ($pers["zver_level"] == 6) {
                $add_ms_mag = 7;
            } else {
                if ($pers["zver_level"] == 7) {
                    $add_ms_mag = 9;
                } else {
                    if ($pers["zver_level"] == 8) {
                        $add_ms_mag = 11;
                    } else {
                        if ($pers["zver_level"] == 9) {
                            $add_ms_mag = 13;
                        } else {
                            if ($pers["zver_level"] == 10) {
                                $add_ms_mag = 15;
                            } else {
                                if ($pers["zver_level"] == 11) {
                                    $add_ms_mag = 17;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    //--------------------------------------------------------------------------------
    $sql = mysql_query("SELECT is_modified, art, add_fire_att, add_air_att, add_watet_att, add_earth_att FROM `inv` WHERE id=" . $pers["hand_r"]);
    $modif = mysql_fetch_array($sql);
    $is_modified = $modif['is_modified'];
    $is_art = $modif['art'];
    //----------------------PRIYOM ON------------------------------------------------
    $a_pr = mysql_query("SELECT pr_name FROM person_on WHERE id_person=" . $pers["id"] . " and battle_id=" . $pers["battle"] . " and pr_active=2 and pr_cur_uses>0");
    while ($attack_priem = mysql_fetch_array($a_pr)) {
        $at_priem[] = $attack_priem["pr_name"];
    }
    $attack_priem_count = array_count_values($at_priem);
    //--------------------------------------------------------------------------------
    switch ($magic_type) {
        case "water_magic":
            $add_magic = (int) $effect["add_water_magic"];
            $hit_type = $modif['add_watet_att'];
            $ms_mag_hit = $pers["ms_water"];
            break;
        case "earth_magic":
            $add_magic = (int) $effect["add_earth_magic"];
            $hit_type = $modif['add_earth_att'];
            $ms_mag_hit = $pers["ms_earth"];
            break;
        case "fire_magic":
            $add_magic = (int) $effect["add_fire_magic"];
            $hit_type = $modif['add_fire_att'];
            $ms_mag_hit = $pers["ms_fire"];
            break;
        case "air_magic":
            $add_magic = (int) $effect["add_air_magic"];
            $hit_type = $modif['add_air_att'];
            $ms_mag_hit = $pers["ms_air"];
            break;
        case "tma_magic":
            $add_magic = (int) $effect["add_tma_magic"];
            $hit_type = $modif['add_tma_att'];
            $ms_mag_hit = $pers["ms_tma"];
            break;
    }
    if ($pers["hand_r_type"] == "staff" || $pers["hand_r_type"] == "spear") {
        $k = rand($pers["hand_r_hitmin"] + $is_modified + $effect["min_udar"], $pers["hand_r_hitmax"] + $is_modified + $effect["max_udar"]) * (1 + 0.07000000000000001 * ($pers["staff_vl"] + $add_magic));
    }
    //----------------------BONUS------------------------------------------------
    if ($pers["intellekt"] >= 125) {
        $ms_mag_hit = $ms_mag_hit + 25;
    } else {
        if ($pers["intellekt"] >= 100) {
            $ms_mag_hit = $ms_mag_hit + 20;
        } else {
            if ($pers["intellekt"] >= 75) {
                $ms_mag_hit = $ms_mag_hit + 15;
            } else {
                if ($pers["intellekt"] >= 50) {
                    $ms_mag_hit = $ms_mag_hit + 10;
                } else {
                    if ($pers["intellekt"] >= 25) {
                        $ms_mag_hit = $ms_mag_hit + 5;
                    }
                }
            }
        }
    }
    $ms_mag_hit = $ms_mag_hit + $add_ms_mag + $pers["intellekt"] / 2 + (int) $effect["add_ms_mag"];
    if ($attack_priem_count["yarost"] == 1) {
        $ms_mag_hit = $ms_mag_hit * 1.05;
    } else {
        if ($attack_priem_count["yarost"] == 2) {
            $ms_mag_hit = $ms_mag_hit * 1.1;
        } else {
            if ($attack_priem_count["yarost"] >= 3) {
                $ms_mag_hit = $ms_mag_hit * 1.15;
            }
        }
    }
    $uron = $pers[$magic_type] + $k;
    if ($hit_type > 0) {
        $ggg = rand(1, 120);
        if ($ggg <= $hit_type) {
            $uron = $uron + $uron * $hit_type / 100;
        }
    }
    $uron = $uron + $uron * $ms_mag_hit / 100;
    if ($is_art == 1) {
        $uron = $uron * 1.3;
    }
    if ($is_art == 2) {
        $uron = ($uron + $pers["intellekt"]) * 1.2;
    }
    //----------------------END URON------------------------------------------------
    return ceil($uron);
}
Пример #7
0
<?php

effects($ATTACK_DATA["id"], $effect_attack);
effects($DEFEND_DATA["id"], $effect_defend);
/*===================определение характеристик атакующего===============*/
$attack_sila = $ATTACK_DATA["sila"] + $effect_attack["add_sila"];
$attack_lovkost = $ATTACK_DATA["lovkost"] + $effect_attack["add_lovkost"];
$attack_udacha = $ATTACK_DATA["udacha"] + $effect_attack["add_udacha"];
if (voin_type($ATTACK_DATA) == "mag" && $type[0] == 1 && $P_HDATA["type"] == 55) {
    $attack_sila = $ATTACK_DATA["intellekt"] / 10 * $ATTACK_DATA["level"];
}
if (in_Array("xlebnut", $at_priem)) {
    $add_xleb_sila[7] = 10;
    $add_xleb_sila[8] = 13;
    $add_xleb_sila[9] = 14;
    $add_xleb_sila[10] = 15;
    $add_xleb_sila[11] = 15;
    $add_xleb_sila[12] = 15;
    $add_xleb_sila[13] = 15;
    $attack_sila = $attack_sila + $add_xleb_sila[$ATTACK_DATA["level"]];
}
$parry = $ATTACK_DATA["parry"] + 5;
$ms_uron = $ATTACK_DATA["ms_udar"] + $effect_attack["add_ms_boyech"] + (in_Array("jajda", $at_priem) ? 5 : 0);
$ms_krit = $ATTACK_DATA["ms_krit"];
$attack_counter = $ATTACK_DATA["counter"] + 10;
############################################################
if ($ATTACK_DATA["zver_on"] == 1) {
    switch ($ATTACK_DATA["zver_type"]) {
        case "wolf":
            $attack_udacha = $attack_udacha + $ATTACK_DATA["zver_level"];
            break;
Пример #8
0
 echo "</TD></TR></TABLE>";
 echo "<br><table width=500 class='l3' cellpadding=5 cellspacing=1><tr class='l1'><td>";
 echo "<b style='color:brown'>ѕоследни¤ причина заключени¤: </b>" . ($res["prision_reason"] ? $res["prision_reason"] : "<i style='color:grey'>нету</i>");
 echo "<br><br><b style='color:brown'>ѕоследни¤ причина блока: </b>" . ($res["blok_reason"] ? $res["blok_reason"] : "<i style='color:grey'>нету</i>");
 echo "<br><br><b style='color:brown'>ѕоследни¤ причина изгнани¤ из ордена: </b>" . ($res["orden_reason"] ? $res["orden_reason"] : "<i style='color:grey'>нету</i>");
 echo "</TD></TR></TABLE>";
 echo "<br><table width=500 class='l3' cellpadding=5 cellspacing=1><tr class='l1'><td>";
 echo "<b style='color:brown'>ќтчет системы безопасности:</b><br>";
 $lv = mysql_query("SELECT * FROM report WHERE login='******' and type='1' ORDER BY time_stamp DESC LIMIT 5");
 while ($lastvisit = mysql_fetch_array($lv)) {
     echo $lastvisit['time_stamp'] . " <b>" . $lastvisit['action'] . "</b> " . $lastvisit['ip'] . '<br>';
 }
 echo "</TD></TR></TABLE>";
 echo "</td><td width=5 nowrap><span></span></td><td valign=top nowrap width=500>";
 if ($db['adminsite']) {
     effects($res["id"], $effect);
     echo "<table width=500 class='l3' cellpadding=5 cellspacing=1><tr class='l1'><td>";
     echo "—нар¤жение: <a href='geyim.php?user="******"' class=us2 target='_blank'>ѕосмотреть</a><br>";
     echo "E-mail: <b>" . $res['email'] . "</b><BR>";
     echo "Admin level: <b style='color:red'>" . $res['admin_level'] . "</b><br>";
     echo "Admin Site: <b style='color:red'>" . $res['adminsite'] . "</b><br>";
     echo "ID: <b style='color:red'>" . $res['id'] . "</b>";
     echo "</TD></TR></TABLE>";
     echo "<br><table width=500 class='l3' cellpadding=5 cellspacing=1><tr class='l1'><td>";
     echo "ќпыт: <b>" . $res['exp'] . "</b><BR>";
     echo "ѕовышение: <b>" . $res['next_up'] . "</b><BR>";
     echo "<font color=green>—вободных увеличений: <b>" . $res['ups'] . "</b> [" . $res['add_ups'] . "]<BR>";
     echo "—вободные умени¤: <b>" . $res['umenie'] . "</b> [" . $res['add_umenie'] . "]</font>";
     echo "</TD></TR></TABLE>";
     echo "<br><table width=500 class='l3' cellpadding=5 cellspacing=1><tr class='l1'><td>";
     echo "<b style='color:brown'>Doyuw sisteminin Deyiwenleri:</b><BR>";