Skip to content

Commit 619f213

Browse files
XfurrySchmoozerd
authored andcommitted
[2229] Implement Doomgrip summon event in BRD
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
1 parent 81db0e9 commit 619f213

6 files changed

Lines changed: 98 additions & 1 deletion

File tree

scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ EndScriptData */
2323

2424
/* ContentData
2525
go_shadowforge_brazier
26+
go_relic_coffer_door
2627
at_ring_of_law
2728
npc_grimstone
2829
mob_phalanx
@@ -50,6 +51,22 @@ bool GOUse_go_shadowforge_brazier(Player* pPlayer, GameObject* pGo)
5051
return false;
5152
}
5253

54+
/*######
55+
## go_relic_coffer_door
56+
######*/
57+
58+
bool GOUse_go_relic_coffer_door(Player* pPlayer, GameObject* pGo)
59+
{
60+
if (ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData())
61+
{
62+
// check if the event is already done
63+
if (pInstance->GetData(TYPE_VAULT) != DONE && pInstance->GetData(TYPE_VAULT) != IN_PROGRESS)
64+
pInstance->SetData(TYPE_VAULT, SPECIAL);
65+
}
66+
67+
return false;
68+
}
69+
5370
/*######
5471
## npc_grimstone
5572
######*/
@@ -796,6 +813,11 @@ void AddSC_blackrock_depths()
796813
pNewScript->pGOUse = &GOUse_go_shadowforge_brazier;
797814
pNewScript->RegisterSelf();
798815

816+
pNewScript = new Script;
817+
pNewScript->Name = "go_relic_coffer_door";
818+
pNewScript->pGOUse = &GOUse_go_relic_coffer_door;
819+
pNewScript->RegisterSelf();
820+
799821
pNewScript = new Script;
800822
pNewScript->Name = "at_ring_of_law";
801823
pNewScript->pAreaTrigger = &AreaTrigger_at_ring_of_law;

scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
enum
99
{
1010
MAX_ENCOUNTER = 6,
11+
MAX_RELIC_DOORS = 12,
12+
1113
TYPE_RING_OF_LAW = 1,
1214
TYPE_VAULT = 2,
1315
TYPE_BAR = 3,
@@ -25,6 +27,8 @@ enum
2527
NPC_SEETHREL = 9038,
2628
// NPC_DOOMREL = 9039,
2729
NPC_DOPEREL = 9040,
30+
NPC_WATCHER_DOOMGRIP = 9476,
31+
NPC_WARBRINGER_CONST = 8905, // Four of them in Relict Vault are related to Doomgrip summon event
2832

2933
GO_ARENA_1 = 161525,
3034
GO_ARENA_2 = 161522,
@@ -48,6 +52,9 @@ enum
4852
GO_SPECTRAL_CHALICE = 164869,
4953
GO_CHEST_SEVEN = 169243,
5054
GO_ARENA_SPOILS = 181074,
55+
GO_SECRET_DOOR = 174553,
56+
57+
SPELL_STONED = 10255, // Aura of Warbringer Constructs in Relict Vault
5158
};
5259

5360
enum ArenaNPCs
@@ -88,6 +95,9 @@ static const uint32 aArenaNPCs[] =
8895
NPC_GOROSH, NPC_GRIZZLE, NPC_EVISCERATOR, NPC_OKTHOR, NPC_ANUBSHIAH, NPC_HEDRUM
8996
};
9097

98+
// Used to summon Watcher Doomgrip (guesswork)
99+
static const float aVaultPositions[4] = {821.905f, -338.382f, -50.134f, 3.78736f};
100+
91101
class MANGOS_DLL_DECL instance_blackrock_depths : public ScriptedInstance
92102
{
93103
public:
@@ -97,6 +107,7 @@ class MANGOS_DLL_DECL instance_blackrock_depths : public ScriptedInstance
97107
void Initialize();
98108

99109
void OnCreatureCreate(Creature* pCreature);
110+
void OnCreatureDeath(Creature* pCreature);
100111
void OnObjectCreate(GameObject* pGo);
101112

102113
void SetData(uint32 uiType, uint32 uiData);
@@ -115,8 +126,11 @@ class MANGOS_DLL_DECL instance_blackrock_depths : public ScriptedInstance
115126
std::string m_strInstData;
116127

117128
uint32 m_uiBarAleCount;
129+
uint8 m_uiCofferDoorsOpened;
118130

119131
float m_fArenaCenterX, m_fArenaCenterY, m_fArenaCenterZ;
132+
133+
GUIDSet m_sVaultNpcGuids;
120134
};
121135

122136
#endif

scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ EndScriptData */
2626

2727
instance_blackrock_depths::instance_blackrock_depths(Map* pMap) : ScriptedInstance(pMap),
2828
m_uiBarAleCount(0),
29+
m_uiCofferDoorsOpened(0),
2930

3031
m_fArenaCenterX(0.0f),
3132
m_fArenaCenterY(0.0f),
@@ -54,6 +55,17 @@ void instance_blackrock_depths::OnCreatureCreate(Creature* pCreature)
5455
case NPC_DOPEREL:
5556
m_mNpcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid();
5657
break;
58+
59+
case NPC_WARBRINGER_CONST:
60+
// Golems not in the Relict Vault?
61+
if (std::abs(pCreature->GetPositionZ() - aVaultPositions[2]) > 1.0f || !pCreature->IsWithinDist2d(aVaultPositions[0], aVaultPositions[1], 20.0f))
62+
break;
63+
// Golems in Relict Vault need to have a stoned aura, set manually to prevent reapply when reached home
64+
pCreature->CastSpell(pCreature, SPELL_STONED, true);
65+
// Store the Relict Vault Golems into m_sVaultNpcGuids
66+
case NPC_WATCHER_DOOMGRIP:
67+
m_sVaultNpcGuids.insert(pCreature->GetObjectGuid());
68+
break;
5769
}
5870
}
5971

@@ -81,6 +93,7 @@ void instance_blackrock_depths::OnObjectCreate(GameObject* pGo)
8193
case GO_SPECTRAL_CHALICE:
8294
case GO_CHEST_SEVEN:
8395
case GO_ARENA_SPOILS:
96+
case GO_SECRET_DOOR:
8497
break;
8598

8699
default:
@@ -100,6 +113,34 @@ void instance_blackrock_depths::SetData(uint32 uiType, uint32 uiData)
100113
m_auiEncounter[0] = uiData;
101114
break;
102115
case TYPE_VAULT:
116+
if (uiData == SPECIAL)
117+
{
118+
++m_uiCofferDoorsOpened;
119+
120+
if (m_uiCofferDoorsOpened == MAX_RELIC_DOORS)
121+
{
122+
SetData(TYPE_VAULT, IN_PROGRESS);
123+
124+
Creature* pConstruct = NULL;
125+
126+
// Activate vault constructs
127+
for (GUIDSet::const_iterator itr = m_sVaultNpcGuids.begin(); itr != m_sVaultNpcGuids.end(); ++itr)
128+
{
129+
if (pConstruct = instance->GetCreature(*itr))
130+
pConstruct->RemoveAurasDueToSpell(SPELL_STONED);
131+
}
132+
133+
if (!pConstruct)
134+
return;
135+
136+
// Summon doomgrip
137+
pConstruct->SummonCreature(NPC_WATCHER_DOOMGRIP, aVaultPositions[0], aVaultPositions[1], aVaultPositions[2], aVaultPositions[3], TEMPSUMMON_DEAD_DESPAWN, 0);
138+
}
139+
// No need to store in this case
140+
return;
141+
}
142+
if (uiData == DONE)
143+
DoUseDoorOrButton(GO_SECRET_DOOR);
103144
m_auiEncounter[1] = uiData;
104145
break;
105146
case TYPE_BAR:
@@ -230,6 +271,24 @@ void instance_blackrock_depths::OnCreatureEvade(Creature* pCreature)
230271
}
231272
}
232273

274+
void instance_blackrock_depths::OnCreatureDeath(Creature* pCreature)
275+
{
276+
switch(pCreature->GetEntry())
277+
{
278+
case NPC_WARBRINGER_CONST:
279+
case NPC_WATCHER_DOOMGRIP:
280+
if (GetData(TYPE_VAULT) == IN_PROGRESS)
281+
{
282+
m_sVaultNpcGuids.erase(pCreature->GetObjectGuid());
283+
284+
// If all event npcs dead then set event to done
285+
if (m_sVaultNpcGuids.empty())
286+
SetData(TYPE_VAULT, DONE);
287+
}
288+
break;
289+
}
290+
}
291+
233292
InstanceData* GetInstanceData_instance_blackrock_depths(Map* pMap)
234293
{
235294
return new instance_blackrock_depths(pMap);

sd2_revision_nr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#ifndef __SD2_REVISION_NR_H__
22
#define __SD2_REVISION_NR_H__
3-
#define SD2_REVISION_NR "2228"
3+
#define SD2_REVISION_NR "2229"
44
#endif // __SD2_REVISION_NR_H__

sql/mangos_scriptname_full.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ UPDATE creature_template SET ScriptName='npc_lokhtos_darkbargainer' WHERE entry=
304304
UPDATE creature_template SET ScriptName='npc_kharan_mighthammer' WHERE entry=9021;
305305
UPDATE creature_template SET ScriptName='npc_rocknot' WHERE entry=9503;
306306
UPDATE gameobject_template SET ScriptName='go_shadowforge_brazier' WHERE entry IN (174744, 174745);
307+
UPDATE gameobject_template SET ScriptName='go_relic_coffer_door' WHERE entry IN (174554, 174555, 174556, 174557, 174558, 174559, 174560, 174561, 174562, 174563, 174564, 174566);
307308

308309
/* BLACKROCK SPIRE */
309310
UPDATE instance_template SET ScriptName='instance_blackrock_spire' WHERE map=229;

sql/updates/r2229_mangos.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UPDATE gameobject_template SET ScriptName='go_relic_coffer_door' WHERE entry IN (174554, 174555, 174556, 174557, 174558, 174559, 174560, 174561, 174562, 174563, 174564, 174566);

0 commit comments

Comments
 (0)