mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-05 16:57:52 +00:00
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:
@@ -38,11 +38,9 @@ struct WMOAreaTableTripple
|
||||
|
||||
typedef std::map<WMOAreaTableTripple, WMOAreaTableEntry const*> WMOAreaInfoByTripple;
|
||||
|
||||
DBCStorage <AreaTableEntry> sAreaStore(AreaTableEntryfmt);
|
||||
DBCStorage <AreaTableEntry> sAreaTableStore(AreaTableEntryfmt);
|
||||
DBCStorage <AreaGroupEntry> sAreaGroupStore(AreaGroupEntryfmt);
|
||||
DBCStorage <AreaPOIEntry> sAreaPOIStore(AreaPOIEntryfmt);
|
||||
static AreaFlagByAreaID sAreaFlagByAreaID;
|
||||
static AreaFlagByMapID sAreaFlagByMapID; // for instances without generated *.map files
|
||||
|
||||
static WMOAreaInfoByTripple sWMOAreaInfoByTripple;
|
||||
|
||||
@@ -255,21 +253,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
StoreProblemList bad_dbc_files;
|
||||
uint32 availableDbcLocales = 0xFFFFFFFF;
|
||||
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sAreaStore, dbcPath, "AreaTable.dbc");
|
||||
|
||||
// must be after sAreaStore loading
|
||||
for (uint32 i = 0; i < sAreaStore.GetNumRows(); ++i) // areaflag numbered from 0
|
||||
{
|
||||
if (AreaTableEntry const* area = sAreaStore.LookupEntry(i))
|
||||
{
|
||||
// fill AreaId->DBC records
|
||||
sAreaFlagByAreaID.insert(AreaFlagByAreaID::value_type(uint16(area->ID), area->exploreFlag));
|
||||
|
||||
// fill MapId->DBC records (skip sub zones and continents)
|
||||
if (area->zone == 0 && area->mapid != 0 && area->mapid != 1 && area->mapid != 530 && area->mapid != 571)
|
||||
sAreaFlagByMapID.insert(AreaFlagByMapID::value_type(area->mapid, area->exploreFlag));
|
||||
}
|
||||
}
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sAreaTableStore, dbcPath, "AreaTable.dbc");
|
||||
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementStore, dbcPath, "Achievement.dbc", &CustomAchievementfmt, &CustomAchievementIndex);
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc");
|
||||
@@ -626,7 +610,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
}
|
||||
|
||||
// Check loaded DBC files proper version
|
||||
if (!sAreaStore.LookupEntry(3617) || // last area (areaflag) added in 3.3.5a
|
||||
if (!sAreaTableStore.LookupEntry(4987) || // last area added in 3.3.5a
|
||||
!sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.5a
|
||||
!sGemPropertiesStore.LookupEntry(1629) || // last added spell in 3.3.5a
|
||||
!sItemStore.LookupEntry(56806) || // last gem property added in 3.3.5a
|
||||
@@ -678,50 +662,12 @@ uint32 GetTalentSpellCost(uint32 spellId)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32 GetAreaFlagByAreaID(uint32 area_id)
|
||||
{
|
||||
AreaFlagByAreaID::iterator i = sAreaFlagByAreaID.find(area_id);
|
||||
if (i == sAreaFlagByAreaID.end())
|
||||
return -1;
|
||||
|
||||
return i->second;
|
||||
}
|
||||
|
||||
WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid, int32 groupid)
|
||||
{
|
||||
WMOAreaInfoByTripple::iterator i = sWMOAreaInfoByTripple.find(WMOAreaTableTripple(rootid, adtid, groupid));
|
||||
if (i == sWMOAreaInfoByTripple.end())
|
||||
return NULL;
|
||||
return i->second;
|
||||
}
|
||||
|
||||
AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id)
|
||||
{
|
||||
int32 areaflag = GetAreaFlagByAreaID(area_id);
|
||||
if (areaflag < 0)
|
||||
if (i == sWMOAreaInfoByTripple.end())
|
||||
return NULL;
|
||||
|
||||
return sAreaStore.LookupEntry(areaflag);
|
||||
}
|
||||
|
||||
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_id)
|
||||
{
|
||||
if (area_flag)
|
||||
return sAreaStore.LookupEntry(area_flag);
|
||||
|
||||
if (MapEntry const* mapEntry = sMapStore.LookupEntry(map_id))
|
||||
return GetAreaEntryByAreaID(mapEntry->linked_zone);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint32 GetAreaFlagByMapId(uint32 mapid)
|
||||
{
|
||||
AreaFlagByMapID::iterator i = sAreaFlagByMapID.find(mapid);
|
||||
if (i == sAreaFlagByMapID.end())
|
||||
return 0;
|
||||
else
|
||||
return i->second;
|
||||
return i->second;
|
||||
}
|
||||
|
||||
uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId)
|
||||
|
||||
@@ -20,11 +20,6 @@ char* GetPetName(uint32 petfamily, uint32 dbclang);
|
||||
uint32 GetTalentSpellCost(uint32 spellId);
|
||||
TalentSpellPos const* GetTalentSpellPos(uint32 spellId);
|
||||
|
||||
int32 GetAreaFlagByAreaID(uint32 area_id); // -1 if not found
|
||||
AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id);
|
||||
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_id);
|
||||
uint32 GetAreaFlagByMapId(uint32 mapid);
|
||||
|
||||
WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid, int32 groupid);
|
||||
|
||||
uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId);
|
||||
@@ -58,7 +53,7 @@ uint32 GetDefaultMapLight(uint32 mapId);
|
||||
|
||||
extern DBCStorage <AchievementEntry> sAchievementStore;
|
||||
extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore;
|
||||
extern DBCStorage <AreaTableEntry> sAreaStore;// recommend access using functions
|
||||
extern DBCStorage <AreaTableEntry> sAreaTableStore;
|
||||
extern DBCStorage <AreaGroupEntry> sAreaGroupStore;
|
||||
extern DBCStorage <AreaPOIEntry> sAreaPOIStore;
|
||||
extern DBCStorage <AreaTriggerEntry> sAreaTriggerStore;
|
||||
|
||||
@@ -11,7 +11,7 @@ char const Achievementfmt[] = "niixssssssssssssssssxxxxxxxxxxxxxxxxxxiixixxxxxxx
|
||||
const std::string CustomAchievementfmt="pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp";
|
||||
const std::string CustomAchievementIndex = "ID";
|
||||
char const AchievementCriteriafmt[] = "niiiiiiiixxxxxxxxxxxxxxxxxiiiix";
|
||||
char const AreaTableEntryfmt[] = "iiinixxxxxissssssssssssssssxiiiiixxx";
|
||||
char const AreaTableEntryfmt[] = "niiiixxxxxissssssssssssssssxiiiiixxx";
|
||||
char const AreaGroupEntryfmt[] = "niiiiiii";
|
||||
char const AreaPOIEntryfmt[] = "niiiiiiiiiiifffixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxix";
|
||||
char const AreaTriggerEntryfmt[] = "niffffffff";
|
||||
|
||||
Reference in New Issue
Block a user