2010-10-07 15:35:36 +02:00
/*
2018-01-01 00:40:17 +01:00
* Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/>
2010-10-07 15:35:36 +02:00
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
2008-10-11 14:16:25 -05:00
*/
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
#include "QuestDef.h"
2017-06-04 01:00:45 +02:00
#include "DB2Stores.h"
2017-05-18 23:52:58 +02:00
#include "Field.h"
2016-06-24 23:12:03 +02:00
#include "GameTables.h"
2017-05-12 18:49:51 +02:00
#include "Log.h"
2017-12-04 17:35:37 +01:00
#include "ObjectMgr.h"
2008-10-11 14:16:25 -05:00
#include "Player.h"
2014-12-28 22:55:53 +02:00
#include "QuestPackets.h"
2017-06-04 01:00:45 +02:00
#include "World.h"
2009-10-17 15:51:44 -07:00
2011-09-15 14:08:17 +02:00
Quest :: Quest ( Field * questRecord )
2008-10-11 14:16:25 -05:00
{
2015-12-07 14:09:40 +01:00
EmoteOnIncomplete = 0 ;
EmoteOnComplete = 0 ;
_rewItemsCount = 0 ;
_rewChoiceItemsCount = 0 ;
_rewCurrencyCount = 0 ;
2014-12-29 20:48:40 +02:00
ID = questRecord [ 0 ]. GetUInt32 ();
Type = questRecord [ 1 ]. GetUInt8 ();
2014-12-28 22:55:53 +02:00
Level = questRecord [ 2 ]. GetInt32 ();
2018-02-10 01:24:00 +01:00
MaxScalingLevel = questRecord [ 3 ]. GetInt32 ();
PackageID = questRecord [ 4 ]. GetUInt32 ();
MinLevel = questRecord [ 5 ]. GetInt32 ();
QuestSortID = questRecord [ 6 ]. GetInt16 ();
QuestInfoID = questRecord [ 7 ]. GetUInt16 ();
SuggestedPlayers = questRecord [ 8 ]. GetUInt8 ();
NextQuestInChain = questRecord [ 9 ]. GetUInt32 ();
RewardXPDifficulty = questRecord [ 10 ]. GetUInt32 ();
RewardXPMultiplier = questRecord [ 11 ]. GetFloat ();
RewardMoney = questRecord [ 12 ]. GetUInt32 ();
RewardMoneyDifficulty = questRecord [ 13 ]. GetUInt32 ();
RewardMoneyMultiplier = questRecord [ 14 ]. GetFloat ();
RewardBonusMoney = questRecord [ 15 ]. GetUInt32 ();
2016-06-24 23:12:03 +02:00
for ( uint32 i = 0 ; i < QUEST_REWARD_DISPLAY_SPELL_COUNT ; ++ i )
2018-02-10 01:24:00 +01:00
RewardDisplaySpell [ i ] = questRecord [ 16 + i ]. GetUInt32 ();
RewardSpell = questRecord [ 19 ]. GetUInt32 ();
RewardHonor = questRecord [ 20 ]. GetUInt32 ();
RewardKillHonor = questRecord [ 21 ]. GetUInt32 ();
SourceItemId = questRecord [ 22 ]. GetUInt32 ();
RewardArtifactXPDifficulty = questRecord [ 23 ]. GetUInt32 ();
RewardArtifactXPMultiplier = questRecord [ 24 ]. GetFloat ();
RewardArtifactCategoryID = questRecord [ 25 ]. GetUInt32 ();
Flags = questRecord [ 26 ]. GetUInt32 ();
FlagsEx = questRecord [ 27 ]. GetUInt32 ();
2014-12-28 22:55:53 +02:00
for ( uint32 i = 0 ; i < QUEST_ITEM_DROP_COUNT ; ++ i )
{
2018-02-10 01:24:00 +01:00
RewardItemId [ i ] = questRecord [ 28 + i * 4 ]. GetUInt32 ();
RewardItemCount [ i ] = questRecord [ 29 + i * 4 ]. GetUInt32 ();
ItemDrop [ i ] = questRecord [ 30 + i * 4 ]. GetUInt32 ();
ItemDropQuantity [ i ] = questRecord [ 31 + i * 4 ]. GetUInt32 ();
2015-12-07 14:09:40 +01:00
if ( RewardItemId [ i ])
++ _rewItemsCount ;
2014-12-28 22:55:53 +02:00
}
2010-04-07 18:09:10 +02:00
2014-12-28 22:55:53 +02:00
for ( uint32 i = 0 ; i < QUEST_REWARD_CHOICES_COUNT ; ++ i )
{
2018-02-10 01:24:00 +01:00
RewardChoiceItemId [ i ] = questRecord [ 44 + i * 3 ]. GetUInt32 ();
RewardChoiceItemCount [ i ] = questRecord [ 45 + i * 3 ]. GetUInt32 ();
RewardChoiceItemDisplayId [ i ] = questRecord [ 46 + i * 3 ]. GetUInt32 ();
2015-12-07 14:09:40 +01:00
if ( RewardChoiceItemId [ i ])
++ _rewChoiceItemsCount ;
2014-12-28 22:55:53 +02:00
}
2012-01-07 17:13:42 +00:00
2018-02-10 01:24:00 +01:00
POIContinent = questRecord [ 62 ]. GetUInt32 ();
POIx = questRecord [ 63 ]. GetFloat ();
POIy = questRecord [ 64 ]. GetFloat ();
POIPriority = questRecord [ 65 ]. GetUInt32 ();
2010-04-07 18:09:10 +02:00
2018-02-10 01:24:00 +01:00
RewardTitleId = questRecord [ 66 ]. GetUInt32 ();
RewardArenaPoints = questRecord [ 67 ]. GetUInt32 ();
RewardSkillId = questRecord [ 68 ]. GetUInt32 ();
RewardSkillPoints = questRecord [ 69 ]. GetUInt32 ();
2010-04-07 18:09:10 +02:00
2018-02-10 01:24:00 +01:00
QuestGiverPortrait = questRecord [ 70 ]. GetUInt32 ();
QuestTurnInPortrait = questRecord [ 71 ]. GetUInt32 ();
2010-04-07 18:09:10 +02:00
2014-12-28 22:55:53 +02:00
for ( uint32 i = 0 ; i < QUEST_REWARD_REPUTATIONS_COUNT ; ++ i )
{
2018-02-10 01:24:00 +01:00
RewardFactionId [ i ] = questRecord [ 72 + i * 4 ]. GetUInt32 ();
RewardFactionValue [ i ] = questRecord [ 73 + i * 4 ]. GetInt32 ();
RewardFactionOverride [ i ] = questRecord [ 74 + i * 4 ]. GetInt32 ();
RewardFactionCapIn [ i ] = questRecord [ 75 + i * 4 ]. GetUInt32 ();
2014-12-28 22:55:53 +02:00
}
2010-04-07 18:09:10 +02:00
2018-02-10 01:24:00 +01:00
RewardReputationMask = questRecord [ 92 ]. GetUInt32 ();
2010-04-07 18:09:10 +02:00
2014-12-28 22:55:53 +02:00
for ( uint32 i = 0 ; i < QUEST_REWARD_CURRENCY_COUNT ; ++ i )
{
2018-02-10 01:24:00 +01:00
RewardCurrencyId [ i ] = questRecord [ 93 + i * 2 ]. GetUInt32 ();
RewardCurrencyCount [ i ] = questRecord [ 94 + i * 2 ]. GetUInt32 ();
2015-12-07 14:09:40 +01:00
if ( RewardCurrencyId [ i ])
++ _rewCurrencyCount ;
2014-12-28 22:55:53 +02:00
}
2010-04-07 18:09:10 +02:00
2018-02-10 01:24:00 +01:00
SoundAccept = questRecord [ 101 ]. GetUInt32 ();
SoundTurnIn = questRecord [ 102 ]. GetUInt32 ();
AreaGroupID = questRecord [ 103 ]. GetUInt32 ();
LimitTime = questRecord [ 104 ]. GetUInt32 ();
AllowableRaces = questRecord [ 105 ]. GetUInt64 ();
QuestRewardID = questRecord [ 106 ]. GetUInt32 ();
Expansion = questRecord [ 107 ]. GetInt32 ();
LogTitle = questRecord [ 108 ]. GetString ();
LogDescription = questRecord [ 109 ]. GetString ();
QuestDescription = questRecord [ 110 ]. GetString ();
AreaDescription = questRecord [ 111 ]. GetString ();
PortraitGiverText = questRecord [ 112 ]. GetString ();
PortraitGiverName = questRecord [ 113 ]. GetString ();
PortraitTurnInText = questRecord [ 114 ]. GetString ();
PortraitTurnInName = questRecord [ 115 ]. GetString ();
QuestCompletionLog = questRecord [ 116 ]. GetString ();
2016-06-24 23:12:03 +02:00
for ( uint32 i = 0 ; i < QUEST_EMOTE_COUNT ; ++ i )
2015-12-07 14:09:40 +01:00
{
2015-12-06 23:26:27 +01:00
DetailsEmote [ i ] = 0 ;
DetailsEmoteDelay [ i ] = 0 ;
OfferRewardEmote [ i ] = 0 ;
OfferRewardEmoteDelay [ i ] = 0 ;
2015-12-07 14:09:40 +01:00
}
2014-12-28 22:55:53 +02:00
}
2010-04-07 18:09:10 +02:00
2014-12-28 22:55:53 +02:00
void Quest :: LoadQuestDetails ( Field * fields )
{
2016-06-24 23:12:03 +02:00
for ( uint32 i = 0 ; i < QUEST_EMOTE_COUNT ; ++ i )
2016-06-28 18:01:03 +02:00
{
if ( ! sEmotesStore . LookupEntry ( fields [ 1 + i ]. GetUInt16 ()))
{
TC_LOG_ERROR ( "sql.sql" , "Table `quest_details` has non-existing Emote%i (%u) set for quest %u. Skipped." , 1 + i , fields [ 1 + i ]. GetUInt16 (), fields [ 0 ]. GetUInt32 ());
continue ;
}
2016-06-24 23:12:03 +02:00
DetailsEmote [ i ] = fields [ 1 + i ]. GetUInt16 ();
2016-06-28 18:01:03 +02:00
}
2010-04-07 18:09:10 +02:00
2016-06-24 23:12:03 +02:00
for ( uint32 i = 0 ; i < QUEST_EMOTE_COUNT ; ++ i )
DetailsEmoteDelay [ i ] = fields [ 5 + i ]. GetUInt32 ();
2014-12-28 22:55:53 +02:00
}
void Quest :: LoadQuestRequestItems ( Field * fields )
{
EmoteOnComplete = fields [ 1 ]. GetUInt16 ();
EmoteOnIncomplete = fields [ 2 ]. GetUInt16 ();
2016-06-28 18:01:03 +02:00
if ( ! sEmotesStore . LookupEntry ( EmoteOnComplete ))
TC_LOG_ERROR ( "sql.sql" , "Table `quest_request_items` has non-existing EmoteOnComplete (%u) set for quest %u." , EmoteOnComplete , fields [ 0 ]. GetUInt32 ());
if ( ! sEmotesStore . LookupEntry ( EmoteOnIncomplete ))
TC_LOG_ERROR ( "sql.sql" , "Table `quest_request_items` has non-existing EmoteOnIncomplete (%u) set for quest %u." , EmoteOnIncomplete , fields [ 0 ]. GetUInt32 ());
2014-12-28 22:55:53 +02:00
EmoteOnCompleteDelay = fields [ 3 ]. GetUInt32 ();
EmoteOnIncompleteDelay = fields [ 4 ]. GetUInt32 ();
RequestItemsText = fields [ 5 ]. GetString ();
}
2010-04-07 18:09:10 +02:00
2014-12-28 22:55:53 +02:00
void Quest :: LoadQuestOfferReward ( Field * fields )
{
2016-06-24 23:12:03 +02:00
for ( uint32 i = 0 ; i < QUEST_EMOTE_COUNT ; ++ i )
2016-06-28 18:01:03 +02:00
{
if ( ! sEmotesStore . LookupEntry ( fields [ 1 + i ]. GetUInt16 ()))
{
TC_LOG_ERROR ( "sql.sql" , "Table `quest_offer_reward` has non-existing Emote%i (%u) set for quest %u. Skipped." , 1 + i , fields [ 1 + i ]. GetUInt16 (), fields [ 0 ]. GetUInt32 ());
continue ;
}
2016-06-24 23:12:03 +02:00
OfferRewardEmote [ i ] = fields [ 1 + i ]. GetUInt16 ();
2016-06-28 18:01:03 +02:00
}
2010-04-07 18:09:10 +02:00
2016-06-24 23:12:03 +02:00
for ( uint32 i = 0 ; i < QUEST_EMOTE_COUNT ; ++ i )
OfferRewardEmoteDelay [ i ] = fields [ 5 + i ]. GetUInt32 ();
2011-11-26 03:00:06 +00:00
2014-12-28 22:55:53 +02:00
OfferRewardText = fields [ 9 ]. GetString ();
}
void Quest :: LoadQuestTemplateAddon ( Field * fields )
{
MaxLevel = fields [ 1 ]. GetUInt8 ();
AllowableClasses = fields [ 2 ]. GetUInt32 ();
SourceSpellID = fields [ 3 ]. GetUInt32 ();
PrevQuestID = fields [ 4 ]. GetInt32 ();
NextQuestID = fields [ 5 ]. GetInt32 ();
ExclusiveGroup = fields [ 6 ]. GetInt32 ();
RewardMailTemplateId = fields [ 7 ]. GetUInt32 ();
RewardMailDelay = fields [ 8 ]. GetUInt32 ();
RequiredSkillId = fields [ 9 ]. GetUInt16 ();
RequiredSkillPoints = fields [ 10 ]. GetUInt16 ();
RequiredMinRepFaction = fields [ 11 ]. GetUInt16 ();
RequiredMaxRepFaction = fields [ 12 ]. GetUInt16 ();
RequiredMinRepValue = fields [ 13 ]. GetInt32 ();
RequiredMaxRepValue = fields [ 14 ]. GetInt32 ();
SourceItemIdCount = fields [ 15 ]. GetUInt8 ();
2016-07-19 09:02:01 +02:00
RewardMailSenderEntry = fields [ 16 ]. GetUInt32 ();
SpecialFlags = fields [ 17 ]. GetUInt8 ();
2017-12-04 17:35:37 +01:00
ScriptId = sObjectMgr -> GetScriptId ( fields [ 18 ]. GetString ());
2009-10-17 15:51:44 -07:00
2014-07-10 13:22:15 -05:00
if ( SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT )
Flags |= QUEST_FLAGS_AUTO_ACCEPT ;
2014-12-28 22:55:53 +02:00
}
2014-07-10 13:22:15 -05:00
2014-12-28 22:55:53 +02:00
void Quest :: LoadQuestObjective ( Field * fields )
{
2014-12-29 20:48:40 +02:00
QuestObjective obj ;
2014-12-28 22:55:53 +02:00
obj . ID = fields [ 0 ]. GetUInt32 ();
2017-03-20 08:54:29 +01:00
obj . QuestID = fields [ 1 ]. GetUInt32 ();
2014-12-28 22:55:53 +02:00
obj . Type = fields [ 2 ]. GetUInt8 ();
2014-12-29 20:48:40 +02:00
obj . StorageIndex = fields [ 3 ]. GetInt8 ();
2014-12-28 22:55:53 +02:00
obj . ObjectID = fields [ 4 ]. GetInt32 ();
obj . Amount = fields [ 5 ]. GetInt32 ();
obj . Flags = fields [ 6 ]. GetUInt32 ();
2016-10-25 19:13:32 +02:00
obj . Flags2 = fields [ 7 ]. GetUInt32 ();
obj . ProgressBarWeight = fields [ 8 ]. GetFloat ();
obj . Description = fields [ 9 ]. GetString ();
2014-12-29 20:48:40 +02:00
Objectives . push_back ( obj );
2014-12-28 22:55:53 +02:00
}
2009-10-17 15:51:44 -07:00
2014-12-28 22:55:53 +02:00
void Quest :: LoadQuestObjectiveVisualEffect ( Field * fields )
{
2015-04-10 18:10:52 +02:00
uint32 objID = fields [ 1 ]. GetUInt32 ();
2009-10-17 15:51:44 -07:00
2014-12-29 20:48:40 +02:00
for ( QuestObjective & obj : Objectives )
{
if ( obj . ID == objID )
{
uint8 effectIndex = fields [ 3 ]. GetUInt8 ();
if ( effectIndex >= obj . VisualEffects . size ())
obj . VisualEffects . resize ( effectIndex + 1 , 0 );
2011-11-26 14:49:15 +00:00
2014-12-29 20:48:40 +02:00
obj . VisualEffects [ effectIndex ] = fields [ 4 ]. GetInt32 ();
break ;
}
}
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2014-12-28 22:55:53 +02:00
uint32 Quest :: XPValue ( uint32 playerLevel ) const
2008-10-11 14:16:25 -05:00
{
2014-12-28 22:55:53 +02:00
if ( playerLevel )
2008-10-11 14:16:25 -05:00
{
2016-06-24 23:12:03 +02:00
uint32 questLevel = uint32 ( Level == - 1 ? playerLevel : Level );
QuestXPEntry const * questXp = sQuestXPStore . LookupEntry ( questLevel );
2017-01-25 17:40:08 +01:00
if ( ! questXp || RewardXPDifficulty >= 10 )
2010-05-23 14:40:23 +02:00
return 0 ;
2016-06-24 23:12:03 +02:00
float multiplier = 1.0f ;
if ( questLevel != playerLevel )
multiplier = sXpGameTable . GetRow ( std :: min ( playerLevel , questLevel )) -> Divisor / sXpGameTable . GetRow ( playerLevel ) -> Divisor ;
int32 diffFactor = 2 * ( questLevel - playerLevel ) + 20 ;
2010-05-23 14:40:23 +02:00
if ( diffFactor < 1 )
diffFactor = 1 ;
else if ( diffFactor > 10 )
diffFactor = 10 ;
2018-03-12 18:20:26 +01:00
uint32 xp = diffFactor * questXp -> Difficulty [ RewardXPDifficulty ] * RewardXPMultiplier / 10 * multiplier ;
2010-05-23 14:40:23 +02:00
if ( xp <= 100 )
xp = 5 * (( xp + 2 ) / 5 );
else if ( xp <= 500 )
xp = 10 * (( xp + 5 ) / 10 );
else if ( xp <= 1000 )
xp = 25 * (( xp + 12 ) / 25 );
else
xp = 50 * (( xp + 25 ) / 50 );
return xp ;
2008-10-11 14:16:25 -05:00
}
2010-05-23 14:40:23 +02:00
2008-10-11 14:16:25 -05:00
return 0 ;
}
2009-10-17 15:51:44 -07:00
2015-07-01 17:57:09 -04:00
uint32 Quest :: MoneyValue ( uint8 playerLevel ) const
2008-10-11 14:16:25 -05:00
{
2015-07-04 02:43:43 +01:00
uint8 level = Level == - 1 ? playerLevel : Level ;
2015-07-01 17:57:09 -04:00
if ( QuestMoneyRewardEntry const * money = sQuestMoneyRewardStore . LookupEntry ( level ))
2018-03-12 18:20:26 +01:00
return money -> Difficulty [ GetRewMoneyDifficulty ()] * GetMoneyMultiplier ();
2014-12-29 20:48:40 +02:00
else
return 0 ;
2008-10-11 14:16:25 -05:00
}
2010-07-12 14:38:24 +02:00
2014-12-28 22:55:53 +02:00
void Quest :: BuildQuestRewards ( WorldPackets :: Quest :: QuestRewards & rewards , Player * player ) const
{
rewards . ChoiceItemCount = GetRewChoiceItemsCount ();
rewards . ItemCount = GetRewItemsCount ();
2015-07-01 17:57:09 -04:00
rewards . Money = player -> GetQuestMoneyReward ( this );
2014-12-28 22:55:53 +02:00
rewards . XP = player -> GetQuestXPReward ( this );
2016-06-28 20:23:09 +02:00
rewards . ArtifactCategoryID = GetArtifactCategoryId ();
2014-12-28 22:55:53 +02:00
rewards . Title = GetRewTitle ();
rewards . FactionFlags = GetRewardReputationMask ();
2016-06-24 23:12:03 +02:00
for ( uint32 i = 0 ; i < QUEST_REWARD_DISPLAY_SPELL_COUNT ; ++ i )
rewards . SpellCompletionDisplayID [ i ] = RewardDisplaySpell [ i ];
2014-12-28 22:55:53 +02:00
rewards . SpellCompletionID = GetRewSpell ();
rewards . SkillLineID = GetRewardSkillId ();
rewards . NumSkillUps = GetRewardSkillPoints ();
2016-06-24 23:12:03 +02:00
rewards . RewardID = GetRewardId ();
2014-12-28 22:55:53 +02:00
for ( uint32 i = 0 ; i < QUEST_REWARD_CHOICES_COUNT ; ++ i )
{
rewards . ChoiceItems [ i ]. ItemID = RewardChoiceItemId [ i ];
rewards . ChoiceItems [ i ]. Quantity = RewardChoiceItemCount [ i ];
}
for ( uint32 i = 0 ; i < QUEST_REWARD_ITEM_COUNT ; ++ i )
{
rewards . ItemID [ i ] = RewardItemId [ i ];
rewards . ItemQty [ i ] = RewardItemCount [ i ];
}
for ( uint32 i = 0 ; i < QUEST_REWARD_REPUTATIONS_COUNT ; ++ i )
{
rewards . FactionID [ i ] = RewardFactionId [ i ];
rewards . FactionValue [ i ] = RewardFactionValue [ i ];
rewards . FactionOverride [ i ] = RewardFactionOverride [ i ];
2016-06-24 23:12:03 +02:00
rewards . FactionCapIn [ i ] = RewardFactionCapIn [ i ];
2014-12-28 22:55:53 +02:00
}
for ( uint32 i = 0 ; i < QUEST_REWARD_CURRENCY_COUNT ; ++ i )
{
rewards . CurrencyID [ i ] = RewardCurrencyId [ i ];
rewards . CurrencyQty [ i ] = RewardCurrencyCount [ i ];
}
}
2013-02-26 16:57:11 +01:00
uint32 Quest :: GetRewMoneyMaxLevel () const
{
2014-08-20 23:43:56 +02:00
// If Quest has flag to not give money on max level, it's 0
2013-02-26 16:57:11 +01:00
if ( HasFlag ( QUEST_FLAGS_NO_MONEY_FROM_XP ))
return 0 ;
2014-08-20 23:43:56 +02:00
// Else, return the rewarded copper sum modified by the rate
2014-12-28 22:55:53 +02:00
return uint32 ( RewardBonusMoney * sWorld -> getRate ( RATE_MONEY_MAX_LEVEL_QUEST ));
2013-02-26 16:57:11 +01:00
}
2012-02-08 20:01:38 -06:00
bool Quest :: IsAutoAccept () const
{
2014-07-17 15:42:57 +02:00
return ! sWorld -> getBoolConfig ( CONFIG_QUEST_IGNORE_AUTO_ACCEPT ) && HasFlag ( QUEST_FLAGS_AUTO_ACCEPT );
2012-02-08 20:01:38 -06:00
}
2011-10-20 17:53:46 +01:00
bool Quest :: IsAutoComplete () const
{
2014-12-29 20:48:40 +02:00
return ! sWorld -> getBoolConfig ( CONFIG_QUEST_IGNORE_AUTO_COMPLETE ) && Type == QUEST_TYPE_AUTOCOMPLETE ;
2011-10-20 17:53:46 +01:00
}
2012-12-24 19:53:28 +01:00
bool Quest :: IsRaidQuest ( Difficulty difficulty ) const
2010-07-12 14:38:24 +02:00
{
2017-04-23 02:20:19 +02:00
switch ( QuestInfoID )
2012-12-24 19:53:28 +01:00
{
2014-12-29 20:48:40 +02:00
case QUEST_INFO_RAID :
2012-12-24 19:53:28 +01:00
return true ;
2014-12-29 20:48:40 +02:00
case QUEST_INFO_RAID_10 :
2015-01-10 01:35:47 +01:00
return difficulty == DIFFICULTY_10_N || difficulty == DIFFICULTY_10_HC ;
2014-12-29 20:48:40 +02:00
case QUEST_INFO_RAID_25 :
2015-01-10 01:35:47 +01:00
return difficulty == DIFFICULTY_25_N || difficulty == DIFFICULTY_25_HC ;
2012-12-24 19:53:28 +01:00
default :
break ;
}
2016-07-11 10:15:51 +02:00
if (( Flags & QUEST_FLAGS_RAID ) != 0 )
return true ;
2012-12-24 19:53:28 +01:00
return false ;
}
bool Quest :: IsAllowedInRaid ( Difficulty difficulty ) const
{
if ( IsRaidQuest ( difficulty ))
2010-07-12 14:38:24 +02:00
return true ;
2010-12-23 23:25:44 +01:00
return sWorld -> getBoolConfig ( CONFIG_QUEST_IGNORE_RAID );
2010-07-12 14:38:24 +02:00
}
2011-01-31 16:27:23 +01:00
2015-03-22 13:47:55 +01:00
uint32 Quest :: CalculateHonorGain ( uint8 /*level*/ ) const
2011-01-31 16:27:23 +01:00
{
uint32 honor = 0 ;
2011-11-23 13:16:45 +01:00
/*if (GetRewHonorAddition() > 0 || GetRewHonorMultiplier() > 0.0f)
2011-01-31 16:27:23 +01:00
{
// values stored from 0.. for 1...
2012-08-28 12:03:39 +02:00
TeamContributionPointsEntry const* tc = sTeamContributionPointsStore.LookupEntry(level);
2011-01-31 16:27:23 +01:00
if (!tc)
return 0;
2012-08-28 12:03:39 +02:00
honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1f);
2011-01-31 16:27:23 +01:00
honor += GetRewHonorAddition();
2011-11-23 13:16:45 +01:00
}*/
2011-01-31 16:27:23 +01:00
return honor ;
}
2016-07-05 09:53:08 +02:00
bool Quest :: CanIncreaseRewardedQuestCounters () const
{
// Dungeon Finder/Daily/Repeatable (if not weekly, monthly or seasonal) quests are never considered rewarded serverside.
// This affects counters and client requests for completed quests.
return ( ! IsDFQuest () && ! IsDaily () && ( ! IsRepeatable () || IsWeekly () || IsMonthly () || IsSeasonal ()));
}