Skip to content

Commit 3d0ddd3

Browse files
committed
[3135] Implement very basic script for Halls of Reflection instance
1 parent 1e36357 commit 3d0ddd3

6 files changed

Lines changed: 270 additions & 5 deletions

File tree

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,113 @@
11
/* This file is part of the ScriptDev2 Project. See AUTHORS file for Copyright information
22
* This program is free software licensed under GPL version 2
33
* Please see the included DOCS/LICENSE.TXT for more information */
4+
5+
#ifndef DEF_ICECROWN_HOR_H
6+
#define DEF_ICECROWN_HOR_H
7+
8+
enum
9+
{
10+
MAX_ENCOUNTER = 3,
11+
12+
TYPE_FALRIC = 0,
13+
TYPE_MARWYN = 1,
14+
TYPE_LICH_KING = 2,
15+
16+
NPC_FALRIC = 38112,
17+
NPC_MARWYN = 38113,
18+
NPC_LICH_KING = 37226,
19+
20+
NPC_JAINA_PART1 = 37221,
21+
NPC_JAINA_PART2 = 36955,
22+
NPC_SYLVANAS_PART1 = 37223,
23+
NPC_SYLVANAS_PART2 = 37554,
24+
NPC_KILARA = 37583,
25+
NPC_ELANDRA = 37774,
26+
NPC_LORALEN = 37779,
27+
NPC_KORELN = 37582,
28+
29+
// intro related npcs
30+
NPC_UTHER = 37225,
31+
NPC_LICH_KING_INTRO = 36954,
32+
NPC_FROSTMOURNE_ALTER_BUNNY = 37704, // dummy trigger for Quel'Delar
33+
NPC_QUEL_DELAR = 37158,
34+
35+
// spirit event creatures
36+
NPC_SPECTRAL_FOOTMAN = 38173,
37+
NPC_SHADOWY_MERCENARY = 38177,
38+
NPC_PHANTOM_MAGE = 38172,
39+
NPC_GHOSTLY_PRIEST = 38175,
40+
NPC_TORTURED_RIFLEMAN = 38176,
41+
42+
// escape event creatures
43+
NPC_RAGING_GHOUL = 36940,
44+
NPC_RISEN_WHITCH_DOCTOR = 36941,
45+
NPC_LUMBERING_ABONIMATION = 37069,
46+
NPC_ICE_WALL_TARGET = 37014, // dummy ice wall target
47+
48+
// objects
49+
GO_ICECROWN_DOOR_ENTRANCE = 201976, // entrance door; used in combat during the spirit event
50+
GO_IMPENETRABLE_DOOR = 197341, // door after the spirit event
51+
GO_ICECROWN_DOOR_LK_ENTRANCE = 197342, // door before the Lich King
52+
GO_ICECROWN_DOOR_LK_EXIT = 197343, // door after the Lich King
53+
GO_FROSTMOURNE_ALTAR = 202236,
54+
GO_FROSTMOURNE = 202302,
55+
56+
GO_ICE_WALL = 201385, // summoned during the Lich King escape
57+
GO_CAVE_IN = 201596, // door after the final encounter
58+
GO_PORTAL_DALARAN = 202079,
59+
GO_THE_SKYBREAKER = 201598,
60+
GO_OGRIMS_HAMMER = 201581,
61+
62+
GO_CAPTAIN_CHEST_HORDE = 202212,
63+
GO_CAPTAIN_CHEST_HORDE_H = 202337,
64+
GO_CAPTAIN_CHEST_ALLIANCE = 201710,
65+
GO_CAPTAIN_CHEST_ALLIANCE_H = 202336,
66+
67+
// world states
68+
WORLD_STATE_SPIRIT_WAVES = 4884,
69+
WORLD_STATE_SPIRIT_WAVES_COUNT = 4882,
70+
};
71+
72+
struct EventNpcLocations
73+
{
74+
uint32 uiEntryHorde, uiEntryAlliance;
75+
float fX, fY, fZ, fO;
76+
float fMoveX, fMoveY, fMoveZ;
77+
};
78+
79+
const EventNpcLocations aEventBeginLocations[2] =
80+
{
81+
{NPC_SYLVANAS_PART1, NPC_JAINA_PART1, 5236.659f, 1929.894f, 707.7781f, 0.87f},
82+
{NPC_LORALEN, NPC_KORELN, 5232.680f, 1931.460f, 707.7781f, 0.83f},
83+
};
84+
85+
class instance_halls_of_reflection : public ScriptedInstance
86+
{
87+
public:
88+
instance_halls_of_reflection(Map* pMap);
89+
~instance_halls_of_reflection() {}
90+
91+
void Initialize() override;
92+
93+
void OnCreatureCreate(Creature* pCreature) override;
94+
void OnObjectCreate(GameObject* pGo) override;
95+
96+
void OnPlayerEnter(Player* pPlayer) override;
97+
98+
void SetData(uint32 uiType, uint32 uiData) override;
99+
uint32 GetData(uint32 uiType) const override;
100+
101+
uint32 GetPlayerTeam() { return m_uiTeam; }
102+
103+
const char* Save() const override { return m_strInstData.c_str(); }
104+
void Load(const char* chrIn) override;
105+
106+
protected:
107+
uint32 m_auiEncounter[MAX_ENCOUNTER];
108+
std::string m_strInstData;
109+
110+
uint32 m_uiTeam; // Team of first entered player, used to set if Jaina or Silvana to spawn
111+
};
112+
113+
#endif

scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/instance_halls_of_reflection.cpp

Lines changed: 150 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,161 @@
1616

1717
/* ScriptData
1818
SDName: instance_halls_of_reflection
19-
SD%Complete: 0
20-
SDComment: Placeholder
19+
SD%Complete: 10
20+
SDComment: Basic support
2121
SDCategory: Halls of Reflection
2222
EndScriptData */
2323

2424
#include "precompiled.h"
25+
#include "halls_of_reflection.h"
26+
27+
instance_halls_of_reflection::instance_halls_of_reflection(Map* pMap) : ScriptedInstance(pMap),
28+
m_uiTeam(TEAM_NONE)
29+
{
30+
Initialize();
31+
}
32+
33+
void instance_halls_of_reflection::Initialize()
34+
{
35+
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
36+
}
37+
38+
void instance_halls_of_reflection::OnPlayerEnter(Player* pPlayer)
39+
{
40+
if (!m_uiTeam) // very first player to enter
41+
{
42+
m_uiTeam = pPlayer->GetTeam();
43+
44+
// Spawn intro npcs
45+
for (uint8 i = 0; i < countof(aEventBeginLocations); ++i)
46+
{
47+
pPlayer->SummonCreature(m_uiTeam == HORDE ? aEventBeginLocations[i].uiEntryHorde : aEventBeginLocations[i].uiEntryAlliance,
48+
aEventBeginLocations[i].fX, aEventBeginLocations[i].fY, aEventBeginLocations[i].fZ, aEventBeginLocations[i].fO, TEMPSUMMON_DEAD_DESPAWN, 0);
49+
}
50+
}
51+
}
52+
53+
void instance_halls_of_reflection::OnCreatureCreate(Creature* pCreature)
54+
{
55+
switch (pCreature->GetEntry())
56+
{
57+
case NPC_JAINA_PART1:
58+
case NPC_JAINA_PART2:
59+
case NPC_SYLVANAS_PART1:
60+
case NPC_SYLVANAS_PART2:
61+
case NPC_FALRIC:
62+
case NPC_MARWYN:
63+
case NPC_LICH_KING:
64+
break;
65+
default:
66+
return;
67+
}
68+
m_mNpcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid();
69+
}
70+
71+
void instance_halls_of_reflection::OnObjectCreate(GameObject* pGo)
72+
{
73+
switch (pGo->GetEntry())
74+
{
75+
case GO_FROSTMOURNE:
76+
case GO_FROSTMOURNE_ALTAR:
77+
case GO_ICECROWN_DOOR_ENTRANCE:
78+
case GO_IMPENETRABLE_DOOR:
79+
case GO_ICECROWN_DOOR_LK_ENTRANCE:
80+
case GO_ICECROWN_DOOR_LK_EXIT:
81+
case GO_CAVE_IN:
82+
83+
case GO_CAPTAIN_CHEST_HORDE:
84+
case GO_CAPTAIN_CHEST_HORDE_H:
85+
case GO_CAPTAIN_CHEST_ALLIANCE:
86+
case GO_CAPTAIN_CHEST_ALLIANCE_H:
87+
break;
88+
default:
89+
return;
90+
}
91+
m_mGoEntryGuidStore[pGo->GetEntry()] = pGo->GetObjectGuid();
92+
}
93+
94+
void instance_halls_of_reflection::SetData(uint32 uiType, uint32 uiData)
95+
{
96+
switch (uiType)
97+
{
98+
case TYPE_FALRIC:
99+
m_auiEncounter[uiType] = uiData;
100+
break;
101+
case TYPE_MARWYN:
102+
if (uiData == DONE)
103+
DoUseDoorOrButton(GO_IMPENETRABLE_DOOR);
104+
m_auiEncounter[uiType] = uiData;
105+
break;
106+
case TYPE_LICH_KING:
107+
if (uiData == DONE)
108+
{
109+
uint32 uiChestEntry = m_uiTeam == ALLIANCE ? (instance->IsRegularDifficulty() ? GO_CAPTAIN_CHEST_ALLIANCE : GO_CAPTAIN_CHEST_ALLIANCE_H) :
110+
(instance->IsRegularDifficulty() ? GO_CAPTAIN_CHEST_HORDE : GO_CAPTAIN_CHEST_HORDE_H);
111+
DoToggleGameObjectFlags(uiChestEntry, GO_FLAG_NO_INTERACT, false);
112+
}
113+
m_auiEncounter[uiType] = uiData;
114+
break;
115+
default:
116+
return;
117+
}
118+
119+
if (uiData == DONE)
120+
{
121+
OUT_SAVE_INST_DATA;
122+
123+
std::ostringstream saveStream;
124+
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2];
125+
126+
m_strInstData = saveStream.str();
127+
128+
SaveToDB();
129+
OUT_SAVE_INST_DATA_COMPLETE;
130+
}
131+
}
132+
133+
void instance_halls_of_reflection::Load(const char* chrIn)
134+
{
135+
if (!chrIn)
136+
{
137+
OUT_LOAD_INST_DATA_FAIL;
138+
return;
139+
}
140+
141+
OUT_LOAD_INST_DATA(chrIn);
142+
143+
std::istringstream loadStream(chrIn);
144+
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2];
145+
146+
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
147+
{
148+
if (m_auiEncounter[i] == IN_PROGRESS)
149+
m_auiEncounter[i] = NOT_STARTED;
150+
}
151+
152+
OUT_LOAD_INST_DATA_COMPLETE;
153+
}
154+
155+
uint32 instance_halls_of_reflection::GetData(uint32 uiType) const
156+
{
157+
if (uiType < MAX_ENCOUNTER)
158+
return m_auiEncounter[uiType];
159+
160+
return 0;
161+
}
162+
163+
InstanceData* GetInstanceData_instance_halls_of_reflection(Map* pMap)
164+
{
165+
return new instance_halls_of_reflection(pMap);
166+
}
25167

