[12195] Improve AreaTrigger teleport requirement checks

Implement AreaLockStatus concept by rsa

Also drop basicly unneeded `areatrigger_teleport`.required_failed_text field.
This concept is still in testing phase, please feedback results of some glitches that might exist!

TODO: Use Player::GetAreaLockStatus or GetAreaTriggerLockStatus for other "CanEnter" checks as well.

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
cyberium 2012-09-06 16:40:31 +02:00 committed by Antz
parent 7901613472
commit 9022705faf
22 changed files with 304 additions and 162 deletions

View file

@ -824,21 +824,21 @@ void Map::UnloadAll(bool pForce)
}
}
MapDifficulty const* Map::GetMapDifficulty() const
MapDifficultyEntry const* Map::GetMapDifficulty() const
{
return GetMapDifficultyData(GetId(), GetDifficulty());
}
uint32 Map::GetMaxPlayers() const
{
if (MapDifficulty const* mapDiff = GetMapDifficulty())
if (MapDifficultyEntry const* mapDiff = GetMapDifficulty())
{
if (mapDiff->maxPlayers || IsRegularDifficulty()) // Normal case (expect that regular difficulty always have correct maxplayers)
return mapDiff->maxPlayers;
else // DBC have 0 maxplayers for heroic instances with expansion < 2
{
// The heroic entry exists, so we don't have to check anything, simply return normal max players
MapDifficulty const* normalDiff = GetMapDifficultyData(i_id, REGULAR_DIFFICULTY);
MapDifficultyEntry const* normalDiff = GetMapDifficultyData(i_id, REGULAR_DIFFICULTY);
return normalDiff ? normalDiff->maxPlayers : 0;
}
}