$battle_message .= '<span class="gensmall">'; // set new span class $battle_message .= ' > ' . sprintf($lang['Adr_pvp_potion_hp_dura'], $current_name, adr_get_lang($item['item_name'])) . '<br />'; $battle_message .= '</span>'; // reset span class to default } // Update the database $check_mp = $user_id === $battle_challenger_id ? 'battle_challenger_mp' : 'battle_opponent_mp'; $sql = "UPDATE " . ADR_BATTLE_PVP_TABLE . "\r\n \t\t\t\tSET {$check_mp} = ({$check_mp} + {$power})\r\n \t\t\t\tWHERE battle_id = '{$battle_id}'"; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Could not update battle', '', __LINE__, __FILE__, $sql); } } else { if ($item['item_type_use'] == 19) { include_once $phpbb_root_path . '/adr/includes/adr_functions_battle_setup.' . $phpEx; $e_message = adr_battle_effects_initialise($user_id, $item_potion, $opponent_infos['character_name'], 1); // Use item adr_use_item($item_potion, $user_id); $battle_message .= $e_message; // Check for low dura if ($item['item_duration'] < '2') { $battle_message .= '<span class="gensmall">'; // set new span class $battle_message .= ' > ' . sprintf($lang['Adr_pvp_potion_hp_dura'], $current_name, adr_get_lang($item['item_name'])) . '<br />'; $battle_message .= '</span>'; // reset span class to default } } } // end us 19 } else {
function adr_potion_generic() { global $monster, $bat, $adr_user, $opponent_element, $item, $db, $lang, $user_id, $power; global $challenger, $battle_message, $user_action, $monster_action, $attack_img, $attackwith_overlay; rabbit_pet_regen(); include_once $phpbb_root_path . '/adr/includes/adr_functions_battle_setup.' . $phpEx; $e_message = adr_battle_effects_initialise($user_id, $item_potion, $monster['monster_name'], 0); // Use item adr_use_item($item_potion, $user_id); $battle_message .= $e_message; // low dura message if ($item['item_duration'] < '2' && $power > '0') { $battle_message .= '</span><span class="gensmall">'; // set new span class $battle_message .= ' > ' . sprintf($lang['Adr_battle_potion_mp_dura_none'], $challenger['character_name'], adr_get_lang($item['item_name']), adr_get_lang($item['item_name'])) . '<br>'; $battle_message .= '</span><span class="genmed">'; // reset span class to default } //($item['item_duration'] < '2') && ($power > '0') // Update the database $sql = "UPDATE " . ADR_BATTLE_LIST_TABLE . "\n\t\tSET battle_turn = 2,\n\t\t\tbattle_round = (battle_round + 1)\n\t\tWHERE battle_challenger_id = '{$user_id}'\n\t\tAND battle_result = '0'\n\t\tAND battle_type = '1'"; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Could not update battle', '', __LINE__, __FILE__, $sql); } //!($result = $db->sql_query($sql)) // Let's sort out the potion (mp) animations... // Make table for start battle sequence... // 0 = Standing image , 1 = Attack image $user_action = 0; $monster_action = 1; $attack_img = $item['item_name']; $attackwith_overlay = file_exists("adr/images/battle/spells/" . $attack_img . ".gif") ? '<img src="adr/images/battle/spells/' . $attack_img . '.gif" width="256" height="96" border="0">' : ''; }
if ($adr_general['Adr_character_limit_enable'] == '1') { adr_battle_quota_check($user_id); } // Fix the items ids $armor = intval($HTTP_POST_VARS['item_armor']); $buckler = intval($HTTP_POST_VARS['item_buckler']); $helm = intval($HTTP_POST_VARS['item_helm']); $greave = intval($HTTP_POST_VARS['item_greave']); $boot = intval($HTTP_POST_VARS['item_boot']); $gloves = intval($HTTP_POST_VARS['item_gloves']); $amulet = intval($HTTP_POST_VARS['item_amulet']); $ring = intval($HTTP_POST_VARS['item_ring']); // Battle start infos gone into adr_functions_battle_setup.php include_once $phpbb_root_path . '/adr/includes/adr_functions_battle_setup.' . $phpEx; adr_battle_equip_initialise($user_id, $armor, $buckler, $helm, $gloves, $amulet, $ring, $greave, $boot); adr_battle_effects_initialise($user_id, 0, '', 0); // V: auto-call pet $sql = "UPDATE " . RABBITOSHI_USERS_TABLE . "\r\n\tSET creature_invoc = 1\r\n\tWHERE owner_id = {$user_id} "; if (!$db->sql_query($sql)) { message_die(GENERAL_ERROR, '', __LINE__, __FILE__, $usql); } //!$db->sql_query($sql) // Update battle limit for user $sql = "UPDATE " . ADR_CHARACTERS_TABLE . "\r\n\t\tSET character_battle_limit = character_battle_limit - 1 \r\n\t\t\tWHERE character_id = {$user_id} "; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Could not update battle limit', '', __LINE__, __FILE__, $sql); } //!($result = $db->sql_query($sql)) } } //!(is_numeric($bat['battle_id'])) && $equip