コード例 #1
0
ファイル: adr_vault.php プロジェクト: ZerGabriel/adr-rpg
    if (!$db->sql_query($sql)) {
        message_die(GENERAL_ERROR, 'Could not obtain accounts information', "", __LINE__, __FILE__, $sql);
    }
    adr_previous(Adr_vault_loan_pay_off_ok, adr_vault, '');
}
$sql = "SELECT * FROM " . ADR_VAULT_USERS_TABLE;
if (!($result = $db->sql_query($sql))) {
    message_die(CRITICAL_ERROR, 'Error Getting Vault Users!');
}
$vault_stats = $db->sql_fetchrowset($result);
$opened_accounts = 0;
$total_deposit = 0;
for ($i = 0; $i < count($vault_stats); $i++) {
    $opened_accounts = $opened_accounts + 1;
    $total_deposit = $total_deposit + $vault_stats[$i]['account_sum'];
}
$sql = "SELECT * FROM " . ADR_VAULT_USERS_TABLE . "\n\tWHERE owner_id = {$user_id} ";
if (!($result = $db->sql_query($sql))) {
    message_die(CRITICAL_ERROR, 'Error Getting Vault Users!');
}
$vault = $db->sql_fetchrow($result);
$remaining_time = $vault_general['loan_interests_time'] - (time() - $vault['loan_time']);
$remaining_date = $vault['loan_time'] + $vault_general['loan_interests_time'];
$loan = $vault['loan_sum'] * (1 + $vault_general['loan_interests'] / 100);
$template->assign_vars(array('POINTS' => number_format($userdata['user_points']), 'ACCOUNTS' => number_format($opened_accounts), 'TOTAL_DEPOSIT' => number_format($total_deposit), 'ACCOUNT_SUM' => number_format($vault['account_sum']), 'INTEREST_TIME' => adr_make_time($vault_general['interests_time']), 'INTEREST_RATE' => $vault_general['interests_rate'], 'POSTS_REQ' => number_format($vault_general['loan_requirements']), 'LOAN_RATE' => $vault_general['loan_interests'], 'LOAN_TIME' => adr_make_time($vault_general['loan_interests_time']), 'LOAN_MAX_SUM' => number_format($vault_general['loan_max_sum']), 'LOAN_SUM' => number_format($vault['loan_sum']), 'LOAN_REMAINING_TIME' => adr_make_time($remaining_time), 'LOAN_REMAINING_DATE' => create_date($board_config['default_dateformat'], $remaining_date, $board_config['board_timezone']), 'LOAN_LOAN' => number_format($loan), 'DUE' => $due, 'L_OTHERS' => $lang['Adr_vault_others'], 'L_VAULT_LIST' => $lang['Adr_vault_list'], 'L_STOCK_EXCHANGE' => $lang['Adr_vault_stock_exchange'], 'L_LOAN_SUM' => $lang['Adr_vault_loan_sum'], 'L_LOAN_REMAINING_TIME' => $lang['Adr_vault_loan_remaining_time'], 'L_LOAN_REMAINING_DATE' => $lang['Adr_vault_loan_remaining_date'], 'L_LOAN_LOAN' => $lang['Adr_vault_loan_loan'], 'L_LOAN_BACK' => $lang['Adr_vault_loan_back'], 'L_LOAN_ACTIVE' => $lang['Adr_vault_loan_active'], 'L_LOAN_RATE' => $lang['Adr_vault_loan_rate'], 'L_LOAN_TIME' => $lang['Adr_vault_loan_time'], 'L_LOAN_MAX_SUM' => $lang['Adr_vault_loan_max_sum'], 'L_ACCOUNT_LOAN' => $lang['Adr_vault_loan_make'], 'L_LOAN' => $lang['Adr_vault_loan_action'], 'L_POSTS_REQ' => $lang['Posts'], 'L_NO_LOAN_EXPLAIN' => $lang['Adr_vault_loan_no_explain'], 'L_INTEREST_TIME' => $lang['Adr_vault_interests_time'], 'L_LOAN_INFORMATIONS' => $lang['Adr_vault_loan_informations'], 'L_INTEREST_RATE' => $lang['Adr_vault_interests_rate'], 'L_ACCOUNT_DEPOSIT' => $lang['Adr_vault_account_deposit'], 'L_DEPOSIT' => $lang['Adr_vault_deposit'], 'L_ACCOUNT_WITHDRAW' => $lang['Adr_vault_account_withdraw'], 'L_WITHDRAW' => $lang['Adr_vault_withdraw'], 'L_PERSONAL_INFORMATIONS' => $lang['Adr_vault_user_informations'], 'L_ACCOUNT_INFORMATIONS' => $lang['Adr_vault_account_informations'], 'L_OPENED_ACCOUNTS' => $lang['Adr_vault_opened_accounts'], 'L_TOTAL_DEPOSIT' => $lang['Adr_vault_accounts_sum'], 'L_OWNER_POINTS' => $lang['Adr_vault_user_points'], 'L_POINTS' => get_reward_name(), 'L_PUBLIC_TITLE' => $lang['Adr_vault__page_name'], 'L_NO_ACCOUNT' => $lang['Adr_vault_no_account'], 'L_ACCOUNT' => $lang['Adr_vault_account'], 'L_OPEN_ACCOUNT' => $lang['Adr_vault_open_account'], 'L_CLOSE_ACCOUNT' => $lang['Adr_vault_close_account'], 'L_BLACK_LISTED' => $lang['Adr_vault_blacklist'], 'L_BLACK_LISTED_EXPLAIN' => $lang['Adr_vault_blacklist_explain'], 'L_BLACK_LISTED_DUE' => $lang['Adr_vault_blacklist_due'], 'L_DUE_PAYOFF' => $lang['Adr_vault_blacklist_due_payoff'], 'S_VAULT_ACTION' => append_sid("adr_vault.{$phpEx}")));
include $phpbb_root_path . 'adr/includes/adr_header.' . $phpEx;
$template->pparse('body');
include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
?>
 
コード例 #2
0
    default:
        $order_by = "set_name {$sort_order} LIMIT {$start}, " . $board_config['topics_per_page'];
        break;
}
$sql = "SELECT * FROM " . ADR_ARMOUR_SET_TABLE . "\r\n\t\tORDER BY {$order_by}";
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);
}
if ($sets = $db->sql_fetchrow($result)) {
    $i = 0;
    do {
        $row_class = !($i % 2) ? $theme['td_class1'] : $theme['td_class2'];
        $image = $sets['set_img'] != '' ? '<img src="adr/images/sets/' . $sets['set_img'] . '">' : '';
        $template->assign_block_vars('sets', array("ROW_CLASS" => $row_class, "SET_ID" => $sets['set_id'], "SET_IMG" => $image, "SET_NAME" => $sets['set_name'], "SET_DESC" => $sets['set_desc'], "SET_HELM" => adr_get_lang($sets['set_helm']), "SET_ARMOUR" => adr_get_lang($sets['set_armour']), "SET_GLOVES" => adr_get_lang($sets['set_gloves']), "SET_SHIELD" => adr_get_lang($sets['set_shield']), "SET_MIGHT_BONUS" => $sets['set_might_bonus'], "SET_CON_BONUS" => $sets['set_constitution_bonus'], "SET_AC_BONUS" => $sets['set_ac_bonus'], "SET_DEX_BONUS" => $sets['set_dexterity_bonus'], "SET_INT_BONUS" => $sets['set_intelligence_bonus'], "SET_WIS_BONUS" => $sets['set_wisdom_bonus'], "SET_MIGHT_PEN" => $sets['set_might_penalty'], "SET_CON_PEN" => $sets['set_constitution_penalty'], "SET_AC_PEN" => $sets['set_ac_penalty'], "SET_DEX_PEN" => $sets['set_dexterity_penalty'], "SET_INT_PEN" => $sets['set_intelligence_penalty'], "SET_WIS_PEN" => $sets['set_wisdom_penalty']));
        $i++;
    } while ($sets = $db->sql_fetchrow($result));
}
$sql = "SELECT count(*) AS total FROM " . ADR_ARMOUR_SET_TABLE;
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
}
if ($total = $db->sql_fetchrow($result)) {
    $total_users = $total['total'];
    $pagination = generate_pagination("adr_character_armour_sets.{$phpEx}?" . POST_USERS_URL . "={$searchid}&amp;mode2={$mode2}&amp;order={$sort_order}", $total_users, $board_config['topics_per_page'], $start) . '&nbsp;';
}
$template->assign_vars(array('POINTS' => get_reward_name(), 'L_SET_HELM' => $lang['Adr_set_helm'], 'L_SET_ARMOUR' => $lang['Adr_set_armour'], 'L_SET_GLOVES' => $lang['Adr_set_gloves'], 'L_SET_SHIELD' => $lang['Adr_set_shield'], 'L_SET_MIGHT_BONUS' => $lang['Adr_set_might_bonus'], 'L_SET_CON_BONUS' => $lang['Adr_set_con_bonus'], 'L_SET_AC_BONUS' => $lang['Adr_set_ac_bonus'], 'L_SET_DEX_BONUS' => $lang['Adr_set_dex_bonus'], 'L_SET_INT_BONUS' => $lang['Adr_set_int_bonus'], 'L_SET_WIS_BONUS' => $lang['Adr_set_wis_bonus'], 'L_SET_MIGHT_PEN' => $lang['Adr_set_might_pen'], 'L_SET_CON_PEN' => $lang['Adr_set_con_pen'], 'L_SET_AC_PEN' => $lang['Adr_set_ac_pen'], 'L_SET_DEX_PEN' => $lang['Adr_set_dex_pen'], 'L_SET_INT_PEN' => $lang['Adr_set_int_pen'], 'L_SET_WIS_PEN' => $lang['Adr_set_wis_pen'], 'L_SET_IMG' => $lang['Adr_races_image'], 'L_SET_IMG_EXPLAIN' => $lang['Adr_set_img_explain'], 'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'], 'L_ORDER' => $lang['Order'], 'L_SORT' => $lang['Sort'], 'S_MODE_SELECT' => $select_sort_mode, 'S_ORDER_SELECT' => $select_sort_order, 'PAGINATION' => $pagination, 'PAGE_NUMBER' => sprintf($lang['Page_of'], floor($start / $board_config['topics_per_page']) + 1, ceil($total_users / $board_config['topics_per_page'])), 'L_GOTO_PAGE' => $lang['Goto_page'], "S_LIST_ACTION" => append_sid("adr_character_armour_sets.{$phpEx}?" . POST_USERS_URL . "={$searchid}&amp;mode2={$mode2}&amp;order={$sort_order}"), "S_HIDDEN_FIELDS" => isset($s_hidden_fields) ? $s_hidden_fields : ''));
include $phpbb_root_path . 'adr/includes/adr_header.' . $phpEx;
$template->pparse('body');
include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
?>
 
