Core: Cleaning up hungarian notation - Phase3: pTarget -> target
This commit is contained in:
@@ -216,11 +216,11 @@ public:
|
||||
summoned->SetDisplayId(soulmodel);
|
||||
summoned->setFaction(me->getFaction());
|
||||
|
||||
if (Unit* pTarget = Unit::GetUnit(*me, soulholder))
|
||||
if (Unit* target = Unit::GetUnit(*me, soulholder))
|
||||
{
|
||||
|
||||
CAST_AI(mob_stolen_soul::mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass);
|
||||
summoned->AI()->AttackStart(pTarget);
|
||||
summoned->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -259,9 +259,9 @@ public:
|
||||
|
||||
if (StolenSoul_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
if (pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
@@ -272,11 +272,11 @@ public:
|
||||
else
|
||||
DoScriptText(SAY_SOUL_CLEAVE, me);
|
||||
|
||||
soulmodel = pTarget->GetDisplayId();
|
||||
soulholder = pTarget->GetGUID();
|
||||
soulclass = pTarget->getClass();
|
||||
soulmodel = target->GetDisplayId();
|
||||
soulholder = target->GetGUID();
|
||||
soulclass = target->getClass();
|
||||
|
||||
DoCast(pTarget, SPELL_STOLEN_SOUL);
|
||||
DoCast(target, SPELL_STOLEN_SOUL);
|
||||
me->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||
|
||||
StolenSoul_Timer = 20000 + rand()% 10000;
|
||||
@@ -286,8 +286,8 @@ public:
|
||||
|
||||
if (Ribbon_of_Souls_timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_RIBBON_OF_SOULS);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_RIBBON_OF_SOULS);
|
||||
|
||||
Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000);
|
||||
} else Ribbon_of_Souls_timer -= diff;
|
||||
|
||||
+5
-5
@@ -136,16 +136,16 @@ public:
|
||||
if (FocusFire_Timer <= diff)
|
||||
{
|
||||
// Summon Focus Fire & Emote
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive())
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive())
|
||||
{
|
||||
FocusedTargetGUID = pTarget->GetGUID();
|
||||
me->SummonCreature(ENTRY_FOCUS_FIRE, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 5500);
|
||||
FocusedTargetGUID = target->GetGUID();
|
||||
me->SummonCreature(ENTRY_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 5500);
|
||||
|
||||
// TODO: Find better way to handle emote
|
||||
// Emote
|
||||
std::string *emote = new std::string(EMOTE_FOCUSES_ON);
|
||||
emote->append(pTarget->GetName());
|
||||
emote->append(target->GetName());
|
||||
emote->append("!");
|
||||
const char* text = emote->c_str();
|
||||
me->MonsterTextEmote(text, 0, true);
|
||||
|
||||
@@ -128,8 +128,8 @@ public:
|
||||
{
|
||||
summoned->CastSpell(summoned, SPELL_ETHEREAL_BEACON_VISUAL, false);
|
||||
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
summoned->AI()->AttackStart(pTarget);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
summoned->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
summons.Summon(summoned);
|
||||
|
||||
@@ -90,9 +90,9 @@ public:
|
||||
|
||||
if (VoidBlast_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
DoCast(pTarget, SPELL_VOID_BLAST);
|
||||
DoCast(target, SPELL_VOID_BLAST);
|
||||
VoidBlast_Timer = 500;
|
||||
++VoidBlast_Counter;
|
||||
}
|
||||
|
||||
@@ -112,8 +112,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 SythSummoning()
|
||||
@@ -154,40 +154,40 @@ public:
|
||||
|
||||
if (flameshock_timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_FLAME_SHOCK);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_FLAME_SHOCK);
|
||||
|
||||
flameshock_timer = 10000 + rand()%5000;
|
||||
} else flameshock_timer -= diff;
|
||||
|
||||
if (arcaneshock_timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_ARCANE_SHOCK);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_ARCANE_SHOCK);
|
||||
|
||||
arcaneshock_timer = 10000 + rand()%5000;
|
||||
} else arcaneshock_timer -= diff;
|
||||
|
||||
if (frostshock_timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_FROST_SHOCK);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_FROST_SHOCK);
|
||||
|
||||
frostshock_timer = 10000 + rand()%5000;
|
||||
} else frostshock_timer -= diff;
|
||||
|
||||
if (shadowshock_timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_SHADOW_SHOCK);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SHADOW_SHOCK);
|
||||
|
||||
shadowshock_timer = 10000 + rand()%5000;
|
||||
} else shadowshock_timer -= diff;
|
||||
|
||||
if (chainlightning_timer <= 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);
|
||||
|
||||
chainlightning_timer = 25000;
|
||||
} else chainlightning_timer -= diff;
|
||||
@@ -229,16 +229,16 @@ public:
|
||||
|
||||
if (flameshock_timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_FLAME_SHOCK);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_FLAME_SHOCK);
|
||||
|
||||
flameshock_timer = 5000;
|
||||
} else flameshock_timer -= diff;
|
||||
|
||||
if (flamebuffet_timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_FLAME_BUFFET);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_FLAME_BUFFET);
|
||||
|
||||
flamebuffet_timer = 5000;
|
||||
} else flamebuffet_timer -= diff;
|
||||
@@ -288,16 +288,16 @@ public:
|
||||
|
||||
if (arcaneshock_timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_ARCANE_SHOCK);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_ARCANE_SHOCK);
|
||||
|
||||
arcaneshock_timer = 5000;
|
||||
} else arcaneshock_timer -= diff;
|
||||
|
||||
if (arcanebuffet_timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_ARCANE_BUFFET);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_ARCANE_BUFFET);
|
||||
|
||||
arcanebuffet_timer = 5000;
|
||||
} else arcanebuffet_timer -= diff;
|
||||
@@ -342,16 +342,16 @@ public:
|
||||
|
||||
if (frostshock_timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_FROST_SHOCK);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_FROST_SHOCK);
|
||||
|
||||
frostshock_timer = 5000;
|
||||
} else frostshock_timer -= diff;
|
||||
|
||||
if (frostbuffet_timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_FROST_BUFFET);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_FROST_BUFFET);
|
||||
|
||||
frostbuffet_timer = 5000;
|
||||
} else frostbuffet_timer -= diff;
|
||||
@@ -397,16 +397,16 @@ public:
|
||||
|
||||
if (shadowshock_timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_SHADOW_SHOCK);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SHADOW_SHOCK);
|
||||
|
||||
shadowshock_timer = 5000;
|
||||
} else shadowshock_timer -= diff;
|
||||
|
||||
if (shadowbuffet_timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_SHADOW_BUFFET);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SHADOW_BUFFET);
|
||||
|
||||
shadowbuffet_timer = 5000;
|
||||
} else shadowbuffet_timer -= diff;
|
||||
|
||||
@@ -151,16 +151,16 @@ public:
|
||||
|
||||
if (Sheep_Timer <= diff)
|
||||
{
|
||||
Unit* pTarget;
|
||||
Unit* target;
|
||||
|
||||
//second top aggro target in normal, random target in heroic correct?
|
||||
if (IsHeroic())
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
else
|
||||
pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
|
||||
target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
|
||||
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_POLYMORPH);
|
||||
if (target)
|
||||
DoCast(target, SPELL_POLYMORPH);
|
||||
Sheep_Timer = 15000+rand()%2500;
|
||||
} else Sheep_Timer -= diff;
|
||||
|
||||
@@ -184,21 +184,21 @@ public:
|
||||
{
|
||||
DoScriptText(EMOTE_ARCANE_EXP, me);
|
||||
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
//Spell doesn't work, but we use for visual effect at least
|
||||
DoCast(pTarget, SPELL_BLINK);
|
||||
DoCast(target, SPELL_BLINK);
|
||||
|
||||
float X = pTarget->GetPositionX();
|
||||
float Y = pTarget->GetPositionY();
|
||||
float Z = pTarget->GetPositionZ();
|
||||
float X = target->GetPositionX();
|
||||
float Y = target->GetPositionY();
|
||||
float Z = target->GetPositionZ();
|
||||
|
||||
DoTeleportTo(X, Y, Z);
|
||||
|
||||
DoCast(pTarget, SPELL_BLINK_TELEPORT);
|
||||
DoCast(target, SPELL_BLINK_TELEPORT);
|
||||
Blink = true;
|
||||
}
|
||||
Blink_Timer = 35000+rand()%5000;
|
||||
|
||||
+5
-5
@@ -136,9 +136,9 @@ 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->CastSpell(pTarget, SPELL_INCITE_CHAOS_B, true);
|
||||
Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->CastSpell(target, SPELL_INCITE_CHAOS_B, true);
|
||||
}
|
||||
|
||||
DoResetThreat();
|
||||
@@ -150,8 +150,8 @@ public:
|
||||
//Charge_Timer
|
||||
if (Charge_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_CHARGE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_CHARGE);
|
||||
Charge_Timer = 15000 + rand()%10000;
|
||||
} else Charge_Timer -= diff;
|
||||
|
||||
|
||||
@@ -274,10 +274,10 @@ public:
|
||||
|
||||
if (IsHeroic() && banish_Timer <= diff)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, false);
|
||||
if (pTarget)
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, false);
|
||||
if (target)
|
||||
{
|
||||
DoCast(pTarget, SPELL_BANISH);
|
||||
DoCast(target, SPELL_BANISH);
|
||||
banish_Timer = 16000;
|
||||
}
|
||||
} else banish_Timer -= diff;
|
||||
|
||||
@@ -82,14 +82,14 @@ 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)
|
||||
Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
//Not do anything without aura, spell can be resisted!
|
||||
if (pTarget->HasAura(SPELL_SONIC_BOOM_CAST) && me->IsWithinDistInMap(pTarget, 34.0f))
|
||||
if (target->HasAura(SPELL_SONIC_BOOM_CAST) && me->IsWithinDistInMap(target, 34.0f))
|
||||
{
|
||||
//This will be wrong calculation. Also, comments suggest it must deal damage
|
||||
pTarget->SetHealth(pTarget->CountPctFromMaxHealth(20));
|
||||
target->SetHealth(target->CountPctFromMaxHealth(20));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,10 +98,10 @@ public:
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
|
||||
// Sonic Boom instant damage (needs core fix instead of this)
|
||||
void SpellHitTarget(Unit* pTarget, const SpellEntry *spell)
|
||||
void SpellHitTarget(Unit* target, const SpellEntry *spell)
|
||||
{
|
||||
if (pTarget && pTarget->isAlive() && spell && spell->Id == uint32(SPELL_SONIC_BOOM_EFFECT))
|
||||
me->DealDamage(pTarget, (pTarget->GetHealth()*90)/100, NULL, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NATURE, spell);
|
||||
if (target && target->isAlive() && spell && spell->Id == uint32(SPELL_SONIC_BOOM_EFFECT))
|
||||
me->DealDamage(target, (target->GetHealth()*90)/100, NULL, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NATURE, spell);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
@@ -131,8 +131,8 @@ public:
|
||||
// Murmur's Touch
|
||||
if (MurmursTouch_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true))
|
||||
DoCast(pTarget, SPELL_MURMURS_TOUCH);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true))
|
||||
DoCast(target, SPELL_MURMURS_TOUCH);
|
||||
MurmursTouch_Timer = 25000 + rand()%10000;
|
||||
} else MurmursTouch_Timer -= diff;
|
||||
|
||||
@@ -149,10 +149,10 @@ public:
|
||||
// Magnetic Pull
|
||||
if (MagneticPull_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive())
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive())
|
||||
{
|
||||
DoCast(pTarget, SPELL_MAGNETIC_PULL);
|
||||
DoCast(target, SPELL_MAGNETIC_PULL);
|
||||
MagneticPull_Timer = 15000+rand()%15000;
|
||||
return;
|
||||
}
|
||||
@@ -166,18 +166,18 @@ public:
|
||||
{
|
||||
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
|
||||
if (Unit* pTarget = Unit::GetUnit((*me), (*i)->getUnitGuid()))
|
||||
if (pTarget->isAlive() && !me->IsWithinDist(pTarget, 35, false))
|
||||
DoCast(pTarget, SPELL_THUNDERING_STORM, true);
|
||||
if (Unit* target = Unit::GetUnit((*me), (*i)->getUnitGuid()))
|
||||
if (target->isAlive() && !me->IsWithinDist(target, 35, false))
|
||||
DoCast(target, SPELL_THUNDERING_STORM, true);
|
||||
ThunderingStorm_Timer = 15000;
|
||||
} else ThunderingStorm_Timer -= diff;
|
||||
|
||||
// Sonic Shock
|
||||
if (SonicShock_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 20, false))
|
||||
if (pTarget->isAlive())
|
||||
DoCast(pTarget, SPELL_SONIC_SHOCK);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20, false))
|
||||
if (target->isAlive())
|
||||
DoCast(target, SPELL_SONIC_SHOCK);
|
||||
SonicShock_Timer = 10000+rand()%10000;
|
||||
} else SonicShock_Timer -= diff;
|
||||
}
|
||||
@@ -189,10 +189,10 @@ public:
|
||||
{
|
||||
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
|
||||
if (Unit* pTarget = Unit::GetUnit((*me), (*i)->getUnitGuid()))
|
||||
if (pTarget->isAlive() && me->IsWithinMeleeRange(pTarget))
|
||||
if (Unit* target = Unit::GetUnit((*me), (*i)->getUnitGuid()))
|
||||
if (target->isAlive() && me->IsWithinMeleeRange(target))
|
||||
{
|
||||
me->TauntApply(pTarget);
|
||||
me->TauntApply(target);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,10 +151,10 @@ public:
|
||||
std::list<HostileReference *>::const_iterator itr = m_threatlist.begin();
|
||||
for (; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
//Sort the list of players
|
||||
@@ -168,16 +168,16 @@ public:
|
||||
{
|
||||
for (std::list<Unit* >::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||
{
|
||||
Unit* pTarget = *itr;
|
||||
if (!pTarget) return;
|
||||
Unit* target = *itr;
|
||||
if (!target) return;
|
||||
for (uint32 i = 0; i<3; ++i)
|
||||
{
|
||||
uint8 eff = spellInfo->Effect[i];
|
||||
if (eff >= TOTAL_SPELL_EFFECTS)
|
||||
continue;
|
||||
|
||||
Aura *Aur = new Aura(spellInfo, i, pTarget, pTarget, pTarget);
|
||||
pTarget->AddAura(Aur);
|
||||
Aura *Aur = new Aura(spellInfo, i, target, target, target);
|
||||
target->AddAura(Aur);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
@@ -228,8 +228,8 @@ public:
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_BEWILDERING_STRIKE);
|
||||
float mt_threat = DoGetThreat(me->getVictim());
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1))
|
||||
me->AddThreat(pTarget, mt_threat);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1))
|
||||
me->AddThreat(target, mt_threat);
|
||||
BewilderingStrikeTimer = 20000;
|
||||
} else BewilderingStrikeTimer -= diff;
|
||||
|
||||
@@ -277,26 +277,26 @@ public:
|
||||
{
|
||||
if (Phase1)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget && pTarget->isAlive())
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target && target->isAlive())
|
||||
{
|
||||
Phase1 = false;
|
||||
|
||||
TargetThreat = DoGetThreat(pTarget);
|
||||
TargetGUID = pTarget->GetGUID();
|
||||
pTarget->CastSpell(me, SPELL_TAUNT_GURTOGG, true);
|
||||
if (DoGetThreat(pTarget))
|
||||
DoModifyThreatPercent(pTarget, -100);
|
||||
me->AddThreat(pTarget, 50000000.0f);
|
||||
TargetThreat = DoGetThreat(target);
|
||||
TargetGUID = target->GetGUID();
|
||||
target->CastSpell(me, SPELL_TAUNT_GURTOGG, true);
|
||||
if (DoGetThreat(target))
|
||||
DoModifyThreatPercent(target, -100);
|
||||
me->AddThreat(target, 50000000.0f);
|
||||
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
|
||||
// If VMaps are disabled, this spell can call the whole instance
|
||||
DoCast(me, SPELL_INSIGNIFIGANCE, true);
|
||||
DoCast(pTarget, SPELL_FEL_RAGE_TARGET, true);
|
||||
DoCast(pTarget, SPELL_FEL_RAGE_2, true);
|
||||
DoCast(target, SPELL_FEL_RAGE_TARGET, true);
|
||||
DoCast(target, SPELL_FEL_RAGE_2, true);
|
||||
/* These spells do not work, comment them out for now.
|
||||
DoCast(pTarget, SPELL_FEL_RAGE_2, true);
|
||||
DoCast(pTarget, SPELL_FEL_RAGE_3, true);*/
|
||||
DoCast(target, SPELL_FEL_RAGE_2, true);
|
||||
DoCast(target, SPELL_FEL_RAGE_3, true);*/
|
||||
|
||||
//Cast this without triggered so that it appears in combat logs and shows visual.
|
||||
DoCast(me, SPELL_FEL_RAGE_SELF);
|
||||
|
||||
@@ -392,13 +392,13 @@ public:
|
||||
|
||||
void ChargeCheck()
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0, 200, false);
|
||||
if (pTarget && (!me->IsWithinCombatRange(pTarget, FLAME_CHARGE_DISTANCE)))
|
||||
Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 200, false);
|
||||
if (target && (!me->IsWithinCombatRange(target, FLAME_CHARGE_DISTANCE)))
|
||||
{
|
||||
me->AddThreat(pTarget, 5000000.0f);
|
||||
AttackStart(pTarget);
|
||||
DoCast(pTarget, SPELL_CHARGE);
|
||||
me->MonsterTextEmote(EMOTE_SETS_GAZE_ON, pTarget->GetGUID());
|
||||
me->AddThreat(target, 5000000.0f);
|
||||
AttackStart(target);
|
||||
DoCast(target, SPELL_CHARGE);
|
||||
me->MonsterTextEmote(EMOTE_SETS_GAZE_ON, target->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,8 +411,8 @@ public:
|
||||
Glaive->InterruptNonMeleeSpells(true);
|
||||
DoCast(me, SPELL_FLAME_ENRAGE, true);
|
||||
DoResetThreat();
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget && pTarget->isAlive())
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target && target->isAlive())
|
||||
{
|
||||
me->AddThreat(me->getVictim(), 5000000.0f);
|
||||
AttackStart(me->getVictim());
|
||||
@@ -1038,8 +1038,8 @@ public:
|
||||
|
||||
case EVENT_PARASITIC_SHADOWFIEND:
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true))
|
||||
DoCast(pTarget, SPELL_PARASITIC_SHADOWFIEND, true);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true))
|
||||
DoCast(target, SPELL_PARASITIC_SHADOWFIEND, true);
|
||||
Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000;
|
||||
}
|
||||
break;
|
||||
@@ -1271,9 +1271,9 @@ public:
|
||||
{
|
||||
if (GETCRE(Illidan, IllidanGUID))
|
||||
{
|
||||
Unit* pTarget = Illidan->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target = Illidan->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
if (!pTarget || !me->IsWithinDistInMap(pTarget, 80) || Illidan->IsWithinDistInMap(pTarget, 20))
|
||||
if (!target || !me->IsWithinDistInMap(target, 80) || Illidan->IsWithinDistInMap(target, 20))
|
||||
{
|
||||
uint8 pos = rand()%4;
|
||||
BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z);
|
||||
@@ -1281,7 +1281,7 @@ public:
|
||||
else
|
||||
{
|
||||
float x, y, z;
|
||||
pTarget->GetPosition(x, y, z);
|
||||
target->GetPosition(x, y, z);
|
||||
BlinkTo(x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -1886,19 +1886,19 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::JustSummoned(Creature* su
|
||||
summon->setDeathState(JUST_DIED);
|
||||
return;
|
||||
}
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true);
|
||||
if (!pTarget || pTarget->HasAura(SPELL_PARASITIC_SHADOWFIEND)
|
||||
|| pTarget->HasAura(SPELL_PARASITIC_SHADOWFIEND2))
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true);
|
||||
if (pTarget)
|
||||
summon->AI()->AttackStart(pTarget);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true);
|
||||
if (!target || target->HasAura(SPELL_PARASITIC_SHADOWFIEND)
|
||||
|| target->HasAura(SPELL_PARASITIC_SHADOWFIEND2))
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true);
|
||||
if (target)
|
||||
summon->AI()->AttackStart(target);
|
||||
}
|
||||
break;
|
||||
case SHADOW_DEMON:
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players.
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players.
|
||||
{
|
||||
summon->AddThreat(pTarget, 5000000.0f);
|
||||
summon->AI()->AttackStart(pTarget);
|
||||
summon->AddThreat(target, 5000000.0f);
|
||||
summon->AI()->AttackStart(target);
|
||||
}
|
||||
break;
|
||||
case MAIEV_SHADOWSONG:
|
||||
@@ -2128,8 +2128,8 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (Unit* pTarget = Unit::GetUnit((*me), TargetGUID))
|
||||
pTarget->RemoveAurasDueToSpell(SPELL_PARALYZE);
|
||||
if (Unit* target = Unit::GetUnit((*me), TargetGUID))
|
||||
target->RemoveAurasDueToSpell(SPELL_PARALYZE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 /*diff*/)
|
||||
@@ -2231,8 +2231,8 @@ public:
|
||||
{
|
||||
if (!me->getVictim())
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true))
|
||||
AttackStart(pTarget);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true))
|
||||
AttackStart(target);
|
||||
else
|
||||
{
|
||||
me->SetVisible(false);
|
||||
|
||||
@@ -190,8 +190,8 @@ public:
|
||||
//Randomly cast one beam.
|
||||
if (BeamTimer <= diff)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (!pTarget || !pTarget->isAlive())
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (!target || !target->isAlive())
|
||||
return;
|
||||
|
||||
BeamTimer = 9000;
|
||||
@@ -199,16 +199,16 @@ public:
|
||||
switch(CurrentBeam)
|
||||
{
|
||||
case 0:
|
||||
DoCast(pTarget, SPELL_BEAM_SINISTER);
|
||||
DoCast(target, SPELL_BEAM_SINISTER);
|
||||
break;
|
||||
case 1:
|
||||
DoCast(pTarget, SPELL_BEAM_VILE);
|
||||
DoCast(target, SPELL_BEAM_VILE);
|
||||
break;
|
||||
case 2:
|
||||
DoCast(pTarget, SPELL_BEAM_WICKED);
|
||||
DoCast(target, SPELL_BEAM_WICKED);
|
||||
break;
|
||||
case 3:
|
||||
DoCast(pTarget, SPELL_BEAM_SINFUL);
|
||||
DoCast(target, SPELL_BEAM_SINFUL);
|
||||
break;
|
||||
}
|
||||
++BeamCount;
|
||||
|
||||
@@ -199,20 +199,20 @@ public:
|
||||
float y = Coords[random].y;
|
||||
Creature* Soul = me->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (!Soul) return false;
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
CAST_AI(npc_enslaved_soul::npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = me->GetGUID();
|
||||
Soul->AI()->AttackStart(pTarget);
|
||||
Soul->AI()->AttackStart(target);
|
||||
} else EnterEvadeMode();
|
||||
return true;
|
||||
}
|
||||
|
||||
void MergeThreatList(Creature* pTarget)
|
||||
void MergeThreatList(Creature* target)
|
||||
{
|
||||
if (!pTarget)
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
std::list<HostileReference*>& m_threatlist = pTarget->getThreatManager().getThreatList();
|
||||
std::list<HostileReference*>& m_threatlist = target->getThreatManager().getThreatList();
|
||||
std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
|
||||
for (; itr != m_threatlist.end(); ++itr)
|
||||
{
|
||||
@@ -220,7 +220,7 @@ public:
|
||||
if (pUnit)
|
||||
{
|
||||
DoModifyThreatPercent(pUnit, -100);
|
||||
float threat = pTarget->getThreatManager().getThreat(pUnit);
|
||||
float threat = target->getThreatManager().getThreat(pUnit);
|
||||
me->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences).
|
||||
}
|
||||
}
|
||||
@@ -446,11 +446,11 @@ public:
|
||||
return; // No targets added for some reason. No point continuing.
|
||||
targets.sort(Trinity::ObjectDistanceOrderPred(me)); // Sort players by distance.
|
||||
targets.resize(1); // Only need closest target.
|
||||
Unit* pTarget = targets.front(); // Get the first target.
|
||||
if (pTarget)
|
||||
pTarget->CastSpell(me, SPELL_FIXATE_TAUNT, true);
|
||||
Unit* target = targets.front(); // Get the first target.
|
||||
if (target)
|
||||
target->CastSpell(me, SPELL_FIXATE_TAUNT, true);
|
||||
DoResetThreat();
|
||||
me->AddThreat(pTarget, 1000000);
|
||||
me->AddThreat(target, 1000000);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -371,8 +371,8 @@ public:
|
||||
{
|
||||
Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z);
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
Spawn->AI()->AttackStart(pTarget);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
Spawn->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ public:
|
||||
Unit* CalculateHatefulStrikeTarget()
|
||||
{
|
||||
uint32 health = 0;
|
||||
Unit* pTarget = NULL;
|
||||
Unit* target = NULL;
|
||||
|
||||
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
|
||||
std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
|
||||
@@ -183,12 +183,12 @@ public:
|
||||
if (pUnit->GetHealth() > health)
|
||||
{
|
||||
health = pUnit->GetHealth();
|
||||
pTarget = pUnit;
|
||||
target = pUnit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pTarget;
|
||||
return target;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
@@ -211,28 +211,28 @@ public:
|
||||
events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST);
|
||||
break;
|
||||
case EVENT_HATEFUL_STRIKE:
|
||||
if (Unit* pTarget = CalculateHatefulStrikeTarget())
|
||||
DoCast(pTarget, SPELL_HATEFUL_STRIKE);
|
||||
if (Unit* target = CalculateHatefulStrikeTarget())
|
||||
DoCast(target, SPELL_HATEFUL_STRIKE);
|
||||
events.DelayEvents(1000, GCD_CAST);
|
||||
events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE);
|
||||
break;
|
||||
case EVENT_SWITCH_TARGET:
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
|
||||
{
|
||||
DoResetThreat();
|
||||
me->AddThreat(pTarget, 5000000.0f);
|
||||
me->AddThreat(target, 5000000.0f);
|
||||
DoScriptText(EMOTE_NEW_TARGET, me);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE);
|
||||
break;
|
||||
case EVENT_VOLCANO:
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true);
|
||||
if (!pTarget) pTarget = me->getVictim();
|
||||
if (pTarget)
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true);
|
||||
if (!target) target = me->getVictim();
|
||||
if (target)
|
||||
{
|
||||
//DoCast(pTarget, SPELL_VOLCANIC_SUMMON);//movement bugged
|
||||
me->SummonCreature(CREATURE_VOLCANO, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
|
||||
//DoCast(target, SPELL_VOLCANIC_SUMMON);//movement bugged
|
||||
me->SummonCreature(CREATURE_VOLCANO, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
|
||||
DoScriptText(EMOTE_GROUND_CRACK, me);
|
||||
events.DelayEvents(1500, GCD_CAST);
|
||||
}
|
||||
|
||||
@@ -178,11 +178,11 @@ public:
|
||||
targets.push_back(pUnit);
|
||||
}
|
||||
targets.sort(Trinity::ObjectDistanceOrderPred(me));
|
||||
Unit* pTarget = targets.front();
|
||||
if (pTarget && me->IsWithinDistInMap(pTarget, me->GetAttackDistance(pTarget)))
|
||||
Unit* target = targets.front();
|
||||
if (target && me->IsWithinDistInMap(target, me->GetAttackDistance(target)))
|
||||
{
|
||||
DoCast(pTarget, SPELL_ATROPHY);
|
||||
me->AI()->AttackStart(pTarget);
|
||||
DoCast(target, SPELL_ATROPHY);
|
||||
me->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,12 +365,12 @@ public:
|
||||
Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true);
|
||||
SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List.
|
||||
CAST_AI(mob_shadowy_construct::mob_shadowy_constructAI, Construct->AI())->GhostGUID = GhostGUID;
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (!pTarget) // someone's trying to solo.
|
||||
pTarget = me->getVictim();
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (!target) // someone's trying to solo.
|
||||
target = me->getVictim();
|
||||
|
||||
if (pTarget)
|
||||
Construct->GetMotionMaster()->MoveChase(pTarget);
|
||||
if (target)
|
||||
Construct->GetMotionMaster()->MoveChase(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,12 +417,12 @@ public:
|
||||
Shadow = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0);
|
||||
if (Shadow)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (!pTarget)
|
||||
pTarget = me->getVictim();
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (!target)
|
||||
target = me->getVictim();
|
||||
|
||||
if (pTarget)
|
||||
Shadow->AI()->AttackStart(pTarget);
|
||||
if (target)
|
||||
Shadow->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
SummonShadowsTimer = 60000;
|
||||
@@ -430,20 +430,20 @@ public:
|
||||
|
||||
if (SummonDoomBlossomTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
float X = CalculateRandomLocation(pTarget->GetPositionX(), 20);
|
||||
float Y = CalculateRandomLocation(pTarget->GetPositionY(), 20);
|
||||
float Z = pTarget->GetPositionZ();
|
||||
float X = CalculateRandomLocation(target->GetPositionX(), 20);
|
||||
float Y = CalculateRandomLocation(target->GetPositionY(), 20);
|
||||
float Z = target->GetPositionZ();
|
||||
Z = me->GetMap()->GetHeight(X, Y, Z);
|
||||
Creature* DoomBlossom = me->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000);
|
||||
if (DoomBlossom)
|
||||
{
|
||||
DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
DoomBlossom->setFaction(me->getFaction());
|
||||
DoomBlossom->AddThreat(pTarget, 1.0f);
|
||||
DoomBlossom->AddThreat(target, 1.0f);
|
||||
CAST_AI(mob_doom_blossom::mob_doom_blossomAI, DoomBlossom->AI())->SetTeronGUID(me->GetGUID());
|
||||
pTarget->CombatStart(DoomBlossom);
|
||||
target->CombatStart(DoomBlossom);
|
||||
SetThreatList(DoomBlossom);
|
||||
SummonDoomBlossomTimer = 35000;
|
||||
}
|
||||
@@ -452,38 +452,38 @@ public:
|
||||
|
||||
if (IncinerateTimer <= diff)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (!pTarget)
|
||||
pTarget = me->getVictim();
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (!target)
|
||||
target = me->getVictim();
|
||||
|
||||
if (pTarget)
|
||||
if (target)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SPECIAL1, SAY_SPECIAL2), me);
|
||||
DoCast(pTarget, SPELL_INCINERATE);
|
||||
DoCast(target, SPELL_INCINERATE);
|
||||
IncinerateTimer = 20000 + rand()%31 * 1000;
|
||||
}
|
||||
} else IncinerateTimer -= diff;
|
||||
|
||||
if (CrushingShadowsTimer <= diff)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget && pTarget->isAlive())
|
||||
DoCast(pTarget, SPELL_CRUSHING_SHADOWS);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target && target->isAlive())
|
||||
DoCast(target, SPELL_CRUSHING_SHADOWS);
|
||||
CrushingShadowsTimer = 10000 + rand()%16 * 1000;
|
||||
} else CrushingShadowsTimer -= diff;
|
||||
|
||||
/*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/
|
||||
/*if (ShadowOfDeathTimer <= diff)
|
||||
{
|
||||
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
|
||||
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
|
||||
|
||||
if (!pTarget)
|
||||
pTarget = me->getVictim();
|
||||
if (!target)
|
||||
target = me->getVictim();
|
||||
|
||||
if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DoCast(pTarget, SPELL_SHADOW_OF_DEATH);
|
||||
GhostGUID = pTarget->GetGUID();
|
||||
DoCast(target, SPELL_SHADOW_OF_DEATH);
|
||||
GhostGUID = target->GetGUID();
|
||||
ShadowOfDeathTimer = 30000;
|
||||
SummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the player
|
||||
}
|
||||
|
||||
@@ -131,9 +131,9 @@ public:
|
||||
bool RemoveImpalingSpine()
|
||||
{
|
||||
if (!SpineTargetGUID) return false;
|
||||
Unit* pTarget = Unit::GetUnit(*me, SpineTargetGUID);
|
||||
if (pTarget && pTarget->HasAura(SPELL_IMPALING_SPINE))
|
||||
pTarget->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE);
|
||||
Unit* target = Unit::GetUnit(*me, SpineTargetGUID);
|
||||
if (target && target->HasAura(SPELL_IMPALING_SPINE))
|
||||
target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE);
|
||||
SpineTargetGUID=0;
|
||||
return true;
|
||||
}
|
||||
@@ -167,14 +167,14 @@ public:
|
||||
break;
|
||||
case EVENT_SPINE:
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (!pTarget) pTarget = me->getVictim();
|
||||
if (pTarget)
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (!target) target = me->getVictim();
|
||||
if (target)
|
||||
{
|
||||
DoCast(pTarget, SPELL_IMPALING_SPINE, true);
|
||||
SpineTargetGUID = pTarget->GetGUID();
|
||||
DoCast(target, SPELL_IMPALING_SPINE, true);
|
||||
SpineTargetGUID = target->GetGUID();
|
||||
//must let target summon, otherwise you cannot click the spine
|
||||
pTarget->SummonGameObject(GOBJECT_SPINE, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 30);
|
||||
target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 30);
|
||||
DoScriptText(rand()%2 ? SAY_NEEDLE1 : SAY_NEEDLE2, me);
|
||||
events.DelayEvents(1500, GCD_CAST);
|
||||
events.DelayEvents(15000, GCD_YELL);
|
||||
@@ -185,9 +185,9 @@ public:
|
||||
case EVENT_NEEDLE:
|
||||
{
|
||||
//DoCast(me, SPELL_NEEDLE_SPINE, true);
|
||||
std::list<Unit*> pTargets;
|
||||
SelectTargetList(pTargets, 3, SELECT_TARGET_RANDOM, 80, true);
|
||||
for (std::list<Unit*>::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i)
|
||||
std::list<Unit*> targets;
|
||||
SelectTargetList(targets, 3, SELECT_TARGET_RANDOM, 80, true);
|
||||
for (std::list<Unit*>::const_iterator i = targets.begin(); i != targets.end(); ++i)
|
||||
DoCast(*i, 39835, true);
|
||||
events.ScheduleEvent(EVENT_NEEDLE, urand(15000, 25000), GCD_CAST);
|
||||
events.DelayEvents(1500, GCD_CAST);
|
||||
|
||||
@@ -275,12 +275,12 @@ public:
|
||||
void AttackStart(Unit* /*who*/) {}
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
|
||||
void StartEvent(Unit* pTarget)
|
||||
void StartEvent(Unit* target)
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
if (pTarget && pTarget->isAlive())
|
||||
if (target && target->isAlive())
|
||||
{
|
||||
Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER);
|
||||
Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR);
|
||||
@@ -301,7 +301,7 @@ public:
|
||||
{
|
||||
Member = Unit::GetUnit((*me), Council[i]);
|
||||
if (Member && Member->isAlive())
|
||||
CAST_CRE(Member)->AI()->AttackStart(pTarget);
|
||||
CAST_CRE(Member)->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -557,12 +557,12 @@ public:
|
||||
|
||||
if (HammerOfJusticeTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
// is in ~10-40 yd range
|
||||
if (me->IsInRange(pTarget, 10.0f, 40.0f, false))
|
||||
if (me->IsInRange(target, 10.0f, 40.0f, false))
|
||||
{
|
||||
DoCast(pTarget, SPELL_HAMMER_OF_JUSTICE);
|
||||
DoCast(target, SPELL_HAMMER_OF_JUSTICE);
|
||||
HammerOfJusticeTimer = 20000;
|
||||
}
|
||||
}
|
||||
@@ -670,9 +670,9 @@ public:
|
||||
|
||||
if (BlizzardTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
DoCast(pTarget, SPELL_BLIZZARD);
|
||||
DoCast(target, SPELL_BLIZZARD);
|
||||
BlizzardTimer = 45000 + rand()%46 * 1000;
|
||||
FlamestrikeTimer += 10000;
|
||||
Cooldown = 1000;
|
||||
@@ -681,9 +681,9 @@ public:
|
||||
|
||||
if (FlamestrikeTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
DoCast(pTarget, SPELL_FLAMESTRIKE);
|
||||
DoCast(target, SPELL_FLAMESTRIKE);
|
||||
FlamestrikeTimer = 55000 + rand()%46 * 1000;
|
||||
BlizzardTimer += 10000;
|
||||
Cooldown = 2000;
|
||||
@@ -738,9 +738,9 @@ public:
|
||||
|
||||
if (EmpoweredSmiteTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
DoCast(pTarget, SPELL_EMPOWERED_SMITE);
|
||||
DoCast(target, SPELL_EMPOWERED_SMITE);
|
||||
EmpoweredSmiteTimer = 38000;
|
||||
}
|
||||
} else EmpoweredSmiteTimer -= diff;
|
||||
@@ -753,9 +753,9 @@ public:
|
||||
|
||||
if (DivineWrathTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
DoCast(pTarget, SPELL_DIVINE_WRATH);
|
||||
DoCast(target, SPELL_DIVINE_WRATH);
|
||||
DivineWrathTimer = 40000 + rand()%41 * 1000;
|
||||
}
|
||||
} else DivineWrathTimer -= diff;
|
||||
@@ -838,7 +838,7 @@ public:
|
||||
|
||||
if (VanishTimer <= diff) // Disappear and stop attacking, but follow a random unit
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
VanishTimer = 30000;
|
||||
AppearEnvenomTimer= 28000;
|
||||
@@ -847,8 +847,8 @@ public:
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
DoResetThreat();
|
||||
// Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking
|
||||
me->AddThreat(pTarget, 500000.0f);
|
||||
me->GetMotionMaster()->MoveChase(pTarget);
|
||||
me->AddThreat(target, 500000.0f);
|
||||
me->GetMotionMaster()->MoveChase(target);
|
||||
}
|
||||
} else VanishTimer -= diff;
|
||||
|
||||
@@ -858,11 +858,11 @@ public:
|
||||
{
|
||||
if (VanishTimer <= diff) // Become attackable and poison current target
|
||||
{
|
||||
Unit* pTarget = me->getVictim();
|
||||
DoCast(pTarget, SPELL_DEADLY_POISON);
|
||||
Unit* target = me->getVictim();
|
||||
DoCast(target, SPELL_DEADLY_POISON);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
DoResetThreat();
|
||||
me->AddThreat(pTarget, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after.
|
||||
me->AddThreat(target, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after.
|
||||
DeadlyPoisonTimer += 6000;
|
||||
VanishTimer = 90000;
|
||||
AppearEnvenomTimer = 4000;
|
||||
|
||||
+23
-23
@@ -225,11 +225,11 @@ public:
|
||||
//Only if not incombat check if the event is started
|
||||
if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
|
||||
{
|
||||
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
|
||||
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
|
||||
|
||||
if (pTarget)
|
||||
if (target)
|
||||
{
|
||||
AttackStart(pTarget);
|
||||
AttackStart(target);
|
||||
GetAdvisors();
|
||||
}
|
||||
}
|
||||
@@ -249,14 +249,14 @@ public:
|
||||
if (CataclysmicBolt_Timer <= diff)
|
||||
{
|
||||
//select a random unit other than the main tank
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
|
||||
//if there aren't other units, cast on the tank
|
||||
if (!pTarget)
|
||||
pTarget = me->getVictim();
|
||||
if (!target)
|
||||
target = me->getVictim();
|
||||
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_CATACLYSMIC_BOLT);
|
||||
if (target)
|
||||
DoCast(target, SPELL_CATACLYSMIC_BOLT);
|
||||
CataclysmicBolt_Timer = 10000;
|
||||
} else CataclysmicBolt_Timer -= diff;
|
||||
|
||||
@@ -381,11 +381,11 @@ public:
|
||||
//Only if not incombat check if the event is started
|
||||
if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
|
||||
{
|
||||
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
|
||||
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
|
||||
|
||||
if (pTarget)
|
||||
if (target)
|
||||
{
|
||||
AttackStart(pTarget);
|
||||
AttackStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,10 +444,10 @@ public:
|
||||
}
|
||||
//DoCast(me, spell_id, true);
|
||||
Creature* Pet = DoSpawnCreature(pet_id, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (Pet && pTarget)
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (Pet && target)
|
||||
{
|
||||
Pet->AI()->AttackStart(pTarget);
|
||||
Pet->AI()->AttackStart(target);
|
||||
SummonedPet = Pet->GetGUID();
|
||||
}
|
||||
} else Pet_Timer -= diff;
|
||||
@@ -522,11 +522,11 @@ public:
|
||||
//Only if not incombat check if the event is started
|
||||
if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
|
||||
{
|
||||
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
|
||||
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
|
||||
|
||||
if (pTarget)
|
||||
if (target)
|
||||
{
|
||||
AttackStart(pTarget);
|
||||
AttackStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -648,11 +648,11 @@ public:
|
||||
//Only if not incombat check if the event is started
|
||||
if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT))
|
||||
{
|
||||
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
|
||||
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER));
|
||||
|
||||
if (pTarget)
|
||||
if (target)
|
||||
{
|
||||
AttackStart(pTarget);
|
||||
AttackStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -695,10 +695,10 @@ public:
|
||||
Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Cyclone->setFaction(me->getFaction());
|
||||
Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true);
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
{
|
||||
Cyclone->AI()->AttackStart(pTarget);
|
||||
Cyclone->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
} else Cyclone_Timer -= diff;
|
||||
|
||||
+6
-6
@@ -262,9 +262,9 @@ public:
|
||||
//VileSludge_Timer
|
||||
if (VileSludge_Timer <= diff)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_VILE_SLUDGE);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
DoCast(target, SPELL_VILE_SLUDGE);
|
||||
|
||||
VileSludge_Timer = 15000;
|
||||
} else VileSludge_Timer -= diff;
|
||||
@@ -329,9 +329,9 @@ public:
|
||||
//WaterTomb_Timer
|
||||
if (WaterTomb_Timer <= diff)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_WATER_TOMB);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (target)
|
||||
DoCast(target, SPELL_WATER_TOMB);
|
||||
|
||||
WaterTomb_Timer = 7000;
|
||||
} else WaterTomb_Timer -= diff;
|
||||
|
||||
@@ -363,12 +363,12 @@ public:
|
||||
{
|
||||
//Static Charge
|
||||
//Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic.
|
||||
Unit* pTarget = NULL;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true);
|
||||
Unit* target = NULL;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true);
|
||||
|
||||
if (pTarget && !pTarget->HasAura(SPELL_STATIC_CHARGE_TRIGGER))
|
||||
if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER))
|
||||
//cast Static Charge every 2 seconds for 20 seconds
|
||||
DoCast(pTarget, SPELL_STATIC_CHARGE_TRIGGER);
|
||||
DoCast(target, SPELL_STATIC_CHARGE_TRIGGER);
|
||||
|
||||
StaticCharge_Timer = 10000+rand()%20000; //blizzlike
|
||||
} else StaticCharge_Timer -= diff;
|
||||
@@ -425,10 +425,10 @@ public:
|
||||
|
||||
if (Sporebat)
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
Sporebat->AI()->AttackStart(pTarget);
|
||||
Unit* target = NULL;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
Sporebat->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
//summon sporebats faster and faster
|
||||
@@ -450,13 +450,13 @@ public:
|
||||
if (Check_Timer <= diff)
|
||||
{
|
||||
bool InMeleeRange = false;
|
||||
Unit* pTarget;
|
||||
Unit* target;
|
||||
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
//if in melee range
|
||||
if (pTarget && pTarget->IsWithinDistInMap(me, 5))
|
||||
if (target && target->IsWithinDistInMap(me, 5))
|
||||
{
|
||||
InMeleeRange = true;
|
||||
break;
|
||||
@@ -478,13 +478,13 @@ public:
|
||||
{
|
||||
//Forked Lightning
|
||||
//Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage.
|
||||
Unit* pTarget = NULL;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target = NULL;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
if (!pTarget)
|
||||
pTarget = me->getVictim();
|
||||
if (!target)
|
||||
target = me->getVictim();
|
||||
|
||||
DoCast(pTarget, SPELL_FORKED_LIGHTNING);
|
||||
DoCast(target, SPELL_FORKED_LIGHTNING);
|
||||
|
||||
ForkedLightning_Timer = 2000+rand()%6000; //blizzlike
|
||||
} else ForkedLightning_Timer -= diff;
|
||||
@@ -519,10 +519,10 @@ public:
|
||||
CoilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
if (CoilfangElite)
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
CoilfangElite->AI()->AttackStart(pTarget);
|
||||
Unit* target = NULL;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
CoilfangElite->AI()->AttackStart(target);
|
||||
else if (me->getVictim())
|
||||
CoilfangElite->AI()->AttackStart(me->getVictim());
|
||||
}
|
||||
@@ -537,10 +537,10 @@ public:
|
||||
CoilfangStrider = me->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
if (CoilfangStrider)
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
CoilfangStrider->AI()->AttackStart(pTarget);
|
||||
Unit* target = NULL;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
CoilfangStrider->AI()->AttackStart(target);
|
||||
else if (me->getVictim())
|
||||
CoilfangStrider->AI()->AttackStart(me->getVictim());
|
||||
}
|
||||
@@ -727,11 +727,11 @@ public:
|
||||
//PoisonBolt_Timer
|
||||
if (PoisonBolt_Timer <= diff)
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target = NULL;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
if (pTarget && pTarget->IsWithinDistInMap(me, 30))
|
||||
DoCast(pTarget, SPELL_POISON_BOLT);
|
||||
if (target && target->IsWithinDistInMap(me, 30))
|
||||
DoCast(target, SPELL_POISON_BOLT);
|
||||
|
||||
PoisonBolt_Timer = 5000+rand()%5000;
|
||||
} else PoisonBolt_Timer -= diff;
|
||||
@@ -819,11 +819,11 @@ public:
|
||||
//toxic spores
|
||||
if (bolt_timer <= diff)
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
Unit* target = NULL;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
{
|
||||
Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
|
||||
Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
|
||||
if (trig)
|
||||
{
|
||||
trig->setFaction(14);
|
||||
|
||||
+7
-7
@@ -356,11 +356,11 @@ public:
|
||||
Creature* pUnit = Unit::GetCreature((*me), InnderDemon[i]);
|
||||
if (pUnit && pUnit->isAlive())
|
||||
{
|
||||
Unit* pUnit_pTarget = Unit::GetUnit(*pUnit, CAST_AI(mob_inner_demon::mob_inner_demonAI, pUnit->AI())->victimGUID);
|
||||
if (pUnit_pTarget && pUnit_pTarget->isAlive())
|
||||
Unit* unit_target = Unit::GetUnit(*pUnit, CAST_AI(mob_inner_demon::mob_inner_demonAI, pUnit->AI())->victimGUID);
|
||||
if (unit_target && unit_target->isAlive())
|
||||
{
|
||||
pUnit->CastSpell(pUnit_pTarget, SPELL_CONSUMING_MADNESS, true);
|
||||
DoModifyThreatPercent(pUnit_pTarget, -100);
|
||||
pUnit->CastSpell(unit_target, SPELL_CONSUMING_MADNESS, true);
|
||||
DoModifyThreatPercent(unit_target, -100);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -759,10 +759,10 @@ public:
|
||||
|
||||
if (Mindblast_Timer <= diff)
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target = NULL;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
if (pTarget)DoCast(pTarget, SPELL_MINDBLAST);
|
||||
if (target)DoCast(target, SPELL_MINDBLAST);
|
||||
|
||||
Mindblast_Timer = 10000 + rand()%5000;
|
||||
} else Mindblast_Timer -= diff;
|
||||
|
||||
@@ -299,11 +299,11 @@ public:
|
||||
|
||||
if (GeyserTimer <= diff)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (!pTarget && me->getVictim())
|
||||
pTarget = me->getVictim();
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_GEYSER, true);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
if (!target && me->getVictim())
|
||||
target = me->getVictim();
|
||||
if (target)
|
||||
DoCast(target, SPELL_GEYSER, true);
|
||||
GeyserTimer = rand()%5000 + 15000;
|
||||
} else GeyserTimer -= diff;
|
||||
|
||||
@@ -311,11 +311,11 @@ public:
|
||||
{
|
||||
if (WaterboltTimer <= diff)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (!pTarget && me->getVictim())
|
||||
pTarget = me->getVictim();
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_WATERBOLT, true);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (!target && me->getVictim())
|
||||
target = me->getVictim();
|
||||
if (target)
|
||||
DoCast(target, SPELL_WATERBOLT, true);
|
||||
WaterboltTimer = 3000;
|
||||
} else WaterboltTimer -= diff;
|
||||
}
|
||||
@@ -453,11 +453,11 @@ public:
|
||||
|
||||
if (ShootBowTimer <= diff)
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target = NULL;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
int bp0 = 1100;
|
||||
if (pTarget)
|
||||
me->CastCustomSpell(pTarget, SPELL_SHOOT, &bp0, NULL, NULL, true);
|
||||
if (target)
|
||||
me->CastCustomSpell(target, SPELL_SHOOT, &bp0, NULL, NULL, true);
|
||||
ShootBowTimer = 4000+rand()%5000;
|
||||
MultiShotTimer += 1500;//add global cooldown
|
||||
} else ShootBowTimer -= diff;
|
||||
|
||||
+10
-10
@@ -187,10 +187,10 @@ public:
|
||||
|
||||
for (uint8 i = 0; i < 10; ++i)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Creature* Murloc = me->SummonCreature(NPC_TIDEWALKER_LURKER, MurlocCords[i][0], MurlocCords[i][1], MurlocCords[i][2], MurlocCords[i][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||
if (pTarget && Murloc)
|
||||
Murloc->AI()->AttackStart(pTarget);
|
||||
if (target && Murloc)
|
||||
Murloc->AI()->AttackStart(target);
|
||||
}
|
||||
DoScriptText(EMOTE_EARTHQUAKE, me);
|
||||
Earthquake = false;
|
||||
@@ -211,7 +211,7 @@ public:
|
||||
if (WateryGrave_Timer <= diff)
|
||||
{
|
||||
//Teleport 4 players under the waterfalls
|
||||
Unit* pTarget;
|
||||
Unit* target;
|
||||
std::set<uint64> list;
|
||||
std::set<uint64>::const_iterator itr;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
@@ -219,18 +219,18 @@ public:
|
||||
counter = 0;
|
||||
do
|
||||
{
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only
|
||||
if (counter < Playercount)
|
||||
break;
|
||||
if (pTarget)
|
||||
itr = list.find(pTarget->GetGUID());
|
||||
if (target)
|
||||
itr = list.find(target->GetGUID());
|
||||
++counter;
|
||||
} while (itr != list.end());
|
||||
|
||||
if (pTarget)
|
||||
if (target)
|
||||
{
|
||||
list.insert(pTarget->GetGUID());
|
||||
ApplyWateryGrave(pTarget, i);
|
||||
list.insert(target->GetGUID());
|
||||
ApplyWateryGrave(target, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -108,13 +108,13 @@ public:
|
||||
//LightningCloud_Timer
|
||||
if (LightningCloud_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_LIGHTNING_CLOUD);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_LIGHTNING_CLOUD);
|
||||
|
||||
//cast twice in Heroic mode
|
||||
if (IsHeroic())
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_LIGHTNING_CLOUD);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_LIGHTNING_CLOUD);
|
||||
|
||||
LightningCloud_Timer = 15000+rand()%10000;
|
||||
} else LightningCloud_Timer -=diff;
|
||||
@@ -122,21 +122,21 @@ public:
|
||||
//LungBurst_Timer
|
||||
if (LungBurst_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_LUNG_BURST);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_LUNG_BURST);
|
||||
LungBurst_Timer = 7000+rand()%5000;
|
||||
} else LungBurst_Timer -=diff;
|
||||
|
||||
//EnvelopingWinds_Timer
|
||||
if (EnvelopingWinds_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_ENVELOPING_WINDS);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_ENVELOPING_WINDS);
|
||||
|
||||
//cast twice in Heroic mode
|
||||
if (IsHeroic())
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_ENVELOPING_WINDS);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_ENVELOPING_WINDS);
|
||||
EnvelopingWinds_Timer = 10000+rand()%5000;
|
||||
} else EnvelopingWinds_Timer -=diff;
|
||||
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@
|
||||
/* ScriptData
|
||||
SDName: Boss_Mekgineer_Steamrigger
|
||||
SD%Complete: 60
|
||||
SDComment: Mechanics' interrrupt heal doesn't work very well, also a proper movement needs to be implemented -> summon further away and move towards pTarget to repair.
|
||||
SDComment: Mechanics' interrrupt heal doesn't work very well, also a proper movement needs to be implemented -> summon further away and move towards target to repair.
|
||||
SDCategory: Coilfang Resevoir, The Steamvault
|
||||
EndScriptData */
|
||||
|
||||
@@ -137,8 +137,8 @@ public:
|
||||
|
||||
if (Saw_Blade_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(pTarget, SPELL_SAW_BLADE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(target, SPELL_SAW_BLADE);
|
||||
else
|
||||
DoCast(me->getVictim(), SPELL_SAW_BLADE);
|
||||
|
||||
|
||||
@@ -191,8 +191,8 @@ public:
|
||||
//Impale_Timer
|
||||
if (Impale_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_IMPALE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_IMPALE);
|
||||
|
||||
Impale_Timer = 7500+rand()%5000;
|
||||
} else Impale_Timer -= diff;
|
||||
|
||||
@@ -75,8 +75,8 @@ public:
|
||||
|
||||
if (Mushroom_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->SummonCreature(17990, pTarget->GetPositionX()+(rand()%8), pTarget->GetPositionY()+(rand()%8), pTarget->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->SummonCreature(17990, target->GetPositionX()+(rand()%8), target->GetPositionY()+(rand()%8), target->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
|
||||
else
|
||||
me->SummonCreature(17990, me->GetPositionX()+(rand()%8), me->GetPositionY()+(rand()%8), me->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000);
|
||||
|
||||
@@ -85,8 +85,8 @@ public:
|
||||
|
||||
if (AcidGeyser_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_ACID_GEYSER);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_ACID_GEYSER);
|
||||
AcidGeyser_Timer = 10000+rand()%7500;
|
||||
} else AcidGeyser_Timer -= diff;
|
||||
|
||||
|
||||
@@ -80,8 +80,8 @@ public:
|
||||
if (summon && summon->GetEntry() == ENTRY_SPORE_STRIDER)
|
||||
{
|
||||
Striders.push_back(summon->GetGUID());
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
summon->AI()->AttackStart(pTarget);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
summon->AI()->AttackStart(target);
|
||||
else
|
||||
if (me->getVictim())
|
||||
summon->AI()->AttackStart(me->getVictim());
|
||||
@@ -125,21 +125,21 @@ public:
|
||||
{
|
||||
if (LevitatedTarget_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = Unit::GetUnit(*me, LevitatedTarget))
|
||||
if (Unit* target = Unit::GetUnit(*me, LevitatedTarget))
|
||||
{
|
||||
if (!pTarget->HasAura(SPELL_LEVITATE))
|
||||
if (!target->HasAura(SPELL_LEVITATE))
|
||||
{
|
||||
LevitatedTarget = 0;
|
||||
return;
|
||||
}
|
||||
if (InAir)
|
||||
{
|
||||
pTarget->AddAura(SPELL_SUSPENSION, pTarget);
|
||||
target->AddAura(SPELL_SUSPENSION, target);
|
||||
LevitatedTarget = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true);
|
||||
target->CastSpell(target, SPELL_MAGNETIC_PULL, true);
|
||||
InAir = true;
|
||||
LevitatedTarget_Timer = 1500;
|
||||
}
|
||||
@@ -150,10 +150,10 @@ public:
|
||||
}
|
||||
if (Levitate_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
{
|
||||
DoCast(pTarget, SPELL_LEVITATE);
|
||||
LevitatedTarget = pTarget->GetGUID();
|
||||
DoCast(target, SPELL_LEVITATE);
|
||||
LevitatedTarget = target->GetGUID();
|
||||
LevitatedTarget_Timer = 2000;
|
||||
InAir = false;
|
||||
}
|
||||
@@ -163,16 +163,16 @@ public:
|
||||
// Chain Lightning
|
||||
if (ChainLightning_Timer <= 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);
|
||||
ChainLightning_Timer = 7000;
|
||||
} else ChainLightning_Timer -= diff;
|
||||
|
||||
// Static Charge
|
||||
if (StaticCharge_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true))
|
||||
DoCast(pTarget, SPELL_STATIC_CHARGE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true))
|
||||
DoCast(target, SPELL_STATIC_CHARGE);
|
||||
StaticCharge_Timer = 10000;
|
||||
} else StaticCharge_Timer -= diff;
|
||||
|
||||
|
||||
@@ -120,18 +120,18 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell)
|
||||
void SpellHitTarget(Unit* target, const SpellEntry* pSpell)
|
||||
{
|
||||
//This to emulate effect1 (77) of SPELL_GROUND_SLAM, knock back to any direction
|
||||
//It's initially wrong, since this will cause fall damage, which is by comments, not intended.
|
||||
if (pSpell->Id == SPELL_GROUND_SLAM)
|
||||
{
|
||||
if (pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
switch (urand(0, 1))
|
||||
{
|
||||
case 0: pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true, NULL, NULL, me->GetGUID()); break;
|
||||
case 1: pTarget->CastSpell(pTarget, SPELL_KNOCK_BACK, true, NULL, NULL, me->GetGUID()); break;
|
||||
case 0: target->CastSpell(target, SPELL_MAGNETIC_PULL, true, NULL, NULL, me->GetGUID()); break;
|
||||
case 1: target->CastSpell(target, SPELL_KNOCK_BACK, true, NULL, NULL, me->GetGUID()); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,10 +140,10 @@ public:
|
||||
if (pSpell->Id == SPELL_SHATTER)
|
||||
{
|
||||
//this spell must have custom handling in the core, dealing damage based on distance
|
||||
pTarget->CastSpell(pTarget, SPELL_SHATTER_EFFECT, true);
|
||||
target->CastSpell(target, SPELL_SHATTER_EFFECT, true);
|
||||
|
||||
if (pTarget->HasAura(SPELL_STONED))
|
||||
pTarget->RemoveAurasDueToSpell(SPELL_STONED);
|
||||
if (target->HasAura(SPELL_STONED))
|
||||
target->RemoveAurasDueToSpell(SPELL_STONED);
|
||||
|
||||
//clear this, if we are still performing
|
||||
if (m_bPerformingGroundSlam)
|
||||
@@ -197,10 +197,10 @@ public:
|
||||
// Hurtful Strike
|
||||
if (m_uiHurtfulStrike_Timer <= uiDiff)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
|
||||
|
||||
if (pTarget && me->IsWithinMeleeRange(me->getVictim()))
|
||||
DoCast(pTarget, SPELL_HURTFUL_STRIKE);
|
||||
if (target && me->IsWithinMeleeRange(me->getVictim()))
|
||||
DoCast(target, SPELL_HURTFUL_STRIKE);
|
||||
else
|
||||
DoCast(me->getVictim(), SPELL_HURTFUL_STRIKE);
|
||||
|
||||
@@ -221,8 +221,8 @@ public:
|
||||
// Cave In
|
||||
if (m_uiCaveIn_Timer <= uiDiff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_CAVE_IN);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_CAVE_IN);
|
||||
|
||||
if (m_uiCaveIn_StaticTimer >= 4000)
|
||||
m_uiCaveIn_StaticTimer -= 2000;
|
||||
|
||||
@@ -223,11 +223,11 @@ public:
|
||||
//Only if not incombat check if the event is started
|
||||
if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
|
||||
{
|
||||
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
|
||||
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
|
||||
|
||||
if (pTarget)
|
||||
if (target)
|
||||
{
|
||||
AttackStart(pTarget);
|
||||
AttackStart(target);
|
||||
GetCouncil();
|
||||
}
|
||||
}
|
||||
@@ -280,12 +280,12 @@ public:
|
||||
//Charging_Timer
|
||||
if (Charging_Timer <= diff)
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
Unit* target = NULL;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
{
|
||||
AttackStart(pTarget);
|
||||
DoCast(pTarget, SPELL_BERSERKER_C);
|
||||
AttackStart(target);
|
||||
DoCast(target, SPELL_BERSERKER_C);
|
||||
}
|
||||
Charging_Timer = 20000;
|
||||
} else Charging_Timer -= diff;
|
||||
@@ -383,11 +383,11 @@ public:
|
||||
//Only if not incombat check if the event is started
|
||||
if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
|
||||
{
|
||||
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
|
||||
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
|
||||
|
||||
if (pTarget)
|
||||
if (target)
|
||||
{
|
||||
AttackStart(pTarget);
|
||||
AttackStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,10 +419,10 @@ public:
|
||||
//DeathCoil Timer /need correct timer
|
||||
if (DeathCoil_Timer <= diff)
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_DEATH_COIL);
|
||||
Unit* target = NULL;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
DoCast(target, SPELL_DEATH_COIL);
|
||||
DeathCoil_Timer = 20000;
|
||||
} else DeathCoil_Timer -= diff;
|
||||
|
||||
@@ -498,11 +498,11 @@ public:
|
||||
//Only if not incombat check if the event is started
|
||||
if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
|
||||
{
|
||||
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
|
||||
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
|
||||
|
||||
if (pTarget)
|
||||
if (target)
|
||||
{
|
||||
AttackStart(pTarget);
|
||||
AttackStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,9 +520,9 @@ public:
|
||||
//GreaterPolymorph_Timer
|
||||
if (GreaterPolymorph_Timer <= diff)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_GREATER_POLYMORPH);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
DoCast(target, SPELL_GREATER_POLYMORPH);
|
||||
|
||||
GreaterPolymorph_Timer = 15000 + rand()%5000;
|
||||
} else GreaterPolymorph_Timer -= diff;
|
||||
@@ -618,11 +618,11 @@ public:
|
||||
//Only if not incombat check if the event is started
|
||||
if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
|
||||
{
|
||||
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
|
||||
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
|
||||
|
||||
if (pTarget)
|
||||
if (target)
|
||||
{
|
||||
AttackStart(pTarget);
|
||||
AttackStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -728,11 +728,11 @@ public:
|
||||
//Only if not incombat check if the event is started
|
||||
if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT))
|
||||
{
|
||||
Unit* pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
|
||||
Unit* target = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK));
|
||||
|
||||
if (pTarget)
|
||||
if (target)
|
||||
{
|
||||
AttackStart(pTarget);
|
||||
AttackStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -765,22 +765,22 @@ public:
|
||||
//BlastWave_Timer
|
||||
if (BlastWave_Timer <= 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());
|
||||
target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
//15 yard radius minimum
|
||||
if (pTarget && pTarget->IsWithinDist(me, 15, false))
|
||||
target_list.push_back(pTarget);
|
||||
pTarget = NULL;
|
||||
if (target && target->IsWithinDist(me, 15, 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());
|
||||
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
DoCast(pTarget, SPELL_BLAST_WAVE);
|
||||
DoCast(target, SPELL_BLAST_WAVE);
|
||||
BlastWave_Timer = 60000;
|
||||
} else BlastWave_Timer -= diff;
|
||||
}
|
||||
|
||||
+2
-2
@@ -352,8 +352,8 @@ class mob_shadowmoon_channeler : public CreatureScript
|
||||
|
||||
if (MarkOfShadow_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_MARK_OF_SHADOW);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_MARK_OF_SHADOW);
|
||||
MarkOfShadow_Timer = 15000+rand()%5000;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -122,8 +122,8 @@ class boss_the_maker : public CreatureScript
|
||||
|
||||
if (ExplodingBreaker_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_EXPLODING_BREAKER);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_EXPLODING_BREAKER);
|
||||
ExplodingBreaker_Timer = 4000+rand()%8000;
|
||||
}
|
||||
else
|
||||
@@ -132,10 +132,10 @@ class boss_the_maker : public CreatureScript
|
||||
/* // Disabled until Core Support for mind control
|
||||
if (domination_timer_timer <= diff)
|
||||
{
|
||||
Unit* pTarget;
|
||||
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
DoCast(pTarget, SPELL_DOMINATION);
|
||||
DoCast(target, SPELL_DOMINATION);
|
||||
|
||||
domination_timer = 120000;
|
||||
} else domination_timer -=diff;
|
||||
|
||||
+6
-6
@@ -192,9 +192,9 @@ class boss_omor_the_unscarred : public CreatureScript
|
||||
{
|
||||
DoScriptText(SAY_CURSE, me);
|
||||
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
DoCast(pTarget, SPELL_TREACHEROUS_AURA);
|
||||
DoCast(target, SPELL_TREACHEROUS_AURA);
|
||||
Aura_Timer = 8000+rand()%8000;
|
||||
}
|
||||
}
|
||||
@@ -203,12 +203,12 @@ class boss_omor_the_unscarred : public CreatureScript
|
||||
|
||||
if (Shadowbolt_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
if (pTarget)
|
||||
pTarget = me->getVictim();
|
||||
if (target)
|
||||
target = me->getVictim();
|
||||
|
||||
DoCast(pTarget, SPELL_SHADOW_BOLT);
|
||||
DoCast(target, SPELL_SHADOW_BOLT);
|
||||
Shadowbolt_Timer = 4000+rand()%2500;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -117,10 +117,10 @@ class boss_nazan : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* pTarget, const SpellEntry* entry)
|
||||
void SpellHitTarget(Unit* target, const SpellEntry* entry)
|
||||
{
|
||||
if (pTarget && entry->Id == uint32(SPELL_FIREBALL))
|
||||
me->SummonCreature(ENTRY_LIQUID_FIRE, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), pTarget->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 30000);
|
||||
if (target && entry->Id == uint32(SPELL_FIREBALL))
|
||||
me->SummonCreature(ENTRY_LIQUID_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 30000);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@
|
||||
/* ScriptData
|
||||
SDName: Boss_Watchkeeper_Gargolmar
|
||||
SD%Complete: 80
|
||||
SDComment: Missing adds to heal him. Surge should be used on pTarget furthest away, not random.
|
||||
SDComment: Missing adds to heal him. Surge should be used on target furthest away, not random.
|
||||
SDCategory: Hellfire Citadel, Hellfire Ramparts
|
||||
EndScriptData */
|
||||
|
||||
@@ -131,8 +131,8 @@ class boss_watchkeeper_gargolmar : public CreatureScript
|
||||
{
|
||||
DoScriptText(SAY_SURGE, me);
|
||||
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_SURGE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SURGE);
|
||||
|
||||
Surge_Timer = 5000+rand()%8000;
|
||||
}
|
||||
|
||||
@@ -426,10 +426,10 @@ class boss_magtheridon : public CreatureScript
|
||||
|
||||
if (Blaze_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
float x, y, z;
|
||||
pTarget->GetPosition(x, y, z);
|
||||
target->GetPosition(x, y, z);
|
||||
Creature* summon = me->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (summon)
|
||||
{
|
||||
@@ -460,10 +460,10 @@ class boss_magtheridon : public CreatureScript
|
||||
{
|
||||
if (Debris_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
float x, y, z;
|
||||
pTarget->GetPosition(x, y, z);
|
||||
target->GetPosition(x, y, z);
|
||||
Creature* summon = me->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (summon)
|
||||
CAST_AI(mob_abyssal::mob_abyssalAI, summon->AI())->SetTrigger(1);
|
||||
@@ -577,8 +577,8 @@ class mob_hellfire_channeler : public CreatureScript
|
||||
|
||||
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 = 25000 + rand()%15000;
|
||||
}
|
||||
else
|
||||
@@ -586,8 +586,8 @@ class mob_hellfire_channeler : public CreatureScript
|
||||
|
||||
if (Infernal_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_BURNING_ABYSSAL, true);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_BURNING_ABYSSAL, true);
|
||||
Infernal_Timer = 30000 + rand()%10000;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -277,8 +277,8 @@ class boss_grand_warlock_nethekurse : public CreatureScript
|
||||
{
|
||||
if (ShadowFissure_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_SHADOW_FISSURE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SHADOW_FISSURE);
|
||||
ShadowFissure_Timer = urand(7500, 15000);
|
||||
}
|
||||
else
|
||||
@@ -286,8 +286,8 @@ class boss_grand_warlock_nethekurse : public CreatureScript
|
||||
|
||||
if (DeathCoil_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_DEATH_COIL);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_DEATH_COIL);
|
||||
DeathCoil_Timer = urand(15000, 20000);
|
||||
}
|
||||
else
|
||||
|
||||
+2
-2
@@ -383,11 +383,11 @@ class boss_warbringer_omrogg : public CreatureScript
|
||||
|
||||
if (ResetThreat_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
DoYellForThreat();
|
||||
DoResetThreat();
|
||||
me->AddThreat(pTarget, 0.0f);
|
||||
me->AddThreat(target, 0.0f);
|
||||
}
|
||||
ResetThreat_Timer = 25000+rand()%15000;
|
||||
}
|
||||
|
||||
@@ -154,8 +154,8 @@ class boss_alar : public CreatureScript
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
if (summon->GetEntry() == CREATURE_EMBER_OF_ALAR)
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
summon->AI()->AttackStart(pTarget);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
summon->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
@@ -283,15 +283,15 @@ class boss_alar : public CreatureScript
|
||||
WaitTimer = 4000;
|
||||
return;
|
||||
case WE_DIVE:
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL);
|
||||
DoCast(pTarget, SPELL_DIVE_BOMB, true);
|
||||
DoCast(target, SPELL_DIVE_BOMB, true);
|
||||
float dist = 3.0f;
|
||||
if (me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f))
|
||||
if (me->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f))
|
||||
dist = 5.0f;
|
||||
WaitTimer = 1000 + uint32(floor(dist / 80 * 1000.0f));
|
||||
me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f);
|
||||
me->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f);
|
||||
me->StopMoving();
|
||||
WaitEvent = WE_LAND;
|
||||
}
|
||||
@@ -371,9 +371,9 @@ class boss_alar : public CreatureScript
|
||||
{
|
||||
if (Charge_Timer <= diff)
|
||||
{
|
||||
Unit* pTarget= SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_CHARGE);
|
||||
Unit* target= SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
|
||||
if (target)
|
||||
DoCast(target, SPELL_CHARGE);
|
||||
Charge_Timer = 30000;
|
||||
}
|
||||
else
|
||||
@@ -403,9 +403,9 @@ class boss_alar : public CreatureScript
|
||||
|
||||
if (FlamePatch_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
Creature* Summoned = me->SummonCreature(CREATURE_FLAME_PATCH_ALAR, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000);
|
||||
Creature* Summoned = me->SummonCreature(CREATURE_FLAME_PATCH_ALAR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000);
|
||||
if (Summoned)
|
||||
{
|
||||
Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -436,10 +436,10 @@ class boss_alar : public CreatureScript
|
||||
}
|
||||
else
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
pTarget = me->SelectNearestTargetInAttackDistance(5);
|
||||
if (pTarget)
|
||||
me->AI()->AttackStart(pTarget);
|
||||
Unit* target = NULL;
|
||||
target = me->SelectNearestTargetInAttackDistance(5);
|
||||
if (target)
|
||||
me->AI()->AttackStart(target);
|
||||
else
|
||||
{
|
||||
DoCast(me, SPELL_FLAME_BUFFET, true);
|
||||
|
||||
@@ -171,8 +171,8 @@ class boss_high_astromancer_solarian : public CreatureScript
|
||||
Creature* Summoned = me->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
if (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);
|
||||
|
||||
Summons.Summon(Summoned);
|
||||
}
|
||||
@@ -227,8 +227,8 @@ class boss_high_astromancer_solarian : public CreatureScript
|
||||
if (Wrath_Timer <= diff)
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
|
||||
DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER, true);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
|
||||
DoCast(target, SPELL_WRATH_OF_THE_ASTROMANCER, true);
|
||||
Wrath_Timer = 20000+rand()%5000;
|
||||
}
|
||||
else
|
||||
@@ -243,11 +243,11 @@ class boss_high_astromancer_solarian : public CreatureScript
|
||||
}
|
||||
else
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (!me->HasInArc(2.5f, pTarget))
|
||||
pTarget = me->getVictim();
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_ARCANE_MISSILES);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (!me->HasInArc(2.5f, target))
|
||||
target = me->getVictim();
|
||||
if (target)
|
||||
DoCast(target, SPELL_ARCANE_MISSILES);
|
||||
}
|
||||
ArcaneMissiles_Timer = 3000;
|
||||
}
|
||||
@@ -258,11 +258,11 @@ class boss_high_astromancer_solarian : public CreatureScript
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
//Target the tank ?
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
{
|
||||
if (pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER);
|
||||
DoCast(target, SPELL_WRATH_OF_THE_ASTROMANCER);
|
||||
m_uiWrathOfTheAstromancer_Timer = 25000;
|
||||
}
|
||||
else
|
||||
@@ -446,21 +446,21 @@ class mob_solarium_priest : public CreatureScript
|
||||
|
||||
if (healTimer <= diff)
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
Unit* target = NULL;
|
||||
switch (urand(0, 1))
|
||||
{
|
||||
case 0:
|
||||
if (pInstance)
|
||||
pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_ASTROMANCER));
|
||||
target = Unit::GetUnit((*me), pInstance->GetData64(DATA_ASTROMANCER));
|
||||
break;
|
||||
case 1:
|
||||
pTarget = me;
|
||||
target = me;
|
||||
break;
|
||||
}
|
||||
|
||||
if (pTarget)
|
||||
if (target)
|
||||
{
|
||||
DoCast(pTarget, SPELL_SOLARIUM_GREAT_HEAL);
|
||||
DoCast(target, SPELL_SOLARIUM_GREAT_HEAL);
|
||||
healTimer = 9000;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,8 +376,8 @@ class boss_kaelthas : public CreatureScript
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
AttackStart(pTarget);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
AttackStart(target);
|
||||
|
||||
}
|
||||
else
|
||||
@@ -439,8 +439,8 @@ class boss_kaelthas : public CreatureScript
|
||||
// if not phoenix, then it's one of the 7 weapons
|
||||
if (pSummoned->GetEntry() != NPC_PHOENIX)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
pSummoned->AI()->AttackStart(pTarget);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
pSummoned->AI()->AttackStart(target);
|
||||
|
||||
summons.Summon(pSummoned);
|
||||
}
|
||||
@@ -474,7 +474,7 @@ class boss_kaelthas : public CreatureScript
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
Unit* target = NULL;
|
||||
Creature* Advisor = NULL;
|
||||
|
||||
//Subphase switch
|
||||
@@ -503,9 +503,9 @@ class boss_kaelthas : public CreatureScript
|
||||
Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
Advisor->setFaction(me->getFaction());
|
||||
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
Advisor->AI()->AttackStart(pTarget);
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
Advisor->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
++PhaseSubphase;
|
||||
@@ -537,9 +537,9 @@ class boss_kaelthas : public CreatureScript
|
||||
Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
Advisor->setFaction(me->getFaction());
|
||||
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
Advisor->AI()->AttackStart(pTarget);
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
Advisor->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
++PhaseSubphase;
|
||||
@@ -571,9 +571,9 @@ class boss_kaelthas : public CreatureScript
|
||||
Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
Advisor->setFaction(me->getFaction());
|
||||
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
Advisor->AI()->AttackStart(pTarget);
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
Advisor->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
++PhaseSubphase;
|
||||
@@ -605,9 +605,9 @@ class boss_kaelthas : public CreatureScript
|
||||
Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
Advisor->setFaction(me->getFaction());
|
||||
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
Advisor->AI()->AttackStart(pTarget);
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
Advisor->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
Phase_Timer = 3000;
|
||||
@@ -683,7 +683,7 @@ class boss_kaelthas : public CreatureScript
|
||||
if (PhaseSubphase == 0)
|
||||
{
|
||||
//Respawn advisors
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
Creature* Advisor;
|
||||
for (uint8 i = 0; i < MAX_ADVISORS; ++i)
|
||||
@@ -693,7 +693,7 @@ class boss_kaelthas : public CreatureScript
|
||||
if (!Advisor)
|
||||
sLog->outError("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i);
|
||||
else
|
||||
CAST_AI(advisorbase_ai, Advisor->AI())->Revive(pTarget);
|
||||
CAST_AI(advisorbase_ai, Advisor->AI())->Revive(target);
|
||||
}
|
||||
|
||||
PhaseSubphase = 1;
|
||||
@@ -714,8 +714,8 @@ class boss_kaelthas : public CreatureScript
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
AttackStart(pTarget);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
AttackStart(target);
|
||||
|
||||
Phase_Timer = 30000;
|
||||
}
|
||||
@@ -1064,11 +1064,11 @@ class boss_thaladred_the_darkener : public CreatureScript
|
||||
//Gaze_Timer
|
||||
if (Gaze_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
DoResetThreat();
|
||||
me->AddThreat(pTarget, 5000000.0f);
|
||||
DoScriptText(EMOTE_THALADRED_GAZE, me, pTarget);
|
||||
me->AddThreat(target, 5000000.0f);
|
||||
DoScriptText(EMOTE_THALADRED_GAZE, me, target);
|
||||
Gaze_Timer = 8500;
|
||||
}
|
||||
}
|
||||
@@ -1266,11 +1266,11 @@ class boss_grand_astromancer_capernian : public CreatureScript
|
||||
//Conflagration_Timer
|
||||
if (Conflagration_Timer <= diff)
|
||||
{
|
||||
Unit* pTarget = NULL;
|
||||
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target = NULL;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
if (pTarget && me->IsWithinDistInMap(pTarget, 30))
|
||||
DoCast(pTarget, SPELL_CONFLAGRATION);
|
||||
if (target && me->IsWithinDistInMap(target, 30))
|
||||
DoCast(target, SPELL_CONFLAGRATION);
|
||||
else
|
||||
DoCast(me->getVictim(), SPELL_CONFLAGRATION);
|
||||
|
||||
@@ -1283,7 +1283,7 @@ class boss_grand_astromancer_capernian : public CreatureScript
|
||||
if (ArcaneExplosion_Timer <= diff)
|
||||
{
|
||||
bool InMeleeRange = false;
|
||||
Unit* pTarget = NULL;
|
||||
Unit* target = NULL;
|
||||
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i!= m_threatlist.end(); ++i)
|
||||
{
|
||||
@@ -1292,13 +1292,13 @@ class boss_grand_astromancer_capernian : public CreatureScript
|
||||
if (pUnit && pUnit->IsWithinDistInMap(me, 5))
|
||||
{
|
||||
InMeleeRange = true;
|
||||
pTarget = pUnit;
|
||||
target = pUnit;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (InMeleeRange)
|
||||
DoCast(pTarget, SPELL_ARCANE_EXPLOSION);
|
||||
DoCast(target, SPELL_ARCANE_EXPLOSION);
|
||||
|
||||
ArcaneExplosion_Timer = 4000+rand()%2000;
|
||||
}
|
||||
@@ -1380,8 +1380,8 @@ class boss_master_engineer_telonicus : public CreatureScript
|
||||
//RemoteToy_Timer
|
||||
if (RemoteToy_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_REMOTE_TOY);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_REMOTE_TOY);
|
||||
|
||||
RemoteToy_Timer = 10000+rand()%5000;
|
||||
}
|
||||
|
||||
@@ -118,27 +118,27 @@ class boss_void_reaver : public CreatureScript
|
||||
// Arcane Orb
|
||||
if (ArcaneOrb_Timer <= 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)
|
||||
target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (!target)
|
||||
continue;
|
||||
// exclude pets & totems, 18 yard radius minimum
|
||||
if (pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive() && !pTarget->IsWithinDist(me, 18, false))
|
||||
target_list.push_back(pTarget);
|
||||
pTarget = NULL;
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive() && !target->IsWithinDist(me, 18, false))
|
||||
target_list.push_back(target);
|
||||
target = NULL;
|
||||
}
|
||||
|
||||
if (target_list.size())
|
||||
pTarget = *(target_list.begin()+rand()%target_list.size());
|
||||
target = *(target_list.begin()+rand()%target_list.size());
|
||||
else
|
||||
pTarget = me->getVictim();
|
||||
target = me->getVictim();
|
||||
|
||||
if (pTarget)
|
||||
me->CastSpell(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, 0, pTarget);
|
||||
if (target)
|
||||
me->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, 0, target);
|
||||
ArcaneOrb_Timer = 3000;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -73,13 +73,13 @@ class mob_crystalcore_devastator : 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);
|
||||
|
||||
Knockaway_Timer = 23000;
|
||||
}
|
||||
|
||||
@@ -233,8 +233,8 @@ class mob_ragin_flames : public CreatureScript
|
||||
|
||||
if (!onlyonce)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->GetMotionMaster()->MoveChase(pTarget);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->GetMotionMaster()->MoveChase(target);
|
||||
onlyonce = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,10 +129,10 @@ class boss_pathaleon_the_calculator : public CreatureScript
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Creature* Wraith = me->SummonCreature(21062, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
if (pTarget && Wraith)
|
||||
Wraith->AI()->AttackStart(pTarget);
|
||||
if (target && Wraith)
|
||||
Wraith->AI()->AttackStart(target);
|
||||
}
|
||||
DoScriptText(SAY_SUMMON, me);
|
||||
Summon_Timer = 30000 + rand()%15000;
|
||||
@@ -158,10 +158,10 @@ class boss_pathaleon_the_calculator : public CreatureScript
|
||||
|
||||
if (Domination_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
{
|
||||
DoScriptText(RAND(SAY_DOMINATION_1, SAY_DOMINATION_2), me);
|
||||
DoCast(pTarget, SPELL_DOMINATION);
|
||||
DoCast(target, SPELL_DOMINATION);
|
||||
}
|
||||
Domination_Timer = 25000 + rand()%5000;
|
||||
}
|
||||
@@ -233,8 +233,8 @@ class mob_nether_wraith : public CreatureScript
|
||||
|
||||
if (ArcaneMissiles_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(pTarget, SPELL_ARCANE_MISSILES);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(target, SPELL_ARCANE_MISSILES);
|
||||
else
|
||||
DoCast(me->getVictim(), SPELL_ARCANE_MISSILES);
|
||||
ArcaneMissiles_Timer = 5000 + rand()%5000;
|
||||
|
||||
@@ -128,8 +128,8 @@ class boss_harbinger_skyriss : public CreatureScript
|
||||
else
|
||||
summon->SetHealth(summon->CountPctFromMaxHealth(66));
|
||||
if (me->getVictim())
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
summon->AI()->AttackStart(pTarget);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
summon->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
@@ -208,8 +208,8 @@ class boss_harbinger_skyriss : public CreatureScript
|
||||
|
||||
if (MindRend_Timer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(pTarget, SPELL_MIND_REND);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(target, SPELL_MIND_REND);
|
||||
else
|
||||
DoCast(me->getVictim(), SPELL_MIND_REND);
|
||||
|
||||
@@ -225,8 +225,8 @@ class boss_harbinger_skyriss : public CreatureScript
|
||||
|
||||
DoScriptText(RAND(SAY_FEAR_1, SAY_FEAR_2), me);
|
||||
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(pTarget, SPELL_FEAR);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(target, SPELL_FEAR);
|
||||
else
|
||||
DoCast(me->getVictim(), SPELL_FEAR);
|
||||
|
||||
@@ -242,8 +242,8 @@ class boss_harbinger_skyriss : public CreatureScript
|
||||
|
||||
DoScriptText(RAND(SAY_MIND_1, SAY_MIND_2), me);
|
||||
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(pTarget, SPELL_DOMINATION);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(target, SPELL_DOMINATION);
|
||||
else
|
||||
DoCast(me->getVictim(), SPELL_DOMINATION);
|
||||
|
||||
@@ -259,8 +259,8 @@ class boss_harbinger_skyriss : public CreatureScript
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
return;
|
||||
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(pTarget, H_SPELL_MANA_BURN);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(target, H_SPELL_MANA_BURN);
|
||||
|
||||
ManaBurn_Timer = 16000+rand()%16000;
|
||||
}
|
||||
|
||||
@@ -237,9 +237,9 @@ public:
|
||||
|
||||
if (ManaBurn_Timer <= diff)
|
||||
{
|
||||
Unit* pTarget = me->getVictim();
|
||||
if (pTarget && pTarget->getPowerType() == POWER_MANA)
|
||||
DoCast(pTarget, SPELL_MANA_BURN);
|
||||
Unit* target = me->getVictim();
|
||||
if (target && target->getPowerType() == POWER_MANA)
|
||||
DoCast(target, SPELL_MANA_BURN);
|
||||
ManaBurn_Timer = 8000+rand()%8000;
|
||||
} else ManaBurn_Timer -= diff;
|
||||
|
||||
|
||||
@@ -1541,11 +1541,11 @@ public:
|
||||
{
|
||||
if (SpellTimer1 <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
if (pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DoCast(pTarget, SpawnCast[1].SpellId); //Focused Bursts
|
||||
DoCast(target, SpawnCast[1].SpellId); //Focused Bursts
|
||||
SpellTimer1 = SpawnCast[1].Timer2 + (rand()%5 * 1000);
|
||||
} else SpellTimer1 = 2000;
|
||||
}
|
||||
@@ -1629,10 +1629,10 @@ void npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI::SummonNextWave()
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
if (Player* pTarget = Unit::GetPlayer(*me, PlayerGUID))
|
||||
if (Player* target = Unit::GetPlayer(*me, PlayerGUID))
|
||||
{
|
||||
float x, y, z;
|
||||
pTarget->GetPosition(x, y, z);
|
||||
target->GetPosition(x, y, z);
|
||||
Spawn->GetMotionMaster()->MovePoint(0, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user