75 lines
4.2 KiB
PHP
75 lines
4.2 KiB
PHP
|
<?
|
|||
|
if (!defined('GAME')) {
|
|||
|
die();
|
|||
|
}
|
|||
|
|
|||
|
$action = $_POST['cometome'];
|
|||
|
$toUser = mysql_real_escape_string($_POST['logingo']);
|
|||
|
if (!isset($u->info['room']) OR !isset($u->info['id']) OR $toUser == '') {
|
|||
|
if($toUser == '') {
|
|||
|
$uer = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "' . $toUser . '" <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
|
|||
|
} else $uer = '<27><><EFBFBD><EFBFBD><EFBFBD> "' . $action . '" <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
|
|||
|
} else {
|
|||
|
if ($u->info['admin'] > 0) {
|
|||
|
$uu = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `login` = "'.$toUser.'" LIMIT 1'));
|
|||
|
$uus = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "'.$uu['id'].'" LIMIT 1'));
|
|||
|
if (isset($uu['id'])) {
|
|||
|
if ($uu['id'] == $u->info['id']) {
|
|||
|
$uer = '<27><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>, <20> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! ';
|
|||
|
} elseif ($uu['admin'] > 0 && $u->info['admin'] == 0) {
|
|||
|
$uer = '<27><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>.';
|
|||
|
} elseif (floor($uu['align']) == $a && $uu['align'] > $u->info['align'] && $u->info['admin'] == 0) {
|
|||
|
$uer = '<27><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
} elseif ($u->info['battle'] == 0 && $action == 'to-fight') {
|
|||
|
$uer = '<27><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
|
|||
|
} elseif ($u->info['dnow'] == 0 && $action == 'to-dungeon') {
|
|||
|
$uer = '<27><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
|
|||
|
} elseif ($uu['city'] != $u->info['city'] && $u->info['admin'] == 0) {
|
|||
|
$uer = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
} else {
|
|||
|
/* <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>\<5C><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. */
|
|||
|
if($action =='to-room' && $uus['dnow']){
|
|||
|
mysql_query('UPDATE `stats` SET `dnow` = "0" WHERE `id` = "' . $uu['id'] . '" LIMIT 1');
|
|||
|
}
|
|||
|
if($action =='to-room' && $uu['battle']){
|
|||
|
mysql_query('UPDATE `users` SET `battle` = "0" WHERE `id` = "' . $uu['id'] .'" LIMIT 1');
|
|||
|
}
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|||
|
if ($action == 'to-room') {
|
|||
|
$upd = mysql_query('UPDATE `users` SET `city` = "'.$u->info['city'].'", `room` = "'.$u->info['room'].'" WHERE `id` = "'.$uu['id'].'" LIMIT 1');
|
|||
|
} elseif ($action == 'to-fight') {
|
|||
|
$upd = mysql_query('UPDATE `users` SET `city` = "' . $u->info['city'] . '",`room` = "' . $u->info['room'] . '",`battle` = "' . $u->info['battle'] . '" WHERE `id` = "' . $uu['id'] .'" LIMIT 1');
|
|||
|
$upd_d = mysql_query('UPDATE `stats` SET `team` = "' . $u->info['team'] . '" WHERE `id` = "' . $uu['id'] . '" LIMIT 1');
|
|||
|
if ($u->info['dnow'] > 0) {
|
|||
|
$upd_d = mysql_query('UPDATE `stats` SET `x` = "' . $u->info['x'] . '",`y` = "' . $u->info['y'] . '",`s` = "' . $u->info['s'] . '",`dnow` = "' . $u->info['dnow'] . '" WHERE `id` = "' . $uu['id'] . '" LIMIT 1');
|
|||
|
}
|
|||
|
} elseif ($action == 'to-dungeon') {
|
|||
|
$upd = mysql_query('UPDATE `users` SET `city` = "' . $u->info['city'] . '",`room` = "' . $u->info['room'] . '" WHERE `id` = "' . $uu['id'] . '" LIMIT 1');
|
|||
|
$upd_d = mysql_query('UPDATE `stats` SET `x` = "' . $u->info['x'] . '",`y` = "' . $u->info['y'] . '",`s` = "' . $u->info['s'] . '",`dnow` = "' . $u->info['dnow'] . '" WHERE `id` = "' . $uu['id'] . '" LIMIT 1');
|
|||
|
} else {
|
|||
|
$uer = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
|
|||
|
$upd = false;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
if ($upd) {
|
|||
|
if ($upd_d) $dngo = true;
|
|||
|
if ($u->info['sex'] == 1) $sx = '<27>'; else $sx = '';
|
|||
|
$rtxt = '[img[items/teleport-cometome.gif]] ' . $rang . ' "' . $u->info['cast_login'] . '" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' . $sx . ' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "' . $uu['login'] . '" <20> <20><><EFBFBD><EFBFBD> <20> ' . ($action == 'to-fight' ? "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" . ($dngo == true ? " <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>." : "") : ($action == 'to-dungeon' ? "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" : "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")) . '.';
|
|||
|
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1')");
|
|||
|
|
|||
|
$uer = '<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "' . $uu['login'] . '" <20> <b>' . ($action == 'to-fight' ? "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" : ($action == 'to-dungeon' ? "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" : "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")) . '</b>.';
|
|||
|
} else {
|
|||
|
$uer = '<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
}
|
|||
|
}
|
|||
|
} else {
|
|||
|
$uer = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
}
|
|||
|
} else {
|
|||
|
$uer = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
?>
|