--HG--
branch : trunk
This commit is contained in:
Brian
2010-02-24 23:50:54 -07:00
7 changed files with 43 additions and 3 deletions
@@ -0,0 +1 @@
ALTER TABLE `access_requirement` ADD COLUMN `status` TINYINT UNSIGNED DEFAULT 15 COMMENT 'instance status (open/close)';
@@ -0,0 +1 @@
INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES (5008,'This instance is closed.');
+1
View File
@@ -14775,6 +14775,7 @@ INSERT INTO `trinity_string` (`entry`,`content_default`,`content_loc1`,`content_
(5005, 'Following players are frozen on the server:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5006, '- %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5007, 'You must be in a raid group to enter this instance.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5008, 'This instance is closed.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5009, 'Sound %u Played to server', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5010, 'linkGUID: %u, Entry: %u (%s)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5011, 'You can''t teleport self to self!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+1 -1
View File
@@ -862,7 +862,7 @@ enum TrinityStrings
LANG_COMMAND_LIST_FREEZE = 5005,
LANG_COMMAND_FROZEN_PLAYERS = 5006,
LANG_INSTANCE_RAID_GROUP_ONLY = 5007,
//LANG_INSTANCE_NOT_AS_GHOST = 5008,
LANG_INSTANCE_CLOSED = 5008,
LANG_COMMAND_PLAYED_TO_ALL = 5009,
LANG_NPCINFO_LINKGUID = 5010,
LANG_TELEPORTED_TO_BY_CONSOLE = 5011,
+3 -2
View File
@@ -5739,8 +5739,8 @@ void ObjectMgr::LoadAccessRequirements()
uint32 count = 0;
// 0 1 2 3 4 5 6 7 8 9 10 11
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT id, level_min, level_max, item, item2, heroic_key, heroic_key2, quest_done, quest_failed_text, heroic_quest_done, heroic_quest_failed_text, heroic_level_min FROM access_requirement");
// 0 1 2 3 4 5 6 7 8 9 10 11 12
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT id, level_min, level_max, item, item2, heroic_key, heroic_key2, quest_done, quest_failed_text, heroic_quest_done, heroic_quest_failed_text, heroic_level_min, status FROM access_requirement");
if( !result )
{
@@ -5778,6 +5778,7 @@ void ObjectMgr::LoadAccessRequirements()
ar.questFailedText = fields[8].GetCppString();
ar.heroicQuest = fields[9].GetUInt32();
ar.heroicQuestFailedText = fields[10].GetCppString();
ar.status = fields[12].GetUInt8();
if(ar.item)
{
+24
View File
@@ -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);
+12
View File
@@ -868,6 +868,17 @@ struct InstancePlayerBind
InstancePlayerBind() : save(NULL), perm(false) {}
};
enum DungeonStatusFlag
{
DUNGEON_STATUSFLAG_NORMAL = 0x01,
DUNGEON_STATUSFLAG_HEROIC = 0x02,
RAID_STATUSFLAG_10MAN_NORMAL = 0x01,
RAID_STATUSFLAG_25MAN_NORMAL = 0x02,
RAID_STATUSFLAG_10MAN_HEROIC = 0x04,
RAID_STATUSFLAG_25MAN_HEROIC = 0x08
};
struct AccessRequirement
{
uint8 levelMin;
@@ -881,6 +892,7 @@ struct AccessRequirement
std::string questFailedText;
uint32 heroicQuest;
std::string heroicQuestFailedText;
uint8 status;
};
class PlayerTaxi