diff options
author | Tartalo <none@none> | 2010-02-25 16:26:03 +0100 |
---|---|---|
committer | Tartalo <none@none> | 2010-02-25 16:26:03 +0100 |
commit | c76cb0ce7cae42970ac1b0792a9ee4ed33a23386 (patch) | |
tree | 5b8fa4196ec0451aa8ea6660faee7e3095bce352 /src/game/Player.cpp | |
parent | 8c06fe676faa0e2a60f8848be0ae94d2cf0b2329 (diff) |
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
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
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); |