Nexus, Nexus: Cleanup

--HG--
branch : trunk
This commit is contained in:
Tartalo
2010-03-27 22:10:18 +01:00
parent 2c3aaee502
commit 63bfba39a8
5 changed files with 379 additions and 429 deletions
@@ -1,5 +1,5 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* Copyright (C) 2006 - 2010 TrinityCore <http://www.trinitycore.org> * Copyright (C) 2008 - 2010 TrinityCore <http://www.trinitycore.org>
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@@ -18,31 +18,34 @@
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "nexus.h" #include "nexus.h"
bool DeadChaoticRift; // needed for achievement: Chaos Theory(2037) enum Spells
enum eEnums
{ {
ACHIEVEMENT_CHAOS_THEORY = 2037,
//Spells //Spells
SPELL_SPARK_N = 47751, SPELL_SPARK = 47751,
SPELL_SPARK_H = 57062, H_SPELL_SPARK = 57062,
SPELL_RIFT_SHIELD = 47748, SPELL_RIFT_SHIELD = 47748,
SPELL_CHARGE_RIFT = 47747, //Works wrong (affect players, not rifts) SPELL_CHARGE_RIFT = 47747, //Works wrong (affect players, not rifts)
SPELL_CREATE_RIFT = 47743, //Don't work, using WA SPELL_CREATE_RIFT = 47743, //Don't work, using WA
SPELL_ARCANE_ATTRACTION = 57063, //No idea, when it's used SPELL_ARCANE_ATTRACTION = 57063, //No idea, when it's used
};
MOB_CRAZED_MANA_WRAITH = 26746,
MOB_CHAOTIC_RIFT = 26918,
SPELL_CHAOTIC_ENERGY_BURST = 47688,
SPELL_CHARGED_CHAOTIC_ENERGY_BURST = 47737,
SPELL_ARCANEFORM = 48019, //Chaotic Rift visual
enum Adds
{
MOB_CRAZED_MANA_WRAITH = 26746,
MOB_CHAOTIC_RIFT = 26918
};
enum Yells
{
//Yell //Yell
SAY_AGGRO = -1576010, SAY_AGGRO = -1576010,
SAY_DEATH = -1576011, SAY_DEATH = -1576011,
SAY_RIFT = -1576012, SAY_RIFT = -1576012,
SAY_SHIELD = -1576013 SAY_SHIELD = -1576013
};
enum Achievs
{
ACHIEV_CHAOS_THEORY = 2037
}; };
const Position RiftLocation[6] = const Position RiftLocation[6] =
@@ -65,18 +68,19 @@ struct boss_anomalusAI : public ScriptedAI
ScriptedInstance* pInstance; ScriptedInstance* pInstance;
uint8 Phase; uint8 Phase;
uint32 SPELL_SPARK_Timer; uint32 uiSparkTimer;
uint32 SPELL_CREATE_RIFT_Timer; uint32 uiCreateRiftTimer;
uint64 ChaoticRiftGUID; uint64 uiChaoticRiftGUID;
bool bDeadChaoticRift; // needed for achievement: Chaos Theory(2037)
void Reset() void Reset()
{ {
Phase = 0; Phase = 0;
SPELL_SPARK_Timer = 5000; uiSparkTimer = 5*IN_MILISECONDS;
SPELL_CREATE_RIFT_Timer = 25000; uiChaoticRiftGUID = 0;
ChaoticRiftGUID = 0;
DeadChaoticRift = false; bDeadChaoticRift = false;
if (pInstance) if (pInstance)
pInstance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED); pInstance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED);
@@ -94,23 +98,12 @@ struct boss_anomalusAI : public ScriptedAI
{ {
DoScriptText(SAY_DEATH, m_creature); DoScriptText(SAY_DEATH, m_creature);
if (IsHeroic() && !DeadChaoticRift)
{
AchievementEntry const *AchievChaosTheory = GetAchievementStore()->LookupEntry(ACHIEVEMENT_CHAOS_THEORY);
if (AchievChaosTheory)
{
Map* pMap = m_creature->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievChaosTheory);
}
}
}
if (pInstance) if (pInstance)
{
if (IsHeroic() && !bDeadChaoticRift)
pInstance->DoCompleteAchievement(ACHIEV_CHAOS_THEORY);
pInstance->SetData(DATA_ANOMALUS_EVENT, DONE); pInstance->SetData(DATA_ANOMALUS_EVENT, DONE);
}
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
@@ -127,44 +120,42 @@ struct boss_anomalusAI : public ScriptedAI
if (m_creature->HasAura(SPELL_RIFT_SHIELD)) if (m_creature->HasAura(SPELL_RIFT_SHIELD))
{ {
if (ChaoticRiftGUID) if (uiChaoticRiftGUID)
{ {
Unit* Rift = Unit::GetUnit((*m_creature), ChaoticRiftGUID); Unit* Rift = Unit::GetUnit((*m_creature), uiChaoticRiftGUID);
if (Rift && Rift->isDead()) if (Rift && Rift->isDead())
{ {
m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD); m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD);
ChaoticRiftGUID = 0; uiChaoticRiftGUID = 0;
} }
return; return;
} }
} else } else
ChaoticRiftGUID = 0; uiChaoticRiftGUID = 0;
if ((Phase == 0) && HealthBelowPct(50)) if ((Phase == 0) && HealthBelowPct(50))
{ {
Phase = 1; Phase = 1;
DoScriptText(SAY_SHIELD, m_creature); DoScriptText(SAY_SHIELD, m_creature);
DoCast(m_creature, SPELL_RIFT_SHIELD); DoCast(m_creature, SPELL_RIFT_SHIELD);
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[urand(0,5)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS);
int tmp = rand()%(2);
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Rift) if (Rift)
{ {
//DoCast(Rift, SPELL_CHARGE_RIFT); //DoCast(Rift, SPELL_CHARGE_RIFT);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
Rift->AI()->AttackStart(pTarget); Rift->AI()->AttackStart(pTarget);
ChaoticRiftGUID = Rift->GetGUID(); uiChaoticRiftGUID = Rift->GetGUID();
DoScriptText(SAY_RIFT , m_creature); DoScriptText(SAY_RIFT , m_creature);
} }
} }
if (SPELL_SPARK_Timer <= diff) if (uiSparkTimer <= diff)
{ {
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, DUNGEON_MODE(SPELL_SPARK_N, SPELL_SPARK_H)); DoCast(pTarget, DUNGEON_MODE(SPELL_SPARK, H_SPELL_SPARK));
SPELL_SPARK_Timer = 5000; uiSparkTimer = 5*IN_MILISECONDS;
} else SPELL_SPARK_Timer -=diff; } else uiSparkTimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
@@ -175,6 +166,13 @@ CreatureAI* GetAI_boss_anomalus(Creature* pCreature)
return new boss_anomalusAI (pCreature); return new boss_anomalusAI (pCreature);
} }
enum RiftSpells
{
SPELL_CHAOTIC_ENERGY_BURST = 47688,
SPELL_CHARGED_CHAOTIC_ENERGY_BURST = 47737,
SPELL_ARCANEFORM = 48019 //Chaotic Rift visual
};
struct mob_chaotic_riftAI : public Scripted_NoMovementAI struct mob_chaotic_riftAI : public Scripted_NoMovementAI
{ {
mob_chaotic_riftAI(Creature *c) : Scripted_NoMovementAI(c) mob_chaotic_riftAI(Creature *c) : Scripted_NoMovementAI(c)
@@ -184,14 +182,14 @@ struct mob_chaotic_riftAI : public Scripted_NoMovementAI
ScriptedInstance* pInstance; ScriptedInstance* pInstance;
uint32 SPELL_CHAOTIC_ENERGY_BURST_Timer; uint32 uiChaoticEnergyBurstTimer;
uint32 SUMMON_CRAZED_MANA_WRAITH_Timer; uint32 uiSummonCrazedManaWraithTimer;
void Reset() void Reset()
{ {
SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000; uiChaoticEnergyBurstTimer = 1*IN_MILISECONDS;
SUMMON_CRAZED_MANA_WRAITH_Timer = 5000; uiSummonCrazedManaWraithTimer = 5*IN_MILISECONDS;
m_creature->SetDisplayId(25206); //For some reason in DB models for ally and horde are different. //m_creature->SetDisplayId(25206); //For some reason in DB models for ally and horde are different.
//Model for ally (1126) does not show auras. Horde model works perfect. //Model for ally (1126) does not show auras. Horde model works perfect.
//Set model to horde number //Set model to horde number
DoCast(m_creature, SPELL_ARCANEFORM, false); DoCast(m_creature, SPELL_ARCANEFORM, false);
@@ -199,7 +197,8 @@ struct mob_chaotic_riftAI : public Scripted_NoMovementAI
void JustDied(Unit *killer) void JustDied(Unit *killer)
{ {
DeadChaoticRift = true; if (Creature* pAnomalus = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0))
CAST_AI(boss_anomalusAI,pAnomalus->AI())->bDeadChaoticRift = true;
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
@@ -207,29 +206,29 @@ struct mob_chaotic_riftAI : public Scripted_NoMovementAI
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (SPELL_CHAOTIC_ENERGY_BURST_Timer <= diff) if (uiChaoticEnergyBurstTimer <= diff)
{ {
Unit* Anomalus = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0); Unit* pAnomalus = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD)) if (pAnomalus && pAnomalus->HasAura(SPELL_RIFT_SHIELD))
DoCast(pTarget, SPELL_CHARGED_CHAOTIC_ENERGY_BURST); DoCast(pTarget, SPELL_CHARGED_CHAOTIC_ENERGY_BURST);
else else
DoCast(pTarget, SPELL_CHAOTIC_ENERGY_BURST); DoCast(pTarget, SPELL_CHAOTIC_ENERGY_BURST);
SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000; uiChaoticEnergyBurstTimer = 1*IN_MILISECONDS;
} else SPELL_CHAOTIC_ENERGY_BURST_Timer -=diff; } else uiChaoticEnergyBurstTimer -= diff;
if (SUMMON_CRAZED_MANA_WRAITH_Timer <= diff) if (uiSummonCrazedManaWraithTimer <= diff)
{ {
Creature* Wraith = m_creature->SummonCreature(MOB_CRAZED_MANA_WRAITH, m_creature->GetPositionX()+1, m_creature->GetPositionY()+1, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); Creature* Wraith = m_creature->SummonCreature(MOB_CRAZED_MANA_WRAITH, m_creature->GetPositionX()+1, m_creature->GetPositionY()+1, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS);
if (Wraith) if (Wraith)
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
Wraith->AI()->AttackStart(pTarget); Wraith->AI()->AttackStart(pTarget);
Unit* Anomalus = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0); Unit* Anomalus = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD)) if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
SUMMON_CRAZED_MANA_WRAITH_Timer = 5000; uiSummonCrazedManaWraithTimer = 5*IN_MILISECONDS;
else else
SUMMON_CRAZED_MANA_WRAITH_Timer = 10000; uiSummonCrazedManaWraithTimer = 10*IN_MILISECONDS;
} else SUMMON_CRAZED_MANA_WRAITH_Timer -=diff; } else uiSummonCrazedManaWraithTimer -= diff;
} }
}; };
@@ -1,4 +1,5 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* Copyright (C) 2008 - 2010 TrinityCore <http://www.trinitycore.org>
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@@ -14,39 +15,38 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
/* ScriptData
SDName: Boss_Keristrasza
SD%Complete:
SDComment:
SDCategory: The Nexus, The Nexus
EndScriptData */
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "nexus.h" #include "nexus.h"
enum eEnums enum Spells
{ {
CONTAINMENT_SPHERES = 3,
ACHIEVEMENT_INTENSE_COLD = 2036,
//Spells //Spells
SPELL_FROZEN_PRISON = 47854, SPELL_FROZEN_PRISON = 47854,
SPELL_TAIL_SWEEP = 50155, SPELL_TAIL_SWEEP = 50155,
SPELL_CRYSTAL_CHAINS = 50997, SPELL_CRYSTAL_CHAINS = 50997,
SPELL_ENRAGE = 8599, SPELL_ENRAGE = 8599,
SPELL_CRYSTALFIRE_BREATH_N = 48096, SPELL_CRYSTALFIRE_BREATH = 48096,
SPELL_CRYSTALFIRE_BREATH_H = 57091, H_SPELL_CRYSTALFIRE_BREATH = 57091,
SPELL_CRYSTALIZE = 48179, SPELL_CRYSTALIZE = 48179,
SPELL_INTENSE_COLD = 48094, SPELL_INTENSE_COLD = 48094,
SPELL_INTENSE_COLD_TRIGGERED = 48095, SPELL_INTENSE_COLD_TRIGGERED = 48095
};
enum Yells
{
//Yell //Yell
SAY_AGGRO = -1576040, SAY_AGGRO = -1576040,
SAY_SLAY = -1576041, SAY_SLAY = -1576041,
SAY_ENRAGE = -1576042, SAY_ENRAGE = -1576042,
SAY_DEATH = -1576043, SAY_DEATH = -1576043,
SAY_CRYSTAL_NOVA = -1576044 SAY_CRYSTAL_NOVA = -1576044
};
enum Achievements
{
ACHIEV_INTENSE_COLD = 2036
};
enum Misc
{
DATA_CONTAINMENT_SPHERES = 3
}; };
struct boss_keristraszaAI : public ScriptedAI struct boss_keristraszaAI : public ScriptedAI
@@ -58,25 +58,25 @@ struct boss_keristraszaAI : public ScriptedAI
ScriptedInstance* pInstance; ScriptedInstance* pInstance;
uint32 CRYSTALFIRE_BREATH_Timer; uint32 uiCrystalfireBreathTimer;
uint32 CRYSTAL_CHAINS_CRYSTALIZE_Timer; uint32 uiCrystalChainsCrystalizeTimer;
uint32 TAIL_SWEEP_Timer; uint32 uiTailSweepTimer;
bool Enrage; bool bEnrage;
uint64 ContainmentSphereGUIDs[CONTAINMENT_SPHERES]; uint64 auiContainmentSphereGUIDs[DATA_CONTAINMENT_SPHERES];
uint32 CheckIntenseColdTimer; uint32 uiCheckIntenseColdTimer;
bool MoreThanTwoIntenseCold; // needed for achievement: Intense Cold(2036) bool bMoreThanTwoIntenseCold; // needed for achievement: Intense Cold(2036)
void Reset() void Reset()
{ {
CRYSTALFIRE_BREATH_Timer = 14000; uiCrystalfireBreathTimer = 14*IN_MILISECONDS;
CRYSTAL_CHAINS_CRYSTALIZE_Timer = DUNGEON_MODE(30000,11000); uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILISECONDS,11*IN_MILISECONDS);
TAIL_SWEEP_Timer = 5000; uiTailSweepTimer = 5*IN_MILISECONDS;
Enrage = false; bEnrage = false;
CheckIntenseColdTimer = 2000; uiCheckIntenseColdTimer = 2*IN_MILISECONDS;
MoreThanTwoIntenseCold = false; bMoreThanTwoIntenseCold = false;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
@@ -99,23 +99,12 @@ struct boss_keristraszaAI : public ScriptedAI
{ {
DoScriptText(SAY_DEATH, m_creature); DoScriptText(SAY_DEATH, m_creature);
if (IsHeroic() && !MoreThanTwoIntenseCold)
{
AchievementEntry const *AchievIntenseCold = GetAchievementStore()->LookupEntry(ACHIEVEMENT_INTENSE_COLD);
if (AchievIntenseCold)
{
Map* pMap = m_creature->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievIntenseCold);
}
}
}
if (pInstance) if (pInstance)
{
if (IsHeroic() && !bMoreThanTwoIntenseCold)
pInstance->DoCompleteAchievement(ACHIEV_INTENSE_COLD);
pInstance->SetData(DATA_KERISTRASZA_EVENT, DONE); pInstance->SetData(DATA_KERISTRASZA_EVENT, DONE);
}
} }
void KilledUnit(Unit *victim) void KilledUnit(Unit *victim)
@@ -128,15 +117,15 @@ struct boss_keristraszaAI : public ScriptedAI
if(!pInstance) if(!pInstance)
return false; return false;
ContainmentSphereGUIDs[0] = pInstance->GetData64(ANOMALUS_CONTAINMET_SPHERE); auiContainmentSphereGUIDs[0] = pInstance->GetData64(ANOMALUS_CONTAINMET_SPHERE);
ContainmentSphereGUIDs[1] = pInstance->GetData64(ORMOROKS_CONTAINMET_SPHERE); auiContainmentSphereGUIDs[1] = pInstance->GetData64(ORMOROKS_CONTAINMET_SPHERE);
ContainmentSphereGUIDs[2] = pInstance->GetData64(TELESTRAS_CONTAINMET_SPHERE); auiContainmentSphereGUIDs[2] = pInstance->GetData64(TELESTRAS_CONTAINMET_SPHERE);
GameObject *ContainmentSpheres[CONTAINMENT_SPHERES]; GameObject *ContainmentSpheres[DATA_CONTAINMENT_SPHERES];
for (uint8 i = 0; i < CONTAINMENT_SPHERES; ++i) for (uint8 i = 0; i < DATA_CONTAINMENT_SPHERES; ++i)
{ {
ContainmentSpheres[i] = pInstance->instance->GetGameObject(ContainmentSphereGUIDs[i]); ContainmentSpheres[i] = pInstance->instance->GetGameObject(auiContainmentSphereGUIDs[i]);
if (!ContainmentSpheres[i]) if (!ContainmentSpheres[i])
return false; return false;
if (ContainmentSpheres[i]->GetGoState() != GO_STATE_ACTIVE) if (ContainmentSpheres[i]->GetGoState() != GO_STATE_ACTIVE)
@@ -169,7 +158,7 @@ struct boss_keristraszaAI : public ScriptedAI
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (CheckIntenseColdTimer < diff && !MoreThanTwoIntenseCold) if (uiCheckIntenseColdTimer < diff && !bMoreThanTwoIntenseCold)
{ {
std::list<HostileReference*> ThreatList = m_creature->getThreatManager().getThreatList(); std::list<HostileReference*> ThreatList = m_creature->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); itr++) for (std::list<HostileReference*>::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); itr++)
@@ -181,41 +170,41 @@ struct boss_keristraszaAI : public ScriptedAI
Aura *AuraIntenseCold = pTarget->GetAura(SPELL_INTENSE_COLD_TRIGGERED); Aura *AuraIntenseCold = pTarget->GetAura(SPELL_INTENSE_COLD_TRIGGERED);
if (AuraIntenseCold && AuraIntenseCold->GetStackAmount() > 2) if (AuraIntenseCold && AuraIntenseCold->GetStackAmount() > 2)
{ {
MoreThanTwoIntenseCold = true; bMoreThanTwoIntenseCold = true;
break; break;
} }
} }
CheckIntenseColdTimer = 2000; uiCheckIntenseColdTimer = 2*IN_MILISECONDS;
} else CheckIntenseColdTimer -= diff; } else uiCheckIntenseColdTimer -= diff;
if (!Enrage && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) if (!bEnrage && (m_creature->GetHealth() < HealthBelowPct(25)))
{ {
DoScriptText(SAY_ENRAGE, m_creature); DoScriptText(SAY_ENRAGE, m_creature);
DoCast(m_creature, SPELL_ENRAGE); DoCast(m_creature, SPELL_ENRAGE);
Enrage = true; bEnrage = true;
} }
if (CRYSTALFIRE_BREATH_Timer <= diff) if (uiCrystalfireBreathTimer <= diff)
{ {
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_CRYSTALFIRE_BREATH_N, SPELL_CRYSTALFIRE_BREATH_H)); DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_CRYSTALFIRE_BREATH, H_SPELL_CRYSTALFIRE_BREATH));
CRYSTALFIRE_BREATH_Timer = 14000; uiCrystalfireBreathTimer = 14*IN_MILISECONDS;
} else CRYSTALFIRE_BREATH_Timer -=diff; } else uiCrystalfireBreathTimer -= diff;
if (TAIL_SWEEP_Timer <= diff) if (uiTailSweepTimer <= diff)
{ {
DoCast(m_creature, SPELL_TAIL_SWEEP); DoCast(m_creature, SPELL_TAIL_SWEEP);
TAIL_SWEEP_Timer = 5000; uiTailSweepTimer = 5*IN_MILISECONDS;
} else TAIL_SWEEP_Timer -=diff; } else uiTailSweepTimer -= diff;
if (CRYSTAL_CHAINS_CRYSTALIZE_Timer <= diff) if (uiCrystalChainsCrystalizeTimer <= diff)
{ {
DoScriptText(SAY_CRYSTAL_NOVA, m_creature); DoScriptText(SAY_CRYSTAL_NOVA, m_creature);
if (IsHeroic()) if (IsHeroic())
DoCast(m_creature, SPELL_CRYSTALIZE); DoCast(m_creature, SPELL_CRYSTALIZE);
else if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) else if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CRYSTAL_CHAINS); DoCast(pTarget, SPELL_CRYSTAL_CHAINS);
CRYSTAL_CHAINS_CRYSTALIZE_Timer = DUNGEON_MODE(30000,11000); uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILISECONDS,11*IN_MILISECONDS);
} else CRYSTAL_CHAINS_CRYSTALIZE_Timer -= diff; } else uiCrystalChainsCrystalizeTimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
@@ -230,14 +219,14 @@ bool GOHello_containment_sphere(Player *pPlayer, GameObject *pGO)
{ {
ScriptedInstance *pInstance = pGO->GetInstanceData(); ScriptedInstance *pInstance = pGO->GetInstanceData();
Creature *Keristrasza = Unit::GetCreature(*pGO, pInstance ? pInstance->GetData64(DATA_KERISTRASZA) : 0); Creature *pKeristrasza = Unit::GetCreature(*pGO, pInstance ? pInstance->GetData64(DATA_KERISTRASZA) : 0);
if (Keristrasza && Keristrasza->isAlive()) if (pKeristrasza && pKeristrasza->isAlive())
{ {
// maybe these are hacks :( // maybe these are hacks :(
pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
pGO->SetGoState(GO_STATE_ACTIVE); pGO->SetGoState(GO_STATE_ACTIVE);
CAST_AI(boss_keristraszaAI, Keristrasza->AI())->CheckContainmentSpheres(true); CAST_AI(boss_keristraszaAI, pKeristrasza->AI())->CheckContainmentSpheres(true);
} }
return true; return true;
} }
@@ -1,4 +1,5 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* Copyright (C) 2008 - 2010 TrinityCore <http://www.trinitycore.org>
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@@ -14,52 +15,44 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
/* ScriptData
SDName: Boss_Magus_Telestra
SD%Complete:
SDComment:
SDCategory: The Nexus, The Nexus
EndScriptData */
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "nexus.h" #include "nexus.h"
enum eEnums enum Spells
{ {
//Spells SPELL_ICE_NOVA = 47772,
SPELL_ICE_NOVA_N = 47772, H_SPELL_ICE_NOVA = 56935,
SPELL_ICE_NOVA_H = 56935, SPELL_FIREBOMB = 47773,
SPELL_FIREBOMB_N = 47773, H_SPELL_FIREBOMB = 56934,
SPELL_FIREBOMB_H = 56934, SPELL_GRAVITY_WELL = 47756,
SPELL_GRAVITY_WELL = 47756, SPELL_TELESTRA_BACK = 47714,
SPELL_TELESTRA_BACK = 47714,
//At 50% HP - 3 clones, Frost, Fire, Arcane (and in 10% HP in Heroic) SPELL_FIRE_MAGUS_VISUAL = 47705,
MOB_FIRE_MAGUS = 26928, SPELL_FROST_MAGUS_VISUAL = 47706,
MOB_FROST_MAGUS = 26930, SPELL_ARCANE_MAGUS_VISUAL = 47704
MOB_ARCANE_MAGUS = 26929, };
enum Creatures
SPELL_FIRE_MAGUS_VISUAL = 47705, {
SPELL_FROST_MAGUS_VISUAL = 47706, MOB_FIRE_MAGUS = 26928,
SPELL_ARCANE_MAGUS_VISUAL = 47704, MOB_FROST_MAGUS = 26930,
MOB_ARCANE_MAGUS = 26929
//Yell };
SAY_AGGRO = -1576000, enum Yells
SAY_KILL = -1576001, {
SAY_DEATH = -1576002, SAY_AGGRO = -1576000,
SAY_MERGE = -1576003, SAY_KILL = -1576001,
SAY_SPLIT_1 = -1576004, SAY_DEATH = -1576002,
SAY_SPLIT_2 = -1576005, SAY_MERGE = -1576003,
SAY_SPLIT_1 = -1576004,
//Achievement SAY_SPLIT_2 = -1576005,
ACHIEV_SPLIT_PERSONALITY = 2150, };
ACHIEV_TIMER = 5 * 1000 enum Achievements
{
ACHIEV_SPLIT_PERSONALITY = 2150,
ACHIEV_TIMER = 5*IN_MILISECONDS
}; };
float CenterOfRoom[1][4] = const Position CenterOfRoom = {504.80, 89.07, -16.12, 6.27};
{
{504.80, 89.07, -16.12, 6.27}
};
struct boss_magus_telestraAI : public ScriptedAI struct boss_magus_telestraAI : public ScriptedAI
{ {
@@ -70,45 +63,44 @@ struct boss_magus_telestraAI : public ScriptedAI
ScriptedInstance* pInstance; ScriptedInstance* pInstance;
uint64 FireMagusGUID; uint64 uiFireMagusGUID;
uint64 FrostMagusGUID; uint64 uiFrostMagusGUID;
uint64 ArcaneMagusGUID; uint64 uiArcaneMagusGUID;
bool FireMagusDead;
bool FrostMagusDead; bool bFireMagusDead;
bool ArcaneMagusDead; bool bFrostMagusDead;
bool bArcaneMagusDead;
bool bIsWaitingToAppear;
bool bIsAchievementTimerRunning;
uint32 AppearDelay_Timer; uint32 uiIsWaitingToAppearTimer;
bool AppearDelay; uint32 uiIceNovaTimer;
uint32 uiFireBombTimer;
uint32 uiGravityWellTimer;
uint32 uiCooldown;
uint32 uiAchievementTimer;
uint8 Phase; uint8 Phase;
uint8 uiAchievementProgress;
uint32 SPELL_ICE_NOVA_Timer;
uint32 SPELL_FIREBOMB_Timer;
uint32 SPELL_GRAVITY_WELL_Timer;
uint32 Cooldown;
bool AchievementTimerRunning;
uint8 AchievementProgress;
uint32 AchievementTimer;
void Reset() void Reset()
{ {
Phase = 0; Phase = 0;
//These times are probably wrong //These times are probably wrong
SPELL_ICE_NOVA_Timer = 7000; uiIceNovaTimer = 7*IN_MILISECONDS;
SPELL_FIREBOMB_Timer = 0; uiFireBombTimer = 0;
SPELL_GRAVITY_WELL_Timer = 15000; uiGravityWellTimer = 15*IN_MILISECONDS;
Cooldown = 0; uiCooldown = 0;
FireMagusGUID = 0; uiFireMagusGUID = 0;
FrostMagusGUID = 0; uiFrostMagusGUID = 0;
ArcaneMagusGUID = 0; uiArcaneMagusGUID = 0;
AchievementProgress = 0; uiAchievementProgress = 0;
AchievementTimer = 0; uiAchievementTimer = 0;
AchievementTimerRunning = false;
bIsAchievementTimerRunning = false;
AppearDelay = false; bIsWaitingToAppear = false;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetVisibility(VISIBILITY_ON); m_creature->SetVisibility(VISIBILITY_ON);
@@ -129,23 +121,12 @@ struct boss_magus_telestraAI : public ScriptedAI
{ {
DoScriptText(SAY_DEATH, m_creature); DoScriptText(SAY_DEATH, m_creature);
if (IsHeroic() && AchievementProgress == 2)
{
AchievementEntry const *AchievSplitPersonality = GetAchievementStore()->LookupEntry(ACHIEV_SPLIT_PERSONALITY);
if (AchievSplitPersonality)
{
Map* pMap = m_creature->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievSplitPersonality);
}
}
}
if (pInstance) if (pInstance)
{
if (IsHeroic() && uiAchievementProgress == 2)
pInstance->DoCompleteAchievement(ACHIEV_SPLIT_PERSONALITY);
pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE); pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE);
}
} }
void KilledUnit(Unit *victim) void KilledUnit(Unit *victim)
@@ -155,8 +136,7 @@ struct boss_magus_telestraAI : public ScriptedAI
uint64 SplitPersonality(uint32 entry) uint64 SplitPersonality(uint32 entry)
{ {
Creature* Summoned = m_creature->SummonCreature(entry, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); if (Creature* Summoned = m_creature->SummonCreature(entry, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS))
if (Summoned)
{ {
switch (entry) switch (entry)
{ {
@@ -191,147 +171,148 @@ struct boss_magus_telestraAI : public ScriptedAI
return; return;
} }
if (AppearDelay) if (bIsWaitingToAppear)
{ {
m_creature->StopMoving(); m_creature->StopMoving();
m_creature->AttackStop(); m_creature->AttackStop();
if (AppearDelay_Timer <= diff) if (uiIsWaitingToAppearTimer <= diff)
{ {
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
AppearDelay = false; bIsWaitingToAppear = false;
} else AppearDelay_Timer -= diff; } else uiIsWaitingToAppearTimer -= diff;
return; return;
} }
if ((Phase == 1)||(Phase == 3)) if ((Phase == 1) ||(Phase == 3))
{ {
Unit* FireMagus; Unit* pFireMagus;
Unit* FrostMagus; Unit* pFrostMagus;
Unit* ArcaneMagus; Unit* pArcaneMagus;
if (FireMagusGUID) if (uiFireMagusGUID)
FireMagus = Unit::GetUnit((*m_creature), FireMagusGUID); pFireMagus = Unit::GetUnit((*m_creature), uiFireMagusGUID);
if (FrostMagusGUID) if (uiFrostMagusGUID)
FrostMagus = Unit::GetUnit((*m_creature), FrostMagusGUID); pFrostMagus = Unit::GetUnit((*m_creature), uiFrostMagusGUID);
if (ArcaneMagusGUID) if (uiArcaneMagusGUID)
ArcaneMagus = Unit::GetUnit((*m_creature), ArcaneMagusGUID); pArcaneMagus = Unit::GetUnit((*m_creature), uiArcaneMagusGUID);
if (FireMagus && FireMagus->isDead()) if (pFireMagus && pFireMagus->isDead())
{ {
FireMagusDead = true; bFireMagusDead = true;
if (!AchievementTimerRunning) if (!bIsAchievementTimerRunning)
AchievementTimerRunning = true; bIsAchievementTimerRunning = true;
} }
if (FrostMagus && FrostMagus->isDead()) if (pFrostMagus && pFrostMagus->isDead())
{ {
FrostMagusDead = true; bFrostMagusDead = true;
if (!AchievementTimerRunning) if (!bIsAchievementTimerRunning)
AchievementTimerRunning = true; bIsAchievementTimerRunning = true;
} }
if (ArcaneMagus && ArcaneMagus->isDead()) if (pArcaneMagus && pArcaneMagus->isDead())
{ {
ArcaneMagusDead = true; bArcaneMagusDead = true;
if (!AchievementTimerRunning) if (!bIsAchievementTimerRunning)
AchievementTimerRunning = true; bIsAchievementTimerRunning = true;
} }
if (AchievementTimerRunning) if (bIsAchievementTimerRunning)
AchievementTimer += diff; uiAchievementTimer += diff;
if (FireMagusDead && FrostMagusDead && ArcaneMagusDead) if (bFireMagusDead && bFrostMagusDead && bArcaneMagusDead)
{ {
if (AchievementTimer <= ACHIEV_TIMER) if (uiAchievementTimer <= ACHIEV_TIMER)
AchievementProgress +=1; uiAchievementProgress +=1;
m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->Clear();
m_creature->GetMap()->CreatureRelocation(m_creature, CenterOfRoom[0][0], CenterOfRoom[0][1], CenterOfRoom[0][2], CenterOfRoom[0][3]); m_creature->GetMap()->CreatureRelocation(m_creature, CenterOfRoom.GetPositionX(), CenterOfRoom.GetPositionY(), CenterOfRoom.GetPositionZ(), CenterOfRoom.GetOrientation());
DoCast(m_creature, SPELL_TELESTRA_BACK); DoCast(m_creature, SPELL_TELESTRA_BACK);
m_creature->SetVisibility(VISIBILITY_ON); m_creature->SetVisibility(VISIBILITY_ON);
if (Phase == 1) if (Phase == 1)
Phase = 2; Phase = 2;
if (Phase == 3) if (Phase == 3)
Phase = 4; Phase = 4;
FireMagusGUID = 0; uiFireMagusGUID = 0;
FrostMagusGUID = 0; uiFrostMagusGUID = 0;
ArcaneMagusGUID = 0; uiArcaneMagusGUID = 0;
AppearDelay = true; bIsWaitingToAppear = true;
AppearDelay_Timer = 4000; uiIsWaitingToAppearTimer = 4*IN_MILISECONDS;
DoScriptText(SAY_MERGE, m_creature); DoScriptText(SAY_MERGE, m_creature);
AchievementTimerRunning = false; bIsAchievementTimerRunning = false;
AchievementTimer = 0; uiAchievementTimer = 0;
}else }
else
return; return;
} }
if ((Phase == 0) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.5))) if ((Phase == 0) && HealthBelowPct(50))
{ {
Phase = 1; Phase = 1;
m_creature->CastStop(); m_creature->CastStop();
m_creature->RemoveAllAuras(); m_creature->RemoveAllAuras();
m_creature->SetVisibility(VISIBILITY_OFF); m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); uiFireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS);
FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); uiFrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS);
ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); uiArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS);
FireMagusDead = false; bFireMagusDead = false;
FrostMagusDead = false; bFrostMagusDead = false;
ArcaneMagusDead = false; bArcaneMagusDead = false;
DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), m_creature); DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), m_creature);
return; return;
} }
if (IsHeroic() && (Phase == 2) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.1))) if (IsHeroic() && (Phase == 2) && HealthBelowPct(10))
{ {
Phase = 3; Phase = 3;
m_creature->CastStop(); m_creature->CastStop();
m_creature->RemoveAllAuras(); m_creature->RemoveAllAuras();
m_creature->SetVisibility(VISIBILITY_OFF); m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); uiFireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS);
FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); uiFrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS);
ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); uiArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS);
FireMagusDead = false; bFireMagusDead = false;
FrostMagusDead = false; bFrostMagusDead = false;
ArcaneMagusDead = false; bArcaneMagusDead = false;
DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), m_creature); DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), m_creature);
return; return;
} }
if (Cooldown) if (uiCooldown)
{ {
if (Cooldown <= diff) if (uiCooldown <= diff)
Cooldown = 0; uiCooldown = 0;
else else
{ {
Cooldown -= diff; uiCooldown -= diff;
return; return;
} }
} }
if (SPELL_ICE_NOVA_Timer <= diff) if (uiIceNovaTimer <= diff)
{ {
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{ {
DoCast(pTarget, DUNGEON_MODE(SPELL_ICE_NOVA_N, SPELL_ICE_NOVA_H)); DoCast(pTarget, DUNGEON_MODE(SPELL_ICE_NOVA, H_SPELL_ICE_NOVA));
Cooldown = 1500; uiCooldown = 1.5*IN_MILISECONDS;
} }
SPELL_ICE_NOVA_Timer = 15000; uiIceNovaTimer = 15*IN_MILISECONDS;
} else SPELL_ICE_NOVA_Timer -=diff; } else uiIceNovaTimer -= diff;
if (SPELL_GRAVITY_WELL_Timer <= diff) if (uiGravityWellTimer <= diff)
{ {
if (Unit *pTarget = m_creature->getVictim()) if (Unit *pTarget = m_creature->getVictim())
{ {
DoCast(pTarget, SPELL_GRAVITY_WELL); DoCast(pTarget, SPELL_GRAVITY_WELL);
Cooldown = 6000; uiCooldown = 6*IN_MILISECONDS;
} }
SPELL_GRAVITY_WELL_Timer = 15000; uiGravityWellTimer = 15*IN_MILISECONDS;
} else SPELL_GRAVITY_WELL_Timer -=diff; } else uiGravityWellTimer -= diff;
if (SPELL_FIREBOMB_Timer <= diff) if (uiFireBombTimer <= diff)
{ {
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{ {
DoCast(pTarget, DUNGEON_MODE(SPELL_FIREBOMB_N, SPELL_FIREBOMB_H)); DoCast(pTarget, DUNGEON_MODE(SPELL_FIREBOMB, H_SPELL_FIREBOMB));
Cooldown = 2000; uiCooldown = 2*IN_MILISECONDS;
} }
SPELL_FIREBOMB_Timer = 2000; uiFireBombTimer = 2*IN_MILISECONDS;
} else SPELL_FIREBOMB_Timer -=diff; } else uiFireBombTimer -=diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
@@ -1,4 +1,5 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* Copyright (C) 2008 - 2010 TrinityCore <http://www.trinitycore.org>
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@@ -14,41 +15,35 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
/* ScriptData
SDName: Boss_Ormorok
SD%Complete:
SDComment:
SDCategory: The Nexus, The Nexus
EndScriptData */
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "nexus.h" #include "nexus.h"
enum eEnums enum Spells
{ {
//Spells SPELL_CRYSTAL_SPIKES = 47958, //Don't work, using walkaround
SPELL_CRYSTAL_SPIKES_N = 47958, //Don't work, using walkaround H_SPELL_CRYSTAL_SPIKES = 57082, //Don't work, using walkaround
SPELL_CRYSTAL_SPIKES_H = 57082, //Don't work, using walkaround SPELL_CRYSTALL_SPIKE_DAMAGE = 47944,
//Walkaround for spells Crystal Spikes ----------------- H_SPELL_CRYSTALL_SPIKE_DAMAGE = 57067,
SPELL_CRYSTALL_SPIKE_DAMAGE_N = 47944, SPELL_CRYSTAL_SPIKE_PREVISUAL = 50442,
SPELL_CRYSTALL_SPIKE_DAMAGE_H = 57067, MOB_CRYSTAL_SPIKE = 27099,
SPELL_CRYSTAL_SPIKE_PREVISUAL = 50442, SPELL_SPELL_REFLECTION = 47981,
MOB_CRYSTAL_SPIKE = 27099, SPELL_TRAMPLE = 48016,
//------------------------------------------------------ H_SPELL_TRAMPLE = 57066,
SPELL_SPELL_REFLECTION = 47981, SPELL_FRENZY = 48017,
SPELL_TRAMPLE_N = 48016, SPELL_SUMMON_CRYSTALLINE_TANGLER = 61564, //summons npc 32665
SPELL_TRAMPLE_H = 57066, SPELL_ROOTS = 28858 //proper spell id is unknown
SPELL_FRENZY = 48017, };
SPELL_SUMMON_CRYSTALLINE_TANGLER = 61564, //summons npc 32665 enum Yells
MOB_CRYSTALLINE_TANGLER = 32665, {
SPELL_ROOTS = 28858, //proper spell id is unknown SAY_AGGRO = -1576020,
SAY_DEATH = -1576021,
//Yell SAY_REFLECT = -1576022,
SAY_AGGRO = -1576020, SAY_CRYSTAL_SPIKES = -1576023,
SAY_DEATH = -1576021, SAY_KILL = -1576024
SAY_REFLECT = -1576022, };
SAY_CRYSTAL_SPIKES = -1576023, enum Creatures
SAY_KILL = -1576024 {
MOB_CRYSTALLINE_TANGLER = 32665
}; };
#define SPIKE_DISTANCE 5.0f #define SPIKE_DISTANCE 5.0f
@@ -62,30 +57,30 @@ struct boss_ormorokAI : public ScriptedAI
ScriptedInstance* pInstance; ScriptedInstance* pInstance;
bool Frenzy; bool bFrenzy;
bool CrystalSpikes; bool bCrystalSpikes;
uint8 CrystalSpikes_Count; uint8 uiCrystalSpikesCount;
float BaseX; float fBaseX;
float BaseY; float fBaseY;
float BaseZ; float fBaseZ;
float BaseO; float fBaseO;
float SpikeXY[4][2]; float fSpikeXY[4][2];
uint32 SPELL_CRYSTAL_SPIKES_Timer; uint32 uiCrystalSpikesTimer;
uint32 CRYSTAL_SPIKES_Timer; uint32 uiCrystalSpikesTimer2;
uint32 SPELL_TRAMPLE_Timer; uint32 uiTrampleTimer;
uint32 SPELL_FRENZY_Timer; uint32 uiFrenzyTimer;
uint32 SPELL_SPELL_REFLECTION_Timer; uint32 uiSpellReflectionTimer;
uint32 SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer; uint32 uiSummonCrystallineTanglerTimer;
void Reset() void Reset()
{ {
SPELL_CRYSTAL_SPIKES_Timer = 12000; uiCrystalSpikesTimer = 12*IN_MILISECONDS;
SPELL_TRAMPLE_Timer = 10000; uiTrampleTimer = 10*IN_MILISECONDS;
SPELL_SPELL_REFLECTION_Timer = 30000; uiSpellReflectionTimer = 30*IN_MILISECONDS;
SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000; uiSummonCrystallineTanglerTimer = 17*IN_MILISECONDS;
Frenzy = false; bFrenzy = false;
CrystalSpikes = false; bCrystalSpikes = false;
if (pInstance) if (pInstance)
pInstance->SetData(DATA_ORMOROK_EVENT, NOT_STARTED); pInstance->SetData(DATA_ORMOROK_EVENT, NOT_STARTED);
@@ -118,57 +113,57 @@ struct boss_ormorokAI : public ScriptedAI
{ {
return; return;
} }
if (CrystalSpikes) if (bCrystalSpikes)
if (CRYSTAL_SPIKES_Timer <= diff) if (uiCrystalSpikesTimer2 <= diff)
{ {
SpikeXY[0][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO)); fSpikeXY[0][0] = fBaseX+(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO));
SpikeXY[0][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO)); fSpikeXY[0][1] = fBaseY+(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO));
SpikeXY[1][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO)); fSpikeXY[1][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO));
SpikeXY[1][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO)); fSpikeXY[1][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO));
SpikeXY[2][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2))); fSpikeXY[2][0] = fBaseX+(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO-(M_PI/2)));
SpikeXY[2][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2))); fSpikeXY[2][1] = fBaseY+(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO-(M_PI/2)));
SpikeXY[3][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2))); fSpikeXY[3][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO-(M_PI/2)));
SpikeXY[3][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2))); fSpikeXY[3][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO-(M_PI/2)));
for (uint8 i = 0; i < 4; ++i) for (uint8 i = 0; i < 4; ++i)
Creature* Spike = m_creature->SummonCreature(MOB_CRYSTAL_SPIKE, SpikeXY[i][0], SpikeXY[i][1], BaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7000); Creature* Spike = m_creature->SummonCreature(MOB_CRYSTAL_SPIKE, fSpikeXY[i][0], fSpikeXY[i][1], fBaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7*IN_MILISECONDS);
if (++CrystalSpikes_Count >= 13) if (++uiCrystalSpikesCount >= 13)
CrystalSpikes = false; bCrystalSpikes = false;
CRYSTAL_SPIKES_Timer = 200; uiCrystalSpikesTimer2 = 200;
} else CRYSTAL_SPIKES_Timer -= diff; } else uiCrystalSpikesTimer2 -= diff;
if (!Frenzy && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) if (!bFrenzy && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25))
{ {
DoCast(m_creature, SPELL_FRENZY); DoCast(m_creature, SPELL_FRENZY);
Frenzy = true; bFrenzy = true;
} }
if (SPELL_TRAMPLE_Timer <= diff) if (uiTrampleTimer <= diff)
{ {
DoCast(m_creature, DUNGEON_MODE(SPELL_TRAMPLE_N, SPELL_TRAMPLE_H)); DoCast(m_creature, DUNGEON_MODE(SPELL_TRAMPLE, H_SPELL_TRAMPLE));
SPELL_TRAMPLE_Timer = 10000; uiTrampleTimer = 10*IN_MILISECONDS;
} else SPELL_TRAMPLE_Timer -= diff; } else uiTrampleTimer -= diff;
if (SPELL_SPELL_REFLECTION_Timer <= diff) if (uiSpellReflectionTimer <= diff)
{ {
DoScriptText(SAY_REFLECT, m_creature); DoScriptText(SAY_REFLECT, m_creature);
DoCast(m_creature, SPELL_SPELL_REFLECTION); DoCast(m_creature, SPELL_SPELL_REFLECTION);
SPELL_SPELL_REFLECTION_Timer = 30000; uiSpellReflectionTimer = 30*IN_MILISECONDS;
} else SPELL_SPELL_REFLECTION_Timer -= diff; } else uiSpellReflectionTimer -= diff;
if (SPELL_CRYSTAL_SPIKES_Timer <= diff) if (uiCrystalSpikesTimer <= diff)
{ {
DoScriptText(SAY_CRYSTAL_SPIKES, m_creature); DoScriptText(SAY_CRYSTAL_SPIKES, m_creature);
CrystalSpikes = true; bCrystalSpikes = true;
CrystalSpikes_Count = 1; uiCrystalSpikesCount = 1;
CRYSTAL_SPIKES_Timer = 0; uiCrystalSpikesTimer2 = 0;
BaseX = m_creature->GetPositionX(); fBaseX = m_creature->GetPositionX();
BaseY = m_creature->GetPositionY(); fBaseY = m_creature->GetPositionY();
BaseZ = m_creature->GetPositionZ(); fBaseZ = m_creature->GetPositionZ();
BaseO = m_creature->GetOrientation(); fBaseO = m_creature->GetOrientation();
SPELL_CRYSTAL_SPIKES_Timer = 20000; uiCrystalSpikesTimer = 20*IN_MILISECONDS;
} else SPELL_CRYSTAL_SPIKES_Timer -=diff; } else uiCrystalSpikesTimer -= diff;
if (IsHeroic() && (SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer <= diff)) if (IsHeroic() && (uiSummonCrystallineTanglerTimer <= diff))
{ {
Creature* Crystalline_Tangler = m_creature->SummonCreature(MOB_CRYSTALLINE_TANGLER, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); Creature* Crystalline_Tangler = m_creature->SummonCreature(MOB_CRYSTALLINE_TANGLER, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Crystalline_Tangler) if (Crystalline_Tangler)
@@ -205,8 +200,8 @@ struct boss_ormorokAI : public ScriptedAI
Crystalline_Tangler->getThreatManager().addThreat(pTarget, 1000000000.0f); Crystalline_Tangler->getThreatManager().addThreat(pTarget, 1000000000.0f);
} }
} }
SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000; uiSummonCrystallineTanglerTimer = 17*IN_MILISECONDS;
} else SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer -=diff; } else uiSummonCrystallineTanglerTimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
@@ -218,32 +213,28 @@ struct mob_crystal_spikeAI : public Scripted_NoMovementAI
{ {
} }
uint32 SPELL_CRYSTALL_SPIKE_DAMAGE_Timer; uint32 SpellCrystalSpikeDamageTimer;
uint32 SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer; uint32 SpellCrystalSpikePrevisualTimer;
void Reset() void Reset()
{ {
SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 3700; SpellCrystalSpikeDamageTimer = 3.7*IN_MILISECONDS;
SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 1000; SpellCrystalSpikePrevisualTimer = 1*IN_MILISECONDS;
m_creature->SetLevel(80); //
m_creature->setFaction(16); //Walkaround to be independent from data in DB
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); //
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{ {
if (SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer <= diff) if (SpellCrystalSpikePrevisualTimer <= diff)
{ {
DoCast(m_creature, SPELL_CRYSTAL_SPIKE_PREVISUAL); DoCast(m_creature, SPELL_CRYSTAL_SPIKE_PREVISUAL);
SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 10000; SpellCrystalSpikePrevisualTimer = 10*IN_MILISECONDS;
} else SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer -=diff; } else SpellCrystalSpikePrevisualTimer -= diff;
if (SPELL_CRYSTALL_SPIKE_DAMAGE_Timer <= diff) if (SpellCrystalSpikeDamageTimer <= diff)
{ {
DoCast(m_creature, DUNGEON_MODE(SPELL_CRYSTALL_SPIKE_DAMAGE_N, SPELL_CRYSTALL_SPIKE_DAMAGE_H)); DoCast(m_creature, DUNGEON_MODE(SPELL_CRYSTALL_SPIKE_DAMAGE, H_SPELL_CRYSTALL_SPIKE_DAMAGE));
SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 10000; SpellCrystalSpikeDamageTimer = 10*IN_MILISECONDS;
} else SPELL_CRYSTALL_SPIKE_DAMAGE_Timer -=diff; } else SpellCrystalSpikeDamageTimer -= diff;
} }
}; };
@@ -251,23 +242,23 @@ struct mob_crystalline_tanglerAI : public ScriptedAI
{ {
mob_crystalline_tanglerAI(Creature *c) : ScriptedAI(c) {} mob_crystalline_tanglerAI(Creature *c) : ScriptedAI(c) {}
uint32 SPELL_ROOTS_Timer; uint32 uiRootsTimer;
void Reset() void Reset()
{ {
SPELL_ROOTS_Timer = 1000; uiRootsTimer = 1*IN_MILISECONDS;
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{ {
if (SPELL_ROOTS_Timer <= diff) if (uiRootsTimer <= diff)
{ {
if (m_creature->IsWithinDist(m_creature->getVictim(), 5.0f, false)) if (m_creature->IsWithinDist(m_creature->getVictim(), 5.0f, false))
{ {
DoCast(m_creature->getVictim(), SPELL_ROOTS); DoCast(m_creature->getVictim(), SPELL_ROOTS);
SPELL_ROOTS_Timer = 15000; uiRootsTimer = 15*IN_MILISECONDS;
} }
} else SPELL_ROOTS_Timer -=diff; } else uiRootsTimer -= diff;
} }
}; };
@@ -1,4 +1,5 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* Copyright (C) 2008 - 2010 TrinityCore <http://www.trinitycore.org>
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@@ -14,13 +15,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
/* ScriptData
SDName: Instance_Nexus
SD%Complete:
SDComment:
SDCategory: The Nexus, The Nexus
EndScriptData */
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "nexus.h" #include "nexus.h"
@@ -46,6 +40,7 @@ struct instance_nexus : public ScriptedInstance
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
Anomalus = 0; Anomalus = 0;
Keristrasza = 0;
} }
void OnCreatureCreate(Creature *pCreature, bool bAdd) void OnCreatureCreate(Creature *pCreature, bool bAdd)
@@ -69,35 +64,30 @@ struct instance_nexus : public ScriptedInstance
// Alliance npcs are spawned by default, if you are alliance, you will fight against horde npcs. // Alliance npcs are spawned by default, if you are alliance, you will fight against horde npcs.
case 26800: case 26800:
{ {
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE) if (TeamInInstance == ALLIANCE)
pCreature->UpdateEntry(26799, HORDE); pCreature->UpdateEntry(26799, HORDE);
break; break;
} }
case 26802: case 26802:
{ {
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE) if (TeamInInstance == ALLIANCE)
pCreature->UpdateEntry(26801, HORDE); pCreature->UpdateEntry(26801, HORDE);
break; break;
} }
case 26805: case 26805:
{ {
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE) if (TeamInInstance == ALLIANCE)
pCreature->UpdateEntry(26803, HORDE); pCreature->UpdateEntry(26803, HORDE);
break; break;
} }
case 27949: case 27949:
{ {
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE) if (TeamInInstance == ALLIANCE)
pCreature->UpdateEntry(27947, HORDE); pCreature->UpdateEntry(27947, HORDE);
break; break;
} }
case 26796: case 26796:
{ {
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE) if (TeamInInstance == ALLIANCE)
pCreature->UpdateEntry(26798, HORDE); pCreature->UpdateEntry(26798, HORDE);
break; break;