diff --git a/mojotrollz/sai/saimod_mojotrollz_db_creature/db_creatures.sql b/mojotrollz/sai/saimod_mojotrollz_db_creature/db_creatures.sql index c42eeb1..bab5e0e 100644 --- a/mojotrollz/sai/saimod_mojotrollz_db_creature/db_creatures.sql +++ b/mojotrollz/sai/saimod_mojotrollz_db_creature/db_creatures.sql @@ -1,3 +1,4 @@ -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1200, 42, 0, 0, 'saimod_mojotrollz_db_creatures', 'action', NULL); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1210, 42, 3, 1200, 'search', 'search', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1200, 42, 0, 0, 'saimod_mojotrollz_db_creature', 'action', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1210, 42, 3, 1200, 'search', 'search', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1215, 42, 3, 1200, 'creature', 'id', 'UINT'); diff --git a/mojotrollz/sai/saimod_mojotrollz_db_creature/qq/DB_CREATURE_TEMPLATE_CREATURE.php b/mojotrollz/sai/saimod_mojotrollz_db_creature/qq/DB_CREATURE_TEMPLATE_CREATURE.php new file mode 100644 index 0000000..0cfdb3c --- /dev/null +++ b/mojotrollz/sai/saimod_mojotrollz_db_creature/qq/DB_CREATURE_TEMPLATE_CREATURE.php @@ -0,0 +1,13 @@ + array( '\DBD\DB_CREATURE_TEMPLATE_CREATURE_LOOT' => array('key' => 'LootId', 'caption' => 'Loot'), + '\DBD\DB_CREATURE_TEMPLATE_CREATURE_TEMPLATE_ADDON' => array('key' => 'Entry', 'caption' => 'Template Addon'), + '\DBD\DB_CREATURE_TEMPLATE_CREATURE_TEMPLATE_SPELLS' => array('key' => 'Entry', 'caption' => 'Template Spells'), + '\DBD\DB_CREATURE_TEMPLATE_CREATURE_QUESTRELATION' => array('key' => 'Entry', 'caption' => 'Questrelation'), + '\DBD\DB_CREATURE_TEMPLATE_CREATURE_ONKILL_REPUTATION' => array('key' => 'Entry', 'caption' => 'Onkill Reputation'), + '\DBD\DB_CREATURE_TEMPLATE_CREATURE_LINKING_TEMPLATE' => array('key' => 'Entry', 'caption' => 'Linking Template'), + '\DBD\DB_CREATURE_TEMPLATE_CREATURE_INVOLVEMENT_RELATION' => array('key' => 'Entry', 'caption' => 'Involvement Relation'), + '\DBD\DB_CREATURE_TEMPLATE_CREATURE_CREATURE' => array('key' => 'Entry', 'caption' => 'Spawns'),)); + + $result = ''; + $base_row = \DBD\DB_CREATURE_TEMPLATE_CREATURE::Q1(array($id)); + foreach($base_row as $key=>$value){ + $result .= '';} + $result .= '
'.$key.''.$value.'
'; + + + foreach($def['additional_tables'] as $key=>$value){ + $result .= '

'.$value['caption'].'

'; + $res = \call_user_func($key.'::QQ',array($base_row[$value['key']])); + $first = true; + while($row = $res->next()){ + if($first){ + $result .= ''; + foreach($row as $key=>$value){ + $result .= '';} + $result .= ''; + } + $result .= ''; + foreach($row as $key=>$value){ + $result .= '';} + $result .= ''; + $first = false; + } + $result .= '
'.$key.'
'.$value.'
'; + + } + + return $result; } public static function sai_mod_saimod_mojotrollz_db_creature($search='%'){ - - $def = array( 'Entry' => array('caption' => 'ID'), + $subdef = array( 'key' => 'Entry'); //table identifier + $def = array( 'Entry' => array('caption' => 'ID'), 'ModelId1' => array('hidden' => false), 'ModelId2' => array('hidden' => false), 'Scale' => array('hidden' => true), @@ -75,12 +115,12 @@ class saimod_mojotrollz_db_creature extends \SYSTEM\SAI\SaiModule { ); $res = \DBD\DB_CREATURE_TEMPLATE_SEARCH::QQ(array($search,$search,$search)); - $result = ''; + $result = ''; $result .= ''; $result_body = ''; $first = true; while($row = $res->next()){ - $result_body .= ''; + $result_body .= ''; foreach($row as $key=>$data){ //hidden if( array_key_exists($key, $def) &&