Ремонт знахаря. Знахарь отныне всегда бесплатный.

This commit is contained in:
2023-06-19 17:40:15 +03:00
parent 5e06f5e136
commit 7270ec2004
4 changed files with 449 additions and 563 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ class Config
$c['expstopu'] = 2999999; //Опыт на котором останавливаемся
$c['noobgade'] = false; //нуб квест (пещера)
$c['level_ransfer'] = 8; //С какого уровня разрешены передачи
$c['znahar'] = true; //бесплатный знахарь
$c['nolevel'] = false; //лимитирование уровней
$c['noitembuy'] = false; //Не требует ресурсы для покупки
$c['effz'] = 0; //Скольким секундам равен заряд
+16 -2
View File
@@ -22,6 +22,20 @@ class Effects
'insert into eff_users (overType, id_eff, uid, name, timeUse, data) values (?,?,?,?,unix_timestamp(),?)',
[$eff['oneType'], $eff['id2'], $uid, $eff['mname'], $eff['mdata']]
);
}
}
public static function hasInjury(int $uid): bool
{
return Db::getValue('select count(*) from eff_users where id_eff in (4,5) and `delete` = 0 and uid = ?', [$uid]) > 0;
}
public static function hasAddiction(int $addictionId, int $uid): bool // пристрастие
{
return Db::getValue('select count(*) from eff_users where (id_eff between 301 and 304 or id_eff between 321 and 332) and id = ? and uid = ?', [$addictionId, $uid]) > 0;
}
public static function removeById(int $id): void
{
Db::sql('update eff_users set delete = unix_timestamp() where id = ?', [$id]);
}
}