aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp742
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp135
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp528
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp264
4 files changed, 815 insertions, 854 deletions
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
index ba7fbd9ca8f..6c97607e296 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
@@ -38,161 +38,172 @@ EndScriptData */
#define SOUND_SUMMON2 5857
#define SAY_KILL "Reckless mortal."
-#define SOUND_KILL 5858
+#define SOUND_KILL 5858
-#define SPELL_GROUND_TREMOR 6524
-#define SPELL_ARCHAEDAS_AWAKEN 10347
-#define SPELL_BOSS_OBJECT_VISUAL 11206
-#define SPELL_BOSS_AGGRO 10340
-#define SPELL_SUB_BOSS_AGGRO 11568
-#define SPELL_AWAKEN_VAULT_WALKER 10258
-#define SPELL_AWAKEN_EARTHEN_GUARDIAN 10252
-
-struct boss_archaedasAI : public ScriptedAI
+enum eSpells
{
- boss_archaedasAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = me->GetInstanceData();
- }
-
- uint32 Tremor_Timer;
- int32 Awaken_Timer;
- uint32 WallMinionTimer;
- bool wakingUp;
-
- bool guardiansAwake;
- bool vaultWalkersAwake;
- ScriptedInstance* pInstance;
-
- void Reset()
- {
- Tremor_Timer = 60000;
- Awaken_Timer = 0;
- WallMinionTimer = 10000;
-
- wakingUp = false;
- guardiansAwake = false;
- vaultWalkersAwake = false;
-
- if (pInstance)
- pInstance->SetData (NULL, 5); // respawn any dead minions
- me->setFaction(35);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
-
- }
-
- void ActivateMinion (uint64 guid, bool flag)
- {
- Unit *minion = Unit::GetUnit(*me, guid);
-
- if (minion && minion->isAlive())
- {
- DoCast (minion, SPELL_AWAKEN_VAULT_WALKER, flag);
- minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN,true);
- }
- }
-
- void EnterCombat(Unit * /*who*/)
- {
- me->setFaction (14);
- me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
- }
-
- void SpellHit (Unit* /*caster*/, const SpellEntry *spell)
- {
- // Being woken up from the altar, start the awaken sequence
- if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)) {
- me->MonsterYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
- DoPlaySoundToSet(me,SOUND_AGGRO);
- Awaken_Timer = 4000;
- wakingUp = true;
- }
- }
-
- void KilledUnit(Unit * /*victim*/)
- {
- me->MonsterYell(SAY_KILL,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(me, SOUND_KILL);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!pInstance)
- return;
- // we're still doing awaken animation
- if (wakingUp && Awaken_Timer >= 0) {
- Awaken_Timer -= diff;
- return; // dont do anything until we are done
- } else if (wakingUp && Awaken_Timer <= 0) {
- wakingUp = false;
- AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0)));
- return; // dont want to continue until we finish the AttackStart method
- }
+ SPELL_GROUND_TREMOR = 6524,
+ SPELL_ARCHAEDAS_AWAKEN = 10347,
+ SPELL_BOSS_OBJECT_VISUAL = 11206,
+ SPELL_BOSS_AGGRO = 10340,
+ SPELL_SUB_BOSS_AGGRO = 11568,
+ SPELL_AWAKEN_VAULT_WALKER = 10258,
+ SPELL_AWAKEN_EARTHEN_GUARDIAN = 10252,
+};
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- // wake a wall minion
- if (WallMinionTimer <= diff) {
- pInstance->SetData (NULL, 2);
-
- WallMinionTimer = 10000;
- } else WallMinionTimer -= diff;
-
- //If we are <66 summon the guardians
- if (!guardiansAwake && me->GetHealth()*100 / me->GetMaxHealth() <= 66) {
- ActivateMinion(pInstance->GetData64(5),true); // EarthenGuardian1
- ActivateMinion(pInstance->GetData64(6),true); // EarthenGuardian2
- ActivateMinion(pInstance->GetData64(7),true); // EarthenGuardian3
- ActivateMinion(pInstance->GetData64(8),true); // EarthenGuardian4
- ActivateMinion(pInstance->GetData64(9),true); // EarthenGuardian5
- ActivateMinion(pInstance->GetData64(10),false); // EarthenGuardian6
- me->MonsterYell(SAY_SUMMON,LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(me, SOUND_SUMMON);
- guardiansAwake = true;
- }
+class boss_archaedas : public CreatureScript
+{
+ public:
- //If we are <33 summon the vault walkers
- if (!vaultWalkersAwake && me->GetHealth()*100 / me->GetMaxHealth() <= 33) {
- ActivateMinion(pInstance->GetData64(1),true); // VaultWalker1
- ActivateMinion(pInstance->GetData64(2),true); // VaultWalker2
- ActivateMinion(pInstance->GetData64(3),true); // VaultWalker3
- ActivateMinion(pInstance->GetData64(4),false); // VaultWalker4
- me->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL);
- DoPlaySoundToSet(me, SOUND_SUMMON2);
- vaultWalkersAwake = true;
+ boss_archaedas()
+ : CreatureScript("boss_archaedas")
+ {
}
- if (Tremor_Timer <= diff)
+ struct boss_archaedasAI : public ScriptedAI
{
- //Cast
- DoCast(me->getVictim(), SPELL_GROUND_TREMOR);
-
- //45 seconds until we should cast this agian
- Tremor_Timer = 45000;
- } else Tremor_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
-
- void JustDied (Unit * /*killer*/) {
- if (pInstance)
+ boss_archaedasAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = me->GetInstanceData();
+ }
+
+ uint32 Tremor_Timer;
+ int32 Awaken_Timer;
+ uint32 WallMinionTimer;
+ bool wakingUp;
+
+ bool guardiansAwake;
+ bool vaultWalkersAwake;
+ ScriptedInstance* pInstance;
+
+ void Reset()
+ {
+ Tremor_Timer = 60000;
+ Awaken_Timer = 0;
+ WallMinionTimer = 10000;
+
+ wakingUp = false;
+ guardiansAwake = false;
+ vaultWalkersAwake = false;
+
+ if (pInstance)
+ pInstance->SetData (NULL, 5); // respawn any dead minions
+ me->setFaction(35);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ }
+
+ void ActivateMinion (uint64 guid, bool flag)
+ {
+ Unit *minion = Unit::GetUnit(*me, guid);
+
+ if (minion && minion->isAlive())
+ {
+ DoCast (minion, SPELL_AWAKEN_VAULT_WALKER, flag);
+ minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN,true);
+ }
+ }
+
+ void EnterCombat(Unit * /*who*/)
+ {
+ me->setFaction (14);
+ me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
+ }
+
+ void SpellHit (Unit* /*caster*/, const SpellEntry *spell)
+ {
+ // Being woken up from the altar, start the awaken sequence
+ if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)) {
+ me->MonsterYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
+ DoPlaySoundToSet(me,SOUND_AGGRO);
+ Awaken_Timer = 4000;
+ wakingUp = true;
+ }
+ }
+
+ void KilledUnit(Unit * /*victim*/)
+ {
+ me->MonsterYell(SAY_KILL,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_KILL);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!pInstance)
+ return;
+ // we're still doing awaken animation
+ if (wakingUp && Awaken_Timer >= 0) {
+ Awaken_Timer -= diff;
+ return; // dont do anything until we are done
+ } else if (wakingUp && Awaken_Timer <= 0) {
+ wakingUp = false;
+ AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0)));
+ return; // dont want to continue until we finish the AttackStart method
+ }
+
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ // wake a wall minion
+ if (WallMinionTimer <= diff) {
+ pInstance->SetData (NULL, 2);
+
+ WallMinionTimer = 10000;
+ } else WallMinionTimer -= diff;
+
+ //If we are <66 summon the guardians
+ if (!guardiansAwake && me->GetHealth()*100 / me->GetMaxHealth() <= 66) {
+ ActivateMinion(pInstance->GetData64(5),true); // EarthenGuardian1
+ ActivateMinion(pInstance->GetData64(6),true); // EarthenGuardian2
+ ActivateMinion(pInstance->GetData64(7),true); // EarthenGuardian3
+ ActivateMinion(pInstance->GetData64(8),true); // EarthenGuardian4
+ ActivateMinion(pInstance->GetData64(9),true); // EarthenGuardian5
+ ActivateMinion(pInstance->GetData64(10),false); // EarthenGuardian6
+ me->MonsterYell(SAY_SUMMON,LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_SUMMON);
+ guardiansAwake = true;
+ }
+
+ //If we are <33 summon the vault walkers
+ if (!vaultWalkersAwake && me->GetHealth()*100 / me->GetMaxHealth() <= 33) {
+ ActivateMinion(pInstance->GetData64(1),true); // VaultWalker1
+ ActivateMinion(pInstance->GetData64(2),true); // VaultWalker2
+ ActivateMinion(pInstance->GetData64(3),true); // VaultWalker3
+ ActivateMinion(pInstance->GetData64(4),false); // VaultWalker4
+ me->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL);
+ DoPlaySoundToSet(me, SOUND_SUMMON2);
+ vaultWalkersAwake = true;
+ }
+
+ if (Tremor_Timer <= diff)
+ {
+ //Cast
+ DoCast(me->getVictim(), SPELL_GROUND_TREMOR);
+
+ //45 seconds until we should cast this agian
+ Tremor_Timer = 45000;
+ } else Tremor_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+ void JustDied (Unit *pKiller) {
+ if (pInstance)
+ {
+ pInstance->SetData(NULL,3); // open the vault door
+ pInstance->SetData(NULL,4); // deactivate his minions
+ }
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
{
- pInstance->SetData(NULL,3); // open the vault door
- pInstance->SetData(NULL,4); // deactivate his minions
+ return new boss_archaedasAI(creature);
}
- }
-
};
-CreatureAI* GetAI_boss_archaedas(Creature* pCreature)
-{
- return new boss_archaedasAI (pCreature);
-}
-
/* ScriptData
SDName: mob_archaedas_minions
SD%Complete: 100
@@ -200,84 +211,159 @@ SDComment: These mobs are initially frozen until Archaedas awakens them
one at a time.
EndScriptData */
-#define SPELL_ARCHAEDAS_AWAKEN 10347
+#define SPELL_ARCHAEDAS_AWAKEN 10347
-struct mob_archaedas_minionsAI : public ScriptedAI
+class mob_archaedas_minions : public CreatureScript
{
- mob_archaedas_minionsAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = me->GetInstanceData();
- }
-
- uint32 Arcing_Timer;
- int32 Awaken_Timer;
- bool wakingUp;
-
- bool amIAwake;
- ScriptedInstance* pInstance;
-
- void Reset()
- {
- Arcing_Timer = 3000;
- Awaken_Timer = 0;
-
- wakingUp = false;
- amIAwake = false;
-
- me->setFaction(35);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- me->RemoveAllAuras();
- }
-
- void EnterCombat(Unit * /*who*/)
- {
- me->setFaction (14);
- me->RemoveAllAuras();
- me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- amIAwake = true;
- }
-
- void SpellHit (Unit* /*caster*/, const SpellEntry *spell) {
- // time to wake up, start animation
- if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)){
- Awaken_Timer = 5000;
- wakingUp = true;
+ public:
+
+ mob_archaedas_minions()
+ : CreatureScript("mob_archaedas_minions")
+ {
}
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (amIAwake)
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void UpdateAI(const uint32 diff)
- {
- // we're still in the awaken animation
- if (wakingUp && Awaken_Timer >= 0) {
- Awaken_Timer -= diff;
- return; // dont do anything until we are done
- } else if (wakingUp && Awaken_Timer <= 0) {
- wakingUp = false;
- amIAwake = true;
- // AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0))); // whoWokeArchaedasGUID
- return; // dont want to continue until we finish the AttackStart method
+
+ struct mob_archaedas_minionsAI : public ScriptedAI
+ {
+ mob_archaedas_minionsAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = me->GetInstanceData();
+ }
+
+ uint32 Arcing_Timer;
+ int32 Awaken_Timer;
+ bool wakingUp;
+
+ bool amIAwake;
+ ScriptedInstance* pInstance;
+
+ void Reset()
+ {
+ Arcing_Timer = 3000;
+ Awaken_Timer = 0;
+
+ wakingUp = false;
+ amIAwake = false;
+
+ me->setFaction(35);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveAllAuras();
+ }
+
+ void EnterCombat(Unit * /*who*/)
+ {
+ me->setFaction (14);
+ me->RemoveAllAuras();
+ me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ amIAwake = true;
+ }
+
+ void SpellHit (Unit* /*caster*/, const SpellEntry *spell) {
+ // time to wake up, start animation
+ if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)){
+ Awaken_Timer = 5000;
+ wakingUp = true;
+ }
+ }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if (amIAwake)
+ ScriptedAI::MoveInLineOfSight(who);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ // we're still in the awaken animation
+ if (wakingUp && Awaken_Timer >= 0) {
+ Awaken_Timer -= diff;
+ return; // dont do anything until we are done
+ } else if (wakingUp && Awaken_Timer <= 0) {
+ wakingUp = false;
+ amIAwake = true;
+ // AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0))); // whoWokeArchaedasGUID
+ return; // dont want to continue until we finish the AttackStart method
+ }
+
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new mob_archaedas_minionsAI(creature);
}
+};
- //Return since we have no target
- if (!UpdateVictim())
- return;
+/* ScriptData
+SDName: mob_stonekeepers
+SD%Complete: 100
+SDComment: After activating the altar of the keepers, the stone keepers will
+wake up one by one.
+EndScriptData */
- DoMeleeAttackIfReady();
- }
-};
+#define SPELL_SELF_DESTRUCT 9874
-CreatureAI* GetAI_mob_archaedas_minions(Creature* pCreature)
+class mob_stonekeepers : public CreatureScript
{
- return new mob_archaedas_minionsAI (pCreature);
-}
+ public:
+
+ mob_stonekeepers()
+ : CreatureScript("mob_stonekeepers")
+ {
+ }
+
+ struct mob_stonekeepersAI : public ScriptedAI
+ {
+ mob_stonekeepersAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = (me->GetInstanceData());
+ }
+
+ ScriptedInstance* pInstance;
+
+ void Reset()
+ {
+ me->setFaction(35);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveAllAuras();
+ }
+
+ void EnterCombat(Unit * /*who*/)
+ {
+ me->setFaction (14);
+ me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ }
+
+ void UpdateAI(const uint32 /*diff*/)
+ {
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+
+ void JustDied(Unit * /*attacker*/)
+ {
+ DoCast (me, SPELL_SELF_DESTRUCT,true);
+ if (pInstance)
+ pInstance->SetData(NULL, 1); // activate next stonekeeper
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new mob_stonekeepersAI(creature);
+ }
+};
/* ScriptData
SDName: go_altar_archaedas
@@ -286,122 +372,31 @@ SDComment: Needs 1 person to activate the Archaedas script
SDCategory: Uldaman
EndScriptData */
-#define OBJECT_ALTAR_OF_ARCHAEDAS 133234
-
-#define NUMBER_NEEDED_TO_ACTIVATE 1 // as of patch 3.0.8 the altars can be opened by a single player (previously 3)
-
#define SPELL_BOSS_OBJECT_VISUAL 11206
-//uint64 altarOfArchaedasCount[5];
-//int32 altarOfArchaedasCounter=0;
-
-bool GOHello_go_altar_of_archaedas(Player* pPlayer, GameObject* /*pGo*/)
+class go_altar_of_archaedas : public CreatureScript
{
- //bool alreadyUsed;
- //pGo->AddUse ();
-
- /*
- alreadyUsed = false;
- for (uint32 loop=0; loop<5; loop++) {
- if (altarOfArchaedasCount[loop] == pPlayer->GetGUID()) alreadyUsed = true;
- }
- if (!alreadyUsed)
- altarOfArchaedasCount[altarOfArchaedasCounter++] = pPlayer->GetGUID();
- */
-
- pPlayer->CastSpell (pPlayer, SPELL_BOSS_OBJECT_VISUAL, false);
-
- /*
- if (altarOfArchaedasCounter < NUMBER_NEEDED_TO_ACTIVATE)
- return false; // not enough people yet
-
- // Check to make sure at least three people are still casting
- uint8 count = 0;
- Unit *pTarget;
- for (uint8 x = 0; x <= 5; ++x)
- {
- pTarget = Unit::GetUnit(*pPlayer, altarOfArchaedasCount[x]);
- if (!pTarget)
- continue;
- if (pTarget->IsNonMeleeSpellCasted(true))
- ++count;
- if (count >= NUMBER_NEEDED_TO_ACTIVATE)
- break;
- }
-
- if (count < NUMBER_NEEDED_TO_ACTIVATE)
- return false; // not enough people
- */
-
- ScriptedInstance* pInstance = pPlayer->GetInstanceData();
- if (!pInstance)
- return false;
-
- pInstance->SetData(NULL,0);
- pInstance->SetData64(0,pPlayer->GetGUID()); // activate archaedas
-
- return false;
-}
+ public:
-/* ScriptData
-SDName: mob_stonekeepers
-SD%Complete: 100
-SDComment: After activating the altar of the keepers, the stone keepers will
-wake up one by one.
-EndScriptData */
-
-#include "ScriptPCH.h"
+ go_altar_of_archaedas()
+ : CreatureScript("go_altar_of_archaedas")
+ {
+ }
-#define SPELL_SELF_DESTRUCT 9874
+ bool OnGossipHello(Player* pPlayer, GameObject* /*pGo*/)
+ {
+ ScriptedInstance* pInstance = pPlayer->GetInstanceData();
+ if (!pInstance)
+ return false;
-struct mob_stonekeepersAI : public ScriptedAI
-{
- mob_stonekeepersAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = (me->GetInstanceData());
- }
-
- ScriptedInstance* pInstance;
-
- void Reset()
- {
- me->setFaction(35);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- me->RemoveAllAuras();
- }
-
- void EnterCombat(Unit * /*who*/)
- {
- me->setFaction (14);
- me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- }
-
- void UpdateAI(const uint32 /*diff*/)
- {
-
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
-
- void JustDied(Unit * /*attacker*/)
- {
- DoCast (me, SPELL_SELF_DESTRUCT,true);
- if (pInstance)
- pInstance->SetData(NULL, 1); // activate next stonekeeper
- }
+ pPlayer->CastSpell (pPlayer, SPELL_BOSS_OBJECT_VISUAL, false);
+ pInstance->SetData(NULL,0);
+ pInstance->SetData64(0,pPlayer->GetGUID()); // activate archaedas
+ return false;
+ }
};
-CreatureAI* GetAI_mob_stonekeepers(Creature* pCreature)
-{
- return new mob_stonekeepersAI (pCreature);
-}
-
/* ScriptData
SDName: go_altar_of_the_keepers
SD%Complete: 100
@@ -411,89 +406,36 @@ EndScriptData */
#define SPELL_BOSS_OBJECT_VISUAL 11206
-#define NUMBER_NEEDED_TO_ACTIVATE 1 // as of patch 3.0.8 the altars can be opened by a single player (previously 3)
+class go_altar_of_the_keepers : public CreatureScript
+{
+ public:
-//static uint64 altarOfTheKeeperCount[5];
-//static uint32 altarOfTheKeeperCounter=0;
+ go_altar_of_the_keepers()
+ : CreatureScript("go_altar_of_the_keepers")
+ {
+ }
-bool GOHello_go_altar_of_the_keepers(Player* pPlayer, GameObject* /*pGo*/)
-{
- ScriptedInstance* pInstance = pPlayer->GetInstanceData();
- if (!pInstance)
- return true;
-
- //bool alreadyUsed;
-
- //pGo->AddUse();
-
- //alreadyUsed = false;
- //for (uint32 loop=0; loop<5; ++loop)
- //{
- // if (altarOfTheKeeperCount[loop] == pPlayer->GetGUID())
- //alreadyUsed = true;
- //}
- //if (!alreadyUsed && altarOfTheKeeperCounter < 5)
- // altarOfTheKeeperCount[altarOfTheKeeperCounter++] = pPlayer->GetGUID();
- pPlayer->CastSpell (pPlayer, SPELL_BOSS_OBJECT_VISUAL, false);
-
- //if (altarOfTheKeeperCounter < NUMBER_NEEDED_TO_ACTIVATE)
- //{
- //sLog.outError("not enough people yet, altarOfTheKeeperCounter = %d", altarOfTheKeeperCounter);
- // return false; // not enough people yet
- //}
-/*
- // Check to make sure at least three people are still casting
- uint8 count = 0;
- Unit *pTarget;
- for (uint8 x = 0; x < 5; ++x)
- {
- pTarget = Unit::GetUnit(*pPlayer, altarOfTheKeeperCount[x]);
- //sLog.outError("number of people currently activating it: %d", x+1);
- if (!pTarget)
- continue;
- if (pTarget->IsNonMeleeSpellCasted(true))
- ++count;
- if (count >= NUMBER_NEEDED_TO_ACTIVATE)
- break;
- }
-
- if (count < NUMBER_NEEDED_TO_ACTIVATE)
- {
- //sLog.outError("still not enough people");
- return true; // not enough people
- }
-*/
- //sLog.outError ("activating stone keepers");
- pInstance->SetData(NULL,1); // activate the Stone Keepers
- return true;
-}
+ bool OnGossipHello(Player* pPlayer, GameObject* /*pGo*/)
+ {
+ ScriptedInstance* pInstance = pPlayer->GetInstanceData();
+ if (!pInstance)
+ return false;
+
+ pPlayer->CastSpell (pPlayer, SPELL_BOSS_OBJECT_VISUAL, false);
+
+ pInstance->SetData(NULL,1); // activate the Stone Keepers
+ return false;
+ }
+};
+//This is the actual function called only once durring InitScripts()
+//It must define all handled functions that are to be run in this script
void AddSC_boss_archaedas()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_archaedas";
- newscript->GetAI = &GetAI_boss_archaedas;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "go_altar_of_archaedas";
- newscript->pGOHello = &GOHello_go_altar_of_archaedas;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_archaedas_minions";
- newscript->GetAI = &GetAI_mob_archaedas_minions;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "go_altar_of_the_keepers";
- newscript->pGOHello = &GOHello_go_altar_of_the_keepers;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "mob_stonekeepers";
- newscript->GetAI = &GetAI_mob_stonekeepers;
- newscript->RegisterSelf();
+ new boss_archaedas();
+ new mob_archaedas_minions();
+ new mob_stonekeepers();
+ new go_altar_of_archaedas();
+ new go_altar_of_the_keepers();
}
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp
index 71e1bf9d877..da4b6a67cc9 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp
@@ -31,78 +31,85 @@ EndScriptData */
#define SPELL_KNOCKAWAY 10101
#define SPELL_WSTOMP 11876
-struct boss_ironayaAI : public ScriptedAI
+class boss_ironaya : public CreatureScript
{
- boss_ironayaAI(Creature *c) : ScriptedAI(c) {}
-
- uint32 Arcing_Timer;
- bool hasCastedWstomp;
- bool hasCastedKnockaway;
-
- void Reset()
- {
- Arcing_Timer = 3000;
- hasCastedKnockaway = false;
- hasCastedWstomp = false;
- }
-
- void EnterCombat(Unit * /*who*/)
- {
- DoScriptText(SAY_AGGRO, me);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- //If we are <50% hp do knockaway ONCE
- if (!hasCastedKnockaway && me->GetHealth()*2 < me->GetMaxHealth())
- {
- DoCast(me->getVictim(), SPELL_KNOCKAWAY, true);
-
- // current aggro target is knocked away pick new target
- Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
-
- if (!Target || Target == me->getVictim())
- Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
+ public:
- if (Target)
- me->TauntApply(Target);
-
- //Shouldn't cast this agian
- hasCastedKnockaway = true;
+ boss_ironaya()
+ : CreatureScript("boss_ironaya")
+ {
}
- //Arcing_Timer
- if (Arcing_Timer <= diff)
+ struct boss_ironayaAI : public ScriptedAI
{
- DoCast(me, SPELL_ARCINGSMASH);
- Arcing_Timer = 13000;
- } else Arcing_Timer -= diff;
-
- if (!hasCastedWstomp && me->GetHealth()*4 < me->GetMaxHealth())
+ boss_ironayaAI(Creature *c) : ScriptedAI(c) {}
+
+ uint32 Arcing_Timer;
+ bool hasCastedWstomp;
+ bool hasCastedKnockaway;
+
+ void Reset()
+ {
+ Arcing_Timer = 3000;
+ hasCastedKnockaway = false;
+ hasCastedWstomp = false;
+ }
+
+ void EnterCombat(Unit * /*who*/)
+ {
+ DoScriptText(SAY_AGGRO, me);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ //If we are <50% hp do knockaway ONCE
+ if (!hasCastedKnockaway && me->GetHealth()*2 < me->GetMaxHealth())
+ {
+ DoCast(me->getVictim(), SPELL_KNOCKAWAY, true);
+
+ // current aggro target is knocked away pick new target
+ Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
+
+ if (!Target || Target == me->getVictim())
+ Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
+
+ if (Target)
+ me->TauntApply(Target);
+
+ //Shouldn't cast this agian
+ hasCastedKnockaway = true;
+ }
+
+ //Arcing_Timer
+ if (Arcing_Timer <= diff)
+ {
+ DoCast(me, SPELL_ARCINGSMASH);
+ Arcing_Timer = 13000;
+ } else Arcing_Timer -= diff;
+
+ if (!hasCastedWstomp && me->GetHealth()*4 < me->GetMaxHealth())
+ {
+ DoCast(me, SPELL_WSTOMP);
+ hasCastedWstomp = true;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
{
- DoCast(me, SPELL_WSTOMP);
- hasCastedWstomp = true;
+ return new boss_ironayaAI(creature);
}
-
- DoMeleeAttackIfReady();
- }
};
-CreatureAI* GetAI_boss_ironaya(Creature* pCreature)
-{
- return new boss_ironayaAI (pCreature);
-}
-
+//This is the actual function called only once durring InitScripts()
+//It must define all handled functions that are to be run in this script
void AddSC_boss_ironaya()
{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_ironaya";
- newscript->GetAI = &GetAI_boss_ironaya;
- newscript->RegisterSelf();
-}
-
+ new boss_ironaya();
+} \ No newline at end of file
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
index 579c01e7286..b8b43291b35 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
@@ -17,286 +17,286 @@
*/
#include "ScriptPCH.h"
+#include "uldaman.h"
-#define SPELL_ARCHAEDAS_AWAKEN 10347
-#define SPELL_AWAKEN_VAULT_WALKER 10258
+enum eSpells
+{
+ SPELL_ARCHAEDAS_AWAKEN = 10347,
+ SPELL_AWAKEN_VAULT_WALKER = 10258,
+};
-#define ARCHAEDAS_TEMPLE_DOOR 141869
-#define ALTAR_OF_ARCHAEDAS 133234
+class instance_uldaman : public InstanceMapScript
+{
+ public:
+ instance_uldaman()
+ : InstanceMapScript("instance_uldaman")
+ {
+ }
+
+ struct instance_uldaman_InstanceMapScript : public ScriptedInstance
+ {
+ instance_uldaman_InstanceMapScript(Map* pMap) : ScriptedInstance(pMap)
+ {
+ Initialize();
+ };
-#define ALTAR_OF_THE_KEEPER_TEMPLE_DOOR 124367
-#define ALTAR_OF_THE_KEEPER_TEMPLE 130511
+ void Initialize()
+ {
+ archaedasGUID = 0;
+ altarOfTheKeeperTempleDoor = 0;
+ archaedasTempleDoor = 0;
+ ancientVaultDoor = 0;
+ whoWokeArchaedasGUID = 0;
+ }
-#define ANCIENT_VAULT_DOOR 124369
+ uint64 archaedasGUID;
+ uint64 altarOfTheKeeperTempleDoor;
+ uint64 archaedasTempleDoor;
+ uint64 ancientVaultDoor;
+ uint64 whoWokeArchaedasGUID;
-struct instance_uldaman : public ScriptedInstance
-{
- instance_uldaman(Map* pMap) : ScriptedInstance(pMap)
- {
- Initialize();
- };
-
- void Initialize()
- {
- archaedasGUID = 0;
- altarOfTheKeeperTempleDoor = 0;
- archaedasTempleDoor = 0;
- ancientVaultDoor = 0;
- whoWokeArchaedasGUID = 0;
- }
-
- uint64 archaedasGUID;
- uint64 altarOfTheKeeperTempleDoor;
- uint64 archaedasTempleDoor;
- uint64 ancientVaultDoor;
- uint64 whoWokeArchaedasGUID;
-
- std::vector<uint64> stoneKeeper;
- std::vector<uint64> altarOfTheKeeperCount;
- std::vector<uint64> vaultWalker;
- std::vector<uint64> earthenGuardian;
- std::vector<uint64> archaedasWallMinions; // minions lined up around the wall
-
- void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
- {
- switch (pGo->GetEntry())
- {
- case ALTAR_OF_THE_KEEPER_TEMPLE_DOOR: // lock the door
- altarOfTheKeeperTempleDoor = pGo->GetGUID();
- break;
+ std::vector<uint64> stoneKeeper;
+ std::vector<uint64> altarOfTheKeeperCount;
+ std::vector<uint64> vaultWalker;
+ std::vector<uint64> earthenGuardian;
+ std::vector<uint64> archaedasWallMinions; // minions lined up around the wall
+
+ void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
+ {
+ switch (pGo->GetEntry())
+ {
+ case GO_ALTAR_OF_THE_KEEPER_TEMPLE_DOOR: // lock the door
+ altarOfTheKeeperTempleDoor = pGo->GetGUID();
+ break;
+
+ case GO_ARCHAEDAS_TEMPLE_DOOR:
+ archaedasTempleDoor = pGo->GetGUID();
+ break;
+
+ case GO_ANCIENT_VAULT_DOOR:
+ pGo->SetGoState(GO_STATE_READY);
+ pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
+ ancientVaultDoor = pGo->GetGUID();
+ break;
+ }
+ }
- case ARCHAEDAS_TEMPLE_DOOR:
- archaedasTempleDoor = pGo->GetGUID();
- break;
+ void SetFrozenState(Creature* pCreature)
+ {
+ pCreature->setFaction(35);
+ pCreature->RemoveAllAuras();
+ //creature->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_ANIMATION_FROZEN);
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ }
+
+ void OpenDoor(uint64 guid)
+ {
+ GameObject* pGo = instance->GetGameObject(guid);
+ if (!pGo)
+ return;
- case ANCIENT_VAULT_DOOR:
- pGo->SetGoState(GO_STATE_READY);
pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
- ancientVaultDoor = pGo->GetGUID();
- break;
- }
- }
-
- void SetFrozenState(Creature* pCreature)
- {
- pCreature->setFaction(35);
- pCreature->RemoveAllAuras();
- //creature->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_ANIMATION_FROZEN);
- pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- }
-
- void OpenDoor(uint64 guid)
- {
- GameObject* pGo = instance->GetGameObject(guid);
- if (!pGo)
- return;
-
- pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
- pGo->SetGoState(GO_STATE_ACTIVE);
- }
-
- void ActivateStoneKeepers()
- {
- for (std::vector<uint64>::const_iterator i = stoneKeeper.begin(); i != stoneKeeper.end(); ++i)
- {
- Creature *pTarget = instance->GetCreature(*i);
- if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14)
- continue;
- pTarget->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
- pTarget->setFaction(14);
- pTarget->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- return; // only want the first one we find
- }
- // if we get this far than all four are dead so open the door
- SetData (NULL, 0);
- }
-
- void ActivateWallMinions()
- {
- Creature *archaedas = instance->GetCreature(archaedasGUID);
- if (!archaedas)
- return;
-
- for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
- {
- Creature *pTarget = instance->GetCreature(*i);
- if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14)
- continue;
- archaedas->CastSpell(pTarget, SPELL_AWAKEN_VAULT_WALKER, true);
- pTarget->CastSpell(pTarget, SPELL_ARCHAEDAS_AWAKEN,true);
- return; // only want the first one we find
- }
- }
-
- // used when Archaedas dies. All active minions must be despawned.
- void DeActivateMinions()
- {
- // first despawn any aggroed wall minions
- for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
- {
- Creature *pTarget = instance->GetCreature(*i);
- if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14)
- continue;
- pTarget->setDeathState(JUST_DIED);
- pTarget->RemoveCorpse();
- }
-
- // Vault Walkers
- for (std::vector<uint64>::const_iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i)
- {
- Creature *pTarget = instance->GetCreature(*i);
- if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14)
- continue;
- pTarget->setDeathState(JUST_DIED);
- pTarget->RemoveCorpse();
- }
-
- // Earthen Guardians
- for (std::vector<uint64>::const_iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i)
- {
- Creature *pTarget = instance->GetCreature(*i);
- if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14)
- continue;
- pTarget->setDeathState(JUST_DIED);
- pTarget->RemoveCorpse();
- }
- }
-
- void ActivateArchaedas(uint64 target)
- {
- Creature *archaedas = instance->GetCreature(archaedasGUID);
- if (!archaedas)
- return;
-
- if (Unit *victim = Unit::GetUnit(*archaedas, target))
- {
- archaedas->CastSpell(archaedas, SPELL_ARCHAEDAS_AWAKEN,false);
- whoWokeArchaedasGUID = target;
- }
- }
-
- void RespawnMinions()
- {
- // first respawn any aggroed wall minions
- for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
- {
- Creature *pTarget = instance->GetCreature(*i);
- if (pTarget && pTarget->isDead())
+ pGo->SetGoState(GO_STATE_ACTIVE);
+ }
+
+ void ActivateStoneKeepers()
{
- pTarget->Respawn();
- pTarget->GetMotionMaster()->MoveTargetedHome();
- SetFrozenState(pTarget);
+ for (std::vector<uint64>::const_iterator i = stoneKeeper.begin(); i != stoneKeeper.end(); ++i)
+ {
+ Creature *pTarget = instance->GetCreature(*i);
+ if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14)
+ continue;
+ pTarget->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
+ pTarget->setFaction(14);
+ pTarget->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ return; // only want the first one we find
+ }
+ // if we get this far than all four are dead so open the door
+ SetData (NULL, 0);
}
- }
- // Vault Walkers
- for (std::vector<uint64>::const_iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i)
- {
- Creature *pTarget = instance->GetCreature(*i);
- if (pTarget && pTarget->isDead())
+ void ActivateWallMinions()
{
- pTarget->Respawn();
- pTarget->GetMotionMaster()->MoveTargetedHome();
- SetFrozenState(pTarget);
+ Creature *archaedas = instance->GetCreature(archaedasGUID);
+ if (!archaedas)
+ return;
+
+ for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
+ {
+ Creature *pTarget = instance->GetCreature(*i);
+ if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14)
+ continue;
+ archaedas->CastSpell(pTarget, SPELL_AWAKEN_VAULT_WALKER, true);
+ pTarget->CastSpell(pTarget, SPELL_ARCHAEDAS_AWAKEN,true);
+ return; // only want the first one we find
+ }
}
- }
- // Earthen Guardians
- for (std::vector<uint64>::const_iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i)
- {
- Creature *pTarget = instance->GetCreature(*i);
- if (pTarget && pTarget->isDead())
+ // used when Archaedas dies. All active minions must be despawned.
+ void DeActivateMinions()
{
- pTarget->Respawn();
- pTarget->GetMotionMaster()->MoveTargetedHome();
- SetFrozenState(pTarget);
+ // first despawn any aggroed wall minions
+ for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
+ {
+ Creature *pTarget = instance->GetCreature(*i);
+ if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14)
+ continue;
+ pTarget->setDeathState(JUST_DIED);
+ pTarget->RemoveCorpse();
+ }
+
+ // Vault Walkers
+ for (std::vector<uint64>::const_iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i)
+ {
+ Creature *pTarget = instance->GetCreature(*i);
+ if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14)
+ continue;
+ pTarget->setDeathState(JUST_DIED);
+ pTarget->RemoveCorpse();
+ }
+
+ // Earthen Guardians
+ for (std::vector<uint64>::const_iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i)
+ {
+ Creature *pTarget = instance->GetCreature(*i);
+ if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14)
+ continue;
+ pTarget->setDeathState(JUST_DIED);
+ pTarget->RemoveCorpse();
+ }
}
- }
- }
-
- void SetData (uint32 /*type*/, uint32 data)
- {
- //sLog.outError ("SetData: data = %d", data);
- if (data == 0) OpenDoor (altarOfTheKeeperTempleDoor);
- if (data == 0) OpenDoor (archaedasTempleDoor);
- if (data == 3) OpenDoor (ancientVaultDoor);
- if (data == 1) ActivateStoneKeepers();
- if (data == 2) ActivateWallMinions();
- if (data == 4) DeActivateMinions();
- if (data == 5) RespawnMinions();
- }
-
- void SetData64 (uint32 type, uint64 data)
- {
- // Archaedas
- if (type == 0)
- {
- ActivateArchaedas (data);
- }
- }
-
- void OnCreatureCreate(Creature* pCreature, bool /*add*/)
- {
- switch (pCreature->GetEntry()) {
- case 4857: // Stone Keeper
- SetFrozenState (pCreature);
- stoneKeeper.push_back(pCreature->GetGUID());
- break;
-
- case 7309: // Earthen Custodian
- archaedasWallMinions.push_back(pCreature->GetGUID());
- break;
-
- case 7077: // Earthen Hallshaper
- archaedasWallMinions.push_back(pCreature->GetGUID());
- break;
-
- case 7076: // Earthen Guardian
- earthenGuardian.push_back(pCreature->GetGUID());
- break;
-
- case 10120: // Vault Walker
- vaultWalker.push_back(pCreature->GetGUID());
- break;
-
- case 2748: // Archaedas
- archaedasGUID = pCreature->GetGUID();
- break;
-
- } // end switch
- } // end OnCreatureCreate
-
- uint64 GetData64 (uint32 identifier)
- {
- if (identifier == 0) return whoWokeArchaedasGUID;
- if (identifier == 1) return vaultWalker[0]; // VaultWalker1
- if (identifier == 2) return vaultWalker[1]; // VaultWalker2
- if (identifier == 3) return vaultWalker[2]; // VaultWalker3
- if (identifier == 4) return vaultWalker[3]; // VaultWalker4
-
- if (identifier == 5) return earthenGuardian[0];
- if (identifier == 6) return earthenGuardian[1];
- if (identifier == 7) return earthenGuardian[2];
- if (identifier == 8) return earthenGuardian[3];
- if (identifier == 9) return earthenGuardian[4];
- if (identifier == 10) return earthenGuardian[5];
-
- return 0;
- } // end GetData64
-};
-InstanceData* GetInstanceData_instance_uldaman(Map* pMap)
-{
- return new instance_uldaman(pMap);
-}
+ void ActivateArchaedas(uint64 target)
+ {
+ Creature *archaedas = instance->GetCreature(archaedasGUID);
+ if (!archaedas)
+ return;
+
+ if (Unit *victim = Unit::GetUnit(*archaedas, target))
+ {
+ archaedas->CastSpell(archaedas, SPELL_ARCHAEDAS_AWAKEN,false);
+ whoWokeArchaedasGUID = target;
+ }
+ }
-void AddSC_instance_uldaman()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "instance_uldaman";
- newscript->GetInstanceData = &GetInstanceData_instance_uldaman;
- newscript->RegisterSelf();
-}
+ void RespawnMinions()
+ {
+ // first respawn any aggroed wall minions
+ for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
+ {
+ Creature *pTarget = instance->GetCreature(*i);
+ if (pTarget && pTarget->isDead())
+ {
+ pTarget->Respawn();
+ pTarget->GetMotionMaster()->MoveTargetedHome();
+ SetFrozenState(pTarget);
+ }
+ }
+
+ // Vault Walkers
+ for (std::vector<uint64>::const_iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i)
+ {
+ Creature *pTarget = instance->GetCreature(*i);
+ if (pTarget && pTarget->isDead())
+ {
+ pTarget->Respawn();
+ pTarget->GetMotionMaster()->MoveTargetedHome();
+ SetFrozenState(pTarget);
+ }
+ }
+
+ // Earthen Guardians
+ for (std::vector<uint64>::const_iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i)
+ {
+ Creature *pTarget = instance->GetCreature(*i);
+ if (pTarget && pTarget->isDead())
+ {
+ pTarget->Respawn();
+ pTarget->GetMotionMaster()->MoveTargetedHome();
+ SetFrozenState(pTarget);
+ }
+ }
+ }
+
+ void SetData (uint32 /*type*/, uint32 data)
+ {
+ //sLog.outError ("SetData: data = %d", data);
+ if (data == 0) OpenDoor (altarOfTheKeeperTempleDoor);
+ if (data == 0) OpenDoor (archaedasTempleDoor);
+ if (data == 3) OpenDoor (ancientVaultDoor);
+ if (data == 1) ActivateStoneKeepers();
+ if (data == 2) ActivateWallMinions();
+ if (data == 4) DeActivateMinions();
+ if (data == 5) RespawnMinions();
+ }
+ void SetData64 (uint32 type, uint64 data)
+ {
+ // Archaedas
+ if (type == 0)
+ {
+ ActivateArchaedas (data);
+ }
+ }
+
+ void OnCreatureCreate(Creature* pCreature, bool /*add*/)
+ {
+ switch (pCreature->GetEntry()) {
+ case 4857: // Stone Keeper
+ SetFrozenState (pCreature);
+ stoneKeeper.push_back(pCreature->GetGUID());
+ break;
+
+ case 7309: // Earthen Custodian
+ archaedasWallMinions.push_back(pCreature->GetGUID());
+ break;
+
+ case 7077: // Earthen Hallshaper
+ archaedasWallMinions.push_back(pCreature->GetGUID());
+ break;
+
+ case 7076: // Earthen Guardian
+ earthenGuardian.push_back(pCreature->GetGUID());
+ break;
+
+ case 10120: // Vault Walker
+ vaultWalker.push_back(pCreature->GetGUID());
+ break;
+
+ case 2748: // Archaedas
+ archaedasGUID = pCreature->GetGUID();
+ break;
+
+ } // end switch
+ } // end OnCreatureCreate
+
+ uint64 GetData64 (uint32 identifier)
+ {
+ if (identifier == 0) return whoWokeArchaedasGUID;
+ if (identifier == 1) return vaultWalker[0]; // VaultWalker1
+ if (identifier == 2) return vaultWalker[1]; // VaultWalker2
+ if (identifier == 3) return vaultWalker[2]; // VaultWalker3
+ if (identifier == 4) return vaultWalker[3]; // VaultWalker4
+
+ if (identifier == 5) return earthenGuardian[0];
+ if (identifier == 6) return earthenGuardian[1];
+ if (identifier == 7) return earthenGuardian[2];
+ if (identifier == 8) return earthenGuardian[3];
+ if (identifier == 9) return earthenGuardian[4];
+ if (identifier == 10) return earthenGuardian[5];
+
+ return 0;
+ } // end GetData64
+ };
+
+ InstanceData* OnGetInstanceData(InstanceMap* pMap)
+ {
+ return new instance_uldaman_InstanceMapScript(pMap);
+ }
+};
+
+void AddSC_instance_uldaman()
+{
+ new instance_uldaman;
+} \ No newline at end of file
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
index 34cf68d0d21..ea914ba5e4f 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp
@@ -34,57 +34,69 @@ EndContentData */
## mob_jadespine_basilisk
######*/
-#define SPELL_CSLUMBER 3636
+enum eSpells
+{
+ SPELL_CRYSTALLINE_SLUMBER = 3636,
+};
-struct mob_jadespine_basiliskAI : public ScriptedAI
+class mob_jadespine_basilisk : public CreatureScript
{
- mob_jadespine_basiliskAI(Creature *c) : ScriptedAI(c) {}
+ public:
- uint32 Cslumber_Timer;
+ mob_jadespine_basilisk()
+ : CreatureScript("mob_jadespine_basilisk")
+ {
+ }
- void Reset()
- {
- Cslumber_Timer = 2000;
- }
+ struct mob_jadespine_basiliskAI : public ScriptedAI
+ {
+ mob_jadespine_basiliskAI(Creature *c) : ScriptedAI(c) {}
- void EnterCombat(Unit * /*who*/)
- {
- }
+ uint32 Cslumber_Timer;
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ void Reset()
+ {
+ Cslumber_Timer = 2000;
+ }
- //Cslumber_Timer
- if (Cslumber_Timer <= diff)
- {
- //Cast
- // DoCast(me->getVictim(), SPELL_CSLUMBER);
- DoCast(me->getVictim(), SPELL_CSLUMBER, true);
+ void EnterCombat(Unit * /*who*/)
+ {
+ }
- //Stop attacking target thast asleep and pick new target
- Cslumber_Timer = 28000;
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
- Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
+ //Cslumber_Timer
+ if (Cslumber_Timer <= diff)
+ {
+ //Cast
+ DoCastVictim(SPELL_CRYSTALLINE_SLUMBER, true);
- if (!Target || Target == me->getVictim())
- Target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
+ //Stop attacking target thast asleep and pick new target
+ Cslumber_Timer = 28000;
- if (Target)
- me->TauntApply(Target);
+ Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
- } else Cslumber_Timer -= diff;
+ if (!Target || Target == me->getVictim())
+ Target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
- DoMeleeAttackIfReady();
- }
-};
+ if (Target)
+ me->TauntApply(Target);
-CreatureAI* GetAI_mob_jadespine_basilisk(Creature* pCreature)
-{
- return new mob_jadespine_basiliskAI (pCreature);
-}
+ } else Cslumber_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new mob_jadespine_basiliskAI(creature);
+ }
+};
/*######
## npc_lore_keeper_of_norgannon
@@ -107,101 +119,101 @@ CreatureAI* GetAI_mob_jadespine_basilisk(Creature* pCreature)
#define GOSSIP_SELECT_KEEPER14 "This is a lot to think about."
#define GOSSIP_SELECT_KEEPER15 "I will access the discs now."
-bool GossipHello_npc_lore_keeper_of_norgannon(Player* pPlayer, Creature* pCreature)
+class npc_lore_keeper_of_norgannon : public CreatureScript
{
- if (pPlayer->GetQuestStatus(2278) == QUEST_STATUS_INCOMPLETE)
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_KEEPER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ public:
- pPlayer->SEND_GOSSIP_MENU(1079, pCreature->GetGUID());
+ npc_lore_keeper_of_norgannon()
+ : CreatureScript("npc_lore_keeper_of_norgannon")
+ {
+ }
- return true;
-}
+ bool OnGossipHello(Player* pPlayer, Creature* pCreature)
+ {
+ if (pPlayer->GetQuestStatus(2278) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_KEEPER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-bool GossipSelect_npc_lore_keeper_of_norgannon(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
-{
- switch (uiAction)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- pPlayer->SEND_GOSSIP_MENU(1080, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- pPlayer->SEND_GOSSIP_MENU(1081, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- pPlayer->SEND_GOSSIP_MENU(1082, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- pPlayer->SEND_GOSSIP_MENU(1083, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- pPlayer->SEND_GOSSIP_MENU(1084, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
- pPlayer->SEND_GOSSIP_MENU(1085, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8);
- pPlayer->SEND_GOSSIP_MENU(1086, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+8:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
- pPlayer->SEND_GOSSIP_MENU(1087, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+9:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);
- pPlayer->SEND_GOSSIP_MENU(1088, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+10:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+11);
- pPlayer->SEND_GOSSIP_MENU(1089, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+12);
- pPlayer->SEND_GOSSIP_MENU(1090, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+12:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+13);
- pPlayer->SEND_GOSSIP_MENU(1091, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+13:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+14);
- pPlayer->SEND_GOSSIP_MENU(1092, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+14:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+15);
- pPlayer->SEND_GOSSIP_MENU(1093, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+15:
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+16);
- pPlayer->SEND_GOSSIP_MENU(1094, pCreature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+16:
- pPlayer->CLOSE_GOSSIP_MENU();
- pPlayer->AreaExploredOrEventHappens(2278);
- break;
- }
- return true;
-}
+ pPlayer->SEND_GOSSIP_MENU(1079, pCreature->GetGUID());
+
+ return true;
+ }
+
+ bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
+ {
+ switch (uiAction)
+ {
+ case GOSSIP_ACTION_INFO_DEF+1:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ pPlayer->SEND_GOSSIP_MENU(1080, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+2:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ pPlayer->SEND_GOSSIP_MENU(1081, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+3:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ pPlayer->SEND_GOSSIP_MENU(1082, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+4:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ pPlayer->SEND_GOSSIP_MENU(1083, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+5:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ pPlayer->SEND_GOSSIP_MENU(1084, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+6:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
+ pPlayer->SEND_GOSSIP_MENU(1085, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+7:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8);
+ pPlayer->SEND_GOSSIP_MENU(1086, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+8:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
+ pPlayer->SEND_GOSSIP_MENU(1087, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+9:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);
+ pPlayer->SEND_GOSSIP_MENU(1088, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+10:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+11);
+ pPlayer->SEND_GOSSIP_MENU(1089, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+11:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+12);
+ pPlayer->SEND_GOSSIP_MENU(1090, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+12:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+13);
+ pPlayer->SEND_GOSSIP_MENU(1091, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+13:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+14);
+ pPlayer->SEND_GOSSIP_MENU(1092, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+14:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+15);
+ pPlayer->SEND_GOSSIP_MENU(1093, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+15:
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+16);
+ pPlayer->SEND_GOSSIP_MENU(1094, pCreature->GetGUID());
+ break;
+ case GOSSIP_ACTION_INFO_DEF+16:
+ pPlayer->CLOSE_GOSSIP_MENU();
+ pPlayer->AreaExploredOrEventHappens(2278);
+ break;
+ }
+ return true;
+ }
+};
void AddSC_uldaman()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "mob_jadespine_basilisk";
- newscript->GetAI = &GetAI_mob_jadespine_basilisk;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "npc_lore_keeper_of_norgannon";
- newscript->pGossipHello = &GossipHello_npc_lore_keeper_of_norgannon;
- newscript->pGossipSelect = &GossipSelect_npc_lore_keeper_of_norgannon;
- newscript->RegisterSelf();
+ new mob_jadespine_basilisk();
+ new npc_lore_keeper_of_norgannon();
}