Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
instance_gnomeregan.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#include "ScriptMgr.h"
7#include "InstanceScript.h"
8#include "gnomeregan.h"
9#include "Player.h"
10
11#define MAX_ENCOUNTER 1
12
14{
15public:
16 instance_gnomeregan() : InstanceMapScript("instance_gnomeregan", 90) { }
17
22
24 {
28
30
33
35
37 {
38 memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
39
42
44 }
45
46 void Load(const char* in) OVERRIDE
47 {
48 if (!in)
49 {
51 return;
52 }
53
55
56 std::istringstream loadStream(in);
57 loadStream >> m_auiEncounter[0];
58
59 for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
60 {
63 }
64
66 }
67
69 {
70 switch (creature->GetEntry())
71 {
72 case NPC_BLASTMASTER_EMI_SHORTFUSE: uiBastmasterEmiShortfuseGUID = creature->GetGUID(); break;
73 }
74 }
75
77 {
78 switch (go->GetEntry())
79 {
80 case GO_CAVE_IN_LEFT:
81 uiCaveInLeftGUID = go->GetGUID();
83 HandleGameObject(0, false, go);
84 break;
86 uiCaveInRightGUID = go->GetGUID();
88 HandleGameObject(0, false, go);
89 break;
90 }
91 }
92
93 void SetData(uint32 uiType, uint32 uiData) OVERRIDE
94 {
95 switch (uiType)
96 {
97 case TYPE_EVENT:
98 m_auiEncounter[0] = uiData;
99 if (uiData == DONE)
100 SaveToDB();
101 break;
102 }
103 }
104
106 {
107 switch (uiType)
108 {
109 case TYPE_EVENT: return m_auiEncounter[0];
110 }
111 return 0;
112 }
113
115 {
116 switch (uiType)
117 {
121 }
122
123 return 0;
124 }
125 };
126};
127
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
#define OUT_LOAD_INST_DATA_FAIL
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
#define OUT_LOAD_INST_DATA_COMPLETE
#define OUT_LOAD_INST_DATA(a)
InstanceMapScript(const char *name, uint32 mapId)
InstanceScript(Map *map)
void HandleGameObject(uint64 guid, bool open, GameObject *go=NULL)
Definition Map.h:238
InstanceScript * GetInstanceScript(InstanceMap *map) const OVERRIDE
@ DATA_NPC_BASTMASTER_EMI_SHORTFUSE
Definition gnomeregan.h:33
@ DATA_GO_CAVE_IN_LEFT
Definition gnomeregan.h:31
@ DATA_GO_CAVE_IN_RIGHT
Definition gnomeregan.h:32
@ GO_CAVE_IN_LEFT
Definition gnomeregan.h:11
@ GO_CAVE_IN_RIGHT
Definition gnomeregan.h:12
@ NPC_BLASTMASTER_EMI_SHORTFUSE
Definition gnomeregan.h:18
@ TYPE_EVENT
Definition gnomeregan.h:26
#define MAX_ENCOUNTER
void AddSC_instance_gnomeregan()
void SetData(uint32 uiType, uint32 uiData) OVERRIDE