Update Vmaps | Mmaps | Recastnav and fixed FleeingMovement

- Fixes getHeight collision (Map height is now calculated properly core-side, extraction of Maps, Vmaps is required)

- Fixes invisible walls causing LoS errores and wrong pathing in some zones.

- Mmaps update, padding is used, now to ensure proper binary-identical mmtiles

- Updated Recastnav to work properly with new updates

- Updated Area Storage

- Implement Map out of Bound (players will pop on closest graveyard if out of bounds)

- FleeingMovementGenerator updated, LoS calc to not go out of bounds or in/under textured when 
fleeing

- Added command .mmap, port from TC (info about mmaps)
This commit is contained in:
sucofog 2017-11-14 15:14:43 +01:00 committed by Yehonal
parent d98ba9cdaa
commit e772b08c68
79 changed files with 5037 additions and 3018 deletions

View file

@ -400,8 +400,8 @@ public:
object->GetZoneAndAreaId(zoneId, areaId);
MapEntry const* mapEntry = sMapStore.LookupEntry(object->GetMapId());
AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zoneId);
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaId);
AreaTableEntry const* zoneEntry = sAreaTableStore.LookupEntry(zoneId);
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(areaId);
float zoneX = object->GetPositionX();
float zoneY = object->GetPositionY();
@ -1280,7 +1280,7 @@ public:
uint32 zoneId = player->GetZoneId();
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(zoneId);
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(zoneId);
if (!areaEntry || areaEntry->zone !=0)
{
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, graveyardId, zoneId);
@ -1411,17 +1411,23 @@ public:
return false;
}
int32 area = GetAreaFlagByAreaID(atoi((char*)args));
int32 offset = area / 32;
uint32 val = uint32((1 << (area % 32)));
if (area<0 || offset >= PLAYER_EXPLORED_ZONES_SIZE)
AreaTableEntry const* area = sAreaTableStore.LookupEntry(atoi(args));
if (!area)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
int32 offset = area->exploreFlag / 32;
if (offset >= PLAYER_EXPLORED_ZONES_SIZE)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
uint32 val = uint32((1 << (area->exploreFlag % 32)));
uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset);
playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields | val)));
@ -1442,17 +1448,23 @@ public:
return false;
}
int32 area = GetAreaFlagByAreaID(atoi((char*)args));
int32 offset = area / 32;
uint32 val = uint32((1 << (area % 32)));
if (area < 0 || offset >= PLAYER_EXPLORED_ZONES_SIZE)
AreaTableEntry const* area = sAreaTableStore.LookupEntry(atoi(args));
if (!area)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
int32 offset = area->exploreFlag / 32;
if (offset >= PLAYER_EXPLORED_ZONES_SIZE)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
uint32 val = uint32((1 << (area->exploreFlag % 32)));
uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset);
playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields ^ val)));
@ -2025,12 +2037,12 @@ public:
MapEntry const* map = sMapStore.LookupEntry(mapId);
AreaTableEntry const* area = GetAreaEntryByAreaID(areaId);
AreaTableEntry const* area = sAreaTableStore.LookupEntry(areaId);
if (area)
{
areaName = area->area_name[locale];
AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone);
AreaTableEntry const* zone = sAreaTableStore.LookupEntry(area->zone);
if (zone)
zoneName = zone->area_name[locale];
}