forked from Bad-Scientists/AF-Script-Packet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spawnManager.d
221 lines (176 loc) · 6.77 KB
/
spawnManager.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
/*
* Function removes NPC from world
*/
func void oCSpawnManager_DeleteNpc (var int slfPtr) {
//0x006D0DE0 public: void __thiscall oCSpawnManager::DeleteNpc(class oCNpc *)
const int oCSpawnManager__DeleteNpc_G1 = 7146976;
//0x00779690 public: void __thiscall oCSpawnManager::DeleteNpc(class oCNpc *)
const int oCSpawnManager__DeleteNpc_G2 = 7837328;
if (!slfPtr) { return; };
const int call = 0;
if (CALL_Begin (call)) {
CALL_PtrParam (_@ (slfPtr));
CALL__thiscall (_@ (MEM_Game.spawnman), MEMINT_SwitchG1G2 (oCSpawnManager__DeleteNpc_G1, oCSpawnManager__DeleteNpc_G2));
call = CALL_End ();
};
};
func void oCSpawnManager_SpawnNpc_AtPos (var int slfPtr, var int posPtr, var int timeDelayF) {
//0x006D0710 public: void __thiscall oCSpawnManager::SpawnNpc(class oCNpc *,class zVEC3 const &,float)
const int oCSpawnManager__SpawnNpc_G1 = 7145232;
//0x00778E70 public: void __thiscall oCSpawnManager::SpawnNpc(class oCNpc *,class zVEC3 const &,float)
const int oCSpawnManager__SpawnNpc_G2 = 7835248;
if (!slfPtr) { return; };
if (!posPtr) { return; };
const int call = 0;
if (CALL_Begin (call)) {
CALL_FloatParam (_@ (timeDelayF));
CALL_PtrParam (_@ (posPtr));
CALL_PtrParam (_@ (slfPtr));
CALL__thiscall (_@ (MEM_Game.spawnman), MEMINT_SwitchG1G2 (oCSpawnManager__SpawnNpc_G1, oCSpawnManager__SpawnNpc_G2));
call = CALL_End ();
};
};
func void oCSpawnManager_SpawnNpc_AtVob (var int slfPtr, var string targetVob, var int timeDelayF) {
//0x006D04C0 public: void __thiscall oCSpawnManager::SpawnNpc(class oCNpc *,class zSTRING const &,float)
const int oCSpawnManager__SpawnNpc_G1 = 7144640;
//0x00778BA0 public: void __thiscall oCSpawnManager::SpawnNpc(class oCNpc *,class zSTRING const &,float)
const int oCSpawnManager__SpawnNpc_G2 = 7834528;
if (!slfPtr) { return; };
CALL_FloatParam (timeDelayF);
CALL_zStringPtrParam (targetVob);
CALL_PtrParam (slfPtr);
CALL__thiscall (MEM_Game.spawnman, MEMINT_SwitchG1G2 (oCSpawnManager__SpawnNpc_G1, oCSpawnManager__SpawnNpc_G2));
};
func int oCSpawnManager_InsertNpc (var int slfPtr, var int posPtr) {
//0x006D0250 private: int __thiscall oCSpawnManager::InsertNpc(class oCNpc *,class zVEC3 const &)
const int oCSpawnManager__InsertNpc_G1 = 7144016;
//0x00778920 private: int __thiscall oCSpawnManager::InsertNpc(class oCNpc *,class zVEC3 const &)
const int oCSpawnManager__InsertNpc_G2 = 7833888;
if (!slfPtr) { return 0; };
if (!posPtr) { return 0; };
const int call = 0;
if (CALL_Begin (call)) {
CALL_PtrParam (_@ (posPtr));
CALL_PtrParam (_@ (slfPtr));
CALL__thiscall (_@ (MEM_Game.spawnman), MEMINT_SwitchG1G2 (oCSpawnManager__InsertNpc_G1, oCSpawnManager__InsertNpc_G2));
call = CALL_End ();
};
return CALL_RetValAsInt ();
};
/*
* Set insert range
*/
func void oCSpawnManager_SetInsertRange (var int f) {
//0x006CF5D0 public: static void __cdecl oCSpawnManager::SetInsertRange(float)
const int oCSpawnManager__SetInsertRange_G1 = 7140816;
//0x00777820 public: static void __cdecl oCSpawnManager::SetInsertRange(float)
const int oCSpawnManager__SetInsertRange_G2 = 7829536;
const int call = 0;
if (CALL_Begin (call)) {
CALL_IntParam (_@ (f));
CALL__cdecl (MEMINT_SwitchG1G2 (oCSpawnManager__SetInsertRange_G1, oCSpawnManager__SetInsertRange_G2));
call = CALL_End ();
};
};
/*
* Get insert range
*/
func int oCSpawnManager_GetInsertRange () {
//0x006CF5E0 public: static float __cdecl oCSpawnManager::GetInsertRange(void)
const int oCSpawnManager__GetInsertRange_G1 = 7140832;
//0x00777830 public: static float __cdecl oCSpawnManager::GetInsertRange(void)
const int oCSpawnManager__GetInsertRange_G2 = 7829552;
var int retVal;
const int call = 0;
if (CALL_Begin (call)) {
CALL_PutRetValTo (_@ (retVal));
CALL__cdecl (MEMINT_SwitchG1G2 (oCSpawnManager__GetInsertRange_G1, oCSpawnManager__GetInsertRange_G2));
call = CALL_End ();
};
return +retVal;
};
/*
* Set remove range
*/
func void oCSpawnManager_SetRemoveRange (var int f) {
//0x006CF5F0 public: static void __cdecl oCSpawnManager::SetRemoveRange(float)
const int oCSpawnManager__SetRemoveRange_G1 = 7140848;
//0x00777840 public: static void __cdecl oCSpawnManager::SetRemoveRange(float)
const int oCSpawnManager__SetRemoveRange_G2 = 7829568;
const int call = 0;
if (CALL_Begin (call)) {
CALL_IntParam (_@ (f));
CALL__cdecl (MEMINT_SwitchG1G2 (oCSpawnManager__SetRemoveRange_G1, oCSpawnManager__SetRemoveRange_G2));
call = CALL_End ();
};
};
/*
* Get remove range
*/
func int oCSpawnManager_GetRemoveRange () {
//0x006CF600 public: static float __cdecl oCSpawnManager::GetRemoveRange(void)
const int oCSpawnManager__GetRemoveRange_G1 = 7140864;
//0x00777850 public: static float __cdecl oCSpawnManager::GetRemoveRange(void)
const int oCSpawnManager__GetRemoveRange_G2 = 7829584;
var int retVal;
const int call = 0;
if (CALL_Begin (call)) {
CALL_PutRetValTo (_@ (retVal));
CALL__cdecl (MEMINT_SwitchG1G2 (oCSpawnManager__GetRemoveRange_G1, oCSpawnManager__GetRemoveRange_G2));
call = CALL_End ();
};
return +retVal;
};
/*
* Set spawn time
*/
func void oCSpawnManager_SetSpawnTime (var int f) {
//0x006CF610 public: static void __cdecl oCSpawnManager::SetSpawnTime(float)
const int oCSpawnManager__SetSpawnTime_G1 = 7140880;
//0x00777860 public: static void __cdecl oCSpawnManager::SetSpawnTime(float)
const int oCSpawnManager__SetSpawnTime_G2 = 7829600;
const int call = 0;
if (CALL_Begin (call)) {
CALL_IntParam (_@ (f));
CALL__cdecl (MEMINT_SwitchG1G2 (oCSpawnManager__SetSpawnTime_G1, oCSpawnManager__SetSpawnTime_G2));
call = CALL_End ();
};
};
/*
* Get spawn time
*/
func int oCSpawnManager_GetSpawnTime () {
//0x006CF620 public: static float __cdecl oCSpawnManager::GetSpawnTime(void)
const int oCSpawnManager__GetSpawnTime_G1 = 7140896;
//0x00777870 public: static float __cdecl oCSpawnManager::GetSpawnTime(void)
const int oCSpawnManager__GetSpawnTime_G2 = 7829616;
var int retVal;
const int call = 0;
if (CALL_Begin (call)) {
CALL_PutRetValTo (_@ (retVal));
CALL__cdecl (MEMINT_SwitchG1G2 (oCSpawnManager__GetSpawnTime_G1, oCSpawnManager__GetSpawnTime_G2));
call = CALL_End ();
};
return +retVal;
};
/*
* Get spawn node for specific NPC
*/
func int oCSpawnManager_GetNodePtr (var int npcPtr) {
if (!MEM_SpawnManager.spawnList_array) { return 0; };
if (!MEM_SpawnManager.spawnList_numInArray) { return 0; };
repeat (i, MEM_SpawnManager.spawnList_numInArray); var int i;
var int spawnNodePtr; spawnNodePtr = MEM_ReadIntArray (MEM_SpawnManager.spawnList_array, i);
if (spawnNodePtr) {
//NPC pointer is @ offset 0, we don't really need to convert pointer to oSSpawnNode object
//var oSSpawnNode spawnNode; spawnNode = _^ (spawnNodePtr);
//if (npcPtr == spawnNode.npc) {
// return spawnNodePtr;
//};
if (MEM_ReadInt (spawnNodePtr) == npcPtr) {
return spawnNodePtr;
};
};
end;
return 0;
};