コード例 #3
0
             $theftskill_rem_effect_value = $effects_list[$i + 1];
             $theftskill_rem_monster_hit = $effects_list[$i + 3];
             $theftskill_rem_perm_effect = $effects_list[$i + 5];
         }
         if ($effects_list[$i] == 'ATT') {
             $att_effect_value = $effects_list[$i + 1];
             $att_monster_hit = $effects_list[$i + 3];
             $att_perm_effect = $effects_list[$i + 5];
         }
         if ($effects_list[$i] == 'DEF') {
             $def_effect_value = $effects_list[$i + 1];
             $def_monster_hit = $effects_list[$i + 3];
             $def_perm_effect = $effects_list[$i + 5];
         }
     }
     $template->assign_vars(array("L_RECIPE_NAME" => $lang['recipe_name'], "L_RECIPE_NAME_DESC" => $lang['recipe_name_desc'], "L_RECIPE_DESC" => $lang['recipe_desc'], "L_RECIPE_DESC_DESC" => $lang['recipe_desc_desc'], "L_RECIPE_IMG" => $lang['Adr_races_image'], "L_RECIPE_IMG_DESC" => $lang['Adr_items_image_explain'], "L_RECIPE_LEVEL" => $lang['recipe_level'], "L_RECIPE_LEVEL_DESC" => $lang['recipe_level_desc'], "L_RECIPE_ADMIN_ONLY" => $lang['recipe_admin_only'], "L_RECIPE_ADMIN_ONLY_DESC" => $lang['recipe_admin_only_desc'], "RECIPE_NAME" => $recipe['item_name'], "RECIPE_DESC" => $recipe['item_desc'], "RECIPE_IMG" => $recipe['item_icon'], "RECIPE_LEVEL" => $recipe['item_power'], "RECIPE_DURATION" => $recipe['item_duration'], "RECIPE_DURATION_MAX" => $recipe['item_duration_max'], "RECIPE_ADD_POWER" => $recipe['item_add_power'], "RECIPE_MP_USE" => $recipe['item_mp_use'], "RECIPE_PRICE" => $recipe['item_price'], "RECIPE_ADMIN_ONLY" => $recipe['item_auth'] ? 'checked' : '', "RECIPE_SELL_BACK_PERCENT" => $recipe['item_sell_back_percentage'], "L_RECIPE_WEIGHT" => $lang['Adr_shops_item_weight'], "RECIPE_WEIGHT" => $recipe['item_weight'], "L_RECIPE_STORE" => $lang['Adr_items_store'], "RECIPE_STORE_LIST" => $recipe_store_cat_list, "L_RECIPE_STEAL" => $lang['Adr_items_steal'], "L_RECIPE_STEAL_EXPLAIN" => $lang['Adr_items_steal_explain'], "RECIPE_STEAL_LIST" => $recipe_steal_list, "L_RECIPE_QUALITY" => $lang['Adr_items_quality'], "RECIPE_QUALITY" => $r_quality, "L_RECIPE_TYPE" => $lang['Adr_items_type_use'], "RECIPE_TYPE" => adr_get_item_type(20, 'simple'), "L_RECIPE_DURATION" => $lang['Adr_items_duration'], "L_RECIPE_DURATION_MAX" => $lang['Adr_items_duration_max'], "L_RECIPE_DURATION" => $lang['Adr_items_duration'], "L_RECIPE_DURATION_MAX" => $lang['Adr_items_duration_max'], "L_RECIPE_PRICE" => $lang['Adr_items_price'], "L_RECIPE_PRICE_EXPLAIN" => $lang['Adr_items_price_explain'], "L_RECIPE_SELL_BACK_PERCENT" => $lang['Adr_item_sell_back'], "L_RECIPE_SELL_BACK_PERCENT_EXPLAIN" => $lang['Adr_item_sell_back_explain'], "L_RECIPE_ITEMS_REQ" => $lang['recipe_items_req'], "L_RECIPE_ITEMS_REQ_DESC" => $lang['recipe_items_req_desc'], "L_RECIPE_ITEMS_AMOUNT" => $lang['recipe_items_amount'], "L_RECIPE_ITEMS_AMOUNT_DESC" => $lang['recipe_items_amount_desc'], "RECIPE_ITEMS_REQ" => $items_list, "RECIPE_ITEMS_AMOUNT" => $new_item_amount_list, "RECIPE_EFFECT" => $item['item_brewing_effect'], "L_RECIPE_EFFECT" => $lang['recipe_effect'], "L_RECIPE_EFFECT_DESC" => $lang['recipe_effect_desc'], "L_RECIPE_EFFECT_HP" => $lang['Adr_character_health'], "L_RECIPE_EFFECT_MP" => $lang['Adr_character_magic'], "L_RECIPE_EFFECT_EXP" => $lang['Adr_character_experience'], "L_RECIPE_EFFECT_GOLD" => get_reward_name(), "L_RECIPE_EFFECT_SP" => $lang['Adr_character_sp'], "L_RECIPE_EFFECT_AC" => $lang['Adr_character_ac'], "L_RECIPE_EFFECT_STR" => $lang['Adr_character_power'], "L_RECIPE_EFFECT_DEX" => $lang['Adr_character_agility'], "L_RECIPE_EFFECT_CON" => $lang['Adr_character_endurance'], "L_RECIPE_EFFECT_INT" => $lang['Adr_character_intelligence'], "L_RECIPE_EFFECT_WIS" => $lang['Adr_character_willpower'], "L_RECIPE_EFFECT_CHA" => $lang['Adr_character_charm'], "L_RECIPE_EFFECT_BATTLES_REM" => $lang['Adr_character_battle_limit'], "L_RECIPE_EFFECT_SKILLUSE_REM" => $lang['Adr_character_skill_limit'], "L_RECIPE_EFFECT_TRADINGSKILL_REM" => $lang['Adr_character_trading_limit'], "L_RECIPE_EFFECT_THEFTSKILL_REM" => $lang['Adr_character_thief_limit'], "L_RECIPE_EFFECT_MA" => $lang['Adr_character_ma'], "L_RECIPE_EFFECT_MD" => $lang['Adr_character_md'], "L_RECIPE_EFFECT_ATT" => $lang['Adr_monster_list_att'], "L_RECIPE_EFFECT_DEF" => $lang['Adr_monster_list_def'], "L_RECIPE_TEMP_AND_PERM" => $lang['Adr_temp_and_perm_effects'], "L_RECIPE_PERM_ONLY" => $lang['Adr_perm_only_effects'], "L_RECIPE_PERM_EFFECT" => $lang['Adr_perm_effect'], "L_RECIPE_HIT_MONSTER" => $lang['Adr_hit_monster'], "RECIPE_EFFECT_HP" => $hp_effect_value, "RECIPE_EFFECT_HP_M" => $hp_monster_hit ? 'checked' : '', "RECIPE_EFFECT_MP" => $mp_effect_value, "RECIPE_EFFECT_MP_M" => $mp_monster_hit ? 'checked' : '', "RECIPE_EFFECT_AC" => $ac_effect_value, "RECIPE_EFFECT_STR" => $str_effect_value, "RECIPE_EFFECT_DEX" => $dex_effect_value, "RECIPE_EFFECT_CON" => $con_effect_value, "RECIPE_EFFECT_INT" => $int_effect_value, "RECIPE_EFFECT_WIS" => $wis_effect_value, "RECIPE_EFFECT_CHA" => $cha_effect_value, "RECIPE_EFFECT_MA_PERM" => $ma_perm_effect ? 'checked' : '', "RECIPE_EFFECT_MA_M" => $ma_monster_hit ? 'checked' : '', "RECIPE_EFFECT_MA" => $ma_effect_value, "RECIPE_EFFECT_MD_PERM" => $md_perm_effect ? 'checked' : '', "RECIPE_EFFECT_MD_M" => $md_monster_hit ? 'checked' : '', "RECIPE_EFFECT_MD" => $md_effect_value, "RECIPE_EFFECT_ATT_M" => $att_monster_hit ? 'checked' : '', "RECIPE_EFFECT_ATT" => $att_effect_value, "RECIPE_EFFECT_DEF_M" => $def_monster_hit ? 'checked' : '', "RECIPE_EFFECT_DEF" => $def_effect_value, "RECIPE_EFFECT_EXP" => $exp_effect_value, "RECIPE_EFFECT_GOLD" => $gold_effect_value, "RECIPE_EFFECT_SP" => $sp_effect_value, "RECIPE_EFFECT_BATTLES_REM" => $battles_rem_effect_value, "RECIPE_EFFECT_SKILLUSE_REM" => $skilluse_rem_effect_value, "RECIPE_EFFECT_TRADINGSKILL_REM" => $tradingskill_rem_effect_value, "RECIPE_EFFECT_THEFTSKILL_REM" => $theftskill_rem_effect_value, "ITEM_NAME" => $item['item_name'], "ITEM_DESC" => $item['item_desc'], "ITEM_NAME_EXPLAIN" => adr_get_lang($item['item_name']), "ITEM_DESC_EXPLAIN" => adr_get_lang($item['item_desc']), "ITEM_IMG" => $item['item_icon'], "ITEM_QUALITY" => adr_get_item_quality($item['item_quality'], 'list'), "ITEM_TYPE" => adr_get_item_type(19, 'simple'), "ITEM_ELEMENT_LIST" => $element_weap_list, "ITEM_ELEMENT_STR" => $item['item_element_str_dmg'], "ITEM_ELEMENT_SAME" => $item['item_element_same_dmg'], "ITEM_ELEMENT_WEAK" => $item['item_element_weak_dmg'], "ITEM_STORE_LIST" => $store_cat_list, "ITEM_WEIGHT" => $item['item_weight'], "ITEM_AUTH" => $item['item_auth'] ? 'checked' : '', "ITEM_MAX_SKILL" => $item['item_max_skill'], "ITEM_SELL_BACK_PERCENT" => $item['item_sell_back_percentage'], "ITEM_STEAL_LIST" => $steal_list, "ITEM_DURATION" => $item['item_duration'], "ITEM_DURATION_MAX" => $item['item_duration_max'], "ITEM_POWER" => $item['item_power'], "ITEM_ADD_POWER" => $item['item_add_power'], "ITEM_MP_USE" => $item['item_mp_use'], "ITEM_PRICE" => $item['item_price'], "L_ITEM_STEAL" => $lang['Adr_items_steal'], "L_ITEM_STEAL_EXPLAIN" => $lang['Adr_items_steal_explain'], "L_ITEM_SELL_BACK_PERCENT" => $lang['Adr_item_sell_back'], "L_ITEM_SELL_BACK_PERCENT_EXPLAIN" => $lang['Adr_item_sell_back_explain'], "L_ITEM_ELEMENT" => $lang['Adr_shops_item_element'], "L_ITEM_ELEMENT_STR" => $lang['Adr_shops_item_element_str'], "L_ITEM_ELEMENT_SAME" => $lang['Adr_shops_item_element_same'], "L_ITEM_ELEMENT_WEAK" => $lang['Adr_shops_item_element_weak'], "L_ITEM_MAX_SKILL" => $lang['Adr_item_max_skill'], "L_ITEM_WEIGHT" => $lang['Adr_shops_item_weight'], "L_ITEM_STORE" => $lang['Adr_items_store'], "L_ITEM_ENHANCEMENTS" => $lang['Adr_items_enhancements'], "L_ITEM_ADD_POWER" => $lang['Adr_items_dex'], "L_ITEM_ADD_POWER_EXPLAIN" => $lang['Adr_items_dex_explain'], "L_ITEM_MP_USE" => $lang['Adr_items_mp_use'], "L_ITEM_MP_USE_EXPLAIN" => $lang['Adr_items_mp_use_explain'], "L_POINTS" => $board_config['points_name'], "L_NAME_EXPLAIN" => $lang['Adr_races_name_explain'], "L_RECIPES_TITLE" => $lang['Adr_recipes_add_title'], "L_RECIPES_EXPLAIN" => $lang['Adr_recipes_add_title_explain'], "L_ITEM_NAME" => $lang['Adr_shops_categories_item_name'], "L_ITEM_DESC" => $lang['Adr_shops_categories_item_desc'], "L_ITEM_QUALITY" => $lang['Adr_items_quality'], "L_ITEM_POWER" => $lang['Adr_items_power'], "L_ITEM_ENHANCEMENTS" => $lang['Adr_items_enhancements'], "L_ITEM_ADD_POWER" => $lang['Adr_items_dex'], "L_ITEM_ADD_POWER_EXPLAIN" => $lang['Adr_items_dex_explain'], "L_ITEM_MP_USE" => $lang['Adr_items_mp_use'], "L_ITEM_MP_USE_EXPLAIN" => $lang['Adr_items_mp_use_explain'], "L_ITEM_DURATION" => $lang['Adr_items_duration'], "L_ITEM_DURATION_MAX" => $lang['Adr_items_duration_max'], "L_ITEM_TYPE" => $lang['Adr_items_type_use'], "L_ITEM_AUTH" => $lang['Adr_store_auth'], "L_NAME" => $lang['Adr_races_name'], "L_DESC" => $lang['Adr_races_desc'], "L_ACTION" => $lang['Action'], "L_ITEMS" => $lang['Adr_shops_categories_items'], "L_EDIT" => $lang['Edit'], "L_DELETE" => $lang['Delete'], "L_ITEM_IMG" => $lang['Adr_races_image'], "L_ITEM_PRICE" => $lang['Adr_items_price'], "L_ITEM_PRICE_EXPLAIN" => $lang['Adr_items_price_explain'], "L_IMG" => $lang['Adr_races_image'], "L_IMG_EXPLAIN" => $lang['Adr_items_image_explain'], "L_ITEM_ELEMENT" => $lang['Adr_shops_item_element'], "L_SUBMIT" => $lang['Submit'], "S_ITEMS_ACTION" => append_sid("admin_adr_brewing_recipes.{$phpEx}"), "S_HIDDEN_FIELDS" => $s_hidden_fields));
     $template->pparse("body");
     break;
 case "save_recipe":
     $item_id = intval($HTTP_POST_VARS['item_id']);
     $recipe_id = intval($HTTP_POST_VARS['recipe_id']);
     $item_name = isset($HTTP_POST_VARS['item_name']) ? trim($HTTP_POST_VARS['item_name']) : trim($HTTP_GET_VARS['item_name']);
     $recipe_name = isset($HTTP_POST_VARS['recipe_name']) ? trim($HTTP_POST_VARS['recipe_name']) : trim($HTTP_GET_VARS['recipe_name']);
     $item_desc = isset($HTTP_POST_VARS['item_desc']) ? trim($HTTP_POST_VARS['item_desc']) : trim($HTTP_GET_VARS['item_desc']);
     $recipe_desc = isset($HTTP_POST_VARS['recipe_desc']) ? trim($HTTP_POST_VARS['recipe_desc']) : trim($HTTP_GET_VARS['recipe_desc']);
     $item_icon = isset($HTTP_POST_VARS['item_img']) ? trim($HTTP_POST_VARS['item_img']) : trim($HTTP_GET_VARS['item_img']);
     $recipe_img = isset($HTTP_POST_VARS['recipe_img']) ? trim($HTTP_POST_VARS['recipe_img']) : trim($HTTP_GET_VARS['recipe_img']);
     $item_quality = intval($HTTP_POST_VARS['item_quality']);
     $recipe_quality = intval($HTTP_POST_VARS['recipe_quality']);
     $item_type = 19;
     $recipe_type = 20;
