Compare commits
5 Commits
1acc749f0c
...
204e6904ed
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
204e6904ed | ||
|
|
86ee1a994c | ||
|
|
fca4ee32cd | ||
|
|
854ebc8025 | ||
|
|
58d13e69e1 |
21
data/sql/updates/db_world/2025_02_18_00.sql
Normal file
21
data/sql/updates/db_world/2025_02_18_00.sql
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
-- DB update 2025_02_16_03 -> 2025_02_18_00
|
||||||
|
|
||||||
|
-- Remove Wrong Spawns
|
||||||
|
DELETE FROM `creature` WHERE `id1` = 28745;
|
||||||
|
|
||||||
|
-- Blight Cauldron Bunny 00 SmartAI
|
||||||
|
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28739;
|
||||||
|
|
||||||
|
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28739);
|
||||||
|
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||||
|
(28739, 0, 0, 1, 8, 0, 100, 0, 52227, 0, 0, 0, 0, 0, 11, 52228, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - On Spellhit \'Dilute Blight Cauldron\' - Cast \'Kill Credit\''),
|
||||||
|
(28739, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52231, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - On Spellhit \'Dilute Blight Cauldron\' - Cast \'Cauldron Diluted Effect\''),
|
||||||
|
(28739, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 12, 28745, 4, 30000, 0, 0, 0, 202, 20, 3, 1, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - On Spellhit \'Dilute Blight Cauldron\' - Summon Creature \'Alarmed Blightguard\''),
|
||||||
|
(28739, 0, 3, 0, 1, 0, 100, 512, 30000, 30000, 30000, 30000, 0, 0, 28, 52231, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - Out of Combat - Remove Aura \'Cauldron Diluted Effect\'');
|
||||||
|
|
||||||
|
-- Set Random Movement for Alarmed Blightguard
|
||||||
|
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28745;
|
||||||
|
|
||||||
|
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28745);
|
||||||
|
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||||
|
(28745, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 89, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Alarmed Blightguard - On Reset - Start Random Movement');
|
||||||
@ -47,8 +47,8 @@ inline CellArea Cell::CalculateCellArea(float x, float y, float radius)
|
|||||||
return CellArea(center, center);
|
return CellArea(center, center);
|
||||||
}
|
}
|
||||||
|
|
||||||
CellCoord centerX = Acore::ComputeCellCoord(x - radius, y - radius).normalize();
|
CellCoord centerX = Acore::ComputeCellCoord(x + radius, y + radius).normalize();
|
||||||
CellCoord centerY = Acore::ComputeCellCoord(x + radius, y + radius).normalize();
|
CellCoord centerY = Acore::ComputeCellCoord(x - radius, y - radius).normalize();
|
||||||
|
|
||||||
return CellArea(centerX, centerY);
|
return CellArea(centerX, centerY);
|
||||||
}
|
}
|
||||||
@ -99,6 +99,8 @@ inline void Cell::Visit(CellCoord const& standing_cell, TypeContainerVisitor<T,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// loop the cell range
|
// loop the cell range
|
||||||
|
ASSERT(area.high_bound.x_coord >= area.low_bound.x_coord);
|
||||||
|
ASSERT(area.high_bound.y_coord >= area.low_bound.y_coord);
|
||||||
for (uint32 x = area.low_bound.x_coord; x <= area.high_bound.x_coord; ++x)
|
for (uint32 x = area.low_bound.x_coord; x <= area.high_bound.x_coord; ++x)
|
||||||
{
|
{
|
||||||
for (uint32 y = area.low_bound.y_coord; y <= area.high_bound.y_coord; ++y)
|
for (uint32 y = area.low_bound.y_coord; y <= area.high_bound.y_coord; ++y)
|
||||||
|
|||||||
@ -170,20 +170,17 @@ typedef CoordPair<TOTAL_NUMBER_OF_CELLS_PER_MAP> CellCoord;
|
|||||||
namespace Acore
|
namespace Acore
|
||||||
{
|
{
|
||||||
template<class RET_TYPE, int CENTER_VAL>
|
template<class RET_TYPE, int CENTER_VAL>
|
||||||
inline RET_TYPE Compute(float x, float y, float center_offset, float size)
|
inline RET_TYPE Compute(float x, float y, float size)
|
||||||
{
|
{
|
||||||
// calculate and store temporary values in double format for having same result as same mySQL calculations
|
int gx = (int)(CENTER_VAL - x / size);
|
||||||
double x_offset = (double(x) - center_offset) / size;
|
int gy = (int)(CENTER_VAL - y / size);
|
||||||
double y_offset = (double(y) - center_offset) / size;
|
|
||||||
|
|
||||||
int x_val = int(x_offset + CENTER_VAL + 0.5f);
|
return RET_TYPE(gx, gy);
|
||||||
int y_val = int(y_offset + CENTER_VAL + 0.5f);
|
|
||||||
return RET_TYPE(x_val, y_val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline GridCoord ComputeGridCoord(float x, float y)
|
inline GridCoord ComputeGridCoord(float x, float y)
|
||||||
{
|
{
|
||||||
return Compute<GridCoord, CENTER_GRID_ID>(x, y, CENTER_GRID_OFFSET, SIZE_OF_GRIDS);
|
return Compute<GridCoord, CENTER_GRID_ID>(x, y, SIZE_OF_GRIDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline GridCoord ComputeGridCoordSimple(float x, float y)
|
inline GridCoord ComputeGridCoordSimple(float x, float y)
|
||||||
@ -195,19 +192,7 @@ namespace Acore
|
|||||||
|
|
||||||
inline CellCoord ComputeCellCoord(float x, float y)
|
inline CellCoord ComputeCellCoord(float x, float y)
|
||||||
{
|
{
|
||||||
return Compute<CellCoord, CENTER_GRID_CELL_ID>(x, y, CENTER_GRID_CELL_OFFSET, SIZE_OF_GRID_CELL);
|
return Compute<CellCoord, CENTER_GRID_CELL_ID>(x, y, SIZE_OF_GRID_CELL);
|
||||||
}
|
|
||||||
|
|
||||||
inline CellCoord ComputeCellCoord(float x, float y, float& x_off, float& y_off)
|
|
||||||
{
|
|
||||||
double x_offset = (double(x) - CENTER_GRID_CELL_OFFSET) / SIZE_OF_GRID_CELL;
|
|
||||||
double y_offset = (double(y) - CENTER_GRID_CELL_OFFSET) / SIZE_OF_GRID_CELL;
|
|
||||||
|
|
||||||
int x_val = int(x_offset + CENTER_GRID_CELL_ID + 0.5f);
|
|
||||||
int y_val = int(y_offset + CENTER_GRID_CELL_ID + 0.5f);
|
|
||||||
x_off = (float(x_offset) - x_val + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL;
|
|
||||||
y_off = (float(y_offset) - y_val + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL;
|
|
||||||
return CellCoord(x_val, y_val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void NormalizeMapCoord(float& c)
|
inline void NormalizeMapCoord(float& c)
|
||||||
|
|||||||
@ -30,7 +30,7 @@ void GridTerrainLoader::LoadMap()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// map file name
|
// map file name
|
||||||
std::string const mapFileName = Acore::StringFormat("{}maps/{:03}{:02}{:02}.map", sWorld->GetDataPath(), _map->GetId(), GetX(), GetY());
|
std::string const mapFileName = Acore::StringFormat("{}maps/{:03}{:02}{:02}.map", sWorld->GetDataPath(), _map->GetId(), _grid.GetX(), _grid.GetY());
|
||||||
|
|
||||||
// loading data
|
// loading data
|
||||||
LOG_DEBUG("maps", "Loading map {}", mapFileName);
|
LOG_DEBUG("maps", "Loading map {}", mapFileName);
|
||||||
@ -46,25 +46,25 @@ void GridTerrainLoader::LoadMap()
|
|||||||
LOG_DEBUG("maps", "Error (result: {}) loading map file: {}", uint32(loadResult), mapFileName);
|
LOG_DEBUG("maps", "Error (result: {}) loading map file: {}", uint32(loadResult), mapFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
sScriptMgr->OnLoadGridMap(_map, _grid.GetTerrainData(), GetX(), GetY());
|
sScriptMgr->OnLoadGridMap(_map, _grid.GetTerrainData(), _grid.GetX(), _grid.GetY());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GridTerrainLoader::LoadVMap()
|
void GridTerrainLoader::LoadVMap()
|
||||||
{
|
{
|
||||||
int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapMgr()->loadMap((sWorld->GetDataPath() + "vmaps").c_str(), _map->GetId(), GetX(), GetY());
|
int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapMgr()->loadMap((sWorld->GetDataPath() + "vmaps").c_str(), _map->GetId(), _grid.GetX(), _grid.GetY());
|
||||||
switch (vmapLoadResult)
|
switch (vmapLoadResult)
|
||||||
{
|
{
|
||||||
case VMAP::VMAP_LOAD_RESULT_OK:
|
case VMAP::VMAP_LOAD_RESULT_OK:
|
||||||
LOG_DEBUG("maps", "VMAP loaded name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})",
|
LOG_DEBUG("maps", "VMAP loaded name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})",
|
||||||
_map->GetMapName(), _map->GetId(), GetX(), GetY(), GetX(), GetY());
|
_map->GetMapName(), _map->GetId(), _grid.GetX(), _grid.GetY(), _grid.GetX(), _grid.GetY());
|
||||||
break;
|
break;
|
||||||
case VMAP::VMAP_LOAD_RESULT_ERROR:
|
case VMAP::VMAP_LOAD_RESULT_ERROR:
|
||||||
LOG_DEBUG("maps", "Could not load VMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})",
|
LOG_DEBUG("maps", "Could not load VMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})",
|
||||||
_map->GetMapName(), _map->GetId(), GetX(), GetY(), GetX(), GetY());
|
_map->GetMapName(), _map->GetId(), _grid.GetX(), _grid.GetY(), _grid.GetX(), _grid.GetY());
|
||||||
break;
|
break;
|
||||||
case VMAP::VMAP_LOAD_RESULT_IGNORED:
|
case VMAP::VMAP_LOAD_RESULT_IGNORED:
|
||||||
LOG_DEBUG("maps", "Ignored VMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})",
|
LOG_DEBUG("maps", "Ignored VMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})",
|
||||||
_map->GetMapName(), _map->GetId(), GetX(), GetY(), GetX(), GetY());
|
_map->GetMapName(), _map->GetId(), _grid.GetX(), _grid.GetY(), _grid.GetX(), _grid.GetY());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,20 +74,20 @@ void GridTerrainLoader::LoadMMap()
|
|||||||
if (!DisableMgr::IsPathfindingEnabled(_map))
|
if (!DisableMgr::IsPathfindingEnabled(_map))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int mmapLoadResult = MMAP::MMapFactory::createOrGetMMapMgr()->loadMap(_map->GetId(), GetX(), GetY());
|
int mmapLoadResult = MMAP::MMapFactory::createOrGetMMapMgr()->loadMap(_map->GetId(), _grid.GetX(), _grid.GetY());
|
||||||
switch (mmapLoadResult)
|
switch (mmapLoadResult)
|
||||||
{
|
{
|
||||||
case MMAP::MMAP_LOAD_RESULT_OK:
|
case MMAP::MMAP_LOAD_RESULT_OK:
|
||||||
LOG_DEBUG("maps", "MMAP loaded name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})",
|
LOG_DEBUG("maps", "MMAP loaded name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})",
|
||||||
_map->GetMapName(), _map->GetId(), GetX(), GetY(), GetX(), GetY());
|
_map->GetMapName(), _map->GetId(), _grid.GetX(), _grid.GetY(), _grid.GetX(), _grid.GetY());
|
||||||
break;
|
break;
|
||||||
case MMAP::MMAP_LOAD_RESULT_ERROR:
|
case MMAP::MMAP_LOAD_RESULT_ERROR:
|
||||||
LOG_DEBUG("maps", "Could not load MMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})",
|
LOG_DEBUG("maps", "Could not load MMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})",
|
||||||
_map->GetMapName(), _map->GetId(), GetX(), GetY(), GetX(), GetY());
|
_map->GetMapName(), _map->GetId(), _grid.GetX(), _grid.GetY(), _grid.GetX(), _grid.GetY());
|
||||||
break;
|
break;
|
||||||
case MMAP::MMAP_LOAD_RESULT_IGNORED:
|
case MMAP::MMAP_LOAD_RESULT_IGNORED:
|
||||||
LOG_DEBUG("maps", "Ignored MMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})",
|
LOG_DEBUG("maps", "Ignored MMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})",
|
||||||
_map->GetMapName(), _map->GetId(), GetX(), GetY(), GetX(), GetY());
|
_map->GetMapName(), _map->GetId(), _grid.GetX(), _grid.GetY(), _grid.GetX(), _grid.GetY());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -152,9 +152,6 @@ void GridTerrainUnloader::UnloadTerrain()
|
|||||||
if (_map->GetInstanceId() != 0)
|
if (_map->GetInstanceId() != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int gx = (MAX_NUMBER_OF_GRIDS - 1) - _grid.GetX();
|
VMAP::VMapFactory::createOrGetVMapMgr()->unloadMap(_map->GetId(), _grid.GetX(), _grid.GetY());
|
||||||
int gy = (MAX_NUMBER_OF_GRIDS - 1) - _grid.GetY();
|
MMAP::MMapFactory::createOrGetMMapMgr()->unloadMap(_map->GetId(), _grid.GetX(), _grid.GetY());
|
||||||
|
|
||||||
VMAP::VMapFactory::createOrGetVMapMgr()->unloadMap(_map->GetId(), gx, gy);
|
|
||||||
MMAP::MMapFactory::createOrGetMMapMgr()->unloadMap(_map->GetId(), gx, gy);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,9 +36,6 @@ private:
|
|||||||
void LoadVMap();
|
void LoadVMap();
|
||||||
void LoadMMap();
|
void LoadMMap();
|
||||||
|
|
||||||
uint16 GetX() { return (MAX_NUMBER_OF_GRIDS - 1) - _grid.GetX(); }
|
|
||||||
uint16 GetY() { return (MAX_NUMBER_OF_GRIDS - 1) - _grid.GetY(); }
|
|
||||||
|
|
||||||
MapGridType& _grid;
|
MapGridType& _grid;
|
||||||
Map* _map;
|
Map* _map;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -304,11 +304,7 @@ void MapMgr::DoDelayedMovesAndRemoves()
|
|||||||
bool MapMgr::ExistMapAndVMap(uint32 mapid, float x, float y)
|
bool MapMgr::ExistMapAndVMap(uint32 mapid, float x, float y)
|
||||||
{
|
{
|
||||||
GridCoord p = Acore::ComputeGridCoord(x, y);
|
GridCoord p = Acore::ComputeGridCoord(x, y);
|
||||||
|
return GridTerrainLoader::ExistMap(mapid, p.x_coord, p.y_coord) && GridTerrainLoader::ExistVMap(mapid, p.x_coord, p.y_coord);
|
||||||
int gx = 63 - p.x_coord;
|
|
||||||
int gy = 63 - p.y_coord;
|
|
||||||
|
|
||||||
return GridTerrainLoader::ExistMap(mapid, gx, gy) && GridTerrainLoader::ExistVMap(mapid, gx, gy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MapMgr::IsValidMAP(uint32 mapid, bool startUp)
|
bool MapMgr::IsValidMAP(uint32 mapid, bool startUp)
|
||||||
|
|||||||
@ -1147,57 +1147,64 @@ void WorldSession::ReadAddonsInfo(ByteBuffer& data)
|
|||||||
|
|
||||||
if (uncompress(addonInfo.contents(), &uSize, data.contents() + pos, data.size() - pos) == Z_OK)
|
if (uncompress(addonInfo.contents(), &uSize, data.contents() + pos, data.size() - pos) == Z_OK)
|
||||||
{
|
{
|
||||||
uint32 addonsCount;
|
try
|
||||||
addonInfo >> addonsCount; // addons count
|
|
||||||
|
|
||||||
for (uint32 i = 0; i < addonsCount; ++i)
|
|
||||||
{
|
{
|
||||||
std::string addonName;
|
uint32 addonsCount;
|
||||||
uint8 enabled;
|
addonInfo >> addonsCount; // addons count
|
||||||
uint32 crc, unk1;
|
|
||||||
|
|
||||||
// check next addon data format correctness
|
for (uint32 i = 0; i < addonsCount; ++i)
|
||||||
if (addonInfo.rpos() + 1 > addonInfo.size())
|
|
||||||
return;
|
|
||||||
|
|
||||||
addonInfo >> addonName;
|
|
||||||
|
|
||||||
addonInfo >> enabled >> crc >> unk1;
|
|
||||||
|
|
||||||
LOG_DEBUG("network", "ADDON: Name: {}, Enabled: 0x{:x}, CRC: 0x{:x}, Unknown2: 0x{:x}", addonName, enabled, crc, unk1);
|
|
||||||
|
|
||||||
AddonInfo addon(addonName, enabled, crc, 2, true);
|
|
||||||
|
|
||||||
SavedAddon const* savedAddon = AddonMgr::GetAddonInfo(addonName);
|
|
||||||
if (savedAddon)
|
|
||||||
{
|
{
|
||||||
bool match = true;
|
std::string addonName;
|
||||||
|
uint8 enabled;
|
||||||
|
uint32 crc, unk1;
|
||||||
|
|
||||||
if (addon.CRC != savedAddon->CRC)
|
// check next addon data format correctness
|
||||||
match = false;
|
if (addonInfo.rpos() + 1 > addonInfo.size())
|
||||||
|
return;
|
||||||
|
|
||||||
if (!match)
|
addonInfo >> addonName;
|
||||||
LOG_DEBUG("network", "ADDON: {} was known, but didn't match known CRC (0x{:x})!", addon.Name, savedAddon->CRC);
|
|
||||||
|
addonInfo >> enabled >> crc >> unk1;
|
||||||
|
|
||||||
|
LOG_DEBUG("network", "ADDON: Name: {}, Enabled: 0x{:x}, CRC: 0x{:x}, Unknown2: 0x{:x}", addonName, enabled, crc, unk1);
|
||||||
|
|
||||||
|
AddonInfo addon(addonName, enabled, crc, 2, true);
|
||||||
|
|
||||||
|
SavedAddon const* savedAddon = AddonMgr::GetAddonInfo(addonName);
|
||||||
|
if (savedAddon)
|
||||||
|
{
|
||||||
|
bool match = true;
|
||||||
|
|
||||||
|
if (addon.CRC != savedAddon->CRC)
|
||||||
|
match = false;
|
||||||
|
|
||||||
|
if (!match)
|
||||||
|
LOG_DEBUG("network", "ADDON: {} was known, but didn't match known CRC (0x{:x})!", addon.Name, savedAddon->CRC);
|
||||||
|
else
|
||||||
|
LOG_DEBUG("network", "ADDON: {} was known, CRC is correct (0x{:x})", addon.Name, savedAddon->CRC);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
LOG_DEBUG("network", "ADDON: {} was known, CRC is correct (0x{:x})", addon.Name, savedAddon->CRC);
|
{
|
||||||
}
|
AddonMgr::SaveAddon(addon);
|
||||||
else
|
|
||||||
{
|
|
||||||
AddonMgr::SaveAddon(addon);
|
|
||||||
|
|
||||||
LOG_DEBUG("network", "ADDON: {} (0x{:x}) was not known, saving...", addon.Name, addon.CRC);
|
LOG_DEBUG("network", "ADDON: {} (0x{:x}) was not known, saving...", addon.Name, addon.CRC);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @todo: Find out when to not use CRC/pubkey, and other possible states.
|
||||||
|
m_addonsList.push_back(addon);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @todo: Find out when to not use CRC/pubkey, and other possible states.
|
uint32 currentTime;
|
||||||
m_addonsList.push_back(addon);
|
addonInfo >> currentTime;
|
||||||
|
LOG_DEBUG("network", "ADDON: CurrentTime: {}", currentTime);
|
||||||
|
|
||||||
|
if (addonInfo.rpos() != addonInfo.size())
|
||||||
|
LOG_DEBUG("network", "packet under-read!");
|
||||||
|
}
|
||||||
|
catch (ByteBufferException const& e)
|
||||||
|
{
|
||||||
|
LOG_ERROR("network", "Addon packet read error! {}", e.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 currentTime;
|
|
||||||
addonInfo >> currentTime;
|
|
||||||
LOG_DEBUG("network", "ADDON: CurrentTime: {}", currentTime);
|
|
||||||
|
|
||||||
if (addonInfo.rpos() != addonInfo.size())
|
|
||||||
LOG_DEBUG("network", "packet under-read!");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LOG_ERROR("network", "Addon packet uncompress error!");
|
LOG_ERROR("network", "Addon packet uncompress error!");
|
||||||
|
|||||||
@ -567,7 +567,8 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cell cell(Acore::ComputeCellCoord(object->GetPositionX(), object->GetPositionY()));
|
CellCoord const cellCoord = Acore::ComputeCellCoord(object->GetPositionX(), object->GetPositionY());
|
||||||
|
Cell cell(cellCoord);
|
||||||
|
|
||||||
uint32 zoneId, areaId;
|
uint32 zoneId, areaId;
|
||||||
object->GetZoneAndAreaId(zoneId, areaId);
|
object->GetZoneAndAreaId(zoneId, areaId);
|
||||||
@ -584,14 +585,8 @@ public:
|
|||||||
float groundZ = object->GetMapHeight(object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT);
|
float groundZ = object->GetMapHeight(object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT);
|
||||||
float floorZ = object->GetMapHeight(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ());
|
float floorZ = object->GetMapHeight(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ());
|
||||||
|
|
||||||
GridCoord gridCoord = Acore::ComputeGridCoord(object->GetPositionX(), object->GetPositionY());
|
uint32 haveMap = GridTerrainLoader::ExistMap(object->GetMapId(), cell.GridX(), cell.GridY()) ? 1 : 0;
|
||||||
|
uint32 haveVMap = GridTerrainLoader::ExistVMap(object->GetMapId(), cell.GridX(), cell.GridY()) ? 1 : 0;
|
||||||
// 63? WHY?
|
|
||||||
int gridX = 63 - gridCoord.x_coord;
|
|
||||||
int gridY = 63 - gridCoord.y_coord;
|
|
||||||
|
|
||||||
uint32 haveMap = GridTerrainLoader::ExistMap(object->GetMapId(), gridX, gridY) ? 1 : 0;
|
|
||||||
uint32 haveVMap = GridTerrainLoader::ExistVMap(object->GetMapId(), gridX, gridY) ? 1 : 0;
|
|
||||||
uint32 haveMMAP = MMAP::MMapFactory::createOrGetMMapMgr()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()) ? 1 : 0;
|
uint32 haveMMAP = MMAP::MMapFactory::createOrGetMMapMgr()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()) ? 1 : 0;
|
||||||
|
|
||||||
if (haveVMap)
|
if (haveVMap)
|
||||||
|
|||||||
@ -133,11 +133,10 @@ public:
|
|||||||
// grid tile location
|
// grid tile location
|
||||||
Player* player = handler->GetSession()->GetPlayer();
|
Player* player = handler->GetSession()->GetPlayer();
|
||||||
|
|
||||||
int32 gx = 32 - player->GetPositionX() / SIZE_OF_GRIDS;
|
GridCoord const gridCoord = Acore::ComputeGridCoord(player->GetPositionX(), player->GetPositionY());
|
||||||
int32 gy = 32 - player->GetPositionY() / SIZE_OF_GRIDS;
|
|
||||||
|
|
||||||
handler->PSendSysMessage("{}{}{}.mmtile", player->GetMapId(), gx, gy);
|
handler->PSendSysMessage("{}{}{}.mmtile", player->GetMapId(), gridCoord.x_coord, gridCoord.y_coord);
|
||||||
handler->PSendSysMessage("gridloc [{}, {}]", gy, gx);
|
handler->PSendSysMessage("gridloc [{}, {}]", gridCoord.x_coord, gridCoord.y_coord);
|
||||||
|
|
||||||
// calculate navmesh tile location
|
// calculate navmesh tile location
|
||||||
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapMgr()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId());
|
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapMgr()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user