diff options
| author | click <click@gonnamakeyou.com> | 2011-07-02 23:16:45 +0200 |
|---|---|---|
| committer | click <click@gonnamakeyou.com> | 2011-07-02 23:16:45 +0200 |
| commit | 70115f52f7229254af99162f6f5639792a23da49 (patch) | |
| tree | c6acac7a3cf183fe14eadf82e07cac2ffde6c4c2 /src/server/scripts/Spells | |
| parent | 169f5da8c3120da98c01ebd8117f7aa527106206 (diff) | |
Core: Cleaning up hungarian notation - Phase3: pTarget -> target
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 14 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 16 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 32 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_rogue.cpp | 12 |
6 files changed, 44 insertions, 44 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index a6938122196..fbe890a41c4 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -476,10 +476,10 @@ class spell_gen_trick_or_treat : public SpellScriptLoader void HandleScript(SpellEffIndex /*effIndex*/) { - if (Player* pTarget = GetHitPlayer()) + if (Player* target = GetHitPlayer()) { - GetCaster()->CastSpell(pTarget, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL); - GetCaster()->CastSpell(pTarget, SPELL_TRICKED_OR_TREATED, true, NULL); + GetCaster()->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL); + GetCaster()->CastSpell(target, SPELL_TRICKED_OR_TREATED, true, NULL); } } diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 0cdeaf82c55..931d63d954b 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -369,23 +369,23 @@ public: return; uint32 spellId = SPELL_SNIPER_TRAINING_BUFF_R1 + GetId() - SPELL_SNIPER_TRAINING_R1; - Unit* pTarget = GetTarget(); - if (!pTarget->HasAura(spellId)) + Unit* target = GetTarget(); + if (!target->HasAura(spellId)) { SpellEntry const* triggeredSpellInfo = sSpellStore.LookupEntry(spellId); - Unit* triggerCaster = GetTriggeredSpellCaster(triggeredSpellInfo, caster, pTarget); - triggerCaster->CastSpell(pTarget, triggeredSpellInfo, true, 0, aurEff); + Unit* triggerCaster = GetTriggeredSpellCaster(triggeredSpellInfo, caster, target); + triggerCaster->CastSpell(target, triggeredSpellInfo, true, 0, aurEff); } } void HandleUpdatePeriodic(AuraEffect * aurEff) { - Unit* pTarget = GetUnitOwner(); - if (Player* playerTarget = pTarget->ToPlayer()) + Unit* target = GetUnitOwner(); + if (Player* playerTarget = target->ToPlayer()) { int32 baseAmount = aurEff->GetBaseAmount(); int32 amount = playerTarget->isMoving() ? - pTarget->CalculateSpellDamage(pTarget, GetSpellProto(), aurEff->GetEffIndex(), &baseAmount) : + target->CalculateSpellDamage(target, GetSpellProto(), aurEff->GetEffIndex(), &baseAmount) : aurEff->GetAmount() - 1; aurEff->SetAmount(amount); } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 76ef4eb2ccc..af62114014e 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -222,13 +222,13 @@ public: void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* pTarget = GetHitUnit()) + if (Unit* target = GetHitUnit()) { Unit* pCaster = GetCaster(); if (urand(0, 99) < 15) pCaster->CastSpell(pCaster, SPELL_GNOMISH_DEATH_RAY_SELF, true, NULL); // failure else - pCaster->CastSpell(pTarget, SPELL_GNOMISH_DEATH_RAY_TARGET, true, NULL); + pCaster->CastSpell(target, SPELL_GNOMISH_DEATH_RAY_TARGET, true, NULL); } } @@ -394,7 +394,7 @@ public: void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* pTarget = GetHitUnit()) + if (Unit* target = GetHitUnit()) { uint32 spellId = SPELL_NET_O_MATIC_TRIGGERED3; uint32 roll = urand(0, 99); @@ -403,7 +403,7 @@ public: else if (roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown) spellId = SPELL_NET_O_MATIC_TRIGGERED2; - GetCaster()->CastSpell(pTarget, spellId, true, NULL); + GetCaster()->CastSpell(target, spellId, true, NULL); } } @@ -572,7 +572,7 @@ public: void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* pTarget = GetHitUnit()) + if (Unit* target = GetHitUnit()) { Unit* pCaster = GetCaster(); @@ -588,17 +588,17 @@ public: { spellId = SPELL_POLYMORPH; if (urand(0, 100) <= 30) // 30% chance to self-cast - pTarget = pCaster; + target = pCaster; } else if (rand < 95) // Enveloping Winds (15% chance) spellId = SPELL_ENVELOPING_WINDS; else // Summon Felhund minion (5% chance) { spellId = SPELL_SUMMON_FELHOUND_MINION; - pTarget = pCaster; + target = pCaster; } - pCaster->CastSpell(pTarget, spellId, true, GetCastItem()); + pCaster->CastSpell(target, spellId, true, GetCastItem()); } } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 031a7da97f2..2de2e5a13cf 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -186,15 +186,15 @@ public: void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - Unit* pTarget = GetTarget(); + Unit* target = GetTarget(); if (Unit* pCaster = GetCaster()) - pCaster->CastSpell(pTarget, PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, true); + pCaster->CastSpell(target, PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, true); } void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - Unit* pTarget = GetTarget(); - pTarget->RemoveAura(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, GetCasterGUID()); + Unit* target = GetTarget(); + target->RemoveAura(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, GetCasterGUID()); } void Register() diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index aaa7186f2ac..c760220b5e5 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -221,9 +221,9 @@ public: PrepareAuraScript(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript) void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - Unit* pTarget = GetTarget(); - pTarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - pTarget->AddUnitState(UNIT_STAT_ROOT); + Unit* target = GetTarget(); + target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + target->AddUnitState(UNIT_STAT_ROOT); } void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) @@ -265,11 +265,11 @@ public: void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* pTarget = GetTargetUnit()) - if (pTarget->GetTypeId() == TYPEID_UNIT && pTarget->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) + if (Unit* target = GetTargetUnit()) + if (target->GetTypeId() == TYPEID_UNIT && target->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) // Make sure nobody else is channeling the same target - if (!pTarget->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER)) - GetCaster()->CastSpell(pTarget, SPELL_SCOURGING_CRYSTAL_CONTROLLER, true, GetCastItem()); + if (!target->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER)) + GetCaster()->CastSpell(target, SPELL_SCOURGING_CRYSTAL_CONTROLLER, true, GetCastItem()); } void Register() @@ -302,9 +302,9 @@ public: void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* pTarget = GetTargetUnit()) - if (pTarget->GetTypeId() == TYPEID_UNIT) - pTarget->RemoveAurasDueToSpell(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3); + if (Unit* target = GetTargetUnit()) + if (target->GetTypeId() == TYPEID_UNIT) + target->RemoveAurasDueToSpell(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3); } void Register() @@ -443,12 +443,12 @@ public: if (pCaster->GetTypeId() != TYPEID_PLAYER) return; - Creature* pTarget = GetHitCreature(); - if (!pTarget) + Creature* target = GetHitCreature(); + if (!target) return; uint32 spellId = 0; - switch (pTarget->GetEntry()) + switch (target->GetEntry()) { case NPC_SCAVENGEBOT_004A8: spellId = SPELL_SUMMON_SCAVENGEBOT_004A8; break; case NPC_SENTRYBOT_57K: spellId = SPELL_SUMMON_SENTRYBOT_57K; break; @@ -460,7 +460,7 @@ public: } pCaster->CastSpell(pCaster, spellId, true, castItem); pCaster->CastSpell(pCaster, SPELL_ROBOT_KILL_CREDIT, true); - pTarget->DespawnOrUnsummon(); + target->DespawnOrUnsummon(); } void Register() @@ -706,11 +706,11 @@ public: Unit* pCaster = GetCaster(); if (Player* player = pCaster->ToPlayer()) { - if(Creature* pTarget = GetHitCreature()) + if(Creature* target = GetHitCreature()) { player->CastSpell(player, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true, NULL); player->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER, 0); - pTarget->DespawnOrUnsummon(); + target->DespawnOrUnsummon(); } } } diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 4c2bdbfa4de..035c6d9b9b5 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -226,18 +226,18 @@ public: void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) { - Unit* pTarget = GetTarget(); - Unit* pVictim = pTarget->getVictim(); - if (pVictim && (pTarget->GetHealthPct() > pVictim->GetHealthPct())) + Unit* target = GetTarget(); + Unit* pVictim = target->getVictim(); + if (pVictim && (target->GetHealthPct() > pVictim->GetHealthPct())) { - if (!pTarget->HasAura(ROGUE_SPELL_PREY_ON_THE_WEAK)) + if (!target->HasAura(ROGUE_SPELL_PREY_ON_THE_WEAK)) { int32 bp = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), 0); - pTarget->CastCustomSpell(pTarget, ROGUE_SPELL_PREY_ON_THE_WEAK, &bp, 0, 0, true); + target->CastCustomSpell(target, ROGUE_SPELL_PREY_ON_THE_WEAK, &bp, 0, 0, true); } } else - pTarget->RemoveAurasDueToSpell(ROGUE_SPELL_PREY_ON_THE_WEAK); + target->RemoveAurasDueToSpell(ROGUE_SPELL_PREY_ON_THE_WEAK); } void Register() |
