[7141] Implement heroic raid instance mode support.

* Heroic mode player amount for instances in DB. Can be used for any instances but added for heroic raid instance.
* Output transfer error at max playrs limit.
* FIXME notes ;) for raid required implementing store 2 reset time and do global reset for 2 modes. But currently raid have inmmap entry data
same reset time for both cases.
* Update instances list where mounts allowed.
* Simplify and fix code for SMSG_RAID_INSTANCE_INFO.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Energy 2009-01-22 02:52:21 +03:00 committed by VladimirMangos
parent 2a891a8c92
commit f26d6151c8
11 changed files with 87 additions and 52 deletions

View file

@ -1528,10 +1528,10 @@ bool InstanceMap::CanEnter(Player *player)
}
// cannot enter if the instance is full (player cap), GMs don't count
InstanceTemplate const* iTemplate = objmgr.GetInstanceTemplate(GetId());
if (!player->isGameMaster() && GetPlayersCountExceptGMs() >= iTemplate->maxPlayers)
uint32 maxPlayers = GetMaxPlayers();
if (!player->isGameMaster() && GetPlayersCountExceptGMs() >= maxPlayers)
{
sLog.outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), iTemplate->maxPlayers, player->GetName());
sLog.outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName());
player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS);
return false;
}
@ -1824,6 +1824,14 @@ void InstanceMap::SetResetSchedule(bool on)
}
}
uint32 InstanceMap::GetMaxPlayers() const
{
InstanceTemplate const* iTemplate = objmgr.GetInstanceTemplate(GetId());
if(!iTemplate)
return 0;
return IsHeroic() ? iTemplate->maxPlayersHeroic : iTemplate->maxPlayers;
}
/* ******* Battleground Instance Maps ******* */
BattleGroundMap::BattleGroundMap(uint32 id, time_t expiry, uint32 InstanceId)