* Implement reputation reward rate for quest / creatures
* Need DB data for this to work * Original patch by NoFantasy --HG-- branch : trunk
This commit is contained in:
@@ -198,6 +198,14 @@ struct MailLevelReward
|
||||
typedef std::list<MailLevelReward> MailLevelRewardList;
|
||||
typedef UNORDERED_MAP<uint8,MailLevelRewardList> MailLevelRewardMap;
|
||||
|
||||
// We assume the rate is in general the same for all three types below, but chose to keep three for scalability and customization
|
||||
struct RepRewardRate
|
||||
{
|
||||
float quest_rate; // We allow rate = 0.0 in database. For this case, it means that
|
||||
float creature_rate; // no reputation are given at all for this faction/rate type.
|
||||
float spell_rate; // not implemented yet (SPELL_EFFECT_REPUTATION)
|
||||
};
|
||||
|
||||
struct ReputationOnKillEntry
|
||||
{
|
||||
uint32 repfaction1;
|
||||
@@ -377,7 +385,9 @@ class ObjectMgr
|
||||
|
||||
typedef UNORDERED_MAP<uint32, AccessRequirement> AccessRequirementMap;
|
||||
|
||||
typedef UNORDERED_MAP<uint32, RepRewardRate > RepRewardRateMap;
|
||||
typedef UNORDERED_MAP<uint32, ReputationOnKillEntry> RepOnKillMap;
|
||||
|
||||
typedef UNORDERED_MAP<uint32, PointOfInterest> PointOfInterestMap;
|
||||
|
||||
typedef UNORDERED_MAP<uint32, WeatherZoneChances> WeatherZoneMap;
|
||||
@@ -525,6 +535,15 @@ class ObjectMgr
|
||||
uint32 GetAreaTriggerScriptId(uint32 trigger_id);
|
||||
SpellScriptsBounds GetSpellScriptsBounds(uint32 spell_id);
|
||||
|
||||
RepRewardRate const* GetRepRewardRate(uint32 factionId) const
|
||||
{
|
||||
RepRewardRateMap::const_iterator itr = m_RepRewardRateMap.find(factionId);
|
||||
if (itr != m_RepRewardRateMap.end())
|
||||
return &itr->second;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ReputationOnKillEntry const* GetReputationOnKilEntry(uint32 id) const
|
||||
{
|
||||
RepOnKillMap::const_iterator itr = mRepOnKill.find(id);
|
||||
@@ -643,7 +662,9 @@ class ObjectMgr
|
||||
void LoadCorpses();
|
||||
void LoadFishingBaseSkillLevel();
|
||||
|
||||
void LoadReputationRewardRate();
|
||||
void LoadReputationOnKill();
|
||||
|
||||
void LoadPointsOfInterest();
|
||||
void LoadQuestPOI();
|
||||
|
||||
@@ -986,6 +1007,7 @@ class ObjectMgr
|
||||
AreaTriggerScriptMap mAreaTriggerScripts;
|
||||
AccessRequirementMap mAccessRequirements;
|
||||
|
||||
RepRewardRateMap m_RepRewardRateMap;
|
||||
RepOnKillMap mRepOnKill;
|
||||
|
||||
GossipMenusMap m_mGossipMenusMap;
|
||||
|
||||
Reference in New Issue
Block a user