@@ -25,26 +25,6 @@ EndScriptData */
25
25
#include " blood_furnace.h"
26
26
27
27
instance_blood_furnace::instance_blood_furnace (Map* pMap) : ScriptedInstance(pMap),
28
- m_uiMakerGUID(0 ),
29
- m_uiBroggokGUID(0 ),
30
- m_uiKelidanGUID(0 ),
31
-
32
- m_uiDoorFinalExitGUID(0 ),
33
- m_uiDoorMakerFrontGUID(0 ),
34
- m_uiDoorMakerRearGUID(0 ),
35
- m_uiDoorBroggokFrontGUID(0 ),
36
- m_uiDoorBrokkokRearGUID(0 ),
37
- m_uiDoorKelidanExitGUID(0 ),
38
-
39
- m_uiPrisonCell1GUID(0 ),
40
- m_uiPrisonCell2GUID(0 ),
41
- m_uiPrisonCell3GUID(0 ),
42
- m_uiPrisonCell4GUID(0 ),
43
- m_uiPrisonCell5GUID(0 ),
44
- m_uiPrisonCell6GUID(0 ),
45
- m_uiPrisonCell7GUID(0 ),
46
- m_uiPrisonCell8GUID(0 ),
47
-
48
28
m_uiBroggokEventTimer(30000 ),
49
29
m_uiBroggokEventPhase(0 )
50
30
{
@@ -60,9 +40,10 @@ void instance_blood_furnace::OnCreatureCreate(Creature* pCreature)
60
40
{
61
41
switch (pCreature->GetEntry ())
62
42
{
63
- case NPC_THE_MAKER: m_uiMakerGUID = pCreature->GetGUID (); break ;
64
- case NPC_BROGGOK: m_uiBroggokGUID = pCreature->GetGUID (); break ;
65
- case NPC_KELIDAN_THE_MAKER: m_uiKelidanGUID = pCreature->GetGUID (); break ;
43
+ case NPC_BROGGOK:
44
+ m_mNpcEntryGuidStore[pCreature->GetEntry ()] = pCreature->GetObjectGuid ();
45
+ break ;
46
+
66
47
case NPC_NASCENT_FEL_ORC:
67
48
m_luiNascentOrcGUIDs.push_back (pCreature->GetGUID ());
68
49
break ;
@@ -74,56 +55,35 @@ void instance_blood_furnace::OnObjectCreate(GameObject* pGo)
74
55
switch (pGo->GetEntry ())
75
56
{
76
57
case GO_DOOR_MAKER_FRONT: // the maker front door
77
- m_uiDoorMakerFrontGUID = pGo->GetGUID ();
78
58
break ;
79
59
case GO_DOOR_MAKER_REAR: // the maker rear door
80
- m_uiDoorMakerRearGUID = pGo->GetGUID ();
81
- if (m_auiEncounter[TYPE_THE_MAKER_EVENT] == DONE && pGo->GetGoState () == GO_STATE_READY)
82
- DoUseDoorOrButton (m_uiDoorMakerRearGUID);
60
+ if (m_auiEncounter[TYPE_THE_MAKER_EVENT] == DONE)
61
+ pGo->SetGoState (GO_STATE_ACTIVE);
83
62
break ;
84
63
case GO_DOOR_BROGGOK_FRONT: // broggok front door
85
- m_uiDoorBroggokFrontGUID = pGo->GetGUID ();
86
64
break ;
87
65
case GO_DOOR_BROGGOK_REAR: // broggok rear door
88
- m_uiDoorBrokkokRearGUID = pGo->GetGUID ();
89
- if (m_auiEncounter[TYPE_BROGGOK_EVENT] == DONE && pGo->GetGoState () == GO_STATE_READY)
90
- DoUseDoorOrButton (m_uiDoorBrokkokRearGUID);
66
+ if (m_auiEncounter[TYPE_BROGGOK_EVENT] == DONE)
67
+ pGo->SetGoState (GO_STATE_ACTIVE);
91
68
break ;
92
69
case GO_DOOR_KELIDAN_EXIT: // kelidan exit door
93
- m_uiDoorKelidanExitGUID = pGo->GetGUID ();
94
- if (m_auiEncounter[TYPE_KELIDAN_EVENT] == DONE && pGo->GetGoState () == GO_STATE_READY)
95
- DoUseDoorOrButton (m_uiDoorKelidanExitGUID);
70
+ if (m_auiEncounter[TYPE_KELIDAN_EVENT] == DONE)
71
+ pGo->SetGoState (GO_STATE_ACTIVE);
96
72
break ;
97
73
case GO_DOOR_FINAL_EXIT: // final exit door
98
- m_uiDoorFinalExitGUID = pGo->GetGUID ();
99
- if (m_auiEncounter[TYPE_KELIDAN_EVENT] == DONE && pGo->GetGoState () == GO_STATE_READY)
100
- DoUseDoorOrButton (m_uiDoorFinalExitGUID);
74
+ if (m_auiEncounter[TYPE_KELIDAN_EVENT] == DONE)
75
+ pGo->SetGoState (GO_STATE_ACTIVE);
101
76
break ;
102
- case GO_PRISON_CELL_MAKER1: m_uiPrisonCell1GUID = pGo->GetGUID (); break ;
103
- case GO_PRISON_CELL_MAKER2: m_uiPrisonCell2GUID = pGo->GetGUID (); break ;
104
- case GO_PRISON_CELL_MAKER3: m_uiPrisonCell3GUID = pGo->GetGUID (); break ;
105
- case GO_PRISON_CELL_MAKER4: m_uiPrisonCell4GUID = pGo->GetGUID (); break ;
77
+
106
78
case GO_PRISON_CELL_BROGGOK_1: m_aBroggokEvent[0 ].m_cellGuid = pGo->GetObjectGuid (); return ;
107
79
case GO_PRISON_CELL_BROGGOK_2: m_aBroggokEvent[1 ].m_cellGuid = pGo->GetObjectGuid (); return ;
108
80
case GO_PRISON_CELL_BROGGOK_3: m_aBroggokEvent[2 ].m_cellGuid = pGo->GetObjectGuid (); return ;
109
81
case GO_PRISON_CELL_BROGGOK_4: m_aBroggokEvent[3 ].m_cellGuid = pGo->GetObjectGuid (); return ;
110
- }
111
- }
112
-
113
- uint64 instance_blood_furnace::GetData64 (uint32 uiData)
114
- {
115
- switch (uiData)
116
- {
117
- case NPC_THE_MAKER: return m_uiMakerGUID;
118
- case NPC_BROGGOK: return m_uiBroggokGUID;
119
- case GO_PRISON_CELL_MAKER1: return m_uiPrisonCell1GUID;
120
- case GO_PRISON_CELL_MAKER2: return m_uiPrisonCell2GUID;
121
- case GO_PRISON_CELL_MAKER3: return m_uiPrisonCell3GUID;
122
- case GO_PRISON_CELL_MAKER4: return m_uiPrisonCell4GUID;
123
82
124
83
default :
125
- return 0 ;
84
+ return ;
126
85
}
86
+ m_mGoEntryGuidStore[pGo->GetEntry ()] = pGo->GetObjectGuid ();
127
87
}
128
88
129
89
void instance_blood_furnace::SetData (uint32 uiType, uint32 uiData)
@@ -132,13 +92,13 @@ void instance_blood_furnace::SetData(uint32 uiType, uint32 uiData)
132
92
{
133
93
case TYPE_THE_MAKER_EVENT:
134
94
if (uiData == IN_PROGRESS)
135
- DoUseDoorOrButton (m_uiDoorMakerFrontGUID );
95
+ DoUseDoorOrButton (GO_DOOR_MAKER_FRONT );
136
96
if (uiData == FAIL)
137
- DoUseDoorOrButton (m_uiDoorMakerFrontGUID );
97
+ DoUseDoorOrButton (GO_DOOR_MAKER_FRONT );
138
98
if (uiData == DONE)
139
99
{
140
- DoUseDoorOrButton (m_uiDoorMakerFrontGUID );
141
- DoUseDoorOrButton (m_uiDoorMakerRearGUID );
100
+ DoUseDoorOrButton (GO_DOOR_MAKER_FRONT );
101
+ DoUseDoorOrButton (GO_DOOR_MAKER_REAR );
142
102
}
143
103
m_auiEncounter[uiType] = uiData;
144
104
break ;
@@ -147,7 +107,7 @@ void instance_blood_furnace::SetData(uint32 uiType, uint32 uiData)
147
107
return ;
148
108
149
109
// Combat door; the exit door is opened in event
150
- DoUseDoorOrButton (m_uiDoorBroggokFrontGUID );
110
+ DoUseDoorOrButton (GO_DOOR_BROGGOK_FRONT );
151
111
if (uiData == IN_PROGRESS)
152
112
{
153
113
if (m_uiBroggokEventPhase <= MAX_ORC_WAVES)
@@ -190,8 +150,8 @@ void instance_blood_furnace::SetData(uint32 uiType, uint32 uiData)
190
150
case TYPE_KELIDAN_EVENT:
191
151
if (uiData == DONE)
192
152
{
193
- DoUseDoorOrButton (m_uiDoorKelidanExitGUID );
194
- DoUseDoorOrButton (m_uiDoorFinalExitGUID );
153
+ DoUseDoorOrButton (GO_DOOR_KELIDAN_EXIT );
154
+ DoUseDoorOrButton (GO_DOOR_FINAL_EXIT );
195
155
}
196
156
m_auiEncounter[uiType] = uiData;
197
157
break ;
@@ -223,9 +183,9 @@ void instance_blood_furnace::DoNextBroggokEventPhase()
223
183
// Open door to the final boss now and move boss to the center of the room
224
184
if (m_uiBroggokEventPhase >= MAX_ORC_WAVES)
225
185
{
226
- DoUseDoorOrButton (m_uiDoorBrokkokRearGUID );
186
+ DoUseDoorOrButton (GO_DOOR_BROGGOK_REAR );
227
187
228
- if (Creature* pBroggok = instance-> GetCreature (m_uiBroggokGUID ))
188
+ if (Creature* pBroggok = GetSingleCreatureFromStorage (NPC_BROGGOK ))
229
189
{
230
190
pBroggok->RemoveSplineFlag (SPLINEFLAG_WALKMODE);
231
191
pBroggok->GetMotionMaster ()->MovePoint (0 , dx, dy, pBroggok->GetPositionZ ());
@@ -423,7 +383,7 @@ bool GOUse_go_prison_cell_lever(Player* pPlayer, GameObject* pGo)
423
383
pInstance->SetData (TYPE_BROGGOK_EVENT, IN_PROGRESS);
424
384
425
385
// Yell intro
426
- if (Creature* pBroggok = pInstance->instance -> GetCreature (pInstance-> GetData64 ( NPC_BROGGOK) ))
386
+ if (Creature* pBroggok = pInstance->GetSingleCreatureFromStorage ( NPC_BROGGOK))
427
387
DoScriptText (SAY_BROGGOK_INTRO, pBroggok);
428
388
}
429
389
0 commit comments