From c76cb0ce7cae42970ac1b0792a9ee4ed33a23386 Mon Sep 17 00:00:00 2001 From: Tartalo Date: Thu, 25 Feb 2010 16:26:03 +0100 Subject: Add new flagged column to access_requirement to set instances opened/closed. This way is possible to open a raid on 10man mode while the rest of modes are closed (for example). Ingame commands to open/close instances coming soon ;) --HG-- branch : trunk --- src/game/Player.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/game/Player.cpp') diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 8379ec77d58..1a5e2720525 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -16980,6 +16980,30 @@ bool Player::Satisfy(AccessRequirement const *ar, uint32 target_map, bool report if(!mapEntry) return false; + bool closed = false; + + switch(mapEntry->IsRaid() ? GetRaidDifficulty() : GetDungeonDifficulty()) + { + case DUNGEON_DIFFICULTY_NORMAL: + closed = (ar->status & DUNGEON_STATUSFLAG_NORMAL) == 0; + break; + case DUNGEON_DIFFICULTY_HEROIC: + closed = (ar->status & DUNGEON_STATUSFLAG_HEROIC) == 0; + break; + case RAID_DIFFICULTY_10MAN_HEROIC: + closed = (ar->status & RAID_STATUSFLAG_10MAN_HEROIC) == 0; + break; + case RAID_DIFFICULTY_25MAN_HEROIC: + closed = (ar->status & RAID_STATUSFLAG_25MAN_HEROIC) == 0; + break; + } + + if (closed) + { + GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_INSTANCE_CLOSED)); + return false; + } + bool isNormalTargetMap = mapEntry->IsRaid() ? (GetRaidDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) : (GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL); -- cgit v1.2.3