Core/Quests: Implemented proper calculation of quest honor reward using DBC

Signed-off-by: Shauren <[email protected]>
This commit is contained in:
TOM_RUS
2011-01-31 16:27:23 +01:00
committed by Shauren
parent 82b7f30271
commit c006f1b904
7 changed files with 34 additions and 6 deletions
+3 -2
View File
@@ -181,6 +181,7 @@ 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);
@@ -245,8 +246,7 @@ void LoadDBCStores(const std::string& dataPath)
uint32 oldMSTime = getMSTime();
std::string dbcPath = dataPath+"dbc/";
const uint32 DBCFilesCount = 90;
const uint32 DBCFilesCount = 91;
StoreProblemList bad_dbc_files;
uint32 availableDbcLocales = 0xFFFFFFFF;
@@ -575,6 +575,7 @@ 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");
LoadDBC(availableDbcLocales,bad_dbc_files,sVehicleSeatStore, dbcPath,"VehicleSeat.dbc");
+1
View File
@@ -157,6 +157,7 @@ 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;
@@ -1749,6 +1749,12 @@ struct TaxiPathNodeEntry
uint32 departureEventID; // 10 m_departureEventID
};
struct TeamContributionPointsEntry
{
//uint32 entry; // 0
float value; // 1 (???)
};
struct TotemCategoryEntry
{
uint32 ID; // 0
+1
View File
@@ -110,6 +110,7 @@ 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";
+2 -4
View File
@@ -14694,10 +14694,8 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver,
}
// honor reward
if (pQuest->GetRewHonorAddition())
RewardHonor(NULL, 0, pQuest->GetRewHonorAddition());
if (pQuest->GetRewHonorMultiplier())
RewardHonor(NULL, 0, Trinity::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorMultiplier()));
if (uint32 honor = pQuest->CalculateHonorGain(getLevel()))
RewardHonor(NULL, 0, honor);
// title reward
if (pQuest->GetCharTitleId())
+20
View File
@@ -212,3 +212,23 @@ 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;
}
+1
View File
@@ -253,6 +253,7 @@ 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 QuestFlags & QUEST_TRINITY_FLAGS_DF_QUEST; }
uint32 CalculateHonorGain(uint8 level) const;
// multiple values
std::string ObjectiveText[QUEST_OBJECTIVES_COUNT];