diff --git a/pages/npc.php b/pages/npc.php index 07208743..cd7b0a76 100644 --- a/pages/npc.php +++ b/pages/npc.php @@ -105,6 +105,7 @@ class NpcPage extends GenericPage $mapType = 1; } + /***********/ /* Infobox */ /***********/ @@ -302,6 +303,7 @@ class NpcPage extends GenericPage if ($stats) $infobox[] = Lang::npc('stats').($modes ? ' ('.Lang::npc('modes', $mapType, 0).')' : null).Lang::main('colon').'[ul][li]'.implode('[/li][li]', $stats).'[/li][/ul]'; + /****************/ /* Main Content */ /****************/ @@ -329,6 +331,10 @@ class NpcPage extends GenericPage BUTTON_VIEW3D => ['type' => TYPE_NPC, 'typeId' => $this->typeId, 'displayId' => $this->subject->getRandomModelId()] ); + if ($this->subject->getField('humanoid')) + $this->redButtons[BUTTON_VIEW3D]['humanoid'] = 1; + + /**************/ /* Extra Tabs */ /**************/ diff --git a/setup/db_structure.sql b/setup/db_structure.sql index d1bb78e2..7ab6b2f3 100644 --- a/setup/db_structure.sql +++ b/setup/db_structure.sql @@ -438,6 +438,7 @@ CREATE TABLE `aowow_creature` ( `displayId4` mediumint(8) unsigned NOT NULL DEFAULT '0', `textureString` varchar(50) DEFAULT NULL, `modelId` mediumint(8) NOT NULL, + `humanoid` tinyint(1) unsigned NOT NULL DEFAULT '0', `iconString` varchar(50) DEFAULT NULL COMMENT 'first texture of first model for search (up to 11 other skins omitted..)', `name_loc0` varchar(100) NOT NULL DEFAULT '0', `name_loc2` varchar(100) DEFAULT NULL, @@ -2679,7 +2680,7 @@ UNLOCK TABLES; LOCK TABLES `aowow_dbversion` WRITE; /*!40000 ALTER TABLE `aowow_dbversion` DISABLE KEYS */; -INSERT INTO `aowow_dbversion` VALUES (1490912250,0,NULL,NULL); +INSERT INTO `aowow_dbversion` VALUES (1491915060,0,NULL,NULL); /*!40000 ALTER TABLE `aowow_dbversion` ENABLE KEYS */; UNLOCK TABLES; diff --git a/setup/tools/sqlgen/creature.func.php b/setup/tools/sqlgen/creature.func.php index cb4e361e..f27c1547 100644 --- a/setup/tools/sqlgen/creature.func.php +++ b/setup/tools/sqlgen/creature.func.php @@ -30,6 +30,7 @@ function creature(array $ids = []) modelid1, modelid2, modelid3, modelid4, "" AS textureString, -- textureString 0 AS modelId, -- modelId + 0 AS humanoid, -- uses creaturedisplayinfoextra "" AS iconString, -- iconString ct.name, IFNULL(ctl2.`Name`, "") AS n2, IFNULL(ctl3.`Name`, "") AS n3, IFNULL(ctl6.`Name`, "") AS n6, IFNULL(ctl8.`Name`, "") AS n8, subname, IFNULL(ctl2.`Title`, "") AS t2, IFNULL(ctl3.`Title`, "") AS t3, IFNULL(ctl6.`Title`, "") AS t6, IFNULL(ctl8.`Title`, "") AS t8, @@ -125,7 +126,8 @@ function creature(array $ids = []) SET c.textureString = IFNULL(cdie.textureString, cdi.skin1), c.modelId = cdi.modelId, - c.iconString = cdi.iconString'; + c.iconString = cdi.iconString, + c.humanoid = IF(cdie.id IS NULL, 0, 1)'; $lastMax = 0; while ($npcs = DB::World()->select($baseQuery, NPC_CU_INSTANCE_BOSS, $lastMax, $ids ?: DBSIMPLE_SKIP, SqlGen::$stepSize)) diff --git a/setup/updates/1491915058_01.sql b/setup/updates/1491915058_01.sql new file mode 100644 index 00000000..d178a5c6 --- /dev/null +++ b/setup/updates/1491915058_01.sql @@ -0,0 +1,4 @@ +ALTER TABLE `aowow_creature` + ADD COLUMN `humanoid` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `modelId`; + +UPDATE `aowow_dbversion` SET `sql` = CONCAT(IFNULL(`sql`, ''), ' creature');