Skip to content

Commit

Permalink
Merge branch 'development' into eluna-support
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/game/Objects/Player.h
  • Loading branch information
bing2008 committed Nov 5, 2023
2 parents d3bab98 + bd9cca7 commit c6d077e
Show file tree
Hide file tree
Showing 205 changed files with 19,620 additions and 3,728 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
unzip tbb-$TBB_VERSION-win.zip
rm tbb-$TBB_VERSION-win.zip
#openssl
choco install -y openssl --version=1.1.1.500
#choco install -y openssl --version=1.1.1.500
#git bash shell
shell: bash

Expand Down Expand Up @@ -85,9 +85,9 @@ jobs:
copy ${{github.workspace}}/tbb/bin/intel64/vc14/tbbmalloc_proxy_debug.dll ${{github.workspace}}/bin/Release/tbbmalloc_proxy_debug.dll
copy ${{github.workspace}}/ACE_wrappers/lib/ACE.dll ${{github.workspace}}/bin/Release/ACE.dll
copy c:/mysql/lib/libmysql.dll ${{github.workspace}}/bin/Release/libmysql.dll
copy "c:/Program Files/OpenSSL/bin/libssl-1_1-x64.dll" ${{github.workspace}}/bin/Release/libssl-1_1-x64.dll
copy "c:/Program Files/OpenSSL/bin/libcrypto-1_1-x64.dll" ${{github.workspace}}/bin/Release/libcrypto-1_1-x64.dll
copy ${{github.workspace}}/dep/windows/lib/x64_release/libmySQL.dll ${{github.workspace}}/bin/Release/libmySQL.dll
# copy "c:/Program Files/OpenSSL-Win64/bin/libssl-1_1-x64.dll" ${{github.workspace}}/bin/Release/libssl-1_1-x64.dll
# copy "c:/Program Files/OpenSSL-Win64/bin/libcrypto-1_1-x64.dll" ${{github.workspace}}/bin/Release/libcrypto-1_1-x64.dll
copy ${{github.workspace}}/dep/windows/lib/x64_release/libeay32.dll ${{github.workspace}}/bin/Release/libeay32.dll
7z a -tzip ${{env.ARCHIVE_FILENAME}} Release
Expand Down Expand Up @@ -128,9 +128,9 @@ jobs:
copy ${{github.workspace}}/tbb/bin/intel64/vc14/tbbmalloc_proxy_debug.dll ${{github.workspace}}/bin/Release/tbbmalloc_proxy_debug.dll
copy ${{github.workspace}}/ACE_wrappers/lib/ACE.dll ${{github.workspace}}/bin/Release/ACE.dll
copy c:/mysql/lib/libmysql.dll ${{github.workspace}}/bin/Release/libmysql.dll
copy "c:/Program Files/OpenSSL/bin/libssl-1_1-x64.dll" ${{github.workspace}}/bin/Release/libssl-1_1-x64.dll
copy "c:/Program Files/OpenSSL/bin/libcrypto-1_1-x64.dll" ${{github.workspace}}/bin/Release/libcrypto-1_1-x64.dll
copy ${{github.workspace}}/dep/windows/lib/x64_release/libmySQL.dll ${{github.workspace}}/bin/Release/libmySQL.dll
# copy "c:/Program Files/OpenSSL-Win64/bin/libssl-1_1-x64.dll" ${{github.workspace}}/bin/Release/libssl-1_1-x64.dll
# copy "c:/Program Files/OpenSSL-Win64/bin/libcrypto-1_1-x64.dll" ${{github.workspace}}/bin/Release/libcrypto-1_1-x64.dll
copy ${{github.workspace}}/dep/windows/lib/x64_release/libeay32.dll ${{github.workspace}}/bin/Release/libeay32.dll
7z a -tzip ${{env.ARCHIVE_FILENAME}} Release
Expand Down
3 changes: 2 additions & 1 deletion contrib/mmap/offmesh.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
30 32,33 (-759.16 -350.45 68.96) (-758.2 -348.56 67.56) 2.5 // AV
30 32,33 (-761.69 -349.45 69.0) (-761 -347.83 67.61) 2.5
30 32,33 (-765?1 -348 69) (-764.53 -346.58 67.66) 2.5
30 32,33 (-765.1 -348 69) (-764.53 -346.58 67.66) 2.5
189 29,28 (1827.839478 1315.610962 17.235508) (1830.25244 1315.189697 19.016930) 2.5
91 changes: 46 additions & 45 deletions contrib/mmap/src/MapBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <list>
#include <fstream>
#include "MMapCommon.h"
#include "MapBuilder.h"
Expand Down Expand Up @@ -120,33 +119,31 @@ bool IsModelArea(int area)
}

