TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
instance_deadmines::instance_deadmines_InstanceMapScript Struct Reference

Public Member Functions

 instance_deadmines_InstanceMapScript (Map *map)
 
virtual void Update (uint32 diff) override
 
void SummonCreatures ()
 
void MoveCreaturesInside ()
 
void MoveCreatureInside (Creature *creature)
 
void ShootCannon ()
 
void BlastOutDoor ()
 
void LeverStucked ()
 
void OnGameObjectCreate (GameObject *go) override
 
void SetData (uint32 type, uint32 data) override
 
uint32 GetData (uint32 type) const override
 
ObjectGuid GetGuidData (uint32 data) const override
 
- Public Member Functions inherited from InstanceScript
 InstanceScript (Map *map)
 
virtual ~InstanceScript ()
 
virtual void Initialize ()
 
virtual void Load (char const *data)
 
virtual std::string GetSaveData ()
 
void SaveToDB ()
 
virtual bool IsEncounterInProgress () const
 
virtual void OnCreatureCreate (Creature *creature) override
 
virtual void OnCreatureRemove (Creature *creature) override
 
virtual void OnGameObjectRemove (GameObject *go) override
 
ObjectGuid GetObjectGuid (uint32 type) const
 
CreatureGetCreature (uint32 type)
 
GameObjectGetGameObject (uint32 type)
 
virtual void OnPlayerEnter (Player *)
 
void HandleGameObject (ObjectGuid guid, bool open, GameObject *go=nullptr)
 
void DoUseDoorOrButton (ObjectGuid guid, uint32 withRestoreTime=0, bool useAlternativeState=false)
 
void DoCloseDoorOrButton (ObjectGuid guid)
 
void DoRespawnGameObject (ObjectGuid guid, uint32 timeToDespawn=MINUTE)
 
void DoUpdateWorldState (uint32 worldstateId, uint32 worldstateValue)
 
void DoSendNotifyToInstance (char const *format,...)
 
void DoUpdateAchievementCriteria (AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=NULL)
 
void DoStartTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoStopTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoRemoveAurasDueToSpellOnPlayers (uint32 spell)
 
void DoCastSpellOnPlayers (uint32 spell)
 
bool ServerAllowsTwoSideGroups ()
 
virtual bool SetBossState (uint32 id, EncounterState state)
 
EncounterState GetBossState (uint32 id) const
 
CreatureBoundary constGetBossBoundary (uint32 id) const
 
virtual bool CheckAchievementCriteriaMeet (uint32, Player const *, Unit const *=NULL, uint32=0)
 
virtual bool CheckRequiredBosses (uint32, Player const *=nullptr) const
 
void UpdateEncounterState (EncounterCreditType type, uint32 creditEntry, Unit *source)
 
void SetCompletedEncountersMask (uint32 newMask)
 
uint32 GetCompletedEncounterMask () const
 
void SendEncounterUnit (uint32 type, Unit *unit=NULL, uint8 param1=0, uint8 param2=0)
 
virtual void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &)
 
void UpdatePhasing ()
 
uint32 GetEncounterCount () const
 
- Public Member Functions inherited from ZoneScript
 ZoneScript ()
 
virtual ~ZoneScript ()
 
virtual uint32 GetCreatureEntry (ObjectGuid::LowType, CreatureData const *data)
 
virtual uint32 GetGameObjectEntry (ObjectGuid::LowType, uint32 entry)
 
virtual void OnUnitDeath (Unit *)
 
virtual void SetGuidData (uint32, ObjectGuid)
 
