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
@@ -83,8 +83,8 @@ public:
//CurseOfTongues_Timer
if (CurseOfTongues_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CURSEOFTONGUES);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_CURSEOFTONGUES);
CurseOfTongues_Timer = 18000;
} else CurseOfTongues_Timer -= diff;
@@ -105,8 +105,8 @@ public:
//EnvelopingWeb_Timer
if (EnvelopingWeb_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_ENVELOPINGWEB);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_ENVELOPINGWEB);
EnvelopingWeb_Timer = 12000;
} else EnvelopingWeb_Timer -= diff;
@@ -81,8 +81,8 @@ public:
if (HandOfThaurissan_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_HANDOFTHAURISSAN);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_HANDOFTHAURISSAN);
//3 Hands of Thaurissan will be casted
//if (Counter < 3)
@@ -73,16 +73,16 @@ public:
//ShadowWordPain_Timer
if (ShadowWordPain_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_SHADOWWORDPAIN);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_SHADOWWORDPAIN);
ShadowWordPain_Timer = 7000;
} else ShadowWordPain_Timer -= diff;
//ManaBurn_Timer
if (ManaBurn_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_MANABURN);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_MANABURN);
ManaBurn_Timer = 10000;
} else ManaBurn_Timer -= diff;
@@ -222,8 +222,8 @@ public:
//Immolate_Timer
if (Immolate_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_IMMOLATE);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_IMMOLATE);
Immolate_Timer = 25000;
} else Immolate_Timer -= diff;
@@ -378,8 +378,8 @@ public:
{
boss->setFaction(FACTION_HOSTILE);
boss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
if (Unit* pTarget = boss->SelectNearestTarget(500))
boss->AI()->AttackStart(pTarget);
if (Unit* target = boss->SelectNearestTarget(500))
boss->AI()->AttackStart(target);
}
}
}
@@ -86,8 +86,8 @@ public:
events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, 45*IN_MILLISECONDS);
break;
case EVENT_HEX:
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_HEX);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_HEX);
events.ScheduleEvent(EVENT_HEX, 15*IN_MILLISECONDS);
break;
case EVENT_CLEAVE:
@@ -262,7 +262,7 @@ public:
&& pUnit->HasAura(SPELL_BROODAF_GREEN))
{
//pTarget->RemoveAllAuras();
//DoCast(pTarget, SPELL_CHROMATIC_MUT_1);
//DoCast(target, SPELL_CHROMATIC_MUT_1);
//Chromatic mutation is causing issues
//Assuming it is caused by a lack of core support for Charm
@@ -114,8 +114,8 @@ public:
// Aura Check. If the gamer is affected by confliguration we attack a random gamer.
if (me->getVictim() && me->getVictim()->HasAura(SPELL_CONFLAGRATION))
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
me->TauntApply(pTarget);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
me->TauntApply(target);
DoMeleeAttackIfReady();
}
@@ -115,10 +115,10 @@ public:
DoingSpeech = false;
}
void BeginSpeech(Unit* pTarget)
void BeginSpeech(Unit* target)
{
//Stand up and begin speach
PlayerGUID = pTarget->GetGUID();
PlayerGUID = target->GetGUID();
//10 seconds
DoScriptText(SAY_LINE1, me);
@@ -208,18 +208,18 @@ public:
//BurningAdrenalineCaster_Timer
if (BurningAdrenalineCaster_Timer <= diff)
{
Unit* pTarget = NULL;
Unit* target = NULL;
uint8 i = 0;
while (i < 3) // max 3 tries to get a random target with power_mana
{
++i;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader
if (pTarget && pTarget->getPowerType() == POWER_MANA)
target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader
if (target && target->getPowerType() == POWER_MANA)
i = 3;
}
if (pTarget) // cast on self (see below)
pTarget->CastSpell(pTarget, SPELL_BURNINGADRENALINE, 1);
if (target) // cast on self (see below)
target->CastSpell(target, SPELL_BURNINGADRENALINE, 1);
BurningAdrenalineCaster_Timer = 15000;
} else BurningAdrenalineCaster_Timer -= diff;
@@ -224,7 +224,7 @@ public:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void BeginEvent(Player* pTarget)
void BeginEvent(Player* target)
{
DoScriptText(SAY_GAMESBEGIN_2, me);
@@ -240,7 +240,7 @@ public:
me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
me->setFaction(103);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
AttackStart(pTarget);
AttackStart(target);
}
void EnterCombat(Unit* /*who*/)
@@ -269,8 +269,8 @@ public:
//ShadowBoltTimer
if (ShadowBoltTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_SHADOWBOLT);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_SHADOWBOLT);
ShadowBoltTimer = urand(3000, 10000);
} else ShadowBoltTimer -= diff;
@@ -278,8 +278,8 @@ public:
//FearTimer
if (FearTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_FEAR);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_FEAR);
FearTimer = 10000 + (rand()%10000);
} else FearTimer -= diff;
@@ -290,7 +290,7 @@ public:
//Spawn 2 random types of creatures at the 2 locations
uint32 CreatureID;
Creature* Spawned = NULL;
Unit* pTarget = NULL;
Unit* target = NULL;
//1 in 3 chance it will be a chromatic
if (urand(0, 2) == 0)
@@ -302,10 +302,10 @@ public:
//Spawn Creature and force it to start attacking a random target
Spawned = me->SummonCreature(CreatureID, ADD_X1, ADD_Y1, ADD_Z1, 5.000f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pTarget && Spawned)
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (target && Spawned)
{
Spawned->AI()->AttackStart(pTarget);
Spawned->AI()->AttackStart(target);
Spawned->setFaction(103);
}
@@ -318,10 +318,10 @@ public:
++SpawnedAdds;
Spawned = me->SummonCreature(CreatureID, ADD_X2, ADD_Y2, ADD_Z2, 5.000f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pTarget && Spawned)
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (target && Spawned)
{
Spawned->AI()->AttackStart(pTarget);
Spawned->AI()->AttackStart(target);
Spawned->setFaction(103);
}
@@ -346,10 +346,10 @@ public:
//Spawn nef and have him attack a random target
Creature* Nefarian = me->SummonCreature(CREATURE_NEFARIAN, NEF_X, NEF_Y, NEF_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pTarget && Nefarian)
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (target && Nefarian)
{
Nefarian->AI()->AttackStart(pTarget);
Nefarian->AI()->AttackStart(target);
Nefarian->setFaction(103);
NefarianGUID = Nefarian->GetGUID();
}
@@ -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;
@@ -302,7 +302,7 @@ public:
if (PhoenixTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
uint8 random = urand(1, 2);
float x = KaelLocations[random][0];
@@ -313,7 +313,7 @@ public:
{
Phoenix->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
SetThreatList(Phoenix);
Phoenix->AI()->AttackStart(pTarget);
Phoenix->AI()->AttackStart(target);
}
DoScriptText(SAY_PHOENIX, me);
@@ -323,11 +323,11 @@ public:
if (FlameStrikeTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
me->InterruptSpell(CURRENT_CHANNELED_SPELL);
me->InterruptSpell(CURRENT_GENERIC_SPELL);
DoCast(pTarget, SPELL_FLAMESTRIKE3, true);
DoCast(target, SPELL_FLAMESTRIKE3, true);
DoScriptText(SAY_FLAMESTRIKE, me);
}
FlameStrikeTimer = urand(15000, 25000);
@@ -395,15 +395,15 @@ public:
for (uint8 i = 0; i < 3; ++i)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
if (Orb && pTarget)
if (Orb && target)
{
Orb->SetSpeed(MOVE_RUN, 0.5f);
Orb->AddThreat(pTarget, 1000000.0f);
Orb->AI()->AttackStart(pTarget);
Orb->AddThreat(target, 1000000.0f);
Orb->AI()->AttackStart(target);
}
}
@@ -671,11 +671,11 @@ public:
if (ChangeTargetTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
me->AddThreat(pTarget, 1.0f);
me->TauntApply(pTarget);
AttackStart(pTarget);
me->AddThreat(target, 1.0f);
me->TauntApply(target);
AttackStart(target);
}
ChangeTargetTimer = urand(5000, 15000);
@@ -256,72 +256,72 @@ public:
if (HealTimer <= diff)
{
uint32 health = me->GetHealth();
Unit* pTarget = me;
Unit* target = me;
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
{
if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[i]))
{
if (pAdd->isAlive() && pAdd->GetHealth() < health)
pTarget = pAdd;
target = pAdd;
}
}
DoCast(pTarget, SPELL_FLASH_HEAL);
DoCast(target, SPELL_FLASH_HEAL);
HealTimer = 15000;
} else HealTimer -= diff;
if (RenewTimer <= diff)
{
Unit* pTarget = me;
Unit* target = me;
if (urand(0, 1))
if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
if (pAdd->isAlive())
pTarget = pAdd;
target = pAdd;
DoCast(pTarget, SPELL_RENEW_NORMAL);
DoCast(target, SPELL_RENEW_NORMAL);
RenewTimer = 5000;
} else RenewTimer -= diff;
if (ShieldTimer <= diff)
{
Unit* pTarget = me;
Unit* target = me;
if (urand(0, 1))
if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
if (pAdd->isAlive() && !pAdd->HasAura(SPELL_SHIELD))
pTarget = pAdd;
target = pAdd;
DoCast(pTarget, SPELL_SHIELD);
DoCast(target, SPELL_SHIELD);
ShieldTimer = 7500;
} else ShieldTimer -= diff;
if (DispelTimer <= diff)
{
Unit* pTarget = NULL;
Unit* target = NULL;
if (urand(0, 1))
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
else
{
if (urand(0, 1))
pTarget = me;
target = me;
else
if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
if (pAdd->isAlive())
pTarget = pAdd;
target = pAdd;
}
if (pTarget)
DoCast(pTarget, SPELL_DISPEL_MAGIC);
if (target)
DoCast(target, SPELL_DISPEL_MAGIC);
DispelTimer = 12000;
} else DispelTimer -= diff;
if (SWPainTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_SW_PAIN_NORMAL);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_SW_PAIN_NORMAL);
SWPainTimer = 10000;
} else SWPainTimer -= diff;
@@ -791,9 +791,9 @@ public:
if (Polymorph_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
DoCast(pTarget, SPELL_POLYMORPH);
DoCast(target, SPELL_POLYMORPH);
Polymorph_Timer = 20000;
}
} else Polymorph_Timer -= diff;
@@ -836,10 +836,10 @@ 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* pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
if (Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
{
//if in melee range
if (pTarget->IsWithinDistInMap(me, 5))
if (target->IsWithinDistInMap(me, 5))
{
InMeleeRange = true;
break;
@@ -923,10 +923,10 @@ 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* pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
if (Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
{
//if in melee range
if (pTarget->IsWithinDistInMap(me, ATTACK_DISTANCE))
if (target->IsWithinDistInMap(me, ATTACK_DISTANCE))
{
InMeleeRange = true;
break;
@@ -163,17 +163,17 @@ public:
if (ChainLightningTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_CHAIN_LIGHTNING);
ChainLightningTimer = 8000;
} else ChainLightningTimer -= diff;
if (ArcaneShockTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (pTarget)
DoCast(pTarget, SPELL_ARCANE_SHOCK);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (target)
DoCast(target, SPELL_ARCANE_SHOCK);
ArcaneShockTimer = 8000;
} else ArcaneShockTimer -= diff;
@@ -99,8 +99,8 @@ class boss_golemagg : public CreatureScript
switch (eventId)
{
case EVENT_PYROBLAST:
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_PYROBLAST);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_PYROBLAST);
events.ScheduleEvent(EVENT_PYROBLAST, 7000);
break;
case EVENT_EARTHQUAKE:
@@ -259,9 +259,9 @@ class boss_ragnaros : public CreatureScript
// summon 8 elementals
for (uint8 i = 0; i < 8; ++i)
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Creature* pSummoned = me->SummonCreature(12143, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 900000))
pSummoned->AI()->AttackStart(pTarget);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Creature* pSummoned = me->SummonCreature(12143, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 900000))
pSummoned->AI()->AttackStart(target);
_hasSubmergedOnce = true;
_isBanished = true;
@@ -274,9 +274,9 @@ class boss_ragnaros : public CreatureScript
DoScriptText(SAY_REINFORCEMENTS2, me);
for (uint8 i = 0; i < 8; ++i)
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Creature* pSummoned = me->SummonCreature(12143, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 900000))
pSummoned->AI()->AttackStart(pTarget);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Creature* pSummoned = me->SummonCreature(12143, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 900000))
pSummoned->AI()->AttackStart(target);
_isBanished = true;
//DoCast(me, SPELL_RAGSUBMERGE);
@@ -155,7 +155,7 @@ public:
}
}
void EventStart(Creature* anchor, Player* pTarget)
void EventStart(Creature* anchor, Player* target)
{
wait_timer = 5000;
phase = PHASE_TO_EQUIP;
@@ -167,8 +167,8 @@ public:
float z;
anchor->GetContactPoint(me, anchorX, anchorY, z, 1.0f);
playerGUID = pTarget->GetGUID();
DoScriptText(say_event_start[rand()%8], me, pTarget);
playerGUID = target->GetGUID();
DoScriptText(say_event_start[rand()%8], me, target);
}
void UpdateAI(const uint32 diff)
@@ -233,8 +233,8 @@ public:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
phase = PHASE_ATTACKING;
if (Player* pTarget = Unit::GetPlayer(*me, playerGUID))
me->AI()->AttackStart(pTarget);
if (Player* target = Unit::GetPlayer(*me, playerGUID))
me->AI()->AttackStart(target);
wait_timer = 0;
}
}
@@ -561,8 +561,8 @@ public:
Phase = 1;
break;
case 1:
if (Unit* pTarget = Unit::GetUnit(*me, TargetGUID))
DoCast(pTarget, DESPAWN_HORSE, true);
if (Unit* target = Unit::GetUnit(*me, TargetGUID))
DoCast(target, DESPAWN_HORSE, true);
PhaseTimer = 3000;
Phase = 2;
break;
@@ -101,8 +101,8 @@ public:
if (Polymorph_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
DoCast(pTarget, SPELL_POLYMORPH);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
DoCast(target, SPELL_POLYMORPH);
Polymorph_Timer = 20000;
} else Polymorph_Timer -= diff;
@@ -249,9 +249,9 @@ public:
}
void EnterCombat(Unit* /*who*/) {}
void SaySound(int32 textEntry, Unit* pTarget = 0)
void SaySound(int32 textEntry, Unit* target = 0)
{
DoScriptText(textEntry, me, pTarget);
DoScriptText(textEntry, me, target);
//DoCast(me, SPELL_HEAD_SPEAKS, true);
Creature* speaker = DoSpawnCreature(HELPER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 1000);
if (speaker)
@@ -502,9 +502,9 @@ public:
}
}
void SaySound(int32 textEntry, Unit* pTarget = 0)
void SaySound(int32 textEntry, Unit* target = 0)
{
DoScriptText(textEntry, me, pTarget);
DoScriptText(textEntry, me, target);
laugh += 4000;
}
@@ -87,8 +87,8 @@ public:
//Fear_Timer
if (Fear_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
DoCast(pTarget, SPELL_FEAR);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
DoCast(target, SPELL_FEAR);
Fear_Timer = 40000;
} else Fear_Timer -= diff;
@@ -96,8 +96,8 @@ public:
//Sleep_Timer
if (Sleep_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0))
DoCast(pTarget, SPELL_SLEEP);
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0))
DoCast(target, SPELL_SLEEP);
Sleep_Timer = 30000;
} else Sleep_Timer -= diff;
@@ -112,8 +112,8 @@ public:
//Dispel_Timer
if (Dispel_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_DISPELMAGIC);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_DISPELMAGIC);
DispelMagic_Timer = 30000;
} else DispelMagic_Timer -= diff;
@@ -317,10 +317,10 @@ public:
//If we are <75% hp cast healing spells at self or Mograine
if (m_uiHeal_Timer <= uiDiff)
{
Creature* pTarget = NULL;
Creature* target = NULL;
if (!HealthAbovePct(75))
pTarget = me;
target = me;
if (m_pInstance)
{
@@ -328,12 +328,12 @@ public:
{
// checking m_bCanResurrectCheck prevents her healing Mograine while he is "faking death"
if (m_bCanResurrectCheck && pMograine->isAlive() && !pMograine->HealthAbovePct(75))
pTarget = pMograine;
target = pMograine;
}
}
if (pTarget)
DoCast(pTarget, SPELL_HEAL);
if (target)
DoCast(target, SPELL_HEAL);
m_uiHeal_Timer = 13000;
} else m_uiHeal_Timer -= uiDiff;
@@ -124,93 +124,93 @@ public:
{
if (Teleport_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target && target->GetTypeId() == TYPEID_PLAYER)
{
if (DoGetThreat(pTarget))
DoModifyThreatPercent(pTarget, -100);
if (DoGetThreat(target))
DoModifyThreatPercent(target, -100);
Creature* Summoned = NULL;
switch(rand()%6)
{
case 0:
DoTeleportPlayer(pTarget, 250.0696f, 0.3921f, 84.8408f, 3.149f);
DoTeleportPlayer(target, 250.0696f, 0.3921f, 84.8408f, 3.149f);
Summoned = me->SummonCreature(16119, 254.2325f, 0.3417f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 257.7133f, 4.0226f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 258.6702f, -2.60656f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
break;
case 1:
DoTeleportPlayer(pTarget, 181.4220f, -91.9481f, 84.8410f, 1.608f);
DoTeleportPlayer(target, 181.4220f, -91.9481f, 84.8410f, 1.608f);
Summoned = me->SummonCreature(16119, 184.0519f, -73.5649f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 179.5951f, -73.7045f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 180.6452f, -78.2143f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 283.2274f, -78.1518f, 84.8407f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
break;
case 2:
DoTeleportPlayer(pTarget, 95.1547f, -1.8173f, 85.2289f, 0.043f);
DoTeleportPlayer(target, 95.1547f, -1.8173f, 85.2289f, 0.043f);
Summoned = me->SummonCreature(16119, 100.9404f, -1.8016f, 85.2289f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 101.3729f, 0.4882f, 85.2289f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 101.4596f, -4.4740f, 85.2289f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
break;
case 3:
DoTeleportPlayer(pTarget, 250.0696f, 0.3921f, 72.6722f, 3.149f);
DoTeleportPlayer(target, 250.0696f, 0.3921f, 72.6722f, 3.149f);
Summoned = me->SummonCreature(16119, 240.34481f, 0.7368f, 72.6722f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 240.3633f, -2.9520f, 72.6722f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 240.6702f, 3.34949f, 72.6722f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
break;
case 4:
DoTeleportPlayer(pTarget, 181.4220f, -91.9481f, 70.7734f, 1.608f);
DoTeleportPlayer(target, 181.4220f, -91.9481f, 70.7734f, 1.608f);
Summoned = me->SummonCreature(16119, 184.0519f, -73.5649f, 70.7734f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 179.5951f, -73.7045f, 70.7734f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 180.6452f, -78.2143f, 70.7734f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 283.2274f, -78.1518f, 70.7734f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
break;
case 5:
DoTeleportPlayer(pTarget, 106.1541f, -1.8994f, 75.3663f, 0.043f);
DoTeleportPlayer(target, 106.1541f, -1.8994f, 75.3663f, 0.043f);
Summoned = me->SummonCreature(16119, 115.3945f, -1.5555f, 75.3663f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 257.7133f, 1.8066f, 75.3663f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
Summoned = me->SummonCreature(16119, 258.6702f, -5.1001f, 75.3663f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned->AI()->AttackStart(target);
break;
}
}
@@ -89,9 +89,9 @@ public:
//ShadowShock_Timer
if (ShadowShock_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget) DoCast(pTarget, SPELL_SHADOWSHOCK);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target) DoCast(target, SPELL_SHADOWSHOCK);
ShadowShock_Timer = 12000;
} else ShadowShock_Timer -= diff;
@@ -96,9 +96,9 @@ public:
//Corruption_Timer
if (Corruption_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget) DoCast(pTarget, SPELL_CORRUPTION);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target) DoCast(target, SPELL_CORRUPTION);
Corruption_Timer = 24000;
} else Corruption_Timer -= diff;
@@ -111,12 +111,12 @@ public:
DoModifyThreatPercent(me->getVictim(), -99);
//Summon 10 Illusions attacking random gamers
Unit* pTarget = NULL;
Unit* target = NULL;
for (uint8 i = 0; i < 10; ++i)
{
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
SummonIllusions(pTarget);
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
SummonIllusions(target);
}
Invisible = true;
Invisible_Timer = 3000;
@@ -78,9 +78,9 @@ public:
//Immolate_Timer
if (Immolate_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget) DoCast(pTarget, SPELL_IMMOLATE);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target) DoCast(target, SPELL_IMMOLATE);
Immolate_Timer = 12000;
} else Immolate_Timer -= diff;
@@ -82,8 +82,8 @@ public:
//Frostbolt_Timer
if (Frostbolt_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_FROSTBOLT);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_FROSTBOLT);
Frostbolt_Timer = 8000;
} else Frostbolt_Timer -= diff;
@@ -122,8 +122,8 @@ public:
void JustSummoned(Creature* summoned)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
summoned->AI()->AttackStart(pTarget);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
summoned->AI()->AttackStart(target);
}
void JustDied(Unit* /*Killer*/)
@@ -111,9 +111,9 @@ public:
//Cast
if (rand()%100 < 65)
{
Unit* pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)DoCast(pTarget, SPELL_POSSESS);
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (target)DoCast(target, SPELL_POSSESS);
}
//50 seconds until we should cast this again
Possess_Timer = 50000;
@@ -186,8 +186,8 @@ public:
//PsychicScream
if (m_uiPsychicScream_Timer <= uiDiff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_PSYCHICSCREAM);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_PSYCHICSCREAM);
m_uiPsychicScream_Timer = 20000;
} else m_uiPsychicScream_Timer -= uiDiff;
@@ -195,8 +195,8 @@ public:
//DeepSleep
if (m_uiDeepSleep_Timer <= uiDiff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SLEEP);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_SLEEP);
m_uiDeepSleep_Timer = 15000;
} else m_uiDeepSleep_Timer -= uiDiff;
@@ -322,9 +322,9 @@ public:
if (BurnTimer <= diff)
{
std::list<Unit*> pTargets;
SelectTargetList(pTargets, 10, SELECT_TARGET_RANDOM, 100, true);
for (std::list<Unit*>::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i)
std::list<Unit*> targets;
SelectTargetList(targets, 10, SELECT_TARGET_RANDOM, 100, true);
for (std::list<Unit*>::const_iterator i = targets.begin(); i != targets.end(); ++i)
if (!(*i)->HasAura(SPELL_BURN))
{
(*i)->CastSpell((*i), SPELL_BURN, true);
@@ -181,7 +181,7 @@ public:
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
void SpellHitTarget(Unit* pTarget, const SpellEntry* spell)
void SpellHitTarget(Unit* target, const SpellEntry* spell)
{
switch(spell->Id)
{
@@ -189,36 +189,36 @@ public:
case SPELL_SHADOW_NOVA:
case SPELL_CONFOUNDING_BLOW:
case SPELL_SHADOW_FURY:
HandleTouchedSpells(pTarget, SPELL_DARK_TOUCHED);
HandleTouchedSpells(target, SPELL_DARK_TOUCHED);
break;
case SPELL_CONFLAGRATION:
HandleTouchedSpells(pTarget, SPELL_FLAME_TOUCHED);
HandleTouchedSpells(target, SPELL_FLAME_TOUCHED);
break;
}
}
void HandleTouchedSpells(Unit* pTarget, uint32 TouchedType)
void HandleTouchedSpells(Unit* target, uint32 TouchedType)
{
switch(TouchedType)
{
case SPELL_FLAME_TOUCHED:
if (!pTarget->HasAura(SPELL_DARK_FLAME))
if (!target->HasAura(SPELL_DARK_FLAME))
{
if (pTarget->HasAura(SPELL_DARK_TOUCHED))
if (target->HasAura(SPELL_DARK_TOUCHED))
{
pTarget->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true);
} else pTarget->CastSpell(pTarget, SPELL_FLAME_TOUCHED, true);
target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
target->CastSpell(target, SPELL_DARK_FLAME, true);
} else target->CastSpell(target, SPELL_FLAME_TOUCHED, true);
}
break;
case SPELL_DARK_TOUCHED:
if (!pTarget->HasAura(SPELL_DARK_FLAME))
if (!target->HasAura(SPELL_DARK_FLAME))
{
if (pTarget->HasAura(SPELL_FLAME_TOUCHED))
if (target->HasAura(SPELL_FLAME_TOUCHED))
{
pTarget->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true);
} else pTarget->CastSpell(pTarget, SPELL_DARK_TOUCHED, true);
target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
target->CastSpell(target, SPELL_DARK_FLAME, true);
} else target->CastSpell(target, SPELL_DARK_TOUCHED, true);
}
break;
}
@@ -252,10 +252,10 @@ public:
if (!me->IsNonMeleeSpellCasted(false))
{
me->InterruptSpell(CURRENT_GENERIC_SPELL);
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
DoCast(pTarget, SPELL_CONFLAGRATION);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
DoCast(target, SPELL_CONFLAGRATION);
ConflagrationTimer = 30000+(rand()%5000);
}
} else ConflagrationTimer -= diff;
@@ -266,15 +266,15 @@ public:
{
if (!me->IsNonMeleeSpellCasted(false))
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
DoCast(pTarget, SPELL_SHADOW_NOVA);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
DoCast(target, SPELL_SHADOW_NOVA);
if (!SisterDeath)
{
if (pTarget)
DoScriptText(EMOTE_SHADOW_NOVA, me, pTarget);
if (target)
DoScriptText(EMOTE_SHADOW_NOVA, me, target);
DoScriptText(YELL_SHADOW_NOVA, me);
}
ShadownovaTimer = 30000+(rand()%5000);
@@ -286,26 +286,26 @@ public:
{
if (!me->IsNonMeleeSpellCasted(false))
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
DoCast(pTarget, SPELL_CONFOUNDING_BLOW);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
DoCast(target, SPELL_CONFOUNDING_BLOW);
ConfoundingblowTimer = 20000 + (rand()%5000);
}
} else ConfoundingblowTimer -=diff;
if (ShadowimageTimer <= diff)
{
Unit* pTarget = NULL;
Unit* target = NULL;
Creature* temp = NULL;
for (uint8 i = 0; i<3; ++i)
{
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
temp = DoSpawnCreature(MOB_SHADOW_IMAGE, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 10000);
if (temp && pTarget)
if (temp && target)
{
temp->AddThreat(pTarget, 1000000);//don't change target(healers)
temp->AI()->AttackStart(pTarget);
temp->AddThreat(target, 1000000);//don't change target(healers)
temp->AI()->AttackStart(target);
}
}
ShadowimageTimer = 20000;
@@ -476,48 +476,48 @@ public:
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
void SpellHitTarget(Unit* pTarget, const SpellEntry* spell)
void SpellHitTarget(Unit* target, const SpellEntry* spell)
{
switch(spell->Id)
{
case SPELL_BLAZE:
pTarget->CastSpell(pTarget, SPELL_BLAZE_SUMMON, true);
target->CastSpell(target, SPELL_BLAZE_SUMMON, true);
case SPELL_CONFLAGRATION:
case SPELL_FLAME_SEAR:
HandleTouchedSpells(pTarget, SPELL_FLAME_TOUCHED);
HandleTouchedSpells(target, SPELL_FLAME_TOUCHED);
break;
case SPELL_SHADOW_NOVA:
HandleTouchedSpells(pTarget, SPELL_DARK_TOUCHED);
HandleTouchedSpells(target, SPELL_DARK_TOUCHED);
break;
}
}
void HandleTouchedSpells(Unit* pTarget, uint32 TouchedType)
void HandleTouchedSpells(Unit* target, uint32 TouchedType)
{
switch(TouchedType)
{
case SPELL_FLAME_TOUCHED:
if (!pTarget->HasAura(SPELL_DARK_FLAME))
if (!target->HasAura(SPELL_DARK_FLAME))
{
if (pTarget->HasAura(SPELL_DARK_TOUCHED))
if (target->HasAura(SPELL_DARK_TOUCHED))
{
pTarget->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true);
target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
target->CastSpell(target, SPELL_DARK_FLAME, true);
}else
{
pTarget->CastSpell(pTarget, SPELL_FLAME_TOUCHED, true);
target->CastSpell(target, SPELL_FLAME_TOUCHED, true);
}
}
break;
case SPELL_DARK_TOUCHED:
if (!pTarget->HasAura(SPELL_DARK_FLAME))
if (!target->HasAura(SPELL_DARK_FLAME))
{
if (pTarget->HasAura(SPELL_FLAME_TOUCHED))
if (target->HasAura(SPELL_FLAME_TOUCHED))
{
pTarget->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true);
} else pTarget->CastSpell(pTarget, SPELL_DARK_TOUCHED, true);
target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
target->CastSpell(target, SPELL_DARK_FLAME, true);
} else target->CastSpell(target, SPELL_DARK_TOUCHED, true);
}
break;
}
@@ -601,10 +601,10 @@ public:
{
if (!me->IsNonMeleeSpellCasted(false))
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
DoCast(pTarget, SPELL_SHADOW_NOVA);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
DoCast(target, SPELL_SHADOW_NOVA);
ShadownovaTimer= 30000+(rand()%5000);
}
} else ShadownovaTimer -=diff;
@@ -616,16 +616,16 @@ public:
if (!me->IsNonMeleeSpellCasted(false))
{
me->InterruptSpell(CURRENT_GENERIC_SPELL);
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
DoCast(pTarget, SPELL_CONFLAGRATION);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
DoCast(target, SPELL_CONFLAGRATION);
ConflagrationTimer = 30000+(rand()%5000);
if (!SisterDeath)
{
if (pTarget)
DoScriptText(EMOTE_CONFLAGRATION, me, pTarget);
if (target)
DoScriptText(EMOTE_CONFLAGRATION, me, target);
DoScriptText(YELL_CANFLAGRATION, me);
}
@@ -701,20 +701,20 @@ public:
void EnterCombat(Unit* /*who*/){}
void SpellHitTarget(Unit* pTarget, const SpellEntry* spell)
void SpellHitTarget(Unit* target, const SpellEntry* spell)
{
switch(spell->Id)
{
case SPELL_SHADOW_FURY:
case SPELL_DARK_STRIKE:
if (!pTarget->HasAura(SPELL_DARK_FLAME))
if (!target->HasAura(SPELL_DARK_FLAME))
{
if (pTarget->HasAura(SPELL_FLAME_TOUCHED))
if (target->HasAura(SPELL_FLAME_TOUCHED))
{
pTarget->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true);
} else pTarget->CastSpell(pTarget, SPELL_DARK_TOUCHED, true);
target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
target->CastSpell(target, SPELL_DARK_FLAME, true);
} else target->CastSpell(target, SPELL_DARK_TOUCHED, true);
}
break;
}
@@ -293,20 +293,20 @@ public:
break;
case 2:
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
if (!pTarget)
pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
if (!target)
target = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
if (!pTarget)
if (!target)
{
EnterEvadeMode();
return;
}
Creature* Vapor = me->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
Creature* Vapor = me->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
if (Vapor)
{
Vapor->AI()->AttackStart(pTarget);
Vapor->AI()->AttackStart(target);
me->InterruptNonMeleeSpells(false);
DoCast(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug
Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true);
@@ -320,22 +320,22 @@ public:
DespawnSummons(MOB_VAPOR_TRAIL);
//DoCast(me, SPELL_VAPOR_SELECT); need core support
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
if (!pTarget)
pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
if (!target)
target = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
if (!pTarget)
if (!target)
{
EnterEvadeMode();
return;
}
//pTarget->CastSpell(pTarget, SPELL_VAPOR_SUMMON, true); need core support
Creature* pVapor = me->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
//pTarget->CastSpell(target, SPELL_VAPOR_SUMMON, true); need core support
Creature* pVapor = me->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000);
if (pVapor)
{
if (pVapor->AI())
pVapor->AI()->AttackStart(pTarget);
pVapor->AI()->AttackStart(target);
me->InterruptNonMeleeSpells(false);
DoCast(pVapor, SPELL_VAPOR_CHANNEL, false); // core bug
pVapor->CastSpell(pVapor, SPELL_VAPOR_TRIGGER, true);
@@ -350,20 +350,20 @@ public:
break;
case 5:
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
if (!pTarget)
pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
if (!target)
target = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
if (!pTarget)
if (!target)
{
EnterEvadeMode();
return;
}
breathX = pTarget->GetPositionX();
breathY = pTarget->GetPositionY();
breathX = target->GetPositionX();
breathY = target->GetPositionY();
float x, y, z;
pTarget->GetContactPoint(me, x, y, z, 70);
target->GetContactPoint(me, x, y, z, 70);
me->GetMotionMaster()->MovePoint(0, x, y, z+10);
break;
}
@@ -393,8 +393,8 @@ public:
uiFlightCount = 4;
break;
case 9:
if (Unit* pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO))
DoStartMovement(pTarget);
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO))
DoStartMovement(target);
else
{
EnterEvadeMode();
@@ -447,8 +447,8 @@ public:
events.ScheduleEvent(EVENT_GAS_NOVA, urand(20000, 25000));
break;
case EVENT_ENCAPSULATE:
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true))
DoCast(pTarget, SPELL_ENCAPSULATE_CHANNEL, false);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true))
DoCast(target, SPELL_ENCAPSULATE_CHANNEL, false);
events.ScheduleEvent(EVENT_ENCAPSULATE, urand(25000, 30000));
break;
case EVENT_FLIGHT:
@@ -548,8 +548,8 @@ public:
void UpdateAI(const uint32 /*diff*/)
{
if (!me->getVictim())
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
AttackStart(pTarget);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
AttackStart(target);
}
};
@@ -645,9 +645,9 @@ public:
damage = 0;
}
void KilledUnit(Unit* pTarget)
void KilledUnit(Unit* target)
{
if (pTarget->GetGUID() == KalecGUID)
if (target->GetGUID() == KalecGUID)
{
TeleportAllPlayersBack();
if (Creature* Kalecgos = Unit::GetCreature(*me, KalecgosGUID))
@@ -783,9 +783,9 @@ public:
if (AgonyCurseTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!pTarget) pTarget = me->getVictim();
DoCast(pTarget, SPELL_AGONY_CURSE);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!target) target = me->getVictim();
DoCast(target, SPELL_AGONY_CURSE);
AgonyCurseTimer = 20000;
} else AgonyCurseTimer -= diff;
@@ -661,19 +661,19 @@ public:
for (uint8 i = 0; i < 4; ++i)
{
float x, y, z;
Unit* pTarget = NULL;
Unit* target = NULL;
for (uint8 z = 0; z < 6; ++z)
{
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (!pTarget || !pTarget->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, 0))break;
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (!target || !target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, 0))break;
}
if (pTarget)
if (target)
{
pTarget->GetPosition(x, y, z);
target->GetPosition(x, y, z);
if (Creature* pSinisterReflection = me->SummonCreature(CREATURE_SINISTER_REFLECTION, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0))
{
pSinisterReflection->SetDisplayId(pTarget->GetDisplayId());
pSinisterReflection->AI()->AttackStart(pTarget);
pSinisterReflection->SetDisplayId(target->GetDisplayId());
pSinisterReflection->AI()->AttackStart(target);
}
}
}
@@ -842,16 +842,16 @@ public:
TimerIsDeactivated[TIMER_ORBS_EMPOWER] = true;
break;
case TIMER_ARMAGEDDON: //Phase 4
Unit* pTarget = NULL;
Unit* target = NULL;
for (uint8 z = 0; z < 6; ++z)
{
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (!pTarget || !pTarget->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, 0)) break;
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (!target || !target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, 0)) break;
}
if (pTarget)
if (target)
{
float x, y, z;
pTarget->GetPosition(x, y, z);
target->GetPosition(x, y, z);
me->SummonCreature(CREATURE_ARMAGEDDON_TARGET, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 15000);
}
Timer[TIMER_ARMAGEDDON] = 2000; // No, I'm not kidding
@@ -72,13 +72,13 @@ class boss_ironaya : public CreatureScript
DoCast(me->getVictim(), SPELL_KNOCKAWAY, true);
// current aggro target is knocked away pick new target
Unit* pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0);
Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0);
if (!pTarget || pTarget == me->getVictim())
pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
if (!target || target == me->getVictim())
target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
if (pTarget)
me->TauntApply(pTarget);
if (target)
me->TauntApply(target);
//Shouldn't cast this agian
bHasCastedKnockaway = true;
@@ -175,12 +175,12 @@ class instance_uldaman : public InstanceMapScript
{
for (std::vector<uint64>::const_iterator i = vStoneKeeper.begin(); i != vStoneKeeper.end(); ++i)
{
Creature* pTarget = instance->GetCreature(*i);
if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14)
Creature* target = instance->GetCreature(*i);
if (!target || !target->isAlive() || target->getFaction() == 14)
continue;
pTarget->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
pTarget->setFaction(14);
pTarget->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
target->setFaction(14);
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
return; // only want the first one we find
}
// if we get this far than all four are dead so open the door
@@ -196,11 +196,11 @@ class instance_uldaman : public InstanceMapScript
for (std::vector<uint64>::const_iterator i = vArchaedasWallMinions.begin(); i != vArchaedasWallMinions.end(); ++i)
{
Creature* pTarget = instance->GetCreature(*i);
if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14)
Creature* target = instance->GetCreature(*i);
if (!target || !target->isAlive() || target->getFaction() == 14)
continue;
archaedas->CastSpell(pTarget, SPELL_AWAKEN_VAULT_WALKER, true);
pTarget->CastSpell(pTarget, SPELL_ARCHAEDAS_AWAKEN, true);
archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true);
target->CastSpell(target, SPELL_ARCHAEDAS_AWAKEN, true);
return; // only want the first one we find
}
}
@@ -211,31 +211,31 @@ class instance_uldaman : public InstanceMapScript
// first despawn any aggroed wall minions
for (std::vector<uint64>::const_iterator i = vArchaedasWallMinions.begin(); i != vArchaedasWallMinions.end(); ++i)
{
Creature* pTarget = instance->GetCreature(*i);
if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14)
Creature* target = instance->GetCreature(*i);
if (!target || target->isDead() || target->getFaction() != 14)
continue;
pTarget->setDeathState(JUST_DIED);
pTarget->RemoveCorpse();
target->setDeathState(JUST_DIED);
target->RemoveCorpse();
}
// Vault Walkers
for (std::vector<uint64>::const_iterator i = vVaultWalker.begin(); i != vVaultWalker.end(); ++i)
{
Creature* pTarget = instance->GetCreature(*i);
if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14)
Creature* target = instance->GetCreature(*i);
if (!target || target->isDead() || target->getFaction() != 14)
continue;
pTarget->setDeathState(JUST_DIED);
pTarget->RemoveCorpse();
target->setDeathState(JUST_DIED);
target->RemoveCorpse();
}
// Earthen Guardians
for (std::vector<uint64>::const_iterator i = vEarthenGuardian.begin(); i != vEarthenGuardian.end(); ++i)
{
Creature* pTarget = instance->GetCreature(*i);
if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14)
Creature* target = instance->GetCreature(*i);
if (!target || target->isDead() || target->getFaction() != 14)
continue;
pTarget->setDeathState(JUST_DIED);
pTarget->RemoveCorpse();
target->setDeathState(JUST_DIED);
target->RemoveCorpse();
}
}
@@ -268,36 +268,36 @@ class instance_uldaman : public InstanceMapScript
// first respawn any aggroed wall minions
for (std::vector<uint64>::const_iterator i = vArchaedasWallMinions.begin(); i != vArchaedasWallMinions.end(); ++i)
{
Creature* pTarget = instance->GetCreature(*i);
if (pTarget && pTarget->isDead())
Creature* target = instance->GetCreature(*i);
if (target && target->isDead())
{
pTarget->Respawn();
pTarget->GetMotionMaster()->MoveTargetedHome();
SetFrozenState(pTarget);
target->Respawn();
target->GetMotionMaster()->MoveTargetedHome();
SetFrozenState(target);
}
}
// Vault Walkers
for (std::vector<uint64>::const_iterator i = vVaultWalker.begin(); i != vVaultWalker.end(); ++i)
{
Creature* pTarget = instance->GetCreature(*i);
if (pTarget && pTarget->isDead())
Creature* target = instance->GetCreature(*i);
if (target && target->isDead())
{
pTarget->Respawn();
pTarget->GetMotionMaster()->MoveTargetedHome();
SetFrozenState(pTarget);
target->Respawn();
target->GetMotionMaster()->MoveTargetedHome();
SetFrozenState(target);
}
}
// Earthen Guardians
for (std::vector<uint64>::const_iterator i = vEarthenGuardian.begin(); i != vEarthenGuardian.end(); ++i)
{
Creature* pTarget = instance->GetCreature(*i);
if (pTarget && pTarget->isDead())
Creature* target = instance->GetCreature(*i);
if (target && target->isDead())
{
pTarget->Respawn();
pTarget->GetMotionMaster()->MoveTargetedHome();
SetFrozenState(pTarget);
target->Respawn();
target->GetMotionMaster()->MoveTargetedHome();
SetFrozenState(target);
}
}
}
@@ -81,13 +81,13 @@ class mob_jadespine_basilisk : public CreatureScript
//Stop attacking target thast asleep and pick new target
uiCslumberTimer = 28000;
Unit* pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0);
Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0);
if (!pTarget || pTarget == me->getVictim())
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (!target || target == me->getVictim())
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pTarget)
me->TauntApply(pTarget);
if (target)
me->TauntApply(target);
} else uiCslumberTimer -= uiDiff;
@@ -258,17 +258,17 @@ class boss_akilzon : public CreatureScript
if (StormCount)
{
Unit* pTarget = Unit::GetUnit(*me, CloudGUID);
if (!pTarget || !pTarget->isAlive())
Unit* target = Unit::GetUnit(*me, CloudGUID);
if (!target || !target->isAlive())
{
EnterEvadeMode();
return;
}
else if (Unit* Cyclone = Unit::GetUnit(*me, CycloneGUID))
Cyclone->CastSpell(pTarget, 25160, true); // keep casting or...
Cyclone->CastSpell(target, 25160, true); // keep casting or...
if (StormSequenceTimer <= diff)
HandleStormSequence(pTarget);
HandleStormSequence(target);
else
StormSequenceTimer -= diff;
@@ -285,22 +285,22 @@ class boss_akilzon : public CreatureScript
if (StaticDisruption_Timer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1);
if (!pTarget) pTarget = me->getVictim();
TargetGUID = pTarget->GetGUID();
DoCast(pTarget, SPELL_STATIC_DISRUPTION, false);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
if (!target) target = me->getVictim();
TargetGUID = target->GetGUID();
DoCast(target, SPELL_STATIC_DISRUPTION, false);
me->SetInFront(me->getVictim());
StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s
/*if (float dist = me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f) dist = 5.0f;
/*if (float dist = me->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f) dist = 5.0f;
SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/
} else StaticDisruption_Timer -= diff;
if (GustOfWind_Timer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1);
if (!pTarget) pTarget = me->getVictim();
DoCast(pTarget, SPELL_GUST_OF_WIND);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
if (!target) target = me->getVictim();
DoCast(target, SPELL_GUST_OF_WIND);
GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers)
} else GustOfWind_Timer -= diff;
@@ -317,20 +317,20 @@ class boss_akilzon : public CreatureScript
}
if (ElectricalStorm_Timer <= diff) {
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true);
if (!pTarget)
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true);
if (!target)
{
EnterEvadeMode();
return;
}
pTarget->CastSpell(pTarget, 44007, true);//cloud visual
DoCast(pTarget, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual
target->CastSpell(target, 44007, true);//cloud visual
DoCast(target, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual
float x, y, z;
pTarget->GetPosition(x, y, z);
if (pTarget)
target->GetPosition(x, y, z);
if (target)
{
pTarget->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
pTarget->SendMonsterMove(x, y, me->GetPositionZ()+15, 0);
target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
target->SendMonsterMove(x, y, me->GetPositionZ()+15, 0);
}
Unit* Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000);
if (Cloud)
@@ -362,11 +362,11 @@ class boss_akilzon : public CreatureScript
Unit* bird = Unit::GetUnit(*me, BirdGUIDs[i]);
if (!bird) //they despawned on die
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
x = pTarget->GetPositionX() + irand(-10, 10);
y = pTarget->GetPositionY() + irand(-10, 10);
z = pTarget->GetPositionZ() + urand(16, 20);
x = target->GetPositionX() + irand(-10, 10);
y = target->GetPositionY() + irand(-10, 10);
z = target->GetPositionZ() + urand(16, 20);
if (z > 95)
z = 95.0f - urand(0, 5);
}
@@ -426,8 +426,8 @@ class mob_akilzon_eagle : public CreatureScript
arrived = true;
if (TargetGUID)
{
if (Unit* pTarget = Unit::GetUnit(*me, TargetGUID))
DoCast(pTarget, SPELL_EAGLE_SWOOP, true);
if (Unit* target = Unit::GetUnit(*me, TargetGUID))
DoCast(target, SPELL_EAGLE_SWOOP, true);
TargetGUID = 0;
me->SetSpeed(MOVE_RUN, 1.2f);
EagleSwoop_Timer = 5000 + rand()%5000;
@@ -443,23 +443,23 @@ class mob_akilzon_eagle : public CreatureScript
if (arrived)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
float x, y, z;
if (EagleSwoop_Timer)
{
x = pTarget->GetPositionX() + irand(-10, 10);
y = pTarget->GetPositionY() + irand(-10, 10);
z = pTarget->GetPositionZ() + urand(10, 15);
x = target->GetPositionX() + irand(-10, 10);
y = target->GetPositionY() + irand(-10, 10);
z = target->GetPositionZ() + urand(10, 15);
if (z > 95)
z = 95.0f - urand(0, 5);
}
else
{
pTarget->GetContactPoint(me, x, y, z);
target->GetContactPoint(me, x, y, z);
z += 2;
me->SetSpeed(MOVE_RUN, 5.0f);
TargetGUID = pTarget->GetGUID();
TargetGUID = target->GetGUID();
}
me->GetMotionMaster()->MovePoint(0, x, y, z);
arrived = false;
@@ -262,12 +262,12 @@ class boss_halazzi : public CreatureScript
if (ShockTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
if (pTarget->IsNonMeleeSpellCasted(false))
DoCast(pTarget, SPELL_EARTHSHOCK);
if (target->IsNonMeleeSpellCasted(false))
DoCast(target, SPELL_EARTHSHOCK);
else
DoCast(pTarget, SPELL_FLAMESHOCK);
DoCast(target, SPELL_FLAMESHOCK);
ShockTimer = 10000 + rand()%5000;
}
} else ShockTimer -= diff;
@@ -391,9 +391,9 @@ class boss_hexlord_malacrass : public CreatureScript
if (SiphonSoul_Timer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 70, true);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 70, true);
Unit* trigger = DoSpawnCreature(MOB_TEMP_TRIGGER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
if (!pTarget || !trigger)
if (!target || !trigger)
{
EnterEvadeMode();
return;
@@ -402,20 +402,20 @@ class boss_hexlord_malacrass : public CreatureScript
{
trigger->SetDisplayId(11686);
trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
trigger->CastSpell(pTarget, SPELL_SIPHON_SOUL, true);
trigger->CastSpell(target, SPELL_SIPHON_SOUL, true);
trigger->GetMotionMaster()->MoveChase(me);
//DoCast(pTarget, SPELL_SIPHON_SOUL, true);
//me->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pTarget->GetGUID());
//DoCast(target, SPELL_SIPHON_SOUL, true);
//me->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, target->GetGUID());
//me->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL);
PlayerGUID = pTarget->GetGUID();
PlayerGUID = target->GetGUID();
PlayerAbility_Timer = urand(8000, 10000);
PlayerClass = pTarget->getClass() - 1;
PlayerClass = target->getClass() - 1;
if (PlayerClass == CLASS_DRUID-1)
PlayerClass = CLASS_DRUID;
else if (PlayerClass == CLASS_PRIEST-1 && pTarget->HasSpell(15473))
else if (PlayerClass == CLASS_PRIEST-1 && target->HasSpell(15473))
PlayerClass = CLASS_PRIEST; // shadow priest
SiphonSoul_Timer = 99999; // buff lasts 30 sec
@@ -424,8 +424,8 @@ class boss_hexlord_malacrass : public CreatureScript
if (PlayerAbility_Timer <= diff)
{
//Unit* pTarget = Unit::GetUnit(*me, PlayerGUID);
//if (pTarget && pTarget->isAlive())
//Unit* target = Unit::GetUnit(*me, PlayerGUID);
//if (target && target->isAlive())
//{
UseAbility();
PlayerAbility_Timer = urand(8000, 10000);
@@ -438,32 +438,32 @@ class boss_hexlord_malacrass : public CreatureScript
void UseAbility()
{
uint8 random = urand(0, 2);
Unit* pTarget = NULL;
Unit* target = NULL;
switch(PlayerAbility[PlayerClass][random].target)
{
case ABILITY_TARGET_SELF:
pTarget = me;
target = me;
break;
case ABILITY_TARGET_VICTIM:
pTarget = me->getVictim();
target = me->getVictim();
break;
case ABILITY_TARGET_ENEMY:
default:
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
break;
case ABILITY_TARGET_HEAL:
pTarget = DoSelectLowestHpFriendly(50, 0);
target = DoSelectLowestHpFriendly(50, 0);
break;
case ABILITY_TARGET_BUFF:
{
std::list<Creature*> templist = DoFindFriendlyMissingBuff(50, PlayerAbility[PlayerClass][random].spell);
if (!templist.empty())
pTarget = *(templist.begin());
target = *(templist.begin());
}
break;
}
if (pTarget)
DoCast(pTarget, PlayerAbility[PlayerClass][random].spell, false);
if (target)
DoCast(target, PlayerAbility[PlayerClass][random].spell, false);
}
};
@@ -511,8 +511,8 @@ class boss_thurg : public CreatureScript
std::list<Creature*> templist = DoFindFriendlyMissingBuff(50, SPELL_BLOODLUST);
if (!templist.empty())
{
if (Unit* pTarget = *(templist.begin()))
DoCast(pTarget, SPELL_BLOODLUST, false);
if (Unit* target = *(templist.begin()))
DoCast(target, SPELL_BLOODLUST, false);
}
bloodlust_timer = 12000;
} else bloodlust_timer -= diff;
@@ -585,26 +585,26 @@ class boss_alyson_antille : public CreatureScript
if (flashheal_timer <= diff)
{
Unit* pTarget = DoSelectLowestHpFriendly(99, 30000);
if (pTarget)
Unit* target = DoSelectLowestHpFriendly(99, 30000);
if (target)
{
if (pTarget->IsWithinDistInMap(me, 50))
DoCast(pTarget, SPELL_FLASH_HEAL, false);
if (target->IsWithinDistInMap(me, 50))
DoCast(target, SPELL_FLASH_HEAL, false);
else
{
// bugged
//me->GetMotionMaster()->Clear();
//me->GetMotionMaster()->MoveChase(pTarget, 20);
//me->GetMotionMaster()->MoveChase(target, 20);
}
}
else
{
if (urand(0, 1))
pTarget = DoSelectLowestHpFriendly(50, 0);
target = DoSelectLowestHpFriendly(50, 0);
else
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
DoCast(pTarget, SPELL_DISPEL_MAGIC, false);
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
DoCast(target, SPELL_DISPEL_MAGIC, false);
}
flashheal_timer = 2500;
} else flashheal_timer -= diff;
@@ -613,9 +613,9 @@ class boss_alyson_antille : public CreatureScript
{
if (urand(0, 1))
{
Unit* pTarget = SelectTarget();
Unit* target = SelectTarget();
DoCast(pTarget, SPELL_DISPEL_MAGIC, false);
DoCast(target, SPELL_DISPEL_MAGIC, false);
}
else
me->CastSpell(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPEL_MAGIC, false);
@@ -181,11 +181,11 @@ class boss_janalai : public CreatureScript
// DoZoneInCombat();
}
void DamageDealt(Unit* pTarget, uint32 &damage, DamageEffectType /*damagetype*/)
void DamageDealt(Unit* target, uint32 &damage, DamageEffectType /*damagetype*/)
{
if (isFlameBreathing)
{
if (!me->HasInArc(M_PI/6, pTarget))
if (!me->HasInArc(M_PI/6, target))
damage = 0;
}
}
@@ -420,11 +420,11 @@ class boss_janalai : public CreatureScript
if (FireBreathTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
me->AttackStop();
me->GetMotionMaster()->Clear();
DoCast(pTarget, SPELL_FLAME_BREATH, false);
DoCast(target, SPELL_FLAME_BREATH, false);
me->StopMoving();
isFlameBreathing = true;
}
@@ -155,7 +155,7 @@ class boss_nalorakk : public CreatureScript
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); // TODO: find the correct equipment id
}
void SendAttacker(Unit* pTarget)
void SendAttacker(Unit* target)
{
std::list<Creature*> templist;
float x, y, z;
@@ -183,7 +183,7 @@ class boss_nalorakk : public CreatureScript
if ((*i) && me->IsWithinDistInMap((*i), 25))
{
(*i)->SetNoCallAssistance(true);
(*i)->AI()->AttackStart(pTarget);
(*i)->AI()->AttackStart(target);
}
}
}
@@ -414,9 +414,9 @@ class boss_nalorakk : public CreatureScript
{
me->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_YELL_SURGE);
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true);
if (pTarget)
DoCast(pTarget, SPELL_SURGE);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true);
if (target)
DoCast(target, SPELL_SURGE);
Surge_Timer = 15000 + rand()%5000;
} else Surge_Timer -= diff;
}
@@ -435,8 +435,8 @@ class boss_zuljin : public CreatureScript
if (Grievous_Throw_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_GRIEVOUS_THROW, false);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_GRIEVOUS_THROW, false);
Grievous_Throw_Timer = 10000;
} else Grievous_Throw_Timer -= diff;
break;
@@ -463,11 +463,11 @@ class boss_zuljin : public CreatureScript
{
if (!TankGUID)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
TankGUID = me->getVictim()->GetGUID();
me->SetSpeed(MOVE_RUN, 5.0f);
AttackStart(pTarget); // change victim
AttackStart(target); // change victim
Claw_Rage_Timer = 0;
Claw_Loop_Timer = 500;
Claw_Counter = 0;
@@ -477,15 +477,15 @@ class boss_zuljin : public CreatureScript
{
if (Claw_Loop_Timer <= diff)
{
Unit* pTarget = me->getVictim();
if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = Unit::GetUnit(*me, TankGUID);
if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
Unit* target = me->getVictim();
if (!target || !target->isTargetableForAttack()) target = Unit::GetUnit(*me, TankGUID);
if (!target || !target->isTargetableForAttack()) target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
{
AttackStart(pTarget);
if (me->IsWithinMeleeRange(pTarget))
AttackStart(target);
if (me->IsWithinMeleeRange(target))
{
DoCast(pTarget, SPELL_CLAW_RAGE_DAMAGE, true);
DoCast(target, SPELL_CLAW_RAGE_DAMAGE, true);
++Claw_Counter;
if (Claw_Counter == 12)
{
@@ -501,7 +501,7 @@ class boss_zuljin : public CreatureScript
}
else
{
EnterEvadeMode(); // if (pTarget)
EnterEvadeMode(); // if (target)
return;
}
} else Claw_Loop_Timer -= diff;
@@ -512,28 +512,28 @@ class boss_zuljin : public CreatureScript
{
if (!TankGUID)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
TankGUID = me->getVictim()->GetGUID();
me->SetSpeed(MOVE_RUN, 5.0f);
AttackStart(pTarget); // change victim
AttackStart(target); // change victim
Lynx_Rush_Timer = 0;
Claw_Counter = 0;
}
}
else if (!Lynx_Rush_Timer)
{
Unit* pTarget = me->getVictim();
if (!pTarget || !pTarget->isTargetableForAttack())
Unit* target = me->getVictim();
if (!target || !target->isTargetableForAttack())
{
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
AttackStart(pTarget);
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
AttackStart(target);
}
if (pTarget)
if (target)
{
if (me->IsWithinMeleeRange(pTarget))
if (me->IsWithinMeleeRange(target))
{
DoCast(pTarget, SPELL_LYNX_RUSH_DAMAGE, true);
DoCast(target, SPELL_LYNX_RUSH_DAMAGE, true);
++Claw_Counter;
if (Claw_Counter == 9)
{
@@ -548,7 +548,7 @@ class boss_zuljin : public CreatureScript
}
else
{
EnterEvadeMode(); // if (pTarget)
EnterEvadeMode(); // if (target)
return;
}
} //if (TankGUID)
@@ -564,15 +564,15 @@ class boss_zuljin : public CreatureScript
if (Pillar_Of_Fire_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SUMMON_PILLAR);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_SUMMON_PILLAR);
Pillar_Of_Fire_Timer = 10000;
} else Pillar_Of_Fire_Timer -= diff;
if (Flame_Breath_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
me->SetInFront(pTarget);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
me->SetInFront(target);
DoCast(me, SPELL_FLAME_BREATH);
Flame_Breath_Timer = 10000;
} else Flame_Breath_Timer -= diff;
@@ -242,8 +242,8 @@ class boss_arlokk : public CreatureScript
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
me->UpdateDamagePhysical(BASE_ATTACK);
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
AttackStart(pTarget);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
AttackStart(target);
m_bIsPhaseTwo = true;
m_bIsVanished = false;
@@ -66,14 +66,14 @@ class boss_grilek : public CreatureScript
{
DoCast(me, SPELL_AVARTAR);
Unit* pTarget = NULL;
Unit* target = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1);
target = SelectTarget(SELECT_TARGET_RANDOM, 1);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(), -50);
if (pTarget)
AttackStart(pTarget);
if (target)
AttackStart(target);
Avartar_Timer = 25000 + rand()%10000;
} else Avartar_Timer -= diff;
@@ -132,8 +132,8 @@ class boss_hakkar : public CreatureScript
//CauseInsanity_Timer
/*if (CauseInsanity_Timer <= diff)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_CAUSEINSANITY);
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_CAUSEINSANITY);
CauseInsanity_Timer = 35000 + rand()%8000;
} else CauseInsanity_Timer -= diff;*/
@@ -141,8 +141,8 @@ class boss_hakkar : public CreatureScript
//WillOfHakkar_Timer
if (WillOfHakkar_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_WILLOFHAKKAR);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_WILLOFHAKKAR);
WillOfHakkar_Timer = 25000 + rand()%10000;
} else WillOfHakkar_Timer -= diff;
@@ -81,16 +81,16 @@ class boss_hazzarah : public CreatureScript
{
//We will summon 3 illusions that will spawn on a random gamer and attack this gamer
//We will just use one model for the beginning
Unit* pTarget = NULL;
Unit* target = NULL;
for (uint8 i = 0; i < 3; ++i)
{
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!pTarget)
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!target)
return;
Creature* Illusion = me->SummonCreature(15163, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
Creature* Illusion = me->SummonCreature(15163, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
if (Illusion)
Illusion->AI()->AttackStart(pTarget);
Illusion->AI()->AttackStart(target);
}
Illusions_Timer = 15000 + rand()%10000;
@@ -113,10 +113,10 @@ class boss_jeklik : public CreatureScript
{
if (Charge_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
DoCast(pTarget, SPELL_CHARGE);
AttackStart(pTarget);
DoCast(target, SPELL_CHARGE);
AttackStart(target);
}
Charge_Timer = 15000 + rand()%15000;
@@ -136,25 +136,25 @@ class boss_jeklik : public CreatureScript
if (SpawnBats_Timer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
Creature* Bat = NULL;
Bat = me->SummonCreature(11368, -12291.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
if (target && Bat) Bat ->AI()->AttackStart(target);
Bat = me->SummonCreature(11368, -12289.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
if (target && Bat) Bat ->AI()->AttackStart(target);
Bat = me->SummonCreature(11368, -12293.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
if (target && Bat) Bat ->AI()->AttackStart(target);
Bat = me->SummonCreature(11368, -12291.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
if (target && Bat) Bat ->AI()->AttackStart(target);
Bat = me->SummonCreature(11368, -12289.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
if (target && Bat) Bat ->AI()->AttackStart(target);
Bat = me->SummonCreature(11368, -12293.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget);
if (target && Bat) Bat ->AI()->AttackStart(target);
SpawnBats_Timer = 60000;
} else SpawnBats_Timer -= diff;
@@ -165,9 +165,9 @@ class boss_jeklik : public CreatureScript
{
if (PhaseTwo && ShadowWordPain_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
DoCast(pTarget, SPELL_SHADOW_WORD_PAIN);
DoCast(target, SPELL_SHADOW_WORD_PAIN);
ShadowWordPain_Timer = 12000 + rand()%6000;
}
}ShadowWordPain_Timer -=diff;
@@ -194,13 +194,13 @@ class boss_jeklik : public CreatureScript
if (SpawnFlyingBats_Timer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!pTarget)
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!target)
return;
Creature* FlyingBat = me->SummonCreature(14965, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Creature* FlyingBat = me->SummonCreature(14965, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (FlyingBat)
FlyingBat->AI()->AttackStart(pTarget);
FlyingBat->AI()->AttackStart(target);
SpawnFlyingBats_Timer = 10000 + rand()%5000;
} else SpawnFlyingBats_Timer -=diff;
@@ -264,9 +264,9 @@ class mob_batrider : public CreatureScript
//Bomb_Timer
if (Bomb_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
DoCast(pTarget, SPELL_BOMB);
DoCast(target, SPELL_BOMB);
Bomb_Timer = 5000;
}
} else Bomb_Timer -= diff;
@@ -108,13 +108,13 @@ class boss_jindo : public CreatureScript
//Casting the delusion curse with a shade. So shade will attack the same target with the curse.
if (Delusions_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
DoCast(pTarget, SPELL_DELUSIONSOFJINDO);
DoCast(target, SPELL_DELUSIONSOFJINDO);
Creature* Shade = me->SummonCreature(14986, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Creature* Shade = me->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Shade)
Shade->AI()->AttackStart(pTarget);
Shade->AI()->AttackStart(target);
}
Delusions_Timer = 4000 + rand()%8000;
@@ -123,43 +123,43 @@ class boss_jindo : public CreatureScript
//Teleporting a random gamer and spawning 9 skeletons that will attack this gamer
if (Teleport_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target && target->GetTypeId() == TYPEID_PLAYER)
{
DoTeleportPlayer(pTarget, -11583.7783f, -1249.4278f, 77.5471f, 4.745f);
DoTeleportPlayer(target, -11583.7783f, -1249.4278f, 77.5471f, 4.745f);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(pTarget, -100);
DoModifyThreatPercent(target, -100);
Creature* Skeletons;
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons = me->SummonCreature(14826, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
Skeletons = me->SummonCreature(14826, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
Skeletons = me->SummonCreature(14826, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
Skeletons = me->SummonCreature(14826, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+3, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Skeletons->AI()->AttackStart(target);
Skeletons = me->SummonCreature(14826, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Skeletons)
Skeletons->AI()->AttackStart(pTarget);
Skeletons->AI()->AttackStart(target);
}
Teleport_Timer = 15000 + rand()%8000;
@@ -118,37 +118,37 @@ class boss_marli : public CreatureScript
{
DoScriptText(SAY_SPIDER_SPAWN, me);
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!pTarget)
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!target)
return;
Creature* Spider = NULL;
Spider = me->SummonCreature(15041, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
Spider = me->SummonCreature(15041, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Spider->AI()->AttackStart(target);
Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
Spider = me->SummonCreature(15041, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Spider->AI()->AttackStart(target);
Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
Spider = me->SummonCreature(15041, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Spider->AI()->AttackStart(target);
Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
Spider->AI()->AttackStart(target);
Spawned = true;
} else SpawnStartSpiders_Timer -= diff;
if (SpawnSpider_Timer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!pTarget)
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!target)
return;
Creature* Spider = me->SummonCreature(15041, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Creature* Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Spider)
Spider->AI()->AttackStart(pTarget);
Spider->AI()->AttackStart(target);
SpawnSpider_Timer = 12000 + rand()%5000;
} else SpawnSpider_Timer -= diff;
@@ -173,21 +173,21 @@ class boss_marli : public CreatureScript
{
if (Charge_Timer <= diff)
{
Unit* pTarget = NULL;
Unit* target = NULL;
int i = 0;
while (i < 3) // max 3 tries to get a random target with power_mana
{
++i;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); // not aggro leader
if (pTarget && pTarget->getPowerType() == POWER_MANA)
target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); // not aggro leader
if (target && target->getPowerType() == POWER_MANA)
i = 3;
}
if (pTarget)
if (target)
{
DoCast(pTarget, SPELL_CHARGE);
//me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
//me->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true, 1);
AttackStart(pTarget);
DoCast(target, SPELL_CHARGE);
//me->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
//me->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true, 1);
AttackStart(target);
}
Charge_Timer = 8000;
@@ -92,12 +92,12 @@ class boss_renataki : public CreatureScript
{
if (Ambush_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
{
DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ());
DoCast(pTarget, SPELL_AMBUSH);
DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
DoCast(target, SPELL_AMBUSH);
}
Ambushed = true;
@@ -126,14 +126,14 @@ class boss_renataki : public CreatureScript
{
if (Aggro_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 1);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(), -50);
if (pTarget)
AttackStart(pTarget);
if (target)
AttackStart(target);
Aggro_Timer = 7000 + rand()%13000;
} else Aggro_Timer -= diff;
@@ -219,11 +219,11 @@ class boss_thekal : public CreatureScript
{
if (Charge_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
DoCast(pTarget, SPELL_CHARGE);
DoCast(target, SPELL_CHARGE);
DoResetThreat();
AttackStart(pTarget);
AttackStart(target);
}
Charge_Timer = 15000 + rand()%7000;
@@ -70,9 +70,9 @@ class boss_wushoolay : public CreatureScript
//LightningWave_Timer
if (LightningWave_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget) DoCast(pTarget, SPELL_LIGHTNINGWAVE);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target) DoCast(target, SPELL_LIGHTNINGWAVE);
LightningWave_Timer = 12000 + rand()%4000;
} else LightningWave_Timer -= diff;
@@ -259,10 +259,10 @@ public:
me->setFaction(FACTION_HOSTILE);
questPhase = 0;
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
me->AddThreat(pTarget, 5000000.0f);
AttackStart(pTarget);
me->AddThreat(target, 5000000.0f);
AttackStart(target);
}
}
else
@@ -290,20 +290,20 @@ public:
if (Creature* pSummoned = me->SummonCreature(creatureId, PyrewoodSpawnPoints[position][0], PyrewoodSpawnPoints[position][1], PyrewoodSpawnPoints[position][2], PyrewoodSpawnPoints[position][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000))
{
Player* player = NULL;
Unit* pTarget = NULL;
Unit* target = NULL;
if (PlayerGUID)
{
player = Unit::GetPlayer(*me, PlayerGUID);
if (player)
pTarget = RAND((Unit*)me, (Unit*)player);
target = RAND((Unit*)me, (Unit*)player);
} else
pTarget = me;
target = me;
if (pTarget)
if (target)
{
pSummoned->setFaction(168);
pSummoned->AddThreat(pTarget, 32.0f);
pSummoned->AI()->AttackStart(pTarget);
pSummoned->AddThreat(target, 32.0f);
pSummoned->AI()->AttackStart(target);
}
}
}
@@ -107,11 +107,11 @@ public:
{
if (summoned->GetEntry() == ENTRY_HIGHBORNE_BUNNY)
{
if (Unit* pTarget = Unit::GetUnit(*summoned, targetGUID))
if (Unit* target = Unit::GetUnit(*summoned, targetGUID))
{
pTarget->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), me->GetPositionZ()+15.0f, 0);
pTarget->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), me->GetPositionZ()+15.0f, 0.0f);
summoned->CastSpell(pTarget, SPELL_RIBBON_OF_SOULS, false);
target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0);
target->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0.0f);
summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false);
}
summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
@@ -161,10 +161,10 @@ public:
{
if (uiFrostBoltVolleyTimer <= uiDiff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
if (pTarget)
DoCast(pTarget, SPELL_FROST_BOLT_VOLLEY);
if (target)
DoCast(target, SPELL_FROST_BOLT_VOLLEY);
}
uiFrostBoltVolleyTimer = urand(5000, 8000);
} else uiFrostBoltVolleyTimer -= uiDiff;
@@ -89,10 +89,10 @@ public:
if (uiSleepTimer < diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoScriptText(SAY_SLEEP, me);
DoCast(pTarget, SPELL_SLEEP);
DoCast(target, SPELL_SLEEP);
}
uiSleepTimer = urand(15000, 20000);
} else uiSleepTimer -= diff;
@@ -128,9 +128,9 @@ public:
pos = i;
if (i == 7 && pInstance)
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}
}
@@ -174,8 +174,8 @@ public:
if (SwarmTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CARRION_SWARM);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_CARRION_SWARM);
SwarmTimer = urand(45000, 60000);
switch (urand(0, 1))
@@ -195,8 +195,8 @@ public:
{
for (uint8 i = 0; i < 3; ++i)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
pTarget->CastSpell(pTarget, SPELL_SLEEP, true);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
target->CastSpell(target, SPELL_SLEEP, true);
}
SleepTimer = 60000;
switch (urand(0, 1))
@@ -154,7 +154,7 @@ public:
};
/* This is the script for the Doomfire Spirit Mob. This mob simply follow players or
travels in random directions if pTarget cannot be found. */
travels in random directions if target cannot be found. */
class mob_doomfire_targetting : public CreatureScript
{
public:
@@ -216,10 +216,10 @@ public:
/* Finally, Archimonde's script. His script isn't extremely complex, most are simply spells on timers.
The only complicated aspect of the battle is Finger of Death and Doomfire, with Doomfire being the
hardest bit to code. Finger of Death is simply a distance check - if no one is in melee range, then
select a random pTarget and cast the spell on them. However, if someone IS in melee range, and this
select a random target and cast the spell on them. However, if someone IS in melee range, and this
is NOT the main tank (creature's victim), then we aggro that player and they become the new victim.
For Doomfire, we summon a mob (Doomfire Spirit) for the Doomfire mob to follow. It's spirit will
randomly select it's pTarget to follow and then we create the random movement making it unpredictable. */
randomly select it's target to follow and then we create the random movement making it unpredictable. */
class boss_archimonde : public CreatureScript
{
@@ -367,13 +367,13 @@ public:
return false;
targets.sort(Trinity::ObjectDistanceOrderPred(me));
Unit* pTarget = targets.front();
if (pTarget)
Unit* target = targets.front();
if (target)
{
if (!me->IsWithinDistInMap(pTarget, me->GetAttackDistance(pTarget)))
if (!me->IsWithinDistInMap(target, me->GetAttackDistance(target)))
return true; // Cast Finger of Death
else // This target is closest, he is our new tank
me->AddThreat(pTarget, me->getThreatManager().getThreat(me->getVictim()));
me->AddThreat(target, me->getThreatManager().getThreat(me->getVictim()));
}
return false;
@@ -409,14 +409,14 @@ public:
}
//this is code doing close to what the summoning spell would do (spell 31903)
void SummonDoomfire(Unit* pTarget)
void SummonDoomfire(Unit* target)
{
me->SummonCreature(CREATURE_DOOMFIRE_SPIRIT,
pTarget->GetPositionX()+15.0f, pTarget->GetPositionY()+15.0f, pTarget->GetPositionZ(), 0,
target->GetPositionX()+15.0f, target->GetPositionY()+15.0f, target->GetPositionZ(), 0,
TEMPSUMMON_TIMED_DESPAWN, 27000);
me->SummonCreature(CREATURE_DOOMFIRE,
pTarget->GetPositionX()-15.0f, pTarget->GetPositionY()-15.0f, pTarget->GetPositionZ(), 0,
target->GetPositionX()-15.0f, target->GetPositionY()-15.0f, target->GetPositionZ(), 0,
TEMPSUMMON_TIMED_DESPAWN, 27000);
}
@@ -121,9 +121,9 @@ public:
pos = i;
if (i == 7 && pInstance)
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}
}
@@ -116,9 +116,9 @@ public:
pos = i;
if (i == 7 && pInstance)
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}
}
@@ -181,10 +181,10 @@ public:
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
Unit* pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->getPowerType() == POWER_MANA)
Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA)
{
pTarget->CastSpell(pTarget, SPELL_MARK, true);//only cast on mana users
target->CastSpell(target, SPELL_MARK, true);//only cast on mana users
}
}
MarkTimerBase -= 5000;
@@ -112,9 +112,9 @@ public:
pos = i;
if (i == 7 && pInstance)
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}
}
@@ -890,18 +890,18 @@ void hyjalAI::UpdateAI(const uint32 diff)
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
Unit* pTarget = NULL;
Unit* target = NULL;
switch(Spells[i].TargetType)
{
case TARGETTYPE_SELF: pTarget = me; break;
case TARGETTYPE_RANDOM: pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); break;
case TARGETTYPE_VICTIM: pTarget = me->getVictim(); break;
case TARGETTYPE_SELF: target = me; break;
case TARGETTYPE_RANDOM: target = SelectTarget(SELECT_TARGET_RANDOM, 0); break;
case TARGETTYPE_VICTIM: target = me->getVictim(); break;
}
if (pTarget && pTarget->isAlive())
if (target && target->isAlive())
{
DoCast(pTarget, Spells[i].SpellId);
DoCast(target, Spells[i].SpellId);
SpellTimer[i] = Spells[i].Cooldown;
}
} else SpellTimer[i] -= diff;
@@ -434,9 +434,9 @@ public:
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}
}
}
@@ -475,9 +475,9 @@ public:
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && !pInstance->GetData(DATA_HORDE_RETREAT))
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
} else if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && pInstance->GetData(DATA_HORDE_RETREAT)){
//do overrun
}
@@ -562,13 +562,13 @@ public:
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}else{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}
}
if (i == LastOverronPos && IsOverrun)
@@ -667,13 +667,13 @@ public:
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}else{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}
}
if (i == LastOverronPos && IsOverrun)
@@ -768,9 +768,9 @@ public:
void JustSummoned(Creature* summon)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true);
if (pTarget && summon)
summon->Attack(pTarget, false);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true);
if (target && summon)
summon->Attack(target, false);
summons.Summon(summon);
}
void SummonedCreatureDespawn(Creature* summon) {summons.Despawn(summon);}
@@ -781,13 +781,13 @@ public:
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}else{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}
}
}
@@ -897,13 +897,13 @@ public:
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}else{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}
}
}
@@ -998,13 +998,13 @@ public:
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}else{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}
}
}
@@ -1090,13 +1090,13 @@ public:
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}else{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
me->AddThreat(pTarget, 0.0f);
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (target && target->isAlive())
me->AddThreat(target, 0.0f);
}
}
}
@@ -1184,11 +1184,11 @@ public:
pos = i;
if (i == 2 && pInstance && !IsOverrun)
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (target && target->isAlive())
{
me->AddThreat(pTarget, 0.0f);
DoCast(pTarget, SPELL_FROST_BREATH, true);
me->AddThreat(target, 0.0f);
DoCast(target, SPELL_FROST_BREATH, true);
}
}
}
@@ -1306,11 +1306,11 @@ public:
pos = i;
if (i == 2 && pInstance && !IsOverrun)
{
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (target && target->isAlive())
{
me->AddThreat(pTarget, 0.0f);
DoCast(pTarget, SPELL_GARGOYLE_STRIKE, true);
me->AddThreat(target, 0.0f);
DoCast(target, SPELL_GARGOYLE_STRIKE, true);
}
}
}
@@ -1373,9 +1373,9 @@ public:
forcemove = false;
if (forcemove)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
me->Attack(pTarget, false);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
me->Attack(target, false);
}
if (MoveTimer <= diff)
{
@@ -104,8 +104,8 @@ public:
if (uiCurseOfExertionTimer < diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CURSE_OF_EXERTION);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_CURSE_OF_EXERTION);
uiCurseOfExertionTimer = 9300;
} else uiCurseOfExertionTimer -= diff;
@@ -171,8 +171,8 @@ public:
if (uiMindBlastTimer < diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_MIND_BLAST);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_MIND_BLAST);
uiMindBlastTimer = 6000;
} else uiMindBlastTimer -= diff;
@@ -185,8 +185,8 @@ public:
if (uiSleepTimer < diff)
{
DoScriptText(RAND(SAY_SLEEP_1, SAY_SLEEP_2), me);
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_SLEEP);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_SLEEP);
uiSleepTimer = urand(15000, 20000);
} else uiSleepTimer -= diff;
@@ -108,8 +108,8 @@ public:
if (uiChainTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CONSTRICTING_CHAINS); //anyone but the tank
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_CONSTRICTING_CHAINS); //anyone but the tank
uiChainTimer = urand(2000, 4000);
} else uiChainTimer -= diff;
@@ -117,8 +117,8 @@ public:
//Shadow bolt timer
if (uiShadowBoltTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SHADOW_BOLT);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_SHADOW_BOLT);
uiShadowBoltTimer = urand(8000, 12000);
} else uiShadowBoltTimer -= diff;
@@ -124,8 +124,8 @@ public:
//Arcane Discharge
if (ArcaneDischarge_Timer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
DoCast(pTarget, SPELL_ARCANE_DISCHARGE);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
DoCast(target, SPELL_ARCANE_DISCHARGE);
ArcaneDischarge_Timer = 20000+rand()%10000;
} else ArcaneDischarge_Timer -= diff;
@@ -119,8 +119,8 @@ public:
if (WingBuffet_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_WING_BUFFET);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_WING_BUFFET);
WingBuffet_Timer = 25000+rand()%10000;
} else WingBuffet_Timer -= diff;
@@ -69,10 +69,10 @@ public:
//Wrath
if (Wrath_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
DoCast(pTarget, SPELL_WRATH);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
DoCast(target, SPELL_WRATH);
Wrath_Timer = 8000;
} else Wrath_Timer -= diff;
@@ -81,10 +81,10 @@ public:
//Boulder_Timer
if (Boulder_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
DoCast(pTarget, SPELL_BOULDER);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
DoCast(target, SPELL_BOULDER);
Boulder_Timer = 10000;
} else Boulder_Timer -= diff;
@@ -200,8 +200,8 @@ public:
void JustSummoned(Creature* pSummoned)
{
pSummoned->SetInCombatWithZone();
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
pSummoned->AI()->AttackStart(pTarget);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
pSummoned->AI()->AttackStart(target);
switch (pSummoned->GetEntry())
{
@@ -457,8 +457,8 @@ public:
{
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_FIREBALL);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_FIREBALL);
m_uiFireballTimer = 8000;
}
@@ -193,13 +193,13 @@ public:
//Charge_Timer
if (Charge_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
{
DoCast(pTarget, SPELL_CHARGE);
//me->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true, 1);
AttackStart(pTarget);
DoCast(target, SPELL_CHARGE);
//me->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true, 1);
AttackStart(target);
}
Charge_Timer = 8000 + rand()%8000;
@@ -273,10 +273,10 @@ public:
for (uint8 i = 0; i < 10; ++i)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
Creature* Summoned = me->SummonCreature(15621, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
if (Summoned && pTarget)
Summoned->AI()->AttackStart(pTarget);
if (Summoned && target)
Summoned->AI()->AttackStart(target);
}
}
@@ -241,9 +241,9 @@ public:
void SpawnEyeTentacle(float x, float y)
{
if (Creature* Spawned = DoSpawnCreature(MOB_EYE_TENTACLE, x, y, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 500))
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Spawned->AI())
Spawned->AI()->AttackStart(pTarget);
Spawned->AI()->AttackStart(target);
}
void UpdateAI(const uint32 diff)
@@ -284,13 +284,13 @@ public:
if (BeamTimer <= diff)
{
//SPELL_GREEN_BEAM
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
me->InterruptNonMeleeSpells(false);
DoCast(pTarget, SPELL_GREEN_BEAM);
DoCast(target, SPELL_GREEN_BEAM);
//Correctly update our target
me->SetUInt64Value(UNIT_FIELD_TARGET, pTarget->GetGUID());
me->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID());
}
//Beam every 3 seconds
@@ -300,15 +300,15 @@ public:
//ClawTentacleTimer
if (ClawTentacleTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
Creature* Spawned = NULL;
//Spawn claw tentacle on the random target
Spawned = me->SummonCreature(MOB_CLAW_TENTACLE, *pTarget, TEMPSUMMON_CORPSE_DESPAWN, 500);
Spawned = me->SummonCreature(MOB_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 500);
if (Spawned && Spawned->AI())
Spawned->AI()->AttackStart(pTarget);
Spawned->AI()->AttackStart(target);
}
//One claw tentacle every 12.5 seconds
@@ -328,10 +328,10 @@ public:
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
//Select random target for dark beam to start on
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
//Face our target
DarkGlareAngle = me->GetAngle(pTarget);
DarkGlareAngle = me->GetAngle(target);
DarkGlareTickTimer = 1000;
DarkGlareTick = 0;
ClockWise = RAND(true, false);
@@ -558,8 +558,8 @@ public:
Creature* Spawned;
Spawned = DoSpawnCreature(MOB_EYE_TENTACLE, x, y, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 500);
if (Spawned && Spawned->AI())
if (Unit* pTarget = SelectRandomNotStomach())
Spawned->AI()->AttackStart(pTarget);
if (Unit* target = SelectRandomNotStomach())
Spawned->AI()->AttackStart(target);
}
Unit* SelectRandomNotStomach()
@@ -787,13 +787,13 @@ public:
//Stomach Enter Timer
if (StomachEnterTimer <= diff)
{
if (Unit* pTarget = SelectRandomNotStomach())
if (Unit* target = SelectRandomNotStomach())
{
//Set target in stomach
Stomach_Map[pTarget->GetGUID()] = true;
pTarget->InterruptNonMeleeSpells(false);
pTarget->CastSpell(pTarget, SPELL_MOUTH_TENTACLE, true, NULL, NULL, me->GetGUID());
StomachEnterTarget = pTarget->GetGUID();
Stomach_Map[target->GetGUID()] = true;
target->InterruptNonMeleeSpells(false);
target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, NULL, NULL, me->GetGUID());
StomachEnterTarget = target->GetGUID();
StomachEnterVisTimer = 3800;
}
@@ -820,12 +820,12 @@ public:
//GientClawTentacleTimer
if (GiantClawTentacleTimer <= diff)
{
if (Unit* pTarget = SelectRandomNotStomach())
if (Unit* target = SelectRandomNotStomach())
{
//Spawn claw tentacle on the random target
if (Creature* spawned = me->SummonCreature(MOB_GIANT_CLAW_TENTACLE, *pTarget, TEMPSUMMON_CORPSE_DESPAWN, 500))
if (Creature* spawned = me->SummonCreature(MOB_GIANT_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 500))
if (spawned->AI())
spawned->AI()->AttackStart(pTarget);
spawned->AI()->AttackStart(target);
}
//One giant claw tentacle every minute
@@ -835,12 +835,12 @@ public:
//GiantEyeTentacleTimer
if (GiantEyeTentacleTimer <= diff)
{
if (Unit* pTarget = SelectRandomNotStomach())
if (Unit* target = SelectRandomNotStomach())
{
//Spawn claw tentacle on the random target
if (Creature* spawned = me->SummonCreature(MOB_GIANT_EYE_TENTACLE, *pTarget, TEMPSUMMON_CORPSE_DESPAWN, 500))
if (Creature* spawned = me->SummonCreature(MOB_GIANT_EYE_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 500))
if (spawned->AI())
spawned->AI()->AttackStart(pTarget);
spawned->AI()->AttackStart(target);
}
//One giant eye tentacle every minute
@@ -988,9 +988,9 @@ public:
//MindflayTimer
if (MindflayTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget && !pTarget->HasAura(SPELL_DIGESTIVE_ACID))
DoCast(pTarget, SPELL_MIND_FLAY);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target && !target->HasAura(SPELL_DIGESTIVE_ACID))
DoCast(target, SPELL_MIND_FLAY);
//Mindflay every 10 seconds
MindflayTimer = 10000;
@@ -1064,16 +1064,16 @@ public:
//Dissapear and reappear at new position
me->SetVisible(false);
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!pTarget)
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!target)
{
me->Kill(me);
return;
}
if (!pTarget->HasAura(SPELL_DIGESTIVE_ACID))
if (!target->HasAura(SPELL_DIGESTIVE_ACID))
{
me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
me->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
if (Creature* pPortal = me->SummonCreature(MOB_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
@@ -1083,7 +1083,7 @@ public:
GroundRuptureTimer = 500;
HamstringTimer = 2000;
EvadeTimer = 5000;
AttackStart(pTarget);
AttackStart(target);
}
me->SetVisible(true);
@@ -1176,16 +1176,16 @@ public:
//Dissapear and reappear at new position
me->SetVisible(false);
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!pTarget)
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!target)
{
me->Kill(me);
return;
}
if (!pTarget->HasAura(SPELL_DIGESTIVE_ACID))
if (!target->HasAura(SPELL_DIGESTIVE_ACID))
{
me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
me->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
if (Creature* pPortal = me->SummonCreature(MOB_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
@@ -1196,7 +1196,7 @@ public:
HamstringTimer = 2000;
ThrashTimer = 5000;
EvadeTimer = 5000;
AttackStart(pTarget);
AttackStart(target);
}
me->SetVisible(true);
} else EvadeTimer -= diff;
@@ -1281,9 +1281,9 @@ public:
//BeamTimer
if (BeamTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget && !pTarget->HasAura(SPELL_DIGESTIVE_ACID))
DoCast(pTarget, SPELL_GREEN_BEAM);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target && !target->HasAura(SPELL_DIGESTIVE_ACID))
DoCast(target, SPELL_GREEN_BEAM);
//Beam every 2 seconds
BeamTimer = 2100;
@@ -136,61 +136,61 @@ public:
{
if (SpawnHatchlings_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target && target->GetTypeId() == TYPEID_PLAYER)
{
DoCast(pTarget, SPELL_ROOT);
DoCast(target, SPELL_ROOT);
if (DoGetThreat(pTarget))
DoModifyThreatPercent(pTarget, -100);
if (DoGetThreat(target))
DoModifyThreatPercent(target, -100);
switch(urand(0, 2))
{
case 0:
DoTeleportPlayer(pTarget, -8106.0142f, 1289.2900f, -74.419533f, 5.112f);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
DoTeleportPlayer(target, -8106.0142f, 1289.2900f, -74.419533f, 5.112f);
Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling->AI()->AttackStart(target);
Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling->AI()->AttackStart(target);
Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling->AI()->AttackStart(target);
Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling->AI()->AttackStart(target);
break;
case 1:
DoTeleportPlayer(pTarget, -7990.135354f, 1155.1907f, -78.849319f, 2.608f);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
DoTeleportPlayer(target, -7990.135354f, 1155.1907f, -78.849319f, 2.608f);
Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling->AI()->AttackStart(target);
Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling->AI()->AttackStart(target);
Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling->AI()->AttackStart(target);
Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling->AI()->AttackStart(target);
break;
case 2:
DoTeleportPlayer(pTarget, -8159.7753f, 1127.9064f, -76.868660f, 0.675f);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
DoTeleportPlayer(target, -8159.7753f, 1127.9064f, -76.868660f, 0.675f);
Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling->AI()->AttackStart(target);
Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling->AI()->AttackStart(target);
Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling->AI()->AttackStart(target);
Hatchling = me->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling->AI()->AttackStart(target);
break;
}
}
@@ -95,8 +95,8 @@ public:
// Wyvern Timer
if (Wyvern_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_WYVERNSTING);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_WYVERNSTING);
Wyvern_Timer = 15000 + rand()%17000;
} else Wyvern_Timer -= diff;
@@ -111,11 +111,11 @@ public:
//ChangeTarget_Timer
if (Submerged && ChangeTarget_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ());
if (target)
DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
ChangeTarget_Timer = 10000 + rand()%10000;
} else ChangeTarget_Timer -= diff;
@@ -236,9 +236,9 @@ public:
for (uint16 i = 0; i < 41; ++i)
{
if (Player* pTarget = CAST_PLR(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)))
if (Player* target = CAST_PLR(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)))
{
if (Group *pGrp = pTarget->GetGroup())
if (Group *pGrp = target->GetGroup())
for (uint8 ico = 0; ico < TARGETICONCOUNT; ++ico)
{
//if (grp->m_targetIcons[ico] == me->GetGUID()) -- private member :(
@@ -264,15 +264,15 @@ public:
case 25: Images25 = true; break;
}
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
Creature* Image1 = me->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
if (Image1)
{
Image1->SetMaxHealth(me->GetMaxHealth() / 5);
Image1->SetHealth(me->GetHealth() / 5);
if (pTarget)
Image1->AI()->AttackStart(pTarget);
if (target)
Image1->AI()->AttackStart(target);
CAST_AI(boss_skeram::boss_skeramAI, Image1->AI())->IsImage = true;
}
@@ -281,8 +281,8 @@ public:
{
Image2->SetMaxHealth(me->GetMaxHealth() / 5);
Image2->SetHealth(me->GetHealth() / 5);
if (pTarget)
Image2->AI()->AttackStart(pTarget);
if (target)
Image2->AI()->AttackStart(target);
CAST_AI(boss_skeram::boss_skeramAI, Image2->AI())->IsImage = true;
}
Invisible = true;
@@ -79,7 +79,7 @@ struct boss_twinemperorsAI : public ScriptedAI
virtual bool IAmVeklor() = 0;
virtual void Reset() = 0;
virtual void CastSpellOnBug(Creature* pTarget) = 0;
virtual void CastSpellOnBug(Creature* target) = 0;
void TwinReset()
{
@@ -418,12 +418,12 @@ public:
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
}
void CastSpellOnBug(Creature* pTarget)
void CastSpellOnBug(Creature* target)
{
pTarget->setFaction(14);
pTarget->AI()->AttackStart(me->getThreatManager().getHostilTarget());
pTarget->AddAura(SPELL_MUTATE_BUG, pTarget);
pTarget->SetFullHealth();
target->setFaction(14);
target->AI()->AttackStart(me->getThreatManager().getHostilTarget());
target->AddAura(SPELL_MUTATE_BUG, target);
target->SetFullHealth();
}
void UpdateAI(const uint32 diff)
@@ -508,11 +508,11 @@ public:
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0);
}
void CastSpellOnBug(Creature* pTarget)
void CastSpellOnBug(Creature* target)
{
pTarget->setFaction(14);
pTarget->AddAura(SPELL_EXPLODEBUG, pTarget);
pTarget->SetFullHealth();
target->setFaction(14);
target->AddAura(SPELL_EXPLODEBUG, target);
target->SetFullHealth();
}
void UpdateAI(const uint32 diff)
@@ -542,10 +542,10 @@ public:
//Blizzard_Timer
if (Blizzard_Timer <= diff)
{
Unit* pTarget = NULL;
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true);
if (pTarget)
DoCast(pTarget, SPELL_BLIZZARD);
Unit* target = NULL;
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true);
if (target)
DoCast(target, SPELL_BLIZZARD);
Blizzard_Timer = 15000+rand()%15000;
} else Blizzard_Timer -= diff;
@@ -19,7 +19,7 @@
/* ScriptData
SDName: mob_anubisath_sentinel
SD%Complete: 95
SDComment: Shadow storm is not properly implemented in core it should only pTarget ppl outside of melee range.
SDComment: Shadow storm is not properly implemented in core it should only target ppl outside of melee range.
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
@@ -142,8 +142,8 @@ public:
break;
case 3:
me->setFaction(FACTION_HOSTILE);
if (Player* pTarget = Player::GetPlayer(*me, PlayerGUID))
AttackStart(pTarget);
if (Player* target = Player::GetPlayer(*me, PlayerGUID))
AttackStart(target);
if (pInstance)
{
@@ -122,8 +122,8 @@ public:
//ManaStorm_Timer
if (ManaStorm_Timer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_MANASTORM);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_MANASTORM);
ManaStorm_Timer = 7500 + rand()%5000;
} else ManaStorm_Timer -= diff;
+7 -7
View File
@@ -841,7 +841,7 @@ public:
void UpdateAI(const uint32 diff)
{
Unit* pTarget = NULL;
Unit* target = NULL;
//Player* player = me->GetPlayer(PlayerGUID);
if (!Timers)
@@ -888,21 +888,21 @@ public:
if (!hasTarget)
{
if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
pTarget = me->FindNearestCreature(15423, 20, true);
target = me->FindNearestCreature(15423, 20, true);
if (me->GetEntry() == 15423)
{
uint8 tar = urand(0, 2);
if (tar == 0)
pTarget = me->FindNearestCreature(15422, 20, true);
target = me->FindNearestCreature(15422, 20, true);
else if (tar == 1)
pTarget = me->FindNearestCreature(15424, 20, true);
target = me->FindNearestCreature(15424, 20, true);
else if (tar == 2)
pTarget = me->FindNearestCreature(15414, 20, true);
target = me->FindNearestCreature(15414, 20, true);
}
hasTarget = true;
if (pTarget)
me->AI()->AttackStart(pTarget);
if (target)
me->AI()->AttackStart(target);
}
if (!(me->FindNearestCreature(15379, 60)))
DoCast(me, 33652);
@@ -99,9 +99,9 @@ public:
if (BerserkerCharge_Timer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (pTarget)
DoCast(pTarget, SPELL_BERSERKER_CHARGE);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
DoCast(target, SPELL_BERSERKER_CHARGE);
BerserkerCharge_Timer = 25000;
} else BerserkerCharge_Timer -= diff;
@@ -142,10 +142,10 @@ public:
}
}
Creature* DoSummonImpaleTarget(Unit* pTarget)
Creature* DoSummonImpaleTarget(Unit* target)
{
Position targetPos;
pTarget->GetPosition(&targetPos);
target->GetPosition(&targetPos);
if (TempSummon* pImpaleTarget = me->SummonCreature(CREATURE_IMPALE_TARGET, targetPos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 6*IN_MILLISECONDS))
{
@@ -157,24 +157,24 @@ public:
if (uiAcidTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_ACID_CLOUD);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_ACID_CLOUD);
uiAcidTimer = urand(20*IN_MILLISECONDS, 30*IN_MILLISECONDS);
} else uiAcidTimer -= diff;
if (uiLeechTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_LEECH_POISON);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_LEECH_POISON);
uiLeechTimer = urand(11*IN_MILLISECONDS, 14*IN_MILLISECONDS);
} else uiLeechTimer -= diff;
if (uiGrabTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) // Draws all players (and attacking Mobs) to itself.
DoCast(pTarget, SPELL_WEB_GRAB);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) // Draws all players (and attacking Mobs) to itself.
DoCast(target, SPELL_WEB_GRAB);
uiGrabTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
} else uiGrabTimer -= diff;
@@ -252,11 +252,11 @@ public:
if (uiChargeTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoResetThreat();
me->AddThreat(pTarget, 1.0f);
DoCast(pTarget, SPELL_CHARGE, true);
me->AddThreat(target, 1.0f);
DoCast(target, SPELL_CHARGE, true);
}
uiChargeTimer = 15*IN_MILLISECONDS;
} else uiChargeTimer -= diff;
@@ -303,8 +303,8 @@ public:
if (uiShadowBoltTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_SHADOW_BOLT, true);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_SHADOW_BOLT, true);
uiShadowBoltTimer = 15*IN_MILLISECONDS;
} else uiShadowBoltTimer -= diff;
@@ -399,8 +399,8 @@ public:
if (uiWebWrapTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_WEB_WRAP, true);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_WEB_WRAP, true);
uiWebWrapTimer = 17*IN_MILLISECONDS;
} else uiWebWrapTimer -= diff;
@@ -447,8 +447,8 @@ public:
if (uiWebWrapTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_WEB_WRAP, true);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_WEB_WRAP, true);
uiWebWrapTimer = 15*IN_MILLISECONDS;
} else uiWebWrapTimer -= diff;
@@ -501,8 +501,8 @@ public:
if (uiWebWrapTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_WEB_WRAP, true);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_WEB_WRAP, true);
uiWebWrapTimer = 15*IN_MILLISECONDS;
} else uiWebWrapTimer -= diff;
@@ -132,8 +132,8 @@ public:
if (uiRootTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_ENTANGLING_ROOTS);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_ENTANGLING_ROOTS);
uiRootTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
} else uiRootTimer -= diff;
@@ -145,8 +145,8 @@ public:
if (uiBoltTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_VENOM_BOLT_VOLLEY);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_VENOM_BOLT_VOLLEY);
uiBoltTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
} else uiBoltTimer -= diff;

Some files were not shown because too many files have changed in this diff Show More