*Implement RepRewardRate for spells.
--HG-- branch : trunk
This commit is contained in:
@@ -6493,14 +6493,10 @@ int32 Player::CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, in
|
||||
float percent = 100.0f;
|
||||
|
||||
// Get the generic rate first
|
||||
if (const RepRewardRate *repData = objmgr.GetRepRewardRate(faction))
|
||||
if (RepRewardRate const * repData = objmgr.GetRepRewardRate(faction))
|
||||
{
|
||||
float repRate = for_quest ? repData->quest_rate : repData->creature_rate;
|
||||
percent *= repRate;
|
||||
|
||||
// for custom, a rate of 0.0 will totally disable reputation gain for this faction/type
|
||||
if (repRate <= 0.0f)
|
||||
percent = repRate;
|
||||
}
|
||||
|
||||
float rate = for_quest ? sWorld.getRate(RATE_REPUTATION_LOWLEVEL_QUEST) : sWorld.getRate(RATE_REPUTATION_LOWLEVEL_KILL);
|
||||
|
||||
@@ -203,7 +203,7 @@ 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)
|
||||
float spell_rate;
|
||||
};
|
||||
|
||||
struct ReputationOnKillEntry
|
||||
|
||||
@@ -7024,6 +7024,11 @@ void Spell::EffectReputation(uint32 i)
|
||||
if (!factionEntry)
|
||||
return;
|
||||
|
||||
if (RepRewardRate const * repData = objmgr.GetRepRewardRate(faction_id))
|
||||
{
|
||||
rep_change = (float)rep_change * repData->spell_rate;
|
||||
}
|
||||
|
||||
_player->GetReputationMgr().ModifyReputation(factionEntry, rep_change);
|
||||
}
|
||||
|
||||
|
||||
@@ -3836,14 +3836,6 @@ void SpellMgr::LoadSpellCustomAttr()
|
||||
spellInfo->AttributesEx3 |= SPELL_ATTR_EX3_NO_INITIAL_AGGRO;
|
||||
count++;
|
||||
break;
|
||||
case 61306: // Kirin Tor Commendation Badge
|
||||
case 61308: // Wyrmrest Commendation Badge
|
||||
case 61311: // Argent Crusade Commendation Badge
|
||||
case 61312: // Ebon Blade Commendadtion Badge
|
||||
case 69757: // Sons of Hodir Commendation Badge
|
||||
spellInfo->EffectBasePoints[0] = 519; // Some suggest a global multiplier is used for rep gain
|
||||
count++; // but basepoints * 1,3 hard coded in the tooltip says
|
||||
break; // otherwise.
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user