Core: Cleaning up hungarian notation - Phase3: pTarget -> target

This commit is contained in:
click
2011-07-02 23:16:45 +02:00
parent 169f5da8c3
commit 70115f52f7
212 changed files with 1970 additions and 1970 deletions
@@ -132,13 +132,13 @@ public:
{
//Summon Astral Flare
Creature* AstralFlare = DoSpawnCreature(17096, float(rand()%37), float(rand()%37), 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (AstralFlare && pTarget)
if (AstralFlare && target)
{
AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false);
AstralFlare->AI()->AttackStart(pTarget);
AstralFlare->AI()->AttackStart(target);
}
//Reduce Mana by 10% of max health
@@ -184,8 +184,8 @@ public:
else
HatefulBoltTimer = 15000;
if (Unit* pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1))
DoCast(pTarget, SPELL_HATEFUL_BOLT);
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1))
DoCast(target, SPELL_HATEFUL_BOLT);
} else HatefulBoltTimer -= diff;
@@ -115,16 +115,16 @@ public:
if (Holyfire_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_HOLYFIRE);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_HOLYFIRE);
Holyfire_Timer = urand(8000, 23000); //Anywhere from 8 to 23 seconds, good luck having several of those in a row!
} else Holyfire_Timer -= diff;
if (Holywrath_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_HOLYWRATH);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_HOLYWRATH);
Holywrath_Timer = urand(20000, 25000); //20-30 secs sounds nice
} else Holywrath_Timer -= diff;
@@ -276,20 +276,20 @@ void boss_attumen::boss_attumenAI::UpdateAI(const uint32 diff)
{
if (ChargeTimer <= diff)
{
Unit* pTarget = NULL;
Unit* target = NULL;
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
std::vector<Unit* > target_list;
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (pTarget && !pTarget->IsWithinDist(me, ATTACK_DISTANCE, false))
target_list.push_back(pTarget);
pTarget = NULL;
target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (target && !target->IsWithinDist(me, ATTACK_DISTANCE, false))
target_list.push_back(target);
target = NULL;
}
if (!target_list.empty())
pTarget = *(target_list.begin()+rand()%target_list.size());
target = *(target_list.begin()+rand()%target_list.size());
DoCast(pTarget, SPELL_BERSERKER_CHARGE);
DoCast(target, SPELL_BERSERKER_CHARGE);
ChargeTimer = 20000;
} else ChargeTimer -= diff;
}
@@ -284,9 +284,9 @@ public:
if (Blind_Timer <= diff)
{
std::list<Unit*> pTargets;
SelectTargetList(pTargets, 5, SELECT_TARGET_RANDOM, me->GetMeleeReach()*5, true);
for (std::list<Unit*>::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i)
std::list<Unit*> targets;
SelectTargetList(targets, 5, SELECT_TARGET_RANDOM, me->GetMeleeReach()*5, true);
for (std::list<Unit*>::const_iterator i = targets.begin(); i != targets.end(); ++i)
if (!me->IsWithinMeleeRange(*i))
{
DoCast(*i, SPELL_BLIND);
@@ -302,8 +302,8 @@ public:
{
DoScriptText(RAND(SAY_SPECIAL_1, SAY_SPECIAL_2), me);
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
pTarget->CastSpell(pTarget, SPELL_GARROTE, true);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
target->CastSpell(target, SPELL_GARROTE, true);
InVanish = false;
} else Wait_Timer -= diff;
@@ -449,17 +449,17 @@ public:
if (ManaBurn_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (pTarget->getPowerType() == POWER_MANA)
DoCast(pTarget, SPELL_MANABURN);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (target->getPowerType() == POWER_MANA)
DoCast(target, SPELL_MANABURN);
ManaBurn_Timer = 5000; // 3 sec cast
} else ManaBurn_Timer -= diff;
if (ShadowWordPain_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoCast(pTarget, SPELL_SWPAIN);
DoCast(target, SPELL_SWPAIN);
ShadowWordPain_Timer = 7000;
}
} else ShadowWordPain_Timer -= diff;
@@ -573,9 +573,9 @@ public:
if (GreaterHeal_Timer <= diff)
{
Unit* pTarget = SelectGuestTarget();
Unit* target = SelectGuestTarget();
DoCast(pTarget, SPELL_GREATERHEAL);
DoCast(target, SPELL_GREATERHEAL);
GreaterHeal_Timer = 17000;
} else GreaterHeal_Timer -= diff;
@@ -587,8 +587,8 @@ public:
if (DispelMagic_Timer <= diff)
{
if (Unit* pTarget = RAND(SelectGuestTarget(), SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)))
DoCast(pTarget, SPELL_DISPELMAGIC);
if (Unit* target = RAND(SelectGuestTarget(), SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)))
DoCast(target, SPELL_DISPELMAGIC);
DispelMagic_Timer = 25000;
} else DispelMagic_Timer -= diff;
@@ -644,26 +644,26 @@ public:
if (HolyLight_Timer <= diff)
{
Unit* pTarget = SelectGuestTarget();
Unit* target = SelectGuestTarget();
DoCast(pTarget, SPELL_HOLYLIGHT);
DoCast(target, SPELL_HOLYLIGHT);
HolyLight_Timer = 10000;
} else HolyLight_Timer -= diff;
if (GreaterBless_Timer <= diff)
{
Unit* pTarget = SelectGuestTarget();
Unit* target = SelectGuestTarget();
DoCast(pTarget, SPELL_GREATERBLESSOFMIGHT);
DoCast(target, SPELL_GREATERBLESSOFMIGHT);
GreaterBless_Timer = 50000;
} else GreaterBless_Timer -= diff;
if (Cleanse_Timer <= diff)
{
Unit* pTarget = SelectGuestTarget();
Unit* target = SelectGuestTarget();
DoCast(pTarget, SPELL_CLEANSE);
DoCast(target, SPELL_CLEANSE);
Cleanse_Timer = 10000;
} else Cleanse_Timer -= diff;
@@ -96,9 +96,9 @@ public:
uint64 BeamerGUID[3]; // guid's of auxiliary beaming portals
uint64 BeamTarget[3]; // guid's of portals' current targets
bool IsBetween(WorldObject* u1, WorldObject *pTarget, WorldObject* u2) // the in-line checker
bool IsBetween(WorldObject* u1, WorldObject* target, WorldObject* u2) // the in-line checker
{
if (!u1 || !u2 || !pTarget)
if (!u1 || !u2 || !target)
return false;
float xn, yn, xp, yp, xh, yh;
@@ -106,8 +106,8 @@ public:
yn = u1->GetPositionY();
xp = u2->GetPositionX();
yp = u2->GetPositionY();
xh = pTarget->GetPositionX();
yh = pTarget->GetPositionY();
xh = target->GetPositionX();
yh = target->GetPositionY();
// check if target is between (not checking distance from the beam yet)
if (dist(xn, yn, xh, yh) >= dist(xn, yn, xp, yp) || dist(xp, yp, xh, yh) >= dist(xn, yn, xp, yp))
@@ -169,7 +169,7 @@ public:
// the one who's been casted upon before
Unit* current = Unit::GetUnit(*portal, BeamTarget[j]);
// temporary store for the best suitable beam reciever
Unit* pTarget = me;
Unit* target = me;
if (Map* map = me->GetMap())
{
@@ -180,41 +180,41 @@ public:
{
Player* p = i->getSource();
if (p && p->isAlive() // alive
&& (!pTarget || pTarget->GetDistance2d(portal)>p->GetDistance2d(portal)) // closer than current best
&& (!target || target->GetDistance2d(portal)>p->GetDistance2d(portal)) // closer than current best
&& !p->HasAura(PlayerDebuff[j], 0) // not exhausted
&& !p->HasAura(PlayerBuff[(j+1)%3], 0) // not on another beam
&& !p->HasAura(PlayerBuff[(j+2)%3], 0)
&& IsBetween(me, p, portal)) // on the beam
pTarget = p;
target = p;
}
}
// buff the target
if (pTarget->GetTypeId() == TYPEID_PLAYER)
pTarget->AddAura(PlayerBuff[j], pTarget);
if (target->GetTypeId() == TYPEID_PLAYER)
target->AddAura(PlayerBuff[j], target);
else
pTarget->AddAura(NetherBuff[j], pTarget);
target->AddAura(NetherBuff[j], target);
// cast visual beam on the chosen target if switched
// simple target switching isn't working -> using BeamerGUID to cast (workaround)
if (!current || pTarget != current)
if (!current || target != current)
{
BeamTarget[j] = pTarget->GetGUID();
BeamTarget[j] = target->GetGUID();
// remove currently beaming portal
if (Creature* beamer = Unit::GetCreature(*portal, BeamerGUID[j]))
{
beamer->CastSpell(pTarget, PortalBeam[j], false);
beamer->CastSpell(target, PortalBeam[j], false);
beamer->DisappearAndDie();
BeamerGUID[j] = 0;
}
// create new one and start beaming on the target
if (Creature* beamer = portal->SummonCreature(PortalID[j], portal->GetPositionX(), portal->GetPositionY(), portal->GetPositionZ(), portal->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 60000))
{
beamer->CastSpell(pTarget, PortalBeam[j], false);
beamer->CastSpell(target, PortalBeam[j], false);
BeamerGUID[j] = beamer->GetGUID();
}
}
// aggro target if Red Beam
if (j == RED_PORTAL && me->getVictim() != pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
me->getThreatManager().addThreat(pTarget, 100000.0f+DoGetThreat(me->getVictim()));
if (j == RED_PORTAL && me->getVictim() != target && target->GetTypeId() == TYPEID_PLAYER)
me->getThreatManager().addThreat(target, 100000.0f+DoGetThreat(me->getVictim()));
}
}
@@ -314,8 +314,8 @@ public:
// Netherbreath
if (NetherbreathTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true))
DoCast(pTarget, SPELL_NETHERBREATH);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true))
DoCast(target, SPELL_NETHERBREATH);
NetherbreathTimer = urand(5000, 7000);
} else NetherbreathTimer -= diff;
@@ -321,23 +321,23 @@ public:
if (CharredEarthTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CHARRED_EARTH);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_CHARRED_EARTH);
CharredEarthTimer = 20000;
} else CharredEarthTimer -= diff;
if (TailSweepTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (!me->HasInArc(M_PI, pTarget))
DoCast(pTarget, SPELL_TAIL_SWEEP);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (!me->HasInArc(M_PI, target))
DoCast(target, SPELL_TAIL_SWEEP);
TailSweepTimer = 15000;
} else TailSweepTimer -= diff;
if (SearingCindersTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_SEARING_CINDERS);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_SEARING_CINDERS);
SearingCindersTimer = 10000;
} else SearingCindersTimer -= diff;
@@ -378,8 +378,8 @@ public:
if (DistractingAshTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_DISTRACTING_ASH);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_DISTRACTING_ASH);
DistractingAshTimer = 2000; //timer wrong
} else DistractingAshTimer -= diff;
}
@@ -395,8 +395,8 @@ public:
if (FireballBarrageTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0))
DoCast(pTarget, SPELL_FIREBALL_BARRAGE);
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0))
DoCast(target, SPELL_FIREBALL_BARRAGE);
FireballBarrageTimer = 20000;
} else FireballBarrageTimer -= diff;
@@ -319,9 +319,9 @@ public:
std::list<HostileReference *>::const_iterator itr = t_list.begin();
std::advance(itr, 1);
for (; itr != t_list.end(); ++itr) //store the threat list in a different container
if (Unit* pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
if (pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
targets.push_back(pTarget);
if (Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
if (target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
targets.push_back(target);
//cut down to size if we have more than 5 targets
while (targets.size() > 5)
@@ -329,13 +329,13 @@ public:
uint32 i = 0;
for (std::vector<Unit* >::const_iterator iter = targets.begin(); iter != targets.end(); ++iter, ++i)
if (Unit* pTarget = *iter)
if (Unit* target = *iter)
{
enfeeble_targets[i] = pTarget->GetGUID();
enfeeble_health[i] = pTarget->GetHealth();
enfeeble_targets[i] = target->GetGUID();
enfeeble_health[i] = target->GetHealth();
pTarget->CastSpell(pTarget, SPELL_ENFEEBLE, true, 0, 0, me->GetGUID());
pTarget->SetHealth(1);
target->CastSpell(target, SPELL_ENFEEBLE, true, 0, 0, me->GetGUID());
target->SetHealth(1);
}
}
@@ -343,9 +343,9 @@ public:
{
for (uint8 i = 0; i < 5; ++i)
{
Unit* pTarget = Unit::GetUnit(*me, enfeeble_targets[i]);
if (pTarget && pTarget->isAlive())
pTarget->SetHealth(enfeeble_health[i]);
Unit* target = Unit::GetUnit(*me, enfeeble_targets[i]);
if (target && target->isAlive())
target->SetHealth(enfeeble_health[i]);
enfeeble_targets[i] = 0;
enfeeble_health[i] = 0;
}
@@ -449,7 +449,7 @@ public:
DoScriptText(SAY_AXE_TOSS2, me);
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
for (uint8 i = 0; i < 2; ++i)
{
Creature* axe = me->SummonCreature(MALCHEZARS_AXE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
@@ -458,12 +458,12 @@ public:
axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
axe->setFaction(me->getFaction());
axes[i] = axe->GetGUID();
if (pTarget)
if (target)
{
axe->AI()->AttackStart(pTarget);
//axe->getThreatManager().tauntApply(pTarget); //Taunt Apply and fade out does not work properly
axe->AI()->AttackStart(target);
//axe->getThreatManager().tauntApply(target); //Taunt Apply and fade out does not work properly
// So we'll use a hack to add a lot of threat to our target
axe->AddThreat(pTarget, 10000000.0f);
axe->AddThreat(target, 10000000.0f);
}
}
}
@@ -494,7 +494,7 @@ public:
{
AxesTargetSwitchTimer = urand(7500, 20000);
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
for (uint8 i = 0; i < 2; ++i)
{
@@ -502,10 +502,10 @@ public:
{
if (axe->getVictim())
DoModifyThreatPercent(axe->getVictim(), -100);
if (pTarget)
axe->AddThreat(pTarget, 1000000.0f);
if (target)
axe->AddThreat(target, 1000000.0f);
//axe->getThreatManager().tauntFadeOut(axe->getVictim());
//axe->getThreatManager().tauntApply(pTarget);
//axe->getThreatManager().tauntApply(target);
}
}
}
@@ -513,8 +513,8 @@ public:
if (AmplifyDamageTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_AMPLIFY_DAMAGE);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_AMPLIFY_DAMAGE);
AmplifyDamageTimer = urand(20000, 30000);
} else AmplifyDamageTimer -= diff;
}
@@ -536,14 +536,14 @@ public:
{
if (SWPainTimer <= diff)
{
Unit* pTarget = NULL;
Unit* target = NULL;
if (phase == 1)
pTarget = me->getVictim(); // the tank
target = me->getVictim(); // the tank
else // anyone but the tank
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
if (pTarget)
DoCast(pTarget, SPELL_SW_PAIN);
if (target)
DoCast(target, SPELL_SW_PAIN);
SWPainTimer = 20000;
} else SWPainTimer -= diff;
@@ -195,10 +195,10 @@ public:
//store the threat list in a different container
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
Unit* pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
//only on alive players
if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
targets.push_back(pTarget);
if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
targets.push_back(target);
}
//cut down to size if we have more than 3 targets
@@ -309,8 +309,8 @@ public:
{
if (!me->IsNonMeleeSpellCasted(false))
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (!pTarget)
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (!target)
return;
uint32 Spells[3];
@@ -337,7 +337,7 @@ public:
if (AvailableSpells)
{
CurrentNormalSpell = Spells[rand() % AvailableSpells];
DoCast(pTarget, CurrentNormalSpell);
DoCast(target, CurrentNormalSpell);
}
}
NormalCastTimer = 1000;
@@ -351,8 +351,8 @@ public:
DoCast(me, SPELL_AOE_CS);
break;
case 1:
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CHAINSOFICE);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_CHAINSOFICE);
break;
}
SecondarySpellTimer = urand(5000, 20000);
@@ -370,15 +370,15 @@ public:
if (SacrificeTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
if (pTarget && pTarget->isAlive())
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
if (target && target->isAlive())
{
DoCast(pTarget, SPELL_SACRIFICE, true);
DoCast(pTarget, SPELL_SUMMON_DEMONCHAINS, true);
DoCast(target, SPELL_SACRIFICE, true);
DoCast(target, SPELL_SUMMON_DEMONCHAINS, true);
if (Creature* Chains = me->FindNearestCreature(CREATURE_DEMONCHAINS, 5000))
{
CAST_AI(mob_demon_chain::mob_demon_chainAI, Chains->AI())->SacrificeGUID = pTarget->GetGUID();
CAST_AI(mob_demon_chain::mob_demon_chainAI, Chains->AI())->SacrificeGUID = target->GetGUID();
Chains->CastSpell(Chains, SPELL_DEMON_CHAINS, true);
DoScriptText(RAND(SAY_SACRIFICE1, SAY_SACRIFICE2), me);
SacrificeTimer = 30000;
@@ -388,8 +388,8 @@ public:
if (BrainWipeTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_BRAIN_WIPE);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_BRAIN_WIPE);
BrainWipeTimer = 20000;
} else BrainWipeTimer -= diff;
@@ -869,15 +869,15 @@ public:
{
if (!IsChasing)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoScriptText(SAY_WOLF_HOOD, me);
DoCast(pTarget, SPELL_LITTLE_RED_RIDING_HOOD, true);
TempThreat = DoGetThreat(pTarget);
DoCast(target, SPELL_LITTLE_RED_RIDING_HOOD, true);
TempThreat = DoGetThreat(target);
if (TempThreat)
DoModifyThreatPercent(pTarget, -100);
HoodGUID = pTarget->GetGUID();
me->AddThreat(pTarget, 1000000.0f);
DoModifyThreatPercent(target, -100);
HoodGUID = target->GetGUID();
me->AddThreat(target, 1000000.0f);
ChaseTimer = 20000;
IsChasing = true;
}
@@ -886,12 +886,12 @@ public:
{
IsChasing = false;
if (Unit* pTarget = Unit::GetUnit((*me), HoodGUID))
if (Unit* target = Unit::GetUnit((*me), HoodGUID))
{
HoodGUID = 0;
if (DoGetThreat(pTarget))
DoModifyThreatPercent(pTarget, -100);
me->AddThreat(pTarget, TempThreat);
if (DoGetThreat(target))
DoModifyThreatPercent(target, -100);
me->AddThreat(target, TempThreat);
TempThreat = 0;
}
@@ -977,19 +977,19 @@ void PretendToDie(Creature* creature)
creature->SetStandState(UNIT_STAND_STATE_DEAD);
};
void Resurrect(Creature* pTarget)
void Resurrect(Creature* target)
{
pTarget->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pTarget->SetFullHealth();
pTarget->SetStandState(UNIT_STAND_STATE_STAND);
pTarget->CastSpell(pTarget, SPELL_RES_VISUAL, true);
if (pTarget->getVictim())
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
target->SetFullHealth();
target->SetStandState(UNIT_STAND_STATE_STAND);
target->CastSpell(target, SPELL_RES_VISUAL, true);
if (target->getVictim())
{
pTarget->GetMotionMaster()->MoveChase(pTarget->getVictim());
pTarget->AI()->AttackStart(pTarget->getVictim());
target->GetMotionMaster()->MoveChase(target->getVictim());
target->AI()->AttackStart(target->getVictim());
}
else
pTarget->GetMotionMaster()->Initialize();
target->GetMotionMaster()->Initialize();
};
class boss_julianne : public CreatureScript
@@ -1289,10 +1289,10 @@ public:
if (BackwardLungeTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
if (pTarget && !me->HasInArc(M_PI, pTarget))
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
if (target && !me->HasInArc(M_PI, target))
{
DoCast(pTarget, SPELL_BACKWARD_LUNGE);
DoCast(target, SPELL_BACKWARD_LUNGE);
BackwardLungeTimer = urand(15000, 30000);
}
} else BackwardLungeTimer -= diff;
@@ -1305,8 +1305,8 @@ public:
if (DeadlySwatheTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_DEADLY_SWATHE);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_DEADLY_SWATHE);
DeadlySwatheTimer = urand(15000, 25000);
} else DeadlySwatheTimer -= diff;
@@ -1410,8 +1410,8 @@ void boss_julianne::boss_julianneAI::UpdateAI(const uint32 diff)
if (BlindingPassionTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_BLINDING_PASSION);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_BLINDING_PASSION);
BlindingPassionTimer = urand(30000, 45000);
} else BlindingPassionTimer -= diff;