This commit is contained in:
Igor Barkov [iwork] 2018-11-01 18:00:26 +02:00
parent 5e6fe346e6
commit 88d8957cb9

View File

@ -2134,51 +2134,49 @@ function dropitem($slot)
break; break;
} }
{ {
if (mysql_query("UPDATE `users` as u, `inventory` as i SET u.{$slot1} = 0, i.dressed = 0, if (db::c()->query('UPDATE `users` as `u`, `inventory` as `i` SET `u`.?f = 0, `i`.`dressed` = 0,
u.sila = u.sila - i.gsila, `u`.`sila` = `u`.`sila` - `i`.`gsila`,
u.lovk = u.lovk - i.glovk, `u`.`lovk` = `u`.`lovk` - `i`.`glovk`,
u.inta = u.inta - i.ginta, `u`.`inta` = `u`.`inta` - `i`.`ginta`,
u.intel = u.intel - i.gintel, `u`.`intel` = `u`.`intel` - `i`.`gintel`,
u.maxhp = u.maxhp - i.ghp, `u`.`maxhp` = `u`.`maxhp` - `i`.`ghp`,
u.noj = u.noj - i.gnoj, `u`.`noj` = `u`.`noj` - `i`.`gnoj`,
u.topor = u.topor - i.gtopor, `u`.`topor` = `u`.`topor` - `i`.`gtopor`,
u.dubina = u.dubina - i.gdubina, `u`.`dubina` = `u`.`dubina` - `i`.`gdubina`,
u.mec = u.mec - i.gmech, `u`.`mec` = `u`.`mec` - `i`.`gmech`,
u.mfire = u.mfire - i.gfire, `u`.`mfire` = `u`.`mfire` - `i`.`gfire`,
u.mwater = u.mwater - i.gwater, `u`.`mwater` = `u`.`mwater` - `i`.`gwater`,
u.mair = u.mair - i.gair, `u`.`mair` = `u`.`mair` - `i`.`gair`,
u.mearth = u.mearth - i.gearth, `u`.`mearth` = `u`.`mearth` - `i`.`gearth`,
u.mlight = u.mlight - i.glight, `u`.`mlight` = `u`.`mlight` - `i`.`glight`,
u.mgray = u.mgray - i.ggray, `u`.`mgray` = `u`.`mgray` - `i`.`ggray`,
u.mdark = u.mdark - i.gdark, `u`.`mdark` = `u`.`mdark` - `i`.`gdark`,
u.ubron1 = u.ubron1 - i.bron1, `u`.`ubron1` = `u`.`ubron1` - `i`.`bron1`,
u.ubron2 = u.ubron2 - i.bron2, `u`.`ubron2` = `u`.`ubron2` - `i`.`bron2`,
u.ubron3 = u.ubron3 - i.bron3, `u`.`ubron3` = `u`.`ubron3` - `i`.`bron3`,
u.ubron4 = u.ubron4 - i.bron4, `u`.`ubron4` = `u`.`ubron4` - `i`.`bron4`,
u.fkrit = u.fkrit - i.mfkrit, `u`.`fkrit` = `u`.`fkrit` - `i`.`mfkrit`,
u.fakrit = u.fakrit - i.mfakrit, `u`.`fakrit` = `u`.`fakrit` - `i`.`mfakrit`,
u.fuvorot = u.fuvorot - i.mfuvorot, `u`.`fuvorot` = `u`.`fuvorot` - `i`.`mfuvorot`,
u.fauvorot = u.fauvorot - i.mfauvorot, `u`.`fauvorot` = `u`.`fauvorot` - `i`.`mfauvorot`,
u.uminu = u.uminu - i.minu, `u`.`uminu` = `u`.`uminu` - `i`.`minu`,
u.umaxu = u.umaxu - i.maxu `u`.`umaxu` = `u`.`umaxu` - `i`.`maxu`
WHERE i.id = u.{$slot1} AND i.dressed = 1 AND i.owner = {$user['id']} AND u.id = {$user['id']};")) WHERE `i`.`id` = `u`.?f AND `i`.`dressed` = 1 AND `i`.`owner` = ?i AND u.id = ?i',$slot1,$slot1,$user['id'],$user['id']))
mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = " . time() . " WHERE `hp` > `maxhp` AND `id` = '{$user['id']}' LIMIT 1;"); db::c()->query('UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = ?i WHERE `hp` > `maxhp` AND `id` = ?i',time(),$user['id']);
$wear_raw = mysql_query("SELECT * FROM inventory where owner={$user['id']} AND dressed='1';"); $wear_raw = db::c()->query('SELECT * FROM `inventory` where `owner` = ?i AND `dressed` = 1',$user['id']);
while ($wear_list = mysql_fetch_array($wear_raw)) { while ($wear_list = $wear_raw->fetch_assoc()) {
$wear_arr[] = $wear_list['prototype']; $wear_arr[] = $wear_list['prototype'];
}; };
$item['id'] = $user[$slot1]; $item['id'] = $user[$slot1];
//foreach($wear_arr as $wt) echo($wt."<BR>");
$get_pro_raw = mysql_query("SELECT * FROM inventory where id={$item['id']} limit 1;"); $get_pro = db::c()->query('SELECT * FROM `inventory` where `id` = ?i',$item['id'])->fetch_assoc();
$get_pro = mysql_fetch_array($get_pro_raw);
///////////////////// /////////////////////
$sets_items = mysql_query("SELECT * FROM item_sets"); $sets_items = db::c()->query('SELECT * FROM `item_sets`');
//для каждого комплекта //для каждого комплекта
while ($items_in_set = mysql_fetch_array($sets_items)) { while ($items_in_set = $sets_items->fetch_assoc()) {
$checker = 0; $checker = 0;
$temp_is = explode(",", $items_in_set['prot_id']); $temp_is = explode(",", $items_in_set['prot_id']);
$set_id = $items_in_set['set_id']; $set_id = $items_in_set['set_id'];
@ -2202,39 +2200,37 @@ function dropitem($slot)
// //
if (($checker == 1) && (!in_array($get_pro['prototype'], $wear_arr))) { if (($checker == 1) && (!in_array($get_pro['prototype'], $wear_arr))) {
mysql_query("UPDATE `users` as u, `item_sets` as s SET db::c()->query('UPDATE `users` as `u`, `item_sets` as `s` SET
u.uminu = u.uminu - s.minu, `u`.`uminu` = `u`.`uminu` - `s`.`minu`,
u.umaxu = u.umaxu - s.maxu, `u`.`umaxu` = `u`.`umaxu` - `s`.`maxu`,
u.sila = u.sila - s.gsila, `u`.`sila = `u`.`sila - `s`.`gsila`,
u.lovk = u.lovk - s.glovk, `u`.`lovk = `u`.`lovk - `s`.`glovk`,
u.inta = u.inta - s.ginta, `u`.`inta = `u`.`inta - `s`.`ginta`,
u.intel = u.intel - s.gintel, `u`.`intel = `u`.`intel - `s`.`gintel`,
u.maxhp = u.maxhp - s.ghp, `u`.`maxhp = `u`.`maxhp - `s`.`ghp`,
u.maxmana = u.maxmana - s.gmana, `u`.`maxmana = `u`.`maxmana - `s`.`gmana`,
u.fkrit = u.fkrit - s.mfkrit, `u`.`fkrit = `u`.`fkrit - `s`.`mfkrit`,
u.fakrit = u.fakrit - s.mfakrit, `u`.`fakrit = `u`.`fakrit - `s`.`mfakrit`,
u.fuvorot = u.fuvorot - s.mfuvorot, `u`.`fuvorot = `u`.`fuvorot - `s`.`mfuvorot`,
u.fauvorot = u.fauvorot - s.mfauvorot, `u`.`fauvorot = `u`.`fauvorot - `s`.`mfauvorot`,
u.noj = u.noj - s.gnoj, `u`.`noj = `u`.`noj - `s`.`gnoj`,
u.topor = u.topor - s.gtopor, `u`.`topor = `u`.`topor - `s`.`gtopor`,
u.dubina = u.dubina - s.gdubina, `u`.`dubina = `u`.`dubina - `s`.`gdubina`,
u.mec = u.mec - s.gmech, `u`.`mec = `u`.`mec - `s`.`gmech`,
u.ubron1 = u.ubron1 - s.bron1, `u`.`ubron1 = `u`.`ubron1 - `s`.`bron1`,
u.ubron2 = u.ubron2 - s.bron2, `u`.`ubron2 = `u`.`ubron2 - `s`.`bron2`,
u.ubron3 = u.ubron3 - s.bron3, `u`.`ubron3 = `u`.`ubron3 - `s`.`bron3`,
u.ubron4 = u.ubron4 - s.bron4, `u`.`ubron4 = `u`.`ubron4 - `s`.`bron4`,
u.mfire = u.mfire - s.gfire, `u`.`mfire = `u`.`mfire - `s`.`gfire`,
u.mwater = u.mwater - s.gwater, `u`.`mwater = `u`.`mwater - `s`.`gwater`,
u.mair = u.mair - s.gair, `u`.`mair = `u`.`mair - `s`.`gair`,
u.mearth = u.mearth - s.gearth, `u`.`mearth = `u`.`mearth - `s`.`gearth`,
u.mlight = u.mlight - s.glight, `u`.`mlight = `u`.`mlight - `s`.`glight`,
u.mgray = u.mgray - s.ggray `u`.`mgray = `u`.`mgray - `s`.`ggray`
WHERE WHERE
u.id = {$user['id']} AND `u`.`id` = ?i AND `s`.`set_id`= ?i',$user['id'],$set_id);
s.set_id={$set_id};"); }
//echo ("Сняли ".$set_id); }
};
};
return true; return true;
} }
} }