[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

@ -319,7 +319,7 @@ bool BattleGroundPersistentState::CanBeUnload() const
//== DungeonResetScheduler functions ======================
uint32 DungeonResetScheduler::GetMaxResetTimeFor(MapDifficulty const* mapDiff)
uint32 DungeonResetScheduler::GetMaxResetTimeFor(MapDifficultyEntry const* mapDiff)
{
if (!mapDiff || !mapDiff->resetTime)
return 0;
@ -332,7 +332,7 @@ uint32 DungeonResetScheduler::GetMaxResetTimeFor(MapDifficulty const* mapDiff)
return delay;
}
time_t DungeonResetScheduler::CalculateNextResetTime(MapDifficulty const* mapDiff, time_t prevResetTime)
time_t DungeonResetScheduler::CalculateNextResetTime(MapDifficultyEntry const* mapDiff, time_t prevResetTime)
{
uint32 diff = sWorld.getConfig(CONFIG_UINT32_INSTANCE_RESET_TIME_HOUR) * HOUR;
uint32 period = GetMaxResetTimeFor(mapDiff);
@ -450,7 +450,7 @@ void DungeonResetScheduler::LoadResetTimes()
uint32 map_diff_pair = itr->first;
uint32 mapid = PAIR32_LOPART(map_diff_pair);
Difficulty difficulty = Difficulty(PAIR32_HIPART(map_diff_pair));
MapDifficulty const* mapDiff = &itr->second;
MapDifficultyEntry const* mapDiff = itr->second;
// skip mapDiff without global reset time
if (!mapDiff->resetTime)
@ -552,7 +552,7 @@ void DungeonResetScheduler::Update()
{
// re-schedule the next/new global reset/warning
// calculate the next reset time
MapDifficulty const* mapDiff = GetMapDifficultyData(event.mapid, event.difficulty);
MapDifficultyEntry const* mapDiff = GetMapDifficultyData(event.mapid, event.difficulty);
MANGOS_ASSERT(mapDiff);
time_t next_reset = DungeonResetScheduler::CalculateNextResetTime(mapDiff, resetTime);
@ -857,7 +857,7 @@ void MapPersistentStateManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficu
if (!warn)
{
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid, difficulty);
MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mapid, difficulty);
if (!mapDiff || !mapDiff->resetTime)
{
sLog.outError("MapPersistentStateManager::ResetOrWarnAll: not valid difficulty or no reset delay for map %d", mapid);