mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Setup/Spawns
* restore info on manually moved spawn points * don't use worldmaparea zone dimensions for maps that don't use them
This commit is contained in:
@@ -359,7 +359,8 @@ class Game
|
|||||||
SQRT(POWER(ABS((x.`maxY` - ?d) * 100 / (x.`maxY` - x.`minY`) - 50), 2) +
|
SQRT(POWER(ABS((x.`maxY` - ?d) * 100 / (x.`maxY` - x.`minY`) - 50), 2) +
|
||||||
POWER(ABS((x.`maxX` - ?d) * 100 / (x.`maxX` - x.`minX`) - 50), 2)) AS `dist`
|
POWER(ABS((x.`maxX` - ?d) * 100 / (x.`maxX` - x.`minX`) - 50), 2)) AS `dist`
|
||||||
FROM
|
FROM
|
||||||
(SELECT 0 AS `id`, `areaId`, `mapId`, `right` AS `minY`, `left` AS `maxY`, `top` AS `maxX`, `bottom` AS `minX`, 0 AS `floor`, 0 AS `worldMapAreaId`, `defaultDungeonMapId` FROM ?_worldmaparea wma UNION
|
(SELECT 0 AS `id`, `areaId`, `mapId`, `right` AS `minY`, `left` AS `maxY`, `top` AS `maxX`, `bottom` AS `minX`, 0 AS `floor`, 0 AS `worldMapAreaId`, `defaultDungeonMapId` FROM ?_worldmaparea wma
|
||||||
|
WHERE `mapId` IN (0, 1, 530, 571, 603, 580, 564, 595) UNION -- select only for continents or maps that use wma data as floor 0
|
||||||
SELECT dm.`id`, `areaId`, wma.`mapId`, `minY`, `maxY`, `maxX`, `minX`, `floor`, `worldMapAreaId`, `defaultDungeonMapId` FROM ?_worldmaparea wma
|
SELECT dm.`id`, `areaId`, wma.`mapId`, `minY`, `maxY`, `maxX`, `minX`, `floor`, `worldMapAreaId`, `defaultDungeonMapId` FROM ?_worldmaparea wma
|
||||||
JOIN ?_dungeonmap dm ON dm.`mapId` = wma.`mapId` WHERE wma.`mapId` NOT IN (0, 1, 530, 571) OR wma.`areaId` = 4395) x
|
JOIN ?_dungeonmap dm ON dm.`mapId` = wma.`mapId` WHERE wma.`mapId` NOT IN (0, 1, 530, 571) OR wma.`areaId` = 4395) x
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ CLISetup::registerSetup("sql", new class extends SetupScript
|
|||||||
|
|
||||||
$point = $this->transformPoint($spawn, $type, $notice);
|
$point = $this->transformPoint($spawn, $type, $notice);
|
||||||
|
|
||||||
if (!$notice && !$lastOverride)
|
if ($notice && $lastOverride != $spawn['guid'])
|
||||||
{
|
{
|
||||||
CLI::write($notice, CLI::LOG_INFO);
|
CLI::write($notice, CLI::LOG_INFO);
|
||||||
$time->reset();
|
$time->reset();
|
||||||
@@ -289,7 +289,7 @@ CLISetup::registerSetup("sql", new class extends SetupScript
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function transformPoint(array $point, int $type, ?string $notice = '') : array
|
private function transformPoint(array $point, int $type, ?string &$notice = '') : array
|
||||||
{
|
{
|
||||||
// npc/object is on a transport -> apply offsets to path of transport
|
// npc/object is on a transport -> apply offsets to path of transport
|
||||||
// note, that transport DO spawn outside of displayable area maps .. another todo i guess..
|
// note, that transport DO spawn outside of displayable area maps .. another todo i guess..
|
||||||
|
|||||||
Reference in New Issue
Block a user