Core/Quests: Fix quest honor reward
Based on the patch of Tassader Closes #1356
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
#include "AuthCodes.h"
|
||||
#include <cstddef>
|
||||
|
||||
namespace AuthHelper
|
||||
{
|
||||
|
||||
@@ -185,7 +185,6 @@ DBCStorage <TaxiPathEntry> sTaxiPathStore(TaxiPathEntryfmt);
|
||||
TaxiPathNodesByPath sTaxiPathNodesByPath;
|
||||
static DBCStorage <TaxiPathNodeEntry> sTaxiPathNodeStore(TaxiPathNodeEntryfmt);
|
||||
|
||||
DBCStorage <TeamContributionPointsEntry> sTeamContributionPointsStore(TeamContributionPointsfmt);
|
||||
DBCStorage <TotemCategoryEntry> sTotemCategoryStore(TotemCategoryEntryfmt);
|
||||
DBCStorage <VehicleEntry> sVehicleStore(VehicleEntryfmt);
|
||||
DBCStorage <VehicleSeatEntry> sVehicleSeatStore(VehicleSeatEntryfmt);
|
||||
@@ -593,7 +592,6 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
}
|
||||
}
|
||||
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sTeamContributionPointsStore, dbcPath, "TeamContributionPoints.dbc");
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sTotemCategoryStore, dbcPath, "TotemCategory.dbc");
|
||||
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sVehicleStore, dbcPath, "Vehicle.dbc");
|
||||
|
||||
@@ -164,7 +164,6 @@ extern TaxiMask sAllianceTaxiNodesMask;
|
||||
extern TaxiMask sDeathKnightTaxiNodesMask;
|
||||
extern TaxiPathSetBySource sTaxiPathSetBySource;
|
||||
extern TaxiPathNodesByPath sTaxiPathNodesByPath;
|
||||
extern DBCStorage <TeamContributionPointsEntry> sTeamContributionPointsStore;
|
||||
extern DBCStorage <TotemCategoryEntry> sTotemCategoryStore;
|
||||
extern DBCStorage <VehicleEntry> sVehicleStore;
|
||||
extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore;
|
||||
|
||||
@@ -1845,12 +1845,6 @@ struct TaxiPathNodeEntry
|
||||
uint32 departureEventID; // 10 m_departureEventID
|
||||
};
|
||||
|
||||
struct TeamContributionPointsEntry
|
||||
{
|
||||
//uint32 entry; // 0
|
||||
float value; // 1 (???)
|
||||
};
|
||||
|
||||
struct TotemCategoryEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
|
||||
@@ -117,7 +117,6 @@ const char TalentTabEntryfmt[]="nxxxxxxxxxxxxxxxxxxxiiix";
|
||||
const char TaxiNodesEntryfmt[]="nifffssssssssssssssssxii";
|
||||
const char TaxiPathEntryfmt[]="niii";
|
||||
const char TaxiPathNodeEntryfmt[]="diiifffiiii";
|
||||
const char TeamContributionPointsfmt[]="df";
|
||||
const char TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii";
|
||||
const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifiixx";
|
||||
const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxx";
|
||||
|
||||
@@ -15127,8 +15127,10 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
}
|
||||
|
||||
// honor reward
|
||||
if (uint32 honor = quest->CalculateHonorGain(getLevel()))
|
||||
RewardHonor(NULL, 0, honor);
|
||||
if (quest->GetRewHonorAddition())
|
||||
ModifyHonorPoints(quest->GetRewHonorAddition());
|
||||
if (quest->GetRewHonorMultiplier())
|
||||
ModifyHonorPoints(Trinity::Honor::hk_honor_at_level(getLevel(), quest->GetRewHonorMultiplier()));
|
||||
|
||||
// title reward
|
||||
if (quest->GetCharTitleId())
|
||||
|
||||
@@ -227,23 +227,3 @@ bool Quest::IsAllowedInRaid() const
|
||||
|
||||
return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_RAID);
|
||||
}
|
||||
|
||||
uint32 Quest::CalculateHonorGain(uint8 level) const
|
||||
{
|
||||
if (level > GT_MAX_LEVEL)
|
||||
level = GT_MAX_LEVEL;
|
||||
|
||||
uint32 honor = 0;
|
||||
|
||||
if (GetRewHonorAddition() > 0 || GetRewHonorMultiplier() > 0.0f)
|
||||
{
|
||||
// values stored from 0.. for 1...
|
||||
TeamContributionPointsEntry const* tc = sTeamContributionPointsStore.LookupEntry(level-1);
|
||||
if (!tc)
|
||||
return 0;
|
||||
honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1000000014901161);
|
||||
honor += GetRewHonorAddition();
|
||||
}
|
||||
|
||||
return honor;
|
||||
}
|
||||
|
||||
@@ -257,7 +257,6 @@ class Quest
|
||||
bool IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; }
|
||||
bool IsAllowedInRaid() const;
|
||||
bool IsDFQuest() const { return Flags & QUEST_TRINITY_FLAGS_DF_QUEST; }
|
||||
uint32 CalculateHonorGain(uint8 level) const;
|
||||
|
||||
// multiple values
|
||||
std::string ObjectiveText[QUEST_OBJECTIVES_COUNT];
|
||||
|
||||
Reference in New Issue
Block a user