Core/Quests: Fix quest honor reward

Based on the patch of Tassader
Closes #1356
This commit is contained in:
Nay
2012-08-28 00:25:49 +01:00
parent ad8010730c
commit 154aaa0ad5
8 changed files with 5 additions and 33 deletions
@@ -16,6 +16,7 @@
*/ */
#include "AuthCodes.h" #include "AuthCodes.h"
#include <cstddef>
namespace AuthHelper namespace AuthHelper
{ {
-2
View File
@@ -185,7 +185,6 @@ DBCStorage <TaxiPathEntry> sTaxiPathStore(TaxiPathEntryfmt);
TaxiPathNodesByPath sTaxiPathNodesByPath; TaxiPathNodesByPath sTaxiPathNodesByPath;
static DBCStorage <TaxiPathNodeEntry> sTaxiPathNodeStore(TaxiPathNodeEntryfmt); static DBCStorage <TaxiPathNodeEntry> sTaxiPathNodeStore(TaxiPathNodeEntryfmt);
DBCStorage <TeamContributionPointsEntry> sTeamContributionPointsStore(TeamContributionPointsfmt);
DBCStorage <TotemCategoryEntry> sTotemCategoryStore(TotemCategoryEntryfmt); DBCStorage <TotemCategoryEntry> sTotemCategoryStore(TotemCategoryEntryfmt);
DBCStorage <VehicleEntry> sVehicleStore(VehicleEntryfmt); DBCStorage <VehicleEntry> sVehicleStore(VehicleEntryfmt);
DBCStorage <VehicleSeatEntry> sVehicleSeatStore(VehicleSeatEntryfmt); 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, sTotemCategoryStore, dbcPath, "TotemCategory.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sVehicleStore, dbcPath, "Vehicle.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sVehicleStore, dbcPath, "Vehicle.dbc");
-1
View File
@@ -164,7 +164,6 @@ extern TaxiMask sAllianceTaxiNodesMask;
extern TaxiMask sDeathKnightTaxiNodesMask; extern TaxiMask sDeathKnightTaxiNodesMask;
extern TaxiPathSetBySource sTaxiPathSetBySource; extern TaxiPathSetBySource sTaxiPathSetBySource;
extern TaxiPathNodesByPath sTaxiPathNodesByPath; extern TaxiPathNodesByPath sTaxiPathNodesByPath;
extern DBCStorage <TeamContributionPointsEntry> sTeamContributionPointsStore;
extern DBCStorage <TotemCategoryEntry> sTotemCategoryStore; extern DBCStorage <TotemCategoryEntry> sTotemCategoryStore;
extern DBCStorage <VehicleEntry> sVehicleStore; extern DBCStorage <VehicleEntry> sVehicleStore;
extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore; extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore;
@@ -1845,12 +1845,6 @@ struct TaxiPathNodeEntry
uint32 departureEventID; // 10 m_departureEventID uint32 departureEventID; // 10 m_departureEventID
}; };
struct TeamContributionPointsEntry
{
//uint32 entry; // 0
float value; // 1 (???)
};
struct TotemCategoryEntry struct TotemCategoryEntry
{ {
uint32 ID; // 0 uint32 ID; // 0
-1
View File
@@ -117,7 +117,6 @@ const char TalentTabEntryfmt[]="nxxxxxxxxxxxxxxxxxxxiiix";
const char TaxiNodesEntryfmt[]="nifffssssssssssssssssxii"; const char TaxiNodesEntryfmt[]="nifffssssssssssssssssxii";
const char TaxiPathEntryfmt[]="niii"; const char TaxiPathEntryfmt[]="niii";
const char TaxiPathNodeEntryfmt[]="diiifffiiii"; const char TaxiPathNodeEntryfmt[]="diiifffiiii";
const char TeamContributionPointsfmt[]="df";
const char TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii"; const char TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii";
const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifiixx"; const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifiixx";
const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxx"; const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxx";
+4 -2
View File
@@ -15127,8 +15127,10 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
} }
// honor reward // honor reward
if (uint32 honor = quest->CalculateHonorGain(getLevel())) if (quest->GetRewHonorAddition())
RewardHonor(NULL, 0, honor); ModifyHonorPoints(quest->GetRewHonorAddition());
if (quest->GetRewHonorMultiplier())
ModifyHonorPoints(Trinity::Honor::hk_honor_at_level(getLevel(), quest->GetRewHonorMultiplier()));
// title reward // title reward
if (quest->GetCharTitleId()) if (quest->GetCharTitleId())
-20
View File
@@ -227,23 +227,3 @@ bool Quest::IsAllowedInRaid() const
return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_RAID); 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;
}
-1
View File
@@ -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 IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; }
bool IsAllowedInRaid() const; bool IsAllowedInRaid() const;
bool IsDFQuest() const { return Flags & QUEST_TRINITY_FLAGS_DF_QUEST; } bool IsDFQuest() const { return Flags & QUEST_TRINITY_FLAGS_DF_QUEST; }
uint32 CalculateHonorGain(uint8 level) const;
// multiple values // multiple values
std::string ObjectiveText[QUEST_OBJECTIVES_COUNT]; std::string ObjectiveText[QUEST_OBJECTIVES_COUNT];