diff options
43 files changed, 340 insertions, 340 deletions
diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h index 4fdedea414a..3c16fe493b4 100755 --- a/src/server/game/AI/CoreAI/UnitAI.h +++ b/src/server/game/AI/CoreAI/UnitAI.h @@ -56,7 +56,7 @@ struct DefaultTargetSelector : public std::unary_function<Unit*, bool> bool m_playerOnly; int32 m_aura; - // pUnit: the reference unit + // unit: the reference unit // dist: if 0: ignored, if > 0: maximum distance to the reference unit, if < 0: minimum distance to the reference unit // playerOnly: self explaining // aura: if 0: ignored, if > 0: the target shall have the aura, if < 0, the target shall NOT have the aura diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 78fcd55278d..cc6911e34a5 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -4689,32 +4689,32 @@ bool ChatHandler::HandleGroupRemoveCommand(const char *args) bool ChatHandler::HandlePossessCommand(const char * /*args*/) { - Unit* pUnit = getSelectedUnit(); - if (!pUnit) + Unit* unit = getSelectedUnit(); + if (!unit) return false; - m_session->GetPlayer()->CastSpell(pUnit, 530, true); + m_session->GetPlayer()->CastSpell(unit, 530, true); return true; } bool ChatHandler::HandleUnPossessCommand(const char * /*args*/) { - Unit* pUnit = getSelectedUnit(); - if (!pUnit) - pUnit = m_session->GetPlayer(); + Unit* unit = getSelectedUnit(); + if (!unit) + unit = m_session->GetPlayer(); - pUnit->RemoveCharmAuras(); + unit->RemoveCharmAuras(); return true; } bool ChatHandler::HandleBindSightCommand(const char * /*args*/) { - Unit* pUnit = getSelectedUnit(); - if (!pUnit) + Unit* unit = getSelectedUnit(); + if (!unit) return false; - m_session->GetPlayer()->CastSpell(pUnit, 6277, true); + m_session->GetPlayer()->CastSpell(unit, 6277, true); return true; } diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 0af2c7f82dc..9497de4142f 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -1180,16 +1180,16 @@ namespace Trinity class AllFriendlyCreaturesInGrid { public: - AllFriendlyCreaturesInGrid(Unit const* obj) : pUnit(obj) {} + AllFriendlyCreaturesInGrid(Unit const* obj) : unit(obj) {} bool operator() (Unit* u) { - if (u->isAlive() && u->IsVisible() && u->IsFriendlyTo(pUnit)) + if (u->isAlive() && u->IsVisible() && u->IsFriendlyTo(unit)) return true; return false; } private: - Unit const* pUnit; + Unit const* unit; }; class AllGameObjectsWithEntryInRange @@ -1213,9 +1213,9 @@ namespace Trinity { public: AllCreaturesOfEntryInRange(const WorldObject* pObject, uint32 uiEntry, float fMaxRange) : m_pObject(pObject), m_uiEntry(uiEntry), m_fRange(fMaxRange) {} - bool operator() (Unit* pUnit) + bool operator() (Unit* unit) { - if (pUnit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(pUnit, m_fRange, false)) + if (unit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(unit, m_fRange, false)) return true; return false; @@ -1230,18 +1230,18 @@ namespace Trinity class PlayerAtMinimumRangeAway { public: - PlayerAtMinimumRangeAway(Unit const* unit, float fMinRange) : pUnit(unit), fRange(fMinRange) {} + PlayerAtMinimumRangeAway(Unit const* unit, float fMinRange) : unit(unit), fRange(fMinRange) {} bool operator() (Player* pPlayer) { //No threat list check, must be done explicit if expected to be in combat with creature - if (!pPlayer->isGameMaster() && pPlayer->isAlive() && !pUnit->IsWithinDist(pPlayer, fRange, false)) + if (!pPlayer->isGameMaster() && pPlayer->isAlive() && !unit->IsWithinDist(pPlayer, fRange, false)) return true; return false; } private: - Unit const* pUnit; + Unit const* unit; float fRange; }; diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index ec651439bc5..6d62e47f4d6 100755 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -155,7 +155,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const { - Unit* pUnit = NULL; + Unit* unit = NULL; if (!obj) sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); else if (!obj->isType(TYPEMASK_UNIT)) @@ -163,12 +163,12 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* s scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow()); else { - pUnit = obj->ToUnit(); - if (!pUnit) + unit = obj->ToUnit(); + if (!unit) sLog->outError("%s %s object could not be casted to unit.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); } - return pUnit; + return unit; } inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp index d74c075b05a..0a8a4a88191 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp @@ -244,22 +244,22 @@ public: std::list<HostileReference*> threatlist = me->getThreatManager().getThreatList(); for (std::list<HostileReference*>::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i) { - Unit* pUnit; + Unit* unit; if ((*i) && (*i)->getSource()) { - pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit) + unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (unit) { //Cast affliction - DoCast(pUnit, RAND(SPELL_BROODAF_BLUE, SPELL_BROODAF_BLACK, + DoCast(unit, RAND(SPELL_BROODAF_BLUE, SPELL_BROODAF_BLACK, SPELL_BROODAF_RED, SPELL_BROODAF_BRONZE, SPELL_BROODAF_GREEN), true); //Chromatic mutation if target is effected by all afflictions - if (pUnit->HasAura(SPELL_BROODAF_BLUE) - && pUnit->HasAura(SPELL_BROODAF_BLACK) - && pUnit->HasAura(SPELL_BROODAF_RED) - && pUnit->HasAura(SPELL_BROODAF_BRONZE) - && pUnit->HasAura(SPELL_BROODAF_GREEN)) + if (unit->HasAura(SPELL_BROODAF_BLUE) + && unit->HasAura(SPELL_BROODAF_BLACK) + && unit->HasAura(SPELL_BROODAF_RED) + && unit->HasAura(SPELL_BROODAF_BRONZE) + && unit->HasAura(SPELL_BROODAF_GREEN)) { //pTarget->RemoveAllAuras(); //DoCast(target, SPELL_CHROMATIC_MUT_1); @@ -269,8 +269,8 @@ public: //So instead we instant kill our target //WORKAROUND - if (pUnit->GetTypeId() == TYPEID_PLAYER) - pUnit->CastSpell(pUnit, 5, false); + if (unit->GetTypeId() == TYPEID_PLAYER) + unit->CastSpell(unit, 5, false); } } } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 596dfa9c25f..e804d2b2b61 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -141,8 +141,8 @@ public: { if (Phase == 2) { - if (Unit* pUnit = Unit::GetUnit(*me, Attumen)) - DoScriptText(SAY_MIDNIGHT_KILL, pUnit); + if (Unit* unit = Unit::GetUnit(*me, Attumen)) + DoScriptText(SAY_MIDNIGHT_KILL, unit); } } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 04981669681..98e40acc4e1 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -359,9 +359,9 @@ struct boss_moroes_guestAI : public ScriptedAI uint64 TempGUID = GuestGUID[rand()%4]; if (TempGUID) { - Unit* pUnit = Unit::GetUnit((*me), TempGUID); - if (pUnit && pUnit->isAlive()) - return pUnit; + Unit* unit = Unit::GetUnit((*me), TempGUID); + if (unit && unit->isAlive()) + return unit; } return me; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index 51085504f99..e13ef8f62e1 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -424,10 +424,10 @@ public: for (uint32 i = 0; i < 4; ++i) { - if (Creature* pUnit = me->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000)) + if (Creature* unit = me->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000)) { - pUnit->Attack(me->getVictim(), true); - pUnit->setFaction(me->getFaction()); + unit->Attack(me->getVictim(), true); + unit->setFaction(me->getFaction()); } } @@ -438,10 +438,10 @@ public: { for (uint32 i = 0; i < 5; ++i) { - if (Creature* pUnit = me->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) + if (Creature* unit = me->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) { - pUnit->Attack(me->getVictim(), true); - pUnit->setFaction(me->getFaction()); + unit->Attack(me->getVictim(), true); + unit->setFaction(me->getFaction()); } } @@ -464,11 +464,11 @@ public: if (!FlameWreathTarget[i]) continue; - Unit* pUnit = Unit::GetUnit(*me, FlameWreathTarget[i]); - if (pUnit && !pUnit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3)) + Unit* unit = Unit::GetUnit(*me, FlameWreathTarget[i]); + if (unit && !unit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3)) { - pUnit->CastSpell(pUnit, 20476, true, 0, 0, me->GetGUID()); - pUnit->CastSpell(pUnit, 11027, true); + unit->CastSpell(unit, 20476, true, 0, 0, me->GetGUID()); + unit->CastSpell(unit, 11027, true); FlameWreathTarget[i] = 0; } } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index b3f06bdf2c7..6802d1817a3 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -193,11 +193,11 @@ public: std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i) { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit && pUnit->isAlive()) + Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (unit && unit->isAlive()) { - float threat = me->getThreatManager().getThreat(pUnit); - SummonedUnit->AddThreat(pUnit, threat); + float threat = me->getThreatManager().getThreat(unit); + SummonedUnit->AddThreat(unit, threat); } } } @@ -211,9 +211,9 @@ public: std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) - pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true); + Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) + unit->CastSpell(unit, SPELL_TELEPORT_CENTER, true); } DoCast(me, SPELL_TELEPORT_CENTER, true); } @@ -223,10 +223,10 @@ public: std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) + Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) // Knockback into the air - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, me->GetGUID()); + unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, me->GetGUID()); } } @@ -235,17 +235,17 @@ public: std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) + Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { // Also needs an exception in spell system. - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, me->GetGUID()); + unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, me->GetGUID()); // Use packet hack WorldPacket data(12); data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); - data.append(pUnit->GetPackGUID()); + data.append(unit->GetPackGUID()); data << uint32(0); - pUnit->SendMessageToSet(&data, true); + unit->SendMessageToSet(&data, true); } } } @@ -255,17 +255,17 @@ public: std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) + Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { - pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); - pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT); + unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); + unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT); WorldPacket data(12); data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); - data.append(pUnit->GetPackGUID()); + data.append(unit->GetPackGUID()); data << uint32(0); - pUnit->SendMessageToSet(&data, true); + unit->SendMessageToSet(&data, true); } } } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index f54883daf56..ae7d7aba9f1 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -527,12 +527,12 @@ public: { DoCast(me, SPELL_VANISH); - Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0); + Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0); DoResetThreat(); - if (pUnit) - me->AddThreat(pUnit, 1000.0f); + if (unit) + me->AddThreat(unit, 1000.0f); InVanish = true; Vanish_Timer = 30000; @@ -644,24 +644,24 @@ public: if (Seed_of_Corruption_Timer <= diff) { - if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_SEED_OF_CORRUPTION); + if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(unit, SPELL_SEED_OF_CORRUPTION); Seed_of_Corruption_Timer = 10000; } else Seed_of_Corruption_Timer -= diff; if (Curse_of_Agony_Timer <= diff) { - if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_CURSE_OF_AGONY); + if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(unit, SPELL_CURSE_OF_AGONY); Curse_of_Agony_Timer = 13000; } else Curse_of_Agony_Timer -= diff; if (Fear_Timer <= diff) { - if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_FEAR); + if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(unit, SPELL_FEAR); Fear_Timer = 10000; } else Fear_Timer -= diff; @@ -806,8 +806,8 @@ public: if (Blizzard_Timer <= diff) { - if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_BLIZZARD); + if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(unit, SPELL_BLIZZARD); Blizzard_Timer = 8000; } else Blizzard_Timer -= diff; @@ -937,8 +937,8 @@ public: //if nobody is in melee range than try to use Intercept if (!InMeleeRange) { - if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_INTERCEPT_STUN); + if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(unit, SPELL_INTERCEPT_STUN); } Intercept_Stun_Timer = 10000; @@ -1168,8 +1168,8 @@ public: if (Purge_Timer <= diff) { - if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_PURGE); + if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(unit, SPELL_PURGE); Purge_Timer = 15000; } else Purge_Timer -= diff; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index 8b68330717f..35269bb296d 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -103,15 +103,15 @@ public: //for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i) for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) { - //Unit* pUnit = Unit::GetUnit(*me, FelCrystals[i]); - Unit* pUnit = Unit::GetUnit(*me, *itr); - if (pUnit) + //Unit* unit = Unit::GetUnit(*me, FelCrystals[i]); + Unit* unit = Unit::GetUnit(*me, *itr); + if (unit) { - if (!pUnit->isAlive()) - CAST_CRE(pUnit)->Respawn(); // Let the core handle setting death state, etc. + if (!unit->isAlive()) + CAST_CRE(unit)->Respawn(); // Let the core handle setting death state, etc. // Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here. - pUnit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + unit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index e255cc52871..9a3913cb7dd 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -478,8 +478,8 @@ public: { me->setFaction(FACTION_HOSTILE); - if (Unit* pUnit = Unit::GetUnit(*me, m_uiDuelerGUID)) - AttackStart(pUnit); + if (Unit* unit = Unit::GetUnit(*me, m_uiDuelerGUID)) + AttackStart(unit); } else m_uiDuelTimer -= uiDiff; diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index f321e75caac..9296bd09bbc 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -569,9 +569,9 @@ public: std::list<HostileReference*>::const_iterator itr; for (itr = caster->getThreatManager().getThreatList().begin(); itr != caster->getThreatManager().getThreatList().end(); ++itr) { - Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive() && pUnit != caster) - me->AddThreat(pUnit, caster->getThreatManager().getThreat(pUnit)); + Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + if (unit && unit->isAlive() && unit != caster) + me->AddThreat(unit, caster->getThreatManager().getThreat(unit)); } } } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 8f15878f888..df20eab39de 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -760,11 +760,11 @@ public: { for (std::list<HostileReference*>::const_iterator itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr) { - if (Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) + if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) { - if (pUnit->GetPositionZ() > me->GetPositionZ()+5) + if (unit->GetPositionZ() > me->GetPositionZ()+5) { - me->getThreatManager().modifyThreatPercent(pUnit, -100); + me->getThreatManager().modifyThreatPercent(unit, -100); } } } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 47704b42d5a..e81d4975378 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -994,9 +994,9 @@ public: std::list<HostileReference*>::iterator itr; for (itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr) { - Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - if (pUnit) - pPortal->AddThreat(pUnit, 1.0f); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); + if (unit) + pPortal->AddThreat(unit, 1.0f); } } FelfirePortalTimer = 20000; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 7f7a85b881f..6135c076920 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -160,23 +160,23 @@ class boss_mandokir : public CreatureScript { if (WatchTarget) //If someone is watched and If the Position of the watched target is different from the one stored, or are attacking, mandokir will charge him { - Unit* pUnit = Unit::GetUnit(*me, WatchTarget); + Unit* unit = Unit::GetUnit(*me, WatchTarget); - if (pUnit && ( - targetX != pUnit->GetPositionX() || - targetY != pUnit->GetPositionY() || - targetZ != pUnit->GetPositionZ() || - pUnit->isInCombat())) + if (unit && ( + targetX != unit->GetPositionX() || + targetY != unit->GetPositionY() || + targetZ != unit->GetPositionZ() || + unit->isInCombat())) { - if (me->IsWithinMeleeRange(pUnit)) + if (me->IsWithinMeleeRange(unit)) { - DoCast(pUnit, 24316); + DoCast(unit, 24316); } else { - DoCast(pUnit, SPELL_CHARGE); - //me->SendMonsterMove(pUnit->GetPositionX(), pUnit->GetPositionY(), pUnit->GetPositionZ(), 0, true, 1); - AttackStart(pUnit); + DoCast(unit, SPELL_CHARGE); + //me->SendMonsterMove(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), 0, true, 1); + AttackStart(unit); } } } @@ -198,12 +198,12 @@ class boss_mandokir : public CreatureScript if ((Watch_Timer < 1000) && endWatch) //1 sec before the debuf expire, store the target position { - Unit* pUnit = Unit::GetUnit(*me, WatchTarget); - if (pUnit) + Unit* unit = Unit::GetUnit(*me, WatchTarget); + if (unit) { - targetX = pUnit->GetPositionX(); - targetY = pUnit->GetPositionY(); - targetZ = pUnit->GetPositionZ(); + targetX = unit->GetPositionX(); + targetY = unit->GetPositionY(); + targetZ = unit->GetPositionZ(); } endWatch = false; } @@ -232,8 +232,8 @@ class boss_mandokir : public CreatureScript std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); for (; i != me->getThreatManager().getThreatList().end(); ++i) { - Unit* pUnit = Unit::GetUnit(*me, (*i)->getUnitGuid()); - if (pUnit && me->IsWithinMeleeRange(pUnit)) + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); + if (unit && me->IsWithinMeleeRange(unit)) ++TargetInRange; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index a7e5f51da98..da316cb91c7 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -358,9 +358,9 @@ public: std::list<HostileReference*>::const_iterator itr = m_threatlist.begin(); for (; itr != m_threatlist.end(); ++itr) { - Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive()) - targets.push_back(pUnit); + Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + if (unit && unit->isAlive()) + targets.push_back(unit); } if (targets.empty()) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 0754e4a1554..385e86e5069 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -714,9 +714,9 @@ void hyjalAI::DeSpawnVeins() return; if (Faction == 1) { - Creature* pUnit=Unit::GetCreature((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (!pUnit)return; - hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI()); + Creature* unit=Unit::GetCreature((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (!unit)return; + hyjalAI* ai = CAST_AI(hyjalAI, unit->AI()); if (!ai)return; for (uint8 i = 0; i<7; ++i) { @@ -725,9 +725,9 @@ void hyjalAI::DeSpawnVeins() } } else if (Faction) { - Creature* pUnit=Unit::GetCreature((*me), pInstance->GetData64(DATA_THRALL)); - if (!pUnit)return; - hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI()); + Creature* unit=Unit::GetCreature((*me), pInstance->GetData64(DATA_THRALL)); + if (!unit)return; + hyjalAI* ai = CAST_AI(hyjalAI, unit->AI()); if (!ai)return; for (uint8 i = 7; i<14; ++i) { @@ -853,8 +853,8 @@ void hyjalAI::UpdateAI(const uint32 diff) { if (BossGUID[i]) { - Unit* pUnit = Unit::GetUnit((*me), BossGUID[i]); - if (pUnit && (!pUnit->isAlive())) + Unit* unit = Unit::GetUnit((*me), BossGUID[i]); + if (unit && (!unit->isAlive())) { if (BossGUID[i] == BossGUID[0]) { @@ -1080,37 +1080,37 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls { uint8 r = rand()%4; - Creature* pUnit = me->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15, 15), AllianceBase[r][1]+irand(-15, 15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) + Creature* unit = me->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15, 15), AllianceBase[r][1]+irand(-15, 15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (unit) { - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); + CAST_AI(hyjal_trashAI, unit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, unit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, unit->AI())->OverrunType = i; + unit->setActive(true); } } for (uint8 i = 0; i < 3; ++i)//summon 3 abominations { uint8 r = rand()%4; - Creature* pUnit = me->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15, 15), AllianceBase[r][1]+irand(-15, 15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) + Creature* unit = me->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15, 15), AllianceBase[r][1]+irand(-15, 15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (unit) { - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); + CAST_AI(hyjal_trashAI, unit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, unit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, unit->AI())->OverrunType = i; + unit->setActive(true); } } for (uint8 i = 0; i < 5; ++i)//summon 5 gargoyles { - Creature* pUnit = me->SummonCreature(GARGOYLE, AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) + Creature* unit = me->SummonCreature(GARGOYLE, AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (unit) { - pUnit->SetHomePosition(AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3]); - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); + unit->SetHomePosition(AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3]); + CAST_AI(hyjal_trashAI, unit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, unit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, unit->AI())->OverrunType = i; + unit->setActive(true); } } break; @@ -1120,38 +1120,38 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) for (uint8 i = 0; i < 26; ++i)//summon infernals { - Creature* pUnit = me->SummonCreature(GIANT_INFERNAL, InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) + Creature* unit = me->SummonCreature(GIANT_INFERNAL, InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (unit) { - pUnit->SetHomePosition(InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3]); - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); + unit->SetHomePosition(InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3]); + CAST_AI(hyjal_trashAI, unit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, unit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, unit->AI())->OverrunType = i; + unit->setActive(true); } } for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls { uint8 r = rand()%4; - Creature* pUnit = me->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15, 15), HordeBase[r][1]+irand(-15, 15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) + Creature* unit = me->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15, 15), HordeBase[r][1]+irand(-15, 15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (unit) { - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); + CAST_AI(hyjal_trashAI, unit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, unit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, unit->AI())->OverrunType = i; + unit->setActive(true); } } for (uint8 i = 0; i < 5; ++i)//summon 5 abominations { uint8 r = rand()%4; - Creature* pUnit = me->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15, 15), HordeBase[r][1]+irand(-15, 15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) + Creature* unit = me->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15, 15), HordeBase[r][1]+irand(-15, 15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (unit) { - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); + CAST_AI(hyjal_trashAI, unit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, unit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, unit->AI())->OverrunType = i; + unit->setActive(true); } } break; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index fcb7126cb6a..e3d57414b94 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -191,12 +191,12 @@ public: Creature* creature = instance->GetCreature(Azgalor); if (creature) { - Creature* pUnit = creature->SummonCreature(21987, creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 10000); + Creature* unit = creature->SummonCreature(21987, creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 10000); Map* pMap = creature->GetMap(); - if (pMap->IsDungeon() && pUnit) + if (pMap->IsDungeon() && unit) { - pUnit->SetVisible(false); + unit->SetVisible(false); Map::PlayerList const &PlayerList = pMap->GetPlayers(); if (PlayerList.isEmpty()) return; @@ -206,7 +206,7 @@ public: if (i->getSource()) { WorldPacket data(SMSG_MESSAGECHAT, 200); - pUnit->BuildMonsterChat(&data, CHAT_MSG_MONSTER_YELL, YELL_EFFORTS, 0, YELL_EFFORTS_NAME, i->getSource()->GetGUID()); + unit->BuildMonsterChat(&data, CHAT_MSG_MONSTER_YELL, YELL_EFFORTS, 0, YELL_EFFORTS_NAME, i->getSource()->GetGUID()); i->getSource()->GetSession()->SendPacket(&data); WorldPacket data2(SMSG_PLAY_SOUND, 4); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index c73843b7a8c..7244d78e83d 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -576,11 +576,11 @@ public: while (i != Stomach_Map.end()) { //Check for valid player - Unit* pUnit = Unit::GetUnit(*me, i->first); + Unit* unit = Unit::GetUnit(*me, i->first); //Only units out of stomach - if (pUnit && i->second == false) - temp.push_back(pUnit); + if (unit && i->second == false) + temp.push_back(unit); ++i; } @@ -724,19 +724,19 @@ public: while (i != Stomach_Map.end()) { //Check for valid player - Unit* pUnit = Unit::GetUnit(*me, i->first); + Unit* unit = Unit::GetUnit(*me, i->first); //Only move units in stomach - if (pUnit && i->second == true) + if (unit && i->second == true) { //Teleport each player out - DoTeleportPlayer(pUnit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+10, float(rand()%6)); + DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+10, float(rand()%6)); //Cast knockback on them - DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true); + DoCast(unit, SPELL_EXIT_STOMACH_KNOCKBACK, true); //Remove the acid debuff - pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); + unit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); i->second = false; } @@ -755,25 +755,25 @@ public: while (i != Stomach_Map.end()) { //Check for valid player - Unit* pUnit = Unit::GetUnit(*me, i->first); + Unit* unit = Unit::GetUnit(*me, i->first); //Only apply to units in stomach - if (pUnit && i->second == true) + if (unit && i->second == true) { //Cast digestive acid on them - DoCast(pUnit, SPELL_DIGESTIVE_ACID, true); + DoCast(unit, SPELL_DIGESTIVE_ACID, true); //Check if player should be kicked from stomach - if (pUnit->IsWithinDist3d(&KickPos, 15.0f)) + if (unit->IsWithinDist3d(&KickPos, 15.0f)) { //Teleport each player out - DoTeleportPlayer(pUnit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+10, float(rand()%6)); + DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+10, float(rand()%6)); //Cast knockback on them - DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true); + DoCast(unit, SPELL_EXIT_STOMACH_KNOCKBACK, true); //Remove the acid debuff - pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); + unit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); i->second = false; } @@ -805,11 +805,11 @@ public: if (StomachEnterVisTimer <= diff) { //Check for valid player - Unit* pUnit = Unit::GetUnit(*me, StomachEnterTarget); + Unit* unit = Unit::GetUnit(*me, StomachEnterTarget); - if (pUnit) + if (unit) { - DoTeleportPlayer(pUnit, STOMACH_X, STOMACH_Y, STOMACH_Z, STOMACH_O); + DoTeleportPlayer(unit, STOMACH_X, STOMACH_Y, STOMACH_Z, STOMACH_O); } StomachEnterTarget = 0; diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index 8bfefade07e..6bbc29dcc56 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -87,10 +87,10 @@ public: std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) + Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { - DoTeleportPlayer(pUnit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+3, pUnit->GetOrientation()); + DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+3, unit->GetOrientation()); } } diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 244250b8204..fd246ab6020 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -535,8 +535,8 @@ public: SetCombatMovement(true); if (me->isInCombat()) - if (Unit* pUnit = me->getVictim()) - me->GetMotionMaster()->MoveChase(pUnit); + if (Unit* unit = me->getVictim()) + me->GetMotionMaster()->MoveChase(unit); } void MoveToDock() diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp index 6b7197292dd..947c5236e14 100644 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ b/src/server/scripts/Kalimdor/mulgore.cpp @@ -160,9 +160,9 @@ public: switch (uiEventPhase) { case 1: - if (Unit* pUnit = Unit::GetUnit(*me, uiPlayerGUID)) + if (Unit* unit = Unit::GetUnit(*me, uiPlayerGUID)) { - if (GameObject* pGo = pUnit->GetGameObject(SPELL_LUNCH)) + if (GameObject* pGo = unit->GetGameObject(SPELL_LUNCH)) { m_bIsMovingToLunch = true; me->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ()); @@ -174,8 +174,8 @@ public: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USESTANDING); break; case 3: - if (Player* pUnit = Unit::GetPlayer(*me, uiPlayerGUID)) - pUnit->TalkedToCreature(me->GetEntry(), me->GetGUID()); + if (Player* unit = Unit::GetPlayer(*me, uiPlayerGUID)) + unit->TalkedToCreature(me->GetEntry(), me->GetGUID()); me->UpdateEntry(NPC_KYLE_FRIENDLY); break; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index 6dc0d0365a0..acbe54d0acd 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp @@ -223,8 +223,8 @@ public: uint64 uiGrandChampionBoss1 = 0; if (Creature* pBoss = Unit::GetCreature(*me, uiVehicle1GUID)) if (Vehicle* pVehicle = pBoss->GetVehicleKit()) - if (Unit* pUnit = pVehicle->GetPassenger(0)) - uiGrandChampionBoss1 = pUnit->GetGUID(); + if (Unit* unit = pVehicle->GetPassenger(0)) + uiGrandChampionBoss1 = unit->GetGUID(); if (pInstance) { pInstance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_1, uiVehicle1GUID); @@ -239,8 +239,8 @@ public: uint64 uiGrandChampionBoss2 = 0; if (Creature* pBoss = Unit::GetCreature(*me, uiVehicle2GUID)) if (Vehicle* pVehicle = pBoss->GetVehicleKit()) - if (Unit* pUnit = pVehicle->GetPassenger(0)) - uiGrandChampionBoss2 = pUnit->GetGUID(); + if (Unit* unit = pVehicle->GetPassenger(0)) + uiGrandChampionBoss2 = unit->GetGUID(); if (pInstance) { pInstance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_2, uiVehicle2GUID); @@ -255,8 +255,8 @@ public: uint64 uiGrandChampionBoss3 = 0; if (Creature* pBoss = Unit::GetCreature(*me, uiVehicle3GUID)) if (Vehicle* pVehicle = pBoss->GetVehicleKit()) - if (Unit* pUnit = pVehicle->GetPassenger(0)) - uiGrandChampionBoss3 = pUnit->GetGUID(); + if (Unit* unit = pVehicle->GetPassenger(0)) + uiGrandChampionBoss3 = unit->GetGUID(); if (pInstance) { pInstance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_3, uiVehicle3GUID); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 013f2cd6e98..ff342db5503 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -292,14 +292,14 @@ struct boss_faction_championsAI : public ScriptedAI std::list<HostileReference*> const& tList = me->getThreatManager().getThreatList(); for (std::list<HostileReference*>::const_iterator itr = tList.begin(); itr != tList.end(); ++itr) { - Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); - if (pUnit && me->getThreatManager().getThreat(pUnit)) + Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + if (unit && me->getThreatManager().getThreat(unit)) { - if (pUnit->GetTypeId()==TYPEID_PLAYER) + if (unit->GetTypeId()==TYPEID_PLAYER) { - float threat = CalculateThreat(me->GetDistance2d(pUnit), (float)pUnit->GetArmor(), pUnit->GetHealth()); - me->getThreatManager().modifyThreatPercent(pUnit, -100); - me->AddThreat(pUnit, 1000000.0f * threat); + float threat = CalculateThreat(me->GetDistance2d(unit), (float)unit->GetArmor(), unit->GetHealth()); + me->getThreatManager().modifyThreatPercent(unit, -100); + me->AddThreat(unit, 1000000.0f * threat); } } } diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h index 8381ead167d..6237d7d57b0 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h @@ -114,8 +114,8 @@ struct boss_horAI : ScriptedAI me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); - if (Unit* pUnit = me->SelectNearestTarget()) - AttackStart(pUnit); + if (Unit* unit = me->SelectNearestTarget()) + AttackStart(unit); DoZoneInCombat(); break; diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index 22aaa74a174..16c258af756 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -276,8 +276,8 @@ public: if (timeBombTimer <= uiDiff) { - if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM)) - DoCast(pUnit, SPELL_TIME_BOMB); + if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM)) + DoCast(unit, SPELL_TIME_BOMB); timeBombTimer = urand(20000, 25000); } else timeBombTimer -= uiDiff; diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp index 318876d79e7..b02ea4bfc48 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp @@ -137,8 +137,8 @@ public: if (SpellVoidShiftTimer <= diff) { - if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_VOID_SHIFT); + if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(unit, SPELL_VOID_SHIFT); SpellVoidShiftTimer = 20000; } else SpellVoidShiftTimer -=diff; diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index c0fbbae1980..a0d64e38d49 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -1706,12 +1706,12 @@ public: { } - void SpellHit(Unit* pUnit, const SpellInfo* pSpell) + void SpellHit(Unit* unit, const SpellInfo* pSpell) { - if (pSpell->Id == SPELL_NEURAL_NEEDLE && pUnit->GetTypeId() == TYPEID_PLAYER) + if (pSpell->Id == SPELL_NEURAL_NEEDLE && unit->GetTypeId() == TYPEID_PLAYER) { ++uiPhase; - CasterGUID = pUnit->GetGUID(); + CasterGUID = unit->GetGUID(); } } diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index bf742a4602f..193c699f930 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -839,12 +839,12 @@ public: std::list<HostileReference*> t_list = me->getThreatManager().getThreatList(); for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) { - if (Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) + if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) { - if (pUnit->GetPositionZ() <= 286.276f) + if (unit->GetPositionZ() <= 286.276f) { me->getThreatManager().resetAllAggro(); - me->AddThreat(pUnit, 5.0f); + me->AddThreat(unit, 5.0f); break; } EnterEvadeMode(); @@ -961,12 +961,12 @@ public: std::list<HostileReference*> t_list = me->getThreatManager().getThreatList(); for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) { - if (Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) + if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) { - if (pUnit->GetPositionZ() <= 286.276f) + if (unit->GetPositionZ() <= 286.276f) { me->getThreatManager().resetAllAggro(); - me->AddThreat(pUnit, 5.0f); + me->AddThreat(unit, 5.0f); break; } EnterEvadeMode(); @@ -1083,7 +1083,7 @@ public: } - void EnterCombat(Unit* pUnit) + void EnterCombat(Unit* unit) { if (!SummonList.empty()) for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr) @@ -1091,7 +1091,7 @@ public: if (Creature* pTemp = Unit::GetCreature(*me, *itr)) { pTemp->m_CombatDistance = 100.0f; // ugly hack? we are not in a instance sorry. :( - pTemp->AI()->AttackStart(pUnit); + pTemp->AI()->AttackStart(unit); } } } @@ -1106,12 +1106,12 @@ public: std::list<HostileReference*> t_list = me->getThreatManager().getThreatList(); for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) { - if (Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) + if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) { - if (pUnit->GetPositionZ() <= 286.276f) + if (unit->GetPositionZ() <= 286.276f) { me->getThreatManager().resetAllAggro(); - me->AddThreat(pUnit, 5.0f); + me->AddThreat(unit, 5.0f); break; } EnterEvadeMode(); diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp index 66ef35f7400..21ecab02293 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp @@ -185,14 +185,14 @@ public: void RevertThreatOnTarget(uint64 guid) { - Unit* pUnit = NULL; - pUnit = Unit::GetUnit((*me), guid); - if (pUnit) + Unit* unit = NULL; + unit = Unit::GetUnit((*me), guid); + if (unit) { - if (DoGetThreat(pUnit)) - DoModifyThreatPercent(pUnit, -100); + if (DoGetThreat(unit)) + DoModifyThreatPercent(unit, -100); if (TargetThreat) - me->AddThreat(pUnit, TargetThreat); + me->AddThreat(unit, TargetThreat); } } diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 612065d5ee6..d602b4d2aac 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1474,9 +1474,9 @@ public: std::vector<Unit*> eliteList; for (std::list<HostileReference*>::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr) { - Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); - if (pUnit && pUnit->GetEntry() == ILLIDARI_ELITE) - eliteList.push_back(pUnit); + Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + if (unit && unit->GetEntry() == ILLIDARI_ELITE) + eliteList.push_back(unit); } for (std::vector<Unit*>::const_iterator itr = eliteList.begin(); itr != eliteList.end(); ++itr) (*itr)->setDeathState(JUST_DIED); diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index 4d79098689c..62e33f0913b 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -165,12 +165,12 @@ public: float Z = TeleportPoint[random].z; for (uint8 i = 0; i < 3; ++i) { - Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 1); - if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) + Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 1); + if (unit && unit->isAlive() && (unit->GetTypeId() == TYPEID_PLAYER)) { - TargetGUID[i] = pUnit->GetGUID(); - pUnit->CastSpell(pUnit, SPELL_TELEPORT_VISUAL, true); - DoTeleportPlayer(pUnit, X, Y, Z, pUnit->GetOrientation()); + TargetGUID[i] = unit->GetGUID(); + unit->CastSpell(unit, SPELL_TELEPORT_VISUAL, true); + DoTeleportPlayer(unit, X, Y, Z, unit->GetOrientation()); } } } @@ -247,12 +247,12 @@ public: { for (uint8 i = 0; i < 3; ++i) { - Unit* pUnit = NULL; + Unit* unit = NULL; if (TargetGUID[i]) { - pUnit = Unit::GetUnit((*me), TargetGUID[i]); - if (pUnit) - pUnit->CastSpell(pUnit, SPELL_ATTRACTION, true); + unit = Unit::GetUnit((*me), TargetGUID[i]); + if (unit) + unit->CastSpell(unit, SPELL_ATTRACTION, true); TargetGUID[i] = 0; } } diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index 746ad9aa7ff..c3bb4ee3d2b 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -216,12 +216,12 @@ public: std::list<HostileReference*>::const_iterator itr = m_threatlist.begin(); for (; itr != m_threatlist.end(); ++itr) { - Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); - if (pUnit) + Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + if (unit) { - DoModifyThreatPercent(pUnit, -100); - float threat = target->getThreatManager().getThreat(pUnit); - me->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences). + DoModifyThreatPercent(unit, -100); + float threat = target->getThreatManager().getThreat(unit); + me->AddThreat(unit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences). } } } @@ -438,9 +438,9 @@ public: std::list<HostileReference*>::const_iterator itr = m_threatlist.begin(); for (; itr != m_threatlist.end(); ++itr) { - Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) // Only alive players - targets.push_back(pUnit); + Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + if (unit && unit->isAlive() && (unit->GetTypeId() == TYPEID_PLAYER)) // Only alive players + targets.push_back(unit); } if (targets.empty()) return; // No targets added for some reason. No point continuing. diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 04646fb10bc..cced0207ca1 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -821,14 +821,14 @@ public: { bool Yelled = false; for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* pUnit = Unit::GetCreature(*me, *itr)) + if (Creature* unit = Unit::GetCreature(*me, *itr)) { if (!Yelled) { - DoScriptText(SAY_BROKEN_FREE_01, pUnit); + DoScriptText(SAY_BROKEN_FREE_01, unit); Yelled = true; } - pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); + unit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); } } ++EndingTalkCount; @@ -838,9 +838,9 @@ public: if (!BrokenList.empty()) { for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* pUnit = Unit::GetCreature(*me, *itr)) + if (Creature* unit = Unit::GetCreature(*me, *itr)) // This is the incorrect spell, but can't seem to find the right one. - pUnit->CastSpell(pUnit, 39656, true); + unit->CastSpell(unit, 39656, true); } ++EndingTalkCount; SoulRetrieveTimer = 5000; @@ -849,8 +849,8 @@ public: if (!BrokenList.empty()) { for (std::list<uint64>::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* pUnit = Unit::GetCreature((*me), *itr)) - pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0); + if (Creature* unit = Unit::GetCreature((*me), *itr)) + unit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0); } SoulRetrieveTimer = 0; break; diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index 4b235906505..6785f7e4e9e 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -177,13 +177,13 @@ public: std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit && me->IsWithinMeleeRange(pUnit)) + Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (unit && me->IsWithinMeleeRange(unit)) { - if (pUnit->GetHealth() > health) + if (unit->GetHealth() > health) { - health = pUnit->GetHealth(); - target = pUnit; + health = unit->GetHealth(); + target = unit; } } } diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 0d3301ec29b..53e5fae888e 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -173,9 +173,9 @@ public: std::list<Unit*> targets; for (; itr != m_threatlist.end(); ++itr) { - Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive()) - targets.push_back(pUnit); + Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + if (unit && unit->isAlive()) + targets.push_back(unit); } targets.sort(Trinity::ObjectDistanceOrderPred(me)); Unit* target = targets.front(); @@ -322,11 +322,11 @@ public: std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i) { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit && pUnit->isAlive()) + Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (unit && unit->isAlive()) { - float threat = DoGetThreat(pUnit); - Blossom->AddThreat(pUnit, threat); + float threat = DoGetThreat(unit); + Blossom->AddThreat(unit, threat); } } } @@ -389,9 +389,9 @@ public: Done = true; if (AggroTargetGUID) { - Unit* pUnit = Unit::GetUnit((*me), AggroTargetGUID); - if (pUnit) - AttackStart(pUnit); + Unit* unit = Unit::GetUnit((*me), AggroTargetGUID); + if (unit) + AttackStart(unit); DoZoneInCombat(); } diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index 7d698559197..71ee7d06f32 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -419,10 +419,10 @@ struct boss_illidari_councilAI : public ScriptedAI { for (uint8 i = 0; i < 4; ++i) { - if (Unit* pUnit = Unit::GetUnit(*me, Council[i])) - if (pUnit != me && pUnit->getVictim()) + if (Unit* unit = Unit::GetUnit(*me, Council[i])) + if (unit != me && unit->getVictim()) { - AttackStart(pUnit->getVictim()); + AttackStart(unit->getVictim()); return; } } @@ -437,11 +437,11 @@ struct boss_illidari_councilAI : public ScriptedAI damage /= 4; for (uint8 i = 0; i < 4; ++i) { - if (Creature* pUnit = Unit::GetCreature(*me, Council[i])) - if (pUnit != me && damage < pUnit->GetHealth()) + if (Creature* unit = Unit::GetCreature(*me, Council[i])) + if (unit != me && damage < unit->GetHealth()) { - pUnit->ModifyHealth(-int32(damage)); - pUnit->LowerPlayerDamageReq(damage); + unit->ModifyHealth(-int32(damage)); + unit->LowerPlayerDamageReq(damage); } } } @@ -504,15 +504,15 @@ public: Unit* SelectCouncilMember() { - Unit* pUnit = me; + Unit* unit = me; uint32 member = 0; // He chooses Lady Malande most often if (rand()%10 == 0) // But there is a chance he picks someone else. member = urand(1, 3); if (member != 2) // No need to create another pointer to us using Unit::GetUnit - pUnit = Unit::GetUnit((*me), Council[member]); - return pUnit; + unit = Unit::GetUnit((*me), Council[member]); + return unit; } void CastAuraOnCouncil() @@ -525,9 +525,9 @@ public: } for (uint8 i = 0; i < 4; ++i) { - Unit* pUnit = Unit::GetUnit((*me), Council[i]); - if (pUnit) - pUnit->CastSpell(pUnit, spellid, true, 0, 0, me->GetGUID()); + Unit* unit = Unit::GetUnit((*me), Council[i]); + if (unit) + unit->CastSpell(unit, spellid, true, 0, 0, me->GetGUID()); } } @@ -538,12 +538,12 @@ public: if (BlessingTimer <= diff) { - if (Unit* pUnit = SelectCouncilMember()) + if (Unit* unit = SelectCouncilMember()) { switch (urand(0, 1)) { - case 0: DoCast(pUnit, SPELL_BLESS_SPELLWARD); break; - case 1: DoCast(pUnit, SPELL_BLESS_PROTECTION); break; + case 0: DoCast(unit, SPELL_BLESS_SPELLWARD); break; + case 1: DoCast(unit, SPELL_BLESS_PROTECTION); break; } } BlessingTimer = 60000; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 6564972fd46..141e5d1c277 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -707,15 +707,15 @@ public: if (Heal_Timer <= diff) { // It can be cast on any of the mobs - Unit* pUnit = NULL; + Unit* unit = NULL; - while (pUnit == NULL || !pUnit->isAlive()) + while (unit == NULL || !unit->isAlive()) { - pUnit = selectAdvisorUnit(); + unit = selectAdvisorUnit(); } - if (pUnit && pUnit->isAlive()) - DoCast(pUnit, SPELL_HEAL); + if (unit && unit->isAlive()) + DoCast(unit, SPELL_HEAL); Heal_Timer = 60000; } else Heal_Timer -= diff; @@ -724,26 +724,26 @@ public: Unit* selectAdvisorUnit() { - Unit* pUnit = NULL; + Unit* unit = NULL; if (pInstance) { switch (rand()%4) { case 0: - pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESS)); + unit = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESS)); break; case 1: - pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_SHARKKIS)); + unit = Unit::GetUnit((*me), pInstance->GetData64(DATA_SHARKKIS)); break; case 2: - pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_TIDALVESS)); + unit = Unit::GetUnit((*me), pInstance->GetData64(DATA_TIDALVESS)); break; case 3: - pUnit = me; + unit = me; break; } - } else pUnit = me; - return pUnit; + } else unit = me; + return unit; } }; }; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index f3da63af38b..e1b3ab1308f 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -96,9 +96,9 @@ public: } void JustDied(Unit* /*victim*/) { - Unit* pUnit = Unit::GetUnit((*me), victimGUID); - if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER)) - pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER); + Unit* unit = Unit::GetUnit((*me), victimGUID); + if (unit && unit->HasAura(SPELL_INSIDIOUS_WHISPER)) + unit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER); } void DamageTaken(Unit* done_by, uint32 &damage) @@ -353,13 +353,13 @@ public: { if (InnderDemon[i] > 0) { - Creature* pUnit = Unit::GetCreature((*me), InnderDemon[i]); - if (pUnit && pUnit->isAlive()) + Creature* unit = Unit::GetCreature((*me), InnderDemon[i]); + if (unit && unit->isAlive()) { - Unit* unit_target = Unit::GetUnit(*pUnit, CAST_AI(mob_inner_demon::mob_inner_demonAI, pUnit->AI())->victimGUID); + Unit* unit_target = Unit::GetUnit(*unit, CAST_AI(mob_inner_demon::mob_inner_demonAI, unit->AI())->victimGUID); if (unit_target && unit_target->isAlive()) { - pUnit->CastSpell(unit_target, SPELL_CONSUMING_MADNESS, true); + unit->CastSpell(unit_target, SPELL_CONSUMING_MADNESS, true); DoModifyThreatPercent(unit_target, -100); } } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 2692d6f12da..12da67f94b5 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -770,8 +770,8 @@ class boss_kaelthas : public CreatureScript if (FlameStrike_Timer <= diff) { - if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_FLAME_STRIKE); + if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(unit, SPELL_FLAME_STRIKE); FlameStrike_Timer = 30000; } @@ -784,7 +784,7 @@ class boss_kaelthas : public CreatureScript for (uint32 i = 0; i < 3; ++i) { sLog->outDebug(LOG_FILTER_TSCR, "SD2: Kael'Thas mind control not supported."); - //DoCast(pUnit, SPELL_MIND_CONTROL); + //DoCast(unit, SPELL_MIND_CONTROL); } MindControl_Timer = 60000; @@ -892,11 +892,11 @@ class boss_kaelthas : public CreatureScript // 1) Kael'thas will portal the whole raid right into his body for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) + Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { //Use work around packet to prevent player from being dropped from combat - DoTeleportPlayer(pUnit, afGravityPos[0], afGravityPos[1], afGravityPos[2], pUnit->GetOrientation()); + DoTeleportPlayer(unit, afGravityPos[0], afGravityPos[1], afGravityPos[2], unit->GetOrientation()); } } @@ -913,20 +913,20 @@ class boss_kaelthas : public CreatureScript // 2) At that point he will put a Gravity Lapse debuff on everyone for (i = me->getThreatManager().getThreatList().begin(); i != me->getThreatManager().getThreatList().end(); ++i) { - if (Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid())) + if (Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid())) { - DoCast(pUnit, SPELL_KNOCKBACK, true); + DoCast(unit, SPELL_KNOCKBACK, true); //Gravity lapse - needs an exception in Spell system to work - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, 0, 0, me->GetGUID()); - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, me->GetGUID()); + unit->CastSpell(unit, SPELL_GRAVITY_LAPSE, true, 0, 0, me->GetGUID()); + unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, me->GetGUID()); //Using packet workaround WorldPacket data(12); data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); - data.append(pUnit->GetPackGUID()); + data.append(unit->GetPackGUID()); data << uint32(0); - pUnit->SendMessageToSet(&data, true); + unit->SendMessageToSet(&data, true); } } GravityLapse_Timer = 10000; @@ -946,14 +946,14 @@ class boss_kaelthas : public CreatureScript //Remove flight for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - if (Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid())) + if (Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid())) { //Using packet workaround WorldPacket data(12); data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); - data.append(pUnit->GetPackGUID()); + data.append(unit->GetPackGUID()); data << uint32(0); - pUnit->SendMessageToSet(&data, true); + unit->SendMessageToSet(&data, true); } } @@ -982,8 +982,8 @@ class boss_kaelthas : public CreatureScript //NetherBeam_Timer if (NetherBeam_Timer <= diff) { - if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_NETHER_BEAM); + if (Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(unit, SPELL_NETHER_BEAM); NetherBeam_Timer = 4000; } @@ -1286,12 +1286,12 @@ class boss_grand_astromancer_capernian : public CreatureScript std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList(); for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); //if in melee range - if (pUnit && pUnit->IsWithinDistInMap(me, 5)) + if (unit && unit->IsWithinDistInMap(me, 5)) { InMeleeRange = true; - target = pUnit; + target = unit; break; } } diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index 5b2350369f0..2ae0cce2ba2 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -809,10 +809,10 @@ public: for (std::list<HostileReference*>::const_iterator itr = AggroList.begin(); itr != AggroList.end(); ++itr) { - if (Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) + if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) { - if (pUnit->GetCreateMana() > 0) - UnitsWithMana.push_back(pUnit); + if (unit->GetCreateMana() > 0) + UnitsWithMana.push_back(unit); } } if (!UnitsWithMana.empty()) diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index b16166ed904..327964e7b1e 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -129,9 +129,9 @@ public: { if (bCanEat && !bIsEating) { - if (Unit* pUnit = Unit::GetUnit(*me, uiPlayerGUID)) + if (Unit* unit = Unit::GetUnit(*me, uiPlayerGUID)) { - if (GameObject* pGo = pUnit->FindNearestGameObject(GO_CARCASS, 10)) + if (GameObject* pGo = unit->FindNearestGameObject(GO_CARCASS, 10)) { if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); |