function call_suspension_text() { global $tool; include_once 'inc/functions/resort_tools.php'; if (!user_has_access($tool)) { echo "Sorry, this page is restricted to ORKFiA Staff"; include_game_down(); exit; } echo $strHeader = '<h2>L&O: Player Suspension (aka Forced Vacation Mode)</h2>'; echo $strForm = '<form method="post" action="' . $_SERVER['REQUEST_URI'] . '">' . 'User-id: ' . '<input type="text" size="11" name="suspend_id">' . '<br />' . 'Updates: ' . '<select name="suspend_updates">' . '<option>12</option>' . '<option>24</option>' . '<option selected>48</option>' . '</select>' . '<br /><br />' . '<input type="submit" value="Suspend Tribe!">' . '</form>' . '<br /><br />'; if (isset($_POST['suspend_id']) && $_POST['suspend_id'] > 1) { include_once 'inc/classes/clsUser.php'; $objTmpUser = new clsUser($_POST['suspend_id']); // Pause Account Routines. Martel July 13, 2006 $arrSrcUser = $objTmpUser->get_user_infos(); if ($arrSrcUser[NEXT_ATTACK] <= 1) { $arrSrcUser[NEXT_ATTACK] = 1; } $arrNewSrcUser = array(NEXT_ATTACK => $arrSrcUser[NEXT_ATTACK], PAUSE_ACCOUNT => $_POST['suspend_updates']); $objTmpUser->set_user_infos($arrNewSrcUser); // Empty Magic and Thievery Points $objTmpUser->set_spell(POWER, 0); $objTmpUser->set_thievery(CREDITS, 0); // Forced Ranking Update include_once 'inc/functions/update_ranking.php'; doUpdateRankings($objTmpUser, 'yes'); echo stripslashes($objTmpUser->get_stat(TRIBE)) . " will be paused for " . $_POST['suspend_updates'] . " updates. Don't forget to send a notice."; echo '<div id="textSmall">' . '<p><b>' . 'Standard notice to copy+paste:' . '</b></p>' . '<p>' . 'Your account has been suspended by the Law & Order Resort (found in alliance #2), you will not recieve updates, or be able to interact with the game, this may be because of a Code of Conduct violation or for some other action. Usually a staff member will contact you, if they have not, it is highly advised that you contact them, especially if you are not guilty of what you have been suspended for.' . '</p>' . '</div>'; } }
function obj_test_for_kill(&$objTrgUser, &$objSrcUser) { global $ip; // Minimize multi-kills - Martel December 30, 2007 // #1 Query DB for kill status (Don't use cached data) #2 Check citz $strSQL = 'SELECT killed FROM stats WHERE id = ' . $objTrgUser->get_userid(); $arrRow = mysql_fetch_row(mysql_query($strSQL)); if ($arrRow[0] == 0 && $objTrgUser->get_pop(CITIZENS) <= 0) { // Separate a reset tribe from a killed (1=age, 2=pk) $objTrgUser->set_stat(KILLED, 2); // Show kill message $arrTrgStats = $objTrgUser->get_stats(); echo $strDiv = '<div id="textMedium">' . '<p>' . "Congratulations! You watch on as the last citizen of " . '<strong class="negative">' . stripslashes($arrTrgStats[TRIBE]) . ' (#' . $arrTrgStats[ALLIANCE] . ")</strong> dies and their empire crumbles in front of you." . '</p>' . '</div>' . '<br />'; // Update SrcUser with +1 Kill $arrSrcStats = $objSrcUser->get_stats(); $iKilled = $arrSrcStats[KILLS] + 1; $objSrcUser->set_stat(KILLS, $iKilled); // Record: Largest Kill require_once 'inc/classes/clsGame.php'; $objGame = new clsGame(); $arrRecords = $objGame->get_game_records(); $arrTrgBuilds = $objTrgUser->get_builds(); if ($arrTrgBuilds[LAND] > $arrRecords[KILLED]) { $arrRecords = array(KILLED => $arrTrgBuilds[LAND], KILLED_ID => $objSrcUser->get_userid()); $objGame->set_game_records($arrRecords); } // War effects require_once "inc/functions/war.php"; $objSrcAlliance = $objSrcUser->get_alliance(); if (checkWarBetween($objSrcAlliance, $arrTrgStats[ALLIANCE])) { $objTrgAlliance = $objTrgUser->get_alliance(); // Update land counter in new war system March 06, 2008 Martel $iNeeded = $objSrcAlliance->get_war('land_needed'); $objSrcAlliance->set_war('land_needed', max(0, $iNeeded - $arrTrgBuilds[LAND])); // Wait with adding this until it is 100% sure no multi kills exist // if (($arrGains = testWarVictory($objSrcAlliance, $objTrgAlliance))) // { // require_once('inc/pages/war_room2.inc.php'); // $strGains = getVictoryReport($arrGains); // // Show war-win message // echo $strDiv = // '<div id="textMedium">' . // '<p><strong class="positive">Your alliance have won the war!</strong></p>' . // $strGains . // '</div>' . // '<br />'; // } // Add war-kill to global news $strGlobalNews = '<strong class="negative">Alliance #' . $arrSrcStats[ALLIANCE] . " has laid the final blow in " . $arrTrgStats[TRIBE] . "\\'s ORKFiA career during their war.</strong>"; mysql_query("INSERT INTO news (id, time, ip, type, duser, ouser, " . "result, text, kingdom_text, kingdoma, kingdomb) " . "VALUES ('', NOW(), '---', 'global', 0, 0, 1, '', " . "'{$strGlobalNews}', 0, '')"); // War events if a killed tribe is in the biggest half of the alli $iLand = $arrTrgBuilds[LAND]; $arrRow1 = mysql_fetch_row(mysql_query("SELECT COUNT(id) FROM rankings_personal WHERE land > {$iLand} AND alli_id = " . $arrTrgStats[ALLIANCE])); $arrRow2 = mysql_fetch_row(mysql_query("SELECT COUNT(id) FROM rankings_personal WHERE alli_id = " . $arrTrgStats[ALLIANCE])); if ($arrRow1[0] * 2 < $arrRow2[0]) { require_once "inc/functions/update.php"; //============================================================== // Bonus for the killing alliance: MP+TP gain, army // moved 1 hours closer to home //============================================================== // Since we don't seem to want a max to the mps/tps here, // why not just add obj_mage_power_growth twice, same for // thieves ofc - AI 25/11/2006 //============================================================== $arrUserId = $objSrcAlliance->get_userids(); foreach ($arrUserId as $iUserid) { check_to_update($iUserid); $objTmpUser = new clsUser($iUserid); $build = $objTmpUser->get_builds(); // Bonus to Thievery Credits require_once "inc/functions/ops.php"; $bonus1 = 2 * obj_thief_op_growth($objTmpUser); $iNewCredits = $objTmpUser->get_thievery(CREDITS); $iNewCredits += $bonus1; // Bonus to Spell Power require_once "inc/functions/spells.php"; $bonus2 = 2 * obj_mage_power_growth($objTmpUser); $iNewPower = $objTmpUser->get_spell(POWER); $iNewPower += $bonus2; // Update User $objTmpUser->set_thievery(CREDITS, $iNewCredits); $objTmpUser->set_spell(POWER, $iNewPower); // Update Military Training 1x time (Mori thieves) $arrTmpStats = $objTmpUser->get_stats(); if ($arrTmpStats[RACE] == "Mori Hai") { $arrMercs = $objTmpUser->get_army_mercs(); $arrNewMercs = array(MERC_T0 => $arrMercs[MERC_T1], MERC_T1 => $arrMercs[MERC_T2], MERC_T2 => $arrMercs[MERC_T3], MERC_T3 => 0); $objTmpUser->set_army_mercs($arrNewMercs); } // Update Military Training 1x time (Everybody) $arrRets = $objTmpUser->get_milreturns(); $arrNewRets = array(UNIT1_T1 => $arrRets[UNIT1_T2], UNIT1_T2 => $arrRets[UNIT1_T3], UNIT1_T3 => $arrRets[UNIT1_T4], UNIT1_T4 => 0, UNIT2_T1 => $arrRets[UNIT2_T2], UNIT2_T2 => $arrRets[UNIT2_T3], UNIT2_T3 => $arrRets[UNIT2_T4], UNIT2_T4 => 0, UNIT3_T1 => $arrRets[UNIT3_T2], UNIT3_T2 => $arrRets[UNIT3_T3], UNIT3_T3 => $arrRets[UNIT3_T4], UNIT3_T4 => 0, UNIT4_T1 => $arrRets[UNIT4_T2], UNIT4_T2 => $arrRets[UNIT4_T3], UNIT4_T3 => $arrRets[UNIT4_T4], UNIT4_T4 => 0, UNIT5_T1 => $arrRets[UNIT5_T2], UNIT5_T2 => $arrRets[UNIT5_T3], UNIT5_T3 => $arrRets[UNIT5_T4], UNIT5_T4 => 0, UNIT6_T1 => $arrRets[UNIT6_T2], UNIT6_T2 => $arrRets[UNIT6_T3], UNIT6_T3 => $arrRets[UNIT6_T4], UNIT6_T4 => 0); $objTmpUser->set_milreturns($arrNewRets); // Update Tribe News $strNews = "The death of one of our enemies has given our " . "troops courage! Armies are returning more quickly, " . "thieves are more willing to risk their lives for the " . "tribe and your mage feels extra powerful."; mysql_query("INSERT INTO news (time, ip, type, duser, " . "ouser, result, text, kingdom_text) VALUES " . "(NOW(), '---', 'local_news', {$iUserid}, '', " . "1, '{$strNews}','')"); $objTmpUser->set_user_info(LAST_NEWS, 1); } // Defiance for the losing alliance, gives bonuses to off/tm-dmg $arrUserId = $objTrgAlliance->get_userids(); foreach ($arrUserId as $iUserid) { check_to_update($iUserid); $objTmpUser = new clsUser($iUserid); $objTmpUser->set_spell(DEFIANCE, 4); $strNews = "The death of one of our big tribes has filled the " . "hearts of our people with anger! For 4 more months " . "we will strike hard at our enemies!"; mysql_query("INSERT INTO news (time, ip, type, duser, " . "ouser, result, text, kingdom_text) VALUES " . "(NOW(), '---', 'local_news', {$iUserid}, '', " . "1, '{$strNews}','')"); $objTmpUser->set_user_info(LAST_NEWS, 1); } } //top half } //war // Create News $timestamp = date(TIMESTAMP_FORMAT); $d_news = '<strong class="negative">' . $arrSrcStats[TRIBE] . " (#" . $arrSrcStats[ALLIANCE] . ") has laid the final blow in " . $arrTrgStats[TRIBE] . "\\'s ORKFiA career.</strong>"; $o_news = '<strong class="positive">Our ' . $arrSrcStats[TRIBE] . " has laid the final blow in " . $arrTrgStats[TRIBE] . " (#" . $arrTrgStats[ALLIANCE] . ")\\'s ORKFiA career.</strong>"; $strNews = "I am sorry leader, upon your return to your tribe your alliance " . "has sent this message forth to you." . "<br /><br />" . $d_news . "<br /><br />" . "They have also sent us supplies and some citizens to restart " . "our tribe." . "<br /><br />" . "Below this line is news our previous tribe had recieved:"; $strSQL = "INSERT INTO news (time, ip, type, duser, ouser, result, " . "text, kingdom_text, kingdoma, kingdomb) VALUES ('{$timestamp}', " . "'{$ip}', 'killed', {$arrTrgStats[ID]}, 0, 1, '{$strNews}', " . "'{$d_news}', '{$arrTrgStats[ALLIANCE]}', '')"; mysql_query($strSQL); $strSQL = "INSERT INTO news (time, ip, type, duser, ouser, result, text, " . "kingdom_text, kingdoma, kingdomb) VALUES ('{$timestamp}', '{$ip}', " . "'killed', 0, 0, 1, '', '{$o_news}', '{$arrSrcStats[ALLIANCE]}', '')"; mysql_query($strSQL); //====================================================================== // Kill the tribe //====================================================================== require_once 'inc/staff/delete.inc.php'; doBackupTribe($objTrgUser->get_userid(), 'kill'); obj_kill_user($objTrgUser); } else { return; } }