63 lines
2.0 KiB
PHP
63 lines
2.0 KiB
PHP
|
<?php
|
|||
|
|
|||
|
namespace User;
|
|||
|
|
|||
|
use Core\Db;
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> User\Stats.
|
|||
|
*/
|
|||
|
class WearedScrolls
|
|||
|
{
|
|||
|
|
|||
|
public static function ScrollsChange(array &$u): void
|
|||
|
{
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if ($u['autospell'] == 0 || $u['battle'] != 0) {
|
|||
|
return;
|
|||
|
}
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
$sparr = [];
|
|||
|
foreach (Db::getRows('select item_id, inOdet from items_users where inOdet between 40 and 50 and uid = ? order by item_id desc', [$u['id']]) as $scroll) {
|
|||
|
$sparr[] = "{$scroll['item_id']} - {$scroll['inOdet']}";
|
|||
|
}
|
|||
|
$splink = implode(',', $sparr);
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if ($u['autospell'] == 1) {
|
|||
|
$u['autospell'] = $splink;
|
|||
|
Db::sql('update users set autospell = ? where id = ?', [$splink, $u['id']]);
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if ($u['autospell'] != $splink) {
|
|||
|
$spe1 = explode(',', $splink);
|
|||
|
$spe2 = explode(',', $u['autospell']);
|
|||
|
$spe1g = [];
|
|||
|
$spe2g = [];
|
|||
|
|
|||
|
for ($i = 0; $i <= 20; $i++) {
|
|||
|
$spe1a = explode('-', $spe1[$i]);
|
|||
|
$spe2a = explode('-', $spe2[$i]);
|
|||
|
|
|||
|
if (isset($spe1a[0])) {
|
|||
|
$spe1g[$spe1a[1]] = $spe1a[0];
|
|||
|
}
|
|||
|
if (isset($spe2a[0])) {
|
|||
|
$spe2g[$spe2a[1]] = $spe2a[0];
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
for ($i = 40; $i <= 50; $i++) {
|
|||
|
if ($spe1g[$i] == $spe2g[$i] || $spe1g[$i] != 0) {
|
|||
|
continue;
|
|||
|
}
|
|||
|
Db::sql('update items_users set inOdet = ? where inOdet = 0 and `delete` = 0 and inTransfer = 0 and inShop = 0 and inGroup = 0 and item_id = ? and uid = ?',
|
|||
|
[$i, $spe2g[$i], $u['id']]);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|