<?
include ("inc/functions.php");
include ("inc/inc/w_functions.php");
// Очищаем Инвентарь >>>>>>>>>>>>>>>>>>>>>>>>>
$pers["inv"] = str_replace ("none","",$pers["inv"]);
$pers["inv"] = str_replace ("||","|",$pers["inv"]);
// Одеваем вещь >>>>>>>>>>>>>>>>>>>>>>>>
if (!empty($_GET["wear"]) and $_GET["wear"]<>'none') {
dress_weapon ($_GET["wear"],$_GET["durab"]);
}
// Снимаем всё>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
//////////////////////////////////
if ($_GET["snall"]=="all") {
remove_all_weapons ();
}
// Снимаем что-то одно >>>>>>>>>>>>
///////////////////////////////
if (!empty($_GET["sn"])) {
remove_weapon ($_GET["sn"]);
}
//Проверка требований одежды
$wear = explode ("|",$pers["wears"]);
for ($i=0;$i<14;$i++)
{
$expl = explode ("=",$wear[$i]);
$wear[$i] = $expl[0];
$wears_durability[$i] = $expl[1];
}
$i=0;
foreach ($wear as $idid) {
$z=1;
$v = mysql_fetch_array (mysql_query ("SELECT * FROM `weapons` WHERE `id` = '".$idid."'"));
if ($wears_durability[$i]==0 and $v["max_durability"]<>0) $z=0;
$i++;
if ($pers["level"]<$v["tlevel"]) $z=0;
if ($pers["sila"]<$v["tsila"] and $v["tsila"]>0) $z=0;
if ($pers["lovk"]<$v["tlovk"] and $v["tlovk"]>0) $z=0;
if ($pers["udacha"]<$v["tudacha"] and $v["tudacha"]>0) $z=0;
if ($pers["zdorov"]<$v["tzdorov"] and $v["tzdorov"]>0) $z=0;
if ($pers["znanya"]<$v["tznan"] and $v["tznan"]>0) $z=0;
if ($pers["power"]<$v["tpower"] and $v["tpower"]>0) $z=0;
if ($z==0) {
$id=0;
if ($wear[2]<>$v["id"] and $v["type"]=='orujie') $v["type"]='orujie2';
if ($wear[11]<>$v["id"] and $v["type"]=='kolco') $v["type"]='kolco2';
if ($wear[4]<>$v["id"] and $v["type"]=='zelie') {$v["type"]='zelie2';
if ($wear[5]<>$v["id"] and $v["type"]=='zelie2') $v["type"]='zelie3';}
remove_weapon ($v["type"]);
}
}
?>