[10719][FIX] Quest honor reward
Наваял вот что:
Код:
diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp
index 96044dc..1833740 100644
--- a/src/game/DBCStores.cpp
+++ b/src/game/DBCStores.cpp
@@ -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);
@@ -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");
diff --git a/src/game/DBCStores.h b/src/game/DBCStores.h
index ad07b05..6d94f85 100644
--- a/src/game/DBCStores.h
+++ b/src/game/DBCStores.h
@@ -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;
diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h
index c8f7489..abc2961 100644
--- a/src/game/DBCStructure.h
+++ b/src/game/DBCStructure.h
@@ -1704,6 +1704,12 @@ struct TaxiPathNodeEntry
uint32 departureEventID; // 10 m_departureEventID
};
+struct TeamContributionPoints
+{
+ uint32 Entry; // 0
+ float Value; // 1 (???)
+};
+
struct TotemCategoryEntry
{
uint32 ID; // 0
diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h
index a9ff44f..a613639 100644
--- a/src/game/DBCfmt.h
+++ b/src/game/DBCfmt.h
@@ -103,6 +103,7 @@ const char TalentTabEntryfmt[]="nxxxxxxxxxxxxxxxxxxxiiix";
const char TaxiNodesEntryfmt[]="nifffssssssssssssssssxii";
const char TaxiPathEntryfmt[]="niii";
const char TaxiPathNodeEntryfmt[]="diiifffiiii";
+const char TeamContributionPointsfmt[]="if";
const char TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii";
const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifixxx";
const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxx";
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 1daeabd..a752c44 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -13585,6 +13585,23 @@ void Player::IncompleteQuest(uint32 quest_id)
}
}
+int Player::GetQuestRewardHonor(Quest const *pQuest)
+{
+ int honor = 0;
+ if(pQuest)
+ {
+ if(pQuest->GetRewHonorAddition() > 0 || pQuest->GetRewHonorMultiplier() > 0.0f)
+ {
+ TeamContributionPoints const* tc = sTeamContributionPoints.LookupEntry(getLevel() - 1);
+ if(!tc)
+ return 0;
+ int i_honor = int(tc->Value * pQuest->GetRewHonorMultiplier() * 0.1000000014901161);
+ honor = i_honor + pQuest->GetRewHonorAddition();
+ }
+ }
+ return honor;
+}
+
void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver, bool announce)
{
uint32 quest_id = pQuest->GetQuestId();
@@ -13660,8 +13677,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 (GetQuestRewardHonor(pQuest))
+ RewardHonor(NULL, 0, GetQuestRewardHonor(pQuest));
// title reward
if (pQuest->GetCharTitleId())
diff --git a/src/game/Player.h b/src/game/Player.h
index eb2a194..243a0f6 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -1420,6 +1420,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void AddQuest( Quest const *pQuest, Object *questGiver );
void CompleteQuest( uint32 quest_id );
void IncompleteQuest( uint32 quest_id );
+ int GetQuestRewardHonor( Quest const *pQuest );
void RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver, bool announce = true );
void FailQuest( uint32 quest_id );
Теперь хонор за квесты дают. То, что отображает в клиенте, то и получаем по факту, спасибо, наконец-то решена эта очень давнишняя (с ревизии 9312) проблема с отсутствием хонора за квесты.
Если что - автор основного TOM_RUS, см. тут.
|