Core/Scripts: Uldaman improvements.

Uldaman now is near to 99% blizzlike, datas and events are fully rewriten.
* Add save to instance.
* Add support for quest 2240 (Hidden Chamber).
* Archeadas Encounter more blizzlike.
* Ironaya Event (and animation) now working for Horde and Ally.

Author: D_Skywalk

Closes issue #4431.

--HG--
branch : trunk
This commit is contained in:
_manuel_
2010-10-21 20:54:47 -03:00
parent cfa052d429
commit 8ad97b1a47
7 changed files with 395 additions and 133 deletions
@@ -27,6 +27,7 @@ On his death the vault door opens.
EndScriptData */
#include "ScriptPCH.h"
#include "uldaman.h"
#define SAY_AGGRO "Who dares awaken Archaedas? Who dares the wrath of the makers!"
#define SOUND_AGGRO 5855
@@ -67,10 +68,10 @@ class boss_archaedas : public CreatureScript
pInstance = me->GetInstanceScript();
}
uint32 Tremor_Timer;
int32 Awaken_Timer;
uint32 uiTremorTimer;
int32 iAwakenTimer;
uint32 WallMinionTimer;
bool wakingUp;
bool bWakingUp;
bool guardiansAwake;
bool vaultWalkersAwake;
@@ -78,11 +79,11 @@ class boss_archaedas : public CreatureScript
void Reset()
{
Tremor_Timer = 60000;
Awaken_Timer = 0;
uiTremorTimer = 60000;
iAwakenTimer = 0;
WallMinionTimer = 10000;
wakingUp = false;
bWakingUp = false;
guardiansAwake = false;
vaultWalkersAwake = false;
@@ -117,8 +118,8 @@ class boss_archaedas : public CreatureScript
if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)) {
me->MonsterYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(me,SOUND_AGGRO);
Awaken_Timer = 4000;
wakingUp = true;
iAwakenTimer = 4000;
bWakingUp = true;
}
}
@@ -133,11 +134,11 @@ class boss_archaedas : public CreatureScript
if (!pInstance)
return;
// we're still doing awaken animation
if (wakingUp && Awaken_Timer >= 0) {
Awaken_Timer -= diff;
if (bWakingUp && iAwakenTimer >= 0) {
iAwakenTimer -= diff;
return; // dont do anything until we are done
} else if (wakingUp && Awaken_Timer <= 0) {
wakingUp = false;
} else if (bWakingUp && iAwakenTimer <= 0) {
bWakingUp = false;
AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0)));
return; // dont want to continue until we finish the AttackStart method
}
@@ -148,7 +149,7 @@ class boss_archaedas : public CreatureScript
// wake a wall minion
if (WallMinionTimer <= diff) {
pInstance->SetData (NULL, 2);
pInstance->SetData (DATA_MINIONS, IN_PROGRESS);
WallMinionTimer = 10000;
} else WallMinionTimer -= diff;
@@ -177,14 +178,14 @@ class boss_archaedas : public CreatureScript
vaultWalkersAwake = true;
}
if (Tremor_Timer <= diff)
if (uiTremorTimer <= diff)
{
//Cast
DoCast(me->getVictim(), SPELL_GROUND_TREMOR);
//45 seconds until we should cast this agian
Tremor_Timer = 45000;
} else Tremor_Timer -= diff;
uiTremorTimer = 45000;
} else uiTremorTimer -= diff;
DoMeleeAttackIfReady();
}
@@ -192,8 +193,8 @@ class boss_archaedas : public CreatureScript
void JustDied (Unit * /*pKiller*/) {
if (pInstance)
{
pInstance->SetData(NULL,3); // open the vault door
pInstance->SetData(NULL,4); // deactivate his minions
pInstance->SetData(DATA_ANCIENT_DOOR, DONE); // open the vault door
pInstance->SetData(DATA_MINIONS, SPECIAL); // deactivate his minions
}
}
};
@@ -229,20 +230,20 @@ class mob_archaedas_minions : public CreatureScript
pInstance = me->GetInstanceScript();
}
uint32 Arcing_Timer;
int32 Awaken_Timer;
bool wakingUp;
uint32 uiArcing_Timer;
int32 iAwakenTimer;
bool bWakingUp;
bool amIAwake;
bool bAmIAwake;
InstanceScript* pInstance;
void Reset()
{
Arcing_Timer = 3000;
Awaken_Timer = 0;
uiArcing_Timer = 3000;
iAwakenTimer = 0;
wakingUp = false;
amIAwake = false;
bWakingUp = false;
bAmIAwake = false;
me->setFaction(35);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -256,32 +257,32 @@ class mob_archaedas_minions : public CreatureScript
me->RemoveAllAuras();
me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
amIAwake = true;
bAmIAwake = 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;
iAwakenTimer = 5000;
bWakingUp = true;
}
}
void MoveInLineOfSight(Unit *who)
{
if (amIAwake)
if (bAmIAwake)
ScriptedAI::MoveInLineOfSight(who);
}
void UpdateAI(const uint32 diff)
{
// we're still in the awaken animation
if (wakingUp && Awaken_Timer >= 0) {
Awaken_Timer -= diff;
if (bWakingUp && iAwakenTimer >= 0) {
iAwakenTimer -= diff;
return; // dont do anything until we are done
} else if (wakingUp && Awaken_Timer <= 0) {
wakingUp = false;
amIAwake = true;
} else if (bWakingUp && iAwakenTimer <= 0) {
bWakingUp = false;
bAmIAwake = true;
// AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0))); // whoWokeArchaedasGUID
return; // dont want to continue until we finish the AttackStart method
}
@@ -355,7 +356,7 @@ class mob_stonekeepers : public CreatureScript
{
DoCast (me, SPELL_SELF_DESTRUCT,true);
if (pInstance)
pInstance->SetData(NULL, 1); // activate next stonekeeper
pInstance->SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // activate next stonekeeper
}
};
@@ -383,7 +384,7 @@ class go_altar_of_archaedas : public GameObjectScript
{
}
bool OnGossipHello(Player* pPlayer, GameObject* /*pGo*/)
bool OnGossipHello(Player* pPlayer, GameObject* /*pGO*/)
{
InstanceScript* pInstance = pPlayer->GetInstanceScript();
if (!pInstance)
@@ -391,7 +392,6 @@ class go_altar_of_archaedas : public GameObjectScript
pPlayer->CastSpell (pPlayer, SPELL_BOSS_OBJECT_VISUAL, false);
pInstance->SetData(NULL,0);
pInstance->SetData64(0,pPlayer->GetGUID()); // activate archaedas
return false;
}
@@ -423,7 +423,7 @@ class go_altar_of_the_keepers : public GameObjectScript
pPlayer->CastSpell (pPlayer, SPELL_BOSS_OBJECT_VISUAL, false);
pInstance->SetData(NULL,1); // activate the Stone Keepers
pInstance->SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // activate the Stone Keepers
return false;
}
};
@@ -44,15 +44,15 @@ class boss_ironaya : public CreatureScript
{
boss_ironayaAI(Creature *c) : ScriptedAI(c) {}
uint32 Arcing_Timer;
bool hasCastedWstomp;
bool hasCastedKnockaway;
uint32 uiArcingTimer;
bool bHasCastedWstomp;
bool bHasCastedKnockaway;
void Reset()
{
Arcing_Timer = 3000;
hasCastedKnockaway = false;
hasCastedWstomp = false;
uiArcingTimer = 3000;
bHasCastedKnockaway = false;
bHasCastedWstomp = false;
}
void EnterCombat(Unit * /*who*/)
@@ -67,7 +67,7 @@ class boss_ironaya : public CreatureScript
return;
//If we are <50% hp do knockaway ONCE
if (!hasCastedKnockaway && HealthBelowPct(50))
if (!bHasCastedKnockaway && HealthBelowPct(50))
{
DoCast(me->getVictim(), SPELL_KNOCKAWAY, true);
@@ -81,20 +81,20 @@ class boss_ironaya : public CreatureScript
me->TauntApply(Target);
//Shouldn't cast this agian
hasCastedKnockaway = true;
bHasCastedKnockaway = true;
}
//Arcing_Timer
if (Arcing_Timer <= diff)
//uiArcingTimer
if (uiArcingTimer <= diff)
{
DoCast(me, SPELL_ARCINGSMASH);
Arcing_Timer = 13000;
} else Arcing_Timer -= diff;
uiArcingTimer = 13000;
} else uiArcingTimer -= diff;
if (!hasCastedWstomp && HealthBelowPct(25))
if (!bHasCastedWstomp && HealthBelowPct(25))
{
DoCast(me, SPELL_WSTOMP);
hasCastedWstomp = true;
bHasCastedWstomp = true;
}
DoMeleeAttackIfReady();
@@ -112,4 +112,4 @@ class boss_ironaya : public CreatureScript
void AddSC_boss_ironaya()
{
new boss_ironaya();
}
}
@@ -16,6 +16,14 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: instance_uldaman
SD%Complete: 99
SDComment: Need some cosmetics updates when archeadas door are closing (Guardians Waypoints).
SDCategory: Uldaman
EndScriptData */
#include "ScriptPCH.h"
#include "uldaman.h"
@@ -42,42 +50,99 @@ class instance_uldaman : public InstanceMapScript
void Initialize()
{
archaedasGUID = 0;
altarOfTheKeeperTempleDoor = 0;
archaedasTempleDoor = 0;
ancientVaultDoor = 0;
whoWokeArchaedasGUID = 0;
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
uiArchaedasGUID = 0;
uiIronayaGUID = 0;
uiWhoWokeuiArchaedasGUID = 0;
uiAltarOfTheKeeperTempleDoor = 0;
uiArchaedasTempleDoor = 0;
uiAncientVaultDoor = 0;
uiIronayaSealDoor = 0;
uiKeystoneGUID = 0;
uiIronayaSealDoorTimer = 27000; //animation time
bKeystoneCheck = false;
}
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*/)
bool IsEncounterInProgress() const
{
switch (pGo->GetEntry())
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
uint64 uiArchaedasGUID;
uint64 uiIronayaGUID;
uint64 uiWhoWokeuiArchaedasGUID;
uint64 uiAltarOfTheKeeperTempleDoor;
uint64 uiArchaedasTempleDoor;
uint64 uiAncientVaultDoor;
uint64 uiIronayaSealDoor;
uint64 uiKeystoneGUID;
uint32 uiIronayaSealDoorTimer;
bool bKeystoneCheck;
std::vector<uint64> vStoneKeeper;
std::vector<uint64> vAltarOfTheKeeperCount;
std::vector<uint64> vVaultWalker;
std::vector<uint64> vEarthenGuardian;
std::vector<uint64> vArchaedasWallMinions; // minions lined up around the wall
uint32 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
void OnGameObjectCreate(GameObject* pGO, bool /*add*/)
{
switch (pGO->GetEntry())
{
case GO_ALTAR_OF_THE_KEEPER_TEMPLE_DOOR: // lock the door
altarOfTheKeeperTempleDoor = pGo->GetGUID();
break;
uiAltarOfTheKeeperTempleDoor = pGO->GetGUID();
if(m_auiEncounter[0] == DONE)
HandleGameObject(NULL, true, pGO);
break;
case GO_ARCHAEDAS_TEMPLE_DOOR:
archaedasTempleDoor = pGo->GetGUID();
break;
uiArchaedasTempleDoor = pGO->GetGUID();
if(m_auiEncounter[0] == DONE)
HandleGameObject(NULL, true, pGO);
break;
case GO_ANCIENT_VAULT_DOOR:
pGo->SetGoState(GO_STATE_READY);
pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
ancientVaultDoor = pGo->GetGUID();
break;
pGO->SetGoState(GO_STATE_READY);
pGO->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
uiAncientVaultDoor = pGO->GetGUID();
if(m_auiEncounter[1] == DONE)
HandleGameObject(NULL, true, pGO);
break;
case GO_IRONAYA_SEAL_DOOR:
uiIronayaSealDoor = pGO->GetGUID();
if (m_auiEncounter[2] == DONE)
HandleGameObject(NULL, true, pGO);
break;
case GO_KEYSTONE:
uiKeystoneGUID = pGO->GetGUID();
if (m_auiEncounter[2] == DONE)
{
HandleGameObject(NULL, true, pGO);
pGO->SetUInt32Value(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
}
break;
}
}
@@ -90,19 +155,27 @@ class instance_uldaman : public InstanceMapScript
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
}
void OpenDoor(uint64 guid)
void SetDoor(uint64 guid, bool open)
{
GameObject* pGo = instance->GetGameObject(guid);
if (!pGo)
GameObject* pGO = instance->GetGameObject(guid);
if (!pGO)
return;
pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
pGo->SetGoState(GO_STATE_ACTIVE);
HandleGameObject(guid, open);
}
void BlockGO(uint64 guid)
{
GameObject *pGO = instance->GetGameObject(guid);
if(!pGO)
return;
pGO->SetUInt32Value(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
}
void ActivateStoneKeepers()
{
for (std::vector<uint64>::const_iterator i = stoneKeeper.begin(); i != stoneKeeper.end(); ++i)
for (std::vector<uint64>::const_iterator i = vStoneKeeper.begin(); i != vStoneKeeper.end(); ++i)
{
Creature *pTarget = instance->GetCreature(*i);
if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14)
@@ -113,16 +186,17 @@ class instance_uldaman : public InstanceMapScript
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);
SetData (DATA_ALTAR_DOORS, DONE);
SetDoor (uiArchaedasTempleDoor, true); //open next the door too
}
void ActivateWallMinions()
{
Creature *archaedas = instance->GetCreature(archaedasGUID);
Creature *archaedas = instance->GetCreature(uiArchaedasGUID);
if (!archaedas)
return;
for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
for (std::vector<uint64>::const_iterator i = vArchaedasWallMinions.begin(); i != vArchaedasWallMinions.end(); ++i)
{
Creature *pTarget = instance->GetCreature(*i);
if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14)
@@ -137,7 +211,7 @@ class instance_uldaman : public InstanceMapScript
void DeActivateMinions()
{
// first despawn any aggroed wall minions
for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
for (std::vector<uint64>::const_iterator i = vArchaedasWallMinions.begin(); i != vArchaedasWallMinions.end(); ++i)
{
Creature *pTarget = instance->GetCreature(*i);
if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14)
@@ -147,7 +221,7 @@ class instance_uldaman : public InstanceMapScript
}
// Vault Walkers
for (std::vector<uint64>::const_iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i)
for (std::vector<uint64>::const_iterator i = vVaultWalker.begin(); i != vVaultWalker.end(); ++i)
{
Creature *pTarget = instance->GetCreature(*i);
if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14)
@@ -157,7 +231,7 @@ class instance_uldaman : public InstanceMapScript
}
// Earthen Guardians
for (std::vector<uint64>::const_iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i)
for (std::vector<uint64>::const_iterator i = vEarthenGuardian.begin(); i != vEarthenGuardian.end(); ++i)
{
Creature *pTarget = instance->GetCreature(*i);
if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14)
@@ -169,21 +243,32 @@ class instance_uldaman : public InstanceMapScript
void ActivateArchaedas(uint64 target)
{
Creature *archaedas = instance->GetCreature(archaedasGUID);
Creature *archaedas = instance->GetCreature(uiArchaedasGUID);
if (!archaedas)
return;
if (Unit::GetUnit(*archaedas, target))
{
archaedas->CastSpell(archaedas, SPELL_ARCHAEDAS_AWAKEN,false);
whoWokeArchaedasGUID = target;
uiWhoWokeuiArchaedasGUID = target;
}
}
void ActivateIronaya()
{
Creature *ironaya = instance->GetCreature(uiIronayaGUID);
if(!ironaya)
return;
ironaya->setFaction(415);
ironaya->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
ironaya->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void RespawnMinions()
{
// first respawn any aggroed wall minions
for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
for (std::vector<uint64>::const_iterator i = vArchaedasWallMinions.begin(); i != vArchaedasWallMinions.end(); ++i)
{
Creature *pTarget = instance->GetCreature(*i);
if (pTarget && pTarget->isDead())
@@ -195,7 +280,7 @@ class instance_uldaman : public InstanceMapScript
}
// Vault Walkers
for (std::vector<uint64>::const_iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i)
for (std::vector<uint64>::const_iterator i = vVaultWalker.begin(); i != vVaultWalker.end(); ++i)
{
Creature *pTarget = instance->GetCreature(*i);
if (pTarget && pTarget->isDead())
@@ -207,7 +292,7 @@ class instance_uldaman : public InstanceMapScript
}
// Earthen Guardians
for (std::vector<uint64>::const_iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i)
for (std::vector<uint64>::const_iterator i = vEarthenGuardian.begin(); i != vEarthenGuardian.end(); ++i)
{
Creature *pTarget = instance->GetCreature(*i);
if (pTarget && pTarget->isDead())
@@ -218,17 +303,89 @@ class instance_uldaman : public InstanceMapScript
}
}
}
void SetData (uint32 /*type*/, uint32 data)
void Update(uint32 diff)
{
//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();
if (!bKeystoneCheck)
return;
if(uiIronayaSealDoorTimer <= diff)
{
ActivateIronaya();
SetDoor(uiIronayaSealDoor, true);
BlockGO(uiKeystoneGUID);
SetData(DATA_IRONAYA_DOOR, DONE); //save state
bKeystoneCheck = false;
}
else
uiIronayaSealDoorTimer -= diff;
}
void SetData (uint32 type, uint32 data)
{
switch(type)
{
case DATA_ALTAR_DOORS:
m_auiEncounter[0] = data;
if(data == DONE)
SetDoor(uiAltarOfTheKeeperTempleDoor, true);
break;
case DATA_ANCIENT_DOOR:
m_auiEncounter[1] = data;
if(data == DONE) //archeadas defeat
{
SetDoor(uiArchaedasTempleDoor, true); //re open enter door
SetDoor(uiAncientVaultDoor, true);
}
break;
case DATA_IRONAYA_DOOR:
m_auiEncounter[2] = data;
break;
case DATA_STONE_KEEPERS:
ActivateStoneKeepers();
break;
case DATA_MINIONS:
switch(data)
{
case NOT_STARTED:
if (m_auiEncounter[0] == DONE) //if players opened the doors
SetDoor(uiArchaedasTempleDoor, true);
RespawnMinions();
break;
case IN_PROGRESS:
ActivateWallMinions();
break;
case SPECIAL:
DeActivateMinions();
break;
}
break;
case DATA_IRONAYA_SEAL:
bKeystoneCheck = true;
break;
}
if (data == DONE)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2];
str_data = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
void SetData64 (uint32 type, uint64 data)
@@ -237,35 +394,70 @@ class instance_uldaman : public InstanceMapScript
if (type == 0)
{
ActivateArchaedas (data);
SetDoor(uiArchaedasTempleDoor, false); //close when event is started
}
}
std::string GetSaveData()
{
return str_data;
}
void Load(const char* in)
{
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
std::istringstream loadStream(in);
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2];
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
{
if (m_auiEncounter[i] == IN_PROGRESS)
m_auiEncounter[i] = NOT_STARTED;
}
OUT_LOAD_INST_DATA_COMPLETE;
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch (pCreature->GetEntry()) {
case 4857: // Stone Keeper
SetFrozenState (pCreature);
stoneKeeper.push_back(pCreature->GetGUID());
vStoneKeeper.push_back(pCreature->GetGUID());
break;
case 7309: // Earthen Custodian
archaedasWallMinions.push_back(pCreature->GetGUID());
vArchaedasWallMinions.push_back(pCreature->GetGUID());
break;
case 7077: // Earthen Hallshaper
archaedasWallMinions.push_back(pCreature->GetGUID());
vArchaedasWallMinions.push_back(pCreature->GetGUID());
break;
case 7076: // Earthen Guardian
earthenGuardian.push_back(pCreature->GetGUID());
vEarthenGuardian.push_back(pCreature->GetGUID());
break;
case 7228: // Ironaya
uiIronayaGUID = pCreature->GetGUID();
if(m_auiEncounter[2] != DONE)
SetFrozenState (pCreature);
break;
case 10120: // Vault Walker
vaultWalker.push_back(pCreature->GetGUID());
vVaultWalker.push_back(pCreature->GetGUID());
break;
case 2748: // Archaedas
archaedasGUID = pCreature->GetGUID();
uiArchaedasGUID = pCreature->GetGUID();
break;
} // end switch
@@ -273,18 +465,18 @@ class instance_uldaman : public InstanceMapScript
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 == 0) return uiWhoWokeuiArchaedasGUID;
if (identifier == 1) return vVaultWalker[0]; // VaultWalker1
if (identifier == 2) return vVaultWalker[1]; // VaultWalker2
if (identifier == 3) return vVaultWalker[2]; // VaultWalker3
if (identifier == 4) return vVaultWalker[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];
if (identifier == 5) return vEarthenGuardian[0];
if (identifier == 6) return vEarthenGuardian[1];
if (identifier == 7) return vEarthenGuardian[2];
if (identifier == 8) return vEarthenGuardian[3];
if (identifier == 9) return vEarthenGuardian[4];
if (identifier == 10) return vEarthenGuardian[5];
return 0;
} // end GetData64
@@ -19,16 +19,19 @@
/* ScriptData
SDName: Uldaman
SD%Complete: 100
SDComment: Quest support: 2278 + 1 trash mob.
SDComment: Quest support: 2240, 2278 + 1 trash mob.
SDCategory: Uldaman
EndScriptData */
/* ContentData
mob_jadespine_basilisk
npc_lore_keeper_of_norgannon
go_keystone_chamber
at_map_chamber
EndContentData */
#include "ScriptPCH.h"
#include "uldaman.h"
/*######
## mob_jadespine_basilisk
@@ -52,11 +55,11 @@ class mob_jadespine_basilisk : public CreatureScript
{
mob_jadespine_basiliskAI(Creature *c) : ScriptedAI(c) {}
uint32 Cslumber_Timer;
uint32 uiCslumberTimer;
void Reset()
{
Cslumber_Timer = 2000;
uiCslumberTimer = 2000;
}
void EnterCombat(Unit * /*who*/)
@@ -69,14 +72,14 @@ class mob_jadespine_basilisk : public CreatureScript
if (!UpdateVictim())
return;
//Cslumber_Timer
if (Cslumber_Timer <= diff)
//uiCslumberTimer
if (uiCslumberTimer <= diff)
{
//Cast
DoCastVictim(SPELL_CRYSTALLINE_SLUMBER, true);
//Stop attacking target thast asleep and pick new target
Cslumber_Timer = 28000;
uiCslumberTimer = 28000;
Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
@@ -86,7 +89,7 @@ class mob_jadespine_basilisk : public CreatureScript
if (Target)
me->TauntApply(Target);
} else Cslumber_Timer -= diff;
} else uiCslumberTimer -= diff;
DoMeleeAttackIfReady();
}
@@ -98,6 +101,51 @@ class mob_jadespine_basilisk : public CreatureScript
}
};
/*######
## go_keystone_chamber
######*/
class go_keystone_chamber : public GameObjectScript
{
public:
go_keystone_chamber() : GameObjectScript("go_keystone_chamber") { }
bool OnGossipHello(Player *pPlayer, GameObject * pGo)
{
if (InstanceScript* pInstance = pGo->GetInstanceScript())
if (pInstance)
pInstance->SetData(DATA_IRONAYA_SEAL, IN_PROGRESS); //door animation and save state.
return false;
}
};
/*######
## at_map_chamber
######*/
#define QUEST_HIDDEN_CHAMBER 2240
class AreaTrigger_at_map_chamber : public AreaTriggerScript
{
public:
AreaTrigger_at_map_chamber()
: AreaTriggerScript("at_map_chamber")
{
}
bool OnTrigger(Player* pPlayer, AreaTriggerEntry const* /*trigger*/)
{
if (pPlayer && ((Player*)pPlayer)->GetQuestStatus(QUEST_HIDDEN_CHAMBER) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(QUEST_HIDDEN_CHAMBER);
return true;
}
};
/*######
## npc_lore_keeper_of_norgannon
######*/
@@ -215,6 +263,8 @@ class npc_lore_keeper_of_norgannon : public CreatureScript
void AddSC_uldaman()
{
new mob_jadespine_basilisk();
new go_keystone_chamber();
new AreaTrigger_at_map_chamber();
new npc_lore_keeper_of_norgannon();
}
@@ -24,6 +24,20 @@ enum eObjects
GO_ARCHAEDAS_TEMPLE_DOOR = 141869,
GO_ALTAR_OF_THE_KEEPER_TEMPLE_DOOR = 124367,
GO_ANCIENT_VAULT_DOOR = 124369,
GO_IRONAYA_SEAL_DOOR = 124372,
GO_KEYSTONE = 124371,
};
enum eData
{
DATA_ALTAR_DOORS = 1,
DATA_ANCIENT_DOOR = 2,
DATA_IRONAYA_DOOR = 3,
DATA_STONE_KEEPERS = 4,
DATA_MINIONS = 5,
DATA_IRONAYA_SEAL = 6,
};
#define MAX_ENCOUNTER 3
#endif