26168
void AddSC_instance_halls_of_reflection()
27169
{
170+
Script* pNewScript;
171+
172+
pNewScript = new Script;
173+
pNewScript->Name = "instance_halls_of_reflection";
174+
pNewScript->GetInstanceData = &GetInstanceData_instance_halls_of_reflection;
175+
pNewScript->RegisterSelf();
28176
}

scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/pit_of_saron.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,13 @@ enum
6262
NPC_YMIRJAR_FLAMEBEARER = 36893,
6363
NPC_FALLEN_WARRIOR = 36841,
6464
NPC_COLDWRAITH = 36842,
65-
NPC_STALKER = 32780,
66-
NPC_GENERAL_BUNNY = 24110,
65+
NPC_STALKER = 32780, // used to handle icicles during the tunnel event
66+
NPC_GENERAL_BUNNY = 24110, // used to handle visuals for the last encounter
67+
68+
// epilog npcs - used during the Tyrannus encounter
69+
NPC_WRATHBONE_SORCERER = 37728,
70+
NPC_WRATHBONE_REAVER = 37729,
71+
NPC_FALLEN_WARRIOR_EPILOG = 38487,
6772

6873
GO_ICEWALL = 201885, // open after gafrost/krick
6974
GO_HALLS_OF_REFLECT_PORT = 201848, // unlocked by jaina/sylvanas at last outro

sd2_revision_nr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#ifndef __SD2_REVISION_NR_H__
22
#define __SD2_REVISION_NR_H__
3-
#define SD2_REVISION_NR "3134"
3+
#define SD2_REVISION_NR "3135"
44
#endif // __SD2_REVISION_NR_H__

sql/mangos_scriptname_full.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ UPDATE creature_template SET ScriptName='boss_devourer_of_souls' WHERE entry=365
778778
UPDATE instance_template SET ScriptName='instance_forge_of_souls' WHERE map=632;
779779

780780
/* HALLS OF REFLECTION */
781+
UPDATE instance_template SET ScriptName='instance_halls_of_reflection' WHERE map=668;
781782

782783
/* PIT OF SARON */
783784
UPDATE instance_template SET ScriptName='instance_pit_of_saron' WHERE map=658;

sql/updates/r3135_mangos.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UPDATE instance_template SET ScriptName='instance_halls_of_reflection' WHERE map=668;

0 commit comments

Comments
 (0)