<?
$db->openDB();
$cl_p=mysql_query("SELECT * FROM users WHERE NICK=\"$_SESSION[s]\"");

while($cl_p2L=mysql_fetch_assoc($cl_p)){

if($cl_p2L[class_pers]==1){
if(($cl_p2L[SKILL_DEX]/5)>0){$DMPL=$cl_p2L[SKILL_DEX]/5;}
$weapon_DMG=mysql_query("SELECT * FROM inv WHERE ID_USERS='$_SESSION[s]' AND ID_IL='$idT'");
$weapon_DMG2=mysql_fetch_assoc($weapon_DMG);
$d3=$weapon_lvl2[IL_MIN_DMG]+$DMPL+$weapon_DMG2[BONUS_DAM];
$d4=$weapon_lvl2[IL_MAX_DMG]+$DMPL+$weapon_DMG2[BONUS_DAM];
$we2=mysql_query("UPDATE inv SET IL_NO='1' WHERE IL_KEY='$use' AND ID_USERS='$_SESSION[s]' AND ID_IL='$idT'");
$weF2=mysql_query("UPDATE users SET DAMAGEmin=\"$d3\",DAMAGEmax=\"$d4\",time_otdix=\"$weapon_lvl2[IL_SPD]\" WHERE NICK='$_SESSION[s]'");//здесь возвращаем прежний урон
 print('<SCRIPT>location.href="inv.php";</SCRIPT>'); }
if($cl_p2L[class_pers]==3 OR $cl_p2L[class_pers]==4 OR $cl_p2L[class_pers]==5 OR $cl_p2L[class_pers]==7){
echo'вы одели оружие';
$posoxTOCH=mysql_query("SELECT * FROM inv WHERE IL_CLASS=\"hummer\" AND IL_NO=\"0\" AND ID_USERS=\"$_SESSION[s]\"");

if(mysql_num_rows($posoxTOCH)>0){
$useposox=mysql_query("SELECT * FROM seconSKILLS WHERE NICK_SSKILLS=\"$_SESSION[s]\" AND KEY_SSKILLS=\"useswords\"");
while($useposox2=mysql_fetch_assoc($useposox)){
$skills_1=$useposox2[LVL_SSKILLS]*10;
}
$users=mysql_query("SELECT * FROM users WHERE NICK=\"$_SESSION[s]\"");
while($users2=mysql_fetch_assoc($users)){
$Ptoch=$skills_1+25;
$tochP=mysql_query("UPDATE users SET U_TOCH=\"$Ptoch\" WHERE NICK=\"$_SESSION[s]\"");
}}
if(($cl_p2L[SKILL_STR]/5)>0){$DMPL=$cl_p2L[SKILL_STR]/5;}
$d3=$weapon_lvl2[IL_MIN_DMG]+$DMPL+$weapon_lvl2[BONUS_DAM];
$d4=$weapon_lvl2[IL_MAX_DMG]+$DMPL+$weapon_lvl2[BONUS_DAM];

$we2=mysql_query("UPDATE inv SET IL_NO='1' WHERE IL_KEY='$use' AND ID_USERS='$_SESSION[s]' AND ID_IL='$idT'");
$weF2=mysql_query("UPDATE users SET DAMAGEmin=\"$d3\",DAMAGEmax=\"$d4\",time_otdix=\"$weapon_lvl2[IL_SPD]\" WHERE NICK='$_SESSION[s]'");//здесь возвращаем прежний урон
 print('<SCRIPT>location.href="inv.php?NICK='.$_SESSION[s].'&pass='.$pass.'";</SCRIPT>');
die;}
if($cl_p2L[class_pers]==2 OR $cl_p2L[class_pers]==6 OR $cl_p2L[class_pers]==8){
$posoxTOCH=mysql_query("SELECT * FROM inv WHERE IL_CLASS=\"posox\" AND IL_NO=\"0\" AND ID_USERS=\"$_SESSION[s]\"");

if(mysql_num_rows($posoxTOCH)>0){
$useposox=mysql_query("SELECT * FROM seconSKILLS WHERE NICK_SSKILLS=\"$_SESSION[s]\" AND KEY_SSKILLS=\"useposox\"");
while($useposox2=mysql_fetch_assoc($useposox)){
$skills_1=$useposox2[LVL_SSKILLS]*10;
}
$users=mysql_query("SELECT * FROM users WHERE NICK=\"$_SESSION[s]\"");
while($users2=mysql_fetch_assoc($users)){
$Ptoch=$skills_1+25;
$tochP=mysql_query("UPDATE users SET U_TOCH=\"$Ptoch\" WHERE NICK=\"$_SESSION[s]\"");
}}
if(($cl_p2L[SKILL_INT]/5)>0){$DMPL=$cl_p2L[SKILL_INT]/5;}
$d3=$weapon_lvl2[IL_MAGD_MIN]+$DMPL+$weapon_DMG2[BONUS_MDAM];
$d4=$weapon_lvl2[IL_MAGD_MAX]+$DMPL+$weapon_DMG2[BONUS_MDAM];
$we2=mysql_query("UPDATE inv SET IL_NO='1' WHERE IL_KEY='$use' AND ID_USERS='$_SESSION[s]' AND ID_IL='$idT'");
$weF2=mysql_query("UPDATE users SET MG_DMGmin=\"$d3\",MG_DMGmax=\"$d4\",time_otdix=\"$weapon_lvl2[IL_SPD]\" WHERE NICK='$_SESSION[s]'");//здесь возвращаем прежний урон
 print('<SCRIPT>location.href="inv.php?NICK='.$_SESSION[s].'&pass='.$pass.'";</SCRIPT>');
die;}
}


?>