Exemple #1
0
 public function request($path_args)
 {
     $result = RO_NPC::suggest(Util::GetString('term'));
     $ret = array();
     foreach ($result as $val) {
         $ret[] = array('label' => $val->name, 'realm' => $val->zone->realm, 'region' => $val->zone->region);
     }
     return $ret;
 }
Exemple #2
0
 public function request($path_args)
 {
     $tpl = new Template("findNPCs.xhtml");
     $tpl->limit = $limit = 20;
     $tpl->offset = $offset = Util::GetInt('offset', 0);
     $tpl->results = $results = RO_NPC::find(Util::GetString('name', ''), Util::GetString('behavior', ''), Util::GetString('profession', ''), RO_Realm::mapRegions(explode(',', Util::GetString('regions', ''))));
     $tpl->moreresults = count($results) > $offset + $limit;
     return array('offset' => $offset, 'limit' => $limit, 'total' => count($results), 'html' => $tpl->execute());
 }