コード例 #4
0
ファイル: adr_battle_pvp.php プロジェクト: ZerGabriel/adr-rpg
             message_die(GENERAL_ERROR, 'Could not update battle list', '', __LINE__, __FILE__, $sql);
         }
     }
     // Give the rewards
     add_reward($dest, $reward);
     $sql = " UPDATE  " . ADR_CHARACTERS_TABLE . "\n\t\t\t\t\tSET character_xp = character_xp + {$exp} ,\n\t\t\t\t\t\tcharacter_victories_pvp = (character_victories_pvp + 1)\n\t\t\t\t\tWHERE character_id = {$dest} ";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not update character', '', __LINE__, __FILE__, $sql);
     }
     $sql = " UPDATE  " . ADR_CHARACTERS_TABLE . "\n\t\t\t\t\tSET character_defeats_pvp = (character_defeats_pvp + 1)\n\t\t\t\t\tWHERE character_id = {$user_id} ";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not update character', '', __LINE__, __FILE__, $sql);
     }
     if ($opponent_pm_me) {
         $subject = $lang['Adr_pvp_won'];
         $message = sprintf($lang['Adr_pvp_won_by'], $current_dmg, $current_infos['character_name'], $exp, $reward, get_reward_name());
         adr_send_pm($dest, $subject, $message);
     }
     $message = sprintf($lang['Adr_battle_pvp_lost'], $current_dmg);
     $message .= '<br /><br />' . sprintf($lang['Adr_battle_temple'], "<a href=\"" . 'adr_temple.' . $phpEx . "\">", "</a>");
     $message .= '<br /><br />' . sprintf($lang['Adr_pvp_return'], "<a href=\"" . 'adr_character.' . $phpEx . "\">", "</a>");
     message_die(GENERAL_MESSAGE, $message);
 }
 // End the turn of the user
 $sql = " UPDATE  " . ADR_BATTLE_PVP_TABLE . "\n                SET battle_turn = {$dest}\n                WHERE battle_id = {$battle_id}\n                AND battle_result = 3 ";
 if (!($result = $db->sql_query($sql))) {
     message_die(GENERAL_ERROR, 'Could not update battle list', '', __LINE__, __FILE__, $sql);
 }
 if ($opponent_pm_me) {
     $subject = $lang['Adr_pvp_turn'];
     $message = sprintf($lang['Adr_pvp_turn_by'], $current_infos['character_name']);
コード例 #5
0
     break;
 case 'sell':
     // Define some values
     $items = isset($_POST['item_box']) && is_array($_POST['item_box']) ? $_POST['item_box'] : array();
     // Deny sale if the user is in a battle
     $sql = "SELECT battle_id FROM  " . ADR_BATTLE_LIST_TABLE . "\r\t\t\t\tWHERE battle_challenger_id = '{$user_id}'\r\t\t\t\tAND battle_result = '0'\r\t\t\t\tAND battle_type = '1'";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not query battle list', '', __LINE__, __FILE__, $sql);
     }
     $bat = $db->sql_fetchrow($result);
     if (is_numeric($bat['battle_id'])) {
         adr_previous('Adr_battle_no_sell_items', 'adr_character_inventory', '');
     }
     $item_id_list = '(' . implode(',', $items) . ',0)';
     $sql = "SELECT i.* FROM " . ADR_SHOPS_ITEMS_TABLE . " i\r\t\t\t\tWHERE i.item_owner_id = {$user_id}\r\t\t\t\tAND i.item_in_shop = 0\r\t\t\t\tAND i.item_duration > 0 \r\t\t\t\tAND i.item_auth = 0 \r\t\t\t\tAND i.item_no_sell = 0 \r\t\t\t\tAND i.item_id IN {$item_id_list} \r\t\t\t\tORDER BY i.item_name ";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not obtain items information', "", __LINE__, __FILE__, $sql);
     }
     $items = $db->sql_fetchrowset($result);
     $items_name = '';
     while (list(, $item) = @each($items)) {
         $item_id = $item['item_id'];
         $temp_price = adr_get_item_real_price($item_id, $user_id);
         $price = intval($price + adr_use_skill_trading($user_id, $temp_price, sell));
         $s_hidden_fields .= '<input type="hidden" name="' . $item_id . '" value="1" />';
     }
     adr_template_file('adr_confirm_body.tpl');
     $template->assign_block_vars('sell_item', array());
     $s_hidden_fields .= '<input type="hidden" name="cat" value="' . $cat . '" />';
     $s_hidden_fields .= '<input type="hidden" name="mode" value="sell_item" />';
     $template->assign_vars(array('MESSAGE_TITLE' => $lang['Adr_items_sell_confirm'], 'MESSAGE_TEXT' => sprintf($lang['Adr_items_sell_confirm_price'], intval($price), get_reward_name()), 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'S_SELL_CONFIRM_ACTION' => append_sid("adr_character_inventory.{$phpEx}"), 'HIDDEN_FIELDS' => $s_hidden_fields));
