mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[8828] Independent instance reset time for different difficulties.
* Store reset time for map/difficulty pairs. * Use DBC data for reset time and max players instead `instance_template` fields (dropped) for each existed map/difficulty pair. * Fix some "heroic" related checks in spells/etc.
This commit is contained in:
parent
70fb82b262
commit
37ba6623bb
19 changed files with 149 additions and 124 deletions
|
|
@ -141,20 +141,13 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
|||
}
|
||||
}
|
||||
|
||||
if (mInstance)
|
||||
if (mInstance && mEntry->IsDungeon())
|
||||
{
|
||||
if(mEntry->IsRaid())
|
||||
Difficulty diff = GetPlayer()->GetDifficulty(mEntry->IsRaid());
|
||||
if (uint32 timeReset = sInstanceSaveMgr.GetResetTimeFor(GetPlayer()->GetMapId(),diff))
|
||||
{
|
||||
uint32 timeleft = sInstanceSaveMgr.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL);
|
||||
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetRaidDifficulty(), timeleft);
|
||||
}
|
||||
else if(mEntry->IsNonRaidDungeon() && GetPlayer()->GetDungeonDifficulty() > DUNGEON_DIFFICULTY_NORMAL)
|
||||
{
|
||||
if(MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->MapID,GetPlayer()->GetDungeonDifficulty()))
|
||||
{
|
||||
uint32 timeleft = sInstanceSaveMgr.GetResetTimeFor(GetPlayer()->GetMapId()) - time(NULL);
|
||||
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), GetPlayer()->GetDungeonDifficulty(), timeleft);
|
||||
}
|
||||
uint32 timeleft = timeReset - time(NULL);
|
||||
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), diff, timeleft);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue