function mage_power_growth($userid) { include_once "inc/functions/get.php"; $kingdom = get_kingdom_nonarray($userid); // Science $alliance_size = get_alliance_size($kingdom) * 80; $science_update_bonus = get_science_update_bonus($kingdom); $prod['science_offence_bonus'] = round(1.98 * $science_update_bonus['offence_bonus'] / ($alliance_size + $science_update_bonus['offence_bonus']), 3); if ($prod['science_offence_bonus'] > 1) { $prod['science_offence_bonus'] = 1; } $build = mysql_query("SELECT guilds,land FROM build WHERE id = '{$userid}' "); $build = mysql_fetch_array($build); // Martel: Standard mana regrowth is 1/8 + 1mp per update $growth = $build['guilds'] * (1 / 8) + 1; $race = get_race($userid); if ($race == "Eagle") { $growth = $build['guilds'] * (1 / 6) + 1; } elseif ($race == "Dark Elf") { $growth *= 1.35; } // elseif($race == "Wood Elf") // { // $growth *= 0.8; // } $growth = $growth * (1 + $build["guilds"] / (2 * $build["land"])); $growth = round($growth * ($prod['science_offence_bonus'] / 2 + 1)); return $growth; }
function weapon_bonus($id) { global $build, $weapon_bonus; include_once "inc/functions/get.php"; $result = mysql_query("SELECT weaponries,land from build where id ='{$id}' ") or die(mysql_error()); $build = mysql_fetch_array($result); $weapon_bonus = $build['weaponries'] / $build['land']; if ($weapon_bonus > 0.2) { $weapon_bonus = 0.2; } // damamdoo : implemeting dwarf thingie $race = get_race($id); if ($race == 'Dwarf') { $weapon_bonus = $weapon_bonus * 1.35; } }
function char($serial) { if (!is_numeric($serial)) { redirect('main'); } if (!secure_serial_check($serial)) { redirect('#warn'); } // заголовок страницы $this->data['title'] = lang('off_title_info'); // узнаЄм имена баз $world = get_world(); $query = $this->MSSQL->query("\n SELECT *\n FROM {$world}.dbo.tbl_base, {$world}.dbo.tbl_general\n WHERE {$world}.dbo.tbl_base.Account = '" . get_login() . "'\n AND {$world}.dbo.tbl_base.Serial={$serial}\n AND {$world}.dbo.tbl_base.Serial={$world}.dbo.tbl_general.Serial"); $this->table->set_template(tpl_table()); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { if ($row->DCK == 0) { $this->table->add_row(b(lang('off_char_name')), preg_name($row->Name)); } $name = preg_name($row->Name); if ($row->DCK == 1) { $this->table->add_row(b(lang('off_char_name')), icon('24x24/delete_user.png') . preg_name($row->DeleteName)); } $this->table->add_row(b(lang('off_char_race')), get_race($row->Race)); $this->table->add_row(b(lang('off_char_totalp')), get_total_min($row->TotalPlayMin)); $this->table->add_row(b(lang('off_char_guild')), get_guild($row->GuildSerial)); $this->table->add_row(b(lang('off_char_pvp')), round($row->PvpPoint)); $this->table->add_row(b(lang('off_char_class')), get_rfclass($row->Class)); $this->table->add_row(b(lang('off_char_level')), $row->Lv); $this->table->add_row(b(lang('off_char_money')), $row->Dalant); $this->table->add_row(b(lang('off_char_gold')), $row->Gold); $this->table->add_row(b(lang('off_char_create')), $row->CreateTime); if (is_online($row->Serial) == true) { $stat = icon('32x32/globe.png') . b(lang('off_char_online')); } else { $stat = icon('32x32/globe_warning.png') . b(lang('off_char_offline')); } $this->table->add_row(b(lang('off_acc_stat')), $stat); } $this->data['content'] = icon('64x64/user.png') . $this->table->generate() . ItemsInChar($name); } else { $this->data['content'] = icon('32x32/red_button.png') . lang('off_error'); } compile(); }
show_error("ln_members_e_2", $modul_name); } } else { show_error("ln_members_e_1", $modul_name); } } header("LOCATION: members.php?action=edituserdata"); exit; } if ($action == "save_race") { $rassenid = intval($_GET['race_id']); if ($rassenid == 0) { show_error("L_NO_RACE_SELECT", $modul_name); exit; } $race_name = trim(get_race($rassenid)); if ($race_name == "") { show_error("L_NO_RACE_SELECT", $modul_name); } if (intval($userdata['rassenid']) > 0) { show_error("L_RACE_OK", $modul_name); } $db->query("UPDATE cc" . $n . "_users SET rassenid='" . $rassenid . "' WHERE userid='" . $userdata['userid'] . "'"); $db->query("UPDATE cc" . $n . "_countries SET race='" . $rassenid . "' WHERE userid='" . $userdata['userid'] . "'"); header("LOCATION: members.php"); exit; } if ($action == "land_change") { $i = intval($_GET['i']); $result = $db->query("SELECT islandid,userid FROM cc" . $n . "_countries WHERE islandid='{$i}'"); $islanddata = $db->fetch_array($result);