Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
instance_hellfire_ramparts.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/* ScriptData
7SDName: Instance_Hellfire_Ramparts
8SD%Complete: 50
9SDComment:
10SDCategory: Hellfire Ramparts
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "InstanceScript.h"
15#include "hellfire_ramparts.h"
16
18{
19 public:
20 instance_ramparts() : InstanceMapScript("instance_ramparts", 543) { }
21
23 {
30
32 {
33 switch (go->GetEntry())
34 {
37 felIronChestGUID = go->GetGUID();
38 break;
39 }
40 }
41
43 {
44 if (!InstanceScript::SetBossState(type, state))
45 return false;
46
47 switch (type)
48 {
49 case DATA_VAZRUDEN:
50 case DATA_NAZAN:
52 {
54 spawned = true;
55 }
56 break;
57 }
58 return true;
59 }
60
61 std::string GetSaveData() OVERRIDE
62 {
64
65 std::ostringstream saveStream;
66 saveStream << "H R " << GetBossSaveData();
67
69 return saveStream.str();
70 }
71
72 void Load(const char* strIn) OVERRIDE
73 {
74 if (!strIn)
75 {
77 return;
78 }
79
80 OUT_LOAD_INST_DATA(strIn);
81
82 char dataHead1, dataHead2;
83
84 std::istringstream loadStream(strIn);
85 loadStream >> dataHead1 >> dataHead2;
86
87 if (dataHead1 == 'H' && dataHead2 == 'R')
88 {
89 for (uint8 i = 0; i < EncounterCount; ++i)
90 {
91 uint32 tmpState;
92 loadStream >> tmpState;
93 if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
94 tmpState = NOT_STARTED;
95
96 SetBossState(i, EncounterState(tmpState));
97 }
98 }
99 else
101
103 }
104
105 protected:
108 };
109
114};
115
@ IN_MILLISECONDS
Definition Common.h:125
@ HOUR
Definition Common.h:120
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
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)
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 DoRespawnGameObject(uint64 guid, uint32 timeToDespawn=MINUTE)
Definition Map.h:238
InstanceScript * GetInstanceScript(InstanceMap *map) const OVERRIDE
@ GO_FEL_IRON_CHECT_HEROIC
@ GO_FEL_IRON_CHEST_NORMAL
@ DATA_VAZRUDEN
@ DATA_NAZAN
void AddSC_instance_ramparts()
bool SetBossState(uint32 type, EncounterState state) OVERRIDE