コード例 #6
0
ファイル: adr_clans.php プロジェクト: Nekrofage/FJR
$pagination = '&';
$total_pag_items = 1;
// Pagination Data [END]
// Set filename
$file = 'adr_clans.php';
$shoutbox = false;
//
// Start MOD Code
//
// V: fix a few warnings
if (empty($_GET['action'])) {
    $_GET['action'] = null;
}
$user_id = $userdata['user_id'];
// Get users' id
$points_name = get_reward_name();
// 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'];
コード例 #7
0
ファイル: adr_shops.php プロジェクト: ZerGabriel/adr-rpg
     }
     ##=== START: show all items or just those available to user?
     $points_check_sql = $show_only_mine == '1' ? ' AND item_price <= ' . $points : '';
     $item_sql = $show_only_mine == '1' ? $item_sql : '';
     ##=== END: show all items or just those available to user?
     $shop_more_sql = $shop_owner != 1 ? 'AND item_in_shop = 1' : '';
     $cat_sql = $cat ? 'AND item_type_use = ' . $cat : '';
     $sql = "SELECT count(*) AS total FROM " . ADR_SHOPS_ITEMS_TABLE . " \n\t\t\t\tWHERE item_owner_id = {$shop_owner}\n\t\t\t\t{$item_sql}\n\t\t\t\t{$points_check_sql}\n\t\t\t\t{$shop_more_sql} \n\t\t\t\t{$cat_sql}\n\t\t\t\tAND item_duration > 0 ";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
     }
     if ($total = $db->sql_fetchrow($result)) {
         $total_items = $total['total'];
         $pagination = generate_pagination("adr_shops.{$phpEx}?mode=see_shop&amp;mode2={$mode2}&amp;order={$sort_order}&amp;shop_id=" . $shop_id . "", $total_items, $board_config['topics_per_page'], $start) . '&nbsp;';
     }
     $template->assign_vars(array('ORDER_BY' => $order_by, 'ACTION_SELECT' => $action_select, 'SELECT_CAT' => $select_category, 'SELECT_QUANTITY' => $select_quantity, 'SHOP_OWNER_ID' => $shop_owner, 'SHOP_NAME' => $shop_name, 'SHOP_DESC' => $shop_desc, 'POINTS' => number_format(get_reward($user_id)), 'SHOW_LINK' => $show_link, 'L_POINTS' => $lang['Adr_my'] . get_reward_name(), 'L_SHOW_LINK' => $show_type, "L_SELECT_CAT" => $lang['Adr_items_select'], "L_SELECT_QUANTITY" => $lang['Adr_items_select_quantity'], "L_ITEM_NAME" => $lang['Adr_shops_categories_item_name'], "L_ITEM_DESC" => $lang['Adr_shops_categories_item_desc'], "L_ITEM_QUALITY" => $lang['Adr_items_quality'], "L_ITEM_POWER" => $lang['Adr_items_power'], "L_ITEM_WEIGHT" => $lang['Adr_character_weight'], "L_ITEM_DURATION" => $lang['Adr_items_duration'], "L_ITEM_ELEMENT" => $lang['Adr_shops_item_element'], "L_ACTION" => $lang['Adr_items_action'], "L_ITEM_IMG" => $lang['Adr_races_image'], "L_ITEM_PRICE" => $lang['Adr_items_price'], "L_ITEM_TYPE" => $lang['Adr_items_type_use'], "L_NO_ITEMS" => $lang['Adr_items_none'], 'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'], 'L_ORDER' => $lang['Order'], 'L_SORT' => $lang['Sort'], 'L_SUBMIT' => $lang['Submit'], 'S_MODE_SELECT' => $select_sort_mode, 'S_ORDER_SELECT' => $select_sort_order, 'PAGINATION' => $pagination, 'PAGE_NUMBER' => sprintf($lang['Page_of'], floor($start / $board_config['topics_per_page']) + 1, ceil($total_items / $board_config['topics_per_page'])), 'L_GOTO_PAGE' => $lang['Goto_page'], 'S_MODE_ACTION' => append_sid("adr_shops.{$phpEx}?mode=see_shop&amp;shop_id=" . $shop_id . "")));
     break;
 case 'shop_list':
     $template->assign_block_vars('shop_list', array());
     if (isset($_GET['mode2']) || isset($_POST['mode2'])) {
         $mode2 = isset($_POST['mode2']) ? htmlspecialchars($_POST['mode2']) : htmlspecialchars($_GET['mode2']);
     } else {
         $mode2 = 'itemname';
     }
     if (isset($_POST['order'])) {
         $sort_order = $_POST['order'] == 'ASC' ? 'ASC' : 'DESC';
     } else {
         if (isset($_GET['order'])) {
             $sort_order = $_GET['order'] == 'ASC' ? 'ASC' : 'DESC';
         } else {
             $sort_order = 'ASC';
コード例 #8
0
function adr_update_store_user_trans($user_id, $shop_owner_id, $items, $sum)
{
    global $db, $lang, $adr_user, $invent_array;
    // Fix the values
    $user_id = intval($user_id);
    $shop_owner_id = intval($shop_owner_id);
    $sum = intval($sum);
    ##=== START: Update the user store transaction table ===##
    $sql = "SELECT user_store_trans_id FROM " . ADR_STORES_USER_HISTORY . "\n\t\tWHERE user_store_owner_id = '{$shop_owner_id}'\n\t\tORDER BY user_store_trans_id\n\t\tDESC LIMIT 1";
    $result = $db->sql_query($sql);
    if (!$result) {
        message_die(GENERAL_ERROR, 'Could not query for store stats', '', __LINE__, __FILE__, $sql);
    }
    $seller_infos = $db->sql_fetchrow($result);
    $new_trans_id = intval($seller_infos['user_store_trans_id'] + 1);
    // Create item name array for trans log
    for ($i = 0; $i < count($items); $i++) {
        $item_id = $items[$i];
        for ($in = 0; $in < count($invent_array); $in++) {
            if ($item_id == $invent_array[$in]['item_id']) {
                $item_list .= adr_get_lang($invent_array[$in]['item_name']);
                if ($in < count($items) - 1) {
                    $item_list .= ', ';
                }
            }
        }
    }
    // If no stats for store already exist in table then create new for this user
    $sql = "INSERT INTO " . ADR_STORES_USER_HISTORY . "\n\t\t(user_store_trans_id, user_store_owner_id, user_store_info, user_store_total_price, user_store_date, user_store_buyer)\n\t\tVALUES({$new_trans_id}, {$shop_owner_id}, '" . str_replace("\\'", "''", $item_list) . "', {$sum}, " . time() . ", '" . $adr_user['character_name'] . "')";
    $result = $db->sql_query($sql);
    if (!$result) {
        message_die(GENERAL_ERROR, "Couldn't insert user store transaction", "", __LINE__, __FILE__, $sql);
    }
    // Send PM to seller (if enabled) with transaction details
    $subject = sprintf($lang['Adr_seller_item_subject']);
    $message = sprintf($lang['Adr_seller_item_msg'], $adr_user['character_name'], $sum, get_reward_name(), '<i>', $item_list, '</i>');
    $seller = adr_get_user_infos($shop_owner_id);
    if ($seller['character_pref_seller_pm']) {
        adr_send_pm($shop_owner_id, $subject, $message);
    }
    return;
}
コード例 #9
0
ファイル: adr_enchant.php プロジェクト: Nekrofage/FJR
     $template->assign_block_vars('mining', array());
     $sql = " SELECT * FROM " . ADR_SHOPS_ITEMS_TABLE . "\r\t\t\t\tWHERE item_owner_id = {$user_id}\r\t\t\t\tAND item_in_shop = 0\r\t\t\t\tAND item_in_warehouse = 0\r\t\t\t\tAND item_duration > 0\r\t\t\t\tAND item_type_use = 3 ";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not check user tools', "", __LINE__, __FILE__, $sql);
     }
     $tools = $db->sql_fetchrowset($result);
     $tool_list = '<select name="item_tool">';
     $tool_list .= '<option value = "0" >' . $lang['Adr_forge_mining_no_tool'] . '</option>';
     for ($i = 0; $i < count($tools); $i++) {
         $tool_list .= '<option value = "' . $tools[$i]['item_id'] . '" >' . adr_get_lang($tools[$i]['item_name']) . ' ( ' . $lang['Adr_items_power'] . ' : ' . $tools[$i]['item_power'] . ' - ' . $lang['Adr_items_duration'] . ' : ' . $tools[$i]['item_duration'] . ' )' . '</option>';
     }
     $tool_list .= '</select>';
     $template->assign_vars(array('TOOL_LIST' => $tool_list, 'L_SELECT_TOOL' => $lang['Adr_forge_mining_select_tool'], 'L_GO_MINING' => $lang['Adr_forge_mining_go'], 'L_MINING_EXPLAIN' => $lang['Adr_forge_mining_explain']));
     break;
 case 'mining_action':
     $tool = intval($HTTP_POST_VARS['item_tool']);
     // No tool , no mining
     if (!$tool) {
         adr_previous(Adr_forge_mining_tool_needed, adr_forge, "mode=mining");
     } else {
         $new_item_id = adr_use_skill_mining($user_id, $tool);
         if (!$new_item_id) {
             adr_previous(Adr_forge_mining_failure, adr_forge, "mode=mining");
         } else {
             $sql = " SELECT item_name , item_price FROM " . ADR_SHOPS_ITEMS_TABLE . "\r\t\t\t\t\t\tWHERE item_owner_id = {$user_id} \r\t\t\t\t\t\tAND item_in_warehouse = 0\r\t\t\t\t\t\tAND item_id = {$new_item_id} ";
             if (!($result = $db->sql_query($sql))) {
                 message_die(GENERAL_ERROR, 'Could not check user tools', "", __LINE__, __FILE__, $sql);
             }
             $new_item = $db->sql_fetchrow($result);
             $direction = append_sid("adr_enchant.{$phpEx}?mode=mining");
             $message = sprintf($lang['Adr_forge_mining_success'], adr_get_lang($new_item['item_name']), $new_item['item_price'], get_reward_name());
コード例 #10
0
ファイル: adr_global.php プロジェクト: ZerGabriel/ADR2
function adr_character_replen_quota()
{
    global $db, $phpEx, $adr_general, $board_config, $lang, $table_prefix, $phpbb_root_path;
    // define some constants
    define('ADR_SHOPS_TABLE', $table_prefix . 'adr_shops');
    define('IN_ADR_SETTINGS', 1);
    define('IN_ADR_VAULT', 1);
    define('IN_ADR_BATTLE', 1);
    define('IN_ADR_CHARACTER', 1);
    $sql = "SELECT * FROM " . ADR_CHARACTERS_TABLE . "";
    $result = $db->sql_query($sql);
    if (!$result) {
        message_die(GENERAL_ERROR, 'Could not obtain character list', '', __LINE__, __FILE__, $sql);
    }
    $characters = $db->sql_fetchrowset($result);
    for ($c = 0; $c < count($characters); $c++) {
        if ($characters[$c]['character_id'] != '0' && $characters[$c]['character_id'] != '') {
            // Define some variables
            $character_id = $characters[$c]['character_id'];
            $points = get_reward($character_id);
            $adr_user['character_birth'] = $characters[$c]['character_birth'];
            $adr_user['character_limit_update'] = $characters[$c]['character_limit_update'];
            $adr_user['character_warehouse_update'] = $characters[$c]['character_warehouse_update'];
            $adr_user['character_warehouse'] = $characters[$c]['character_warehouse'];
            $adr_user['character_shop_update'] = $characters[$c]['character_shop_update'];
            $pm_wh = FALSE;
            $pm_shop = FALSE;
            $wh_msg = '';
            $shop_msg = '';
            // Vault account check
            $sql = "SELECT account_sum FROM " . ADR_VAULT_USERS_TABLE . "\n\t\t\t\tWHERE owner_id = '{$character_id}'";
            if (!($result = $db->sql_query($sql))) {
                message_die(GENERAL_ERROR, 'Could not query vault user table', '', __LINE__, __FILE__, $sql);
            }
            $vault_check = $db->sql_fetchrow($result);
            // Shop stats check
            $sql = "SELECT shop_id FROM " . ADR_SHOPS_TABLE . "\n\t\t\t\tWHERE shop_owner_id = '{$character_id}'";
            if (!($result = $db->sql_query($sql))) {
                message_die(GENERAL_ERROR, 'Could not query shops table', '', __LINE__, __FILE__, $sql);
            }
            $shop_check = $db->sql_fetchrow($result);
            // Work out how many days have passed since character_creation
            $character_days = floor((time() - $adr_user['character_birth']) / 86400);
            // START battle & skill regening
            if (is_numeric($character_id) && $adr_general['Adr_character_limit_enable'] != '0' && $character_days > $adr_user['character_limit_update'] + ($adr_general['Adr_limit_regen_duration'] - 1)) {
                $new_battle_limit = $adr_general['Adr_character_battle_limit'];
                $new_skill_limit = $adr_general['Adr_character_skill_limit'];
                $new_trading_limit = $adr_general['Adr_character_trading_limit'];
                $new_thief_limit = $adr_general['Adr_character_thief_limit'];
                $sql = " UPDATE " . ADR_CHARACTERS_TABLE . "\n\t\t\t\t\tSET character_battle_limit = {$new_battle_limit},\n\t\t\t\t\t\tcharacter_skill_limit = {$new_skill_limit},\n\t\t\t\t\t\tcharacter_trading_limit = {$new_trading_limit},\n\t\t\t\t\t\tcharacter_thief_limit = {$new_thief_limit},\n\t\t\t\t\t\tcharacter_limit_update = {$character_days}\n\t\t\t\t\tWHERE character_id = '{$character_id}'";
                if (!($results = $db->sql_query($sql))) {
                    message_die(GENERAL_MESSAGE, 'Error regening user battle & skill limits');
                }
            }
            // END battle & skill regening
            // START warehouse tax check
            if (is_numeric($character_id) && $character_days > $adr_user['character_warehouse_update'] + ($board_config['Adr_warehouse_duration'] - 1)) {
                $warehouse_days = $character_days - ($adr_user['character_warehouse_update'] + ($board_config['Adr_warehouse_duration'] - 1));
                $warehouse_tax = $board_config['Adr_warehouse_tax'] * $warehouse_days;
                if ($adr_user['character_warehouse'] != '0' && $board_config['Adr_warehouse_tax'] > '0') {
                    if ($points >= $warehouse_tax) {
                        // Remove tax from user_points
                        subtract_reward($character_id, $warehouse_tax);
                        $wh_msg = sprintf($lang['Adr_character_warehouse_tax'], $warehouse_tax, get_reward_name());
                    } elseif ($points < $warehouse_tax && is_numeric($vault_check['account_sum']) && $vault_check['account_sum'] >= $warehouse_tax) {
                        // Else remove from Vault
                        $sql = "UPDATE " . ADR_VAULT_USERS_TABLE . "\n\t\t\t\t\t\t\t\tSET account_sum = (account_sum - {$warehouse_tax})\n\t\t\t\t\t\t\t\tWHERE owner_id = '{$character_id}'";
                        if (!$db->sql_query($sql)) {
                            message_die(CRITICAL_ERROR, 'Error removing points for WH tax (vault)');
                        }
                        $wh_msg = sprintf($lang['Adr_character_warehouse_tax'], $warehouse_tax, get_reward_name());
                    } else {
                        // Close warehouse
                        $sql = " UPDATE " . ADR_CHARACTERS_TABLE . "\n\t\t\t\t\t\t\tSET character_warehouse = 0\n\t\t\t\t\t\t\t\tWHERE character_id = '{$character_id}'";
                        if (!$db->sql_query($sql)) {
                            message_die(GENERAL_MESSAGE, 'Error closing warehouse');
                        }
                        // Remove warehouse status from itemsif rent not paid
                        $sql = "UPDATE " . ADR_SHOPS_ITEMS_TABLE . "\n\t\t\t\t\t\t\tSET item_in_warehouse = 0\n\t\t\t\t\t\t\tWHERE item_owner_id = '{$character_id}'";
                        if (!$db->sql_query($sql)) {
                            message_die(GENERAL_ERROR, 'Could not remove WH status for items', "", __LINE__, __FILE__, $sql);
                        }
                        $wh_msg = sprintf($lang['Adr_character_warehouse_closed'], $warehouse_tax, get_reward_name());
                    }
                    // Check for any messages to use later on in PM to user
                    $pm_wh = TRUE;
                }
                // Update user warehouse update time
                $sql = " UPDATE " . ADR_CHARACTERS_TABLE . "\n\t\t\t\t\tSET character_warehouse_update = {$character_days}\n\t\t\t\t\t\tWHERE character_id = '{$character_id}'";
                if (!($results = $db->sql_query($sql))) {
                    message_die(GENERAL_MESSAGE, 'Error updating warehouse');
                }
            }
            // END warehouse tax check
            // START open shop tax check
            if (is_numeric($character_id) && $character_days > $adr_user['character_shop_update'] + ($board_config['Adr_shop_duration'] - 1)) {
                $shop_days = $character_days - ($adr_user['character_shop_update'] + ($board_config['Adr_shop_duration'] - 1));
                $shop_tax = $board_config['Adr_shop_tax'] * $shop_days;
                // see if user has a shop open
                if (is_numeric($shop_check['shop_id']) && $board_config['Adr_shop_tax'] > '0') {
                    if ($points >= $shop_tax) {
                        // Remove tax from user_points
                        subtract_reward($character_id, $shop_tax);
                        $shop_msg = sprintf($lang['Adr_character_shop_tax'], $shop_tax, get_reward_name());
                    } elseif ($points < $shop_tax && is_numeric($vault_check['account_sum']) && $vault_check['account_sum'] >= $shop_tax) {
                        $sql = "UPDATE " . ADR_VAULT_USERS_TABLE . "\n\t\t\t\t\t\t\t\tSET account_sum = (account_sum - {$shop_tax})\n\t\t\t\t\t\t\t\tWHERE owner_id = '{$character_id}'";
                        if (!$db->sql_query($sql)) {
                            message_die(CRITICAL_ERROR, 'Error removing points for shop (vault)');
                        }
                        $shop_msg = sprintf($lang['Adr_character_shop_tax'], $shop_tax, get_reward_name());
                    } else {
                        // Remove shop status from items & close shop if rent not paid
                        $sql = "UPDATE " . ADR_SHOPS_ITEMS_TABLE . "\n\t\t\t\t\t\t\tSET item_in_shop = 0\n\t\t\t\t\t\t\tWHERE item_owner_id = '{$character_id}'";
                        if (!$db->sql_query($sql)) {
                            message_die(GENERAL_ERROR, 'Could not remove shop status for items', "", __LINE__, __FILE__, $sql);
                        }
                        $sql = "DELETE FROM " . ADR_SHOPS_TABLE . "\n\t\t\t\t\t\t\tWHERE shop_owner_id = '{$character_id}'";
                        if (!$db->sql_query($sql)) {
                            message_die(GENERAL_ERROR, 'Could not delete shop', "", __LINE__, __FILE__, $sql);
                        }
                        // Remove all transaction logs for user store
                        $sql = "DELETE FROM " . ADR_STORES_USER_HISTORY . "\n\t\t\t\t\t\t\tWHERE user_store_owner_id = '{$character_id}'";
                        if (!$db->sql_query($sql)) {
                            message_die(GENERAL_ERROR, 'Could not delete user store trans logs', "", __LINE__, __FILE__, $sql);
                        }
                        $shop_msg = sprintf($lang['Adr_character_shop_closed'], $shop_tax, get_reward_name());
                    }
                    // Check for any messages to use later on in PM to user
                    $pm_shop = TRUE;
                }
                // Last shop update
                $sql = " UPDATE " . ADR_CHARACTERS_TABLE . "\n\t\t\t\t\tSET character_shop_update = {$character_days}\n\t\t\t\t\t\tWHERE character_id = '{$character_id}'";
                if (!($results = $db->sql_query($sql))) {
                    message_die(GENERAL_MESSAGE, 'Error updating warehouse');
                }
            }
            // END open shop tax check
            // Here we need to check whether to send user a PM notification of charges
            if ($pm_wh === TRUE || $pm_shop === TRUE) {
                $subject = sprintf($lang['Adr_tax_pm_sub']);
                if ($pm_wh === TRUE) {
                    $message = $wh_msg . '&nbsp;';
                }
                if ($pm_shop === TRUE) {
                    $message .= $shop_msg;
                }
                adr_send_pm($character_id, $subject, $message, 2);
            }
        }
    }
    return;
}
コード例 #11
0
ファイル: adr_cell.php プロジェクト: Nekrofage/FJR
$user_id = $userdata['user_id'];
$caution = $userdata['user_cell_caution'];
$pay = isset($HTTP_POST_VARS['submit']);
// Update the time sentence
adr_cell_update_users();
if ($pay) {
    $sql = "UPDATE " . ADR_JAIL_USERS_TABLE . " \r\n\t\tSET user_freed_by = {$user_id}\r\n\t\tWHERE user_id = {$user_id} ";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, "", __LINE__, __FILE__, $sql);
    }
    $sql = "DELETE FROM " . ADR_JAIL_VOTES_TABLE . " \r\n\t\tWHERE vote_id = {$user_id} ";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, "", __LINE__, __FILE__, $sql);
    }
    $sql = "UPDATE " . USERS_TABLE . " \r\n\t\tSET user_points = user_points - {$caution} ,\r\n\t\tuser_cell_time = 0 ,\r\n\t\tuser_cell_time_judgement = 0 ,\r\n\t\tuser_cell_enable_caution = 0,\r\n\t\tuser_cell_enable_free = 0,\r\n\t\tuser_cell_sentence = '',\r\n\t\tuser_cell_caution = 0\r\n\t\tWHERE user_id = {$user_id} ";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, "", __LINE__, __FILE__, $sql);
    }
    message_die(GENERAL_MESSAGE, $lang['Adr_cell_free']);
}
if ($userdata['user_points'] >= $caution && $caution != 0) {
    $template->assign_block_vars('is_rich', array());
}
$punishment[1] = $lang['Adr_cell_time_explain'];
$punishment[2] = $lang['Adr_cell_time_explain_posts'];
$punishment[3] = $lang['Adr_cell_time_explain_read'];
$template->assign_vars(array('DAY' => $days, 'HOUR' => $hours, 'MINUTE' => $minutes, 'CAUTION' => $caution . '&nbsp;' . get_reward_name(), 'L_CELL' => $lang['Adr_cell_title'], 'L_CELL_EXPLAIN' => $lang['Adr_cell_explain'], 'L_CELL_TIME' => $lang['Adr_cell_time'], 'L_CELL_TIME_EXPLAIN' => $punishment[$userdata['user_cell_punishment']], 'L_CELLED_TIME' => adr_make_time($userdata['user_cell_time']), 'L_CAUTION' => $lang['Adr_cell_caution'], 'L_SENTENCE' => $userdata['user_cell_sentence'], 'L_CAUTION_PAY' => $lang['Adr_cell_caution_pay'], 'S_CELL_ACTION' => append_sid("adr_cell.{$phpEx}")));
$template->pparse('body');
include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
?>
 
