*Add column heroic_level_min in table access_requirement

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-08 15:31:04 -05:00
parent 0555ec4a35
commit 6578cce471
4 changed files with 17 additions and 8 deletions
+4 -3
View File
@@ -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
View File
@@ -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)
+1
View File
@@ -759,6 +759,7 @@ struct AccessRequirement
{
uint8 levelMin;
uint8 levelMax;
uint8 heroicLevelMin;
uint32 item;
uint32 item2;
uint32 heroicKey;