TrinityCore
Loading...
Searching...
No Matches
instance_arcatraz.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "arcatraz.h"
20#include "Creature.h"
21#include "CreatureAI.h"
22#include "GameObject.h"
23#include "InstanceScript.h"
24#include "Map.h"
25
32
34{
36 { 0, 0 } // END
37};
38
49
51{
52 public:
54
56 {
68
69 void OnCreatureCreate(Creature* creature) override
70 {
72
73 switch (creature->GetEntry())
74 {
75 case NPC_DALLIAH:
76 DalliahGUID = creature->GetGUID();
77 break;
79 SoccothratesGUID = creature->GetGUID();
80 break;
81 case NPC_MILLHOUSE:
82 MillhouseGUID = creature->GetGUID();
83 break;
84 default:
85 break;
86 }
87 }
88
89 void SetData(uint32 type, uint32 data) override
90 {
91 switch (type)
92 {
93 case DATA_WARDEN_1:
94 case DATA_WARDEN_2:
95 case DATA_WARDEN_3:
96 case DATA_WARDEN_4:
97 case DATA_WARDEN_5:
98 StasisPodStates[type - DATA_WARDEN_1] = uint8(data);
99 break;
101 ConversationState = uint8(data);
102 break;
103 default:
104 break;
105 }
106 }
107
108 uint32 GetData(uint32 type) const override
109 {
110 switch (type)
111 {
112 case DATA_WARDEN_1:
113 case DATA_WARDEN_2:
114 case DATA_WARDEN_3:
115 case DATA_WARDEN_4:
116 case DATA_WARDEN_5:
117 return StasisPodStates[type - DATA_WARDEN_1];
119 return ConversationState;
120 default:
121 break;
122 }
123 return 0;
124 }
125
126 ObjectGuid GetGuidData(uint32 data) const override
127 {
128 switch (data)
129 {
130 case DATA_DALLIAH:
131 return DalliahGUID;
133 return SoccothratesGUID;
134 default:
135 break;
136 }
137 return ObjectGuid::Empty;
138 }
139
140 bool SetBossState(uint32 type, EncounterState state) override
141 {
142 if (!InstanceScript::SetBossState(type, state))
143 return false;
144
145 switch (type)
146 {
148 if (state == NOT_STARTED || state == FAIL)
149 {
155 }
156 if (state == DONE)
157 {
158 if (!instance->IsHeroic())
159 break;
160
161 if (Creature* millhouse = instance->GetCreature(MillhouseGUID))
162 if (millhouse->IsAlive())
164 }
165 if (state == FAIL)
166 {
167 if (Creature* mellichar = GetCreature(DATA_MELLICHAR))
168 mellichar->AI()->DoAction(ACTION_RESET_PRISON);
169 }
170 break;
171 default:
172 break;
173 }
174 return true;
175 }
176
177 protected:
181
184 };
185
187 {
189 }
190};
191
193{
194 new instance_arcatraz();
195}
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
EncounterState
@ FAIL
@ DONE
@ NOT_STARTED
@ DOOR_TYPE_ROOM
@ DOOR_TYPE_PASSAGE
#define ArcatrazScriptName
Definition arcatraz.h:23
@ ACTION_RESET_PRISON
Definition arcatraz.h:79
@ SPELL_QID_10886
Definition arcatraz.h:74
@ NPC_MILLHOUSE
Definition arcatraz.h:57
@ NPC_MELLICHAR
Definition arcatraz.h:56
@ NPC_DALLIAH
Definition arcatraz.h:54
@ NPC_SOCCOTHRATES
Definition arcatraz.h:55
@ GO_CONTAINMENT_CORE_SECURITY_FIELD_ALPHA
Definition arcatraz.h:62
@ GO_WARDENS_SHIELD
Definition arcatraz.h:69
@ GO_STASIS_POD_OMEGA
Definition arcatraz.h:68
@ GO_STASIS_POD_ALPHA
Definition arcatraz.h:64
@ GO_STASIS_POD_GAMMA
Definition arcatraz.h:67
@ GO_STASIS_POD_BETA
Definition arcatraz.h:65
@ GO_CONTAINMENT_CORE_SECURITY_FIELD_BETA
Definition arcatraz.h:63
@ GO_STASIS_POD_DELTA
Definition arcatraz.h:66
@ DATA_WARDEN_4
Definition arcatraz.h:41
@ DATA_MELLICHAR
Definition arcatraz.h:43
@ DATA_WARDENS_SHIELD
Definition arcatraz.h:44
@ DATA_STASIS_POD_DELTA
Definition arcatraz.h:47
@ DATA_SOCCOTHRATES
Definition arcatraz.h:33
@ DATA_STASIS_POD_GAMMA
Definition arcatraz.h:48
@ DATA_CONVERSATION
Definition arcatraz.h:37
@ DATA_WARDEN_2
Definition arcatraz.h:39
@ DATA_STASIS_POD_BETA
Definition arcatraz.h:46
@ DATA_WARDEN_3
Definition arcatraz.h:40
@ DATA_HARBINGER_SKYRISS
Definition arcatraz.h:34
@ DATA_STASIS_POD_OMEGA
Definition arcatraz.h:49
@ DATA_DALLIAH
Definition arcatraz.h:32
@ DATA_WARDEN_1
Definition arcatraz.h:38
@ DATA_WARDEN_5
Definition arcatraz.h:42
@ DATA_STASIS_POD_ALPHA
Definition arcatraz.h:45
#define DataHeader
uint32 const EncounterCount
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
virtual void OnCreatureCreate(Creature *creature) override
void DoCastSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
Creature * GetCreature(uint32 type)
InstanceMap * instance
void LoadDoorData(DoorData const *data)
void SetHeaders(std::string const &dataHeaders)
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
bool IsHeroic() const
Definition Map.cpp:4256
Creature * GetCreature(ObjectGuid const &guid)
Definition Map.cpp:4397
static ObjectGuid const Empty
Definition ObjectGuid.h:140
uint32 GetEntry() const
Definition Object.h:81
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const gameObjectData[]
ObjectData const creatureData[]
DoorData const doorData[]
void AddSC_instance_arcatraz()
bool SetBossState(uint32 type, EncounterState state) override
void SetData(uint32 type, uint32 data) override