Core: Cleaning up hungarian notation - Phase3: pTarget -> target
This commit is contained in:
@@ -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;
|
||||
|
||||
+3
-3
@@ -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;
|
||||
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user