game/_incl_data/class/noob.quests.php

196 lines
6.0 KiB
PHP
Raw Normal View History

2022-06-06 21:30:34 +00:00
<?
if(!defined('GAME')) { die(); }
class noob {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public static $info = array(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
/*
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
public static function test1($var) {
global $u;
$r = false;
$var = explode('=',$var);
if( $var[0] == 'slot' ) {
//<2F><><EFBFBD><EFBFBD> <20><> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$test = mysql_fetch_array(mysql_query('SELECT `id`,`item_id` FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `inOdet` = "'.mysql_real_escape_string($var[1]).'" AND `delete` = 0 LIMIT 1'));
if(isset($test['id'])) {
if($var[2] == 0 || $var[2] == $test['item_id'] ) {
$r = true;
}
}
}
return $r;
}
/*
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
public static function testAll() {
global $u;
//<2F><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$go = 1;
//<2F><><EFBFBD><EFBFBD>
$ex = explode('>',self::$info['module']);
if( $ex[0] == 'exp' ) {
if( $ex[1] < $u->info['exp'] ) {
self::$info['module'] = '';
}
}
$ex = explode('<',self::$info['module']);
if( $ex[0] == 'exp' ) {
if( $ex[1] < $u->info['exp'] ) {
mysql_query('UPDATE `users` SET `fnq` = "'.self::$info['next'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
self::$info['module'] = '';
}
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$ex = explode('=',self::$info['module']);
if( $ex[0] == 'slots' ) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>
$ex2 = explode(',',$ex[1]);
$i = 0; $gd = 1;
while( $i < count($ex2) ) {
if( !isset($u->stats['wp' . $ex2[$i] . 'id']) ) {
$gd = 0;
}
$i++;
}
if( $gd == 1 ) {
self::$info['module'] = '';
}
}
//
$go = 1;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$e1 = explode('|',self::$info['tr']);
$i = 0;
while( $i < count($e1) ) {
$ex = explode('=',$e1[$i]);
//
if( $ex[0] == 'exp' ) {
if( $ex[1] == '>' ) {
if( $ex[2] > $u->info['exp'] ) {
$go = 0;
}
}elseif( $ex[1] == '<' ) {
if( $ex[2] < $u->info['exp'] ) {
$go = 0;
}
}
}
//
$i++;
}
//
//
return $go;
}
/*
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
public static function start() {
global $u;
if( $u->info['fnq'] == 0 ) {
$u->info['fnq'] = 1;
mysql_query('UPDATE `users` SET `fnq` = "'.$u->info['fnq'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}else{
if( $u->info['level'] > 2 ) {
mysql_query('UPDATE `users` SET `fnq` = "-1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}
}
if( $u->info['fnq'] == 0 ) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/*$humor = array(
0 => array(
':maniac: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> ;)',':beggar: <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD>!',':pal: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!',
':vamp: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!',':susel: <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>
':friday: <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!',':doc: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! <20><>, <20><>! <20><>! <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!'
),
1 => array(
':maniac: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> ;)',':nail: <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ;)',':pal: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!',
':vamp: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!',':rev: <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!',':hug: <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!',
':angel2: <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>...'
)
);
$humor = $humor[$u->info['sex']];
*/
$u->info['fnq'] = 1;
mysql_query('UPDATE `users` SET `fnq` = "'.$u->info['fnq'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//$u->send('','','','','','<27> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> &quot;<b>' . $u->info['login'] . '</b>&quot;! '.$humor[rand(0,count($humor)-1)].'',time(),6,0,0,0,1,0);
}else{
self::$info = mysql_fetch_array(mysql_query('SELECT * FROM `an_quest` WHERE `id` = "'.$u->info['fnq'].'" LIMIT 1'));
if(isset(self::$info['id'])) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
$go = self::testAll();
if( $go == 0 ) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
self::$info = array();
}elseif( $u->info['marker'] == self::$info['module'] || self::$info['module'] == '' || (self::$info['module'] == 'next' && isset($_GET['nextfnq'])) || self::test1(self::$info['module']) == true ) {
//<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!
if( self::$info['room'] == '' || self::$info['room'] == $u->room['name'] ) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$nag = explode('|',self::$info['win']);
if( $nag[3] != '0' ) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$ng = explode(',',$nag[3]);
$i = 0;
while( $i < count($ng) ) {
$ngi = explode(',',$ng[$i]);
$j = 0;
while( $j < count($ngi) ) {
$ngj = explode('=',$ngi[$j]);
// id = srok = data
$ngjs = '';
if( $ngj[1] > 0 ) {
$ngjs .= '|srok='.$ngj[1].'';
}
$u->addItem($ngj[0], $u->info['id'], $ngjs);
$j++;
}
$i++;
}
}
if( $nag[4] != '0' ) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
$u->info['money4'] += $nag[4];
mysql_query('UPDATE `users` SET `money4` = "'.$u->info['money4'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}
$u->info['fnq'] = self::$info['next'];
mysql_query('UPDATE `users` SET `fnq` = "'.$u->info['fnq'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
self::$info = mysql_fetch_array(mysql_query('SELECT * FROM `an_quest` WHERE `id` = "'.$u->info['fnq'].'" LIMIT 1'));
$go = self::testAll();
if( $go == 0 || self::$info['act'] == 'deadline' ) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
self::$info = array();
}
}
}else{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
}
if(isset(self::$info['id'])) {
self::$info['info'] = str_replace('{login}',$u->info['login'],self::$info['info']);
self::$info['info'] = str_replace('{level}',$u->info['level'],self::$info['info']);
self::$info['info'] = str_replace("\r\n",'<br>',self::$info['info']);
echo '<script>top.noob.takeData("'.self::$info['id'].'","'.self::$info['ico_bot'].'","'.self::$info['name_bot'].'","'.self::$info['name'].'","'.self::$info['act'].'","'.self::$info['next'].'","'.str_replace('"','&quot;',self::$info['info']).'");</script>';
}else{
echo '<script>top.noob.no();</script>';
}
}else{
//<2F><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
echo '<script>top.noob.no();</script>';
}
//
}
}
}
?>