more cleanup
This commit is contained in:
1 parent
c0165ec7f8
commit
0532afed90
5 files changed
+81
-81
No files matched your search
@@ -4079,10 +4079,10 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
// most likely will never be used, haven't heard of cases where players unlearn a mount
|
||||
if (Has310Flyer(false) && _spell_idx->second->skillId == SKILL_MOUNTS)
|
||||
{
|
||||
SpellInfo const* pSpellInfo = sSpellMgr->GetSpellInfo(spell_id);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id);
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (pSpellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
|
||||
pSpellInfo->Effects[i].CalcValue() == 310)
|
||||
if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
|
||||
spellInfo->Effects[i].CalcValue() == 310)
|
||||
Has310Flyer(true, spell_id); // with true as first argument its also used to set/remove the flag
|
||||
}
|
||||
}
|
||||
@@ -4161,7 +4161,7 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId)
|
||||
else
|
||||
{
|
||||
SetHas310Flyer(false);
|
||||
SpellInfo const* pSpellInfo;
|
||||
SpellInfo const* spellInfo;
|
||||
for (PlayerSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
|
||||
{
|
||||
if (itr->first == excludeSpellId)
|
||||
@@ -4173,10 +4173,10 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId)
|
||||
if (_spell_idx->second->skillId != SKILL_MOUNTS)
|
||||
break; // We can break because mount spells belong only to one skillline (at least 310 flyers do)
|
||||
|
||||
pSpellInfo = sSpellMgr->GetSpellInfo(itr->first);
|
||||
spellInfo = sSpellMgr->GetSpellInfo(itr->first);
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (pSpellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
|
||||
pSpellInfo->Effects[i].CalcValue() == 310)
|
||||
if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
|
||||
spellInfo->Effects[i].CalcValue() == 310)
|
||||
{
|
||||
SetHas310Flyer(true);
|
||||
return true;
|
||||
@@ -6916,15 +6916,15 @@ int32 Player::CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, in
|
||||
}
|
||||
|
||||
//Calculates how many reputation points player gains in victim's enemy factions
|
||||
void Player::RewardReputation(Unit* pVictim, float rate)
|
||||
void Player::RewardReputation(Unit* victim, float rate)
|
||||
{
|
||||
if (!pVictim || pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (!victim || victim->GetTypeId() == TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
if (pVictim->ToCreature()->IsReputationGainDisabled())
|
||||
if (victim->ToCreature()->IsReputationGainDisabled())
|
||||
return;
|
||||
|
||||
ReputationOnKillEntry const* Rep = sObjectMgr->GetReputationOnKilEntry(pVictim->ToCreature()->GetCreatureTemplate()->Entry);
|
||||
ReputationOnKillEntry const* Rep = sObjectMgr->GetReputationOnKilEntry(victim->ToCreature()->GetCreatureTemplate()->Entry);
|
||||
|
||||
if (!Rep)
|
||||
return;
|
||||
@@ -6966,7 +6966,7 @@ void Player::RewardReputation(Unit* pVictim, float rate)
|
||||
|
||||
if (Rep->RepFaction1 && (!Rep->TeamDependent || team == ALLIANCE))
|
||||
{
|
||||
int32 donerep1 = CalculateReputationGain(pVictim->getLevel(), Rep->RepValue1, ChampioningFaction ? ChampioningFaction : Rep->RepFaction1, false);
|
||||
int32 donerep1 = CalculateReputationGain(victim->getLevel(), Rep->RepValue1, ChampioningFaction ? ChampioningFaction : Rep->RepFaction1, false);
|
||||
donerep1 = int32(donerep1*(rate + favored_rep_mult));
|
||||
|
||||
if (recruitAFriend)
|
||||
@@ -6980,7 +6980,7 @@ void Player::RewardReputation(Unit* pVictim, float rate)
|
||||
|
||||
if (Rep->RepFaction2 && (!Rep->TeamDependent || team == HORDE))
|
||||
{
|
||||
int32 donerep2 = CalculateReputationGain(pVictim->getLevel(), Rep->RepValue2, ChampioningFaction ? ChampioningFaction : Rep->RepFaction2, false);
|
||||
int32 donerep2 = CalculateReputationGain(victim->getLevel(), Rep->RepValue2, ChampioningFaction ? ChampioningFaction : Rep->RepFaction2, false);
|
||||
donerep2 = int32(donerep2*(rate + favored_rep_mult));
|
||||
|
||||
if (recruitAFriend)
|
||||
@@ -7112,14 +7112,14 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvpt
|
||||
|
||||
if (uVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Player* pVictim = uVictim->ToPlayer();
|
||||
Player* victim = uVictim->ToPlayer();
|
||||
|
||||
if (GetTeam() == pVictim->GetTeam() && !sWorld->IsFFAPvPRealm())
|
||||
if (GetTeam() == victim->GetTeam() && !sWorld->IsFFAPvPRealm())
|
||||
return false;
|
||||
|
||||
uint8 k_level = getLevel();
|
||||
uint8 k_grey = Trinity::XP::GetGrayLevel(k_level);
|
||||
uint8 v_level = pVictim->getLevel();
|
||||
uint8 v_level = victim->getLevel();
|
||||
|
||||
if (v_level <= k_grey)
|
||||
return false;
|
||||
@@ -7130,7 +7130,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvpt
|
||||
// [15..28] Horde honor titles and player name
|
||||
// [29..38] Other title and player name
|
||||
// [39+] Nothing
|
||||
uint32 victim_title = pVictim->GetUInt32Value(PLAYER_CHOSEN_TITLE);
|
||||
uint32 victim_title = victim->GetUInt32Value(PLAYER_CHOSEN_TITLE);
|
||||
// Get Killer titles, CharTitlesEntry::bit_index
|
||||
// Ranks:
|
||||
// title[1..14] -> rank[5..18]
|
||||
@@ -7152,10 +7152,10 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvpt
|
||||
// and those in a lifetime
|
||||
ApplyModUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 1, true);
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL);
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS, pVictim->getClass());
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_RACE, pVictim->getRace());
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS, victim->getClass());
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_RACE, victim->getRace());
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA, GetAreaId());
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, 1, 0, pVictim);
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, 1, 0, victim);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -22649,20 +22649,20 @@ uint32 Player::GetResurrectionSpellId()
|
||||
}
|
||||
|
||||
// Used in triggers for check "Only to targets that grant experience or honor" req
|
||||
bool Player::isHonorOrXPTarget(Unit* pVictim)
|
||||
bool Player::isHonorOrXPTarget(Unit* victim)
|
||||
{
|
||||
uint8 v_level = pVictim->getLevel();
|
||||
uint8 v_level = victim->getLevel();
|
||||
uint8 k_grey = Trinity::XP::GetGrayLevel(getLevel());
|
||||
|
||||
// Victim level less gray level
|
||||
if (v_level <= k_grey)
|
||||
return false;
|
||||
|
||||
if (pVictim->GetTypeId() == TYPEID_UNIT)
|
||||
if (victim->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (pVictim->ToCreature()->isTotem() ||
|
||||
pVictim->ToCreature()->isPet() ||
|
||||
pVictim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL)
|
||||
if (victim->ToCreature()->isTotem() ||
|
||||
victim->ToCreature()->isPet() ||
|
||||
victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -22709,9 +22709,9 @@ bool Player::GetsRecruitAFriendBonus(bool forXP)
|
||||
return recruitAFriend;
|
||||
}
|
||||
|
||||
void Player::RewardPlayerAndGroupAtKill(Unit* pVictim, bool isBattleGround)
|
||||
void Player::RewardPlayerAndGroupAtKill(Unit* victim, bool isBattleGround)
|
||||
{
|
||||
KillRewarder(this, pVictim, isBattleGround).Reward();
|
||||
KillRewarder(this, victim, isBattleGround).Reward();
|
||||
}
|
||||
|
||||
void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource)
|
||||
|
||||
Reference in new issue
Block a user