view www/level.php @ 2833:d0e186348cb2 default tip

Add mention of soft level limitation to 'Eightleg woods'.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 26 May 2024 20:33:53 +0300
parents 03979a8e1f2e
children
line wrap: on
line source

<?php
require "config.inc.php";
require "world.inc.php";
require "common.inc.php";


if (($hcbat = isset($_GET["hcbat"])))
{
  $locTable = array();
  mpParseLocFile("hcbat", $locTable, FALSE, FALSE, 0);
}
else
{
  $locTable = mpParseLocFiles(FALSE);
}

//========================================================================
// Create data tables
$areaTable = array();

foreach ($locTable as $loc)
if (isset($loc["freeform"]))
{
  if (preg_match_all("/level([ -]limited\s+to\s+lvl|[ -]limited\s+to|\s+limit)\s*([0-9]+)?/i", $loc["freeform"], $matches, PREG_SET_ORDER))
  {
//    echo $loc["name"]." : "; print_r($matches); echo "<br />\n";
    foreach ($matches as $key => $val)
    {
      $areaTable[$loc["name"]] = array(
        "data" => $loc,
        "limit" => isset($val[2]) ? intval($val[2]) : -1,
      );
    }
  }
}

ksort($areaTable, SORT_STRING);

//========================================================================
mpPrintPageHeader($pageTitle." - Level restricted / limited areas");

echo
  "<h1>BatMUD Level restricted / limited areas</h1>\n";

if (count($areaTable) > 0)
{
  echo
    " <table class=\"locTable quests\">\n".
    "  <tr>\n".
    "   <th>Location</th>\n".
    "   <th>Limit</th>\n".
    "   <th>Continent</th>\n".
    "   <th>Info</th>\n".
    "  </tr>\n";

  foreach ($areaTable as $name => $data)
  {
    $loc = &$data["data"];
    echo
      "  <tr>\n".
      "   <td>".mpGetMapLink($loc,
        !isset($continentList[$loc["continent"]]) || $continentList[$loc["continent"]][CTI_HAS_MAP], TRUE, FALSE).
        "</td>\n".
      "   <td>".($data["limit"] > 0 ? $data["limit"] : "?")."</td>\n".
      ($hcbat ? "" : "   <td class=\"".$loc["continent"]."\">".$continentList[$loc["continent"]][CTI_NAME]."</td>\n").
      "   <td>".chentities($loc["freeform"])."</td>\n".
      "  </tr>\n";
  }

  echo
    " </table>\n".
    " <p><b>".count($areaTable)." total listed.</b></p>\n";
}
else
{
  echo " <p><b>No level quests known!</b></p>\n";
}

mpPrintPageFooter();
?>