Core/Reputation: Implemented new reputation_reward_rate fields for dayily/weekly quests

This commit is contained in:
Vincent-Michael committed 2012-12-04 14:48:44 +01:00
1 parent 1f55b890b7
commit 2b3b124e09
6 files changed
+127 -58

No files matched your search

+5 -13
View File
@@ -4982,25 +4982,17 @@ void Spell::EffectReputation(SpellEffIndex effIndex)
Player* player = unitTarget->ToPlayer();
int32 rep_change = damage;
int32 repChange = damage;
uint32 faction_id = m_spellInfo->Effects[effIndex].MiscValue;
FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction_id);
uint32 factionId = m_spellInfo->Effects[effIndex].MiscValue;
FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
if (!factionEntry)
return;
if (RepRewardRate const* repData = sObjectMgr->GetRepRewardRate(faction_id))
{
rep_change = int32((float)rep_change * repData->spell_rate);
}
repChange = player->CalculateReputationGain(REPUTATION_SOURCE_SPELL, 0, repChange, factionId);
// Bonus from spells that increase reputation gain
float bonus = rep_change * player->GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN) / 100.0f; // 10%
rep_change += (int32)bonus;
player->GetReputationMgr().ModifyReputation(factionEntry, rep_change);
player->GetReputationMgr().ModifyReputation(factionEntry, repChange);
}
void Spell::EffectQuestComplete(SpellEffIndex effIndex)