Skip to content

Commit 4670a30

Browse files
feat: dragon spawner menu
1 parent 3a58ff1 commit 4670a30

File tree

6 files changed

+128
-0
lines changed

6 files changed

+128
-0
lines changed

Code/client/Games/Fallout4/Actor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ struct Actor : TESObjectREFR
2525

2626
static GamePtr<Actor> New() noexcept;
2727
static GamePtr<Actor> Create(TESNPC* apNpc) noexcept;
28+
static GamePtr<Actor> Spawn(uint32_t aBaseFormId) noexcept;
2829

2930
virtual void sub_C4();
3031
virtual void sub_C5();

Code/client/Games/References.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,12 @@ GamePtr<Actor> Actor::Create(TESNPC* apBaseForm) noexcept
591591
return pActor;
592592
}
593593

594+
GamePtr<Actor> Actor::Spawn(uint32_t aBaseFormId) noexcept
595+
{
596+
TESNPC* pNpc = Cast<TESNPC>(TESForm::GetById(aBaseFormId));
597+
return Actor::Create(pNpc);
598+
}
599+
594600
void Actor::SetLevelMod(uint32_t aLevel) noexcept
595601
{
596602
TP_THIS_FUNCTION(TActorSetLevelMod, void, ExtraDataList, uint32_t);

Code/client/Games/Skyrim/Actor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ struct Actor : TESObjectREFR
3030
static GamePtr<Actor> New() noexcept;
3131
// Places a brand new actor in the world
3232
static GamePtr<Actor> Create(TESNPC* apBaseForm) noexcept;
33+
static GamePtr<Actor> Spawn(uint32_t aBaseFormId) noexcept;
3334

3435
virtual void sub_9C();
3536
virtual void sub_9D();

Code/client/Services/Debug/DebugService.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ static bool g_enableCellWindow{false};
236236
static bool g_enableProcessesWindow{false};
237237
static bool g_enableWeatherWindow{false};
238238
static bool g_enableCombatWindow{false};
239+
static bool g_enableDragonSpawnerWindow{false};
239240

240241
void DebugService::DrawServerView() noexcept
241242
{
@@ -335,6 +336,7 @@ void DebugService::OnDraw() noexcept
335336
ImGui::MenuItem("Entities", nullptr, &g_enableEntitiesWindow);
336337
ImGui::MenuItem("Server", nullptr, &g_enableServerWindow);
337338
ImGui::MenuItem("Party", nullptr, &g_enablePartyWindow);
339+
ImGui::MenuItem("Dragon spawner", nullptr, &g_enableDragonSpawnerWindow);
338340

339341
#if (!IS_MASTER)
340342
ImGui::MenuItem("Network", nullptr, &g_enableNetworkWindow);
@@ -378,6 +380,8 @@ void DebugService::OnDraw() noexcept
378380
DrawServerView();
379381
if (g_enablePartyWindow)
380382
DrawPartyView();
383+
if (g_enableDragonSpawnerWindow)
384+
DrawDragonSpawnerView();
381385

382386
#if (!IS_MASTER)
383387
if (g_enableNetworkWindow)
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#include <imgui.h>
2+
#include <inttypes.h>
3+
4+
void DebugService::DrawDragonSpawnerView()
5+
{
6+
#if TP_SKYRIM64
7+
ImGui::Begin("Dragon spawner");
8+
9+
if (ImGui::CollapsingHeader("Dragons (level 10)"))
10+
{
11+
if (ImGui::Button("Brown (fire)"))
12+
{
13+
Actor::Spawn(0x1CA03);
14+
}
15+
if (ImGui::Button("Brown (frost)"))
16+
{
17+
Actor::Spawn(0xF80FA);
18+
}
19+
if (ImGui::Button("White (frost)"))
20+
{
21+
Actor::Spawn(0x8BC7F);
22+
}
23+
if (ImGui::Button("Bronze (frost)"))
24+
{
25+
Actor::Spawn(0x8BC7E);
26+
}
27+
}
28+
29+
if (ImGui::CollapsingHeader("Blood dragons (level 20)"))
30+
{
31+
if (ImGui::Button("Blood (fire)"))
32+
{
33+
Actor::Spawn(0xF80FD);
34+
}
35+
if (ImGui::Button("Blood (frost)"))
36+
{
37+
Actor::Spawn(0xF77F8);
38+
}
39+
}
40+
41+
if (ImGui::CollapsingHeader("Frost dragons (level 27-35)"))
42+
{
43+
if (ImGui::Button("Frost"))
44+
{
45+
Actor::Spawn(0x351C3);
46+
}
47+
}
48+
49+
if (ImGui::CollapsingHeader("Elder dragons (level 36-44)"))
50+
{
51+
if (ImGui::Button("Elder (fire)"))
52+
{
53+
Actor::Spawn(0xF811B);
54+
}
55+
if (ImGui::Button("Elder (frost)"))
56+
{
57+
Actor::Spawn(0xF811A);
58+
}
59+
}
60+
61+
if (ImGui::CollapsingHeader("Ancient dragons (level 45-54)"))
62+
{
63+
if (ImGui::Button("Ancient (fire)"))
64+
{
65+
Actor::Spawn(0xF811C);
66+
}
67+
if (ImGui::Button("Ancient (frost)"))
68+
{
69+
Actor::Spawn(0xF811E);
70+
}
71+
}
72+
73+
if (ImGui::CollapsingHeader("Serpentine dragons (level 55-58)"))
74+
{
75+
if (ImGui::Button("Serpentine (fire)"))
76+
{
77+
Actor::Spawn(0x04036134);
78+
}
79+
if (ImGui::Button("Serpentine (frost)"))
80+
{
81+
Actor::Spawn(0x04036133);
82+
}
83+
}
84+
85+
if (ImGui::CollapsingHeader("Revered dragons (level 62)"))
86+
{
87+
if (ImGui::Button("Revered (fire)"))
88+
{
89+
Actor::Spawn(0x02008431);
90+
}
91+
}
92+
93+
if (ImGui::CollapsingHeader("Legendary dragons (level 75)"))
94+
{
95+
if (ImGui::Button("Legendary (fire)"))
96+
{
97+
Actor::Spawn(0x0200C5F5);
98+
}
99+
if (ImGui::Button("Legendary (frost)"))
100+
{
101+
Actor::Spawn(0x0200C5FD);
102+
}
103+
}
104+
105+
if (ImGui::CollapsingHeader("Skeletal dragons (warning: very scary)"))
106+
{
107+
if (ImGui::Button("Skeletal (frost)"))
108+
{
109+
Actor::Spawn(0x9192C);
110+
}
111+
}
112+
113+
ImGui::End();
114+
#endif
115+
}

Code/client/Services/DebugService.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ struct DebugService
5858
void DrawProcessView();
5959
void DrawWeatherView();
6060
void DrawCombatView();
61+
void DrawDragonSpawnerView();
6162

6263
public:
6364
bool m_showDebugStuff = false;

0 commit comments

Comments
 (0)