Added support for all raid quest types

Added new config option to allow non-raid quest progression when in raid group

code by Vladimir

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-07-12 14:38:24 +02:00
parent 7a8d464b19
commit 5ad02b578d
7 changed files with 24 additions and 5 deletions
+3 -3
View File
@@ -15168,7 +15168,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid)
continue;
// just if !ingroup || !noraidgroup || raidgroup
QuestStatusData& q_status = mQuestStatus[questid];
if (q_status.m_status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->GetType() == QUEST_TYPE_RAID))
if (q_status.m_status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid()))
{
if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST))
{
@@ -15451,7 +15451,7 @@ bool Player::HasQuestForItem(uint32 itemid) const
continue;
// hide quest if player is in raid-group and quest is no raid quest
if (GetGroup() && GetGroup()->isRaidGroup() && qinfo->GetType() != QUEST_TYPE_RAID)
if (GetGroup() && GetGroup()->isRaidGroup() && !qinfo->IsAllowedInRaid())
if (!InBattleGround()) //there are two ways.. we can make every bg-quest a raidquest, or add this code here.. i don't know if this can be exploited by other quests, but i think all other quests depend on a specific area.. but keep this in mind, if something strange happens later
continue;
@@ -21397,7 +21397,7 @@ bool Player::HasQuestForGO(int32 GOId) const
if (!qinfo)
continue;
if (GetGroup() && GetGroup()->isRaidGroup() && qinfo->GetType() != QUEST_TYPE_RAID)
if (GetGroup() && GetGroup()->isRaidGroup() && !qinfo->IsAllowedInRaid())
continue;
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
+9 -1
View File
@@ -175,7 +175,7 @@ uint32 Quest::XPValue(Player *pPlayer) const
if (!xpentry)
return 0;
int diffFactor = 2 * (quest_level - pPlayer->getLevel()) + 20;
int32 diffFactor = 2 * (quest_level - pPlayer->getLevel()) + 20;
if (diffFactor < 1)
diffFactor = 1;
else if (diffFactor > 10)
@@ -204,3 +204,11 @@ int32 Quest::GetRewOrReqMoney() const
return int32(RewOrReqMoney * sWorld.getRate(RATE_DROP_MONEY));
}
bool Quest::IsAllowedInRaid() const
{
if (IsRaidQuest())
return true;
return sWorld.getConfig(CONFIG_QUEST_IGNORE_RAID);
}
+3
View File
@@ -23,6 +23,7 @@
#include "Define.h"
#include "DatabaseEnv.h"
#include "SharedDefines.h"
#include <string>
#include <vector>
@@ -244,6 +245,8 @@ class Quest
bool IsWeekly() const { return QuestFlags & QUEST_FLAGS_WEEKLY; }
bool IsDailyOrWeekly() const { return QuestFlags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); }
bool IsAutoAccept() const { return QuestFlags & QUEST_FLAGS_AUTO_ACCEPT; }
bool IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; }
bool IsAllowedInRaid() const;
// multiple values
std::string ObjectiveText[QUEST_OBJECTIVES_COUNT];
@@ -422,7 +422,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data)
if (!pOriginalPlayer)
return;
if (pQuest->GetType() == QUEST_TYPE_RAID)
if (pQuest->IsRaidQuest())
{
if (!_player->IsInSameRaidWith(pOriginalPlayer))
return;
+1
View File
@@ -1013,6 +1013,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = sConfig.GetIntDefault("Quests.HighLevelHideDiff", 7);
if (m_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] > MAX_LEVEL)
m_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = MAX_LEVEL;
m_configs[CONFIG_QUEST_IGNORE_RAID] = sConfig.GetBoolDefault("Quests.IgnoreRaid", false);
m_configs[CONFIG_RANDOM_BG_RESET_HOUR] = sConfig.GetIntDefault("BattleGround.Random.ResetHour", 6);
if (m_configs[CONFIG_RANDOM_BG_RESET_HOUR] < 0 || m_configs[CONFIG_RANDOM_BG_RESET_HOUR] > 23)
+1
View File
@@ -188,6 +188,7 @@ enum WorldConfigs
CONFIG_WORLD_BOSS_LEVEL_DIFF,
CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF,
CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF,
CONFIG_QUEST_IGNORE_RAID,
CONFIG_DETECT_POS_COLLISION,
CONFIG_RESTRICTED_LFG_CHANNEL,
CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL,
@@ -811,6 +811,11 @@ ChatLogTimestamp = 0
# Default: 7
# -1 (show all available quests marks)
#
# Quests.IgnoreRaid
# Allow non-raid quests to be completed when in raid group
# Default: 0 (false)
# 1 (true)
#
# Guild.EventLogRecordsCount
# Count of guild event log records stored in guild_eventlog table
# Increase to store more guild events in table, minimum is 100
@@ -928,6 +933,7 @@ Instance.ResetTimeHour = 4
Instance.UnloadDelay = 1800000
Quests.LowLevelHideDiff = 4
Quests.HighLevelHideDiff = 7
Quests.IgnoreRaid = 0
Guild.EventLogRecordsCount = 100
Guild.BankEventLogRecordsCount = 25
MaxPrimaryTradeSkill = 2