コード例 #12
0
ファイル: adr_blacksmithing.php プロジェクト: Nekrofage/FJR
     } else {
         $new_item_id = adr_use_skill($user_id, $tool, $recipe_id, 13, blacksmithing);
         if (!$new_item_id) {
             adr_previous(blacksmithing_failure, adr_blacksmithing, "mode=view&known_recipes=" . $recipe_id . "&item_tool=" . $tool . "");
         } elseif (strlen($new_item_id) > 15) {
             $direction = append_sid("adr_blacksmithing.{$phpEx}?mode=view&known_recipes=" . $recipe_id . "&item_tool=" . $tool . "");
             $new_item_id .= '<br /><br />' . sprintf($lang['Adr_return'], "<a href=\"" . $direction . "\">", "</a>");
             message_die(GENERAL_MESSAGE, $new_item_id);
         } else {
             $sql = " SELECT item_name , item_price FROM " . ADR_SHOPS_ITEMS_TABLE . "\r\n\t\t\t\t\t\tWHERE item_owner_id = {$user_id} \r\n\t\t\t\t\t\tAND item_in_warehouse = 0\r\n\t\t\t\t\t\tAND item_id = {$new_item_id} ";
             if (!($result = $db->sql_query($sql))) {
                 message_die(GENERAL_ERROR, 'Could not check user tools', "", __LINE__, __FILE__, $sql);
             }
             $new_item = $db->sql_fetchrow($result);
             $direction = append_sid("adr_blacksmithing.{$phpEx}?mode=view&known_recipes=" . $recipe_id . "&item_tool=" . $tool . "");
             $message = sprintf($lang['blacksmithing_success'], adr_get_lang($new_item['item_name']), $new_item['item_price'], get_reward_name());
             $message .= '<br /><br />' . sprintf($lang['Adr_return'], "<a href=\"" . $direction . "\">", "</a>");
             message_die(GENERAL_MESSAGE, $message);
         }
     }
     break;
 case 'view':
     $template->assign_block_vars('recipe', array());
     $existing_recipe = isset($HTTP_POST_VARS['known_recipes']) ? trim($HTTP_POST_VARS['known_recipes']) : trim($HTTP_GET_VARS['known_recipes']);
     //blacksmithing tools
     $sql = " SELECT * FROM " . ADR_SHOPS_ITEMS_TABLE . "\r\n\t\t\t\tWHERE item_owner_id = {$user_id}\r\n\t\t\t\tAND item_in_shop = 0\r\n\t\t\t\tAND item_in_warehouse = 0\r\n\t\t\t\tAND item_duration > 0\r\n\t\t\t\tAND item_type_use = 95 ";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not check user tools', "", __LINE__, __FILE__, $sql);
     }
     $tools = $db->sql_fetchrowset($result);
     $existing_tool = isset($HTTP_POST_VARS['item_tool']) ? trim($HTTP_POST_VARS['item_tool']) : trim($HTTP_GET_VARS['item_tool']);
