*Add support for Thrallmar's Fervor spell, cleanup some talent code
--HG-- branch : trunk
This commit is contained in:
+11
-6
@@ -6118,10 +6118,15 @@ void Player::RewardReputation(Unit *pVictim, float rate)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Increase reputation gain on kill under certain conditions
|
||||||
|
uint32 zone = GetZoneId();
|
||||||
|
float zonerepmult = 0;
|
||||||
|
if(HasAura(32096) && (zone == 3483 || zone == 3562 || zone == 3836 || zone == 3713 || zone == 3714)) zonerepmult = 0.25; // Thrallmar's Favor
|
||||||
|
|
||||||
if(Rep->repfaction1 && (!Rep->team_dependent || GetTeam()==ALLIANCE))
|
if(Rep->repfaction1 && (!Rep->team_dependent || GetTeam()==ALLIANCE))
|
||||||
{
|
{
|
||||||
int32 donerep1 = CalculateReputationGain(pVictim->getLevel(), Rep->repvalue1, ChampioningFaction ? ChampioningFaction : Rep->repfaction1, false);
|
int32 donerep1 = CalculateReputationGain(pVictim->getLevel(), Rep->repvalue1, ChampioningFaction ? ChampioningFaction : Rep->repfaction1, false);
|
||||||
donerep1 = int32(donerep1*rate);
|
donerep1 = int32(donerep1*(rate + zonerepmult));
|
||||||
FactionEntry const *factionEntry1 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->repfaction1);
|
FactionEntry const *factionEntry1 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->repfaction1);
|
||||||
uint32 current_reputation_rank1 = GetReputationMgr().GetRank(factionEntry1);
|
uint32 current_reputation_rank1 = GetReputationMgr().GetRank(factionEntry1);
|
||||||
if (factionEntry1 && current_reputation_rank1 <= Rep->reputation_max_cap1)
|
if (factionEntry1 && current_reputation_rank1 <= Rep->reputation_max_cap1)
|
||||||
@@ -6139,7 +6144,7 @@ void Player::RewardReputation(Unit *pVictim, float rate)
|
|||||||
if(Rep->repfaction2 && (!Rep->team_dependent || GetTeam()==HORDE))
|
if(Rep->repfaction2 && (!Rep->team_dependent || GetTeam()==HORDE))
|
||||||
{
|
{
|
||||||
int32 donerep2 = CalculateReputationGain(pVictim->getLevel(), Rep->repvalue2, ChampioningFaction ? ChampioningFaction : Rep->repfaction2, false);
|
int32 donerep2 = CalculateReputationGain(pVictim->getLevel(), Rep->repvalue2, ChampioningFaction ? ChampioningFaction : Rep->repfaction2, false);
|
||||||
donerep2 = int32(donerep2*rate);
|
donerep2 = int32(donerep2*(rate + zonerepmult));
|
||||||
FactionEntry const *factionEntry2 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->repfaction2);
|
FactionEntry const *factionEntry2 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->repfaction2);
|
||||||
uint32 current_reputation_rank2 = GetReputationMgr().GetRank(factionEntry2);
|
uint32 current_reputation_rank2 = GetReputationMgr().GetRank(factionEntry2);
|
||||||
if (factionEntry2 && current_reputation_rank2 <= Rep->reputation_max_cap2)
|
if (factionEntry2 && current_reputation_rank2 <= Rep->reputation_max_cap2)
|
||||||
@@ -21163,13 +21168,13 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
|
|||||||
{
|
{
|
||||||
if (tmpTalent->TalentTab == tTab)
|
if (tmpTalent->TalentTab == tTab)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < MAX_TALENT_RANK; j++)
|
for (uint8 rank = 0; rank < MAX_TALENT_RANK; rank++)
|
||||||
{
|
{
|
||||||
if (tmpTalent->RankID[j] != 0)
|
if (tmpTalent->RankID[rank] != 0)
|
||||||
{
|
{
|
||||||
if (HasSpell(tmpTalent->RankID[j]))
|
if (HasSpell(tmpTalent->RankID[rank]))
|
||||||
{
|
{
|
||||||
spentPoints += j + 1;
|
spentPoints += (rank + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user