Skip to content

Commit

Permalink
Core/LFG: Minimum item level in Wotlk heroic dungeons
Browse files Browse the repository at this point in the history
WotLK Heroics, beside Trial of the Champion, Pit of Saron, Halls of Reflection and The Forge of Souls unlock with an average item level of 160.
Also Trial of the Champion (normal) and The Forge of Souls (normal) unlock with an item level of 160.

http://www.wowwiki.com/Dungeon_Finder?oldid=2404648#Wrath_of_the_Lich_King_dungeons
  • Loading branch information
gerripeach committed Jan 26, 2014
1 parent e169e24 commit ffe1e6e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
9 changes: 9 additions & 0 deletions sql/updates/world/2014_01_21_world_access_requirement.sql
@@ -0,0 +1,9 @@
-- Add new collum in the access_requirement table.
ALTER TABLE `access_requirement` ADD COLUMN `item_level` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `level_max`;

-- All WotLK Heroics require at least an average item level of 180.
UPDATE `access_requirement` SET `item_level`=180 WHERE `mapId` IN (574, 575, 576, 578, 595, 599, 600, 601, 602, 604, 608, 619) AND `difficulty`=1;
-- Trial of the Champion, Pit of Saron, and the Forge of Souls require an average item level of 200.
UPDATE `access_requirement` SET `item_level`=200 WHERE `mapId` IN (632, 650, 658);
-- Halls of Reflection requires an average item level of 219.
UPDATE `access_requirement` SET `item_level`=219 WHERE `mapId`=668;
5 changes: 3 additions & 2 deletions src/server/game/DungeonFinding/LFGMgr.cpp
Expand Up @@ -405,7 +405,9 @@ void LFGMgr::InitializeLockedDungeons(Player* player, uint8 level /* = 0 */)
lockData = LFG_LOCKSTATUS_NOT_IN_SEASON;
else if (AccessRequirement const* ar = sObjectMgr->GetAccessRequirement(dungeon->map, Difficulty(dungeon->difficulty)))
{
if (ar->achievement && !player->HasAchieved(ar->achievement))
if (player->GetAverageItemLevel() < ar->item_level)

This comment has been minimized.

Copy link
@emsy

emsy Feb 16, 2014

This should probably be
if (ar->item_level && player->GetAverageItemLevel() < ar->item_level)
to trigger the check only for non-zero values. As a result, all instances other than those above currently return this error

This comment has been minimized.

Copy link
@joschiwald

joschiwald Feb 16, 2014

Contributor

player->GetAverageItemLevel() < 0 should never happen

This comment has been minimized.

Copy link
@emsy

emsy Feb 17, 2014

Yes but there's apparently something wrong when players can't enter any other instance because this error keeps triggering for all instances where item_level is 0

lockData = LFG_LOCKSTATUS_TOO_LOW_GEAR_SCORE;
else if (ar->achievement && !player->HasAchieved(ar->achievement))
lockData = LFG_LOCKSTATUS_MISSING_ACHIEVEMENT;
else if (player->GetTeam() == ALLIANCE && ar->quest_A && !player->GetQuestRewardStatus(ar->quest_A))
lockData = LFG_LOCKSTATUS_QUEST_NOT_COMPLETED;
Expand All @@ -422,7 +424,6 @@ void LFGMgr::InitializeLockedDungeons(Player* player, uint8 level /* = 0 */)
}

/* @todo VoA closed if WG is not under team control (LFG_LOCKSTATUS_RAID_LOCKED)
lockData = LFG_LOCKSTATUS_TOO_LOW_GEAR_SCORE;
lockData = LFG_LOCKSTATUS_TOO_HIGH_GEAR_SCORE;
lockData = LFG_LOCKSTATUS_ATTUNEMENT_TOO_LOW_LEVEL;
lockData = LFG_LOCKSTATUS_ATTUNEMENT_TOO_HIGH_LEVEL;
Expand Down
1 change: 1 addition & 0 deletions src/server/game/Entities/Player/Player.h
Expand Up @@ -840,6 +840,7 @@ struct AccessRequirement
{
uint8 levelMin;
uint8 levelMax;
uint16 item_level;
uint32 item;
uint32 item2;
uint32 quest_A;
Expand Down
18 changes: 10 additions & 8 deletions src/server/game/Globals/ObjectMgr.cpp
Expand Up @@ -6012,8 +6012,9 @@ void ObjectMgr::LoadAccessRequirements()
_accessRequirementStore.clear(); // need for reload case
}

// 0 1 2 3 4 5 6 7 8 9
QueryResult result = WorldDatabase.Query("SELECT mapid, difficulty, level_min, level_max, item, item2, quest_done_A, quest_done_H, completed_achievement, quest_failed_text FROM access_requirement");
// 0 1 2 3 4 5 6 7 8 9 10
QueryResult result = WorldDatabase.Query("SELECT mapid, difficulty, level_min, level_max, item_level, item, item2, quest_done_A, quest_done_H, completed_achievement, quest_failed_text FROM access_requirement");

if (!result)
{
TC_LOG_INFO("server.loading", ">> Loaded 0 access requirement definitions. DB table `access_requirement` is empty.");
Expand All @@ -6036,12 +6037,13 @@ void ObjectMgr::LoadAccessRequirements()

ar->levelMin = fields[2].GetUInt8();
ar->levelMax = fields[3].GetUInt8();
ar->item = fields[4].GetUInt32();
ar->item2 = fields[5].GetUInt32();
ar->quest_A = fields[6].GetUInt32();
ar->quest_H = fields[7].GetUInt32();
ar->achievement = fields[8].GetUInt32();
ar->questFailedText = fields[9].GetString();
ar->item_level = fields[4].GetUInt16();
ar->item = fields[5].GetUInt32();
ar->item2 = fields[6].GetUInt32();
ar->quest_A = fields[7].GetUInt32();
ar->quest_H = fields[8].GetUInt32();
ar->achievement = fields[9].GetUInt32();
ar->questFailedText = fields[10].GetString();

if (ar->item)
{
Expand Down

1 comment on commit ffe1e6e

@jackpoz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot to update instance locks every time a player changes equipment

Please sign in to comment.