Esempio n. 1
0
 public static function createSpawnableForObject($gameId, $type, $typeId, $editorId, $editorToken)
 {
     if (!Module::authenticateGameEditor($gameId, $editorId, $editorToken, "read_write")) {
         return new returnData(6, NULL, "Failed Authentication");
     }
     switch ($type) {
         case 'Item':
             $query = "SELECT name as title FROM items WHERE game_id = {$gameId} AND item_id = {$typeId} LIMIT 1";
             break;
         case 'Node':
             $query = "SELECT title FROM nodes WHERE game_id = {$gameId} AND node_id = {$typeId} LIMIT 1";
             break;
         case 'Npc':
             $query = "SELECT name as title FROM npcs WHERE game_id = {$gameId} AND npc_id = {$typeId} LIMIT 1";
             break;
         case 'WebPage':
             $query = "SELECT name as title FROM web_pages WHERE web_page_id = {$typeId} LIMIT 1";
             break;
         case 'AugBubble':
             $query = "SELECT name as title FROM aug_bubbles WHERE aug_bubble_id = {$typeId} LIMIT 1";
             break;
     }
     $result = Module::query($query);
     $obj = mysql_fetch_object($result);
     $title = $obj->title;
     Spawnables::createSpawnable($gameId, $type, $typeId, $title, 5, 35, 50, 'PER_PLAYER', 'PLAYER', 0, 0, 50, 10, 0, 100, 15, 0, 0, 0, 1, 0);
     return Spawnables::getSpawnableForObject($gameId, $type, $typeId);
 }