Core: Fixed remaining C6246: Local declaration of 'x' hides declaration of the same name in outer scope. from previous commit
This commit is contained in:
@@ -563,10 +563,10 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
|
||||
amount += (int32)DoneActualBenefit;
|
||||
|
||||
// Arena - Dampening
|
||||
if (AuraEffect const* pAurEff = caster->GetAuraEffect(74410, 0))
|
||||
AddPctN(amount, pAurEff->GetAmount());
|
||||
// Battleground - Dampening
|
||||
else if (AuraEffect const* pAurEff = caster->GetAuraEffect(74411, 0))
|
||||
AuraEffect const* pAurEff = caster->GetAuraEffect(74410, 0);
|
||||
if (!pAurEff)
|
||||
pAurEff = caster->GetAuraEffect(74411, 0); // Battleground - Dampening
|
||||
if (pAurEff)
|
||||
AddPctN(amount, pAurEff->GetAmount());
|
||||
|
||||
return amount;
|
||||
@@ -1508,15 +1508,15 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
|
||||
// Nurturing Instinct
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT, SPELLFAMILY_DRUID, 2254, 0))
|
||||
{
|
||||
uint32 spellId = 0;
|
||||
uint32 spellId3 = 0;
|
||||
switch (aurEff->GetId())
|
||||
{
|
||||
case 33872:
|
||||
spellId = 47179;
|
||||
break;
|
||||
case 33873:
|
||||
spellId = 47180;
|
||||
break;
|
||||
case 33872:
|
||||
spellId3 = 47179;
|
||||
break;
|
||||
case 33873:
|
||||
spellId3 = 47180;
|
||||
break;
|
||||
}
|
||||
target->CastSpell(target, spellId, true, NULL, this);
|
||||
}
|
||||
@@ -4892,8 +4892,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
// Living Bomb
|
||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x20000)
|
||||
{
|
||||
AuraRemoveMode mode = aurApp->GetRemoveMode();
|
||||
if (caster && (mode == AURA_REMOVE_BY_ENEMY_SPELL || mode == AURA_REMOVE_BY_EXPIRE))
|
||||
AuraRemoveMode removeMode = aurApp->GetRemoveMode();
|
||||
if (caster && (removeMode == AURA_REMOVE_BY_ENEMY_SPELL || removeMode == AURA_REMOVE_BY_EXPIRE))
|
||||
caster->CastSpell(target, GetAmount(), true);
|
||||
}
|
||||
break;
|
||||
@@ -6019,13 +6019,15 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
|
||||
case 65923:
|
||||
{
|
||||
Unit* permafrostCaster = NULL;
|
||||
if (Aura* permafrostAura = target->GetAura(66193))
|
||||
permafrostCaster = permafrostAura->GetCaster();
|
||||
else if (Aura* permafrostAura = target->GetAura(67855))
|
||||
permafrostCaster = permafrostAura->GetCaster();
|
||||
else if (Aura* permafrostAura = target->GetAura(67856))
|
||||
permafrostCaster = permafrostAura->GetCaster();
|
||||
else if (Aura* permafrostAura = target->GetAura(67857))
|
||||
Aura* permafrostAura = target->GetAura(66193);
|
||||
if (!permafrostAura)
|
||||
permafrostAura = target->GetAura(67855);
|
||||
if (!permafrostAura)
|
||||
permafrostAura = target->GetAura(67856);
|
||||
if (!permafrostAura)
|
||||
permafrostAura = target->GetAura(67857);
|
||||
|
||||
if (permafrostAura)
|
||||
permafrostCaster = permafrostAura->GetCaster();
|
||||
|
||||
if (permafrostCaster)
|
||||
@@ -6461,15 +6463,15 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
|
||||
// damage caster for heal amount
|
||||
if (target != caster && GetSpellInfo()->AttributesEx2 & SPELL_ATTR2_HEALTH_FUNNEL)
|
||||
{
|
||||
uint32 damage = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); // damage is not affected by spell power
|
||||
if ((int32)damage > gain)
|
||||
damage = gain;
|
||||
uint32 absorb = 0;
|
||||
caster->DealDamageMods(caster, damage, &absorb);
|
||||
caster->SendSpellNonMeleeDamageLog(caster, GetId(), damage, GetSpellInfo()->GetSchoolMask(), absorb, 0, false, 0, false);
|
||||
uint32 funnelDamage = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); // damage is not affected by spell power
|
||||
if ((int32)funnelDamage > gain)
|
||||
funnelDamage = gain;
|
||||
uint32 funnelAbsorb = 0;
|
||||
caster->DealDamageMods(caster, funnelDamage, &funnelAbsorb);
|
||||
caster->SendSpellNonMeleeDamageLog(caster, GetId(), funnelDamage, GetSpellInfo()->GetSchoolMask(), funnelAbsorb, 0, false, 0, false);
|
||||
|
||||
CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
|
||||
caster->DealDamage(caster, damage, &cleanDamage, NODAMAGE, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
|
||||
caster->DealDamage(caster, funnelDamage, &cleanDamage, NODAMAGE, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
|
||||
}
|
||||
|
||||
uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
|
||||
|
||||
@@ -641,23 +641,24 @@ void Spell::InitExplicitTargets(SpellCastTargets const& targets)
|
||||
// try to select correct unit target if not provided by client or by serverside cast
|
||||
if (neededTargets & (TARGET_FLAG_UNIT_MASK))
|
||||
{
|
||||
Unit* target = NULL;
|
||||
Unit* unit = NULL;
|
||||
// try to use player selection as a target
|
||||
if (Player* playerCaster = m_caster->ToPlayer())
|
||||
{
|
||||
// selection has to be found and to be valid target for the spell
|
||||
if (Unit* selectedUnit = ObjectAccessor::GetUnit(*m_caster, playerCaster->GetSelection()))
|
||||
if (m_spellInfo->CheckExplicitTarget(m_caster, selectedUnit) == SPELL_CAST_OK)
|
||||
target = selectedUnit;
|
||||
unit = selectedUnit;
|
||||
}
|
||||
// try to use attacked unit as a target
|
||||
else if ((m_caster->GetTypeId() == TYPEID_UNIT) && neededTargets & (TARGET_FLAG_UNIT_ENEMY | TARGET_FLAG_UNIT))
|
||||
target = m_caster->getVictim();
|
||||
// didn't find anything - let's use self as target
|
||||
if (!target && neededTargets & (TARGET_FLAG_UNIT_RAID | TARGET_FLAG_UNIT_PARTY | TARGET_FLAG_UNIT_ALLY))
|
||||
target = m_caster;
|
||||
unit = m_caster->getVictim();
|
||||
|
||||
m_targets.SetUnitTarget(target);
|
||||
// didn't find anything - let's use self as target
|
||||
if (!unit && neededTargets & (TARGET_FLAG_UNIT_RAID | TARGET_FLAG_UNIT_PARTY | TARGET_FLAG_UNIT_ALLY))
|
||||
unit = m_caster;
|
||||
|
||||
m_targets.SetUnitTarget(unit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1218,11 +1219,11 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
|
||||
if (spellHitTarget)
|
||||
{
|
||||
SpellMissInfo missInfo = DoSpellHitOnUnit(spellHitTarget, mask, target->scaleAura);
|
||||
if (missInfo != SPELL_MISS_NONE)
|
||||
SpellMissInfo missInfo2 = DoSpellHitOnUnit(spellHitTarget, mask, target->scaleAura);
|
||||
if (missInfo2 != SPELL_MISS_NONE)
|
||||
{
|
||||
if (missInfo != SPELL_MISS_MISS)
|
||||
m_caster->SendSpellMiss(unit, m_spellInfo->Id, missInfo);
|
||||
if (missInfo2 != SPELL_MISS_MISS)
|
||||
m_caster->SendSpellMiss(unit, m_spellInfo->Id, missInfo2);
|
||||
m_damage = 0;
|
||||
spellHitTarget = NULL;
|
||||
}
|
||||
@@ -6798,7 +6799,7 @@ void Spell::SelectTrajTargets()
|
||||
if (!dist2d)
|
||||
return;
|
||||
|
||||
float dz = m_targets.GetDst()->m_positionZ - m_targets.GetSrc()->m_positionZ;
|
||||
float srcToDestDelta = m_targets.GetDst()->m_positionZ - m_targets.GetSrc()->m_positionZ;
|
||||
|
||||
UnitList unitList;
|
||||
SearchAreaTarget(unitList, dist2d, PUSH_IN_THIN_LINE, SPELL_TARGETS_ANY);
|
||||
@@ -6808,8 +6809,9 @@ void Spell::SelectTrajTargets()
|
||||
unitList.sort(Trinity::ObjectDistanceOrderPred(m_caster));
|
||||
|
||||
float b = tangent(m_targets.GetElevation());
|
||||
float a = (dz - dist2d * b) / (dist2d * dist2d);
|
||||
if (a > -0.0001f) a = 0;
|
||||
float a = (srcToDestDelta - dist2d * b) / (dist2d * dist2d);
|
||||
if (a > -0.0001f)
|
||||
a = 0;
|
||||
DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: a %f b %f", a, b);)
|
||||
|
||||
float bestDist = m_spellInfo->GetMaxRange(false);
|
||||
@@ -6837,9 +6839,14 @@ void Spell::SelectTrajTargets()
|
||||
}
|
||||
|
||||
#define CHECK_DIST {\
|
||||
DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)\
|
||||
if (dist > bestDist) continue;\
|
||||
if (dist < objDist2d + size && dist > objDist2d - size) { bestDist = dist; break; }\
|
||||
DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)\
|
||||
if (dist > bestDist)\
|
||||
continue;\
|
||||
if (dist < objDist2d + size && dist > objDist2d - size)\
|
||||
{\
|
||||
bestDist = dist;\
|
||||
break;\
|
||||
}\
|
||||
}
|
||||
|
||||
if (!a)
|
||||
|
||||
@@ -923,7 +923,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 spell_id = roll_chance_i(50)
|
||||
spell_id = roll_chance_i(50)
|
||||
? 29277 // Summon Purified Helboar Meat
|
||||
: 29278; // Summon Toxic Helboar Meat
|
||||
|
||||
@@ -951,12 +951,16 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
return;
|
||||
case 35745: // Socrethar's Stone
|
||||
{
|
||||
uint32 spell_id;
|
||||
switch (m_caster->GetAreaId())
|
||||
{
|
||||
case 3900: spell_id = 35743; break; // Socrethar Portal
|
||||
case 3742: spell_id = 35744; break; // Socrethar Portal
|
||||
default: return;
|
||||
case 3900:
|
||||
spell_id = 35743;
|
||||
break; // Socrethar Portal
|
||||
case 3742:
|
||||
spell_id = 35744;
|
||||
break; // Socrethar Portal
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
m_caster->CastSpell(m_caster, spell_id, true);
|
||||
@@ -1453,7 +1457,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_DK_DEATH_STRIKE)
|
||||
{
|
||||
uint32 count = unitTarget->GetDiseasesByCaster(m_caster->GetGUID());
|
||||
int32 bp = int32(count * m_caster->CountPctFromMaxHealth(int32(m_spellInfo->Effects[EFFECT_0].DamageMultiplier)));
|
||||
bp = int32(count * m_caster->CountPctFromMaxHealth(int32(m_spellInfo->Effects[EFFECT_0].DamageMultiplier)));
|
||||
// Improved Death Strike
|
||||
if (AuraEffect const* aurEff = m_caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_DEATHKNIGHT, 2751, 0))
|
||||
AddPctN(bp, m_caster->CalculateSpellDamage(m_caster, aurEff->GetSpellInfo(), 2));
|
||||
@@ -1465,12 +1469,12 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
if (m_caster->IsFriendlyTo(unitTarget))
|
||||
{
|
||||
int32 bp = int32(damage * 1.5f);
|
||||
bp = int32(damage * 1.5f);
|
||||
m_caster->CastCustomSpell(unitTarget, 47633, &bp, NULL, NULL, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
int32 bp = damage;
|
||||
bp = damage;
|
||||
m_caster->CastCustomSpell(unitTarget, 47632, &bp, NULL, NULL, true);
|
||||
}
|
||||
return;
|
||||
@@ -6348,13 +6352,13 @@ void Spell::EffectQuestClear(SpellEffIndex effIndex)
|
||||
// remove all quest entries for 'entry' from quest log
|
||||
for (uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot)
|
||||
{
|
||||
uint32 quest = player->GetQuestSlotQuestId(slot);
|
||||
if (quest == quest_id)
|
||||
uint32 logQuest = player->GetQuestSlotQuestId(slot);
|
||||
if (logQuest == quest_id)
|
||||
{
|
||||
player->SetQuestSlot(slot, 0);
|
||||
|
||||
// we ignore unequippable quest items in this case, its' still be equipped
|
||||
player->TakeQuestSourceItem(quest, false);
|
||||
// we ignore unequippable quest items in this case, it's still be equipped
|
||||
player->TakeQuestSourceItem(logQuest, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1005,7 +1005,7 @@ SpellThreatEntry const* SpellMgr::GetSpellThreatEntry(uint32 spellID) const
|
||||
else
|
||||
{
|
||||
uint32 firstSpell = GetFirstSpellInChain(spellID);
|
||||
SpellThreatMap::const_iterator itr = mSpellThreatMap.find(firstSpell);
|
||||
itr = mSpellThreatMap.find(firstSpell);
|
||||
if (itr != mSpellThreatMap.end())
|
||||
return &itr->second;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user