Beispiel #1
0
$troll = new c_Troll($_POST["idTroll"]);
$troll->getTroll();
// Applique les objets au Troll
if (isset($_POST["itemInfo"])) {
    // Création de l'objet DOM
    $dom = getDom();
    // Parcours l'équipements choisit
    foreach (explode(";", $_POST["itemInfo"]) as $itemCarac) {
        // Sépare la chaine en idObjet typeObjet
        $itemCarac = explode("|", $itemCarac);
        if ($itemCarac[0] != 0) {
            // Charge le  fichier xml et récupère l'objet
            $dom->load("tanieres/" . $itemCarac[1] . ".xml");
            $item = getItemById($dom->getElementsByTagName("Element"), $itemCarac[0]);
            // Regarde dans l'équipement du Troll si l'objet n'a pas été trouvé
            if ($item == NULL) {
                $dom->load("trolls/" . $_POST["idTroll"] . ".xml");
                $item = getItemById($dom->getElementsByTagName("Equipements")->item(0)->childNodes, $itemCarac[0]);
            }
            // Applique les modifications au Troll selon la configuration utilisée
            if ($itemCarac[1] != "Arme_2_mains" && $itemCarac[1] != "Arme_1_main" && $itemCarac[1] != "Bouclier" || $itemCarac[1] == "Arme_2_mains" && $_POST["configArme"] || ($itemCarac[1] == "Arme_1_main" || $itemCarac[1] == "Bouclier") && !$_POST["configArme"]) {
                $troll->applyItem($item->getAttribute("carac") . " | " . $item->getAttribute("temps"));
            }
        }
    }
    // Mets à jour les temps du Troll
    $troll->updateTrollTime();
}
// Créer un objet trollHTML et affiche le tableau de caractéristiques du Troll
$trollHTML = new c_TrollHTML($troll);
echo $trollHTML->htmlGetTableProfil();
Beispiel #2
0
<?php

header('Content-Type: text/html; charset=iso-8859-1');
require_once "functions_pmt.php";
// Création de l'objet DOM et récupération de l'objet
$dom = getDom();
$dom->load("tanieres/" . $_POST["type"] . ".xml");
$item = getItemById($dom->getElementsByTagName("Element"), $_POST["idItem"]);
// Si l'objet n'a pas été trouvé on regarde dans l'équipement du Troll
if ($item == NULL) {
    $dom->load("trolls/" . $_POST["idTroll"] . ".xml");
    $item = getItemById($dom->getElementsByTagName("Equipements")->item(0)->childNodes, $_POST["idItem"]);
}
// Affichage de ses caractéristiques
echo getItemCarac($item);
Beispiel #3
0
<?php

header('Content-Type: text/html; charset=iso-8859-1');
require_once "../easyem_functions.php";
$tanieres = array("38965" => "La Bïblyohtek", "1646554" => "Le Relais des Abysses", "34111" => "La Taverne");
if ($_POST["type"] == "Compo") {
    $composant = getItemById(getComposants(), $_POST["id"]);
}
if ($_POST["type"] == "Champi") {
    $composant = getItemById(getChampignons(), $_POST["id"]);
}
if ($_POST["type"] == "PoPaAn") {
    $composant = getItemById(getParchemins(), $_POST["id"]);
}
echo "<h3><a href='' onClick=\"window.open('http://games.mountyhall.com/mountyhall/View/TresorHistory.php?ai_IDTresor=" . $composant->getAttribute("id") . "&as_From=Comptoir&ai_IDLieu=" . $composant->getAttribute("idTaniere") . "','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=1, copyhistory=0, menuBar=0, width=766, height=636');return(false);\">[" . $_POST["id"] . "]</a> <a href='http://games.mountyhall.com/mountyhall/MH_Comptoirs/Comptoir_o_Stock.php?IDLieu=" . $composant->getAttribute("idTaniere") . "&as_type=" . $_POST["type"] . "' target='_blank'>" . getTanieresById($composant->getAttribute("idTaniere")) . "</a></h3>";
Beispiel #4
0
function getCompoTrollOption()
{
    $retour = "";
    $arrayCompo = array();
    if (isset($_SESSION["AuthTroll"])) {
        $compotroll = getItemById(getCompotrolls(), $_SESSION["AuthTroll"]);
    }
    if (!$compotroll) {
        $retour .= "<option onClick='updateRatio();' value='0'>Pas de compotroll !</option>";
        $retour = "<td class='mh_tdpage'><select class='composant_taniere'>" . $retour . "</select></td>";
        $retour .= "<td id='td_compotroll'class='mh_tdpage'  width='200px'><h3></h3></td>";
        $retour .= "<input class='hidden_element' type='hidden' value='Pas de compotroll !'/>";
        return $retour;
    }
    $xpath = new DOMXPath(getComposants());
    foreach ($xpath->query('/Elements/Element[contains(child::text(),"' . $compotroll->nodeValue . '")]') as $c) {
        if (getInfoCompoTroll($compotroll, $c)) {
            $arrayCompo[] = getInfoCompoTroll($compotroll, $c);
        }
    }
    if (empty($arrayCompo)) {
        $retour .= "<option onClick='updateRatio();' value='0'>Pas de compotroll !</option>";
        $retour = "<td class='mh_tdpage'><select class='composant_taniere'>" . $retour . "</select></td>";
        $retour .= "<td id='td_compotroll'class='mh_tdpage'  width='200px'><h3></h3></td>";
        $retour .= "<input class='hidden_element' type='hidden' value='Pas de compotroll !'/>";
    } else {
        usort($arrayCompo, 'sortByRatio');
        foreach ($arrayCompo as $compo) {
            $retour .= "<option onClick=\"updateHidden( 'hidden_compotroll', '[" . $compo["id"] . "] " . addslashes($compo["nom"]) . " " . getTanieresById($compo["idTaniere"]) . "' );updateRatio();getTaniere( 'Compo', 'compotroll', " . $compo["id"] . " );\" value='" . $compo["ratio"] . "'>" . $compo["nom"] . " -> " . $compo["ratio"] . "%</option>";
        }
        $retour = "<td class='mh_tdpage'><select class='composant_taniere'>" . $retour . "</select></td>";
        $retour .= "<td id='td_compotroll'class='mh_tdpage'  width='200px'><h3><a href='' onClick=\"window.open('http://games.mountyhall.com/mountyhall/View/TresorHistory.php?ai_IDTresor=" . $arrayCompo[0]["id"] . "&as_From=Comptoir&ai_IDLieu=" . $arrayCompo[0]["idTaniere"] . "','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=1, copyhistory=0, menuBar=0, width=766, height=636');return(false);\">[" . $arrayCompo[0]["id"] . "]</a> <a href='http://games.mountyhall.com/mountyhall/MH_Comptoirs/Comptoir_o_Stock.php?IDLieu=" . $arrayCompo[0]["idTaniere"] . "&as_type=Compo' target='_blank'>" . getTanieresById($arrayCompo[0]["idTaniere"]) . "</a></h3></td>";
        $retour .= "<input id='hidden_compotroll' class='hidden_element' type='hidden' value=\"[" . $arrayCompo[0]["id"] . "] " . $arrayCompo[0]["nom"] . " " . getTanieresById($arrayCompo[0]["idTaniere"]) . "\"/>";
    }
    return $retour;
}