*code cleanup
*totally destroyed m_creature, use "me" for future coding --HG-- branch : trunk
This commit is contained in:
@@ -135,7 +135,7 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
if (Creature* pStormforgedLieutenant = (Unit::GetCreature((*m_creature), m_auiStormforgedLieutenantGUID[i])))
|
||||
if (Creature* pStormforgedLieutenant = (Unit::GetCreature((*me), m_auiStormforgedLieutenantGUID[i])))
|
||||
{
|
||||
if (!pStormforgedLieutenant->isAlive())
|
||||
pStormforgedLieutenant->Respawn();
|
||||
@@ -145,7 +145,7 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
if (m_uiStance != STANCE_DEFENSIVE)
|
||||
{
|
||||
DoRemoveStanceAura(m_uiStance);
|
||||
DoCast(m_creature, SPELL_DEFENSIVE_STANCE);
|
||||
DoCast(me, SPELL_DEFENSIVE_STANCE);
|
||||
m_uiStance = STANCE_DEFENSIVE;
|
||||
}
|
||||
|
||||
@@ -157,10 +157,10 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
|
||||
void EnterCombat(Unit* pWho)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
//must get both lieutenants here and make sure they are with him
|
||||
m_creature->CallForHelp(30.0f);
|
||||
me->CallForHelp(30.0f);
|
||||
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(TYPE_BJARNGRIM, IN_PROGRESS);
|
||||
@@ -168,12 +168,12 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
|
||||
void KilledUnit(Unit* pVictim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit* pKiller)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(TYPE_BJARNGRIM, DONE);
|
||||
@@ -185,13 +185,13 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
switch(uiStance)
|
||||
{
|
||||
case STANCE_DEFENSIVE:
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_DEFENSIVE_STANCE);
|
||||
me->RemoveAurasDueToSpell(SPELL_DEFENSIVE_STANCE);
|
||||
break;
|
||||
case STANCE_BERSERKER:
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_BERSEKER_STANCE);
|
||||
me->RemoveAurasDueToSpell(SPELL_BERSEKER_STANCE);
|
||||
break;
|
||||
case STANCE_BATTLE:
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_BATTLE_STANCE);
|
||||
me->RemoveAurasDueToSpell(SPELL_BATTLE_STANCE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
if (m_uiChangeStance_Timer <= uiDiff)
|
||||
{
|
||||
//wait for current spell to finish before change stance
|
||||
if (m_creature->IsNonMeleeSpellCasted(false))
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
return;
|
||||
|
||||
DoRemoveStanceAura(m_uiStance);
|
||||
@@ -221,21 +221,21 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
switch(m_uiStance)
|
||||
{
|
||||
case STANCE_DEFENSIVE:
|
||||
DoScriptText(SAY_DEFENSIVE_STANCE, m_creature);
|
||||
DoScriptText(EMOTE_DEFENSIVE_STANCE, m_creature);
|
||||
DoCast(m_creature, SPELL_DEFENSIVE_STANCE);
|
||||
DoScriptText(SAY_DEFENSIVE_STANCE, me);
|
||||
DoScriptText(EMOTE_DEFENSIVE_STANCE, me);
|
||||
DoCast(me, SPELL_DEFENSIVE_STANCE);
|
||||
SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE);
|
||||
break;
|
||||
case STANCE_BERSERKER:
|
||||
DoScriptText(SAY_BERSEKER_STANCE, m_creature);
|
||||
DoScriptText(EMOTE_BERSEKER_STANCE, m_creature);
|
||||
DoCast(m_creature, SPELL_BERSEKER_STANCE);
|
||||
DoScriptText(SAY_BERSEKER_STANCE, me);
|
||||
DoScriptText(EMOTE_BERSEKER_STANCE, me);
|
||||
DoCast(me, SPELL_BERSEKER_STANCE);
|
||||
SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE);
|
||||
break;
|
||||
case STANCE_BATTLE:
|
||||
DoScriptText(SAY_BATTLE_STANCE, m_creature);
|
||||
DoScriptText(EMOTE_BATTLE_STANCE, m_creature);
|
||||
DoCast(m_creature, SPELL_BATTLE_STANCE);
|
||||
DoScriptText(SAY_BATTLE_STANCE, me);
|
||||
DoScriptText(EMOTE_BATTLE_STANCE, me);
|
||||
DoCast(me, SPELL_BATTLE_STANCE);
|
||||
SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
|
||||
break;
|
||||
}
|
||||
@@ -252,7 +252,7 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
{
|
||||
if (m_uiReflection_Timer <= uiDiff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_SPELL_REFLECTION);
|
||||
DoCast(me, SPELL_SPELL_REFLECTION);
|
||||
m_uiReflection_Timer = 8000 + rand()%1000;
|
||||
}
|
||||
else
|
||||
@@ -260,7 +260,7 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
|
||||
if (m_uiKnockAway_Timer <= uiDiff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_KNOCK_AWAY);
|
||||
DoCast(me, SPELL_KNOCK_AWAY);
|
||||
m_uiKnockAway_Timer = 20000 + rand()%1000;
|
||||
}
|
||||
else
|
||||
@@ -268,7 +268,7 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
|
||||
if (m_uiPummel_Timer <= uiDiff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_PUMMEL);
|
||||
DoCast(me->getVictim(), SPELL_PUMMEL);
|
||||
m_uiPummel_Timer = 10000 + rand()%1000;
|
||||
}
|
||||
else
|
||||
@@ -276,7 +276,7 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
|
||||
if (m_uiIronform_Timer <= uiDiff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_IRONFORM);
|
||||
DoCast(me, SPELL_IRONFORM);
|
||||
m_uiIronform_Timer = 25000 + rand()%1000;
|
||||
}
|
||||
else
|
||||
@@ -289,7 +289,7 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
if (m_uiIntercept_Timer <= uiDiff)
|
||||
{
|
||||
//not much point is this, better random target and more often?
|
||||
DoCast(m_creature->getVictim(), SPELL_INTERCEPT);
|
||||
DoCast(me->getVictim(), SPELL_INTERCEPT);
|
||||
m_uiIntercept_Timer = 45000 + rand()%1000;
|
||||
}
|
||||
else
|
||||
@@ -297,7 +297,7 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
|
||||
if (m_uiWhirlwind_Timer <= uiDiff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_WHIRLWIND);
|
||||
DoCast(me, SPELL_WHIRLWIND);
|
||||
m_uiWhirlwind_Timer = 10000 + rand()%1000;
|
||||
}
|
||||
else
|
||||
@@ -305,7 +305,7 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
|
||||
if (m_uiCleave_Timer <= uiDiff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
m_uiCleave_Timer = 8000 + rand()%1000;
|
||||
}
|
||||
else
|
||||
@@ -317,7 +317,7 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
{
|
||||
if (m_uiMortalStrike_Timer <= uiDiff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
|
||||
DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
|
||||
m_uiMortalStrike_Timer = 20000 + rand()%1000;
|
||||
}
|
||||
else
|
||||
@@ -325,7 +325,7 @@ struct boss_bjarngrimAI : public ScriptedAI
|
||||
|
||||
if (m_uiSlam_Timer <= uiDiff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_SLAM);
|
||||
DoCast(me->getVictim(), SPELL_SLAM);
|
||||
m_uiSlam_Timer = 15000 + rand()%1000;
|
||||
}
|
||||
else
|
||||
@@ -381,7 +381,7 @@ struct mob_stormforged_lieutenantAI : public ScriptedAI
|
||||
|
||||
if (m_uiArcWeld_Timer <= uiDiff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_ARC_WELD);
|
||||
DoCast(me->getVictim(), SPELL_ARC_WELD);
|
||||
m_uiArcWeld_Timer = 20000 + rand()%1000;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -100,10 +100,10 @@ struct boss_ionarAI : public ScriptedAI
|
||||
|
||||
uiDisperseHealth = 45 + urand(0,10);
|
||||
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE);
|
||||
|
||||
if (m_creature->GetVisibility() == VISIBILITY_OFF)
|
||||
m_creature->SetVisibility(VISIBILITY_ON);
|
||||
if (me->GetVisibility() == VISIBILITY_OFF)
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_IONAR, NOT_STARTED);
|
||||
@@ -111,7 +111,7 @@ struct boss_ionarAI : public ScriptedAI
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_IONAR, IN_PROGRESS);
|
||||
@@ -119,7 +119,7 @@ struct boss_ionarAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
lSparkList.DespawnAll();
|
||||
|
||||
@@ -129,7 +129,7 @@ struct boss_ionarAI : public ScriptedAI
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
|
||||
}
|
||||
|
||||
//make sparks come back
|
||||
@@ -140,11 +140,11 @@ struct boss_ionarAI : public ScriptedAI
|
||||
return;
|
||||
|
||||
Position pos;
|
||||
m_creature->GetPosition(&pos);
|
||||
me->GetPosition(&pos);
|
||||
|
||||
for (std::list<uint64>::const_iterator itr = lSparkList.begin(); itr != lSparkList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pSpark = Unit::GetCreature(*m_creature, *itr))
|
||||
if (Creature* pSpark = Unit::GetCreature(*me, *itr))
|
||||
{
|
||||
if (pSpark->isAlive())
|
||||
{
|
||||
@@ -160,7 +160,7 @@ struct boss_ionarAI : public ScriptedAI
|
||||
|
||||
void DamageTaken(Unit *pDoneBy, uint32 &uiDamage)
|
||||
{
|
||||
if (m_creature->GetVisibility() == VISIBILITY_OFF)
|
||||
if (me->GetVisibility() == VISIBILITY_OFF)
|
||||
uiDamage = 0;
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ struct boss_ionarAI : public ScriptedAI
|
||||
return;
|
||||
|
||||
// Splitted
|
||||
if (m_creature->GetVisibility() == VISIBILITY_OFF)
|
||||
if (me->GetVisibility() == VISIBILITY_OFF)
|
||||
{
|
||||
if (uiSplitTimer <= uiDiff)
|
||||
{
|
||||
@@ -210,16 +210,16 @@ struct boss_ionarAI : public ScriptedAI
|
||||
// Lightning effect and restore Ionar
|
||||
else if (lSparkList.empty())
|
||||
{
|
||||
m_creature->SetVisibility(VISIBILITY_ON);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE);
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE);
|
||||
|
||||
DoCast(m_creature, SPELL_SPARK_DESPAWN, false);
|
||||
DoCast(me, SPELL_SPARK_DESPAWN, false);
|
||||
|
||||
uiSplitTimer = 25*IN_MILISECONDS;
|
||||
bIsSplitPhase = true;
|
||||
|
||||
if (m_creature->getVictim())
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
|
||||
if (me->getVictim())
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -240,7 +240,7 @@ struct boss_ionarAI : public ScriptedAI
|
||||
|
||||
if (uiBallLightningTimer <= uiDiff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_BALL_LIGHTNING);
|
||||
DoCast(me->getVictim(), SPELL_BALL_LIGHTNING);
|
||||
uiBallLightningTimer = urand(10*IN_MILISECONDS, 11*IN_MILISECONDS);
|
||||
}
|
||||
else
|
||||
@@ -251,12 +251,12 @@ struct boss_ionarAI : public ScriptedAI
|
||||
{
|
||||
bHasDispersed = true;
|
||||
|
||||
DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), m_creature);
|
||||
DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), me);
|
||||
|
||||
if (m_creature->IsNonMeleeSpellCasted(false))
|
||||
m_creature->InterruptNonMeleeSpells(false);
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
DoCast(m_creature, SPELL_DISPERSE, true);
|
||||
DoCast(me, SPELL_DISPERSE, true);
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -310,7 +310,7 @@ struct mob_spark_of_ionarAI : public ScriptedAI
|
||||
void Reset()
|
||||
{
|
||||
uiCheckTimer = 2*IN_MILISECONDS;
|
||||
m_creature->SetReactState(REACT_PASSIVE);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 uiType, uint32 uiPointId)
|
||||
@@ -319,7 +319,7 @@ struct mob_spark_of_ionarAI : public ScriptedAI
|
||||
return;
|
||||
|
||||
if (uiPointId == DATA_POINT_CALLBACK)
|
||||
m_creature->ForcedDespawn();
|
||||
me->ForcedDespawn();
|
||||
}
|
||||
|
||||
void DamageTaken(Unit *pDoneBy, uint32 &uiDamage)
|
||||
@@ -332,7 +332,7 @@ struct mob_spark_of_ionarAI : public ScriptedAI
|
||||
// Despawn if the encounter is not running
|
||||
if (pInstance && pInstance->GetData(TYPE_IONAR) != IN_PROGRESS)
|
||||
{
|
||||
m_creature->ForcedDespawn();
|
||||
me->ForcedDespawn();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -344,18 +344,18 @@ struct mob_spark_of_ionarAI : public ScriptedAI
|
||||
Creature* pIonar = pInstance->instance->GetCreature(pInstance->GetData64(DATA_IONAR));
|
||||
if (pIonar && pIonar->isAlive())
|
||||
{
|
||||
if (m_creature->GetDistance(pIonar) > DATA_MAX_SPARK_DISTANCE)
|
||||
if (me->GetDistance(pIonar) > DATA_MAX_SPARK_DISTANCE)
|
||||
{
|
||||
Position pos;
|
||||
pIonar->GetPosition(&pos);
|
||||
|
||||
m_creature->SetSpeed(MOVE_RUN, 2.0f);
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->GetMotionMaster()->MovePoint(DATA_POINT_CALLBACK, pos);
|
||||
me->SetSpeed(MOVE_RUN, 2.0f);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(DATA_POINT_CALLBACK, pos);
|
||||
}
|
||||
}
|
||||
else
|
||||
m_creature->ForcedDespawn();
|
||||
me->ForcedDespawn();
|
||||
}
|
||||
uiCheckTimer = 2*IN_MILISECONDS;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ struct boss_lokenAI : public ScriptedAI
|
||||
|
||||
void EnterCombat(Unit* pWho)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
EncounterTime = 0;
|
||||
|
||||
@@ -105,14 +105,14 @@ struct boss_lokenAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* pKiller)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (IsHeroic() && EncounterTime <= MAX_ENCOUNTER_TIME)
|
||||
{
|
||||
AchievementEntry const *AchievTimelyDeath = GetAchievementStore()->LookupEntry(ACHIEVEMENT_TIMELY_DEATH);
|
||||
if (AchievTimelyDeath)
|
||||
{
|
||||
Map* pMap = m_creature->GetMap();
|
||||
Map* pMap = me->GetMap();
|
||||
if (pMap && pMap->IsDungeon())
|
||||
{
|
||||
Map::PlayerList const &players = pMap->GetPlayers();
|
||||
@@ -128,7 +128,7 @@ struct boss_lokenAI : public ScriptedAI
|
||||
|
||||
void KilledUnit(Unit* pVictim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
@@ -144,7 +144,7 @@ struct boss_lokenAI : public ScriptedAI
|
||||
// workaround for PULSING_SHOCKWAVE
|
||||
if (m_uiPulsingShockwave_Timer <= uiDiff)
|
||||
{
|
||||
Map* pMap = m_creature->GetMap();
|
||||
Map* pMap = me->GetMap();
|
||||
if (pMap->IsDungeon())
|
||||
{
|
||||
Map::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
@@ -156,13 +156,13 @@ struct boss_lokenAI : public ScriptedAI
|
||||
if (i->getSource() && i->getSource()->isAlive() && i->getSource()->isTargetableForAttack())
|
||||
{
|
||||
int32 dmg;
|
||||
float m_fDist = m_creature->GetExactDist(i->getSource()->GetPositionX(), i->getSource()->GetPositionY(), i->getSource()->GetPositionZ());
|
||||
float m_fDist = me->GetExactDist(i->getSource()->GetPositionX(), i->getSource()->GetPositionY(), i->getSource()->GetPositionZ());
|
||||
|
||||
dmg = DUNGEON_MODE(100, 150); // need to correct damage
|
||||
if (m_fDist > 1.0f) // Further from 1 yard
|
||||
dmg *= m_fDist;
|
||||
|
||||
m_creature->CastCustomSpell(i->getSource(), DUNGEON_MODE(52942, 59837), &dmg, 0, 0, false);
|
||||
me->CastCustomSpell(i->getSource(), DUNGEON_MODE(52942, 59837), &dmg, 0, 0, false);
|
||||
}
|
||||
}
|
||||
m_uiPulsingShockwave_Timer = 2000;
|
||||
@@ -173,9 +173,9 @@ struct boss_lokenAI : public ScriptedAI
|
||||
if (m_uiResumePulsingShockwave_Timer <= uiDiff)
|
||||
{
|
||||
//breaks at movement, can we assume when it's time, this spell is casted and also must stop movement?
|
||||
DoCast(m_creature, SPELL_PULSING_SHOCKWAVE_AURA, true);
|
||||
DoCast(me, SPELL_PULSING_SHOCKWAVE_AURA, true);
|
||||
|
||||
DoCast(m_creature, SPELL_PULSING_SHOCKWAVE_N); // need core support
|
||||
DoCast(me, SPELL_PULSING_SHOCKWAVE_N); // need core support
|
||||
m_bIsAura = true;
|
||||
m_uiResumePulsingShockwave_Timer = 0;
|
||||
}
|
||||
@@ -195,9 +195,9 @@ struct boss_lokenAI : public ScriptedAI
|
||||
|
||||
if (m_uiLightningNova_Timer <= uiDiff)
|
||||
{
|
||||
DoScriptText(RAND(SAY_NOVA_1,SAY_NOVA_2,SAY_NOVA_3), m_creature);
|
||||
DoScriptText(EMOTE_NOVA, m_creature);
|
||||
DoCast(m_creature, SPELL_LIGHTNING_NOVA_N);
|
||||
DoScriptText(RAND(SAY_NOVA_1,SAY_NOVA_2,SAY_NOVA_3), me);
|
||||
DoScriptText(EMOTE_NOVA, me);
|
||||
DoCast(me, SPELL_LIGHTNING_NOVA_N);
|
||||
|
||||
m_bIsAura = false;
|
||||
m_uiResumePulsingShockwave_Timer = DUNGEON_MODE(5000, 4000); // Pause Pulsing Shockwave aura
|
||||
@@ -207,13 +207,13 @@ struct boss_lokenAI : public ScriptedAI
|
||||
m_uiLightningNova_Timer -= uiDiff;
|
||||
|
||||
// Health check
|
||||
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(25*m_uiHealthAmountModifier)))
|
||||
if ((me->GetHealth()*100 / me->GetMaxHealth()) < (100-(25*m_uiHealthAmountModifier)))
|
||||
{
|
||||
switch(m_uiHealthAmountModifier)
|
||||
{
|
||||
case 1: DoScriptText(SAY_75HEALTH, m_creature); break;
|
||||
case 2: DoScriptText(SAY_50HEALTH, m_creature); break;
|
||||
case 3: DoScriptText(SAY_25HEALTH, m_creature); break;
|
||||
case 1: DoScriptText(SAY_75HEALTH, me); break;
|
||||
case 2: DoScriptText(SAY_50HEALTH, me); break;
|
||||
case 3: DoScriptText(SAY_25HEALTH, me); break;
|
||||
}
|
||||
|
||||
++m_uiHealthAmountModifier;
|
||||
|
||||
@@ -116,7 +116,7 @@ struct boss_volkhanAI : public ScriptedAI
|
||||
|
||||
void EnterCombat(Unit* pWho)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(TYPE_VOLKHAN, IN_PROGRESS);
|
||||
@@ -124,20 +124,20 @@ struct boss_volkhanAI : public ScriptedAI
|
||||
|
||||
void AttackStart(Unit* pWho)
|
||||
{
|
||||
if (m_creature->Attack(pWho, true))
|
||||
if (me->Attack(pWho, true))
|
||||
{
|
||||
m_creature->AddThreat(pWho, 0.0f);
|
||||
m_creature->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(m_creature);
|
||||
me->AddThreat(pWho, 0.0f);
|
||||
me->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(me);
|
||||
|
||||
if (!m_bHasTemper)
|
||||
m_creature->GetMotionMaster()->MoveChase(pWho);
|
||||
me->GetMotionMaster()->MoveChase(pWho);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* pKiller)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
DespawnGolem();
|
||||
|
||||
if (m_pInstance)
|
||||
@@ -148,7 +148,7 @@ struct boss_volkhanAI : public ScriptedAI
|
||||
AchievementEntry const *AchievShatterResistant = GetAchievementStore()->LookupEntry(ACHIEVEMENT_SHATTER_RESISTANT);
|
||||
if (AchievShatterResistant)
|
||||
{
|
||||
Map* pMap = m_creature->GetMap();
|
||||
Map* pMap = me->GetMap();
|
||||
if (pMap && pMap->IsDungeon())
|
||||
{
|
||||
Map::PlayerList const &players = pMap->GetPlayers();
|
||||
@@ -161,7 +161,7 @@ struct boss_volkhanAI : public ScriptedAI
|
||||
|
||||
void KilledUnit(Unit* pVictim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
|
||||
}
|
||||
|
||||
void DespawnGolem()
|
||||
@@ -171,7 +171,7 @@ struct boss_volkhanAI : public ScriptedAI
|
||||
|
||||
for (std::list<uint64>::const_iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, *itr))
|
||||
{
|
||||
if (pTemp->isAlive())
|
||||
pTemp->ForcedDespawn();
|
||||
@@ -188,7 +188,7 @@ struct boss_volkhanAI : public ScriptedAI
|
||||
|
||||
for (std::list<uint64>::const_iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, *itr))
|
||||
{
|
||||
// only shatter brittle golems
|
||||
if (pTemp->isAlive() && pTemp->GetEntry() == NPC_BRITTLE_GOLEM)
|
||||
@@ -216,7 +216,7 @@ struct boss_volkhanAI : public ScriptedAI
|
||||
pSummoned->AI()->AttackStart(pTarget);
|
||||
|
||||
//why healing when just summoned?
|
||||
pSummoned->CastSpell(pSummoned, DUNGEON_MODE(SPELL_HEAT_N, SPELL_HEAT_H), false, NULL, NULL, m_creature->GetGUID());
|
||||
pSummoned->CastSpell(pSummoned, DUNGEON_MODE(SPELL_HEAT_N, SPELL_HEAT_H), false, NULL, NULL, me->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,10 +230,10 @@ struct boss_volkhanAI : public ScriptedAI
|
||||
{
|
||||
if (m_uiPause_Timer <= uiDiff)
|
||||
{
|
||||
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
|
||||
{
|
||||
if (m_creature->getVictim())
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
|
||||
if (me->getVictim())
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim());
|
||||
}
|
||||
|
||||
m_bHasTemper = false;
|
||||
@@ -253,11 +253,11 @@ struct boss_volkhanAI : public ScriptedAI
|
||||
{
|
||||
//should he stomp even if he has no brittle golem to shatter?
|
||||
|
||||
DoScriptText(RAND(SAY_STOMP_1,SAY_STOMP_2), m_creature);
|
||||
DoScriptText(RAND(SAY_STOMP_1,SAY_STOMP_2), me);
|
||||
|
||||
DoCast(m_creature, SPELL_SHATTERING_STOMP_N);
|
||||
DoCast(me, SPELL_SHATTERING_STOMP_N);
|
||||
|
||||
DoScriptText(EMOTE_SHATTER, m_creature);
|
||||
DoScriptText(EMOTE_SHATTER, me);
|
||||
|
||||
m_uiShatteringStomp_Timer = 30000;
|
||||
m_bCanShatterGolem = true;
|
||||
@@ -280,18 +280,18 @@ struct boss_volkhanAI : public ScriptedAI
|
||||
}
|
||||
|
||||
// Health check
|
||||
if (!m_bCanShatterGolem && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(20*m_uiHealthAmountModifier)))
|
||||
if (!m_bCanShatterGolem && (me->GetHealth()*100 / me->GetMaxHealth()) < (100-(20*m_uiHealthAmountModifier)))
|
||||
{
|
||||
++m_uiHealthAmountModifier;
|
||||
|
||||
if (m_creature->IsNonMeleeSpellCasted(false))
|
||||
m_creature->InterruptNonMeleeSpells(false);
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
|
||||
DoScriptText(RAND(SAY_FORGE_1,SAY_FORGE_2), m_creature);
|
||||
DoScriptText(RAND(SAY_FORGE_1,SAY_FORGE_2), me);
|
||||
|
||||
m_bHasTemper = true;
|
||||
|
||||
DoCast(m_creature, SPELL_TEMPER, false);
|
||||
DoCast(me, SPELL_TEMPER, false);
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -386,31 +386,31 @@ struct mob_molten_golemAI : public ScriptedAI
|
||||
|
||||
void AttackStart(Unit* pWho)
|
||||
{
|
||||
if (m_creature->Attack(pWho, true))
|
||||
if (me->Attack(pWho, true))
|
||||
{
|
||||
m_creature->AddThreat(pWho, 0.0f);
|
||||
m_creature->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(m_creature);
|
||||
me->AddThreat(pWho, 0.0f);
|
||||
me->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(me);
|
||||
|
||||
if (!m_bIsFrozen)
|
||||
m_creature->GetMotionMaster()->MoveChase(pWho);
|
||||
me->GetMotionMaster()->MoveChase(pWho);
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
|
||||
{
|
||||
if (uiDamage > m_creature->GetHealth())
|
||||
if (uiDamage > me->GetHealth())
|
||||
{
|
||||
m_creature->UpdateEntry(NPC_BRITTLE_GOLEM);
|
||||
m_creature->SetHealth(1);
|
||||
me->UpdateEntry(NPC_BRITTLE_GOLEM);
|
||||
me->SetHealth(1);
|
||||
uiDamage = 0;
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->AttackStop();
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
if (m_creature->IsNonMeleeSpellCasted(false))
|
||||
m_creature->InterruptNonMeleeSpells(false);
|
||||
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
|
||||
m_creature->GetMotionMaster()->MovementExpired();
|
||||
me->RemoveAllAuras();
|
||||
me->AttackStop();
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
|
||||
me->GetMotionMaster()->MovementExpired();
|
||||
m_bIsFrozen = true;
|
||||
}
|
||||
}
|
||||
@@ -420,8 +420,8 @@ struct mob_molten_golemAI : public ScriptedAI
|
||||
//this is the dummy effect of the spells
|
||||
if (pSpell->Id == SPELL_SHATTER_N || pSpell->Id == SPELL_SHATTER_H)
|
||||
{
|
||||
if (m_creature->GetEntry() == NPC_BRITTLE_GOLEM)
|
||||
m_creature->ForcedDespawn();
|
||||
if (me->GetEntry() == NPC_BRITTLE_GOLEM)
|
||||
me->ForcedDespawn();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ struct mob_molten_golemAI : public ScriptedAI
|
||||
|
||||
if (m_uiBlast_Timer <= uiDiff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_BLAST_WAVE);
|
||||
DoCast(me, SPELL_BLAST_WAVE);
|
||||
m_uiBlast_Timer = 20000;
|
||||
}
|
||||
else
|
||||
@@ -441,7 +441,7 @@ struct mob_molten_golemAI : public ScriptedAI
|
||||
|
||||
if (m_uiImmolation_Timer <= uiDiff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_IMMOLATION_STRIKE_N);
|
||||
DoCast(me->getVictim(), SPELL_IMMOLATION_STRIKE_N);
|
||||
m_uiImmolation_Timer = 5000;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -64,7 +64,7 @@ struct boss_krystallusAI : public ScriptedAI
|
||||
}
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KRYSTALLUS_EVENT, IN_PROGRESS);
|
||||
@@ -92,13 +92,13 @@ struct boss_krystallusAI : public ScriptedAI
|
||||
|
||||
if (uiStompTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_STOMP);
|
||||
DoCast(me, SPELL_STOMP);
|
||||
uiStompTimer = 20000 + rand()%9000;
|
||||
} else uiStompTimer -= diff;
|
||||
|
||||
if (uiGroundSlamTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_GROUND_SLAM);
|
||||
DoCast(me, SPELL_GROUND_SLAM);
|
||||
bIsSlam = true;
|
||||
uiShatterTimer = 10000;
|
||||
uiGroundSlamTimer = 15000 + rand()%3000;
|
||||
@@ -108,7 +108,7 @@ struct boss_krystallusAI : public ScriptedAI
|
||||
{
|
||||
if (uiShatterTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_SHATTER);
|
||||
DoCast(me, SPELL_SHATTER);
|
||||
bIsSlam = false;
|
||||
} else uiShatterTimer -= diff;
|
||||
}
|
||||
@@ -118,7 +118,7 @@ struct boss_krystallusAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KRYSTALLUS_EVENT, DONE);
|
||||
@@ -126,9 +126,9 @@ struct boss_krystallusAI : public ScriptedAI
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (victim == m_creature)
|
||||
if (victim == me)
|
||||
return;
|
||||
DoScriptText(SAY_KILL, m_creature);
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ struct boss_maiden_of_griefAI : public ScriptedAI
|
||||
{
|
||||
boss_maiden_of_griefAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = m_creature->GetInstanceData();
|
||||
pInstance = me->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
@@ -68,7 +68,7 @@ struct boss_maiden_of_griefAI : public ScriptedAI
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
@@ -109,15 +109,15 @@ struct boss_maiden_of_griefAI : public ScriptedAI
|
||||
|
||||
if (StormOfGriefTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_STORM_OF_GRIEF_N, true);
|
||||
DoCast(me->getVictim(), SPELL_STORM_OF_GRIEF_N, true);
|
||||
StormOfGriefTimer = 15000 + rand()%5000;
|
||||
} else StormOfGriefTimer -= diff;
|
||||
|
||||
if (ShockOfSorrowTimer <= diff)
|
||||
{
|
||||
DoResetThreat();
|
||||
DoScriptText(SAY_STUN, m_creature);
|
||||
DoCast(m_creature, SPELL_SHOCK_OF_SORROW_N);
|
||||
DoScriptText(SAY_STUN, me);
|
||||
DoCast(me, SPELL_SHOCK_OF_SORROW_N);
|
||||
ShockOfSorrowTimer = 20000 + rand()%10000;
|
||||
} else ShockOfSorrowTimer -= diff;
|
||||
|
||||
@@ -128,7 +128,7 @@ struct boss_maiden_of_griefAI : public ScriptedAI
|
||||
if (pTarget)
|
||||
DoCast(pTarget, SPELL_PILLAR_OF_WOE_N);
|
||||
else
|
||||
DoCast(m_creature->getVictim(), SPELL_PILLAR_OF_WOE_N);
|
||||
DoCast(me->getVictim(), SPELL_PILLAR_OF_WOE_N);
|
||||
|
||||
PillarOfWoeTimer = 5000 + rand()%20000;
|
||||
} else PillarOfWoeTimer -= diff;
|
||||
@@ -137,13 +137,13 @@ struct boss_maiden_of_griefAI : public ScriptedAI
|
||||
}
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MAIDEN_OF_GRIEF_EVENT, DONE);
|
||||
|
||||
AchievementEntry const *AchievGoodGrief = GetAchievementStore()->LookupEntry(ACHIEVEMENT_GOOD_GRIEF);
|
||||
Map* pMap = m_creature->GetMap();
|
||||
Map* pMap = me->GetMap();
|
||||
|
||||
if (IsHeroic() && AchievTimer < 60000 && pMap && pMap->IsDungeon() && AchievGoodGrief)
|
||||
{
|
||||
@@ -154,10 +154,10 @@ struct boss_maiden_of_griefAI : public ScriptedAI
|
||||
}
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (victim == m_creature)
|
||||
if (victim == me)
|
||||
return;
|
||||
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3,SAY_SLAY_4), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3,SAY_SLAY_4), me);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ struct boss_sjonnirAI : public ScriptedAI
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
uiEncounterTimer = 0;
|
||||
|
||||
@@ -140,28 +140,28 @@ struct boss_sjonnirAI : public ScriptedAI
|
||||
|
||||
if (uiLightningShieldTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_LIGHTING_SHIELD);
|
||||
DoCast(me, SPELL_LIGHTING_SHIELD);
|
||||
uiLightningShieldTimer -= diff;
|
||||
}
|
||||
|
||||
if (uiStaticChargeTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_STATIC_CHARGE);
|
||||
DoCast(me->getVictim(), SPELL_STATIC_CHARGE);
|
||||
uiStaticChargeTimer = 20000 + rand()%5000;
|
||||
} uiStaticChargeTimer -= diff;
|
||||
|
||||
if (uiLightningRingTimer <= diff)
|
||||
{
|
||||
if (m_creature->IsNonMeleeSpellCasted(false))
|
||||
m_creature->InterruptNonMeleeSpells(false);
|
||||
DoCast(m_creature, SPELL_LIGHTING_RING);
|
||||
if (me->IsNonMeleeSpellCasted(false))
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
DoCast(me, SPELL_LIGHTING_RING);
|
||||
uiLightningRingTimer = 30000 + rand()%5000;
|
||||
} else uiLightningRingTimer -= diff;
|
||||
|
||||
if (uiSummonTimer <= diff)
|
||||
{
|
||||
uint32 uiSummonPipe = rand()%2;
|
||||
m_creature->SummonCreature(uiEncounterTimer > DATA_TIME_BEFORE_OOZE ? CREATURE_MALFORMED_OOZE :
|
||||
me->SummonCreature(uiEncounterTimer > DATA_TIME_BEFORE_OOZE ? CREATURE_MALFORMED_OOZE :
|
||||
RAND(CREATURE_FORGED_IRON_DWARF,CREATURE_FORGED_IRON_TROGG),
|
||||
PipeLocations[uiSummonPipe].x, PipeLocations[uiSummonPipe].y, PipeLocations[uiSummonPipe].z, 0.0f,
|
||||
TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
|
||||
@@ -172,7 +172,7 @@ struct boss_sjonnirAI : public ScriptedAI
|
||||
{
|
||||
if (uiFrenzyTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_FRENZY);
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
bIsFrenzy = true;
|
||||
}
|
||||
else uiFrenzyTimer -= diff;
|
||||
@@ -193,7 +193,7 @@ struct boss_sjonnirAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
lSummons.DespawnAll();
|
||||
|
||||
if (pInstance)
|
||||
@@ -205,9 +205,9 @@ struct boss_sjonnirAI : public ScriptedAI
|
||||
}
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (victim == m_creature)
|
||||
if (victim == me)
|
||||
return;
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
|
||||
}
|
||||
|
||||
void KilledIronSludge()
|
||||
@@ -236,11 +236,11 @@ struct mob_malformed_oozeAI : public ScriptedAI
|
||||
{
|
||||
if (uiMergeTimer <= diff)
|
||||
{
|
||||
if (Creature* pTemp = m_creature->FindNearestCreature(CREATURE_MALFORMED_OOZE, 3.0f, true))
|
||||
if (Creature* pTemp = me->FindNearestCreature(CREATURE_MALFORMED_OOZE, 3.0f, true))
|
||||
{
|
||||
DoSpawnCreature(CREATURE_IRON_SLUDGE, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000);
|
||||
pTemp->DisappearAndDie();
|
||||
m_creature->DisappearAndDie();
|
||||
me->DisappearAndDie();
|
||||
}
|
||||
uiMergeTimer = 3000;
|
||||
} else uiMergeTimer -= diff;
|
||||
@@ -269,7 +269,7 @@ struct mob_iron_sludgeAI : public ScriptedAI
|
||||
void JustDied(Unit* pKiller)
|
||||
{
|
||||
if (pInstance)
|
||||
if (Creature* pSjonnir = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SJONNIR)))
|
||||
if (Creature* pSjonnir = Unit::GetCreature(*me, pInstance->GetData64(DATA_SJONNIR)))
|
||||
CAST_AI(boss_sjonnirAI, pSjonnir->AI())->KilledIronSludge();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -158,7 +158,7 @@ struct mob_tribuna_controllerAI : public ScriptedAI
|
||||
|
||||
void UpdateFacesList()
|
||||
{
|
||||
/*GetCreatureListWithEntryInGrid(lKaddrakGUIDList, m_creature, CREATURE_KADDRAK, 50.0f);
|
||||
/*GetCreatureListWithEntryInGrid(lKaddrakGUIDList, me, CREATURE_KADDRAK, 50.0f);
|
||||
if (!lKaddrakGUIDList.empty())
|
||||
{
|
||||
uint32 uiPositionCounter = 0;
|
||||
@@ -192,7 +192,7 @@ struct mob_tribuna_controllerAI : public ScriptedAI
|
||||
if (!KaddrakGUIDList.empty())
|
||||
for (std::list<uint64>::const_iterator itr = KaddrakGUIDList.begin(); itr != KaddrakGUIDList.end(); ++itr)
|
||||
{
|
||||
if (Creature *pKaddrak = Unit::GetCreature(*m_creature, *itr))
|
||||
if (Creature *pKaddrak = Unit::GetCreature(*me, *itr))
|
||||
{
|
||||
if (pKaddrak->isAlive())
|
||||
pKaddrak->CastSpell(pTarget, DUNGEON_MODE(SPELL_GLARE_OF_THE_TRIBUNAL, H_SPELL_GLARE_OF_THE_TRIBUNAL), true);
|
||||
@@ -207,7 +207,7 @@ struct mob_tribuna_controllerAI : public ScriptedAI
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
{
|
||||
if (Creature* pSummon = m_creature->SummonCreature(CREATURE_DARK_MATTER_TARGET, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
|
||||
if (Creature* pSummon = me->SummonCreature(CREATURE_DARK_MATTER_TARGET, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
|
||||
{
|
||||
pSummon->SetDisplayId(11686);
|
||||
pSummon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
@@ -223,7 +223,7 @@ struct mob_tribuna_controllerAI : public ScriptedAI
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
{
|
||||
if (Creature* pSummon = m_creature->SummonCreature(CREATURE_SEARING_GAZE_TARGET, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
|
||||
if (Creature* pSummon = me->SummonCreature(CREATURE_SEARING_GAZE_TARGET, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
|
||||
{
|
||||
pSummon->SetDisplayId(11686);
|
||||
pSummon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
@@ -279,7 +279,7 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
return;
|
||||
for (std::list<uint64>::const_iterator itr = lDwarfGUIDList.begin(); itr != lDwarfGUIDList.end(); ++itr)
|
||||
{
|
||||
Creature* pTemp = Unit::GetCreature(*m_creature, pInstance ? (*itr) : 0);
|
||||
Creature* pTemp = Unit::GetCreature(*me, pInstance ? (*itr) : 0);
|
||||
if (pTemp && pTemp->isAlive())
|
||||
pTemp->ForcedDespawn();
|
||||
}
|
||||
@@ -291,7 +291,7 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
switch(uiPointId)
|
||||
{
|
||||
case 7:
|
||||
if (Creature* pCreature = GetClosestCreatureWithEntry(m_creature, CREATURE_TRIBUNAL_OF_THE_AGES, 100.0f))
|
||||
if (Creature* pCreature = GetClosestCreatureWithEntry(me, CREATURE_TRIBUNAL_OF_THE_AGES, 100.0f))
|
||||
{
|
||||
if (!pCreature->isAlive())
|
||||
pCreature->Respawn();
|
||||
@@ -300,15 +300,15 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
DoScriptText(SAY_EVENT_INTRO_1, m_creature);
|
||||
DoScriptText(SAY_EVENT_INTRO_1, me);
|
||||
SetEscortPaused(true);
|
||||
JumpToNextStep(20000);
|
||||
break;
|
||||
case 17:
|
||||
DoScriptText(SAY_EVENT_INTRO_2, m_creature);
|
||||
DoScriptText(SAY_EVENT_INTRO_2, me);
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_TRIBUNAL_CONSOLE),true);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
SetEscortPaused(true);
|
||||
JumpToNextStep(8500);
|
||||
break;
|
||||
@@ -326,16 +326,16 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
{
|
||||
uint32 uiSpawnNumber = DUNGEON_MODE(2,3);
|
||||
for (uint8 i = 0; i < uiSpawnNumber; ++i)
|
||||
m_creature->SummonCreature(CREATURE_DARK_RUNE_PROTECTOR, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
|
||||
m_creature->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
|
||||
me->SummonCreature(CREATURE_DARK_RUNE_PROTECTOR, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
|
||||
me->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
m_creature->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
|
||||
me->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
|
||||
break;
|
||||
case 3:
|
||||
m_creature->SummonCreature(CREATURE_IRON_GOLEM_CUSTODIAN, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
|
||||
me->SummonCreature(CREATURE_IRON_GOLEM_CUSTODIAN, SpawnLocations[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -343,8 +343,8 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
void JustSummoned(Creature* pSummoned)
|
||||
{
|
||||
lDwarfGUIDList.push_back(pSummoned->GetGUID());
|
||||
pSummoned->AddThreat(m_creature, 0.0f);
|
||||
pSummoned->AI()->AttackStart(m_creature);
|
||||
pSummoned->AddThreat(me, 0.0f);
|
||||
pSummoned->AI()->AttackStart(me);
|
||||
}
|
||||
|
||||
void JumpToNextStep(uint32 uiTimer)
|
||||
@@ -355,7 +355,7 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
|
||||
void StartWP()
|
||||
{
|
||||
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
SetEscortPaused(false);
|
||||
uiStep = 1;
|
||||
Start();
|
||||
@@ -381,7 +381,7 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
pInstance->SetData(DATA_BRANN_EVENT, IN_PROGRESS);
|
||||
}
|
||||
bIsBattle = false;
|
||||
DoScriptText(SAY_ESCORT_START, m_creature);
|
||||
DoScriptText(SAY_ESCORT_START, me);
|
||||
SetRun(true);
|
||||
JumpToNextStep(0);
|
||||
break;
|
||||
@@ -391,49 +391,49 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
break;
|
||||
case 5:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM))))
|
||||
if (Creature* pTemp = (Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM))))
|
||||
DoScriptText(SAY_EVENT_INTRO_3_ABED, pTemp);
|
||||
JumpToNextStep(8500);
|
||||
break;
|
||||
case 6:
|
||||
DoScriptText(SAY_EVENT_A_1, m_creature);
|
||||
DoScriptText(SAY_EVENT_A_1, me);
|
||||
JumpToNextStep(6500);
|
||||
break;
|
||||
case 7:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_KADDRAK)))
|
||||
DoScriptText(SAY_EVENT_A_2_KADD, pTemp);
|
||||
JumpToNextStep(12500);
|
||||
break;
|
||||
case 8:
|
||||
DoScriptText(SAY_EVENT_A_3, m_creature);
|
||||
DoScriptText(SAY_EVENT_A_3, me);
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_KADDRAK),true);
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, uiControllerGUID))
|
||||
CAST_AI(mob_tribuna_controllerAI, pTemp->AI())->bKaddrakActivated = true;
|
||||
JumpToNextStep(5000);
|
||||
break;
|
||||
case 9:
|
||||
m_creature->SetReactState(REACT_PASSIVE);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
SpawnDwarf(1);
|
||||
JumpToNextStep(20000);
|
||||
break;
|
||||
case 10:
|
||||
DoScriptText(SAY_EVENT_B_1, m_creature);
|
||||
DoScriptText(SAY_EVENT_B_1, me);
|
||||
JumpToNextStep(6000);
|
||||
break;
|
||||
case 11:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_MARNAK)))
|
||||
DoScriptText(SAY_EVENT_B_2_MARN, pTemp);
|
||||
SpawnDwarf(1);
|
||||
JumpToNextStep(20000);
|
||||
break;
|
||||
case 12:
|
||||
DoScriptText(SAY_EVENT_B_3, m_creature);
|
||||
DoScriptText(SAY_EVENT_B_3, me);
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_MARNAK),true);
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, uiControllerGUID))
|
||||
CAST_AI(mob_tribuna_controllerAI, pTemp->AI())->bMarnakActivated = true;
|
||||
JumpToNextStep(10000);
|
||||
break;
|
||||
@@ -446,7 +446,7 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
JumpToNextStep(20000);
|
||||
break;
|
||||
case 15:
|
||||
DoScriptText(SAY_EVENT_C_1, m_creature);
|
||||
DoScriptText(SAY_EVENT_C_1, me);
|
||||
SpawnDwarf(1);
|
||||
JumpToNextStep(10000);
|
||||
break;
|
||||
@@ -456,16 +456,16 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
break;
|
||||
case 17:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
DoScriptText(SAY_EVENT_C_2_ABED, pTemp);
|
||||
SpawnDwarf(1);
|
||||
JumpToNextStep(20000);
|
||||
break;
|
||||
case 18:
|
||||
DoScriptText(SAY_EVENT_C_3, m_creature);
|
||||
DoScriptText(SAY_EVENT_C_3, me);
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_ABEDNEUM),true);
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, uiControllerGUID))
|
||||
CAST_AI(mob_tribuna_controllerAI, pTemp->AI())->bAbedneumActivated = true;
|
||||
JumpToNextStep(5000);
|
||||
break;
|
||||
@@ -478,13 +478,13 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
JumpToNextStep(15000);
|
||||
break;
|
||||
case 21:
|
||||
DoScriptText(SAY_EVENT_D_1, m_creature);
|
||||
DoScriptText(SAY_EVENT_D_1, me);
|
||||
SpawnDwarf(3);
|
||||
JumpToNextStep(20000);
|
||||
break;
|
||||
case 22:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
DoScriptText(SAY_EVENT_D_2_ABED, pTemp);
|
||||
SpawnDwarf(1);
|
||||
JumpToNextStep(5000);
|
||||
@@ -494,7 +494,7 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
JumpToNextStep(15000);
|
||||
break;
|
||||
case 24:
|
||||
DoScriptText(SAY_EVENT_D_3, m_creature);
|
||||
DoScriptText(SAY_EVENT_D_3, me);
|
||||
SpawnDwarf(3);
|
||||
JumpToNextStep(5000);
|
||||
break;
|
||||
@@ -508,25 +508,25 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
break;
|
||||
case 27:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
DoScriptText(SAY_EVENT_D_4_ABED, pTemp);
|
||||
SpawnDwarf(1);
|
||||
JumpToNextStep(10000);
|
||||
break;
|
||||
case 28:
|
||||
m_creature->SetReactState(REACT_DEFENSIVE);
|
||||
DoScriptText(SAY_EVENT_END_01, m_creature);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
DoScriptText(SAY_EVENT_END_01, me);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_SKY_FLOOR),true);
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, uiControllerGUID))
|
||||
pTemp->DealDamage(pTemp, pTemp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
bIsBattle = true;
|
||||
SetEscortPaused(false);
|
||||
JumpToNextStep(6500);
|
||||
break;
|
||||
case 29:
|
||||
DoScriptText(SAY_EVENT_END_02, m_creature);
|
||||
DoScriptText(SAY_EVENT_END_02, me);
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_BRANN_EVENT, DONE);
|
||||
@@ -543,97 +543,97 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
break;
|
||||
case 30:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
DoScriptText(SAY_EVENT_END_03_ABED, pTemp);
|
||||
JumpToNextStep(8500);
|
||||
break;
|
||||
case 31:
|
||||
DoScriptText(SAY_EVENT_END_04, m_creature);
|
||||
DoScriptText(SAY_EVENT_END_04, me);
|
||||
JumpToNextStep(11500);
|
||||
break;
|
||||
case 32:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
DoScriptText(SAY_EVENT_END_05_ABED, pTemp);
|
||||
JumpToNextStep(11500);
|
||||
break;
|
||||
case 33:
|
||||
DoScriptText(SAY_EVENT_END_06, m_creature);
|
||||
DoScriptText(SAY_EVENT_END_06, me);
|
||||
JumpToNextStep(4500);
|
||||
break;
|
||||
case 34:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
DoScriptText(SAY_EVENT_END_07_ABED, pTemp);
|
||||
JumpToNextStep(22500);
|
||||
break;
|
||||
case 35:
|
||||
DoScriptText(SAY_EVENT_END_08, m_creature);
|
||||
DoScriptText(SAY_EVENT_END_08, me);
|
||||
JumpToNextStep(7500);
|
||||
break;
|
||||
case 36:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_KADDRAK)))
|
||||
DoScriptText(SAY_EVENT_END_09_KADD, pTemp);
|
||||
JumpToNextStep(18500);
|
||||
break;
|
||||
case 37:
|
||||
DoScriptText(SAY_EVENT_END_10, m_creature);
|
||||
DoScriptText(SAY_EVENT_END_10, me);
|
||||
JumpToNextStep(5500);
|
||||
break;
|
||||
case 38:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_KADDRAK)))
|
||||
DoScriptText(SAY_EVENT_END_11_KADD, pTemp);
|
||||
JumpToNextStep(20500);
|
||||
break;
|
||||
case 39:
|
||||
DoScriptText(SAY_EVENT_END_12, m_creature);
|
||||
DoScriptText(SAY_EVENT_END_12, me);
|
||||
JumpToNextStep(2500);
|
||||
break;
|
||||
case 40:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_KADDRAK)))
|
||||
DoScriptText(SAY_EVENT_END_13_KADD, pTemp);
|
||||
JumpToNextStep(19500);
|
||||
break;
|
||||
case 41:
|
||||
DoScriptText(SAY_EVENT_END_14, m_creature);
|
||||
DoScriptText(SAY_EVENT_END_14, me);
|
||||
JumpToNextStep(10500);
|
||||
break;
|
||||
case 42:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_MARNAK)))
|
||||
DoScriptText(SAY_EVENT_END_15_MARN, pTemp);
|
||||
JumpToNextStep(6500);
|
||||
break;
|
||||
case 43:
|
||||
DoScriptText(SAY_EVENT_END_16, m_creature);
|
||||
DoScriptText(SAY_EVENT_END_16, me);
|
||||
JumpToNextStep(6500);
|
||||
break;
|
||||
case 44:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_MARNAK)))
|
||||
DoScriptText(SAY_EVENT_END_17_MARN, pTemp);
|
||||
JumpToNextStep(25500);
|
||||
break;
|
||||
case 45:
|
||||
DoScriptText(SAY_EVENT_END_18, m_creature);
|
||||
DoScriptText(SAY_EVENT_END_18, me);
|
||||
JumpToNextStep(23500);
|
||||
break;
|
||||
case 46:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_MARNAK)))
|
||||
DoScriptText(SAY_EVENT_END_19_MARN, pTemp);
|
||||
JumpToNextStep(3500);
|
||||
break;
|
||||
case 47:
|
||||
DoScriptText(SAY_EVENT_END_20, m_creature);
|
||||
DoScriptText(SAY_EVENT_END_20, me);
|
||||
JumpToNextStep(8500);
|
||||
break;
|
||||
case 48:
|
||||
if (pInstance)
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, pInstance->GetData64(DATA_ABEDNEUM)))
|
||||
DoScriptText(SAY_EVENT_END_21_ABED, pTemp);
|
||||
JumpToNextStep(5500);
|
||||
break;
|
||||
@@ -648,8 +648,8 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
}
|
||||
Player* pPlayer = GetPlayerForEscort();
|
||||
if (pPlayer)
|
||||
pPlayer->GroupEventHappens(QUEST_HALLS_OF_STONE, m_creature);
|
||||
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
pPlayer->GroupEventHappens(QUEST_HALLS_OF_STONE, me);
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
JumpToNextStep(180000);
|
||||
break;
|
||||
}
|
||||
@@ -661,7 +661,7 @@ struct npc_brann_hosAI : public npc_escortAI
|
||||
|
||||
if (!bIsLowHP && HealthBelowPct(30))
|
||||
{
|
||||
DoScriptText(SAY_LOW_HEALTH, m_creature);
|
||||
DoScriptText(SAY_LOW_HEALTH, me);
|
||||
bIsLowHP = true;
|
||||
}
|
||||
else if (bIsLowHP && !HealthBelowPct(30))
|
||||
|
||||
@@ -114,14 +114,14 @@ struct boss_algalonAI : public ScriptedAI
|
||||
{
|
||||
if (Summon)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
me->InterruptSpell(CURRENT_CHANNELED_SPELL);
|
||||
DoZoneInCombat(who->ToCreature());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->SetReactState(REACT_PASSIVE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
uiStep = 1;
|
||||
}
|
||||
|
||||
@@ -131,14 +131,14 @@ struct boss_algalonAI : public ScriptedAI
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Phase = 1;
|
||||
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_ALGALON, NOT_STARTED);
|
||||
|
||||
@@ -168,7 +168,7 @@ struct boss_algalonAI : public ScriptedAI
|
||||
|
||||
for (std::list<uint64>::const_iterator itr = m_lCollapsingStarGUIDList.begin(); itr != m_lCollapsingStarGUIDList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
|
||||
if (Creature* pTemp = Unit::GetCreature(*me, *itr))
|
||||
{
|
||||
if (pTemp->isAlive())
|
||||
pTemp->ForcedDespawn();
|
||||
@@ -182,17 +182,17 @@ struct boss_algalonAI : public ScriptedAI
|
||||
if (pSummoned->GetEntry() == CREATURE_COLLAPSING_STAR)
|
||||
{
|
||||
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
if (m_creature->getVictim())
|
||||
pSummoned->AI()->AttackStart(pTarget ? pTarget : m_creature->getVictim());
|
||||
if (me->getVictim())
|
||||
pSummoned->AI()->AttackStart(pTarget ? pTarget : me->getVictim());
|
||||
m_lCollapsingStarGUIDList.push_back(pSummoned->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void SummonCollapsingStar(Unit* target)
|
||||
{
|
||||
DoScriptText(SAY_SUMMON_COLLAPSING_STAR, m_creature);
|
||||
m_creature->SummonCreature(CREATURE_COLLAPSING_STAR,target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN, 100000);
|
||||
m_creature->SummonCreature(CREATURE_BLACK_HOLE,target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN, 27000);
|
||||
DoScriptText(SAY_SUMMON_COLLAPSING_STAR, me);
|
||||
me->SummonCreature(CREATURE_COLLAPSING_STAR,target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN, 100000);
|
||||
me->SummonCreature(CREATURE_BLACK_HOLE,target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN, 27000);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
@@ -204,21 +204,21 @@ struct boss_algalonAI : public ScriptedAI
|
||||
if (Phase == 1 && HealthBelowPct(20))
|
||||
{
|
||||
Phase = 2;
|
||||
DoScriptText(SAY_PHASE_2, m_creature);
|
||||
DoScriptText(SAY_PHASE_2, me);
|
||||
}
|
||||
|
||||
if (HealthBelowPct(2))
|
||||
{
|
||||
m_creature->SummonGameObject(GAMEOBJECT_GIVE_OF_THE_OBSERVER, 1634.258667, -295.101166,417.321381,0,0,0,0,0,-10);
|
||||
me->SummonGameObject(GAMEOBJECT_GIVE_OF_THE_OBSERVER, 1634.258667, -295.101166,417.321381,0,0,0,0,0,-10);
|
||||
|
||||
// All of them. or random?
|
||||
DoScriptText(SAY_DEATH_1, m_creature);
|
||||
DoScriptText(SAY_DEATH_2, m_creature);
|
||||
DoScriptText(SAY_DEATH_3, m_creature);
|
||||
DoScriptText(SAY_DEATH_4, m_creature);
|
||||
DoScriptText(SAY_DEATH_5, m_creature);
|
||||
DoScriptText(SAY_DEATH_1, me);
|
||||
DoScriptText(SAY_DEATH_2, me);
|
||||
DoScriptText(SAY_DEATH_3, me);
|
||||
DoScriptText(SAY_DEATH_4, me);
|
||||
DoScriptText(SAY_DEATH_5, me);
|
||||
|
||||
m_creature->DisappearAndDie();
|
||||
me->DisappearAndDie();
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_ALGALON, DONE);
|
||||
@@ -235,24 +235,24 @@ struct boss_algalonAI : public ScriptedAI
|
||||
switch(uiStep)
|
||||
{
|
||||
case 1:
|
||||
DoScriptText(SAY_SUMMON_1, m_creature);
|
||||
DoScriptText(SAY_SUMMON_1, me);
|
||||
JumpToNextStep(3000);
|
||||
break;
|
||||
case 2:
|
||||
DoScriptText(SAY_SUMMON_2, m_creature);
|
||||
DoScriptText(SAY_SUMMON_2, me);
|
||||
JumpToNextStep(3000);
|
||||
break;
|
||||
case 3:
|
||||
DoScriptText(SAY_SUMMON_3, m_creature);
|
||||
DoScriptText(SAY_SUMMON_3, me);
|
||||
JumpToNextStep(3000);
|
||||
break;
|
||||
case 4:
|
||||
DoScriptText(SAY_ENGADED_FOR_FIRTS_TIME, m_creature);
|
||||
DoScriptText(SAY_ENGADED_FOR_FIRTS_TIME, me);
|
||||
JumpToNextStep(3000);
|
||||
break;
|
||||
case 5:
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->SetReactState(REACT_AGGRESSIVE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
Summon = true;
|
||||
break;
|
||||
}
|
||||
@@ -263,29 +263,29 @@ struct boss_algalonAI : public ScriptedAI
|
||||
|
||||
if (QuantumStrike_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), RAID_MODE(SPELL_QUANTUM_STRIKE,H_SPELL_QUANTUM_STRIKE), true);
|
||||
DoCast(me->getVictim(), RAID_MODE(SPELL_QUANTUM_STRIKE,H_SPELL_QUANTUM_STRIKE), true);
|
||||
|
||||
QuantumStrike_Timer = urand(4000, 14000);
|
||||
} else QuantumStrike_Timer -= diff;
|
||||
|
||||
if (BigBang_Timer <= diff)
|
||||
{
|
||||
DoScriptText(RAND(SAY_BIG_BANG_1,SAY_BIG_BANG_2), m_creature);
|
||||
DoCast(m_creature->getVictim(), RAID_MODE(SPELL_BIG_BANG,H_SPELL_BIG_BANG), true);
|
||||
DoScriptText(RAND(SAY_BIG_BANG_1,SAY_BIG_BANG_2), me);
|
||||
DoCast(me->getVictim(), RAID_MODE(SPELL_BIG_BANG,H_SPELL_BIG_BANG), true);
|
||||
|
||||
BigBang_Timer = 90000;
|
||||
} else BigBang_Timer -= diff;
|
||||
|
||||
if (Ascend_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(),SPELL_ASCEND, true);
|
||||
DoCast(me->getVictim(),SPELL_ASCEND, true);
|
||||
|
||||
Ascend_Timer = 480000;
|
||||
} else Ascend_Timer -= diff;
|
||||
|
||||
if (PhasePunch_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(),SPELL_PHASE_PUNCH, true);
|
||||
DoCast(me->getVictim(),SPELL_PHASE_PUNCH, true);
|
||||
|
||||
PhasePunch_Timer = 8000;
|
||||
} else PhasePunch_Timer -= diff;
|
||||
@@ -299,8 +299,8 @@ struct boss_algalonAI : public ScriptedAI
|
||||
|
||||
if (Berserk_Timer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_BERSERK, m_creature);
|
||||
DoCast(m_creature->getVictim(),SPELL_BERSERK, true);
|
||||
DoScriptText(SAY_BERSERK, me);
|
||||
DoCast(me->getVictim(),SPELL_BERSERK, true);
|
||||
|
||||
Berserk_Timer = 360000;
|
||||
} else Berserk_Timer -= diff;
|
||||
@@ -316,8 +316,8 @@ struct boss_algalonAI : public ScriptedAI
|
||||
{
|
||||
if (Ascend_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_ASCEND);
|
||||
DoScriptText(SAY_BERSERK, m_creature);
|
||||
DoCast(me, SPELL_ASCEND);
|
||||
DoScriptText(SAY_BERSERK, me);
|
||||
Ascend_Timer = urand(360000,365000);
|
||||
Enrage = false;
|
||||
} else Ascend_Timer -= diff;
|
||||
@@ -352,7 +352,7 @@ struct mob_collapsing_starAI : public ScriptedAI
|
||||
|
||||
if (BlackHoleExplosion_Timer <= diff)
|
||||
{
|
||||
m_creature->CastSpell(m_creature, SPELL_BLACK_HOLE_EXPLOSION, false);
|
||||
me->CastSpell(me, SPELL_BLACK_HOLE_EXPLOSION, false);
|
||||
BlackHoleExplosion_Timer = 0;
|
||||
} else BlackHoleExplosion_Timer -= diff;
|
||||
}
|
||||
|
||||
@@ -113,9 +113,9 @@ enum Yells
|
||||
SAY_BRUNDIR_BERSERK = -1603047,
|
||||
};
|
||||
|
||||
bool IsEncounterComplete(ScriptedInstance* pInstance, Creature* m_creature)
|
||||
bool IsEncounterComplete(ScriptedInstance* pInstance, Creature* me)
|
||||
{
|
||||
if (!pInstance || !m_creature)
|
||||
if (!pInstance || !me)
|
||||
return false;
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
@@ -124,7 +124,7 @@ bool IsEncounterComplete(ScriptedInstance* pInstance, Creature* m_creature)
|
||||
if (!guid)
|
||||
return false;
|
||||
|
||||
if (Creature *boss = Unit::GetCreature(*m_creature, guid))
|
||||
if (Creature *boss = Unit::GetCreature(*me, guid))
|
||||
{
|
||||
if (boss->isAlive())
|
||||
return false;
|
||||
@@ -146,7 +146,7 @@ struct boss_steelbreakerAI : public ScriptedAI
|
||||
{
|
||||
events.Reset();
|
||||
phase = 0;
|
||||
m_creature->RemoveAllAuras();
|
||||
me->RemoveAllAuras();
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_ASSEMBLY, NOT_STARTED);
|
||||
}
|
||||
@@ -157,9 +157,9 @@ struct boss_steelbreakerAI : public ScriptedAI
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
DoScriptText(SAY_STEELBREAKER_AGGRO, m_creature);
|
||||
DoScriptText(SAY_STEELBREAKER_AGGRO, me);
|
||||
DoZoneInCombat();
|
||||
DoCast(m_creature, RAID_MODE(SPELL_HIGH_VOLTAGE, SPELL_HIGH_VOLTAGE_H));
|
||||
DoCast(me, RAID_MODE(SPELL_HIGH_VOLTAGE, SPELL_HIGH_VOLTAGE_H));
|
||||
events.ScheduleEvent(EVENT_ENRAGE, 900000);
|
||||
UpdatePhase();
|
||||
}
|
||||
@@ -177,13 +177,13 @@ struct boss_steelbreakerAI : public ScriptedAI
|
||||
|
||||
void DamageTaken(Unit* pKiller, uint32 &damage)
|
||||
{
|
||||
if (damage >= m_creature->GetHealth())
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
if (Creature* Brundir = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_STORMCALLER_BRUNDIR) : 0))
|
||||
if (Creature* Brundir = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_STORMCALLER_BRUNDIR) : 0))
|
||||
if (Brundir->isAlive())
|
||||
Brundir->SetHealth(Brundir->GetMaxHealth());
|
||||
|
||||
if (Creature* Molgeim = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_RUNEMASTER_MOLGEIM) : 0))
|
||||
if (Creature* Molgeim = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_RUNEMASTER_MOLGEIM) : 0))
|
||||
if (Molgeim->isAlive())
|
||||
Molgeim->SetHealth(Molgeim->GetMaxHealth());
|
||||
|
||||
@@ -193,17 +193,17 @@ struct boss_steelbreakerAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
DoScriptText(RAND(SAY_STEELBREAKER_DEATH_1,SAY_STEELBREAKER_DEATH_2), m_creature);
|
||||
if (IsEncounterComplete(pInstance, m_creature) && pInstance)
|
||||
DoScriptText(RAND(SAY_STEELBREAKER_DEATH_1,SAY_STEELBREAKER_DEATH_2), me);
|
||||
if (IsEncounterComplete(pInstance, me) && pInstance)
|
||||
pInstance->SetData(TYPE_ASSEMBLY, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *who)
|
||||
{
|
||||
DoScriptText(RAND(SAY_STEELBREAKER_SLAY_1,SAY_STEELBREAKER_SLAY_2), m_creature);
|
||||
DoScriptText(RAND(SAY_STEELBREAKER_SLAY_1,SAY_STEELBREAKER_SLAY_2), me);
|
||||
|
||||
if (phase == 3)
|
||||
DoCast(m_creature, SPELL_ELECTRICAL_CHARGE);
|
||||
DoCast(me, SPELL_ELECTRICAL_CHARGE);
|
||||
}
|
||||
|
||||
void SpellHit(Unit *from, const SpellEntry *spell)
|
||||
@@ -224,7 +224,7 @@ struct boss_steelbreakerAI : public ScriptedAI
|
||||
switch(eventId)
|
||||
{
|
||||
case EVENT_ENRAGE:
|
||||
DoScriptText(SAY_STEELBREAKER_BERSERK, m_creature);
|
||||
DoScriptText(SAY_STEELBREAKER_BERSERK, me);
|
||||
DoCast(SPELL_BERSERK);
|
||||
break;
|
||||
case EVENT_FUSION_PUNCH:
|
||||
@@ -237,7 +237,7 @@ struct boss_steelbreakerAI : public ScriptedAI
|
||||
events.ScheduleEvent(EVENT_STATIC_DISRUPTION, urand(20000, 40000));
|
||||
break;
|
||||
case EVENT_OVERWHELMING_POWER:
|
||||
DoScriptText(SAY_STEELBREAKER_POWER, m_creature);
|
||||
DoScriptText(SAY_STEELBREAKER_POWER, me);
|
||||
DoCast(me->getVictim(), RAID_MODE(SPELL_OVERWHELMING_POWER, SPELL_OVERWHELMING_POWER_H));
|
||||
events.ScheduleEvent(EVENT_OVERWHELMING_POWER, RAID_MODE(60000, 35000));
|
||||
break;
|
||||
@@ -260,7 +260,7 @@ struct boss_runemaster_molgeimAI : public ScriptedAI
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_ASSEMBLY, NOT_STARTED);
|
||||
events.Reset();
|
||||
m_creature->RemoveAllAuras();
|
||||
me->RemoveAllAuras();
|
||||
phase = 0;
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ struct boss_runemaster_molgeimAI : public ScriptedAI
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_MOLGEIM_AGGRO, m_creature);
|
||||
DoScriptText(SAY_MOLGEIM_AGGRO, me);
|
||||
DoZoneInCombat();
|
||||
events.ScheduleEvent(EVENT_ENRAGE, 900000);
|
||||
UpdatePhase();
|
||||
@@ -290,30 +290,30 @@ struct boss_runemaster_molgeimAI : public ScriptedAI
|
||||
|
||||
void DamageTaken(Unit* pKiller, uint32 &damage)
|
||||
{
|
||||
if (damage >= m_creature->GetHealth())
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
if (Creature* Steelbreaker = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_STEELBREAKER) : 0))
|
||||
if (Creature* Steelbreaker = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_STEELBREAKER) : 0))
|
||||
if (Steelbreaker->isAlive())
|
||||
Steelbreaker->SetHealth(Steelbreaker->GetMaxHealth());
|
||||
|
||||
if (Creature* Brundir = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_STORMCALLER_BRUNDIR) : 0))
|
||||
if (Creature* Brundir = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_STORMCALLER_BRUNDIR) : 0))
|
||||
if (Brundir->isAlive())
|
||||
Brundir->SetHealth(Brundir->GetMaxHealth());
|
||||
|
||||
DoCast(m_creature, SPELL_SUPERCHARGE);
|
||||
DoCast(me, SPELL_SUPERCHARGE);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
DoScriptText(RAND(SAY_MOLGEIM_DEATH_1,SAY_MOLGEIM_DEATH_2), m_creature);
|
||||
if (IsEncounterComplete(pInstance, m_creature) && pInstance)
|
||||
DoScriptText(RAND(SAY_MOLGEIM_DEATH_1,SAY_MOLGEIM_DEATH_2), me);
|
||||
if (IsEncounterComplete(pInstance, me) && pInstance)
|
||||
pInstance->SetData(TYPE_ASSEMBLY, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *who)
|
||||
{
|
||||
DoScriptText(RAND(SAY_MOLGEIM_SLAY_1,SAY_MOLGEIM_SLAY_2), m_creature);
|
||||
DoScriptText(RAND(SAY_MOLGEIM_SLAY_1,SAY_MOLGEIM_SLAY_2), me);
|
||||
}
|
||||
|
||||
void SpellHit(Unit *from, const SpellEntry *spell)
|
||||
@@ -334,30 +334,30 @@ struct boss_runemaster_molgeimAI : public ScriptedAI
|
||||
switch(eventId)
|
||||
{
|
||||
case EVENT_ENRAGE:
|
||||
DoScriptText(SAY_MOLGEIM_BERSERK, m_creature);
|
||||
DoScriptText(SAY_MOLGEIM_BERSERK, me);
|
||||
DoCast(SPELL_BERSERK);
|
||||
break;
|
||||
case EVENT_RUNE_OF_POWER: // Improve target selection; random alive friendly
|
||||
{
|
||||
Unit *pTarget = DoSelectLowestHpFriendly(60);
|
||||
if (!pTarget || (pTarget && !pTarget->isAlive()))
|
||||
pTarget = m_creature;
|
||||
pTarget = me;
|
||||
DoCast(pTarget, SPELL_RUNE_OF_POWER);
|
||||
events.ScheduleEvent(EVENT_RUNE_OF_POWER, 60000);
|
||||
break;
|
||||
}
|
||||
case EVENT_SHIELD_OF_RUNES:
|
||||
DoCast(m_creature, RAID_MODE(SPELL_SHIELD_OF_RUNES, SPELL_SHIELD_OF_RUNES_H));
|
||||
DoCast(me, RAID_MODE(SPELL_SHIELD_OF_RUNES, SPELL_SHIELD_OF_RUNES_H));
|
||||
events.ScheduleEvent(EVENT_SHIELD_OF_RUNES, urand(27000,34000));
|
||||
break;
|
||||
case EVENT_RUNE_OF_DEATH:
|
||||
DoScriptText(SAY_MOLGEIM_RUNE_DEATH, m_creature);
|
||||
DoScriptText(SAY_MOLGEIM_RUNE_DEATH, me);
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
DoCast(pTarget, SPELL_RUNE_OF_DEATH);
|
||||
events.ScheduleEvent(EVENT_RUNE_OF_DEATH, urand(30000,40000));
|
||||
break;
|
||||
case EVENT_RUNE_OF_SUMMONING:
|
||||
DoScriptText(SAY_MOLGEIM_SUMMON, m_creature);
|
||||
DoScriptText(SAY_MOLGEIM_SUMMON, me);
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
DoCast(pTarget, SPELL_RUNE_OF_SUMMONING);
|
||||
events.ScheduleEvent(EVENT_RUNE_OF_SUMMONING, urand(20000,30000));
|
||||
@@ -378,26 +378,26 @@ struct mob_lightning_elementalAI : public ScriptedAI
|
||||
|
||||
void Charge()
|
||||
{
|
||||
Unit* pTarget = m_creature->SelectNearestTarget();
|
||||
m_creature->AddThreat(pTarget, 5000000.0f);
|
||||
Unit* pTarget = me->SelectNearestTarget();
|
||||
me->AddThreat(pTarget, 5000000.0f);
|
||||
AttackStart(pTarget);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!m_creature->isInCombat())
|
||||
if (!me->isInCombat())
|
||||
return;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
|
||||
if (me->IsWithinMeleeRange(me->getVictim()))
|
||||
{
|
||||
DoCast(m_creature->getVictim(), RAID_MODE(SPELL_LIGHTNING_BLAST, SPELL_LIGHTNING_BLAST_H));
|
||||
m_creature->Kill(m_creature); // hack until spell works
|
||||
DoCast(me->getVictim(), RAID_MODE(SPELL_LIGHTNING_BLAST, SPELL_LIGHTNING_BLAST_H));
|
||||
me->Kill(me); // hack until spell works
|
||||
}
|
||||
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); // needed at every update?
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim()); // needed at every update?
|
||||
}
|
||||
};
|
||||
|
||||
@@ -410,8 +410,8 @@ struct mob_rune_of_summoningAI : public ScriptedAI
|
||||
|
||||
void SummonLightningElemental()
|
||||
{
|
||||
m_creature->SummonCreature(CREATURE_RUNE_OF_SUMMONING, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth());
|
||||
me->SummonCreature(CREATURE_RUNE_OF_SUMMONING, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
me->DealDamage(me, me->GetHealth());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -426,7 +426,7 @@ struct boss_stormcaller_brundirAI : public ScriptedAI
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_ASSEMBLY, NOT_STARTED);
|
||||
m_creature->RemoveAllAuras();
|
||||
me->RemoveAllAuras();
|
||||
events.Reset();
|
||||
phase = 0;
|
||||
}
|
||||
@@ -437,7 +437,7 @@ struct boss_stormcaller_brundirAI : public ScriptedAI
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_BRUNDIR_AGGRO, m_creature);
|
||||
DoScriptText(SAY_BRUNDIR_AGGRO, me);
|
||||
DoZoneInCombat();
|
||||
events.ScheduleEvent(EVENT_ENRAGE, 900000);
|
||||
UpdatePhase();
|
||||
@@ -453,20 +453,20 @@ struct boss_stormcaller_brundirAI : public ScriptedAI
|
||||
events.RescheduleEvent(EVENT_LIGHTNING_WHIRL, urand(20000,40000));
|
||||
if (phase >= 3)
|
||||
{
|
||||
DoCast(m_creature, SPELL_STORMSHIELD);
|
||||
DoCast(me, SPELL_STORMSHIELD);
|
||||
events.RescheduleEvent(EVENT_LIGHTNING_TENDRILS, urand(40000,80000));
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* pKiller, uint32 &damage)
|
||||
{
|
||||
if (damage >= m_creature->GetHealth())
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
if (Creature* Steelbreaker = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_STEELBREAKER) : 0))
|
||||
if (Creature* Steelbreaker = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_STEELBREAKER) : 0))
|
||||
if (Steelbreaker->isAlive())
|
||||
Steelbreaker->SetHealth(Steelbreaker->GetMaxHealth());
|
||||
|
||||
if (Creature* Molgeim = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_RUNEMASTER_MOLGEIM) : 0))
|
||||
if (Creature* Molgeim = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_RUNEMASTER_MOLGEIM) : 0))
|
||||
if (Molgeim->isAlive())
|
||||
Molgeim->SetHealth(Molgeim->GetMaxHealth());
|
||||
|
||||
@@ -476,14 +476,14 @@ struct boss_stormcaller_brundirAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
DoScriptText(RAND(SAY_BRUNDIR_DEATH_1,SAY_BRUNDIR_DEATH_2), m_creature);
|
||||
if (IsEncounterComplete(pInstance, m_creature) && pInstance)
|
||||
DoScriptText(RAND(SAY_BRUNDIR_DEATH_1,SAY_BRUNDIR_DEATH_2), me);
|
||||
if (IsEncounterComplete(pInstance, me) && pInstance)
|
||||
pInstance->SetData(TYPE_ASSEMBLY, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *who)
|
||||
{
|
||||
DoScriptText(RAND(SAY_BRUNDIR_SLAY_1,SAY_BRUNDIR_SLAY_2), m_creature);
|
||||
DoScriptText(RAND(SAY_BRUNDIR_SLAY_1,SAY_BRUNDIR_SLAY_2), me);
|
||||
}
|
||||
|
||||
void SpellHit(Unit *from, const SpellEntry *spell)
|
||||
@@ -504,7 +504,7 @@ struct boss_stormcaller_brundirAI : public ScriptedAI
|
||||
switch(eventId)
|
||||
{
|
||||
case EVENT_ENRAGE:
|
||||
DoScriptText(SAY_BRUNDIR_BERSERK, m_creature);
|
||||
DoScriptText(SAY_BRUNDIR_BERSERK, me);
|
||||
DoCast(SPELL_BERSERK);
|
||||
break;
|
||||
case EVENT_CHAIN_LIGHTNING:
|
||||
|
||||
@@ -53,17 +53,17 @@ struct boss_auriaya_AI : public BossAI
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
_EnterCombat();
|
||||
DoScriptText(SAY_AGGRO,m_creature);
|
||||
DoScriptText(SAY_AGGRO,me);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
|
||||
@@ -99,14 +99,14 @@ struct boss_flame_leviathanAI : public BossAI
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
m_creature->SetReactState(REACT_AGGRESSIVE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
_EnterCombat();
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
m_creature->SetReactState(REACT_DEFENSIVE);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
events.ScheduleEvent(EVENT_PURSUE, 0);
|
||||
events.ScheduleEvent(EVENT_MISSILE, 1500);
|
||||
events.ScheduleEvent(EVENT_VENT, 20000);
|
||||
@@ -127,7 +127,7 @@ struct boss_flame_leviathanAI : public BossAI
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
@@ -136,15 +136,15 @@ struct boss_flame_leviathanAI : public BossAI
|
||||
if (spell->Id == 62472)
|
||||
vehicle->InstallAllAccessories();
|
||||
else if (spell->Id == SPELL_ELECTROSHOCK)
|
||||
m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
|
||||
me->InterruptSpell(CURRENT_CHANNELED_SPELL);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!m_creature->isInCombat())
|
||||
if (!me->isInCombat())
|
||||
return;
|
||||
|
||||
if (m_creature->getThreatManager().isThreatListEmpty())
|
||||
if (me->getThreatManager().isThreatListEmpty())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
@@ -152,11 +152,11 @@ struct boss_flame_leviathanAI : public BossAI
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (m_creature->hasUnitState(UNIT_STAT_CASTING))
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
uint32 eventId = events.GetEvent();
|
||||
if (!m_creature->getVictim())
|
||||
if (!me->getVictim())
|
||||
eventId = EVENT_PURSUE;
|
||||
|
||||
switch(eventId)
|
||||
@@ -166,7 +166,7 @@ struct boss_flame_leviathanAI : public BossAI
|
||||
DoCastAOE(SPELL_PURSUED, true);
|
||||
//events.RepeatEvent(35000); // this should not be used because eventId may be overriden
|
||||
events.RescheduleEvent(EVENT_PURSUE, 35000);
|
||||
if (!m_creature->getVictim()) // all siege engines and demolishers are dead
|
||||
if (!me->getVictim()) // all siege engines and demolishers are dead
|
||||
UpdateVictim(); // begin to kill other things
|
||||
return;
|
||||
case EVENT_MISSILE:
|
||||
@@ -189,11 +189,11 @@ struct boss_flame_leviathanAI : public BossAI
|
||||
events.RepeatEvent(2000);
|
||||
return;
|
||||
case EVENT_MIMIRON_INFERNO: // Not Blizzlike
|
||||
DoCast(m_creature->getVictim(), SPELL_MIMIRON_INFERNO);
|
||||
DoCast(me->getVictim(), SPELL_MIMIRON_INFERNO);
|
||||
events.RepeatEvent(urand(60000, 120000));
|
||||
return;
|
||||
case EVENT_HODIR_FURY: // Not Blizzlike
|
||||
DoCast(m_creature->getVictim(), SPELL_HODIR_FURY);
|
||||
DoCast(me->getVictim(), SPELL_HODIR_FURY);
|
||||
events.RepeatEvent(urand(60000, 120000));
|
||||
return;
|
||||
default:
|
||||
@@ -213,7 +213,7 @@ struct boss_flame_leviathan_seatAI : public PassiveAI
|
||||
{
|
||||
assert(vehicle);
|
||||
#ifdef BOSS_DEBUG
|
||||
m_creature->SetReactState(REACT_AGGRESSIVE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ struct boss_flame_leviathan_seatAI : public PassiveAI
|
||||
|
||||
void PassengerBoarded(Unit *who, int8 seatId, bool apply)
|
||||
{
|
||||
if (!m_creature->GetVehicle())
|
||||
if (!me->GetVehicle())
|
||||
return;
|
||||
|
||||
if (seatId == SEAT_PLAYER)
|
||||
@@ -240,7 +240,7 @@ struct boss_flame_leviathan_seatAI : public PassiveAI
|
||||
|
||||
if (Creature *turret = CAST_CRE(vehicle->GetPassenger(SEAT_TURRET)))
|
||||
{
|
||||
turret->setFaction(m_creature->GetVehicleBase()->getFaction());
|
||||
turret->setFaction(me->GetVehicleBase()->getFaction());
|
||||
turret->SetUInt32Value(UNIT_FIELD_FLAGS, 0); // unselectable
|
||||
turret->AI()->AttackStart(who);
|
||||
}
|
||||
@@ -290,15 +290,15 @@ struct boss_flame_leviathan_overload_deviceAI : public PassiveAI
|
||||
{
|
||||
if (param == EVENT_SPELLCLICK)
|
||||
{
|
||||
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
if (m_creature->GetVehicle())
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
if (me->GetVehicle())
|
||||
{
|
||||
if (Unit *player = m_creature->GetVehicle()->GetPassenger(SEAT_PLAYER))
|
||||
if (Unit *player = me->GetVehicle()->GetPassenger(SEAT_PLAYER))
|
||||
{
|
||||
player->ExitVehicle();
|
||||
m_creature->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true);
|
||||
if (Unit *leviathan = m_creature->GetVehicleBase()->GetVehicleBase())
|
||||
me->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true);
|
||||
if (Unit *leviathan = me->GetVehicleBase()->GetVehicleBase())
|
||||
player->GetMotionMaster()->MoveKnockbackFrom(leviathan->GetPositionX(), leviathan->GetPositionY(), 30, 30);
|
||||
}
|
||||
}
|
||||
@@ -312,18 +312,18 @@ struct boss_flame_leviathan_safety_containerAI : public PassiveAI
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (id == m_creature->GetEntry())
|
||||
if (id == me->GetEntry())
|
||||
{
|
||||
if (Creature *liquid = DoSummon(MOB_LIQUID, me, 0))
|
||||
liquid->CastSpell(liquid, 62494, true);
|
||||
m_creature->DisappearAndDie(); // this will relocate creature to sky
|
||||
me->DisappearAndDie(); // this will relocate creature to sky
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!m_creature->GetVehicle() && m_creature->isSummon() && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
|
||||
m_creature->GetMotionMaster()->MoveFall(409.8f, m_creature->GetEntry());
|
||||
if (!me->GetVehicle() && me->isSummon() && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
|
||||
me->GetMotionMaster()->MoveFall(409.8f, me->GetEntry());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -331,7 +331,7 @@ struct spell_pool_of_tarAI : public TriggerAI
|
||||
{
|
||||
spell_pool_of_tarAI(Creature *c) : TriggerAI(c)
|
||||
{
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit *who, uint32 &damage)
|
||||
@@ -341,8 +341,8 @@ struct spell_pool_of_tarAI : public TriggerAI
|
||||
|
||||
void SpellHit(Unit* caster, const SpellEntry *spell)
|
||||
{
|
||||
if (spell->SchoolMask & SPELL_SCHOOL_MASK_FIRE && !m_creature->HasAura(SPELL_BLAZE))
|
||||
m_creature->CastSpell(me, SPELL_BLAZE, true);
|
||||
if (spell->SchoolMask & SPELL_SCHOOL_MASK_FIRE && !me->HasAura(SPELL_BLAZE))
|
||||
me->CastSpell(me, SPELL_BLAZE, true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -64,18 +64,18 @@ struct boss_freyaAI : public BossAI
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* pWho)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
_EnterCombat();
|
||||
}
|
||||
|
||||
|
||||
@@ -45,18 +45,18 @@ struct boss_hodirAI : public BossAI
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* pWho)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
_EnterCombat();
|
||||
}
|
||||
|
||||
|
||||
@@ -54,18 +54,18 @@ struct boss_ignis_AI : public BossAI
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO,m_creature);
|
||||
DoScriptText(SAY_AGGRO,me);
|
||||
_EnterCombat();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
@@ -76,12 +76,12 @@ struct boss_ignis_AI : public BossAI
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (m_creature->GetPositionY() < 150 || m_creature->GetPositionX() < 450) // Not Blizzlike, anti-exploit to prevent players from pulling bosses to vehicles.
|
||||
if (me->GetPositionY() < 150 || me->GetPositionX() < 450) // Not Blizzlike, anti-exploit to prevent players from pulling bosses to vehicles.
|
||||
{
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->DeleteThreatList();
|
||||
m_creature->CombatStop(false);
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->CombatStop(false);
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
|
||||
if (uiFlameJetsTimer <= diff)
|
||||
@@ -92,7 +92,7 @@ struct boss_ignis_AI : public BossAI
|
||||
|
||||
if (uiScorchTimer <= diff)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SCORCH_1,SAY_SCORCH_2), m_creature);
|
||||
DoScriptText(RAND(SAY_SCORCH_1,SAY_SCORCH_2), me);
|
||||
DoCast(SPELL_SCORCH);
|
||||
uiScorchTimer = 20000;
|
||||
} else uiScorchTimer -= diff;
|
||||
@@ -101,7 +101,7 @@ struct boss_ignis_AI : public BossAI
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
{
|
||||
DoScriptText(SAY_SLAG_POT, m_creature);
|
||||
DoScriptText(SAY_SLAG_POT, me);
|
||||
DoCast(pTarget, SPELL_SLAG_POT);
|
||||
}
|
||||
uiSlagPotTimer = 30000;
|
||||
|
||||
@@ -70,13 +70,13 @@ struct boss_kologarnAI : public BossAI
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_2,SAY_SLAY_2), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_2,SAY_SLAY_2), me);
|
||||
}
|
||||
|
||||
void PassengerBoarded(Unit *who, int8 seatId, bool apply)
|
||||
@@ -94,7 +94,7 @@ struct boss_kologarnAI : public BossAI
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_SMASH, 5000);
|
||||
events.ScheduleEvent(EVENT_SWEEP, 10000);
|
||||
|
||||
@@ -86,13 +86,13 @@ struct boss_razorscaleAI : public BossAI
|
||||
InitialSpawn = true;
|
||||
IsFlying = true;
|
||||
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
|
||||
m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
|
||||
me->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ struct boss_razorscaleAI : public BossAI
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_KILL, m_creature);
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
@@ -110,28 +110,28 @@ struct boss_razorscaleAI : public BossAI
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (m_creature->GetPositionY() > -60 || m_creature->GetPositionX() < 450) // Not Blizzlike, anti-exploit to prevent players from pulling bosses to vehicles.
|
||||
if (me->GetPositionY() > -60 || me->GetPositionX() < 450) // Not Blizzlike, anti-exploit to prevent players from pulling bosses to vehicles.
|
||||
{
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->DeleteThreatList();
|
||||
m_creature->CombatStop(false);
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->CombatStop(false);
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
|
||||
// Victim is not controlled by a player (should never happen)
|
||||
if (m_creature->getVictim() && !m_creature->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
m_creature->Kill(m_creature->getVictim());
|
||||
if (me->getVictim() && !me->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
me->Kill(me->getVictim());
|
||||
|
||||
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 99 && Phase == 1) // TODO: Only land (exit Phase 1) if brought down with harpoon guns! This is important!
|
||||
if ((me->GetHealth()*100 / me->GetMaxHealth()) < 99 && Phase == 1) // TODO: Only land (exit Phase 1) if brought down with harpoon guns! This is important!
|
||||
{
|
||||
Phase = 2;
|
||||
DoScriptText(SAY_PHASE_2_TRANS, m_creature); // Audio: "Move quickly! She won't remain grounded for long!"
|
||||
DoScriptText(SAY_PHASE_2_TRANS, me); // Audio: "Move quickly! She won't remain grounded for long!"
|
||||
}
|
||||
|
||||
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 33 && Phase == 2) // Health under 33%, Razorscale can't fly anymore.
|
||||
if ((me->GetHealth()*100 / me->GetMaxHealth()) < 33 && Phase == 2) // Health under 33%, Razorscale can't fly anymore.
|
||||
{
|
||||
Phase = 3;
|
||||
DoScriptText(SAY_PHASE_3_TRANS, m_creature); // "Razorscale lands permanently!"
|
||||
DoScriptText(SAY_PHASE_3_TRANS, me); // "Razorscale lands permanently!"
|
||||
// TODO: Cast Devouring Flame on all harpoon guns simultaneously, briefly after Phase 3 starts (lasts until the harpoon guns are destroyed)
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ struct boss_razorscaleAI : public BossAI
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true))
|
||||
{
|
||||
m_creature->SetInFront(pTarget);
|
||||
me->SetInFront(pTarget);
|
||||
DoCast(pTarget, SPELL_FIREBALL);
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ struct boss_razorscaleAI : public BossAI
|
||||
|
||||
if (FlameBreathTimer <= diff)
|
||||
{
|
||||
DoScriptText(EMOTE_BREATH, m_creature); // TODO: "Razorscale takes a deep breath..."
|
||||
DoScriptText(EMOTE_BREATH, me); // TODO: "Razorscale takes a deep breath..."
|
||||
DoCastVictim(SPELL_FLAMEBREATH);
|
||||
FlameBreathTimer = 15000;
|
||||
WingBuffetTimer = 0;
|
||||
@@ -183,13 +183,13 @@ struct boss_razorscaleAI : public BossAI
|
||||
{
|
||||
if (FlameBuffetTimer <= diff)
|
||||
{
|
||||
DoScriptText(EMOTE_BREATH, m_creature);
|
||||
DoScriptText(EMOTE_BREATH, me);
|
||||
std::list<Unit*> pTargets;
|
||||
SelectTargetList(pTargets, RAID_MODE(3,9), SELECT_TARGET_RANDOM, 100, true);
|
||||
uint8 i = 0;
|
||||
for (std::list<Unit*>::const_iterator itr = pTargets.begin(); itr != pTargets.end();)
|
||||
{
|
||||
if (m_creature->HasInArc(M_PI, *itr))
|
||||
if (me->HasInArc(M_PI, *itr))
|
||||
{
|
||||
DoCast(*itr, SPELL_FLAMEBUFFET, true);
|
||||
++i;
|
||||
@@ -217,7 +217,7 @@ struct boss_razorscaleAI : public BossAI
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true))
|
||||
{
|
||||
m_creature->SetInFront(pTarget);
|
||||
me->SetInFront(pTarget);
|
||||
DoCast(pTarget, SPELL_FIREBALL);
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ struct boss_razorscaleAI : public BossAI
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true))
|
||||
{
|
||||
m_creature->SetInFront(pTarget);
|
||||
me->SetInFront(pTarget);
|
||||
DoCast(pTarget, SPELL_DEVOURINGFLAME);
|
||||
}
|
||||
|
||||
@@ -252,9 +252,9 @@ struct boss_razorscaleAI : public BossAI
|
||||
{
|
||||
float x = std::max(500.0f, std::min(650.0f, pTarget->GetPositionX() + irand(-20,20))); // Safe range is between 500 and 650
|
||||
float y = std::max(-235.0f, std::min(-145.0f, pTarget->GetPositionY() + irand(-20,20))); // Safe range is between -235 and -145
|
||||
float z = m_creature->GetBaseMap()->GetHeight(x, y, MAX_HEIGHT); // Ground level
|
||||
float z = me->GetBaseMap()->GetHeight(x, y, MAX_HEIGHT); // Ground level
|
||||
// TODO: Spawn drillers, then spawn adds 5 seconds later
|
||||
if (Creature *pAdd = m_creature->SummonCreature(NPC_DARK_RUNE_SENTINEL, x, y, z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000))
|
||||
if (Creature *pAdd = me->SummonCreature(NPC_DARK_RUNE_SENTINEL, x, y, z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000))
|
||||
pAdd->AI()->AttackStart(pTarget);
|
||||
}
|
||||
}
|
||||
@@ -265,34 +265,34 @@ struct boss_razorscaleAI : public BossAI
|
||||
{
|
||||
const float x = 587.54;
|
||||
const float y = -174.92;
|
||||
const float GroundLevel = m_creature->GetBaseMap()->GetHeight(x, y, MAX_HEIGHT);
|
||||
const float GroundLevel = me->GetBaseMap()->GetHeight(x, y, MAX_HEIGHT);
|
||||
const float FlightHeight = GroundLevel + 4.0f; // TODO: Fly out of range of attacks (442 is sufficient height for this), minus ~(10*number of harpoon gun chains attached to Razorscale)
|
||||
|
||||
if (Phase == 1) // Always flying during Phase 1
|
||||
IsFlying = true;
|
||||
|
||||
m_creature->SetFlying(IsFlying);
|
||||
m_creature->SendMovementFlagUpdate();
|
||||
m_creature->SetSpeed(MOVE_WALK, IsFlying ? 7.0f : 2.5f, IsFlying);
|
||||
me->SetFlying(IsFlying);
|
||||
me->SendMovementFlagUpdate();
|
||||
me->SetSpeed(MOVE_WALK, IsFlying ? 7.0f : 2.5f, IsFlying);
|
||||
|
||||
if (Phase == 1) // Flying Phase
|
||||
{
|
||||
if (m_creature->GetPositionZ() > FlightHeight) // Correct height, stop moving
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
if (me->GetPositionZ() > FlightHeight) // Correct height, stop moving
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
else // Incorrect height
|
||||
{
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
m_creature->GetMotionMaster()->MovePoint(0, x, y, FlightHeight + 0.5f); // Fly to slightly above (x, y, FlightHeight)
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, FlightHeight + 0.5f); // Fly to slightly above (x, y, FlightHeight)
|
||||
}
|
||||
}
|
||||
else // Ground Phases
|
||||
{
|
||||
const float CurrentGroundLevel = m_creature->GetBaseMap()->GetHeight(m_creature->GetPositionX(), m_creature->GetPositionY(), MAX_HEIGHT);
|
||||
const float CurrentGroundLevel = me->GetBaseMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT);
|
||||
//if (StunTimer == 30000) // Only fly around if not stunned.
|
||||
//{
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
if (IsFlying && m_creature->GetPositionZ() > CurrentGroundLevel) // Fly towards the ground
|
||||
m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), CurrentGroundLevel);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
if (IsFlying && me->GetPositionZ() > CurrentGroundLevel) // Fly towards the ground
|
||||
me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), CurrentGroundLevel);
|
||||
// TODO: Swoop up just before landing
|
||||
else
|
||||
IsFlying = false; // Landed, no longer flying
|
||||
|
||||
@@ -54,24 +54,24 @@ struct boss_thorimAI : public BossAI
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
DoScriptText(SAY_WIPE, m_creature);
|
||||
DoScriptText(SAY_WIPE, me);
|
||||
_EnterEvadeMode();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* pWho)
|
||||
{
|
||||
DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2), m_creature);
|
||||
DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2), me);
|
||||
_EnterCombat();
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ struct boss_xt002_AI : public BossAI
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
//Makes XT-002 to cast a light bomb 10 seconds after aggro.
|
||||
uiSearingLightTimer = TIMER_SEARING_LIGHT/2;
|
||||
@@ -217,7 +217,7 @@ struct boss_xt002_AI : public BossAI
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
_EnterCombat();
|
||||
}
|
||||
|
||||
@@ -234,10 +234,10 @@ struct boss_xt002_AI : public BossAI
|
||||
enterHardMode = true;
|
||||
|
||||
// set max health
|
||||
m_creature->SetHealth(m_creature->GetMaxHealth());
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
|
||||
// Get his heartbreak buff
|
||||
m_creature->CastSpell(m_creature, RAID_MODE(SPELL_HEARTBREAK_10, SPELL_HEARTBREAK_25), true);
|
||||
me->CastSpell(me, RAID_MODE(SPELL_HEARTBREAK_10, SPELL_HEARTBREAK_25), true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -255,12 +255,12 @@ struct boss_xt002_AI : public BossAI
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
|
||||
}
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ struct boss_xt002_AI : public BossAI
|
||||
|
||||
if (uiTympanicTantrumTimer <= 0)
|
||||
{
|
||||
DoScriptText(SAY_TYMPANIC_TANTRUM, m_creature);
|
||||
DoScriptText(SAY_TYMPANIC_TANTRUM, me);
|
||||
DoCast(SPELL_TYMPANIC_TANTRUM);
|
||||
uiTympanicTantrumTimer = urand(TIMER_TYMPANIC_TANTRUM_MIN, TIMER_TYMPANIC_TANTRUM_MAX);
|
||||
} else uiTympanicTantrumTimer -= diff;
|
||||
@@ -332,20 +332,20 @@ struct boss_xt002_AI : public BossAI
|
||||
else
|
||||
{
|
||||
//Stop moving
|
||||
m_creature->StopMoving();
|
||||
me->StopMoving();
|
||||
|
||||
//Start summoning adds
|
||||
if (uiSpawnAddTimer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_SUMMON, m_creature);
|
||||
DoScriptText(SAY_SUMMON, me);
|
||||
|
||||
// Spawn Pummeller
|
||||
switch (rand() % 4)
|
||||
{
|
||||
case 0: m_creature->SummonCreature(NPC_XM024_PUMMELLER, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 1: m_creature->SummonCreature(NPC_XM024_PUMMELLER, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 2: m_creature->SummonCreature(NPC_XM024_PUMMELLER, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 3: m_creature->SummonCreature(NPC_XM024_PUMMELLER, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 0: me->SummonCreature(NPC_XM024_PUMMELLER, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 1: me->SummonCreature(NPC_XM024_PUMMELLER, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 2: me->SummonCreature(NPC_XM024_PUMMELLER, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 3: me->SummonCreature(NPC_XM024_PUMMELLER, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
}
|
||||
|
||||
// Spawn 5 Bombs
|
||||
@@ -354,20 +354,20 @@ struct boss_xt002_AI : public BossAI
|
||||
//Some randomes are added so they wont spawn in a pile
|
||||
switch(rand() % 4)
|
||||
{
|
||||
case 0: m_creature->SummonCreature(NPC_XS013_SCRAPBOT, irand(LR_X - 3, LR_X + 3), irand(LR_Y - 3, LR_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 1: m_creature->SummonCreature(NPC_XS013_SCRAPBOT, irand(LL_X - 3, LL_X + 3), irand(LL_Y - 3, LL_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 2: m_creature->SummonCreature(NPC_XS013_SCRAPBOT, irand(UR_X - 3, UR_X + 3), irand(UR_Y - 3, UR_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 3: m_creature->SummonCreature(NPC_XS013_SCRAPBOT, irand(UL_X - 3, UL_X + 3), irand(UL_Y - 3, UL_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 0: me->SummonCreature(NPC_XS013_SCRAPBOT, irand(LR_X - 3, LR_X + 3), irand(LR_Y - 3, LR_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 1: me->SummonCreature(NPC_XS013_SCRAPBOT, irand(LL_X - 3, LL_X + 3), irand(LL_Y - 3, LL_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 2: me->SummonCreature(NPC_XS013_SCRAPBOT, irand(UR_X - 3, UR_X + 3), irand(UR_Y - 3, UR_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 3: me->SummonCreature(NPC_XS013_SCRAPBOT, irand(UL_X - 3, UL_X + 3), irand(UL_Y - 3, UL_Y + 3), SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
}
|
||||
}
|
||||
|
||||
//Spawn 5 Scrapbots
|
||||
switch (rand() % 4)
|
||||
{
|
||||
case 0: m_creature->SummonCreature(NPC_XE321_BOOMBOT, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 1: m_creature->SummonCreature(NPC_XE321_BOOMBOT, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 2: m_creature->SummonCreature(NPC_XE321_BOOMBOT, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 3: m_creature->SummonCreature(NPC_XE321_BOOMBOT, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 0: me->SummonCreature(NPC_XE321_BOOMBOT, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 1: me->SummonCreature(NPC_XE321_BOOMBOT, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 2: me->SummonCreature(NPC_XE321_BOOMBOT, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
case 3: me->SummonCreature(NPC_XE321_BOOMBOT, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break;
|
||||
}
|
||||
|
||||
uiSpawnAddTimer = TIMER_SPAWN_ADD;
|
||||
@@ -376,7 +376,7 @@ struct boss_xt002_AI : public BossAI
|
||||
// Is the phase over?
|
||||
if (uiHeartPhaseTimer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_HEART_CLOSED, m_creature);
|
||||
DoScriptText(SAY_HEART_CLOSED, me);
|
||||
SetPhaseOne();
|
||||
}
|
||||
else
|
||||
@@ -390,7 +390,7 @@ struct boss_xt002_AI : public BossAI
|
||||
{
|
||||
if (uiSpawnLifeSparkTimer <= diff)
|
||||
{
|
||||
if (Unit *pSearingLightTarget = m_creature->GetUnit(*m_creature, uiSearingLightTarget))
|
||||
if (Unit *pSearingLightTarget = me->GetUnit(*me, uiSearingLightTarget))
|
||||
pSearingLightTarget->SummonCreature(NPC_LIFE_SPARK, pSearingLightTarget->GetPositionX(), pSearingLightTarget->GetPositionY(), pSearingLightTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
uiSpawnLifeSparkTimer = TIMER_SPAWN_LIFE_SPARK;
|
||||
searing_light_active = false;
|
||||
@@ -404,7 +404,7 @@ struct boss_xt002_AI : public BossAI
|
||||
{
|
||||
if (uiGravityBombAuraTimer <= diff)
|
||||
{
|
||||
if (Unit *pGravityBombTarget = m_creature->GetUnit(*m_creature, uiGravityBombTarget))
|
||||
if (Unit *pGravityBombTarget = me->GetUnit(*me, uiGravityBombTarget))
|
||||
{
|
||||
pGravityBombTarget->RemoveAurasDueToSpell(RAID_MODE(SPELL_GRAVITY_BOMB_10,SPELL_GRAVITY_BOMB_25));
|
||||
if (hardMode)
|
||||
@@ -424,8 +424,8 @@ struct boss_xt002_AI : public BossAI
|
||||
if (!enraged)
|
||||
if (uiEnrageTimer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_BERSERK, m_creature);
|
||||
DoCast(m_creature, SPELL_ENRAGE);
|
||||
DoScriptText(SAY_BERSERK, me);
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
enraged = true;
|
||||
} else uiEnrageTimer -= diff;
|
||||
}
|
||||
@@ -433,10 +433,10 @@ struct boss_xt002_AI : public BossAI
|
||||
void exposeHeart()
|
||||
{
|
||||
//Make untargetable
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
//Summon the heart npc
|
||||
m_creature->SummonCreature(NPC_XT002_HEART, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 7, 0, TEMPSUMMON_TIMED_DESPAWN, TIMER_HEART_PHASE);
|
||||
me->SummonCreature(NPC_XT002_HEART, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 7, 0, TEMPSUMMON_TIMED_DESPAWN, TIMER_HEART_PHASE);
|
||||
|
||||
// Start "end of phase 2 timer"
|
||||
uiHeartPhaseTimer = TIMER_HEART_PHASE;
|
||||
@@ -448,7 +448,7 @@ struct boss_xt002_AI : public BossAI
|
||||
//Reset the add spawning timer
|
||||
uiSpawnAddTimer = TIMER_SPAWN_ADD;
|
||||
|
||||
DoScriptText(SAY_HEART_OPENED, m_creature);
|
||||
DoScriptText(SAY_HEART_OPENED, me);
|
||||
}
|
||||
|
||||
void SetPhaseOne()
|
||||
@@ -459,9 +459,9 @@ struct boss_xt002_AI : public BossAI
|
||||
uiSpawnAddTimer = TIMER_SPAWN_ADD;
|
||||
|
||||
if (!hardMode)
|
||||
m_creature->ModifyHealth(-((int32)transferHealth));
|
||||
me->ModifyHealth(-((int32)transferHealth));
|
||||
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
phase = 1;
|
||||
}
|
||||
|
||||
@@ -484,7 +484,7 @@ struct boss_xt002_AI : public BossAI
|
||||
// //Deal damage to the victim
|
||||
// int32 damage = urand(minDamage, maxDamage);
|
||||
// i->getSource()->ModifyHealth(-damage);
|
||||
// m_creature->SendSpellNonMeleeDamageLog(i->getSource(), SPELL_GRAVITY_BOMB_AURA_10, damage, SPELL_SCHOOL_MASK_SHADOW, 0, 0, false, 0);
|
||||
// me->SendSpellNonMeleeDamageLog(i->getSource(), SPELL_GRAVITY_BOMB_AURA_10, damage, SPELL_SCHOOL_MASK_SHADOW, 0, 0, false, 0);
|
||||
|
||||
// //Replacing the tractor beam effect
|
||||
// i->getSource()->JumpTo(pGravityBombTarget, 5);
|
||||
@@ -509,9 +509,9 @@ struct mob_xt002_heartAI : public ScriptedAI
|
||||
mob_xt002_heartAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
m_pInstance = pCreature->GetInstanceData();
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
DoCast(m_creature, SPELL_EXPOSED_HEART);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
DoCast(me, SPELL_EXPOSED_HEART);
|
||||
}
|
||||
|
||||
ScriptedInstance* m_pInstance;
|
||||
@@ -519,25 +519,25 @@ struct mob_xt002_heartAI : public ScriptedAI
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
if (m_pInstance)
|
||||
if (Creature* pXT002 = m_creature->GetCreature(*m_creature, m_pInstance->GetData64(TYPE_XT002)))
|
||||
if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(TYPE_XT002)))
|
||||
if (pXT002->AI())
|
||||
pXT002->AI()->DoAction(ACTION_ENTER_HARD_MODE);
|
||||
|
||||
//removes the aura
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_EXPOSED_HEART);
|
||||
me->RemoveAurasDueToSpell(SPELL_EXPOSED_HEART);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit *pDone, uint32 &damage)
|
||||
{
|
||||
if (Creature* pXT002 = m_creature->GetCreature(*m_creature, m_pInstance->GetData64(TYPE_XT002)))
|
||||
if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(TYPE_XT002)))
|
||||
if (pXT002->AI())
|
||||
{
|
||||
uint32 health = m_creature->GetHealth();
|
||||
uint32 health = me->GetHealth();
|
||||
health -= damage;
|
||||
if (health < 0)
|
||||
health = 0;
|
||||
|
||||
pXT002->AI()->SetData(DATA_TRANSFERED_HEALTH, m_creature->GetMaxHealth() - health);
|
||||
pXT002->AI()->SetData(DATA_TRANSFERED_HEALTH, me->GetMaxHealth() - health);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -556,24 +556,24 @@ struct mob_scrapbotAI : public ScriptedAI
|
||||
{
|
||||
mob_scrapbotAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
m_pInstance = m_creature->GetInstanceData();
|
||||
m_pInstance = me->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* m_pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_creature->SetReactState(REACT_PASSIVE);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
|
||||
if (Creature* pXT002 = m_creature->GetCreature(*m_creature, m_pInstance->GetData64(TYPE_XT002)))
|
||||
m_creature->GetMotionMaster()->MoveChase(pXT002);
|
||||
if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(TYPE_XT002)))
|
||||
me->GetMotionMaster()->MoveChase(pXT002);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Creature* pXT002 = m_creature->GetCreature(*m_creature, m_pInstance->GetData64(TYPE_XT002)))
|
||||
if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(TYPE_XT002)))
|
||||
{
|
||||
if (m_creature->GetDistance2d(pXT002) <= 0.5)
|
||||
if (me->GetDistance2d(pXT002) <= 0.5)
|
||||
{
|
||||
// TODO Send raid message
|
||||
|
||||
@@ -581,7 +581,7 @@ struct mob_scrapbotAI : public ScriptedAI
|
||||
pXT002->ModifyHealth(pXT002->GetMaxHealth() * 0.01);
|
||||
|
||||
// Despawns the scrapbot
|
||||
m_creature->ForcedDespawn();
|
||||
me->ForcedDespawn();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -621,23 +621,23 @@ struct mob_pummellerAI : public ScriptedAI
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
|
||||
if (me->IsWithinMeleeRange(me->getVictim()))
|
||||
{
|
||||
if (uiArcingSmashTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH);
|
||||
DoCast(me->getVictim(), SPELL_ARCING_SMASH);
|
||||
uiArcingSmashTimer = TIMER_ARCING_SMASH;
|
||||
} else uiArcingSmashTimer -= diff;
|
||||
|
||||
if (uiTrampleTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_TRAMPLE);
|
||||
DoCast(me->getVictim(), SPELL_TRAMPLE);
|
||||
uiTrampleTimer = TIMER_TRAMPLE;
|
||||
} else uiTrampleTimer -= diff;
|
||||
|
||||
if (uiUppercutTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_UPPERCUT);
|
||||
DoCast(me->getVictim(), SPELL_UPPERCUT);
|
||||
uiUppercutTimer = TIMER_UPPERCUT;
|
||||
} else uiUppercutTimer -= diff;
|
||||
}
|
||||
@@ -667,10 +667,10 @@ struct mob_boombotAI : public ScriptedAI
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_creature->SetReactState(REACT_PASSIVE);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
|
||||
if (Creature* pXT002 = m_creature->GetCreature(*m_creature, m_pInstance->GetData64(TYPE_XT002)))
|
||||
m_creature->GetMotionMaster()->MoveChase(pXT002);
|
||||
if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(TYPE_XT002)))
|
||||
me->GetMotionMaster()->MoveChase(pXT002);
|
||||
}
|
||||
|
||||
void JustDied(Unit *killer)
|
||||
@@ -680,15 +680,15 @@ struct mob_boombotAI : public ScriptedAI
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Creature* pXT002 = m_creature->GetCreature(*m_creature, m_pInstance->GetData64(TYPE_XT002)))
|
||||
if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(TYPE_XT002)))
|
||||
{
|
||||
if (m_creature->GetDistance2d(pXT002) <= 0.5)
|
||||
if (me->GetDistance2d(pXT002) <= 0.5)
|
||||
{
|
||||
//Explosion
|
||||
DoCast(m_creature, SPELL_BOOM);
|
||||
DoCast(me, SPELL_BOOM);
|
||||
|
||||
//Despawns the boombot
|
||||
m_creature->ForcedDespawn();
|
||||
me->ForcedDespawn();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -709,7 +709,7 @@ struct mob_void_zoneAI : public ScriptedAI
|
||||
mob_void_zoneAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
m_pInstance = pCreature->GetInstanceData();
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
}
|
||||
|
||||
ScriptedInstance* m_pInstance;
|
||||
@@ -739,11 +739,11 @@ struct mob_void_zoneAI : public ScriptedAI
|
||||
// for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
// {
|
||||
// // If a player is within the range of the spell
|
||||
// if (i->getSource() && i->getSource()->GetDistance2d(m_creature) <= 16)
|
||||
// if (i->getSource() && i->getSource()->GetDistance2d(me) <= 16)
|
||||
// {
|
||||
// // Deal damage to the victim
|
||||
// int32 damage = RAID_MODE(VOID_ZONE_DMG_10, VOID_ZONE_DMG_25);
|
||||
// m_creature->DealDamage(i->getSource(), damage, NULL, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_SHADOW);
|
||||
// me->DealDamage(i->getSource(), damage, NULL, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_SHADOW);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@@ -772,7 +772,7 @@ struct mob_life_sparkAI : public ScriptedAI
|
||||
|
||||
void Reset()
|
||||
{
|
||||
DoCast(m_creature, RAID_MODE(SPELL_STATIC_CHARGED_10, SPELL_STATIC_CHARGED_25));
|
||||
DoCast(me, RAID_MODE(SPELL_STATIC_CHARGED_10, SPELL_STATIC_CHARGED_25));
|
||||
uiShockTimer = 0; // first one is immediate.
|
||||
}
|
||||
|
||||
@@ -783,9 +783,9 @@ struct mob_life_sparkAI : public ScriptedAI
|
||||
|
||||
if (uiShockTimer <= diff)
|
||||
{
|
||||
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
|
||||
if (me->IsWithinMeleeRange(me->getVictim()))
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_SHOCK);
|
||||
DoCast(me->getVictim(), SPELL_SHOCK);
|
||||
uiShockTimer = TIMER_SHOCK;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user