Exemplo n.º 1
0
<?php

Libraries::Req("World");
CharacterOnlyFeature();
class Worlds
{
    public $Handle;
    public function View($WorldID)
    {
        global $Template, $Database, $BaseURL, $World;
        if (intval($WorldID) <= 0) {
            MessageHandler::HandleUserError("There was a problem with the URL.");
            $this->Handle = 'index';
            return;
        }
        if ($Monsters = $World->getMonsters(intval($WorldID))) {
            $Content = '<div style="text-align:center;" class="harabara_bold">Monsters in world ' . $World->getWorldName(intval($WorldID)) . '</div>';
            foreach ($Monsters as $Monster) {
                $Content .= "-Level {$Monster['Level']} {$Monster['Name']} <br/>";
            }
            $Template->assign_var('content', $Content);
            $this->Handle = 'basepage';
            return;
        } else {
            trigger_error("Invalid monsters query. Please, contact the administrator.");
        }
    }
    public function Enter()
    {
        global $Template, $Database, $BaseURL;
        $Arguments = func_get_args();
Exemplo n.º 2
0
<?php

/*
@file pages/Pockets.php
@author Robert Derrien
@description inventory page
*/
CharacterOnlyFeature();
Libraries::Req('Pockets', $_SESSION['CharacterInfo']['CharacterID']);
Libraries::Req('Items');
class Inventory
{
    public $Handle;
    public function Render()
    {
        global $Pockets, $Template, $Items, $BaseURL;
        $Vars = array();
        if ($Slots = $Pockets->getSlots()) {
            for ($i = 0; $i < 50; $i++) {
                if (isset($Slots[$i])) {
                    $ItemInfo = $Items->getAll($Slots[$i]->ID);
                    $Template->assign_var("slot{$i}name", str_replace("'", "&quot;", $ItemInfo['Name']));
                    $Template->assign_var("slot{$i}description", $ItemInfo['Description']);
                    $Template->assign_var("slot{$i}type", $ItemInfo['Type']);
                    $Template->assign_var("slot{$i}minlevel", $ItemInfo['MinLevel']);
                    $Template->assign_var("slot{$i}stats", str_replace('"', '&quot;', $ItemInfo['Stats']));
                    $Template->assign_var("slow{$i}icon", "{$BaseURL}/images/" . $ItemInfo['Icon']);
                    $Vars["slot{$i}"] = "<span><span style='float:right;'>{$Slots[$i]->Amount}</span><img src='{$BaseURL}/images/icons/{$ItemInfo['Icon']}' title='{$ItemInfo['Description']}'/></span>";
                } else {
                    $Vars["slot{$i}"] = "&nbsp;";
                }
Exemplo n.º 3
0
<?php

Libraries::Req("Character");
unset($_SESSION['CharacterInfo']);
//Once you enter the character manager you leave your character...
class CharacterManager
{
    public $Handle;
    public function delete_do($CharacterID)
    {
        global $Character;
        LoggedInOnlyFeature();
        $CharacterName = $Character->getName(intval($CharacterID));
        if (intval($CharacterID) > 0 && !empty($_POST['CharacterName'])) {
            if ($_POST['CharacterName'] == $CharacterName) {
                if ($_SESSION['USERINFO']['id'] == $Character->getOwner(intval($CharacterID))) {
                    if ($Character->delete(intval($CharacterID))) {
                        MessageHandler::HandleAnnouncement("Your character {$CharacterName} fought well, but in the end, he was forced to leave. Farewell, hero.");
                    } else {
                        trigger_error("Problem with the query");
                    }
                } else {
                    MessageHandler::HandleUserError("You do not own this character.");
                }
            } else {
                MessageHandler::HandleUserError("The character's name you typed does not match the character you are trying to delete.");
            }
        } else {
            MessageHandler::HandleUserError("Either you did not fill all fields or there was a problem with the URL.");
        }
        $this->Render();