void filterLedgeSpans(const int walkableHeight, const int walkableClimbTransition, const int walkableClimbTerrain,
rcHeightfield& solid)
rcHeightfield& heightfield)
{
const int w = solid.width;
const int h = solid.height;
const int w = heightfield.width;
const int h = heightfield.height;
const int MAX_HEIGHT = 0xffff;
std::list<rcSpan*> nullSpans;
std::list<rcSpan*> steepSlopes;

for (int y = 0; y < h; ++y)
{
for (int x = 0; x < w; ++x)
{
for (rcSpan* s = solid.spans[x + y*w]; s; s = s->next)
for (rcSpan* span = heightfield.spans[x + y*w]; span; span = span->next)
{
// Skip non walkable spans.
if (s->area == RC_NULL_AREA)
if (span->area == RC_NULL_AREA)
continue;

const int bot = (int)(s->smax);
const int top = s->next ? (int)(s->next->smin) : MAX_HEIGHT;
const int bot = (int)(span->smax);
const int top = span->next ? (int)(span->next->smin) : MAX_HEIGHT;

// Find neighbours minimum height.
int minh = MAX_HEIGHT;
int minNeighborHeight = MAX_HEIGHT;

// Min and max height of accessible neighbours.
int asmin = s->smax;
int asmax = s->smax;
int accessibleNeighborMinHeight = span->smax;
int accessibleNeighborMaxHeight = span->smax;
bool hasAllNbTerrain = true;
bool hasAllNbModel = true;

Expand All @@ -157,35 +154,36 @@ void filterLedgeSpans(const int walkableHeight, const int walkableClimbTransitio
// Skip neighbours which are out of bounds.
if (dx < 0 || dy < 0 || dx >= w || dy >= h)
{
//minh = rcMin(minh, -walkableClimbTerrain - bot);
//TODO: Figure out why this is commented out.
//minNeighborHeight = rcMin(minNeighborHeight , -walkableClimbTerrain - bot);
continue;
}

// From minus infinity to the first span.
rcSpan* ns = solid.spans[dx + dy*w];
rcSpan* neighborSpan = heightfield.spans[dx + dy*w];
int nbot = -walkableClimbTerrain;
int ntop = ns ? (int)ns->smin : MAX_HEIGHT;
int ntop = neighborSpan ? (int)neighborSpan->smin : MAX_HEIGHT;
// Skip neighbour if the gap between the spans is too small.
if (rcMin(top,ntop) - rcMax(bot,nbot) > walkableHeight)
minh = rcMin(minh, nbot - bot);
minNeighborHeight = rcMin(minNeighborHeight, nbot - bot);

// Rest of the spans.
for (ns = solid.spans[dx + dy*w]; ns; ns = ns->next)
for (neighborSpan = heightfield.spans[dx + dy*w]; neighborSpan; neighborSpan = neighborSpan->next)
{
if (ns->area == RC_NULL_AREA)
if (neighborSpan->area == RC_NULL_AREA)
continue;
nbot = (int)ns->smax;
ntop = ns->next ? (int)ns->next->smin : MAX_HEIGHT;
nbot = (int)neighborSpan->smax;
ntop = neighborSpan->next ? (int)neighborSpan->next->smin : MAX_HEIGHT;
// Skip neightbour if the gap between the spans is too small.
if (rcMin(top,ntop) - rcMax(bot,nbot) > walkableHeight)
{
minh = rcMin(minh, nbot - bot);
minNeighborHeight = rcMin(minNeighborHeight, nbot - bot);
// Find min/max accessible neighbour height.
if (rcAbs(nbot - bot) <= walkableClimbTerrain)
{
if (nbot < asmin) asmin = nbot;
if (nbot > asmax) asmax = nbot;
if (!IsModelArea(ns->area))
if (nbot < accessibleNeighborMinHeight) accessibleNeighborMinHeight = nbot;
if (nbot > accessibleNeighborMaxHeight) accessibleNeighborMaxHeight = nbot;
if (!IsModelArea(neighborSpan->area))
hasAllNbModel = false;
else
hasAllNbTerrain = false;
Expand All @@ -196,31 +194,27 @@ void filterLedgeSpans(const int walkableHeight, const int walkableClimbTransitio

// The current span is close to a ledge if the drop to any
// neighbour span is less than the walkableClimb.
bool modelToTerrainTransition = (IsModelArea(s->area) && !hasAllNbModel) || (!IsModelArea(s->area) && !hasAllNbTerrain);
bool modelToTerrainTransition = (IsModelArea(span->area) && !hasAllNbModel) || (!IsModelArea(span->area) && !hasAllNbTerrain);
int currentMaxClimb = walkableClimbTerrain;
// Model -> Terrain or Terrain -> Model
if (modelToTerrainTransition)
currentMaxClimb = walkableClimbTransition;
if (minh < -currentMaxClimb)
nullSpans.push_front(s);
if (minNeighborHeight < -currentMaxClimb)
span->area = RC_NULL_AREA;


// If the difference between all neighbours is too large,
// we are at steep slope, mark the span as it
else if ((asmax - asmin) > currentMaxClimb)
else if ((accessibleNeighborMaxHeight - accessibleNeighborMinHeight) > currentMaxClimb)
{
if (modelToTerrainTransition)
nullSpans.push_front(s);
span->area = RC_NULL_AREA;
else
steepSlopes.push_front(s);
span->area = AREA_STEEP_SLOPE;
}
}
}
}
for (std::list<rcSpan*>::iterator it = nullSpans.begin(); it != nullSpans.end(); ++it)
(*it)->area = RC_NULL_AREA;
for (std::list<rcSpan*>::iterator it = steepSlopes.begin(); it != steepSlopes.end(); ++it)
(*it)->area = AREA_STEEP_SLOPE;
}

void from_json(const json& j, rcConfig& config)
Expand Down Expand Up @@ -373,8 +367,7 @@ namespace MMAP

float bmin[3] = { 0, 0, 0 };
float bmax[3] = { 0, 0, 0 };
float lmin[3] = { 0, 0, 0 };
float lmax[3] = { 0, 0, 0 };

MeshData meshData;

// make sure we process maps which don't have tiles
Expand All @@ -389,6 +382,9 @@ namespace MMAP
// get the coord bounds of the model data
if (meshData.solidVerts.size() && meshData.liquidVerts.size())
{
float lmin[3] = { 0, 0, 0 };
float lmax[3] = { 0, 0, 0 };

rcCalcBounds(meshData.solidVerts.getCArray(), meshData.solidVerts.size() / 3, bmin, bmax);
rcCalcBounds(meshData.liquidVerts.getCArray(), meshData.liquidVerts.size() / 3, lmin, lmax);
rcVmin(bmin, lmin);
Expand All @@ -397,7 +393,7 @@ namespace MMAP
else if (meshData.solidVerts.size())
rcCalcBounds(meshData.solidVerts.getCArray(), meshData.solidVerts.size() / 3, bmin, bmax);
else
rcCalcBounds(meshData.liquidVerts.getCArray(), meshData.liquidVerts.size() / 3, lmin, lmax);
rcCalcBounds(meshData.liquidVerts.getCArray(), meshData.liquidVerts.size() / 3, bmin, bmax);

// convert coord bounds to grid bounds
maxX = 32 - bmin[0] / GRID_SIZE;
Expand Down Expand Up @@ -680,10 +676,15 @@ namespace MMAP
Tile liquidsTile;

// Calculate the per tile bounding box.
tileCfg.bmin[0] = config.bmin[0] + float(x * config.tileSize - config.borderSize) * config.cs;
tileCfg.bmin[2] = config.bmin[2] + float(y * config.tileSize - config.borderSize) * config.cs;
tileCfg.bmax[0] = config.bmin[0] + float((x + 1) * config.tileSize + config.borderSize) * config.cs;
tileCfg.bmax[2] = config.bmin[2] + float((y + 1) * config.tileSize + config.borderSize) * config.cs;
tileCfg.bmin[0] = config.bmin[0] + x * float(config.tileSize * config.cs);
tileCfg.bmin[2] = config.bmin[2] + y * float(config.tileSize * config.cs);
tileCfg.bmax[0] = config.bmin[0] + (x + 1) * float(config.tileSize * config.cs);
tileCfg.bmax[2] = config.bmin[2] + (y + 1) * float(config.tileSize * config.cs);

tileCfg.bmin[0] -= tileCfg.borderSize * tileCfg.cs;
tileCfg.bmin[2] -= tileCfg.borderSize * tileCfg.cs;
tileCfg.bmax[0] += tileCfg.borderSize * tileCfg.cs;
tileCfg.bmax[2] += tileCfg.borderSize * tileCfg.cs;

// NOSTALRIUS - MMAPS TILE GENERATION
/// 1. Alloc heightfield for walkable areas
Expand Down Expand Up @@ -711,7 +712,7 @@ namespace MMAP
// - We are on a model (WMO...)
// - Also we want to remove under-terrain triangles
unsigned char* areas = new unsigned char[tTriCount];
memset(areas, 0, tTriCount * sizeof(unsigned char));
memset(areas, AREA_NONE, tTriCount * sizeof(unsigned char));
float norm[3];
const float playerClimbLimit = cosf(52.0f/180.0f*RC_PI);
const float maxClimbLimitTerrain = cosf(75.0f/180.0f*RC_PI);
Expand Down Expand Up @@ -756,7 +757,7 @@ namespace MMAP

if (m_terrainBuilder->IsUnderMap(&verts[0]) && m_terrainBuilder->IsUnderMap(&verts[3]) && m_terrainBuilder->IsUnderMap(&verts[6]))
{
areas[i] = 0;
areas[i] = AREA_NONE;
continue;
}
}
Expand Down Expand Up @@ -1275,7 +1276,7 @@ namespace MMAP
return;
}
unsigned char* m_triareas = new unsigned char[tTriCount];
memset(m_triareas, 0, tTriCount*sizeof(unsigned char));
memset(m_triareas, AREA_NONE, tTriCount*sizeof(unsigned char));
rcMarkWalkableTriangles(m_rcContext, config.walkableSlopeAngle, tVerts, tVertCount, tTris, tTriCount, m_triareas);
rcRasterizeTriangles(m_rcContext, tVerts, tVertCount, tTris, m_triareas, tTriCount, *tile.solid, config.walkableClimb);
rcFilterLowHangingWalkableObstacles(m_rcContext, config.walkableClimb, *tile.solid);
Expand Down
7 changes: 5 additions & 2 deletions contrib/mmap/src/TerrainBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,9 +766,12 @@ namespace MMAP
float inDist = -1.0f;
if (it->IsUnderObject(v, up, isM2, &outDist, &inDist)) // inDist < outDist
{
//if there are less than 1.5y between terrain and model then mark the terrain as unwalkable
if (inDist < 1.5f)
// If terrain is under wmo, mark terrain as unwalkable
// If there are less than 1.5y between terrain and m2 then mark the terrain as unwalkable
if (!isM2 || inDist < 1.5f)
{
terrainInsideModelsVerts[t] = inDist;
}
}
}
}
Expand Down
17 changes: 17 additions & 0 deletions sql/custom/WSG_invis_walls.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-- This adds invisible walls at terrain exploit spots in WSG
-- From Classic but the invisible walls never existed in vanilla
-- The object exists in 1.7.0 and forward, if you are using 1.12.1 you can change patch_min

SET @OINVIS = 3998750;
INSERT INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecsmin`, `spawntimesecsmax`, `animprogress`, `state`, `spawn_flags`, `visibility_mod`, `patch_min`, `patch_max`) VALUES
(@OINVIS+0, 180322, 489, 917.462, 1431.63, 361.555, 3.14995, -0.256078, -0.127144, -0.957513, 0.0377819, 25, 25, 100, 1, 1, 350, 5, 10),
(@OINVIS+1, 180322, 489, 1536.53, 1410.2, 371.014, 1.96517, 0, 0, 0.831934, 0.554875, 25, 25, 100, 1, 1, 350, 5, 10),
(@OINVIS+2, 180322, 489, 1528.47, 1511.9, 359.055, 0, 0, 0, 0, 1, 25, 25, 100, 1, 1, 350, 5, 10),
(@OINVIS+3, 180322, 489, 1541, 1416, 372, 6.10865, 0, 0, -0.0871553, 0.996195, 25, 25, 100, 1, 1, 350, 5, 10),
(@OINVIS+4, 180322, 489, 1471.05, 1442.52, 371.495, 4.67748, 0.692015, -0.716602, 0.0605431, 0.0627004, 25, 25, 100, 1, 1, 350, 5, 10),
(@OINVIS+5, 180322, 489, 997.53, 1282.98, 358.421, 0.581384, 0, 0, 0.286615, 0.958046, 25, 25, 100, 1, 1, 350, 5, 10),
(@OINVIS+6, 180322, 489, 990.203, 1294.89, 357.31, 0.170133, 0, 0, 0.0849638, 0.996384, 25, 25, 100, 1, 1, 350, 5, 10),
(@OINVIS+8, 180322, 489, 1442.77, 1667.75, 366.105, 2.60508, 0, 0, 0.964234, 0.265051, 25, 25, 100, 1, 1, 350, 5, 10),
(@OINVIS+9, 180322, 489, 1146.96, 1688.87, 351.199, 1.47358, 0, 0, 0.671914, 0.740629, 25, 25, 100, 1, 1, 350, 5, 10),
(@OINVIS+10, 180322, 489, 1186.25, 1256.99, 337.158, 1.18015, 0, 0, 0.556424, 0.830898, 25, 25, 100, 1, 1, 350, 5, 10),
(@OINVIS+11, 180322, 489, 969.54, 1547.69, 358.262, 1.10841, 0, 0, 0.526268, 0.850319, 25, 25, 100, 1, 1, 350, 5, 10);
19 changes: 19 additions & 0 deletions sql/migrations/20230324094209_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
DROP PROCEDURE IF EXISTS add_migration;
delimiter ??
CREATE PROCEDURE `add_migration`()
BEGIN
DECLARE v INT DEFAULT 1;
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20230324094209');
IF v=0 THEN
INSERT INTO `migrations` VALUES ('20230324094209');
-- Add your query below.

-- Entry at creature_spells was already existing, just spell_list_id was not linked
UPDATE `creature_template` SET `spell_list_id`= 18950 WHERE `entry`=1895;

-- End of migration.
END IF;
END??
delimiter ;
CALL add_migration();
DROP PROCEDURE IF EXISTS add_migration;
33 changes: 33 additions & 0 deletions sql/migrations/20230708060723_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
DROP PROCEDURE IF EXISTS add_migration;
delimiter ??
CREATE PROCEDURE `add_migration`()
BEGIN
DECLARE v INT DEFAULT 1;
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20230708060723');
IF v=0 THEN
INSERT INTO `migrations` VALUES ('20230708060723');
-- Add your query below.


SET @OGUID = 90977;
-- Spawn Risen Protector pre 1.6.0
INSERT INTO `creature` (`guid`, `id`, `id2`, `id3`, `id4`, `id5`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecsmin`, `spawntimesecsmax`, `wander_distance`, `health_percent`, `mana_percent`, `movement_type`, `spawn_flags`, `visibility_mod`, `patch_min`, `patch_max`) VALUES
(@OGUID, 10487, 0, 0, 0, 0, 289, 195.727, 128.917, 109.794, 1.3257, 7200, 7200, 0, 100, 100, 0, 0, 0, 0, 3),
(@OGUID+1, 10487, 0, 0, 0, 0, 289, 169.733, 156.674, 109.507, 6.28001, 7200, 7200, 0, 100, 100, 0, 0, 0, 0, 3),
(@OGUID+2, 10487, 0, 0, 0, 0, 289, 169.875, 149.593, 109.508, 0.358109, 7200, 7200, 0, 100, 100, 0, 0, 0, 0, 3),
(@OGUID+3, 10487, 0, 0, 0, 0, 289, 204.894, 129.028, 109.794, 1.76239, 7200, 7200, 0, 100, 100, 0, 0, 0, 0, 3),
(@OGUID+4, 10487, 0, 0, 0, 0, 289, 236.687, 189.963, 95.8464, 1.00923, 7200, 7200, 0, 100, 100, 0, 0, 0, 0, 3),
(@OGUID+5, 10487, 0, 0, 0, 0, 289, 245.316, 189.926, 95.8464, 2.25248, 7200, 7200, 0, 100, 100, 0, 0, 0, 0, 3),
(@OGUID+6, 10487, 0, 0, 0, 0, 289, 197.778, 176.974, 109.796, 4.78456, 7200, 7200, 0, 100, 100, 0, 0, 0, 0, 3),
(@OGUID+7, 10487, 0, 0, 0, 0, 289, 204.641, 176.899, 109.796, 4.78456, 7200, 7200, 0, 100, 100, 0, 0, 0, 0, 3),
-- Spawn Risen Warrior pre 1.6.0
(@OGUID+8, 10486, 0, 0, 0, 0, 289, -18.4563, 152.231, 83.8604, 3.47225, 7200, 7200, 0, 100, 0, 0, 0, 0, 0, 3),
(@OGUID+9, 10486, 0, 0, 0, 0, 289, -18.1193, 131.767, 83.8999, 2.71828, 7200, 7200, 0, 100, 0, 0, 0, 0, 0, 3);


-- End of migration.
END IF;
END??
delimiter ;
CALL add_migration();
DROP PROCEDURE IF EXISTS add_migration;
Loading

0 comments on commit c6d077e

Please sign in to comment.