Fix
This commit is contained in:
parent
5e6fe346e6
commit
88d8957cb9
132
functions.php
132
functions.php
@ -2134,51 +2134,49 @@ function dropitem($slot)
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (mysql_query("UPDATE `users` as u, `inventory` as i SET u.{$slot1} = 0, i.dressed = 0,
|
||||
u.sila = u.sila - i.gsila,
|
||||
u.lovk = u.lovk - i.glovk,
|
||||
u.inta = u.inta - i.ginta,
|
||||
u.intel = u.intel - i.gintel,
|
||||
u.maxhp = u.maxhp - i.ghp,
|
||||
u.noj = u.noj - i.gnoj,
|
||||
u.topor = u.topor - i.gtopor,
|
||||
u.dubina = u.dubina - i.gdubina,
|
||||
u.mec = u.mec - i.gmech,
|
||||
u.mfire = u.mfire - i.gfire,
|
||||
u.mwater = u.mwater - i.gwater,
|
||||
u.mair = u.mair - i.gair,
|
||||
u.mearth = u.mearth - i.gearth,
|
||||
u.mlight = u.mlight - i.glight,
|
||||
u.mgray = u.mgray - i.ggray,
|
||||
u.mdark = u.mdark - i.gdark,
|
||||
u.ubron1 = u.ubron1 - i.bron1,
|
||||
u.ubron2 = u.ubron2 - i.bron2,
|
||||
u.ubron3 = u.ubron3 - i.bron3,
|
||||
u.ubron4 = u.ubron4 - i.bron4,
|
||||
u.fkrit = u.fkrit - i.mfkrit,
|
||||
u.fakrit = u.fakrit - i.mfakrit,
|
||||
u.fuvorot = u.fuvorot - i.mfuvorot,
|
||||
u.fauvorot = u.fauvorot - i.mfauvorot,
|
||||
u.uminu = u.uminu - i.minu,
|
||||
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']};"))
|
||||
mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = " . time() . " WHERE `hp` > `maxhp` AND `id` = '{$user['id']}' LIMIT 1;");
|
||||
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`.`lovk` = `u`.`lovk` - `i`.`glovk`,
|
||||
`u`.`inta` = `u`.`inta` - `i`.`ginta`,
|
||||
`u`.`intel` = `u`.`intel` - `i`.`gintel`,
|
||||
`u`.`maxhp` = `u`.`maxhp` - `i`.`ghp`,
|
||||
`u`.`noj` = `u`.`noj` - `i`.`gnoj`,
|
||||
`u`.`topor` = `u`.`topor` - `i`.`gtopor`,
|
||||
`u`.`dubina` = `u`.`dubina` - `i`.`gdubina`,
|
||||
`u`.`mec` = `u`.`mec` - `i`.`gmech`,
|
||||
`u`.`mfire` = `u`.`mfire` - `i`.`gfire`,
|
||||
`u`.`mwater` = `u`.`mwater` - `i`.`gwater`,
|
||||
`u`.`mair` = `u`.`mair` - `i`.`gair`,
|
||||
`u`.`mearth` = `u`.`mearth` - `i`.`gearth`,
|
||||
`u`.`mlight` = `u`.`mlight` - `i`.`glight`,
|
||||
`u`.`mgray` = `u`.`mgray` - `i`.`ggray`,
|
||||
`u`.`mdark` = `u`.`mdark` - `i`.`gdark`,
|
||||
`u`.`ubron1` = `u`.`ubron1` - `i`.`bron1`,
|
||||
`u`.`ubron2` = `u`.`ubron2` - `i`.`bron2`,
|
||||
`u`.`ubron3` = `u`.`ubron3` - `i`.`bron3`,
|
||||
`u`.`ubron4` = `u`.`ubron4` - `i`.`bron4`,
|
||||
`u`.`fkrit` = `u`.`fkrit` - `i`.`mfkrit`,
|
||||
`u`.`fakrit` = `u`.`fakrit` - `i`.`mfakrit`,
|
||||
`u`.`fuvorot` = `u`.`fuvorot` - `i`.`mfuvorot`,
|
||||
`u`.`fauvorot` = `u`.`fauvorot` - `i`.`mfauvorot`,
|
||||
`u`.`uminu` = `u`.`uminu` - `i`.`minu`,
|
||||
`u`.`umaxu` = `u`.`umaxu` - `i`.`maxu`
|
||||
WHERE `i`.`id` = `u`.?f AND `i`.`dressed` = 1 AND `i`.`owner` = ?i AND u.id = ?i',$slot1,$slot1,$user['id'],$user['id']))
|
||||
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';");
|
||||
while ($wear_list = mysql_fetch_array($wear_raw)) {
|
||||
$wear_raw = db::c()->query('SELECT * FROM `inventory` where `owner` = ?i AND `dressed` = 1',$user['id']);
|
||||
while ($wear_list = $wear_raw->fetch_assoc()) {
|
||||
$wear_arr[] = $wear_list['prototype'];
|
||||
};
|
||||
|
||||
$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 = mysql_fetch_array($get_pro_raw);
|
||||
$get_pro = db::c()->query('SELECT * FROM `inventory` where `id` = ?i',$item['id'])->fetch_assoc();
|
||||
/////////////////////
|
||||
$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;
|
||||
$temp_is = explode(",", $items_in_set['prot_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))) {
|
||||
mysql_query("UPDATE `users` as u, `item_sets` as s SET
|
||||
u.uminu = u.uminu - s.minu,
|
||||
u.umaxu = u.umaxu - s.maxu,
|
||||
u.sila = u.sila - s.gsila,
|
||||
u.lovk = u.lovk - s.glovk,
|
||||
u.inta = u.inta - s.ginta,
|
||||
u.intel = u.intel - s.gintel,
|
||||
u.maxhp = u.maxhp - s.ghp,
|
||||
u.maxmana = u.maxmana - s.gmana,
|
||||
u.fkrit = u.fkrit - s.mfkrit,
|
||||
u.fakrit = u.fakrit - s.mfakrit,
|
||||
u.fuvorot = u.fuvorot - s.mfuvorot,
|
||||
u.fauvorot = u.fauvorot - s.mfauvorot,
|
||||
u.noj = u.noj - s.gnoj,
|
||||
u.topor = u.topor - s.gtopor,
|
||||
u.dubina = u.dubina - s.gdubina,
|
||||
u.mec = u.mec - s.gmech,
|
||||
u.ubron1 = u.ubron1 - s.bron1,
|
||||
u.ubron2 = u.ubron2 - s.bron2,
|
||||
u.ubron3 = u.ubron3 - s.bron3,
|
||||
u.ubron4 = u.ubron4 - s.bron4,
|
||||
u.mfire = u.mfire - s.gfire,
|
||||
u.mwater = u.mwater - s.gwater,
|
||||
u.mair = u.mair - s.gair,
|
||||
u.mearth = u.mearth - s.gearth,
|
||||
u.mlight = u.mlight - s.glight,
|
||||
u.mgray = u.mgray - s.ggray
|
||||
db::c()->query('UPDATE `users` as `u`, `item_sets` as `s` SET
|
||||
`u`.`uminu` = `u`.`uminu` - `s`.`minu`,
|
||||
`u`.`umaxu` = `u`.`umaxu` - `s`.`maxu`,
|
||||
`u`.`sila = `u`.`sila - `s`.`gsila`,
|
||||
`u`.`lovk = `u`.`lovk - `s`.`glovk`,
|
||||
`u`.`inta = `u`.`inta - `s`.`ginta`,
|
||||
`u`.`intel = `u`.`intel - `s`.`gintel`,
|
||||
`u`.`maxhp = `u`.`maxhp - `s`.`ghp`,
|
||||
`u`.`maxmana = `u`.`maxmana - `s`.`gmana`,
|
||||
`u`.`fkrit = `u`.`fkrit - `s`.`mfkrit`,
|
||||
`u`.`fakrit = `u`.`fakrit - `s`.`mfakrit`,
|
||||
`u`.`fuvorot = `u`.`fuvorot - `s`.`mfuvorot`,
|
||||
`u`.`fauvorot = `u`.`fauvorot - `s`.`mfauvorot`,
|
||||
`u`.`noj = `u`.`noj - `s`.`gnoj`,
|
||||
`u`.`topor = `u`.`topor - `s`.`gtopor`,
|
||||
`u`.`dubina = `u`.`dubina - `s`.`gdubina`,
|
||||
`u`.`mec = `u`.`mec - `s`.`gmech`,
|
||||
`u`.`ubron1 = `u`.`ubron1 - `s`.`bron1`,
|
||||
`u`.`ubron2 = `u`.`ubron2 - `s`.`bron2`,
|
||||
`u`.`ubron3 = `u`.`ubron3 - `s`.`bron3`,
|
||||
`u`.`ubron4 = `u`.`ubron4 - `s`.`bron4`,
|
||||
`u`.`mfire = `u`.`mfire - `s`.`gfire`,
|
||||
`u`.`mwater = `u`.`mwater - `s`.`gwater`,
|
||||
`u`.`mair = `u`.`mair - `s`.`gair`,
|
||||
`u`.`mearth = `u`.`mearth - `s`.`gearth`,
|
||||
`u`.`mlight = `u`.`mlight - `s`.`glight`,
|
||||
`u`.`mgray = `u`.`mgray - `s`.`ggray`
|
||||
WHERE
|
||||
u.id = {$user['id']} AND
|
||||
s.set_id={$set_id};");
|
||||
//echo ("Сняли ".$set_id);
|
||||
};
|
||||
};
|
||||
`u`.`id` = ?i AND `s`.`set_id`= ?i',$user['id'],$set_id);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user