*Add column heroic_level_min in table access_requirement
--HG-- branch : trunk
This commit is contained in:
@@ -5384,8 +5384,8 @@ void ObjectMgr::LoadAccessRequirements()
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9 10
|
||||
QueryResult *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 FROM access_requirement");
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11
|
||||
QueryResult *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");
|
||||
if( !result )
|
||||
{
|
||||
|
||||
@@ -5413,7 +5413,8 @@ void ObjectMgr::LoadAccessRequirements()
|
||||
AccessRequirement ar;
|
||||
|
||||
ar.levelMin = fields[1].GetUInt8();
|
||||
ar.levelMax = fields[2].GetUInt32();
|
||||
ar.levelMax = fields[2].GetUInt8();
|
||||
ar.heroicLevelMin = fields[11].GetUInt8();
|
||||
ar.item = fields[3].GetUInt32();
|
||||
ar.item2 = fields[4].GetUInt32();
|
||||
ar.heroicKey = fields[5].GetUInt32();
|
||||
|
||||
+11
-5
@@ -15686,12 +15686,18 @@ bool Player::Satisfy(AccessRequirement const *ar, uint32 target_map, bool report
|
||||
if(!isGameMaster() && ar)
|
||||
{
|
||||
uint32 LevelMin = 0;
|
||||
if(getLevel() < ar->levelMin && !sWorld.getConfig(CONFIG_INSTANCE_IGNORE_LEVEL))
|
||||
LevelMin = ar->levelMin;
|
||||
|
||||
uint32 LevelMax = 0;
|
||||
if(ar->levelMax >= ar->levelMin && getLevel() > ar->levelMax && !sWorld.getConfig(CONFIG_INSTANCE_IGNORE_LEVEL))
|
||||
LevelMax = ar->levelMax;
|
||||
|
||||
if(!sWorld.getConfig(CONFIG_INSTANCE_IGNORE_LEVEL))
|
||||
{
|
||||
if(ar->levelMin && getLevel() < ar->levelMin)
|
||||
LevelMin = ar->levelMin;
|
||||
else if(ar->heroicLevelMin && GetDifficulty() == DIFFICULTY_HEROIC
|
||||
&& getLevel() < ar->heroicLevelMin)
|
||||
LevelMin = ar->heroicLevelMin;
|
||||
if(ar->levelMax && getLevel() > ar->levelMax)
|
||||
LevelMax = ar->levelMax;
|
||||
}
|
||||
|
||||
uint32 missingItem = 0;
|
||||
if(ar->item)
|
||||
|
||||
@@ -759,6 +759,7 @@ struct AccessRequirement
|
||||
{
|
||||
uint8 levelMin;
|
||||
uint8 levelMax;
|
||||
uint8 heroicLevelMin;
|
||||
uint32 item;
|
||||
uint32 item2;
|
||||
uint32 heroicKey;
|
||||
|
||||
Reference in New Issue
Block a user