コード例 #13
0
ファイル: adr_character.php プロジェクト: Nekrofage/FJR
     $template->assign_block_vars('character.bio', array());
 }
 $class = adr_get_lang($row['class_name']);
 $race = adr_get_lang($row['race_name']);
 $element = adr_get_lang($row['element_name']);
 $alignment = adr_get_lang($row['alignment_name']);
 // Work out weight stats
 $max_weight = adr_weight_stats($row['character_level'], $row['race_weight'], $row['race_weight_per_level'], $row['character_might']);
 // Count up characters current weight
 $sql = "SELECT SUM(item_weight) AS total FROM  " . ADR_SHOPS_ITEMS_TABLE . "\r\t\tWHERE item_owner_id = {$searchid} \r\t\tAND item_in_warehouse = 0 \r\t\tAND item_duration > 0\r\t\tAND item_in_shop = 0";
 if (!($result = $db->sql_query($sql))) {
     message_die(CRITICAL_ERROR, 'Error Getting Adr Users!');
 }
 $weight = $db->sql_fetchrow($result);
 if ($weight['total'] != '') {
     $current_weight = $weight['total'];
 } else {
     $current_weight = 0;
 }
 //changed from max_hp to max_xp
 $max_xp = $row['class_update_xp_req'];
 for ($p = 1; $p < $row['character_level']; $p++) {
     $max_xp = floor($max_xp * (($adr_general['next_level_penalty'] + 100) / 100));
 }
 ##=== Create bar widths ===##
 list($hp_percent_width, $hp_percent_empty) = adr_make_bars($row['character_hp'], $row['character_hp_max'], '318');
 list($mp_percent_width, $mp_percent_empty) = adr_make_bars($row['character_mp'], $row['character_mp_max'], '318');
 list($exp_percent_width, $exp_percent_empty) = adr_make_bars($row['character_xp'], $max_xp, '318');
 list($weight_percent_width, $weight_percent_empty) = adr_make_bars($current_weight, $max_weight, '318');
 ##=== Create bar widths ===##
 $template->assign_vars(array('LEVEL' => $row['character_level'], 'POWER' => $row['character_might'], 'AGILITY' => $row['character_dexterity'], 'CONSTIT' => $row['character_constitution'], 'INT' => $row['character_intelligence'], 'WIS' => $row['character_wisdom'], 'CHA' => $row['character_charisma'], 'POINTS' => number_format($view_userdata['user_points']), 'HP' => $row['character_hp'], 'MP' => $row['character_mp'], 'EXP' => $row['character_xp'], 'HP_MAX' => $row['character_hp_max'], 'MP_MAX' => $row['character_mp_max'], 'SP' => number_format($row['character_sp']), 'EXP_MAX' => $max_xp, 'WEIGHT' => $current_weight, 'WEIGHT_MAX' => $max_weight, 'WEIGHT_PERCENT_WIDTH' => $weight_percent_width, 'BATTLE_VICTORIES' => number_format($row['character_victories']), 'BATTLE_DEFEATS' => number_format($row['character_defeats']), 'BATTLE_FLEES' => number_format($row['character_flees']), 'BATTLE_VICTORIES_PVP' => number_format($row['character_victories_pvp']), 'BATTLE_DEFEATS_PVP' => number_format($row['character_defeats_pvp']), 'BATTLE_FLEES_PVP' => number_format($row['character_flees_pvp']), 'BATTLE_LIMIT' => $row['character_battle_limit'] . '/' . $adr_general['Adr_character_battle_limit'], 'SKILL_LIMIT' => $row['character_skill_limit'] . '/' . $adr_general['Adr_character_skill_limit'], 'TRADING_LIMIT' => $row['character_trading_limit'] . '/' . $adr_general['Adr_character_trading_limit'], 'THIEF_LIMIT' => $row['character_thief_limit'] . '/' . $adr_general['Adr_character_thief_limit'], 'QUOTA_TIMER' => adr_character_replenish_timer($user_id), 'FP' => number_format($row['character_fp']), 'AC' => $row['character_ac'], 'NAME' => $row['character_name'], 'BIO' => str_replace("\n", "\n<br />\n", $row['character_desc']), 'AVATAR_IMG' => $avatar_img, 'CLASS' => $class, 'RACE' => $race, 'ELEMENT' => $element, 'ALIGNMENT' => $alignment, 'CLASS_IMG' => $row['class_img'], 'RACE_IMG' => $row['race_img'], 'ELEMENT_IMG' => $row['element_img'], 'ALIGNMENT_IMG' => $row['alignment_img'], 'HP_PERCENT_WIDTH' => $hp_percent_width, 'MP_PERCENT_WIDTH' => $mp_percent_width, 'EXP_PERCENT_WIDTH' => $exp_percent_width, 'SWORD' => $row['character_skill_sword_uses'], 'DIRK' => $row['character_skill_dirk_uses'], 'RANGED' => $row['character_skill_ranged_uses'], 'MAGIC' => $row['character_skill_magic_uses'], 'MACE' => $row['character_skill_mace_uses'], 'FIST' => $row['character_skill_fist_uses'], 'STAFF' => $row['character_skill_staff_uses'], 'SPEAR' => $row['character_skill_spear_uses'], 'AXE' => $row['character_skill_axe_uses'], 'SWORD_MAX' => $row['character_skill_sword_level'] * 500, 'DIRK_MAX' => $row['character_skill_dirk_level'] * 500, 'RANGED_MAX' => $row['character_skill_ranged_level'] * 500, 'MAGIC_MAX' => $row['character_skill_magic_level'] * 500, 'MACE_MAX' => $row['character_skill_mace_level'] * 500, 'FIST_MAX' => $row['character_skill_fist_level'] * 500, 'STAFF_MAX' => $row['character_skill_staff_level'] * 500, 'SPEAR_MAX' => $row['character_skill_spear_level'] * 500, 'AXE_MAX' => $row['character_skill_axe_level'] * 500, 'SWORD_LEVEL' => $row['character_skill_sword_level'], 'DIRK_LEVEL' => $row['character_skill_dirk_level'], 'RANGED_LEVEL' => $row['character_skill_ranged_level'], 'MAGIC_LEVEL' => $row['character_skill_magic_level'], 'MACE_LEVEL' => $row['character_skill_mace_level'], 'FIST_LEVEL' => $row['character_skill_fist_level'], 'STAFF_LEVEL' => $row['character_skill_staff_level'], 'SPEAR_LEVEL' => $row['character_skill_spear_level'], 'AXE_LEVEL' => $row['character_skill_axe_level'], 'CHAR_YEAR' => $age = adr_character_age($user_id, '0'), 'HP_PERCENT_EMPTY' => $hp_percent_empty, 'MP_PERCENT_EMPTY' => $mp_percent_empty, 'EXP_PERCENT_EMPTY' => $exp_percent_empty, 'WEIGHT_PERCENT_EMPTY' => $weight_percent_empty, 'L_YEAR' => $lang['year'], 'L_MONTH' => $lang['month'], 'L_WEEK' => $lang['week'], 'L_DAY' => $lang['day'], 'L_HOUR' => $lang['hour'], 'L_AGE' => $age, 'L_CHARACTER_AGE' => 'Age', 'L_MA' => $lang['Adr_character_ma'], 'L_MD' => $lang['Adr_character_md'], 'L_BIO' => $lang['Adr_character_new_bio'], 'L_CLASS' => $lang['Adr_character_class'], 'L_RACE' => $lang['Adr_character_race'], 'L_SWORD' => $lang['Adr_items_type_weapon'], 'L_SPECIAL' => $lang['Adr_items_type_enchanted_weapon'], 'L_DIRK' => $lang['Adr_items_type_dirk'], 'L_STAFF' => $lang['Adr_items_type_staff'], 'L_MACE' => $lang['Adr_items_type_mace'], 'L_RANGED' => $lang['Adr_items_type_ranged'], 'L_FIST' => $lang['Adr_items_type_fist'], 'L_AXE' => $lang['Adr_items_type_axe'], 'L_SPEAR' => $lang['Adr_items_type_spear'], 'L_ELEMENT' => $lang['Adr_character_element'], 'L_ALIGNMENT' => $lang['Adr_character_alignment'], 'L_HEALTH' => $lang['Adr_character_health'], 'L_MAGIC' => $lang['Adr_character_magic'], 'L_EXPERIENCE' => $lang['Adr_character_experience'], 'L_SP' => $lang['Adr_character_sp'], 'L_WEIGHT' => $lang['Adr_character_weight'], 'L_AC' => $lang['Adr_character_ac'], 'L_POWER' => $lang['Adr_character_power'], 'L_AGILITY' => $lang['Adr_character_agility'], 'L_CONSTIT' => $lang['Adr_character_endurance'], 'L_INT' => $lang['Adr_character_intelligence'], 'L_WIS' => $lang['Adr_character_willpower'], 'L_CHA' => $lang['Adr_character_charm'], 'L_POINTS' => get_reward_name(), 'L_BATTLE_STATISTICS' => $lang['Adr_character_battle_statistics'], 'L_BATTLE_VICTORIES' => $lang['Adr_character_victories'], 'L_BATTLE_DEFEATS' => $lang['Adr_character_defeats'], 'L_BATTLE_SKILLS' => $lang['Adr_character_battle_skills'], 'L_BATTLE_LIMIT' => $lang['Adr_character_battle_limit'], 'L_SKILL_LIMIT' => $lang['Adr_character_skill_limit'], 'L_TRADING_LIMIT' => $lang['Adr_character_trading_limit'], 'L_THIEF_LIMIT' => $lang['Adr_character_thief_limit'], 'L_BATTLE_FLEES' => $lang['Adr_character_flees'], 'L_QUOTA_TIMER' => $lang['Adr_character_quota_timer'], 'L_FP' => $lang['Adr_character_fp'], 'L_STATS_MONSTER' => $lang['Adr_character_stats_monster'], 'L_STATS_PVP' => $lang['Adr_character_stats_pvp'], 'L_BATTLE_SEE_MONSTERS' => $lang['Adr_character_battle_history_monsters'], 'L_BATTLE_SEE_PLAYERS' => $lang['Adr_character_battle_history_players'], 'L_CHARACTER_LEVEL_UP' => $lang['Adr_level_up'], 'L_CHARACTER_LEVEL_UP_SELECT' => $lang['Adr_level_up_select'], 'L_LEVEL_UP' => $lang['Adr_level_up_perform'], 'L_DELETE_CHARACTER' => $lang['Adr_character_delete'], 'L_EDIT_CHARACTER' => $lang['Adr_character_edit']));
