diff options
-rw-r--r-- | sql/updates/6241_world_quest_template.sql | 5 | ||||
-rw-r--r-- | sql/world.sql | 2 | ||||
-rw-r--r-- | src/game/Player.h | 2 | ||||
-rw-r--r-- | src/game/QuestDef.cpp | 18 | ||||
-rw-r--r-- | src/game/QuestHandler.cpp | 2 |
5 files changed, 17 insertions, 12 deletions
diff --git a/sql/updates/6241_world_quest_template.sql b/sql/updates/6241_world_quest_template.sql new file mode 100644 index 00000000000..bc1fe74c2c3 --- /dev/null +++ b/sql/updates/6241_world_quest_template.sql @@ -0,0 +1,5 @@ +-- Change column QuestLevel to allowed -1 value. +ALTER TABLE `quest_template` CHANGE `QuestLevel` `QuestLeveltemp` INT(8); +ALTER TABLE `quest_template` ADD `QuestLevel` SMALLINT(3) AFTER `QuestLeveltemp`; +UPDATE `quest_template` SET `QuestLevel` = `QuestLeveltemp`; +ALTER TABLE `quest_template` DROP `QuestLeveltemp`; diff --git a/sql/world.sql b/sql/world.sql index 391aae19be6..1c24a339b95 100644 --- a/sql/world.sql +++ b/sql/world.sql @@ -2430,7 +2430,7 @@ CREATE TABLE `quest_template` ( `ZoneOrSort` smallint(6) NOT NULL default '0', `SkillOrClass` smallint(6) NOT NULL default '0', `MinLevel` tinyint(3) unsigned NOT NULL default '0', - `QuestLevel` tinyint(3) unsigned NOT NULL default '0', + `QuestLevel` smallint(3) NOT NULL default '0', `Type` smallint(5) unsigned NOT NULL default '0', `RequiredRaces` smallint(5) unsigned NOT NULL default '0', `RequiredSkillValue` smallint(5) unsigned NOT NULL default '0', diff --git a/src/game/Player.h b/src/game/Player.h index 8c0212f3ded..bc54f5c3f6b 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1211,7 +1211,7 @@ class MANGOS_DLL_SPEC Player : public Unit /*** QUEST SYSTEM ***/ /*********************************************************/ - uint32 GetQuestLevel( Quest const* pQuest ) const { return pQuest && pQuest->GetQuestLevel() ? pQuest->GetQuestLevel() : getLevel(); } + int32 GetQuestLevel( Quest const* pQuest ) const { return pQuest && pQuest->GetQuestLevel() ? pQuest->GetQuestLevel() : getLevel(); } void PrepareQuestMenu( uint64 guid ); void SendPreparedQuest( uint64 guid ); diff --git a/src/game/QuestDef.cpp b/src/game/QuestDef.cpp index 013d6da1f0f..1c429178fda 100644 --- a/src/game/QuestDef.cpp +++ b/src/game/QuestDef.cpp @@ -29,7 +29,7 @@ Quest::Quest(Field * questRecord) ZoneOrSort = questRecord[2].GetInt32(); SkillOrClass = questRecord[3].GetInt32(); MinLevel = questRecord[4].GetUInt32(); - QuestLevel = questRecord[5].GetUInt32(); + QuestLevel = questRecord[5].GetInt32(); Type = questRecord[6].GetUInt32(); RequiredRaces = questRecord[7].GetUInt32(); RequiredSkillValue = questRecord[8].GetUInt32(); @@ -167,7 +167,7 @@ uint32 Quest::XPValue( Player *pPlayer ) const if( RewMoneyMaxLevel > 0 ) { uint32 pLevel = pPlayer->getLevel(); - uint32 qLevel = QuestLevel; + int32 qLevel = QuestLevel; float fullxp = 0; if (qLevel >= 15) fullxp = RewMoneyMaxLevel / 6.0f; @@ -181,18 +181,18 @@ uint32 Quest::XPValue( Player *pPlayer ) const fullxp = RewMoneyMaxLevel / 1.2f; else if (qLevel >= 1 && qLevel <= 10) fullxp = RewMoneyMaxLevel / 0.6f; - else if (qLevel == 0) + else if (qLevel <= 0) fullxp = RewMoneyMaxLevel; - if( pLevel <= qLevel + 5 ) + if ((pLevel <= qLevel + 5) || qLevel == -1) return (uint32)fullxp; - else if( pLevel == qLevel + 6 ) + else if (pLevel == qLevel + 6) return (uint32)(fullxp * 0.8f); - else if( pLevel == qLevel + 7 ) + else if (pLevel == qLevel + 7) return (uint32)(fullxp * 0.6f); - else if( pLevel == qLevel + 8 ) + else if (pLevel == qLevel + 8) return (uint32)(fullxp * 0.4f); - else if( pLevel == qLevel + 9 ) + else if (pLevel == qLevel + 9) return (uint32)(fullxp * 0.2f); else return (uint32)(fullxp * 0.1f); @@ -203,7 +203,7 @@ uint32 Quest::XPValue( Player *pPlayer ) const int32 Quest::GetRewOrReqMoney() const { - if(RewOrReqMoney <=0) + if(RewOrReqMoney <= 0) return RewOrReqMoney; return int32(RewOrReqMoney * sWorld.getRate(RATE_DROP_MONEY)); diff --git a/src/game/QuestHandler.cpp b/src/game/QuestHandler.cpp index ae1c23ba08e..b60e901417d 100644 --- a/src/game/QuestHandler.cpp +++ b/src/game/QuestHandler.cpp @@ -566,7 +566,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32 { if ( pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && pPlayer->getQuestStatusMap()[quest_id].m_rewarded)) result2 = DIALOG_STATUS_REWARD_REP; - else if (pPlayer->getLevel() <= pPlayer->GetQuestLevel(pQuest) + sWorld.getConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF) ) + else if (pPlayer->getLevel() <= ((pPlayer->GetQuestLevel(pQuest) == -1) ? pPlayer->getLevel() : pPlayer->GetQuestLevel(pQuest) + sWorld.getConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF))) { if (pQuest->IsDaily()) result2 = DIALOG_STATUS_AVAILABLE_REP; |