* it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define('IN_PHPBB', true); if (!empty($setmodules)) { $file = basename(__FILE__); $module['Rabbitoshi']['Rabbitoshi_Level_Up'] = $file; return; } $phpbb_root_path = './../'; require $phpbb_root_path . 'extension.inc'; require "./pagestart.{$phpEx}"; include $phpbb_root_path . 'rabbitoshi/includes/functions_rabbitoshi.' . $phpEx; rabbitoshi_template_file('admin/config_rabbitoshi_levelup_body.tpl'); $submit = isset($HTTP_POST_VARS['submit']); $sql = "SELECT *\r\nFROM " . RABBITOSHI_GENERAL_TABLE; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, "Could not query config information in admin_board", "", __LINE__, __FILE__, $sql); } while ($row = $db->sql_fetchrow($result)) { $rabitoshi[$row['config_name']] = $row['config_value']; } $template->assign_vars(array('HEALTH_LEVELUP' => $rabitoshi['health_levelup'], 'HUNGER_LEVELUP' => $rabitoshi['hunger_levelup'], 'THIRST_LEVELUP' => $rabitoshi['thirst_levelup'], 'HYGIENE_LEVELUP' => $rabitoshi['hygiene_levelup'], 'POWER_LEVELUP' => $rabitoshi['power_levelup'], 'MAGICPOWER_LEVELUP' => $rabitoshi['magicpower_levelup'], 'ARMOR_LEVELUP' => $rabitoshi['armor_levelup'], 'MP_LEVELUP' => $rabitoshi['mp_levelup'], 'ATTACK_LEVELUP' => $rabitoshi['attack_levelup'], 'MAGICATTACK_LEVELUP' => $rabitoshi['magicattack_levelup'])); if ($submit) { $health_levelup = $HTTP_POST_VARS['health_levelup']; $hunger_levelup = $HTTP_POST_VARS['hunger_levelup']; $thirst_levelup = $HTTP_POST_VARS['thirst_levelup']; $hygiene_levelup = $HTTP_POST_VARS['hygiene_levelup']; $power_levelup = $HTTP_POST_VARS['power_levelup'];
* it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define('IN_PHPBB', true); if (!empty($setmodules)) { $file = basename(__FILE__); $module['Rabbitoshi']['Rabbitoshi_Abilities'] = $file; return; } $phpbb_root_path = './../'; require $phpbb_root_path . 'extension.inc'; require "./pagestart.{$phpEx}"; include $phpbb_root_path . 'rabbitoshi/includes/functions_rabbitoshi.' . $phpEx; rabbitoshi_template_file('admin/config_rabbitoshi_abilities_body.tpl'); $submit = isset($HTTP_POST_VARS['submit']); $sql = "SELECT *\r\nFROM " . RABBITOSHI_GENERAL_TABLE; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, "Could not query config information in admin_board", "", __LINE__, __FILE__, $sql); } while ($row = $db->sql_fetchrow($result)) { $rabitoshi[$row['config_name']] = $row['config_value']; } $template->assign_vars(array('REGENERATION_LEVEL' => $rabitoshi['regeneration_level'], 'REGENERATION_MAGICPOWER' => $rabitoshi['regeneration_magicpower'], 'REGENERATION_MP' => $rabitoshi['regeneration_mp'], 'REGENERATION_MP_NEED' => $rabitoshi['regeneration_mp_need'], 'REGENERATION_HP_GIVE' => $rabitoshi['regeneration_hp_give'], 'REGENERATION_PRICE' => $rabitoshi['regeneration_price'], 'HEALTH_LEVEL' => $rabitoshi['health_transfert_level'], 'HEALTH_MAGICPOWER' => $rabitoshi['health_transfert_magicpower'], 'HEALTH_HEALTH' => $rabitoshi['health_transfert_health'], 'HEALTH_PERCENT' => $rabitoshi['health_transfert_percent'], 'HEALTH_PRICE' => $rabitoshi['health_transfert_price'], 'MANA_LEVEL' => $rabitoshi['mana_transfert_level'], 'MANA_MAGICPOWER' => $rabitoshi['mana_transfert_magicpower'], 'MANA_MP' => $rabitoshi['mana_transfert_mp'], 'MANA_PERCENT' => $rabitoshi['mana_transfert_percent'], 'MANA_PRICE' => $rabitoshi['mana_transfert_price'], 'SACRIFICE_LEVEL' => $rabitoshi['sacrifice_level'], 'SACRIFICE_POWER' => $rabitoshi['sacrifice_power'], 'SACRIFICE_ARMOR' => $rabitoshi['sacrifice_armor'], 'SACRIFICE_MP' => $rabitoshi['sacrifice_mp'], 'SACRIFICE_PRICE' => $rabitoshi['sacrifice_price'])); if ($submit) { $regeneration_level = $HTTP_POST_VARS['regeneration_level']; $regeneration_magicpower = $HTTP_POST_VARS['regeneration_magicpower']; $regeneration_mp = $HTTP_POST_VARS['regeneration_mp']; $regeneration_mp_need = $HTTP_POST_VARS['regeneration_mp_need']; $regeneration_hp_give = $HTTP_POST_VARS['regeneration_hp_give'];
* it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define('IN_PHPBB', true); if (!empty($setmodules)) { $file = basename(__FILE__); $module['Rabbitoshi']['Rabbitoshi_settings'] = $file; return; } $phpbb_root_path = './../'; require $phpbb_root_path . 'extension.inc'; require "./pagestart.{$phpEx}"; include $phpbb_root_path . 'rabbitoshi/includes/functions_rabbitoshi.' . $phpEx; rabbitoshi_template_file('admin/config_rabbitoshi_general_body.tpl'); $submit = isset($HTTP_POST_VARS['submit']); $sql = "SELECT *\r\nFROM " . RABBITOSHI_GENERAL_TABLE; if (!($result = $db->sql_query($sql))) { message_die(CRITICAL_ERROR, "Could not query config information in admin_board", "", __LINE__, __FILE__, $sql); } while ($row = $db->sql_fetchrow($result)) { $rabitoshi[$row['config_name']] = $row['config_value']; } $template->assign_vars(array('RABBITOSHI_NAME' => $board_config['rabbitoshi_name'], 'RABBITOSHI_USE_CHECKED' => $board_config['rabbitoshi_enable'] ? 'CHECKED' : '', 'RABBITOSHI_USE_CRON_CHECKED' => $board_config['rabbitoshi_enable_cron'] ? 'CHECKED' : '', 'RABBITOSHI_CRON_TIME' => $board_config['rabbitoshi_cron_time'], 'RABBITOSHI_CRON_TIME_EXPLAIN' => rabbitoshi_make_time($board_config['rabbitoshi_cron_time']), 'RABBITOSHI_THIRST_TIME' => $rabitoshi['thirst_time'], 'RABBITOSHI_THIRST_TIME_EXPLAIN' => rabbitoshi_make_time($rabitoshi['thirst_time']), 'RABBITOSHI_THIRST_VALUE' => $rabitoshi['thirst_value'], 'RABBITOSHI_HUNGER_TIME' => $rabitoshi['hunger_time'], 'RABBITOSHI_HUNGER_TIME_EXPLAIN' => rabbitoshi_make_time($rabitoshi['hunger_time']), 'RABBITOSHI_HUNGER_VALUE' => $rabitoshi['hunger_value'], 'RABBITOSHI_HEALTH_TIME' => $rabitoshi['health_time'], 'RABBITOSHI_HEALTH_TIME_EXPLAIN' => rabbitoshi_make_time($rabitoshi['health_time']), 'RABBITOSHI_HEALTH_VALUE' => $rabitoshi['health_value'], 'RABBITOSHI_HYGIENE_TIME' => $rabitoshi['hygiene_time'], 'RABBITOSHI_HYGIENE_TIME_EXPLAIN' => rabbitoshi_make_time($rabitoshi['hygiene_time']), 'RABBITOSHI_HYGIENE_VALUE' => $rabitoshi['hygiene_value'], 'RABBITOSHI_REBIRTH_CHECKED' => $rabitoshi['rebirth_enable'] ? 'CHECKED' : '', 'RABBITOSHI_REBIRTH_PRICE' => $rabitoshi['rebirth_price'], 'RABBITOSHI_VET_CHECKED' => $rabitoshi['vet_enable'] ? 'CHECKED' : '', 'RABBITOSHI_VET_PRICE' => $rabitoshi['vet_price'], 'RABBITOSHI_HOTEL_CHECKED' => $rabitoshi['hotel_enable'] ? 'CHECKED' : '', 'RABBITOSHI_HOTEL_PRICE' => $rabitoshi['hotel_cost'], 'RABBITOSHI_HOTEL_EXP' => $rabitoshi['exp_lose'], 'RABBITOSHI_HEALTH_PRICE' => $rabitoshi['health_price'], 'RABBITOSHI_HUNGER_PRICE' => $rabitoshi['hunger_price'], 'RABBITOSHI_THIRST_PRICE' => $rabitoshi['thirst_price'], 'RABBITOSHI_HYGIENE_PRICE' => $rabitoshi['hygiene_price'], 'RABBITOSHI_LEVEL_PRICE' => $rabitoshi['level_price'], 'RABBITOSHI_POWER_PRICE' => $rabitoshi['power_price'], 'RABBITOSHI_MAGICPOWER_PRICE' => $rabitoshi['magicpower_price'], 'RABBITOSHI_ARMOR_PRICE' => $rabitoshi['armor_price'], 'RABBITOSHI_ATTACK_PRICE' => $rabitoshi['attack_price'], 'RABBITOSHI_MAGICATTACK_PRICE' => $rabitoshi['magicattack_price'], 'RABBITOSHI_MP_PRICE' => $rabitoshi['mp_price'], 'RABBITOSHI_HEALTH_RAISE' => $rabitoshi['health_raise'], 'RABBITOSHI_HUNGER_RAISE' => $rabitoshi['hunger_raise'], 'RABBITOSHI_THIRST_RAISE' => $rabitoshi['thirst_raise'], 'RABBITOSHI_HYGIENE_RAISE' => $rabitoshi['hygiene_raise'], 'RABBITOSHI_POWER_RAISE' => $rabitoshi['power_raise'], 'RABBITOSHI_MAGICPOWER_RAISE' => $rabitoshi['magicpower_raise'], 'RABBITOSHI_ARMOR_RAISE' => $rabitoshi['armor_raise'], 'RABBITOSHI_ATTACK_RAISE' => $rabitoshi['attack_raise'], 'RABBITOSHI_MAGICATTACK_RAISE' => $rabitoshi['magicattack_raise'], 'RABBITOSHI_ATTACK_RELOAD_PRICE' => $rabitoshi['attack_reload'], 'RABBITOSHI_MAGIC_RELOAD_PRICE' => $rabitoshi['magic_reload'], 'RABBITOSHI_MP_RAISE' => $rabitoshi['mp_raise'], 'RABBITOSHI_EXPERIENCE_MIN' => $rabitoshi['experience_min'], 'RABBITOSHI_EXPERIENCE_MAX' => $rabitoshi['experience_max'], 'RABBITOSHI_MP_MIN' => $rabitoshi['mp_min'], 'RABBITOSHI_MP_MAX' => $rabitoshi['mp_max'], 'RABBITOSHI_EVOLUTION_CHECKED' => $rabitoshi['evolution_enable'] ? 'CHECKED' : '', 'RABBITOSHI_EVOLUTION_PRICE' => $rabitoshi['evolution_cost'], 'RABBITOSHI_EVOLUTION_TIME' => $rabitoshi['evolution_time'], 'RABBITOSHI_LEVEL_UP_PENALTY' => $rabitoshi['next_level_penalty'])); if ($submit) { $use = intval($HTTP_POST_VARS['use']); $rebirth = intval($HTTP_POST_VARS['rebirth']); $vet = intval($HTTP_POST_VARS['vet']); $hotel = intval($HTTP_POST_VARS['hotel']); $evolution = intval($HTTP_POST_VARS['evolution']);
* ***************************************************************************/ define('IN_PHPBB', true); if (!empty($setmodules)) { $file = basename(__FILE__); $module['Rabbitoshi']['Rabbitoshi_owners'] = $file; return; } $phpbb_root_path = './../'; require $phpbb_root_path . 'extension.inc'; require "./pagestart.{$phpEx}"; include $phpbb_root_path . 'rabbitoshi/includes/functions_rabbitoshi.' . $phpEx; if (defined('PRIVMSGA_TABLE')) { include $phpbb_root_path . 'includes/functions_messages.' . $phpEx; } rabbitoshi_template_file('admin/config_rabbitoshi_owners_body.tpl'); $submit = isset($HTTP_POST_VARS['submit']); $update = isset($HTTP_POST_VARS['update']); $sql = "SELECT u.user_id , u.username\r\n\tFROM " . USERS_TABLE . " u , " . RABBITOSHI_USERS_TABLE . " ru\r\n\tWHERE u.user_id = ru.owner_id\r\n\tORDER by u.username"; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Could not obtain group list', '', __LINE__, __FILE__, $sql); } $select_list = ''; if ($row = $db->sql_fetchrow($result)) { $select_list .= '<select name="owner_id">'; do { $select_list .= '<option value="' . $row['user_id'] . '">' . $row['username'] . '</option>'; } while ($row = $db->sql_fetchrow($result)); $select_list .= '</select>'; } if (!empty($HTTP_POST_VARS['owner_id'])) {
if (!($result = $db->sql_query($sql, BEGIN_TRANSACTION))) { message_die(GENERAL_ERROR, 'Unable to update pet status.', '', __LINE__, __FILE__, $sql); } $prize = $rabbit_general['rebirth_price']; $sql = "UPDATE " . USERS_TABLE . "\r\n\t\t\t\t\t\t\tSET user_points = user_points - {$prize}\r\n\t\t\t\t\t\t\tWHERE user_id = {$user_id}"; if (!$db->sql_query($sql)) { message_die(GENERAL_ERROR, 'Unable to deduct user points.', '', __LINE__, __FILE__, $sql); } rabbitoshi_previous('Rabbitoshi_pet_dead_rebirth_ok', 'rabbitoshi', ''); } else { if ($resurrect_no) { // why no ;( // rabbitoshi_delete_pet($user_id); rabbitoshi_previous('Rabbitoshi_pet_dead_rebirth_no', 'rabbitoshi', ''); } else { rabbitoshi_template_file('rabbitoshi_confirm_body.tpl'); $template->assign_block_vars('resurrect', array()); $template->assign_vars(array('L_CONFIRM_TITLE' => $lang['Rabbitoshi_confirm'], 'L_PET_IS_DEAD' => $lang['Rabbitoshi_pet_is_dead'], 'L_PET_DEAD_COST' => $lang['Rabbitoshi_pet_is_dead_cost'], 'L_PET_DEAD_COST_EXPLAIN' => $lang['Rabbitoshi_pet_is_dead_cost_explain'], 'L_RESURRECT_OK' => $lang['Yes'], 'L_RESURRECT_NO' => $lang['No'], 'PET_DEAD_COST' => $rabbit_general['rebirth_price'])); } } } else { rabbitoshi_previous('Rabbitoshi_pet_dead_lack', 'rabbitoshi', ''); } } } $rabbit_config = get_rabbitoshi_config($rabbit_user['owner_creature_id']); $template->assign_block_vars('pet', array()); list($is_in_hotel, $hotel_time) = rabbitoshi_get_hotel(); if ($hotel_time > 1) { $is_in_hotel = TRUE; $template->assign_block_vars('pet.pet_hotel', array());
// Start session management $userdata = session_pagestart($user_ip, PAGE_RABSHO); init_userprefs($userdata); // End session management // if (!$userdata['session_logged_in']) { $redirect = "rabbitoshi.{$phpEx}"; $redirect .= isset($user_id) ? '&user_id=' . $user_id : ''; header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true)); } // // Generate page // $page_title = $lang['Rabbitoshi_title']; include $phpbb_root_path . 'includes/page_header.' . $phpEx; rabbitoshi_template_file('rabbitoshi_shop_body.tpl'); $board_config['points_name'] = $board_config['points_name'] ? $board_config['points_name'] : $lang['Rabbitoshi_default_points_name']; $user_id = $userdata['user_id']; if (empty($HTTP_GET_VARS[POST_USERS_URL])) { $view_userdata = $userdata; } else { $view_userdata = get_userdata($HTTP_GET_VARS[POST_USERS_URL]); } $searchid = $view_userdata['user_id']; $points = $userdata['user_points']; $sql = "SELECT * FROM " . RABBITOSHI_USERS_TABLE . " \r\nWHERE owner_id = " . $view_userdata['user_id']; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_MESSAGE, $lang['Rabbitoshi_owner_pet_lack']); } $rabbit_user = $db->sql_fetchrow($result); $sql = "SELECT * FROM " . RABBITOSHI_GENERAL_TABLE;
// Start session management $userdata = session_pagestart($user_ip, PAGE_RABPRO); init_userprefs($userdata); // End session management // if (!$userdata['session_logged_in']) { $redirect = "rabbitoshi_progress.{$phpEx}"; $redirect .= isset($user_id) ? '&user_id=' . $user_id : ''; header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true)); } // // Generate page // $page_title = $lang['Rabbitoshi_pet_progress']; include $phpbb_root_path . 'includes/page_header.' . $phpEx; rabbitoshi_template_file('rabbitoshi_progress_body.tpl'); $board_config['points_name'] = $board_config['points_name'] ? $board_config['points_name'] : $lang['Rabbitoshi_default_points_name']; $user_id = $userdata['user_id']; if (empty($HTTP_GET_VARS[POST_USERS_URL])) { $view_userdata = $userdata; } else { $view_userdata = get_userdata($HTTP_GET_VARS[POST_USERS_URL]); } $searchid = $view_userdata['user_id']; $points = $userdata['user_points']; $sql = "SELECT * FROM " . RABBITOSHI_USERS_TABLE . " \r\n\tWHERE owner_id = " . $view_userdata['user_id']; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_MESSAGE, $lang['Rabbitoshi_owner_pet_lack']); } $rabbit_user = $db->sql_fetchrow($result); $sql = "SELECT * FROM " . RABBITOSHI_CONFIG_TABLE . " \r\n\tWHERE creature_id = " . $rabbit_user['owner_creature_id'];
// Start session management $userdata = session_pagestart($user_ip, PAGE_RABINV); init_userprefs($userdata); // End session management // if (!$userdata['session_logged_in']) { $redirect = "rabbitoshi.{$phpEx}"; $redirect .= isset($user_id) ? '&user_id=' . $user_id : ''; header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true)); } // // Generate page // $page_title = $lang['Rabbitoshi_inventory']; include $phpbb_root_path . 'includes/page_header.' . $phpEx; rabbitoshi_template_file('rabbitoshi_inventory_body.tpl'); $user_id = $userdata['user_id']; if (empty($HTTP_GET_VARS[POST_USERS_URL])) { $view_userdata = $userdata; } else { $view_userdata = get_userdata($HTTP_GET_VARS[POST_USERS_URL]); } $searchid = $view_userdata['user_id']; $points = $userdata['user_points']; $sql = "SELECT * FROM " . RABBITOSHI_USERS_TABLE . " \r\n\tWHERE owner_id = " . $view_userdata['user_id']; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_MESSAGE, $lang['Rabbitoshi_owner_pet_lack']); } $rabbit_user = $db->sql_fetchrow($result); $sql = "SELECT * FROM " . RABBITOSHI_GENERAL_TABLE; if (!($result = $db->sql_query($sql))) {
$result = $db->sql_query($sql); if (!$result) { message_die(GENERAL_ERROR, "Couldn't insert new pet", "", __LINE__, __FILE__, $sql); } $message = $lang['Rabbitoshi_add_success'] . "<br /><br />" . sprintf($lang['Click_return_rabbitoshiadmin'], "<a href=\"" . append_sid("admin_rabbitoshi.{$phpEx}") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.{$phpEx}?pane=right") . "\">", "</a>"); message_die(GENERAL_MESSAGE, $message); break; } } else { $sql = "SELECT *\r\n\t\tFROM " . RABBITOSHI_CONFIG_TABLE . "\r\n\t\tORDER BY creature_id"; $result = $db->sql_query($sql); if (!$result) { message_die(GENERAL_ERROR, "Couldn't obtain rabbitoshis from database", "", __LINE__, __FILE__, $sql); } $rabbitoshi = $db->sql_fetchrowset($result); rabbitoshi_template_file('admin/config_rabbitoshi_list_body.tpl'); for ($i = 0; $i < count($rabbitoshi); $i++) { $rsql = "SELECT item_name\r\n\t\t\tFROM " . RABBITOSHI_SHOP_TABLE . "\r\n\t\t\tWHERE item_id = " . $rabbitoshi[$i]['creature_food_id']; $rresult = $db->sql_query($rsql); if (!$rresult) { message_die(GENERAL_ERROR, 'Could not obtain pets information', "", __LINE__, __FILE__, $rsql); } $food_type = $db->sql_fetchrow($rresult); $esql = "SELECT creature_name\r\n\t\t\tFROM " . RABBITOSHI_CONFIG_TABLE . "\r\n\t\t\tWHERE creature_id = " . $rabbitoshi[$i]['creature_evolution_of']; $eresult = $db->sql_query($esql); if (!$eresult) { message_die(GENERAL_ERROR, 'Could not obtain pets information', "", __LINE__, __FILE__, $esql); } $evo = $db->sql_fetchrow($eresult); $evolution_of = $evo['creature_name']; $buyable = $rabbitoshi[$i]['creature_buyable'] ? $lang['Yes'] : $lang['No'];