Example #1
0
function displayMissions($playerLevel, $cityIDsToRankAvail)
{
    if (isset($_SESSION['currentMissionCity'])) {
        $visibleMissions = Mission::getMissionsInCityGivenPlayerLevel($playerLevel + 1, $_SESSION['currentMissionCity']);
        if (count($visibleMissions) == 0) {
            echo "No missions available in this city";
        } else {
            $cityRank = -1;
            foreach ($cityIDsToRankAvail as $cityID => $rankAvail) {
                if ($cityID == $_SESSION['currentMissionCity']) {
                    $cityRank = $cityIDsToRankAvail[$cityID];
                }
            }
            foreach ($visibleMissions as $visibleMission) {
                displayMissionInfo($visibleMission, $playerLevel, $cityRank);
            }
        }
    } else {
        print "Select a city to do missions in from above";
    }
}
Example #2
0
function displayMissions($playerLevel, $cityIDsToRankAvail, $currentCityID, $serverRoot, $requiredItemsPopupHTML)
{
    global $user;
    if (isset($currentCityID)) {
        $visibleMissions = Mission::getMissionsInCityGivenPlayerLevel($playerLevel, $currentCityID);
        $visibleUnlockMissions = Mission::getUnlockMissionsInCity($playerLevel, $currentCityID);
        if (count($visibleMissions) == 0 && count($visibleUnlockMissions) == 0) {
            echo "No missions available in this city";
        } else {
            $cityRank = -1;
            foreach ($cityIDsToRankAvail as $cityID => $rankAvail) {
                if ($cityID == $currentCityID) {
                    $cityRank = $cityIDsToRankAvail[$cityID];
                }
            }
            foreach ($visibleMissions as $visibleMission) {
                displayMissionInfo($visibleMission, $playerLevel, $cityRank, $currentCityID, $serverRoot, $requiredItemsPopupHTML);
            }
            foreach ($visibleUnlockMissions as $visibleUnlockMission) {
                displayMissionInfo($visibleUnlockMission, $playerLevel, $cityRank, $currentCityID, $serverRoot, $requiredItemsPopupHTML);
            }
        }
    } else {
    }
}