aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp3
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp1
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp340
3 files changed, 187 insertions, 157 deletions
diff --git a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp
index bf344b74bf7..25164e08f65 100644
--- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp
@@ -246,7 +246,7 @@ class mob_ahnkahar_nerubian : public CreatureScript
{
}
- void UpdateAI(const uint32 diff)
+ void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
@@ -311,7 +311,6 @@ class achievement_respect_your_elders : public AchievementCriteriaScript
bool OnCheck(Player* /*player*/, Unit* target)
{
- sLog->outString("OnCheck()");
if (Creature* Nadox = target->ToCreature())
if (Nadox->AI()->GetData(DATA_RESPECT_YOUR_ELDERS))
return true;
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp
index 36b5a133905..2274b30b29a 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp
@@ -283,7 +283,6 @@ class achievement_king_dred : public AchievementCriteriaScript
bool OnCheck(Player* /*player*/, Unit* target)
{
- sLog->outString("OnCheck()");
if (Creature* Dred = target->ToCreature())
if (Dred->AI()->GetData(DATA_KING_DRED) >= 6)
return true;
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp
index 415c510f001..34ccd0aec93 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp
@@ -21,7 +21,6 @@
enum Spells
{
- //Spells
SPELL_SPARK = 47751,
H_SPELL_SPARK = 57062,
SPELL_RIFT_SHIELD = 47748,
@@ -35,226 +34,259 @@ enum Adds
MOB_CRAZED_MANA_WRAITH = 26746,
MOB_CHAOTIC_RIFT = 26918
};
+
enum Yells
{
- //Yell
SAY_AGGRO = -1576010,
SAY_DEATH = -1576011,
SAY_RIFT = -1576012,
SAY_SHIELD = -1576013
};
-enum Achievs
+enum RiftSpells
{
- ACHIEV_CHAOS_THEORY = 2037
+ SPELL_CHAOTIC_ENERGY_BURST = 47688,
+ SPELL_CHARGED_CHAOTIC_ENERGY_BURST = 47737,
+ SPELL_ARCANEFORM = 48019, //Chaotic Rift visual
};
-const Position RiftLocation[6] =
+Position const RiftLocation[6] =
{
- {652.64f, -273.70f, -8.75f, 0.0f},
- {634.45f, -265.94f, -8.44f, 0.0f},
- {620.73f, -281.17f, -9.02f, 0.0f},
- {626.10f, -304.67f, -9.44f, 0.0f},
- {639.87f, -314.11f, -9.49f, 0.0f},
- {651.72f, -297.44f, -9.37f, 0.0f}
+ { 652.64f, -273.70f, -8.75f, 0.0f },
+ { 634.45f, -265.94f, -8.44f, 0.0f },
+ { 620.73f, -281.17f, -9.02f, 0.0f },
+ { 626.10f, -304.67f, -9.44f, 0.0f },
+ { 639.87f, -314.11f, -9.49f, 0.0f },
+ { 651.72f, -297.44f, -9.37f, 0.0f }
};
+#define ACTION_RIFT_DEAD 1
+#define DATA_CHAOS_THEORY 2
+
class boss_anomalus : public CreatureScript
{
-public:
- boss_anomalus() : CreatureScript("boss_anomalus") { }
-
- CreatureAI* GetAI(Creature* pCreature) const
- {
- return new boss_anomalusAI (pCreature);
- }
+ public:
+ boss_anomalus() : CreatureScript("boss_anomalus") { }
- struct boss_anomalusAI : public ScriptedAI
- {
- boss_anomalusAI(Creature *c) : ScriptedAI(c)
+ struct boss_anomalusAI : public ScriptedAI
{
- pInstance = c->GetInstanceScript();
- }
-
- InstanceScript* pInstance;
+ boss_anomalusAI(Creature* creature) : ScriptedAI(creature)
+ {
+ instance = me->GetInstanceScript();
+ }
- uint8 Phase;
- uint32 uiSparkTimer;
- uint32 uiCreateRiftTimer;
- uint64 uiChaoticRiftGUID;
+ InstanceScript* instance;
- bool bDeadChaoticRift; // needed for achievement: Chaos Theory(2037)
+ uint8 Phase;
+ uint32 uiSparkTimer;
+ uint32 uiCreateRiftTimer;
+ uint64 uiChaoticRiftGUID;
+ bool chaosTheory;
- void Reset()
- {
- Phase = 0;
- uiSparkTimer = 5*IN_MILLISECONDS;
- uiChaoticRiftGUID = 0;
+ void Reset()
+ {
+ Phase = 0;
+ uiSparkTimer = 5000;
+ uiChaoticRiftGUID = 0;
+ chaosTheory = true;
- bDeadChaoticRift = false;
+ if (instance)
+ instance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED);
+ }
- if (pInstance)
- pInstance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED);
- }
+ void EnterCombat(Unit* /*who*/)
+ {
+ DoScriptText(SAY_AGGRO, me);
- void EnterCombat(Unit* /*who*/)
- {
- DoScriptText(SAY_AGGRO, me);
+ if (instance)
+ instance->SetData(DATA_ANOMALUS_EVENT, IN_PROGRESS);
+ }
- if (pInstance)
- pInstance->SetData(DATA_ANOMALUS_EVENT, IN_PROGRESS);
- }
+ void JustDied(Unit* /*who*/)
+ {
+ DoScriptText(SAY_DEATH, me);
- void JustDied(Unit* /*killer*/)
- {
- DoScriptText(SAY_DEATH, me);
+ if (instance)
+ instance->SetData(DATA_ANOMALUS_EVENT, DONE);
+ }
- if (pInstance)
+ void DoAction(int32 const action)
{
- if (IsHeroic() && !bDeadChaoticRift)
- pInstance->DoCompleteAchievement(ACHIEV_CHAOS_THEORY);
- pInstance->SetData(DATA_ANOMALUS_EVENT, DONE);
+ if (action == ACTION_RIFT_DEAD)
+ chaosTheory = false;
}
- }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ uint32 GetData(uint32 type)
+ {
+ if (type == DATA_CHAOS_THEORY)
+ return chaosTheory ? 1 : 0;
+
+ return 0;
+ }
- if (me->GetDistance(me->GetHomePosition()) > 60.0f)
+ void SetData(uint32 id, uint32 data)
{
- //Not blizzlike, hack to avoid an exploit
- EnterEvadeMode();
- return;
+ if (id == DATA_CHAOS_THEORY)
+ chaosTheory = data ? true : false;
}
- if (me->HasAura(SPELL_RIFT_SHIELD))
+ void UpdateAI(uint32 const diff)
{
- if (uiChaoticRiftGUID)
+ if (!UpdateVictim())
+ return;
+
+ if (me->GetDistance(me->GetHomePosition()) > 60.0f)
{
- Unit* Rift = Unit::GetUnit((*me), uiChaoticRiftGUID);
- if (Rift && Rift->isDead())
- {
- me->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD);
- uiChaoticRiftGUID = 0;
- }
+ // Not blizzlike, hack to avoid an exploit
+ EnterEvadeMode();
return;
}
- } else
- uiChaoticRiftGUID = 0;
- if ((Phase == 0) && HealthBelowPct(50))
- {
- Phase = 1;
- DoScriptText(SAY_SHIELD, me);
- DoCast(me, SPELL_RIFT_SHIELD);
- Creature* Rift = me->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[urand(0, 5)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILLISECONDS);
- if (Rift)
+ if (me->HasAura(SPELL_RIFT_SHIELD))
{
- //DoCast(Rift, SPELL_CHARGE_RIFT);
- if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
- Rift->AI()->AttackStart(pTarget);
- uiChaoticRiftGUID = Rift->GetGUID();
- DoScriptText(SAY_RIFT , me);
+ if (uiChaoticRiftGUID)
+ {
+ Creature* Rift = ObjectAccessor::GetCreature(*me, uiChaoticRiftGUID);
+ if (Rift && Rift->isDead())
+ {
+ me->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD);
+ uiChaoticRiftGUID = 0;
+ }
+ return;
+ }
}
- }
+ else
+ uiChaoticRiftGUID = 0;
- if (uiSparkTimer <= diff)
- {
- if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
- DoCast(pTarget, SPELL_SPARK);
- uiSparkTimer = 5*IN_MILLISECONDS;
- } else uiSparkTimer -= diff;
+ if ((Phase == 0) && HealthBelowPct(50))
+ {
+ Phase = 1;
+ DoScriptText(SAY_SHIELD, me);
+ DoCast(me, SPELL_RIFT_SHIELD);
+ if (Creature* Rift = me->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[urand(0, 5)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000))
+ {
+ //DoCast(Rift, SPELL_CHARGE_RIFT);
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ Rift->AI()->AttackStart(target);
+ uiChaoticRiftGUID = Rift->GetGUID();
+ DoScriptText(SAY_RIFT , me);
+ }
+ }
- DoMeleeAttackIfReady();
- }
- };
+ if (uiSparkTimer <= diff)
+ {
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ DoCast(target, SPELL_SPARK);
+ uiSparkTimer = 5000;
+ }
+ else
+ uiSparkTimer -= diff;
-};
+ DoMeleeAttackIfReady();
+ }
+ };
-enum RiftSpells
-{
- SPELL_CHAOTIC_ENERGY_BURST = 47688,
- SPELL_CHARGED_CHAOTIC_ENERGY_BURST = 47737,
- SPELL_ARCANEFORM = 48019 //Chaotic Rift visual
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new boss_anomalusAI(creature);
+ }
};
class mob_chaotic_rift : public CreatureScript
{
-public:
- mob_chaotic_rift() : CreatureScript("mob_chaotic_rift") { }
+ public:
+ mob_chaotic_rift() : CreatureScript("mob_chaotic_rift") { }
- CreatureAI* GetAI(Creature* pCreature) const
- {
- return new mob_chaotic_riftAI (pCreature);
- }
-
- struct mob_chaotic_riftAI : public Scripted_NoMovementAI
- {
- mob_chaotic_riftAI(Creature *c) : Scripted_NoMovementAI(c)
+ struct mob_chaotic_riftAI : public Scripted_NoMovementAI
{
- pInstance = c->GetInstanceScript();
- }
-
- InstanceScript* pInstance;
+ mob_chaotic_riftAI(Creature* creature) : Scripted_NoMovementAI(creature)
+ {
+ instance = me->GetInstanceScript();
+ }
- uint32 uiChaoticEnergyBurstTimer;
- uint32 uiSummonCrazedManaWraithTimer;
+ InstanceScript* instance;
- void Reset()
- {
- uiChaoticEnergyBurstTimer = 1*IN_MILLISECONDS;
- uiSummonCrazedManaWraithTimer = 5*IN_MILLISECONDS;
- //me->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.
- //Set model to horde number
- DoCast(me, SPELL_ARCANEFORM, false);
- }
+ uint32 uiChaoticEnergyBurstTimer;
+ uint32 uiSummonCrazedManaWraithTimer;
- void JustDied(Unit* /*killer*/)
- {
- if (Creature* pAnomalus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0))
- CAST_AI(boss_anomalus::boss_anomalusAI, pAnomalus->AI())->bDeadChaoticRift = true;
- }
+ void Reset()
+ {
+ uiChaoticEnergyBurstTimer = 1000;
+ uiSummonCrazedManaWraithTimer = 5000;
+ //me->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.
+ //Set model to horde number
+ DoCast(me, SPELL_ARCANEFORM, false);
+ }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ void JustDied(Unit* /*who*/)
+ {
+ if (Creature* Anomalus = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ANOMALUS)))
+ Anomalus->AI()->DoAction(ACTION_RIFT_DEAD);
+ }
- if (uiChaoticEnergyBurstTimer <= diff)
+ void UpdateAI(uint32 const diff)
{
- Unit* pAnomalus = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
- if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ if (!UpdateVictim())
+ return;
+
+ if (uiChaoticEnergyBurstTimer <= diff)
{
- if (pAnomalus && pAnomalus->HasAura(SPELL_RIFT_SHIELD))
- DoCast(pTarget, SPELL_CHARGED_CHAOTIC_ENERGY_BURST);
- else
- DoCast(pTarget, SPELL_CHAOTIC_ENERGY_BURST);
+ Creature* Anomalus = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ANOMALUS));
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ {
+ if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
+ DoCast(target, SPELL_CHARGED_CHAOTIC_ENERGY_BURST);
+ else
+ DoCast(target, SPELL_CHAOTIC_ENERGY_BURST);
+ }
+ uiChaoticEnergyBurstTimer = 1000;
}
- uiChaoticEnergyBurstTimer = 1*IN_MILLISECONDS;
- } else uiChaoticEnergyBurstTimer -= diff;
+ else
+ uiChaoticEnergyBurstTimer -= diff;
- if (uiSummonCrazedManaWraithTimer <= diff)
- {
- Creature* Wraith = me->SummonCreature(MOB_CRAZED_MANA_WRAITH, me->GetPositionX()+1, me->GetPositionY()+1, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILLISECONDS);
- if (Wraith)
- if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
- Wraith->AI()->AttackStart(pTarget);
- Unit* Anomalus = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
- if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
- uiSummonCrazedManaWraithTimer = 5*IN_MILLISECONDS;
+ if (uiSummonCrazedManaWraithTimer <= diff)
+ {
+ if (Creature* Wraith = me->SummonCreature(MOB_CRAZED_MANA_WRAITH, me->GetPositionX() + 1, me->GetPositionY() + 1, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000))
+ if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ Wraith->AI()->AttackStart(pTarget);
+ Creature* Anomalus = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ANOMALUS));
+ if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
+ uiSummonCrazedManaWraithTimer = 5000;
+ else
+ uiSummonCrazedManaWraithTimer = 10000;
+ }
else
- uiSummonCrazedManaWraithTimer = 10*IN_MILLISECONDS;
- } else uiSummonCrazedManaWraithTimer -= diff;
+ uiSummonCrazedManaWraithTimer -= diff;
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new mob_chaotic_riftAI(creature);
}
- };
+};
+class achievement_chaos_theory : public AchievementCriteriaScript
+{
+ public:
+ achievement_chaos_theory() : AchievementCriteriaScript("achievement_chaos_theory")
+ {
+ }
+
+ bool OnCheck(Player* /*player*/, Unit* target)
+ {
+ if (Creature* Anomalus = target->ToCreature())
+ if (Anomalus->AI()->GetData(DATA_CHAOS_THEORY))
+ return true;
+
+ return false;
+ }
};
void AddSC_boss_anomalus()
{
new boss_anomalus();
new mob_chaotic_rift();
+ new achievement_chaos_theory();
}