mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/Script: Uldaman - Altar of the Keepers
... and some codestyle changes.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
UPDATE `gameobject_template` SET `ScriptName`='' WHERE `entry`=130511;
|
||||
@@ -399,35 +399,6 @@ class go_altar_of_archaedas : public GameObjectScript
|
||||
}
|
||||
};
|
||||
|
||||
/* ScriptData
|
||||
SDName: go_altar_of_the_keepers
|
||||
SD%Complete: 100
|
||||
SDComment: Need 1 person to activate to open the altar. One by one the StoneKeepers will activate. After all four are dead than the door will open.
|
||||
SDCategory: Uldaman
|
||||
EndScriptData */
|
||||
|
||||
class go_altar_of_the_keepers : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
|
||||
go_altar_of_the_keepers()
|
||||
: GameObjectScript("go_altar_of_the_keepers")
|
||||
{
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* /*go*/)
|
||||
{
|
||||
InstanceScript* instance = player->GetInstanceScript();
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
player->CastSpell (player, SPELL_BOSS_OBJECT_VISUAL, false);
|
||||
|
||||
instance->SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // 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()
|
||||
@@ -436,6 +407,5 @@ void AddSC_boss_archaedas()
|
||||
new mob_archaedas_minions();
|
||||
new mob_stonekeepers();
|
||||
new go_altar_of_archaedas();
|
||||
new go_altar_of_the_keepers();
|
||||
}
|
||||
|
||||
|
||||
@@ -33,38 +33,38 @@ enum eSpells
|
||||
SPELL_AWAKEN_VAULT_WALKER = 10258,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_SUB_BOSS_AGGRO = 2228
|
||||
};
|
||||
|
||||
class instance_uldaman : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_uldaman()
|
||||
: InstanceMapScript("instance_uldaman", 70)
|
||||
{
|
||||
}
|
||||
instance_uldaman() : InstanceMapScript("instance_uldaman", 70) {}
|
||||
|
||||
struct instance_uldaman_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_uldaman_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
}
|
||||
instance_uldaman_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
uiArchaedasGUID = 0;
|
||||
uiIronayaGUID = 0;
|
||||
uiWhoWokeuiArchaedasGUID = 0;
|
||||
archaedasGUID = 0;
|
||||
ironayaGUID = 0;
|
||||
whoWokeuiArchaedasGUID = 0;
|
||||
|
||||
uiAltarOfTheKeeperTempleDoor = 0;
|
||||
uiArchaedasTempleDoor = 0;
|
||||
uiAncientVaultDoor = 0;
|
||||
altarOfTheKeeperTempleDoor = 0;
|
||||
archaedasTempleDoor = 0;
|
||||
ancientVaultDoor = 0;
|
||||
|
||||
uiIronayaSealDoor = 0;
|
||||
ironayaSealDoor = 0;
|
||||
|
||||
uiKeystoneGUID = 0;
|
||||
keystoneGUID = 0;
|
||||
|
||||
uiIronayaSealDoorTimer = 27000; //animation time
|
||||
bKeystoneCheck = false;
|
||||
ironayaSealDoorTimer = 27000; //animation time
|
||||
keystoneCheck = false;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
@@ -76,25 +76,25 @@ class instance_uldaman : public InstanceMapScript
|
||||
return false;
|
||||
}
|
||||
|
||||
uint64 uiArchaedasGUID;
|
||||
uint64 uiIronayaGUID;
|
||||
uint64 uiWhoWokeuiArchaedasGUID;
|
||||
uint64 archaedasGUID;
|
||||
uint64 ironayaGUID;
|
||||
uint64 whoWokeuiArchaedasGUID;
|
||||
|
||||
uint64 uiAltarOfTheKeeperTempleDoor;
|
||||
uint64 uiArchaedasTempleDoor;
|
||||
uint64 uiAncientVaultDoor;
|
||||
uint64 uiIronayaSealDoor;
|
||||
uint64 altarOfTheKeeperTempleDoor;
|
||||
uint64 archaedasTempleDoor;
|
||||
uint64 ancientVaultDoor;
|
||||
uint64 ironayaSealDoor;
|
||||
|
||||
uint64 uiKeystoneGUID;
|
||||
uint64 keystoneGUID;
|
||||
|
||||
uint32 uiIronayaSealDoorTimer;
|
||||
bool bKeystoneCheck;
|
||||
uint32 ironayaSealDoorTimer;
|
||||
bool keystoneCheck;
|
||||
|
||||
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
|
||||
std::vector<uint64> stoneKeepers;
|
||||
std::vector<uint64> altarOfTheKeeperCounts;
|
||||
std::vector<uint64> vaultWalkers;
|
||||
std::vector<uint64> earthenGuardians;
|
||||
std::vector<uint64> archaedasWallMinions; // minions lined up around the wall
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string str_data;
|
||||
@@ -104,14 +104,14 @@ class instance_uldaman : public InstanceMapScript
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_ALTAR_OF_THE_KEEPER_TEMPLE_DOOR: // lock the door
|
||||
uiAltarOfTheKeeperTempleDoor = go->GetGUID();
|
||||
altarOfTheKeeperTempleDoor = go->GetGUID();
|
||||
|
||||
if (m_auiEncounter[0] == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
break;
|
||||
|
||||
case GO_ARCHAEDAS_TEMPLE_DOOR:
|
||||
uiArchaedasTempleDoor = go->GetGUID();
|
||||
archaedasTempleDoor = go->GetGUID();
|
||||
|
||||
if (m_auiEncounter[0] == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
@@ -120,21 +120,21 @@ class instance_uldaman : public InstanceMapScript
|
||||
case GO_ANCIENT_VAULT_DOOR:
|
||||
go->SetGoState(GO_STATE_READY);
|
||||
go->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
|
||||
uiAncientVaultDoor = go->GetGUID();
|
||||
ancientVaultDoor = go->GetGUID();
|
||||
|
||||
if (m_auiEncounter[1] == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
break;
|
||||
|
||||
case GO_IRONAYA_SEAL_DOOR:
|
||||
uiIronayaSealDoor = go->GetGUID();
|
||||
ironayaSealDoor = go->GetGUID();
|
||||
|
||||
if (m_auiEncounter[2] == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
break;
|
||||
|
||||
case GO_KEYSTONE:
|
||||
uiKeystoneGUID = go->GetGUID();
|
||||
keystoneGUID = go->GetGUID();
|
||||
|
||||
if (m_auiEncounter[2] == DONE)
|
||||
{
|
||||
@@ -174,28 +174,31 @@ class instance_uldaman : public InstanceMapScript
|
||||
|
||||
void ActivateStoneKeepers()
|
||||
{
|
||||
for (std::vector<uint64>::const_iterator i = vStoneKeeper.begin(); i != vStoneKeeper.end(); ++i)
|
||||
if (GetData(DATA_ALTAR_DOORS) != DONE)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (!target || !target->isAlive() || target->getFaction() == 14)
|
||||
continue;
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
target->setFaction(14);
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
return; // only want the first one we find
|
||||
for (std::vector<uint64>::const_iterator i = stoneKeepers.begin(); i != stoneKeepers.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (!target || !target->isAlive())
|
||||
continue;
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
target->setFaction(14);
|
||||
target->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(DATA_ALTAR_DOORS, DONE);
|
||||
SetDoor(archaedasTempleDoor, true); //open next the door too
|
||||
}
|
||||
// if we get this far than all four are dead so open the door
|
||||
SetData(DATA_ALTAR_DOORS, DONE);
|
||||
SetDoor(uiArchaedasTempleDoor, true); //open next the door too
|
||||
}
|
||||
|
||||
void ActivateWallMinions()
|
||||
{
|
||||
Creature* archaedas = instance->GetCreature(uiArchaedasGUID);
|
||||
Creature* archaedas = instance->GetCreature(archaedasGUID);
|
||||
if (!archaedas)
|
||||
return;
|
||||
|
||||
for (std::vector<uint64>::const_iterator i = vArchaedasWallMinions.begin(); i != vArchaedasWallMinions.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (!target || !target->isAlive() || target->getFaction() == 14)
|
||||
@@ -213,7 +216,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
void DeActivateMinions()
|
||||
{
|
||||
// first despawn any aggroed wall minions
|
||||
for (std::vector<uint64>::const_iterator i = vArchaedasWallMinions.begin(); i != vArchaedasWallMinions.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (!target || target->isDead() || target->getFaction() != 14)
|
||||
@@ -223,7 +226,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
}
|
||||
|
||||
// Vault Walkers
|
||||
for (std::vector<uint64>::const_iterator i = vVaultWalker.begin(); i != vVaultWalker.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = vaultWalkers.begin(); i != vaultWalkers.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (!target || target->isDead() || target->getFaction() != 14)
|
||||
@@ -233,7 +236,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
}
|
||||
|
||||
// Earthen Guardians
|
||||
for (std::vector<uint64>::const_iterator i = vEarthenGuardian.begin(); i != vEarthenGuardian.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = earthenGuardians.begin(); i != earthenGuardians.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (!target || target->isDead() || target->getFaction() != 14)
|
||||
@@ -245,20 +248,20 @@ class instance_uldaman : public InstanceMapScript
|
||||
|
||||
void ActivateArchaedas(uint64 target)
|
||||
{
|
||||
Creature* archaedas = instance->GetCreature(uiArchaedasGUID);
|
||||
Creature* archaedas = instance->GetCreature(archaedasGUID);
|
||||
if (!archaedas)
|
||||
return;
|
||||
|
||||
if (Unit::GetUnit(*archaedas, target))
|
||||
{
|
||||
archaedas->CastSpell(archaedas, SPELL_ARCHAEDAS_AWAKEN, false);
|
||||
uiWhoWokeuiArchaedasGUID = target;
|
||||
whoWokeuiArchaedasGUID = target;
|
||||
}
|
||||
}
|
||||
|
||||
void ActivateIronaya()
|
||||
{
|
||||
Creature* ironaya = instance->GetCreature(uiIronayaGUID);
|
||||
Creature* ironaya = instance->GetCreature(ironayaGUID);
|
||||
if (!ironaya)
|
||||
return;
|
||||
|
||||
@@ -270,7 +273,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
void RespawnMinions()
|
||||
{
|
||||
// first respawn any aggroed wall minions
|
||||
for (std::vector<uint64>::const_iterator i = vArchaedasWallMinions.begin(); i != vArchaedasWallMinions.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (target && target->isDead())
|
||||
@@ -282,7 +285,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
}
|
||||
|
||||
// Vault Walkers
|
||||
for (std::vector<uint64>::const_iterator i = vVaultWalker.begin(); i != vVaultWalker.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = vaultWalkers.begin(); i != vaultWalkers.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (target && target->isDead())
|
||||
@@ -294,7 +297,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
}
|
||||
|
||||
// Earthen Guardians
|
||||
for (std::vector<uint64>::const_iterator i = vEarthenGuardian.begin(); i != vEarthenGuardian.end(); ++i)
|
||||
for (std::vector<uint64>::const_iterator i = earthenGuardians.begin(); i != earthenGuardians.end(); ++i)
|
||||
{
|
||||
Creature* target = instance->GetCreature(*i);
|
||||
if (target && target->isDead())
|
||||
@@ -307,21 +310,21 @@ class instance_uldaman : public InstanceMapScript
|
||||
}
|
||||
void Update(uint32 diff)
|
||||
{
|
||||
if (!bKeystoneCheck)
|
||||
if (!keystoneCheck)
|
||||
return;
|
||||
|
||||
if (uiIronayaSealDoorTimer <= diff)
|
||||
if (ironayaSealDoorTimer <= diff)
|
||||
{
|
||||
ActivateIronaya();
|
||||
|
||||
SetDoor(uiIronayaSealDoor, true);
|
||||
BlockGO(uiKeystoneGUID);
|
||||
SetDoor(ironayaSealDoor, true);
|
||||
BlockGO(keystoneGUID);
|
||||
|
||||
SetData(DATA_IRONAYA_DOOR, DONE); //save state
|
||||
bKeystoneCheck = false;
|
||||
keystoneCheck = false;
|
||||
}
|
||||
else
|
||||
uiIronayaSealDoorTimer -= diff;
|
||||
ironayaSealDoorTimer -= diff;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
@@ -331,15 +334,15 @@ class instance_uldaman : public InstanceMapScript
|
||||
case DATA_ALTAR_DOORS:
|
||||
m_auiEncounter[0] = data;
|
||||
if (data == DONE)
|
||||
SetDoor(uiAltarOfTheKeeperTempleDoor, true);
|
||||
SetDoor(altarOfTheKeeperTempleDoor, 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);
|
||||
SetDoor(archaedasTempleDoor, true); //re open enter door
|
||||
SetDoor(ancientVaultDoor, true);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -356,7 +359,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
{
|
||||
case NOT_STARTED:
|
||||
if (m_auiEncounter[0] == DONE) //if players opened the doors
|
||||
SetDoor(uiArchaedasTempleDoor, true);
|
||||
SetDoor(archaedasTempleDoor, true);
|
||||
|
||||
RespawnMinions();
|
||||
break;
|
||||
@@ -372,7 +375,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
break;
|
||||
|
||||
case DATA_IRONAYA_SEAL:
|
||||
bKeystoneCheck = true;
|
||||
keystoneCheck = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -396,7 +399,7 @@ class instance_uldaman : public InstanceMapScript
|
||||
if (type == 0)
|
||||
{
|
||||
ActivateArchaedas (data);
|
||||
SetDoor(uiArchaedasTempleDoor, false); //close when event is started
|
||||
SetDoor(archaedasTempleDoor, false); //close when event is started
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,34 +436,34 @@ class instance_uldaman : public InstanceMapScript
|
||||
{
|
||||
case 4857: // Stone Keeper
|
||||
SetFrozenState (creature);
|
||||
vStoneKeeper.push_back(creature->GetGUID());
|
||||
stoneKeepers.push_back(creature->GetGUID());
|
||||
break;
|
||||
|
||||
case 7309: // Earthen Custodian
|
||||
vArchaedasWallMinions.push_back(creature->GetGUID());
|
||||
archaedasWallMinions.push_back(creature->GetGUID());
|
||||
break;
|
||||
|
||||
case 7077: // Earthen Hallshaper
|
||||
vArchaedasWallMinions.push_back(creature->GetGUID());
|
||||
archaedasWallMinions.push_back(creature->GetGUID());
|
||||
break;
|
||||
|
||||
case 7076: // Earthen Guardian
|
||||
vEarthenGuardian.push_back(creature->GetGUID());
|
||||
earthenGuardians.push_back(creature->GetGUID());
|
||||
break;
|
||||
|
||||
case 7228: // Ironaya
|
||||
uiIronayaGUID = creature->GetGUID();
|
||||
ironayaGUID = creature->GetGUID();
|
||||
|
||||
if (m_auiEncounter[2] != DONE)
|
||||
SetFrozenState (creature);
|
||||
break;
|
||||
|
||||
case 10120: // Vault Walker
|
||||
vVaultWalker.push_back(creature->GetGUID());
|
||||
vaultWalkers.push_back(creature->GetGUID());
|
||||
break;
|
||||
|
||||
case 2748: // Archaedas
|
||||
uiArchaedasGUID = creature->GetGUID();
|
||||
archaedasGUID = creature->GetGUID();
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -471,25 +474,37 @@ class instance_uldaman : public InstanceMapScript
|
||||
switch (identifier)
|
||||
{
|
||||
case 0:
|
||||
return uiWhoWokeuiArchaedasGUID;
|
||||
return whoWokeuiArchaedasGUID;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
return vVaultWalker.at(identifier - 1);
|
||||
return vaultWalkers.at(identifier - 1);
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
return vEarthenGuardian.at(identifier - 5);
|
||||
return earthenGuardians.at(identifier - 5);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
} // end GetData64
|
||||
|
||||
void ProcessEvent(WorldObject* /*gameObject*/, uint32 eventId)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SUB_BOSS_AGGRO:
|
||||
SetData(DATA_STONE_KEEPERS, IN_PROGRESS); // activate the Stone Keepers
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
|
||||
Reference in New Issue
Block a user