mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[10719] Implement proper calculation quest honor reward.
Now server side rewar same as reported at client side. Also thanks to KiriX for patch prepering to commit and testing. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
c9dacb9940
commit
ff66e20468
8 changed files with 37 additions and 4 deletions
|
|
@ -175,6 +175,7 @@ DBCStorage <TaxiPathEntry> sTaxiPathStore(TaxiPathEntryfmt);
|
|||
TaxiPathNodesByPath sTaxiPathNodesByPath;
|
||||
static DBCStorage <TaxiPathNodeEntry> sTaxiPathNodeStore(TaxiPathNodeEntryfmt);
|
||||
|
||||
DBCStorage <TeamContributionPoints> sTeamContributionPoints(TeamContributionPointsfmt);
|
||||
DBCStorage <TotemCategoryEntry> sTotemCategoryStore(TotemCategoryEntryfmt);
|
||||
DBCStorage <VehicleEntry> sVehicleStore(VehicleEntryfmt);
|
||||
DBCStorage <VehicleSeatEntry> sVehicleSeatStore(VehicleSeatEntryfmt);
|
||||
|
|
@ -357,7 +358,7 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
const uint32 DBCFilesCount = 87;
|
||||
const uint32 DBCFilesCount = 88;
|
||||
|
||||
barGoLink bar( (int)DBCFilesCount );
|
||||
|
||||
|
|
@ -632,6 +633,7 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
}
|
||||
}
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTeamContributionPoints, dbcPath,"TeamContributionPoints.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTotemCategoryStore, dbcPath,"TotemCategory.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleStore, dbcPath,"Vehicle.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleSeatStore, dbcPath,"VehicleSeat.dbc");
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@ extern TaxiMask sTaxiNodesMask;
|
|||
extern TaxiMask sOldContinentsNodesMask;
|
||||
extern TaxiPathSetBySource sTaxiPathSetBySource;
|
||||
extern TaxiPathNodesByPath sTaxiPathNodesByPath;
|
||||
extern DBCStorage <TeamContributionPoints> sTeamContributionPoints;
|
||||
extern DBCStorage <TotemCategoryEntry> sTotemCategoryStore;
|
||||
extern DBCStorage <VehicleEntry> sVehicleStore;
|
||||
extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore;
|
||||
|
|
|
|||
|
|
@ -1704,6 +1704,12 @@ struct TaxiPathNodeEntry
|
|||
uint32 departureEventID; // 10 m_departureEventID
|
||||
};
|
||||
|
||||
struct TeamContributionPoints
|
||||
{
|
||||
//uint32 Entry; // 0
|
||||
float Value; // 1 (???)
|
||||
};
|
||||
|
||||
struct TotemCategoryEntry
|
||||
{
|
||||
uint32 ID; // 0
|
||||
|
|
|
|||
|
|
@ -103,6 +103,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[]="niffffiiiiiiiifffffffffffffffssssfifixxx";
|
||||
const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxx";
|
||||
|
|
|
|||
|
|
@ -13696,8 +13696,8 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver,
|
|||
}
|
||||
|
||||
// honor reward
|
||||
if (pQuest->GetRewHonorAddition())
|
||||
RewardHonor(NULL, 0, MaNGOS::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorAddition()));
|
||||
if (uint32 honor = pQuest->CalculateRewardHonor(getLevel()))
|
||||
RewardHonor(NULL, 0, honor);
|
||||
|
||||
// title reward
|
||||
if (pQuest->GetCharTitleId())
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include "QuestDef.h"
|
||||
#include "Player.h"
|
||||
#include "World.h"
|
||||
#include "DBCStores.h"
|
||||
|
||||
Quest::Quest(Field * questRecord)
|
||||
{
|
||||
|
|
@ -271,3 +272,23 @@ bool Quest::IsAllowedInRaid() const
|
|||
|
||||
return sWorld.getConfig(CONFIG_BOOL_QUEST_IGNORE_RAID);
|
||||
}
|
||||
|
||||
uint32 Quest::CalculateRewardHonor(uint32 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...
|
||||
TeamContributionPoints const* tc = sTeamContributionPoints.LookupEntry(level-1);
|
||||
if(!tc)
|
||||
return 0;
|
||||
uint32 i_honor = uint32(tc->Value * GetRewHonorMultiplier() * 0.1000000014901161);
|
||||
honor = i_honor + GetRewHonorAddition();
|
||||
}
|
||||
|
||||
return honor;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -273,6 +273,8 @@ class Quest
|
|||
void SetQuestActiveState(bool state) { m_isActive = state; }
|
||||
bool IsActive() const { return m_isActive; }
|
||||
|
||||
uint32 CalculateRewardHonor(uint32 level) const;
|
||||
|
||||
// multiple values
|
||||
std::string ObjectiveText[QUEST_OBJECTIVES_COUNT];
|
||||
uint32 ReqItemId[QUEST_ITEM_OBJECTIVES_COUNT];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10718"
|
||||
#define REVISION_NR "10719"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue