Skip to content

Commit d5456b0

Browse files
calaxfurry
authored andcommitted
[s2845] Improve BRD arena event
Signed-off-by: Xfurry <xfurry@scriptdev2.com> (based on commit SD2-TBC[3142] - 7624584) Signed-off-by: xfurry <xfurry@scriptdev2.com>
1 parent cf26431 commit d5456b0

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ enum
4444
NPC_TOBIAS = 9679,
4545
NPC_DUGHAL = 9022,
4646

47+
// Arena crowd
48+
NPC_ARENA_SPECTATOR = 8916,
49+
NPC_SHADOWFORGE_PEASANT = 8896,
50+
NPC_SHADOWFORGE_CITIZEN = 8902,
51+
NPC_SHADOWFORGE_SENATOR = 8904,
52+
NPC_ANVILRAGE_SOLDIER = 8893,
53+
NPC_ANVILRAGE_MEDIC = 8894,
54+
NPC_ANVILRAGE_OFFICER = 8895,
55+
4756
GO_ARENA_1 = 161525,
4857
GO_ARENA_2 = 161522,
4958
GO_ARENA_3 = 161524,
@@ -87,8 +96,20 @@ enum
8796
SPELL_STONED = 10255, // Aura of Warbringer Constructs in Relict Vault
8897

8998
FACTION_DWARF_HOSTILE = 754, // Hostile faction for the Tomb of the Seven dwarfs
99+
FACTION_ARENA_NEUTRAL = 674, // Neutral faction for NPC in top of Arena after event complete
90100
};
91101

102+
struct ArenaCylinder
103+
{
104+
float m_fCenterX;
105+
float m_fCenterY;
106+
float m_fCenterZ;
107+
uint32 m_uiRadius;
108+
uint32 m_uiHeight;
109+
};
110+
111+
static const ArenaCylinder aArenaCrowdVolume[] = {595.78f, -188.65f, -38.63f, 69, 10};
112+
92113
enum ArenaNPCs
93114
{
94115
// Gladiators
@@ -175,6 +196,7 @@ class instance_blackrock_depths : public ScriptedInstance
175196
float m_fArenaCenterX, m_fArenaCenterY, m_fArenaCenterZ;
176197

177198
GuidSet m_sVaultNpcGuids;
199+
GuidSet m_sArenaCrowdNpcGuids;
178200
};
179201

180202
#endif

scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,21 @@ void instance_blackrock_depths::OnCreatureCreate(Creature* pCreature)
7878
case NPC_WATCHER_DOOMGRIP:
7979
m_sVaultNpcGuids.insert(pCreature->GetObjectGuid());
8080
break;
81+
// Arena crowd
82+
case NPC_ARENA_SPECTATOR:
83+
case NPC_SHADOWFORGE_PEASANT:
84+
case NPC_SHADOWFORGE_CITIZEN:
85+
case NPC_SHADOWFORGE_SENATOR:
86+
case NPC_ANVILRAGE_SOLDIER:
87+
case NPC_ANVILRAGE_MEDIC:
88+
case NPC_ANVILRAGE_OFFICER:
89+
if (pCreature->GetPositionZ() < aArenaCrowdVolume->m_fCenterZ || pCreature->GetPositionZ() > aArenaCrowdVolume->m_fCenterZ + aArenaCrowdVolume->m_uiHeight ||
90+
!pCreature->IsWithinDist2d(aArenaCrowdVolume->m_fCenterX, aArenaCrowdVolume->m_fCenterY, aArenaCrowdVolume->m_uiRadius))
91+
break;
92+
m_sArenaCrowdNpcGuids.insert(pCreature->GetObjectGuid());
93+
if (m_auiEncounter[0] == DONE)
94+
pCreature->SetFactionTemporary(FACTION_ARENA_NEUTRAL, TEMPFACTION_RESTORE_RESPAWN);
95+
break;
8196
}
8297
}
8398

@@ -132,6 +147,14 @@ void instance_blackrock_depths::SetData(uint32 uiType, uint32 uiData)
132147
// If finished the arena event after theldren fight
133148
if (uiData == DONE && m_auiEncounter[0] == SPECIAL)
134149
DoRespawnGameObject(GO_ARENA_SPOILS, HOUR);
150+
else if (uiData == DONE)
151+
{
152+
for (GuidSet::const_iterator itr = m_sArenaCrowdNpcGuids.begin(); itr != m_sArenaCrowdNpcGuids.end(); ++itr)
153+
{
154+
if (Creature* pSpectator = instance->GetCreature(*itr))
155+
pSpectator->SetFactionTemporary(FACTION_ARENA_NEUTRAL, TEMPFACTION_RESTORE_RESPAWN);
156+
}
157+
}
135158
m_auiEncounter[0] = uiData;
136159
break;
137160
case TYPE_VAULT:

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 "s2844"
3+
#define SD2_REVISION_NR "s2845"
44
#endif // __SD2_REVISION_NR_H__

0 commit comments

Comments
 (0)