diff options
author | megamage <none@none> | 2009-06-08 15:31:04 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-08 15:31:04 -0500 |
commit | 6578cce47133eb017a7ab6b14c91d6c5b80b226a (patch) | |
tree | 230ba6efafd225e5f5e7fb8805774188903a833e | |
parent | 0555ec4a35e1ec78efa09fdfc721addd603ea0cd (diff) |
*Add column heroic_level_min in table access_requirement
--HG--
branch : trunk
-rw-r--r-- | sql/updates/3869_world_access_requirement.sql | 1 | ||||
-rw-r--r-- | src/game/ObjectMgr.cpp | 7 | ||||
-rw-r--r-- | src/game/Player.cpp | 16 | ||||
-rw-r--r-- | src/game/Player.h | 1 |
4 files changed, 17 insertions, 8 deletions
diff --git a/sql/updates/3869_world_access_requirement.sql b/sql/updates/3869_world_access_requirement.sql new file mode 100644 index 00000000000..4ead0543c48 --- /dev/null +++ b/sql/updates/3869_world_access_requirement.sql @@ -0,0 +1 @@ +ALTER TABLE `access_requirement` ADD COLUMN `heroic_level_min` tinyint(3) unsigned NOT NULL default '0' AFTER `level_min`;
\ No newline at end of file diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 8f87e58ed26..8c0e5d6e1bd 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -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(); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 5d804b66537..d647768d3e0 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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) diff --git a/src/game/Player.h b/src/game/Player.h index a2a2135024c..379bb606f7a 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -759,6 +759,7 @@ struct AccessRequirement { uint8 levelMin; uint8 levelMax; + uint8 heroicLevelMin; uint32 item; uint32 item2; uint32 heroicKey; |