virtual uint64 GetData64 (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
virtual void ProcessEvent (WorldObject *, uint32)
 

Public Attributes

ObjectGuid FactoryDoorGUID
 
ObjectGuid IronCladDoorGUID
 
ObjectGuid DefiasCannonGUID
 
ObjectGuid DoorLeverGUID
 
ObjectGuid DefiasPirate1GUID
 
ObjectGuid DefiasPirate2GUID
 
ObjectGuid DefiasCompanionGUID
 
uint32 State
 
uint32 CannonBlast_Timer
 
uint32 PiratesDelay_Timer
 
ObjectGuid uiSmiteChestGUID
 
- Public Attributes inherited from InstanceScript
Mapinstance
 

Additional Inherited Members

- Static Public Member Functions inherited from InstanceScript
static std::string GetBossStateName (uint8 state)
 
- Protected Member Functions inherited from InstanceScript
void SetHeaders (std::string const &dataHeaders)
 
void SetBossNumber (uint32 number)
 
void LoadBossBoundaries (BossBoundaryData const &data)
 
void LoadDoorData (DoorData const *data)
 
void LoadMinionData (MinionData const *data)
 
void LoadObjectData (ObjectData const *creatureData, ObjectData const *gameObjectData)
 
void AddObject (Creature *obj, bool add)
 
void AddObject (GameObject *obj, bool add)
 
void AddObject (WorldObject *obj, uint32 type, bool add)
 
virtual void AddDoor (GameObject *door, bool add)
 
void AddMinion (Creature *minion, bool add)
 
virtual void UpdateDoorState (GameObject *door)
 
void UpdateMinionState (Creature *minion, EncounterState state)
 
BossInfoGetBossInfo (uint32 id)
 
bool ReadSaveDataHeaders (std::istringstream &data)
 
void ReadSaveDataBossStates (std::istringstream &data)
 
virtual void ReadSaveDataMore (std::istringstream &)
 
void WriteSaveDataHeaders (std::ostringstream &data)
 
void WriteSaveDataBossStates (std::ostringstream &data)
 
virtual void WriteSaveDataMore (std::ostringstream &)
 
bool _SkipCheckRequiredBosses (Player const *player=nullptr) const
 

Constructor & Destructor Documentation

instance_deadmines::instance_deadmines_InstanceMapScript::instance_deadmines_InstanceMapScript ( Map map)
inline
59  : InstanceScript(map)
60  {
62 
66  }
uint32 PiratesDelay_Timer
Definition: instance_deadmines.cpp:78
uint32 CannonBlast_Timer
Definition: instance_deadmines.cpp:77
uint32 State
Definition: instance_deadmines.cpp:76
Definition: deadmines.h:25
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:98
#define DataHeader
Definition: baradin_hold.h:25
InstanceScript(Map *map)
Definition: InstanceScript.h:144

+ Here is the call graph for this function:

Member Function Documentation

void instance_deadmines::instance_deadmines_InstanceMapScript::BlastOutDoor ( )
inline
169  {
170  if (GameObject* pIronCladDoor = instance->GetGameObject(IronCladDoorGUID))
171  {
172  pIronCladDoor->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
173  pIronCladDoor->PlayDirectSound(SOUND_DESTROYDOOR);
174  }
175  }
Definition: GameObject.h:824
Map * instance
Definition: InstanceScript.h:148
Definition: GameObject.h:880
ObjectGuid IronCladDoorGUID
Definition: instance_deadmines.cpp:69
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3545
Definition: instance_deadmines.cpp:35

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32 instance_deadmines::instance_deadmines_InstanceMapScript::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from ZoneScript.

212  {
213  switch (type)
214  {
215  case EVENT_STATE:
216  return State;
217  }
218 
219  return 0;
220  }
uint32 State
Definition: instance_deadmines.cpp:76
Definition: deadmines.h:34
ObjectGuid instance_deadmines::instance_deadmines_InstanceMapScript::GetGuidData ( uint32  data) const
inlineoverridevirtual

Reimplemented from InstanceScript.

223  {
224  switch (data)
225  {
226  case DATA_SMITE_CHEST:
227  return uiSmiteChestGUID;
228  }
229 
230  return ObjectGuid::Empty;
231  }
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: deadmines.h:40
ObjectGuid uiSmiteChestGUID
Definition: instance_deadmines.cpp:79
void instance_deadmines::instance_deadmines_InstanceMapScript::LeverStucked ( )
inline
178  {
179  if (GameObject* pDoorLever = instance->GetGameObject(DoorLeverGUID))
180  pDoorLever->SetUInt32Value(GAMEOBJECT_FLAGS, 4);
181  }
ObjectGuid DoorLeverGUID
Definition: instance_deadmines.cpp:71
Map * instance
Definition: InstanceScript.h:148
Definition: GameObject.h:880
Definition: UpdateFields.h:319
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3545

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void instance_deadmines::instance_deadmines_InstanceMapScript::MoveCreatureInside ( Creature creature)
inline
154  {
155  creature->SetWalk(false);
156  creature->GetMotionMaster()->MovePoint(0, -102.7f, -655.9f, creature->GetPositionZ());
157  }
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
float GetPositionZ() const
Definition: Position.h:106
bool SetWalk(bool enable)
Definition: Unit.cpp:15800

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void instance_deadmines::instance_deadmines_InstanceMapScript::MoveCreaturesInside ( )
inline
138  {
140  return;
141 
142  Creature* pDefiasPirate1 = instance->GetCreature(DefiasPirate1GUID);
143  Creature* pDefiasPirate2 = instance->GetCreature(DefiasPirate2GUID);
144  Creature* pDefiasCompanion = instance->GetCreature(DefiasCompanionGUID);
145  if (!pDefiasPirate1 || !pDefiasPirate2 || !pDefiasCompanion)
146  return;
147 
148  MoveCreatureInside(pDefiasPirate1);
149  MoveCreatureInside(pDefiasPirate2);
150  MoveCreatureInside(pDefiasCompanion);
151  }
void MoveCreatureInside(Creature *creature)
Definition: instance_deadmines.cpp:153
ObjectGuid DefiasPirate1GUID
Definition: instance_deadmines.cpp:72
Definition: Creature.h:467
ObjectGuid DefiasPirate2GUID
Definition: instance_deadmines.cpp:73
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3535
ObjectGuid DefiasCompanionGUID
Definition: instance_deadmines.cpp:74

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void instance_deadmines::instance_deadmines_InstanceMapScript::OnGameObjectCreate ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

184  {
185  switch (go->GetEntry())
186  {
187  case GO_FACTORY_DOOR: FactoryDoorGUID = go->GetGUID(); break;
188  case GO_IRONCLAD_DOOR: IronCladDoorGUID = go->GetGUID(); break;
189  case GO_DEFIAS_CANNON: DefiasCannonGUID = go->GetGUID(); break;
190  case GO_DOOR_LEVER: DoorLeverGUID = go->GetGUID(); break;
191  case GO_MR_SMITE_CHEST: uiSmiteChestGUID = go->GetGUID(); break;
192  }
193  }
Definition: deadmines.h:47
Definition: deadmines.h:49
ObjectGuid DefiasCannonGUID
Definition: instance_deadmines.cpp:70
Definition: deadmines.h:45
ObjectGuid DoorLeverGUID
Definition: instance_deadmines.cpp:71
Definition: deadmines.h:46
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: deadmines.h:48
ObjectGuid FactoryDoorGUID
Definition: instance_deadmines.cpp:68
uint32 GetEntry() const
Definition: Object.h:107
ObjectGuid IronCladDoorGUID
Definition: instance_deadmines.cpp:69
ObjectGuid uiSmiteChestGUID
Definition: instance_deadmines.cpp:79

+ Here is the call graph for this function:

void instance_deadmines::instance_deadmines_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

196  {
197  switch (type)
198  {
199  case EVENT_STATE:
201  State = data;
202  break;
203  case EVENT_RHAHKZOR:
204  if (data == DONE)
206  go->SetGoState(GO_STATE_ACTIVE);
207  break;
208  }
209  }
Definition: inflate.h:49
uint32 State
Definition: instance_deadmines.cpp:76
ObjectGuid DefiasCannonGUID
Definition: instance_deadmines.cpp:70
Definition: deadmines.h:34
Map * instance
Definition: InstanceScript.h:148
Definition: GameObject.h:880
Definition: GameObject.h:822
ObjectGuid FactoryDoorGUID
Definition: instance_deadmines.cpp:68
Definition: deadmines.h:35
ObjectGuid IronCladDoorGUID
Definition: instance_deadmines.cpp:69
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3545
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

void instance_deadmines::instance_deadmines_InstanceMapScript::ShootCannon ( )
inline
160  {
161  if (GameObject* pDefiasCannon = instance->GetGameObject(DefiasCannonGUID))
162  {
163  pDefiasCannon->SetGoState(GO_STATE_ACTIVE);
164  pDefiasCannon->PlayDirectSound(SOUND_CANNONFIRE);
165  }
166  }
Definition: instance_deadmines.cpp:34
ObjectGuid DefiasCannonGUID
Definition: instance_deadmines.cpp:70
Map * instance
Definition: InstanceScript.h:148
Definition: GameObject.h:880
Definition: GameObject.h:822
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3545

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void instance_deadmines::instance_deadmines_InstanceMapScript::SummonCreatures ( )
inline
124  {
125  if (GameObject* pIronCladDoor = instance->GetGameObject(IronCladDoorGUID))
126  {
127  Creature* DefiasPirate1 = pIronCladDoor->SummonCreature(657, pIronCladDoor->GetPositionX() - 2, pIronCladDoor->GetPositionY()-7, pIronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
128  Creature* DefiasPirate2 = pIronCladDoor->SummonCreature(657, pIronCladDoor->GetPositionX() + 3, pIronCladDoor->GetPositionY()-6, pIronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
129  Creature* DefiasCompanion = pIronCladDoor->SummonCreature(3450, pIronCladDoor->GetPositionX() + 2, pIronCladDoor->GetPositionY()-6, pIronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
130 
131  DefiasPirate1GUID = DefiasPirate1->GetGUID();
132  DefiasPirate2GUID = DefiasPirate2->GetGUID();
133  DefiasCompanionGUID = DefiasCompanion->GetGUID();
134  }
135  }
ObjectGuid DefiasPirate1GUID
Definition: instance_deadmines.cpp:72
Definition: Creature.h:467
ObjectGuid DefiasPirate2GUID
Definition: instance_deadmines.cpp:73
Map * instance
Definition: InstanceScript.h:148
Definition: GameObject.h:880
ObjectGuid const & GetGUID() const
Definition: Object.h:105
ObjectGuid DefiasCompanionGUID
Definition: instance_deadmines.cpp:74
Definition: Object.h:59
ObjectGuid IronCladDoorGUID
Definition: instance_deadmines.cpp:69
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3545
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void instance_deadmines::instance_deadmines_InstanceMapScript::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from InstanceScript.

82  {
84  return;
85 
87  if (!pIronCladDoor)
88  return;
89 
90  switch (State)
91  {
94  // it's a hack - Mr. Smite should do that but his too far away
95  //pIronCladDoor->SetName("Mr. Smite");
96  //pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, NULL);
97  pIronCladDoor->PlayDirectSound(SOUND_MR_SMITE_ALARM1);
99  break;
102  if (CannonBlast_Timer <= diff)
103  {
104  SummonCreatures();
105  ShootCannon();
106  BlastOutDoor();
107  LeverStucked();
108  //pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, NULL);
109  pIronCladDoor->PlayDirectSound(SOUND_MR_SMITE_ALARM2);
111  } else CannonBlast_Timer -= diff;
112  break;
113  case PIRATES_ATTACK:
114  if (PiratesDelay_Timer <= diff)
115  {
117  State = EVENT_DONE;
118  } else PiratesDelay_Timer -= diff;
119  break;
120  }
121  }
Definition: deadmines.h:29
void PlayDirectSound(uint32 sound_id, Player *target=NULL)
Definition: Object.cpp:2966
void SummonCreatures()
Definition: instance_deadmines.cpp:123
uint32 PiratesDelay_Timer
Definition: instance_deadmines.cpp:78
uint32 CannonBlast_Timer
Definition: instance_deadmines.cpp:77
Definition: instance_deadmines.cpp:37
uint32 State
Definition: instance_deadmines.cpp:76
void MoveCreaturesInside()
Definition: instance_deadmines.cpp:137
void BlastOutDoor()
Definition: instance_deadmines.cpp:168
ObjectGuid DefiasCannonGUID
Definition: instance_deadmines.cpp:70
Definition: deadmines.h:26
ObjectGuid DoorLeverGUID
Definition: instance_deadmines.cpp:71
void LeverStucked()
Definition: instance_deadmines.cpp:177
Definition: instance_deadmines.cpp:46
Map * instance
Definition: InstanceScript.h:148
Definition: GameObject.h:880
Definition: deadmines.h:28
void ShootCannon()
Definition: instance_deadmines.cpp:159
Definition: deadmines.h:27
Definition: instance_deadmines.cpp:36
ObjectGuid IronCladDoorGUID
Definition: instance_deadmines.cpp:69
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3545
Definition: instance_deadmines.cpp:45

+ Here is the call graph for this function:

Member Data Documentation

uint32 instance_deadmines::instance_deadmines_InstanceMapScript::CannonBlast_Timer
ObjectGuid instance_deadmines::instance_deadmines_InstanceMapScript::DefiasCannonGUID
ObjectGuid instance_deadmines::instance_deadmines_InstanceMapScript::DefiasCompanionGUID
ObjectGuid instance_deadmines::instance_deadmines_InstanceMapScript::DefiasPirate1GUID
ObjectGuid instance_deadmines::instance_deadmines_InstanceMapScript::DefiasPirate2GUID
ObjectGuid instance_deadmines::instance_deadmines_InstanceMapScript::DoorLeverGUID
ObjectGuid instance_deadmines::instance_deadmines_InstanceMapScript::FactoryDoorGUID
ObjectGuid instance_deadmines::instance_deadmines_InstanceMapScript::IronCladDoorGUID
uint32 instance_deadmines::instance_deadmines_InstanceMapScript::PiratesDelay_Timer
uint32 instance_deadmines::instance_deadmines_InstanceMapScript::State
ObjectGuid instance_deadmines::instance_deadmines_InstanceMapScript::uiSmiteChestGUID

The documentation for this struct was generated from the following file: