Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
instance_the_stockade.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/*
7This placeholder for the instance is needed for dungeon finding to be able
8to give credit after the boss defined in lastEncounterDungeon is killed.
9Without it, the party doing random dungeon won't get satchel of spoils and
10gets instead the deserter debuff.
11*/
12
13#include "ScriptMgr.h"
14#include "InstanceScript.h"
16
18{
19public:
21
23 {
32
34 {
35 switch (creature->GetEntry())
36 {
38 RandolphMolochGUID = creature->GetGUID();
39 break;
41 LordOverheatGUID = creature->GetGUID();
42 break;
43 case NPC_HOGGER:
44 HoggerGUID = creature->GetGUID();
45 break;
46 default:
47 break;
48 }
49 }
50
52 {
53 switch (type)
54 {
56 return RandolphMolochGUID;
58 return LordOverheatGUID;
59 case DATA_HOGGER:
60 return HoggerGUID;
61 default:
62 break;
63 }
64 return 0;
65 }
66
67 std::string GetSaveData() OVERRIDE
68 {
70
71 std::ostringstream saveStream;
72 saveStream << "T S " << GetBossSaveData();
73
75 return saveStream.str();
76 }
77
78 void Load(char const* str) OVERRIDE
79 {
80 if (!str)
81 {
83 return;
84 }
85
87
88 char dataHead1, dataHead2;
89
90 std::istringstream loadStream(str);
91 loadStream >> dataHead1 >> dataHead2;
92
93 if (dataHead1 == 'T' && dataHead2 == 'S')
94 {
95 for (uint32 i = 0; i < EncounterCount; ++i)
96 {
97 uint32 tmpState;
98 loadStream >> tmpState;
99 if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
100 tmpState = NOT_STARTED;
101 SetBossState(i, EncounterState(tmpState));
102 }
103 }
104 else
106
108 }
109
110 protected:
114 };
115
120};
121
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
@ 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()
Definition Map.h:238
InstanceScript * GetInstanceScript(InstanceMap *map) const OVERRIDE
void AddSC_instance_the_stockade()
@ NPC_LORD_OVERHEAT
@ NPC_RANDOLPH_MOLOCH
#define TheStockadeScriptName
@ DATA_LORD_OVERHEAT
@ DATA_RANDOLPH_MOLOCH