$item_price = $adr_type_price; // Then apply the quality modifier $item_price = $item_price * ($adr_quality_price / 100); // And now the power - it's a little more complicated $item_price = $item_power > 1 ? $item_price + $item_price * (($item_power - 1) * ($adr_general['item_modifier_power'] - 100) / 100) : $item_price; // Apply the duration penalty $item_price = abs($item_price / ($item_duration_max / $item_duration)); // Finally let's use a non decimal value & add 10 % $item_price = ceil($item_price * 1.1); } // START RESTRICTION CHECKS // Make new restriction arrays $recipe_newalignlist = adr_admin_make_array($recipe_alignment_enable, $recipe_alignment); $recipe_newclasslist = adr_admin_make_array($recipe_class_enable, $recipe_class); $recipe_newracelist = adr_admin_make_array($recipe_race_enable, $recipe_race); $recipe_newelementlist = adr_admin_make_array($recipe_element_enable, $recipe_element); // Make sure admin chose one or more options if enabled if ($recipe_alignment_enable == '1' && count($recipe_alignment) < '1') { message_die(MESSAGE, $lang['Adr_admin_store_alignment_error']); } if ($recipe_class_enable == '1' && count($recipe_class) < '1') { message_die(MESSAGE, $lang['Adr_admin_store_class_error']); } if ($recipe_race_enable == '1' && count($recipe_race) < '1') { message_die(MESSAGE, $lang['Adr_admin_store_race_error']); } if ($recipe_element_enable == '1' && count($recipe_element) < '1') { message_die(MESSAGE, $lang['Adr_admin_store_element_error']); } // END RESTRICTION CHECKS if ($recipe_price == '') {
$alignment = isset($HTTP_POST_VARS['align_type_list']) ? $HTTP_POST_VARS['align_type_list'] : array(); $race_enable = intval($HTTP_POST_VARS['race_enable']); $race = isset($HTTP_POST_VARS['race_type_list']) ? $HTTP_POST_VARS['race_type_list'] : array(); $element_enable = intval($HTTP_POST_VARS['element_enable']); $element = isset($HTTP_POST_VARS['element_type_list']) ? $HTTP_POST_VARS['element_type_list'] : array(); ##=== START: Prevent 0% element effects if ($item_element == '0') { $item_element_str = intval(100); $item_element_same = intval(100); $item_element_weak = intval(100); } ##=== END: Prevent 0% element effects $item_zone = intval($HTTP_POST_VARS['zone']); //Find zone name $sql = "SELECT * FROM " . ADR_ZONES_TABLE . "\r\t\t\t\t\tWHERE zone_id = '{$item_zone}' "; $result = $db->sql_query($sql); if (!$result) { message_die(GENERAL_ERROR, 'Could not obtain elements information', "", __LINE__, __FILE__, $sql); } $zone_data = $db->sql_fetchrow($result); $name_data = $zone_data['zone_name']; if ($item_name == '' || !$item_power || !$item_duration) { message_die(MESSAGE, $lang['Fields_empty']); } // START RESTRICTION CHECKS // Make new restriction arrays $newalignlist = adr_admin_make_array($alignment_enable, $alignment); $newclasslist = adr_admin_make_array($class_enable, $class); $newracelist = adr_admin_make_array($race_enable, $race); $newelementlist = adr_admin_make_array($element_enable, $element); // Make sure admin chose one or more options if enabled
$item_element_str = intval($_POST['item_element_str']); $item_element_same = intval($_POST['item_element_same']); $item_element_weak = intval($_POST['item_element_weak']); $item_max_skill = intval($_POST['item_max_skill']); $item_class = isset($_POST['item_class_limit']) ? $_POST['item_class_limit'] : array(); $item_class_limit = adr_admin_make_array('1', $item_class); $item_auth = intval($_POST['item_auth']); $item_linked_item = intval($_POST['spell_recipe']); $item_battle = intval($_POST['battle_list']); $item_xtreme = isset($_POST['spell_xtreme']) ? trim($_POST['spell_xtreme']) : trim($_GET['spell_xtreme']); $item_xtreme_battle = isset($_POST['spell_xtreme_battle']) ? trim($_POST['spell_xtreme_battle']) : trim($_GET['spell_xtreme_battle']); $item_xtreme_pvp = isset($_POST['spell_xtreme_pvp']) ? trim($_POST['spell_xtreme_pvp']) : trim($_GET['spell_xtreme_pvp']); $item_alignment = isset($_POST['item_alignment_limit']) ? $_POST['item_alignment_limit'] : array(); $item_alignment_limit = adr_admin_make_array('1', $item_alignment); $item_element_restrict = isset($_POST['element_restrict_list']) ? $_POST['element_restrict_list'] : array(); $item_element_restrict_limit = adr_admin_make_array('1', $item_element_restrict); ##=== START: Prevent 0% element effects if ($item_element == '0') { $item_element_str = intval(100); $item_element_same = intval(100); $item_element_weak = intval(100); } ##=== END: Prevent 0% element effects //spell_items_req $recipe_items_req_list = array(); $recipe_items_req_list = $_POST['recipe_items_req']; $recipe_items_amount_list = array(); $recipe_items_amount_list = explode(':', $_POST['recipe_items_amount']); $selected_req_item = count($recipe_items_req_list); if ($selected_req_item == 0) { $final_req_list = '';