mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Setup/Spawns
* fix coords for cases with coords in both WorldMapArea.dbc and DungeonMap.dbc without using WorldMapArea.dbc as base floor
This commit is contained in:
@@ -123,7 +123,7 @@ abstract class WorldPosition
|
|||||||
x.`id`,
|
x.`id`,
|
||||||
x.`areaId`,
|
x.`areaId`,
|
||||||
IF(x.`defaultDungeonMapId` < 0, x.`floor` + 1, x.`floor`) AS `floor`,
|
IF(x.`defaultDungeonMapId` < 0, x.`floor` + 1, x.`floor`) AS `floor`,
|
||||||
IF(dm.`id` IS NOT NULL OR x.`defaultDungeonMapId` < 0, 1, 0) AS `multifloor`,
|
IF(dm.`id` IS NOT NULL OR x.`defaultDungeonMapId` < 0, 1, 0) AS `srcPrio`,
|
||||||
ROUND((x.`maxY` - ?d) * 100 / (x.`maxY` - x.`minY`), 1) AS `posX`,
|
ROUND((x.`maxY` - ?d) * 100 / (x.`maxY` - x.`minY`), 1) AS `posX`,
|
||||||
ROUND((x.`maxX` - ?d) * 100 / (x.`maxX` - x.`minX`), 1) AS `posY`,
|
ROUND((x.`maxX` - ?d) * 100 / (x.`maxX` - x.`minX`), 1) AS `posY`,
|
||||||
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) +
|
||||||
@@ -133,7 +133,7 @@ abstract class WorldPosition
|
|||||||
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
|
||||||
?_dungeonmap dm ON dm.`mapId` = x.`mapId` AND dm.`worldMapAreaId` = x.`worldMapAreaId` AND dm.`floor` <> x.`floor` AND dm.`worldMapAreaId` > 0
|
?_dungeonmap dm ON dm.`mapId` = x.`mapId` AND dm.`worldMapAreaId` = x.`worldMapAreaId` AND dm.`floor` = x.`floor` AND dm.`worldMapAreaId` > 0
|
||||||
WHERE
|
WHERE
|
||||||
x.`mapId` = ?d AND IF(?d, x.`areaId` = ?d, x.`areaId` <> 0){ AND x.`floor` = ?d - IF(x.`defaultDungeonMapId` < 0, 1, 0)}
|
x.`mapId` = ?d AND IF(?d, x.`areaId` = ?d, x.`areaId` <> 0){ AND x.`floor` = ?d - IF(x.`defaultDungeonMapId` < 0, 1, 0)}
|
||||||
GROUP BY
|
GROUP BY
|
||||||
@@ -141,7 +141,7 @@ abstract class WorldPosition
|
|||||||
HAVING
|
HAVING
|
||||||
(`posX` BETWEEN 0.1 AND 99.9 AND `posY` BETWEEN 0.1 AND 99.9)
|
(`posX` BETWEEN 0.1 AND 99.9 AND `posY` BETWEEN 0.1 AND 99.9)
|
||||||
ORDER BY
|
ORDER BY
|
||||||
`multifloor` DESC, `dist` ASC';
|
`srcPrio` DESC, `dist` ASC';
|
||||||
|
|
||||||
// dist BETWEEN 0 (center) AND 70.7 (corner)
|
// dist BETWEEN 0 (center) AND 70.7 (corner)
|
||||||
$points = DB::Aowow()->select($query, $mapY, $mapX, $mapY, $mapX, $mapId, $preferedAreaId, $preferedAreaId, $preferedFloor < 0 ? DBSIMPLE_SKIP : $preferedFloor);
|
$points = DB::Aowow()->select($query, $mapY, $mapX, $mapY, $mapX, $mapId, $preferedAreaId, $preferedAreaId, $preferedFloor < 0 ? DBSIMPLE_SKIP : $preferedFloor);
|
||||||
|
|||||||
@@ -1173,7 +1173,7 @@ abstract class Util
|
|||||||
$menu = [[null, "Move Location to..."]];
|
$menu = [[null, "Move Location to..."]];
|
||||||
foreach ($points as $p)
|
foreach ($points as $p)
|
||||||
{
|
{
|
||||||
if ($p['multifloor'])
|
if ($p['srcPrio'])
|
||||||
$floors[$p['areaId']][] = $p['floor'];
|
$floors[$p['areaId']][] = $p['floor'];
|
||||||
|
|
||||||
if (isset($menu[$p['areaId']]))
|
if (isset($menu[$p['areaId']]))
|
||||||
|
|||||||
1
setup/sql/updates/1760979519_01.sql
Normal file
1
setup/sql/updates/1760979519_01.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
UPDATE `aowow_dbversion` SET `sql` = CONCAT(IFNULL(`sql`, ''), ' spawns');
|
||||||
Reference in New Issue
Block a user