function zone_goto($goto_id, $cost_goto) { global $board_config, $adr_user, $db, $adr_user, $phpEx, $user_id, $lang; if ($board_config['zone_dead_travel'] == '1' && $adr_user['character_hp'] < '1') { adr_previous(Adr_zone_change_dead, adr_zones, ''); } //Prevent blank destination error if ($goto_id . '' == $lang['Adr_zone_destination_none']) { adr_previous(Adr_zone_change_unavaible, adr_zones, ''); } //Select the zone destination $zone_id = zone_get($goto_id); if (!$zone_id) { adr_previous('Adr_zone_change_unavaible', 'adr_zones'); } $destination_id = $zone_id['zone_id']; $required_item = $zone_id['zone_item']; $required_level = $zone_id['zone_level']; if ($adr_user['character_level'] < $required_level) { adr_previous(adr_zone_change_level, adr_zones, ''); } // Check if user has the required item $sql = " SELECT * FROM " . ADR_SHOPS_ITEMS_TABLE . "\n \t\tWHERE item_name = '{$required_item}'\n \t\tAND item_owner_id = '{$user_id}'\n \t\tAND item_in_shop = '0'\n \t\tAND item_in_warehouse = '0' "; $result = $db->sql_query($sql); if (!$result) { message_die(GENERAL_ERROR, 'Could not obtain required item information', "", __LINE__, __FILE__, $sql); } $item_check = $db->sql_fetchrow($result); if ($required_item == '0' || $required_item == $item_check['item_name']) { adr_substract_points($user_id, $cost_goto, adr_zones, ''); //Update character zone $sql = " UPDATE " . ADR_CHARACTERS_TABLE . " \n\t\t\tSET character_area = '{$destination_id}'\n\t\t\tWHERE character_id = '{$user_id}' "; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Could not update character zone', '', __LINE__, __FILE__, $sql); } @header('Location:' . append_sid("adr_zones.{$phpEx}")); adr_previous(Adr_zone_change_success, adr_zones, ''); break; } else { $message = $lang['Adr_zone_item_lack'] . ' : ' . $required_item . '<br /><br />' . $lang['Adr_zone_event_return'] . '<br /><br />'; message_die(GENERAL_ERROR, $message, Zones, ''); break; } }
header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true)); } // Includes the tpl and the header adr_template_file('adr_zones_body.tpl'); include_once $phpbb_root_path . 'includes/page_header.' . $phpEx; // Get the general config and character infos $adr_general = adr_get_general_config(); adr_enable_check(); adr_ban_check($user_id); adr_character_created_check($user_id); $adr_user = adr_get_user_infos($user_id); // don't let people tell you what to do! $template->assign_var('OUT_OF_ZONES', false); // Get Zone infos $area_id = $adr_user['character_area']; $zone = zone_get($area_id); // V: let's make sure nothing bad happened for some reason // i.e. somebody deleted the zone. // of course, it's still gonna fail its race's start zone got ERASED if (!$zone) { $sql = "SELECT race_zone_begin FROM " . ADR_RACES_TABLE . "\r\n\t\tWHERE race_id = " . $adr_user['character_race']; $result = $db->sql_query($sql); if (!($race = $db->sql_fetchrow($result))) { message_die(GENERAL_MESSAGE, 'Could not query race data'); } $sql = "UPDATE " . ADR_CHARACTERS_TABLE . "\r\n\t\tSET character_area = " . $race['race_zone_begin']; $db->sql_query($sql); adr_previous('ADR_MOVED_BACK_TO_SAFE_ZONE', 'adr_zones'); } $zone_name = $zone['zone_name']; $zone_img = $zone['zone_img'];
// Get points name $adr_user = adr_get_user_infos($user_id); //Grab character details // Sorry , only logged users ... if (!$userdata['session_logged_in']) { $redirect = "adr_clans.{$phpEx}"; $redirect .= isset($user_id) ? '&user_id=' . $user_id : ''; header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true)); } // Get the general settings $adr_general = adr_get_general_config(); adr_enable_check(); adr_ban_check($user_id); adr_character_created_check($user_id); $actual_zone = $adr_user['character_area']; $info = zone_get($actual_zone); //V: let's say you always have access to the clans page, wherever you are //$access = $info['zone_clans']; //if ( $access == '0' ) // adr_previous( Adr_zone_building_noaccess , adr_zones , '' ); // Clan list if (!isset($_GET['action']) || $_GET['action'] == "list") { $this_title = $lang['clans_title_clanslist']; // Get clans user belongs to! $sql = "SELECT * FROM " . ADR_CLANS_TABLE . "\r\n\t\t\tWHERE leader = '" . $user_id . "' OR members LIKE '%ß" . $user_id . "Þ%' OR approvelist LIKE '%ß" . $user_id . "Þ%'\r\n\t\t\tORDER BY name,id"; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Error retrieving data', '', __LINE__, __FILE__, $sql); } if ($db->sql_numrows($result) < 1) { $template->assign_block_vars('no_userclans', array('L_NONE' => $lang['clans_none'])); }
$redirect .= isset($user_id) ? '&user_id=' . $user_id : ''; header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true)); } // Includes the tpl and the header adr_template_file('adr_shops_body.tpl'); include $phpbb_root_path . 'includes/page_header.' . $phpEx; // Get the general config $adr_general = adr_get_general_config(); adr_enable_check(); adr_ban_check($user_id); adr_character_created_check($user_id); // //BEGIN zone Shops Restriction // $zone_user = adr_get_user_infos($user_id); $info = zone_get($zone_user['character_area']); $actual_zone = $zone_user['character_area']; $access = $info['zone_shops']; if ($access == '0') { adr_previous(Adr_zone_building_noaccess, adr_zones, ''); } // //END zone Shops Restriction // // Deny access if the user is into a battle or is imprisoned adr_battle_cell_check($user_id, $userdata); $points_name = get_reward_name() ? get_reward_name() : $lang['Adr_default_points_name']; $quantity = isset($HTTP_POST_VARS['quantity']) ? intval($HTTP_POST_VARS['quantity']) : 1; $start = isset($HTTP_GET_VARS['start']) ? intval($HTTP_GET_VARS['start']) : 0; $item_id = isset($HTTP_GET_VARS['item_id']) ? intval($HTTP_GET_VARS['item_id']) : 0; $shop_owner_id = isset($HTTP_GET_VARS['shop_owner_id']) ? intval($HTTP_GET_VARS['shop_owner_id']) : 0;