Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
instance_sethekk_halls.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 "sethekk_halls.h"
9
15
17{
18 public:
20
22 {
28
30 {
31 if (creature->GetEntry() == NPC_ANZU)
32 {
34 creature->DisappearAndDie();
35 else
37 }
38 }
39
41 {
42 if (go->GetEntry() == GO_IKISS_DOOR)
43 AddDoor(go, true);
44 }
45
47 {
48 if (go->GetEntry() == GO_IKISS_DOOR)
49 AddDoor(go, false);
50 }
51
52 std::string GetSaveData() OVERRIDE
53 {
55
56 std::ostringstream saveStream;
57 saveStream << "S H " << GetBossSaveData();
58
60 return saveStream.str();
61 }
62
63 void Load(char const* str) OVERRIDE
64 {
65 if (!str)
66 {
68 return;
69 }
70
72
73 char dataHead1, dataHead2;
74
75 std::istringstream loadStream(str);
76 loadStream >> dataHead1 >> dataHead2;
77
78 if (dataHead1 == 'S' && dataHead2 == 'H')
79 {
80 for (uint32 i = 0; i < EncounterCount; ++i)
81 {
82 uint32 tmpState;
83 loadStream >> tmpState;
84 if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
85 tmpState = NOT_STARTED;
86 SetBossState(i, EncounterState(tmpState));
87 }
88 }
89 else
91
93 }
94 };
95
100};
101
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
#define OUT_LOAD_INST_DATA_FAIL
EncounterState
@ IN_PROGRESS
@ DONE
@ SPECIAL
@ NOT_STARTED
#define OUT_SAVE_INST_DATA_COMPLETE
#define OUT_LOAD_INST_DATA_COMPLETE
#define OUT_SAVE_INST_DATA
#define OUT_LOAD_INST_DATA(a)
@ DOOR_TYPE_ROOM
@ DOOR_TYPE_PASSAGE
@ BOUNDARY_NONE
uint32 const EncounterCount
InstanceMapScript(const char *name, uint32 mapId)
InstanceScript(Map *map)
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
std::string GetBossSaveData()
EncounterState GetBossState(uint32 id) const
void AddDoor(GameObject *door, bool add)
void LoadDoorData(DoorData const *data)
Definition Map.h:238
InstanceScript * GetInstanceScript(InstanceMap *map) const OVERRIDE
DoorData const doorData[]
void AddSC_instance_sethekk_halls()
DoorData const doorData[]
@ GO_IKISS_DOOR
#define SHScriptName
@ NPC_ANZU
@ DATA_TALON_KING_IKISS
@ DATA_ANZU