/**
  * (Admin) add a drop to a `area_obstacle`.`id`
  */
 function admin_edit($areaobstacle_id = null)
 {
     if (isset($this->data) && !empty($this->data)) {
         $this->AreasObstacle->bindModel(array('hasOne' => array('AreasObstaclesItem')));
         $this->AreasObstacle->AreasObstaclesItem->deleteAll(array('areas_obstacle_id' => $this->data['areaobstacle_id']));
         $savedata = array();
         foreach ($this->data['AreasObstaclesItem'] as $data) {
             if ($data['check'] == 1) {
                 $data['areas_obstacle_id'] = $this->data['areaobstacle_id'];
                 $savedata[] = $data;
             }
         }
         $this->AreasObstacle->bindModel(array('hasMany' => array('AreasObstaclesItem')));
         $this->AreasObstacle->AreasObstaclesItem->saveAll($savedata);
     } else {
         $this->AreasObstacle->bindModel(array('hasAndBelongsToMany' => array('Item')));
         $drops = $this->AreasObstacle->find('first', array('conditions' => array('AreasObstacle.id' => $areaobstacle_id)));
         $this->data = $drops;
         // Get all the items
         $this->AreasObstacle->bindModel(array('hasAndBelongsToMany' => array('Item')));
         $items = $this->AreasObstacle->Item->find('list');
         $this->set('items', $items);
         $this->set('areaobstacle_id', $areaobstacle_id);
         App::import('Model', 'Quest');
         $Quest = new Quest();
         $quests = array_merge(array(0 => ''));
         $someQuests = $Quest->find('all', array('fields' => array('Quest.id', 'Quest.name')));
         foreach ($someQuests as $index => $quest) {
             $quests[$quest['Quest']['id']] = $quest['Quest']['name'];
         }
         $this->set('quests', $quests);
     }
 }
 /**
  * This is an unique obstacle in a area. We will check if here is any drops for the character...
  */
 function view($id = null)
 {
     if (isset($id) && !empty($id)) {
         $AreasObstacle = $this->AreasObstacle->find('first', array('conditions' => array('AreasObstacle.id' => $id)));
         // Kijken of deze items geloot mogen worden...
         App::import('Model', 'Drop');
         $Drop = new Drop();
         foreach ($AreasObstacle['Item'] as $index => $item) {
             if (!$Drop->canLoot($this->characterInfo, $item['AreasObstaclesItem']['id'])) {
                 unset($AreasObstacle['Item'][$index]);
             }
         }
         // Kijken voor questen om in te leveren
         App::import('Model', 'Quest');
         $Quest = new Quest();
         foreach ($AreasObstacle['Quest'] as $index => $quest) {
             if (!$Quest->canView($this->characterInfo['Character']['id'], $quest['id'], $quest['ActionsObstacle']['type'])) {
                 unset($AreasObstacle['Quest'][$index]);
             }
         }
         $this->set('AreasObstacle', $AreasObstacle);
     } else {
         $this->render(false);
     }
 }
Ejemplo n.º 3
0
 /**
  * Get actions for a specific area
  *
  * @param int $character_id the ID of the character
  * @param int $area_id the ID of the current location of the character
  * @return array a list of available actions
  */
 function getActions($character_id = null, $area_id = null)
 {
     if (!isset($area_id) || !isset($character_id)) {
         return array();
     }
     $actions = array();
     App::import('Model', 'Drop');
     $Drop = new Drop();
     App::import('Model', 'Quest');
     $Quest = new Quest();
     $this->contain(array('AreasObstacle' => array('Item', 'Quest'), 'Npc', 'AreasMob' => array('Mob')));
     $areaInfo = $this->find('first', array('conditions' => array('Area.id' => $area_id)));
     if ($areaInfo['Area']['travel_to'] != 0) {
         if ($this->canMove($area_id, $areaInfo['Area']['travel_to'], $character_id)) {
             $areaTo = $this->find('first', array('conditions' => array('Area.id' => $areaInfo['Area']['travel_to'])));
             $actions[] = array('type' => 'Area', 'data' => $areaTo);
         }
     }
     // Doorlopen van de Obstacles, en kijken of er iets te halen valt...
     foreach ($areaInfo['AreasObstacle'] as $index => $obstacle) {
         // Looting items
         if (!empty($obstacle['Item'])) {
             foreach ($obstacle['Item'] as $item) {
                 if ($Drop->canLoot($item['AreasObstaclesItem']['id'], $character_id, $area_id)) {
                     $actions[] = array('type' => 'Item', 'data' => $item);
                 }
             }
         }
         // Quest inleveren of ophalen
         if (!empty($obstacle['Quest'])) {
             foreach ($obstacle['Quest'] as $quest) {
                 if ($Quest->canView($character_id, $quest['id'], $quest['ActionsObstacle']['type'])) {
                     $actions[] = array('type' => 'Quest', 'data' => $quest);
                 }
             }
         }
     }
     // Talking to npcs
     if (!empty($areaInfo['Npc'])) {
         foreach ($areaInfo['Npc'] as $npc) {
             $actions[] = array('type' => 'Npc', 'data' => $npc);
         }
     }
     // Killing mobs
     if (!empty($areaInfo['AreasMob'])) {
         foreach ($areaInfo['AreasMob'] as $index => $mob) {
             if ($this->AreasMob->canAttack($mob['id'], $character_id, $area_id)) {
                 $actions[] = array('type' => 'Mob', 'data' => $mob);
             }
         }
     }
     return $actions;
 }
Ejemplo n.º 4
0
 /**
  * Looting an Item from an Obstacle in the game map
  *
  * @param int the id of the character
  * @param int the id of the areas_obstacles_item
  */
 function loot($characterInfo = null, $areas_obstacles_item_id = null)
 {
     if ($this->canLoot($areas_obstacles_item_id, $characterInfo['id'], $characterInfo['area_id'])) {
         // Opslaan die handel
         App::import('Model', 'AreasObstaclesItem');
         $AreasObstaclesItem = new AreasObstaclesItem();
         $drop = $AreasObstaclesItem->find('first', array('conditions' => array('AreasObstaclesItem.id' => $areas_obstacles_item_id)));
         $data['Drop']['areas_obstacle_item_id'] = $drop['AreasObstaclesItem']['id'];
         $data['Drop']['item_id'] = $drop['AreasObstaclesItem']['item_id'];
         $data['Drop']['character_id'] = $characterInfo['id'];
         $dataInventory['Inventory']['item_id'] = $drop['AreasObstaclesItem']['item_id'];
         $dataInventory['Inventory']['character_id'] = $characterInfo['id'];
         if ($this->save($data)) {
             // Item opvragen, en eventueel de character_id invullen als deze character de eerste is...
             App::import('Model', 'Item');
             $Item = new Item();
             $Item->unbindModelAll();
             $thisItem = $Item->find('first', array('conditions' => array('Item.id' => $drop['AreasObstaclesItem']['item_id'])));
             if (isset($thisItem['Item']['character_id']) && $thisItem['Item']['character_id'] == 0) {
                 $thisItem['Item']['character_id'] = $characterInfo['id'];
                 $thisItem['Item']['discovered'] = date('Y-m-d H:i:s');
                 $Item->save($thisItem);
             }
             App::import('Model', 'Inventory');
             $Inventory = new Inventory();
             // Bagid en index opvragen
             $bagIndex = $this->hasFreeSpace($characterInfo['id'], $drop['AreasObstaclesItem']['item_id'], true);
             $dataInventory['Inventory']['index'] = $bagIndex['index'];
             $dataInventory['Inventory']['bag_id'] = $bagIndex['bag_id'];
             // Save to inventory
             if ($Inventory->save($dataInventory)) {
                 App::import('Model', 'Quest');
                 $Quest = new Quest();
                 $Quest->update(null, $characterInfo['id']);
                 // Item is nu in de inventory... We kunnen eventueel questen updaten nu
                 return true;
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
Ejemplo n.º 5
0
 function getList()
 {
     $retJson = $this->createJson();
     $quests = Quest::find('all');
     $returnRequest;
     foreach ($quests as $quest) {
         $ret['quest'] = $quest->to_array();
         $returnRequest[] = $ret;
     }
     return $returnRequest;
 }
 function game_loot($loot_id = null)
 {
     $this->render(false);
     $this->Loot->contain(array('Item'));
     $someLoot = $this->Loot->find('first', array('conditions' => array('Loot.character_id' => $this->characterInfo['id'], 'Loot.id' => $loot_id)));
     if (!empty($someLoot)) {
         $this->loadModel('Inventory');
         $this->loadModel('Drop');
         // Bagid en index opvragen
         if ($bagIndex = $this->Drop->hasFreeSpace($this->characterInfo['id'], $someLoot['Item']['id'], true)) {
             $dataInventory['Inventory']['index'] = $bagIndex['index'];
             $dataInventory['Inventory']['bag_id'] = $bagIndex['bag_id'];
             $dataInventory['Inventory']['character_id'] = $this->characterInfo['id'];
             $dataInventory['Inventory']['item_id'] = $someLoot['Item']['id'];
             // Save to inventory
             if ($this->Inventory->save($dataInventory)) {
                 App::import('Model', 'Quest');
                 $Quest = new Quest();
                 $Quest->update(null, $this->characterInfo['id']);
                 $someLoot['Loot']['looted'] = 'yes';
                 $this->Loot->save($someLoot);
                 // Kijken of dit item als eerst gevonden is voor deze gebruiker...
                 if (isset($someLoot['Item']['character_id']) && $someLoot['Item']['character_id'] == 0) {
                     $thisItem['Item']['character_id'] = $this->characterInfo['id'];
                     $thisItem['Item']['discovered'] = date('Y-m-d H:i:s');
                     $this->Item->save($thisItem);
                 }
                 if ($someLoot['Item']['']) {
                     echo '1';
                 }
                 exit;
             }
         }
     }
     echo '0';
     exit;
 }
Ejemplo n.º 7
0
 public function changeQuest($id)
 {
     $quest = Quest::find_by_id($id);
     if ($quest instanceof Quest) {
         $quest->name = trim(strip_tags($this->data['name_modal']));
         $quest->name = trim(strip_tags($this->data['name_modal']));
         $quest->sex = trim(strip_tags($this->data['quest1']));
         $quest->fio = trim(strip_tags($this->data['quest2']));
         $quest->ref = trim(strip_tags($this->data['quest4']));
         $quest->rev = trim(strip_tags($this->data['quest5']));
         $quest->mail = trim(strip_tags($this->data['quest6']));
         $quest->tel = trim(strip_tags($this->data['quest7']));
         $quest->save();
         Flight::redirect('/quest?success=2');
     }
 }
Ejemplo n.º 8
0
    private function sendMessage($user, $id_quest)
    {
        $quest = Quest::find_by_id($id_quest);
        $url = "";
        switch ($quest->name) {
            case "Побег из Супермакса":
                $url = "http://vk.com/kvestsupermax";
                break;
            case "Перевал Дятлова":
                $url = "http://vk.com/dpereval";
                break;
            case "Искусственный Интеллект":
                $url = "http://vk.com/questii";
                break;
            default:
                break;
        }
        $message = '
<html>
<body>
<h3>Здравствуйте, <b>' . $user->fio . '</b>!</h3>
<br>
Вы посещали квест <b>"' . $quest->name . '"</b>
<br><br>
Будьте в курсе всех наших новых событий, Добавляйтесь в нашу основную группу Вконтакте http://vk.com/vzaperti18 
<br><br>
Во время вашей игры оператор сделал несколько фотографий.
<br><br>
ти фотографии вы сможете найти в специальной закрытой группе ВКонтакте, созданной только для тех, кто проходил квест "' . $quest->name . ' "' . $url . ' 
<br><br>
Также в этой группе вы узнаете Как создавался квест, как проходили его другие игроки, что интересного происходило во время прохождения другими командами! 
<br><br>
ВНИМАНИЕ! Чтобы модератор группы понял, что именно вы проходили квест, и дал вам доступ в закрытую группу, <b>разместите на своей страничке ВКонтакте краткий отзыв (нам важны любые мнения) со ссылкой на наш сайт vzaperti18.ru</b>
<br><br>
Спасибо, ждем вас на следующей игре!
<br><br>
Это сообщение было отправлено от Взаперти на ' . $user->mail . '
<br>
Квесты в реальности Взаперти | 8(3412) 77-31-57, 77-31-47 <br>Ракетная 63, Советская 12а, Ижевск, Российская Федерация.
</body></html>';
        $theme = 'Вы посещали квест!';
        $this->send_mime_mail('admin', '*****@*****.**', $user->fio, $user->mail, 'UTF-8', 'windows-1251', $theme, $message, true);
    }
Ejemplo n.º 9
0
<?php

require 'common.inc.php';
$regraPersonagem = new Personagem();
$regraQuest = new Quest();
$regraItem = new Item();
$personagem = $regraPersonagem->pegar(ID_PERSONAGEM);
$GLOBALS['_personagem'] = $personagem;
$id_quest = intval($_GET['quest']);
//$quest = $regraQuest->pegar($id_quest);
$grupo = array($personagem);
//$mensagens = $regraQuest->executar($id_quest, $grupo);
require 'header.inc.php';
require 'menu-principal.inc.php';
require 'personagem-modal.inc.php';
?>
<div class="container" style="margin-top: 80px">
    <div class="row">
        <div class="col-md-3">
            <?php 
require 'login.inc.php';
?>
        </div>
        <div class="col-md-9">
            <?php 
echo '<pre>';
?>
            <?php 
$mensagens = $regraQuest->executar($id_quest, $grupo);
?>
            <?php 
Ejemplo n.º 10
0
 public function __construct($array)
 {
     parent::__construct($array);
     $this->question = Quest::_getField($array, 'question');
     $this->maxRepetitions = Quest::_getField($array, 'maxRepetitions');
     $this->currentIndex = Quest::_getField($array, 'currentIndex');
     for ($i = 0; $i < $this->currentIndex && $i < $this->maxRepetitions; $i++) {
         $this->userAnswers[$i] = Quest::_getField($array, 'answer' . $i);
     }
 }
Ejemplo n.º 11
0
 /**
  *	@params array $array contains instance variables indexed
  *	 	by name.
  */
 public function __construct($array)
 {
     parent::__construct($array);
     $this->quests = Quest::_getField($array, 'quests');
 }
 /**
  * Edits an Area
  *
  * @param int $id the ID of the Area
  */
 function admin_edit($id = null)
 {
     if (isset($this->data) && !empty($this->data)) {
         $this->Area->save($this->data);
     } else {
         App::import('Model', 'Quest');
         $Quest = new Quest();
         $this->set('quests', $Quest->find('list'));
         $this->data = $this->Area->find('first', array('conditions' => array('Area.id' => $id)));
     }
 }
Ejemplo n.º 13
0
                        <hr />
                    </div>
                    <?php 
$quests = new Collection("quests");
?>
                    <?php 
$skills = new Collection("skills");
?>
                    <?php 
foreach ($quests->get_collection() as $quest_row) {
    ?>
                        <?php 
    $connection = new Connection();
    ?>
                        <?php 
    $quest = new Quest($quest_row['id']);
    ?>
                        <div class="col-md-4 col-sm-4 panel-container">
                            <ul class="panel-options">
                                <li data-toggle="tooltip" data-placement="top" title="View Guides">
                                    <span class="glyphicon glyphicon-book"></span>
                                </li>
                                <li data-toggle="tooltip" data-placement="right" title="Mark Completed">
                                    <span class="glyphicon glyphicon-ok"></span>
                                </li>
                                <li data-toggle="tooltip" data-placement="right" title="To Do List">
                                    <span class="glyphicon glyphicon-plus"></span>
                                </li>
                                <li data-toggle="tooltip" data-placement="bottom" title="Join Discussion">
                                    <span class="glyphicon glyphicon-comment"></span>
                                </li>
Ejemplo n.º 14
0
		$the_story .= '\n\n';
		$the_story .= '\"I know, \" said ' . $name2 . '. \"Why don\'t we just jam this ' . $ammo . ' in it?\"\n';
		$the_story .= '\"Good idea!\" agreed ' . $name1 . ', so they did.';
		$the_story .= '\n\n';
		$the_story .= 'And it worked! The ship was good as new. ';
		$the_story .= 'They agreed that the ship was awesome and decided to cruise around in it happily ever after.';
	}
	$story_response->set_story($the_story);
}

//respond to client
$serialized_string = $story_response->SerializeToString();
print($serialized_string);
*/
require_once './pb_proto_Kroto.php';
$quest01 = new Quest();
$quest01->set_questname('wadehell...');
$kroto01 = new Kroto();
$kroto01->set_id(1);
$kroto01->set_name('Ngarso');
$kroto01->set_quest($quest01);
$serialized_string = $kroto01->SerializeToString();
$text = print_r($serialized_string, true);
$filename = 'test.txt';
$somecontent = $text;
// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {
    // In our example we're opening $filename in append mode.
    // The file pointer is at the bottom of the file hence
    // that's where $somecontent will go when we fwrite() it.
    if (!($handle = fopen($filename, 'a'))) {
Ejemplo n.º 15
0
$QuestResult03->set_key("fame_point");
$QuestResult03->set_val("20");
$QuestResult04 = new QuestResult();
$QuestResult04->set_key("doku");
$QuestResult04->set_val("100");
$Activity02 = new Activity();
$Activity02->set_id(2);
$Activity02->set_activityName("Mencari Makanan Favorit Para Pendekar");
//$Activity02->set_requirement(null);
$Activity02->set_result(0, $QuestResult03);
$Activity02->set_result(1, $QuestResult04);
$Activity02->set_nextActivity(0);
$Activity02->set_dialog($dialogTree02);
$Activity02->set_objectiveType(1);
$Activity02->set_action(1);
$Quest01 = new Quest();
$Quest01->set_id(1);
$Quest01->set_name("Petualangan Sang Pendekar");
//$Quest01->set_requirementQuest(null);
$Quest01->set_requirementDoku(0);
$Quest01->set_requirementFame(0);
$Quest01->set_description("Petualangan menjelajahi dunia LILO");
$Quest01->set_activities(0, $Activity01);
$Quest01->set_activities(1, $Activity02);
$playerQuest01 = new PlayerQuest();
$playerQuest01->set_id(18);
$playerQuest01->set_quest(1);
$playerQuest01->set_status(ACTIVE);
$playerQuest01->set_currentActivity(1);
$playerQuestList01 = new PlayerQuestList();
$playerQuestList01->set_playerQuests(0, $playerQuest01);
Ejemplo n.º 16
0
<?php

require 'common.inc.php';
$regraPersonagem = new Personagem();
$regraQuest = new Quest();
$regraItem = new Item();
$personagem = $regraPersonagem->pegar(ID_PERSONAGEM);
$GLOBALS['_personagem'] = $personagem;
$urlPersonagem = WEB_PATH . '/' . strtolower(sanitize_slug($personagem->nome)) . '_' . $personagem->id_personagem;
$grupo = array($personagem);
$regraQuest->gerar($grupo, ID_PERSONAGEM);
$quests = $regraQuest->listarGrupo(ID_PERSONAGEM, $grupo);
require 'header.inc.php';
require 'menu-principal.inc.php';
require 'personagem-modal.inc.php';
?>
<div class="container" style="margin-top: 80px">
    <div class="row">
        <div class="col-md-3">
            <?php 
require 'login.inc.php';
?>
        </div>
        <div class="col-md-7">
            <div class="panel panel-default">
                <div class="panel-body">
                    <table class="table table-condensed table-hover table-striped">
                        <thead>
                            <tr>
                                <th class="text-right"><a href="#">Nível</a></th>
                                <th><a href="#">Quest</a></th>
 /**
  * Get a list of the completed achievements by the guild
  * @param String $sort Define what the list should be sorted by: id|name
  * @param String $sortFlag Can be asc|desc
  */
 public function getCompletedQuests($sort = FALSE, $sortFlag = 'asc')
 {
     $wowhead = new WowHead();
     $quests = $this->characterData['quests'];
     for ($i = 0; $i < count($quests); $i++) {
         // Build the new array to return
         $quest[$i]['id'] = $quests[$i];
         $quest[$i]['url'] = $GLOBALS['wowarmory']['urls']['quest'] . "=" . $quests[$i];
         // Get name of achievement
         $questdata = new Quest($this->region, $quests[$i]);
         $quest[$i]['name'] = $questdata->getTitle();
         #$quest[$i]['url'] .= "&who=".$this->name."&when=".$achievement[$i]['timestamp'];
     }
     if ($sort) {
         return $this->sortAchievements($quest, $sort, $sortFlag);
     }
     return $quest;
 }
Ejemplo n.º 18
0
    protected function _execute(array $params)
    {
        //var_dump($params);
        if (array_key_exists('without-documents', $params)) {
            $sel_type = 'without-documents';
        } elseif (array_key_exists('with-documents', $params)) {
            $sel_type = 'with-documents';
        } else {
            CLI_Helper::write('Specify selection type (--without-documents or --with-documents)');
            exit(1);
        }
        $format = 'Y-m-d';
        $i = 0;
        // 3 попытки ввода корректного значения
        while ($i < 3) {
            $start_d = CLI_Helper::read('Please enter start date');
            $sd = DateTime::createFromFormat($format, $start_d);
            if ($sd && $sd->format($format) == $start_d) {
                break;
            } elseif ($i == 2) {
                exit(1);
            }
            $i++;
        }
        $i = 0;
        while ($i < 3) {
            $end_d = CLI_Helper::read('Please enter end date');
            $sd = DateTime::createFromFormat($format, $end_d);
            if ($sd && $sd->format($format) == $end_d) {
                break;
            } elseif ($i == 2) {
                exit(1);
            }
            $i++;
        }
        $sql = '';
        if ($sel_type == 'without-documents') {
            $sql .= '
				SELECT
					COUNT(`p`.`id`) as `count`,
					SUM(`p`.`amount`) as `amount`
				FROM
					`payments` as `p`
				LEFT JOIN
					`documents` as `d`
				ON
					`p`.`id`=`d`.`entity_id`
				WHERE
					`d`.`entity_id` is null AND
					DATE(`p`.`create_ts`) >= :start AND
					DATE(`p`.`create_ts`) < :end
				GROUP BY
					`p`.`id`
					';
        }
        if ($sel_type == 'with-documents') {
            $sql .= '
				SELECT
					COUNT(`d`.`entity_id`) as `count`,
					SUM(`p`.`amount`) as `amount`
				FROM
					`payments` as `p`
				JOIN
					`documents` as `d`
				ON
					`p`.`id`=`d`.`entity_id`
				WHERE
					DATE(`p`.`create_ts`) >= :start AND
					DATE(`p`.`create_ts`) < :end
				GROUP BY
					`d`.`entity_id`
					';
        }
        try {
            $quest = new Quest();
            $db = $quest->getDb();
            $st = $db->prepare($sql);
            $st->bindParam(':start', $start_d);
            $st->bindParam(':end', $end_d);
            $st->setFetchMode(PDO::FETCH_OBJ);
            $st->execute();
        } catch (PDOException $e) {
            CLI_Helper::write($e->getMessage());
            exit(1);
        }
        CLI_Helper::write('count	|	amount');
        foreach ($st as $row) {
            CLI_Helper::write($row->count . '	|	' . $row->amount);
        }
    }
Ejemplo n.º 19
0
    $saveid = $row["id"];
    $art = $row["zusatz"];
    $anzahl = $row["anzahl"];
}
if ($saveid > 0) {
    $testab = mysql_query("SELECT SUM(" . $art . ") FROM schiffe WHERE besitzer='" . $ich->id . "'");
    $testaa = mysql_query("SELECT SUM(" . $art . ") FROM planeten WHERE besitzer='" . $ich->id . "'");
    $testab = mysql_fetch_array($testab);
    $testaa = mysql_fetch_array($testaa);
    $summe = $testab[0] + $testaa[0];
    if ($summe < 0) {
        $summe = 0;
    }
    if ($summe > $max) {
        $summe = $max;
        $neuq = new Quest($saveid);
        $neuq->anzahl = $summe;
        $neuq->done();
    }
    mysql_query("UPDATE erfolge SET anzahl='" . $summe . "' WHERE id='" . $saveid . "'");
}
//reseten der abschlusswerte
unset($max);
unset($saveid);
unset($art);
unset($anzahl);
//questpruefeung : Buildings ( Typ 4)
$abfrage = mysql_query("SELECT erfolge.anzahl,quests.zusatz,quests.max,erfolge.id FROM erfolge,quests WHERE uid='" . $_SESSION["Id"] . "' AND quests.id=erfolge.qid AND quests.typ='4' AND erledigt='0'");
while ($row = mysql_fetch_assoc($abfrage)) {
    $menge = $row["max"];
    $saveid = $row["id"];
Ejemplo n.º 20
0
 public function products($uri = '', $init = 0)
 {
     $this->load->library('Quest');
     $quest = new Quest();
     $init = round($init);
     if (count($_POST)) {
         $quest->updateFilters($this->input->post(NULL, true));
         if (!AJAX) {
             redirect('productos/' . $quest->generateURI());
         }
     }
     $quest->loadURI($uri);
     if ($quest->filter->cost1 > 0 || $quest->filter->cost2 > 0) {
         if ($quest->filter->cost1 > $quest->filter->cost2) {
             $c1 = $quest->filter->cost1;
             $quest->filter->cost1 = $quest->filter->cost2;
             $quest->filter->cost2 = $c1;
         }
     }
     $this->Data->quest = $quest;
     $this->Data->init = $init;
     $total = $this->Data->SearchCount();
     $this->data['costValues'] = $this->Data->SearchCost();
     if ($quest->filter->cost2 >= round($this->data['costValues']->max) * 0.99) {
         $quest->filter->cost2 = 0;
         $this->Data->quest = $quest;
     }
     $this->data['sectionMenu'] = 'productos';
     $this->data['noChangeURI'] = true;
     $this->data['totalProducts'] = $total;
     $this->data['questURI'] = $quest->generateURI();
     $this->data['search'] = $quest;
     $this->data['productsSearch'] = $this->Data->Search();
     $this->load->driver('cache');
     $this->load->helper('date');
     $this->load->helper('form');
     $this->load->helper('string');
     /*if ( !$bestsellers = $this->cache->file->get('bestsellers'))
       {
         $bestsellers = $this->load->view('products/bestsellers', array('bestsellers' => $this->Data->ProductBestsellers()), true) ;
         $this->cache->file->save('bestsellers', $bestsellers, 300);
       }
       $this->data['bestsellersView'] = $bestsellers;*/
     $this->data['rnd'] = random_string();
     $config['base_url'] = base_url() . "productos/" . ($this->data['questURI'] ? $this->data['questURI'] : "order:1") . "/";
     $config['total_rows'] = $total;
     $config['per_page'] = $this->Data->quest->filter->show;
     $config['uri_segment'] = 3;
     $this->load->library('pagination');
     $this->pagination->initialize($config);
     $this->data['pagination'] = $this->pagination->create_links();
     $this->load->view('products/products', $this->data);
 }
Ejemplo n.º 21
0
    $betray = true;
}
if ($schiff->typ != 's') {
    $betray = true;
}
if ($schiff->besitzer->id != $_SESSION["Id"]) {
    $betray = true;
}
if ($betray) {
    echo 'Du bist nicht <a href="login.php">eingeloggt oder du versucht auf fremde Accounts zuzugreifen...';
} else {
    //CHEATSCHUTZ ENDE
    //QUESTABFRAGE
    $abfrage = mysql_query("SELECT E.id FROM erfolge E,quests Q WHERE E.qid=Q.id AND Q.typ=9 AND E.erledigt=0 AND Q.zusatz='" . $target->typ . "'");
    while ($row = mysql_fetch_array($abfrage)) {
        $qst = new Quest($row[0]);
        $qst->plus();
        $qst->done();
        echo 'Du hast einen (Teil)-Erfolg fuer eine Quest erreicht!<br />';
    }
    //ENDE QUESTS
    if ($target->besitzer->id == 3) {
        $npcware = 'Latinum';
        $npcname = 'Handelsturm';
        $npcbild = 'npcferg';
    }
    //if($target->besitzer->id==4) { $npcware='Vinkulum'; $npcname='Handelsturm'; $npcbild='npcferg'; }
    if ($target->besitzer->id == 5) {
        $npcware = 'Chateau Picard';
        $npcname = 'F&ouml;derationsrat';
        $npcbild = 'npcfod';
Ejemplo n.º 22
0
<?php 
    }
    ?>






<?php 
    if ($__is_viewing_self || !IsHiddenObject('bits')) {
        ?>
	<div class="full-bits">
<?php 
        MakeHideToggleButton('bits');
        $bits_quest = Quest::GetQuest($internal_id, CURRENT_LOCALE, 7022, true);
        $bits_info = null;
        // c=0;e=1;l=3;s=12
        // c = Type of case (3090000)
        // e = Equipped. Is removed when unequipped
        // l = Lines
        // s = Slots
        if ($bits_quest !== null && !$bits_quest->IsCompleted() && isset($bits_quest->data['e']) && $bits_quest->data['e'] == 1) {
            $bits_info = $bits_quest->data;
            $bits_rows = (int) $bits_info['l'];
            $bits_cols = (int) $bits_info['s'] / $bits_rows;
            // Get size
            $url = "http://" . $domain . "/ui/bits/" . $bits_rows . "/" . $bits_cols . "/";
            $width_height_array = json_decode(file_get_contents($url . '?onlysize'), true);
        }
        ?>