subtractKills($username, getLevel($username) * 5); addLevel($username, 1); addStrength($username, 5); addTurns($username, 50); addHealth($username, 100); } else { echo "You do not have enough kills to proceed at this time.<br>\n"; } } } else { if ($nextlevel > $MAX_LEVEL) { $msg = "You enter the dojo as one of the elite ninja. No trainer has anything left to teach you.<br>\n"; } else { if (getKills($username) < getLevel($username) * 5) { $msg = "Your trainer finds you lacking. You are instructed to prove your might against more ninja before you return.<br>\n"; } else { echo "<form id=\"level_up\" action=\"dojo.php\" method=\"post\" name=\"level_up\">\n"; echo "<div>\n"; echo "<br>Do you wish to upgrade to level " . $nextlevel . "?<br>\n"; echo "<input id=\"upgrade\" type=\"hidden\" value=\"1\" name=\"upgrade\">\n"; echo "<input type=\"submit\" value=\"Upgrade\" class=\"formButton\"><br>\n"; echo "</div>\n"; echo "</form>\n"; } } } echo "Your current level is " . getLevel($username) . ". <br>Your current kills are " . getKills($username) . ".<br><br>\n"; echo "Level " . (getLevel($username) + 1) . " requires " . getLevel($username) * 5 . " kills.<br><br>\n"; echo $msg; } include SERVER_ROOT . "interface/footer.php";
// *** End of if > 5 *** if (!$just_villager) { // *** Something beyond just a villager, drop a shuriken. *** addItem($username, 'Shuriken', $quantity = 1); echo "The villager dropped a Shuriken.\n"; } } } else { if ($victim == "samurai") { $turn_cost = 1; echo "<img src=\"images/characters/samurai.png\" alt=\"Samurai\">\n"; if (getLevel($username) < 6) { echo "You are too weak to take on the Samurai.<br>\n"; $turn_cost = 0; } else { if (getKills($username) < 1) { echo "You are too exhausted to take on the Samurai.<br>\n"; $turn_cost = 0; } else { echo "The Samurai was waiting for your attack.<br><br>\n"; $ninja_str = getStrength($username); $ninja_health = getHealth($username); $samurai_damage_array[1] = rand(1, $ninja_str); $samurai_damage_array[2] = rand(10, 10 + round($ninja_str * 1.2)); $does_ninja_succeed = rand(1, 2); if ($does_ninja_succeed == 1) { $samurai_damage_array[3] = rand(30 + round($ninja_str * 0.2), 30 + round($ninja_str * 1.7)); } else { $samurai_damage_array[3] = $ninja_health - $samurai_damage_array[1] - $samurai_damage_array[2]; //Instant death. }
width: 70% !important; margin: 1em auto !important; } .pure-g p{ font-size: 150% !important; } </style> <h2 class="pages-title"> <?php echo $translation["page"]["soutez"]; ?> </h2> <div id="page-content" class="content pages-content"> <?php $from = '2015-11-02 00:00:00'; $to = '2015-12-01 23:59:59'; $kills = getKills($db_ip, $db_port, $db_login, $db_pass, "soe-hlstats", $from, $to); echo $translation["page"]["text"]; ?> <?php echo getActivityHtml($kills, $translation); ?> </div>
} else { if ($startingKills > 1 || $freeResurrection) { // If you're dead, and a newbie, or dead and have kills. // *** FREE RESURRECTION DETERMINATION *** if (!$freeResurrection) { subtractKills($username, 1); } setHealth($username, 100); subtractStatus($username, STEALTH + POISON + FROZEN + CLASS_STATE); // *** FREE STEALTHING FOR BLACK CLASS UPON NON-FREE RESURRECTION if ($players_class == "Black" && !$freeResurrection) { addStatus($username, STEALTH); } echo "What once was dead shall rise again.<br>\n"; echo "Current Kills: " . $startingKills . "<br>\n"; echo "Adjusted Kills after returning to life: " . getKills($username) . "<br>\n"; } elseif ($startingTurns > 0) { echo "What once was dead shall rise again.<br>\n"; if ($startingTurns < $lostTurns && $startingTurns > 0) { $lostTurns = $startingTurns; } subtractTurns($username, $lostTurns); // *** Takes away necessary turns. setHealth($username, 100); subtractStatus($username, STEALTH + POISON + FROZEN + CLASS_STATE); echo "Since you have no kills, your resurrection will cost you part of your life time."; echo "Current Turns: " . $startingTurns . "<br>\n"; echo "Adjusted Turns after returning to life: " . getTurns($username) . "<br>\n"; } else { echo "You must wait for time to pass before you can return to life."; echo "Current Turns: " . $startingTurns . "<br>\n";
The shrine to the gods is peacefully quiet as you enter. The sound of flowing water soothes your mind. <br><br> A monk approaches you quietly and asks, "Are you in need of healing?" </div> <?php $freeResLevelLimit = 6; $freeResKillLimit = 25; $lostTurns = 10; // *** Default turns lost when the player has no kills. $startingKills = 0; $userLevel = 0; if (!isset($username)) { echo "You have no need of healing."; } else { $startingKills = getKills($username); $userLevel = getLevel($username); // *** A True or False as to whether resurrection will be free. $freeResurrection = $userLevel < $freeResLevelLimit && $startingKills < $freeResKillLimit; if (!$players_health) { echo '<form action="shrine_mod.php" method="post">'; echo '<span class="brownHeading">Resurrect</span>'; if ($freeResurrection) { echo '<p style="color: red;">'; echo 'Since you have not killed more than twenty ninja or gained beyond five levels, you will not lose power by resurrecting!'; echo '</p>'; } echo '<p>'; echo 'Resurrect to return to life.'; if (!$freeResurrection) { echo ' You will lose a kill point for every resurrection. ';
function changeKills($who, $amount) { if (abs($amount) > 0) { global $sql; $sql->Update("UPDATE players SET kills = kills + " . "CASE WHEN kills+{$amount} < 0 THEN kills*(-1) ELSE {$amount} END " . "WHERE uname = '{$who}'"); $new_kills = getKills($who); return $new_kills; } else { return getKills($who); } }