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:
Shauren
2011-11-23 19:17:33 +01:00
parent f091360940
commit 358b33239a
30 changed files with 220 additions and 226 deletions
+17 -19
View File
@@ -3484,7 +3484,7 @@ bool Player::AddTalent(uint32 spell_id, uint8 spec, bool learning)
if (!rankSpellId || rankSpellId == spell_id)
continue;
PlayerTalentMap::iterator itr = m_talents[spec]->find(rankSpellId);
itr = m_talents[spec]->find(rankSpellId);
if (itr != m_talents[spec]->end())
itr->second->state = PLAYERSPELL_REMOVED;
}
@@ -4094,8 +4094,6 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
if (uint32 prev_id = sSpellMgr->GetPrevSpellInChain(spell_id))
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id);
// if talent then lesser rank also talent and need learn
if (talentCosts)
{
@@ -4243,8 +4241,8 @@ void Player::RemoveArenaSpellCooldowns(bool removeActivePetCooldowns)
if (Pet* pet = GetPet())
{
// notify player
for (CreatureSpellCooldowns::const_iterator itr = pet->m_CreatureSpellCooldowns.begin(); itr != pet->m_CreatureSpellCooldowns.end(); ++itr)
SendClearCooldown(itr->first, pet);
for (CreatureSpellCooldowns::const_iterator itr2 = pet->m_CreatureSpellCooldowns.begin(); itr2 != pet->m_CreatureSpellCooldowns.end(); ++itr2)
SendClearCooldown(itr2->first, pet);
// actually clear cooldowns
pet->m_CreatureSpellCooldowns.clear();
@@ -4397,9 +4395,9 @@ bool Player::resetTalents(bool no_cost)
RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
{
TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentId);
if (!talentInfo)
continue;
@@ -4835,14 +4833,14 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
{
do
{
Field* fields = resultItems->Fetch();
uint32 item_guidlow = fields[11].GetUInt32();
uint32 item_template = fields[12].GetUInt32();
Field* fields2 = resultItems->Fetch();
uint32 item_guidlow = fields2[11].GetUInt32();
uint32 item_template = fields2[12].GetUInt32();
ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_template);
if (!itemProto)
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
stmt->setUInt32(0, item_guidlow);
trans->Append(stmt);
continue;
@@ -15899,9 +15897,9 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id)
if (reqTarget != entry) // if entry doesn't match, check for killcredits referenced in template
{
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
for (uint8 i = 0; i < MAX_KILL_CREDIT; ++i)
if (cinfo->KillCredit[i] == reqTarget)
entry = cinfo->KillCredit[i];
for (uint8 j = 0; j < MAX_KILL_CREDIT; ++j)
if (cinfo->KillCredit[j] == reqTarget)
entry = cinfo->KillCredit[j];
}
}
}
@@ -17538,7 +17536,7 @@ void Player::_LoadMailedItems(Mail* mail)
{
sLog->outError("Player %u has unknown item_template (ProtoType) in mailed items(GUID: %u template: %u) in mail (%u), deleted.", GetGUIDLow(), item_guid_low, item_template, mail->messageID);
CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid = '%u'", item_guid_low);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
stmt->setUInt32(0, item_guid_low);
CharacterDatabase.Execute(stmt);
continue;
@@ -20125,9 +20123,9 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
if (sWorld->getBoolConfig(CONFIG_INSTANT_TAXI))
{
TaxiNodesEntry const* lastnode = sTaxiNodesStore.LookupEntry(nodes[nodes.size()-1]);
TaxiNodesEntry const* lastPathNode = sTaxiNodesStore.LookupEntry(nodes[nodes.size()-1]);
m_taxi.ClearTaxiDestinations();
TeleportTo(lastnode->map_id, lastnode->x, lastnode->y, lastnode->z, GetOrientation());
TeleportTo(lastPathNode->map_id, lastPathNode->x, lastPathNode->y, lastPathNode->z, GetOrientation());
return false;
}
else
@@ -24330,9 +24328,9 @@ void Player::ActivateSpec(uint8 spec)
// Let client clear his current Actions
SendActionButtons(2);
// m_actionButtons.clear() is called in the next _LoadActionButtons
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
{
TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentId);
if (!talentInfo)
continue;
+23 -24
View File
@@ -1514,8 +1514,8 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo
if (GetTypeId() == TYPEID_PLAYER)
{
AuraEffectList const& ResIgnoreAuras = GetAuraEffectsByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT);
for (AuraEffectList::const_iterator itr = ResIgnoreAuras.begin(); itr != ResIgnoreAuras.end(); ++itr)
AuraEffectList const& ArPenAuras = GetAuraEffectsByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT);
for (AuraEffectList::const_iterator itr = ArPenAuras.begin(); itr != ArPenAuras.end(); ++itr)
{
// item neutral spell
if ((*itr)->GetSpellInfo()->EquippedItemClass == -1)
@@ -1687,12 +1687,12 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
if (currentAbsorb < 0)
currentAbsorb = 0;
uint32 absorb = currentAbsorb;
uint32 tempAbsorb = uint32(currentAbsorb);
bool defaultPrevented = false;
absorbAurEff->GetBase()->CallScriptEffectAbsorbHandlers(absorbAurEff, aurApp, dmgInfo, absorb, defaultPrevented);
currentAbsorb = absorb;
absorbAurEff->GetBase()->CallScriptEffectAbsorbHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb, defaultPrevented);
currentAbsorb = tempAbsorb;
if (defaultPrevented)
continue;
@@ -1705,8 +1705,8 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
dmgInfo.AbsorbDamage(currentAbsorb);
absorb = currentAbsorb;
absorbAurEff->GetBase()->CallScriptEffectAfterAbsorbHandlers(absorbAurEff, aurApp, dmgInfo, absorb);
tempAbsorb = currentAbsorb;
absorbAurEff->GetBase()->CallScriptEffectAfterAbsorbHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb);
// Check if our aura is using amount to count damage
if (absorbAurEff->GetAmount() >= 0)
@@ -1738,12 +1738,12 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
if (currentAbsorb < 0)
currentAbsorb = 0;
uint32 absorb = currentAbsorb;
uint32 tempAbsorb = currentAbsorb;
bool defaultPrevented = false;
absorbAurEff->GetBase()->CallScriptEffectManaShieldHandlers(absorbAurEff, aurApp, dmgInfo, absorb, defaultPrevented);
currentAbsorb = absorb;
absorbAurEff->GetBase()->CallScriptEffectManaShieldHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb, defaultPrevented);
currentAbsorb = tempAbsorb;
if (defaultPrevented)
continue;
@@ -1766,8 +1766,8 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
dmgInfo.AbsorbDamage(currentAbsorb);
absorb = currentAbsorb;
absorbAurEff->GetBase()->CallScriptEffectAfterManaShieldHandlers(absorbAurEff, aurApp, dmgInfo, absorb);
tempAbsorb = currentAbsorb;
absorbAurEff->GetBase()->CallScriptEffectAfterManaShieldHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb);
// Check if our aura is using amount to count damage
if (absorbAurEff->GetAmount() >= 0)
@@ -3744,13 +3744,13 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit*
// Cast duration to unsigned to prevent permanent aura's such as Righteous Fury being permanently added to caster
uint32 dur = std::min(2u * MINUTE * IN_MILLISECONDS, uint32(aura->GetDuration()));
if (Aura* newAura = stealer->GetAura(aura->GetId(), aura->GetCasterGUID()))
if (Aura* oldAura = stealer->GetAura(aura->GetId(), aura->GetCasterGUID()))
{
if (stealCharge)
newAura->ModCharges(1);
oldAura->ModCharges(1);
else
newAura->ModStackAmount(1);
newAura->SetDuration(int32(dur));
oldAura->ModStackAmount(1);
oldAura->SetDuration(int32(dur));
}
else
{
@@ -5242,7 +5242,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
break;
case CLASS_ROGUE: // 39511, 40997, 40998, 41002, 41005, 41011
case CLASS_WARRIOR: // 39511, 40997, 40998, 41002, 41005, 41011
case CLASS_DEATH_KNIGHT:
case CLASS_DEATH_KNIGHT:
triggered_spell_id = RAND(39511, 40997, 40998, 41002, 41005, 41011);
cooldown_spell_id = 39511;
break;
@@ -11970,7 +11970,7 @@ void Unit::Unmount()
if (GetTypeId() == TYPEID_PLAYER && GetVehicleKit())
{
// Send other players that we are no longer a vehicle
WorldPacket data(SMSG_PLAYER_VEHICLE_DATA, 8+4);
data.Initialize(SMSG_PLAYER_VEHICLE_DATA, 8+4);
data.appendPackGUID(GetGUID());
data << uint32(0);
ToPlayer()->SendMessageToSet(&data, true);
@@ -14378,8 +14378,8 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", triggeredByAura->GetAmount(), spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
SpellNonMeleeDamage damageInfo(this, target, spellInfo->Id, spellInfo->SchoolMask);
uint32 damage = SpellDamageBonus(target, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE);
CalculateSpellDamageTaken(&damageInfo, damage, spellInfo);
uint32 newDamage = SpellDamageBonus(target, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE);
CalculateSpellDamageTaken(&damageInfo, newDamage, spellInfo);
DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
SendSpellNonMeleeDamageLog(&damageInfo);
DealSpellDamage(&damageInfo, true);
@@ -16589,10 +16589,9 @@ float Unit::GetCombatRatingReduction(CombatRating cr) const
if (Player const* player = ToPlayer())
return player->GetRatingBonusValue(cr);
// Player's pet get resilience from owner
else if (isPet())
if (Unit* owner = GetOwner())
if (Player* player = owner->ToPlayer())
return player->GetRatingBonusValue(cr);
else if (isPet() && GetOwner())
if (Player* owner = GetOwner()->ToPlayer())
return owner->GetRatingBonusValue(cr);
return 0.0f;
}
+4 -4
View File
@@ -5392,7 +5392,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
// mail open and then not returned
for (MailItemInfoVec::iterator itr2 = m->items.begin(); itr2 != m->items.end(); ++itr2)
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
stmt->setUInt32(0, itr2->item_guid);
CharacterDatabase.Execute(stmt);
}
@@ -7084,13 +7084,13 @@ void ObjectMgr::LoadQuestPOI()
{
// The first result should have the highest questId
Field* fields = points->Fetch();
uint32 questId = fields[0].GetUInt32();
POIs.resize(questId + 1);
uint32 questIdMax = fields[0].GetUInt32();
POIs.resize(questIdMax + 1);
do
{
Field* fields = points->Fetch();
fields = points->Fetch();
uint32 questId = fields[0].GetUInt32();
uint32 id = fields[1].GetUInt32();
@@ -309,11 +309,11 @@ void InstanceSaveManager::LoadResetTimes()
while (result->NextRow());
// update reset time for normal instances with the max creature respawn time + X hours
if (PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_GET_MAX_CREATURE_RESPAWNS)))
if (PreparedQueryResult result2 = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_GET_MAX_CREATURE_RESPAWNS)))
{
do
{
Field* fields = result->Fetch();
Field* fields = result2->Fetch();
uint32 instance = fields[1].GetUInt32();
time_t resettime = time_t(fields[0].GetUInt32() + 2 * HOUR);
InstResetTimeMapDiffType::iterator itr = instResetTime.find(instance);
@@ -305,7 +305,6 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
void InstanceScript::DoSendNotifyToInstance(const char *format, ...)
{
InstanceMap::PlayerList const &PlayerList = instance->GetPlayers();
InstanceMap::PlayerList::const_iterator i;
if (!PlayerList.isEmpty())
{
+3 -3
View File
@@ -2451,7 +2451,7 @@ bool InstanceMap::Reset(uint8 method)
return m_mapRefManager.isEmpty();
}
void InstanceMap::PermBindAllPlayers(Player* player)
void InstanceMap::PermBindAllPlayers(Player* source)
{
if (!IsDungeon())
return;
@@ -2459,11 +2459,11 @@ void InstanceMap::PermBindAllPlayers(Player* player)
InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId());
if (!save)
{
sLog->outError("Cannot bind player (GUID: %u, Name: %s), because no instance save is available for instance map (Name: %s, Entry: %u, InstanceId: %u)!", player->GetGUIDLow(), player->GetName(), player->GetMap()->GetMapName(), player->GetMapId(), GetInstanceId());
sLog->outError("Cannot bind player (GUID: %u, Name: %s), because no instance save is available for instance map (Name: %s, Entry: %u, InstanceId: %u)!", source->GetGUIDLow(), source->GetName(), source->GetMap()->GetMapName(), source->GetMapId(), GetInstanceId());
return;
}
Group* group = player->GetGroup();
Group* group = source->GetGroup();
// group members outside the instance group don't get bound
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
{
+1 -1
View File
@@ -574,7 +574,7 @@ class InstanceMap : public Map
bool Reset(uint8 method);
uint32 GetScriptId() { return i_script_id; }
InstanceScript* GetInstanceScript() { return i_data; }
void PermBindAllPlayers(Player* player);
void PermBindAllPlayers(Player* source);
void UnloadAll();
bool CanEnter(Player* player);
void SendResetWarnings(uint32 timeLeft) const;
+4 -4
View File
@@ -208,8 +208,8 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
if (corpseMap == mapid)
break;
InstanceTemplate const* instance = sObjectMgr->GetInstanceTemplate(corpseMap);
corpseMap = instance ? instance->Parent : 0;
InstanceTemplate const* corpseInstance = sObjectMgr->GetInstanceTemplate(corpseMap);
corpseMap = corpseInstance ? corpseInstance->Parent : 0;
} while (corpseMap);
if (!corpseMap)
@@ -287,8 +287,8 @@ void MapManager::Update(uint32 diff)
iter->second->DelayedUpdate(uint32(i_timer.GetCurrent()));
sObjectAccessor->Update(uint32(i_timer.GetCurrent()));
for (TransportSet::iterator iter = m_Transports.begin(); iter != m_Transports.end(); ++iter)
(*iter)->Update(uint32(i_timer.GetCurrent()));
for (TransportSet::iterator itr = m_Transports.begin(); itr != m_Transports.end(); ++itr)
(*itr)->Update(uint32(i_timer.GetCurrent()));
i_timer.SetCurrent(0);
}
+3 -3
View File
@@ -321,11 +321,11 @@ void Map::ScriptsProcess()
source = HashMapHolder<Corpse>::Find(step.sourceGUID);
break;
case HIGHGUID_MO_TRANSPORT:
for (MapManager::TransportSet::iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter)
for (MapManager::TransportSet::iterator itr2 = sMapMgr->m_Transports.begin(); itr2 != sMapMgr->m_Transports.end(); ++itr2)
{
if ((*iter)->GetGUID() == step.sourceGUID)
if ((*itr2)->GetGUID() == step.sourceGUID)
{
source = *iter;
source = *itr2;
break;
}
}
@@ -107,9 +107,9 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target)
*Target << uint8(unk1);
if (unk1)
{
uint8 unk2 = (crc != 0x4c1c776d); // If addon is Standard addon CRC
*Target << uint8(unk2);
if (unk2)
uint8 unk = (crc != 0x4c1c776d); // If addon is Standard addon CRC
*Target << uint8(unk);
if (unk)
Target->append(tdata, sizeof(tdata));
*Target << uint32(0);
@@ -1409,9 +1409,9 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
}
CharacterDatabase.EscapeString(newname);
if (QueryResult result = CharacterDatabase.PQuery("SELECT name FROM characters WHERE guid ='%u'", GUID_LOPART(guid)))
if (QueryResult oldNameResult = CharacterDatabase.PQuery("SELECT name FROM characters WHERE guid ='%u'", GUID_LOPART(guid)))
{
std::string oldname = result->Fetch()[0].GetString();
std::string oldname = oldNameResult->Fetch()[0].GetString();
std::string IP_str = GetRemoteAddress();
sLog->outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), IP_str.c_str(), oldname.c_str(), GUID_LOPART(guid), newname.c_str());
}
@@ -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;
+24 -17
View File
@@ -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)
+16 -12
View File
@@ -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);
}
}
+1 -1
View File
@@ -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;
}