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
This commit is contained in:
@@ -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.');
|
||||||
@@ -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),
|
(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),
|
(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),
|
(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),
|
(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),
|
(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),
|
(5011, 'You can''t teleport self to self!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||||
|
|||||||
+1
-1
@@ -862,7 +862,7 @@ enum TrinityStrings
|
|||||||
LANG_COMMAND_LIST_FREEZE = 5005,
|
LANG_COMMAND_LIST_FREEZE = 5005,
|
||||||
LANG_COMMAND_FROZEN_PLAYERS = 5006,
|
LANG_COMMAND_FROZEN_PLAYERS = 5006,
|
||||||
LANG_INSTANCE_RAID_GROUP_ONLY = 5007,
|
LANG_INSTANCE_RAID_GROUP_ONLY = 5007,
|
||||||
//LANG_INSTANCE_NOT_AS_GHOST = 5008,
|
LANG_INSTANCE_CLOSED = 5008,
|
||||||
LANG_COMMAND_PLAYED_TO_ALL = 5009,
|
LANG_COMMAND_PLAYED_TO_ALL = 5009,
|
||||||
LANG_NPCINFO_LINKGUID = 5010,
|
LANG_NPCINFO_LINKGUID = 5010,
|
||||||
LANG_TELEPORTED_TO_BY_CONSOLE = 5011,
|
LANG_TELEPORTED_TO_BY_CONSOLE = 5011,
|
||||||
|
|||||||
@@ -5739,8 +5739,8 @@ void ObjectMgr::LoadAccessRequirements()
|
|||||||
|
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
|
|
||||||
// 0 1 2 3 4 5 6 7 8 9 10 11
|
// 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 FROM access_requirement");
|
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 )
|
if( !result )
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -5778,6 +5778,7 @@ void ObjectMgr::LoadAccessRequirements()
|
|||||||
ar.questFailedText = fields[8].GetCppString();
|
ar.questFailedText = fields[8].GetCppString();
|
||||||
ar.heroicQuest = fields[9].GetUInt32();
|
ar.heroicQuest = fields[9].GetUInt32();
|
||||||
ar.heroicQuestFailedText = fields[10].GetCppString();
|
ar.heroicQuestFailedText = fields[10].GetCppString();
|
||||||
|
ar.status = fields[12].GetUInt8();
|
||||||
|
|
||||||
if(ar.item)
|
if(ar.item)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16980,6 +16980,30 @@ bool Player::Satisfy(AccessRequirement const *ar, uint32 target_map, bool report
|
|||||||
if(!mapEntry)
|
if(!mapEntry)
|
||||||
return false;
|
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()
|
bool isNormalTargetMap = mapEntry->IsRaid()
|
||||||
? (GetRaidDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)
|
? (GetRaidDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)
|
||||||
: (GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL);
|
: (GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL);
|
||||||
|
|||||||
@@ -868,6 +868,17 @@ struct InstancePlayerBind
|
|||||||
InstancePlayerBind() : save(NULL), perm(false) {}
|
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
|
struct AccessRequirement
|
||||||
{
|
{
|
||||||
uint8 levelMin;
|
uint8 levelMin;
|
||||||
@@ -881,6 +892,7 @@ struct AccessRequirement
|
|||||||
std::string questFailedText;
|
std::string questFailedText;
|
||||||
uint32 heroicQuest;
|
uint32 heroicQuest;
|
||||||
std::string heroicQuestFailedText;
|
std::string heroicQuestFailedText;
|
||||||
|
uint8 status;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PlayerTaxi
|
class PlayerTaxi
|
||||||
|
|||||||
Reference in New Issue
Block a user