コード例 #14
0
ファイル: adr_courthouse.php プロジェクト: Nekrofage/FJR
        }
        if ($row = $db->sql_fetchrow($result)) {
            $i = 0;
            do {
                if ($i == '0') {
                    $template->assign_block_vars('cell_user', array());
                }
                $username = $row['username'];
                $cuser_id = $row['user_id'];
                $profile_img = '<img src="' . $images['icon_profile'] . '" alt="' . $lang['Read_profile'] . '" title="' . $lang['Read_profile'] . '" border="0" />';
                $judgement_img = '<img src="adr/images/misc/icon_justice.gif" alt="' . $lang['Adr_cell_judge_user'] . '" title="' . $lang['Adr_cell_judge_user'] . '" border="0" />';
                $row_color = !($i % 2) ? $theme['td_color1'] : $theme['td_color2'];
                $row_class = !($i % 2) ? $theme['td_class1'] : $theme['td_class2'];
                $template->assign_block_vars('cell_user.cell_users', array('ROW_CLASS' => $row_class, 'CELLED_ID' => $cuser_id, 'USERNAME' => $username, 'TIME' => adr_make_time($row['user_cell_time']), 'SLEDGE' => $row['user_cell_caution'], 'PROFILE_IMG' => $profile_img, 'JUDGEMENT_IMG' => $judgement_img, 'PUNISHMENT' => $punishment[$row['user_cell_punishment']], 'U_JUDGEMENT' => append_sid("adr_courthouse.{$phpEx}?celled_user_id={$cuser_id}"), 'U_VIEWPROFILE' => append_sid("profile.{$phpEx}?mode=viewprofile&amp;" . POST_USERS_URL . "={$cuser_id}")));
                $i++;
            } while ($row = $db->sql_fetchrow($result));
        } else {
            $template->assign_block_vars('cell_no_users', array());
        }
        $sql = "SELECT count(*) AS total FROM " . USERS_TABLE . "\r\t\tWHERE user_cell_time > 0 ";
        if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
        }
        if ($total = $db->sql_fetchrow($result)) {
            $total_members = $total['total'];
            $pagination = generate_pagination("adr_courthouse.{$phpEx}?from=list&amp;mode={$mode}&amp;order={$sort_order}", $total_members, $board_config['topics_per_page'], $start) . '&nbsp;';
        }
        $template->assign_vars(array('L_SELECT_SORT_METHOD' => $lang['Select_sort_method'], 'S_MODE_SELECT' => $select_sort_mode, 'S_ORDER_SELECT' => $select_sort_order, 'PAGINATION' => $pagination, 'PAGE_NUMBER' => sprintf($lang['Page_of'], floor($start / $board_config['topics_per_page']) + 1, ceil($total_members / $board_config['topics_per_page'])), 'L_GOTO_PAGE' => $lang['Goto_page']));
        break;
}
$template->assign_vars(array('POINTS' => $userdata['user_points'], 'L_NO_CELLED' => $lang['Adr_cell_judgement_none'], 'L_CAUTION_NOT_AUTHED' => $lang['Adr_cell_caution_not_authed'], 'L_JUDGE_NOT_AUTHED' => $lang['Adr_cell_judgement_not_authed'], 'L_JUDGE_EVER' => $lang['Adr_cell_judgement_ever'], 'L_JUDGEMENT_EXPLAIN' => $lang['Adr_cell_judgement_explain'], 'L_JUDGEMENT_NO' => $lang['Adr_cell_judgement_guilty'], 'L_JUDGEMENT_YES' => $lang['Adr_cell_judgement_innocent'], 'L_JUDGE_AUTHED_EVER' => $lang['Adr_cell_judgement_ever_authed'], 'L_NEVER_CELLED' => $lang['Adr_cell_judgement_never'], 'L_CELLED_TIMES' => $lang['Adr_cell_imprisonments'], 'L_SUBMIT' => $lang['Submit'], 'L_PUNISHMENT' => $lang['Adr_cell_punishment'], 'L_POINTS' => get_reward_name(), 'L_SLEDGE' => $lang['Adr_cell_admin_celled_caution'], 'L_USERNAME' => $lang['Username'], 'L_IMPRISONED_TIME' => $lang['Adr_cell_celled_time'], 'L_IMPRISONED_DATE' => $lang['Adr_cell_celled_date'], 'L_FREED_BY' => $lang['Adr_cell_freed_type'], 'L_JUDGEMENT' => $lang['Adr_cell_judgement'], 'L_COURTHOUSE' => $lang['Adr_courthouse_page_name'], 'L_CELLED_LIST' => $lang['Adr_cell_celled_list'], 'L_TOWNBOUTONRETOUR' => $lang['Adr_TownMap_Bouton_Retour'], 'L_TOWNMAPCOPYRIGHT' => $lang['TownMap_Copyright'], 'L_COPYRIGHT' => $lang['Adr_copyright'], 'U_COPYRIGHT' => append_sid("adr_copyright.{$phpEx}"), 'U_TOWNMAPCOPYRIGHT' => append_sid("TownMap_Copyright.{$phpEx}"), 'U_TOWNBOUTONRETOUR' => append_sid("adr_TownMap.{$phpEx}"), 'U_COURTHOUSE' => append_sid("adr_courthouse.{$phpEx}"), 'S_COURTHOUSE_ACTION' => append_sid("adr_courthouse.{$phpEx}")));
コード例 #15
0
ファイル: adr_battle.php プロジェクト: ZerGabriel/adr-rpg
     $sql_update_hp = $challenger['character_hp'] < '1' ? 'character_hp = 1' : '';
     $sql = " UPDATE  " . ADR_CHARACTERS_TABLE . " \n\t\t\tSET character_xp = character_xp + {$exp} ,\n\t\t\t\tcharacter_victories = character_victories + 1 ,\n\t\t\t\t{$sql_update_hp}\n\t\t\t\tcharacter_sp = character_sp + '" . $bat['battle_opponent_sp'] . "'\n\t\t\tWHERE character_id = {$user_id} ";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not update character', '', __LINE__, __FILE__, $sql);
     }
     // Remove item stolen status
     $sql = "UPDATE " . ADR_SHOPS_ITEMS_TABLE . "\n\t\t\tSET item_monster_thief = 0 \n\t\t\tWHERE item_owner_id = {$user_id} ";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not update stolen item status', '', __LINE__, __FILE__, $sql);
     }
     // Delete broken items from users inventory
     $sql = " DELETE FROM " . ADR_SHOPS_ITEMS_TABLE . "\n\t\t\tWHERE item_duration < 1 \n\t\t\tAND item_owner_id = {$user_id} ";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not delete broken items', '', __LINE__, __FILE__, $sql);
     }
     $message = sprintf($lang['Adr_battle_won'], $bat['battle_challenger_dmg'], $exp, $bat['battle_opponent_sp'], $reward, get_reward_name());
     if ($stolen['item_name'] != '') {
         $message .= '<br />' . sprintf($lang['Adr_battle_stolen_items'], $monster['monster_name']);
     }
     $message .= '<br /><br />' . sprintf($lang['Adr_battle_return'], "<a href=\"" . 'adr_battle.' . $phpEx . "\">", "</a>");
     $message .= '<br /><br />' . sprintf($lang['Adr_character_return'], "<a href=\"" . 'adr_character.' . $phpEx . "\">", "</a>");
     message_die(GENERAL_MESSAGE, $message);
 }
 if ($challenger_hp < 1 && $opponent_hp > 0) {
     // The character is dead , update the database
     $sql = " UPDATE  " . ADR_BATTLE_LIST_TABLE . " \n\t\t\tSET battle_result = 2,\n\t\t\t\tbattle_finish = " . time() . ",\n\t\t\t\tbattle_text = ''\n\t\t\tWHERE battle_challenger_id = {$user_id}\n\t\t\tAND battle_result = 0\n\t\t\tAND battle_type = 1 ";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not update battle list', '', __LINE__, __FILE__, $sql);
     }
     $sql = " UPDATE  " . ADR_CHARACTERS_TABLE . " \n\t\t\tSET character_hp = 0 ,\n\t\t\t    character_defeats = character_defeats + 1\n\t\t\tWHERE character_id = {$user_id} ";
     if (!($result = $db->sql_query($sql))) {
コード例 #16
0
ファイル: adr_research.php プロジェクト: Nekrofage/FJR
                        // Check to see if you already know this information
                        if ($row_learn == '') {
                            $sql_learn = "INSERT INTO " . ADR_LIBRARY_LEARN_TABLE . "\r\n\t\t\t\t\t\t\t(user_id, book_id, book_name, book_details)\r\n\t\t\t\t\t\t\tVALUES ({$user_id}, " . $rand_library['book_id'] . ", '" . $rand_library['book_name'] . "', '" . $rand_library['book_details'] . "')";
                            if (!($result_learn = $db->sql_query($sql_learn))) {
                                message_die(GENERAL_ERROR, "Couldn't insert learned information", "", __LINE__, __FILE__, $sql_learn);
                            }
                        } else {
                            $sql_learn = "UPDATE " . ADR_LIBRARY_LEARN_TABLE . "\r\n\t\t\t\t\t\t\t\tSET book_name = '" . $rand_library['book_name'] . "',\r\n\t\t\t\t\t\t\t\t\tbook_details = '" . $rand_library['book_details'] . "'\r\n\t\t\t\t\t\t\t\tWHERE user_id = {$user_id}\r\n\t\t\t\t\t\t\t\tAND book_id = " . $rand_library['book_id'];
                            if (!($result_learn = $db->sql_query($sql_learn))) {
                                message_die(GENERAL_ERROR, "Couldn't insert learned information", "", __LINE__, __FILE__, $sql_learn);
                            }
                        }
                    }
                }
                $direction = append_sid("adr_research.{$phpEx}");
                $message = $lang['Adr_library_success_top'];
                $message .= '<b>' . $book_name . '</b><br /><br /><div align="center">' . $book_details . '</div>';
                $message .= $lang['Adr_library_success_bottom'];
                $message .= sprintf($lang['Adr_return'], "<a href=\"" . $direction . "\">", "</a>");
                message_die(GENERAL_MESSAGE, $message);
            }
            break;
    }
} else {
    $template->assign_block_vars('research', array());
    $template->assign_vars(array('L_PERFORM_RESEARCH' => $lang['Adr_library_perform_research'], 'L_RESEARCH_EXPLAIN' => $lang['Adr_library_explain']));
}
$template->assign_vars(array('L_RESEARCH_TITLE' => $lang['Adr_library_title'], 'L_RESEARCH' => $lang['Adr_library_main'], 'L_RESEARCH_GO_TO' => $lang['Adr_library_go_to'], 'L_RESEARCH_EXPLAIN' => $lang['Adr_library_area_explain'], 'L_RESEARCH_HELPER' => $lang['Adr_library_helper'], 'L_RESEARCH_KEEP' => $lang['Adr_library_keep_info'], 'L_POINTS' => get_reward_name(), 'POINTS' => $points, 'U_RESEARCH' => append_sid("adr_research.{$phpEx}"), 'S_FORGE_ACTION' => append_sid("adr_research.{$phpEx}")));
include $phpbb_root_path . 'adr/includes/adr_header.' . $phpEx;
$template->pparse('body');
include $phpbb_root_path . 'includes/page_tail.' . $phpEx;