forked from Bad-Scientists/AF-Script-Packet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ou.d
207 lines (156 loc) · 6.54 KB
/
ou.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
/*
* Output units
*/
/*
* oCSVMManager_GetOU
* - returns SVM output unit instance ID
*/
func int oCSVMManager_GetOU (var string svm, var int voice) {
//0x006D1520 public: int __thiscall oCSVMManager::GetOU(class zSTRING const &,int)
const int oCSVMManager__GetOU_G1 = 7148832;
//0x00779E50 public: int __thiscall oCSVMManager::GetOU(class zSTRING const &,int)
const int oCSVMManager__GetOU_G2 = 7839312;
if (!MEM_Game.svmman) { return -1; };
CALL_IntParam (voice);
CALL_zStringPtrParam (svm);
CALL__thiscall (MEM_Game.svmman, MEMINT_SwitchG1G2 (oCSVMManager__GetOU_G1, oCSVMManager__GetOU_G2));
return CALL_RetValAsInt ();
};
func int zCCSManager_LibGet (var int ou) {
//0x0041BA30 public: virtual class zCCSBlock * __thiscall zCCSManager::LibGet(int)
const int zCCSManager__LibGet_G1 = 4307504;
//0x0041BF20 public: virtual class zCCSBlock * __thiscall zCCSManager::LibGet(int)
const int zCCSManager__LibGet_G2 = 4308768;
if (!MEM_Game._zCSession_csMan) { return 0; };
var int csManPtr; csManPtr = MEM_Game._zCSession_csMan; //zCCSManager*
var int retVal;
const int call = 0;
if (CALL_Begin(call)) {
CALL_PutRetValTo (_@ (retVal));
CALL_IntParam (_@ (ou));
CALL__thiscall (_@ (csManPtr), MEMINT_SwitchG1G2 (zCCSManager__LibGet_G1, zCCSManager__LibGet_G2));
call = CALL_End();
};
return + retVal;
};
/*
* zCCSManager_LibGetSvmModuleName
* - returns name of SVM instance ID
*/
func string zCCSManager_LibGetSvmModuleName (var int ou) {
//0x004196C0 public: virtual class zSTRING __thiscall zCCSManager::LibGetSvmModuleName(int)
const int zCCSManager__LibGetSvmModuleName_G1 = 4298432;
//0x00419BC0 public: virtual class zSTRING __thiscall zCCSManager::LibGetSvmModuleName(int)
const int zCCSManager__LibGetSvmModuleName_G2 = 4299712;
if (!MEM_Game._zCSession_csMan) { return ""; };
CALL_RetValIszString ();
CALL_IntParam (ou);
CALL__thiscall (MEM_Game._zCSession_csMan, MEMINT_SwitchG1G2 (zCCSManager__LibGetSvmModuleName_G1, zCCSManager__LibGetSvmModuleName_G2));
return CALL_RetValAszstring ();
};
/*
* zCCSManager_LibIsSvmModuleRunning
* - checks if SVM is runinng
*/
func int zCCSManager_LibIsSvmModuleRunning (var int ou) {
//0x00419980 public: virtual int __thiscall zCCSManager::LibIsSvmModuleRunning(int)
const int zCCSManager__LibIsSvmModuleRunning_G1 = 4299136;
//0x00419E80 public: virtual int __thiscall zCCSManager::LibIsSvmModuleRunning(int)
const int zCCSManager__LibIsSvmModuleRunning_G2 = 4300416;
if (!MEM_Game._zCSession_csMan) { return FALSE; };
var int csManPtr; csManPtr = MEM_Game._zCSession_csMan;
var int retVal;
const int call = 0;
if (CALL_Begin(call)) {
CALL_PutRetValTo (_@ (retVal));
CALL_IntParam (_@ (ou));
CALL__thiscall (_@ (csManPtr), MEMINT_SwitchG1G2 (zCCSManager__LibIsSvmModuleRunning_G1, zCCSManager__LibIsSvmModuleRunning_G2));
call = CALL_End();
};
return + retVal;
};
/*
* zCCSManager_LibSvmModuleStop
* - stops SVM ou
*/
func int zCCSManager_LibSvmModuleStop (var int ou) {
//0x00419C60 public: virtual int __thiscall zCCSManager::LibSvmModuleStop(int)
const int zCCSManager__LibSvmModuleStop_G1 = 4299872;
//0x0041A160 public: virtual int __thiscall zCCSManager::LibSvmModuleStop(int)
const int zCCSManager__LibSvmModuleStop_G2 = 4301152;
if (!MEM_Game._zCSession_csMan) { return FALSE; };
var int csManPtr; csManPtr = MEM_Game._zCSession_csMan;
var int retVal;
const int call = 0;
if (CALL_Begin(call)) {
CALL_PutRetValTo (_@ (retVal));
CALL_IntParam (_@ (ou));
CALL__thiscall (_@ (csManPtr), MEMINT_SwitchG1G2 (zCCSManager__LibSvmModuleStop_G1, zCCSManager__LibSvmModuleStop_G2));
call = CALL_End();
};
return + retVal;
};
func int zCCSManager_LibValidateOU (var int ou) {
//0x0041BE20 public: virtual int __thiscall zCCSManager::LibValidateOU(int)
const int zCCSManager__LibValidateOU_G1 = 4308512;
//0x0041C3B0 public: virtual int __thiscall zCCSManager::LibValidateOU(int)
const int zCCSManager__LibValidateOU_G2 = 4309936;
if (!MEM_Game._zCSession_csMan) { return -1; };
var int csManPtr; csManPtr = MEM_Game._zCSession_csMan;
var int retVal;
const int call = 0;
if (CALL_Begin(call)) {
CALL_PutRetValTo (_@ (retVal));
CALL_IntParam (_@ (ou));
CALL__thiscall (_@ (csManPtr), MEMINT_SwitchG1G2 (zCCSManager__LibValidateOU_G1, zCCSManager__LibValidateOU_G2));
call = CALL_End();
};
return + retVal;
};
func int zCCSManager_LibValidateOU_ByName (var string ou) {
//0x0041BE50 public: virtual int __thiscall zCCSManager::LibValidateOU(class zSTRING &)
const int zCCSManager__LibValidateOU_G1 = 4308560;
//0x0041C3E0 public: virtual int __thiscall zCCSManager::LibValidateOU(class zSTRING &)
const int zCCSManager__LibValidateOU_G2 = 4309984;
if (!MEM_Game._zCSession_csMan) { return -1; };
CALL_zStringPtrParam (ou);
CALL__thiscall (MEM_Game._zCSession_csMan, MEMINT_SwitchG1G2 (zCCSManager__LibValidateOU_G1, zCCSManager__LibValidateOU_G2));
return CALL_RetValAsInt ();
};
func void Npc_StartOutputUnit (var int slfInstance, var int diaInstance) {
//0x006C63B0 public: void __thiscall oCNpc_States::StartOutputUnit(int)
const int oCNpc_States__StartOutputUnit_G1 = 7103408;
//0x0076D8F0 public: void __thiscall oCNpc_States::StartOutputUnit(int)
const int oCNpc_States__StartOutputUnit_G2 = 7788784;
var oCNPC slf; slf = Hlp_GetNPC (slfInstance);
if (!Hlp_IsValidNPC (slf)) { return; };
//NPC_GetNPCState replacing with 'raw' implementation because of compilation order
//var int statePtr; statePtr = NPC_GetNPCState (slfInstance);
var int statePtr; statePtr = _@ (slf) + MEMINT_SwitchG1G2 (1136, 1416);
if (!statePtr) { return; };
if (diaInstance == -1) { return; };
const int call = 0;
if (CALL_Begin (call)) {
CALL_IntParam (_@ (diaInstance));
CALL__thiscall (_@ (statePtr), MEMINT_SwitchG1G2 (oCNpc_States__StartOutputUnit_G1, oCNpc_States__StartOutputUnit_G2));
call = CALL_End();
};
};
func void Npc_OutputSVM (var int slfInstance, var string svm) {
var oCNPC slf; slf = Hlp_GetNPC (slfInstance);
if (!Hlp_IsValidNPC (slf)) { return; };
var int ou; ou = oCSVMManager_GetOU (svm, slf.voice);
Npc_StartOutputUnit (slf, ou);
};
func void Npc_Output (var int slfInstance, var string ouName) {
var oCNPC slf; slf = Hlp_GetNPC (slfInstance);
if (!Hlp_IsValidNPC (slf)) { return; };
var int ou; ou = zCCSManager_LibValidateOU_ByName (ouName);
Npc_StartOutputUnit (slf, ou);
};
func void Npc_StopSVM (var int slfInstance, var string svm) {
var oCNPC slf; slf = Hlp_GetNPC (slfInstance);
if (!Hlp_IsValidNPC (slf)) { return; };
var int ou; ou = oCSVMManager_GetOU (svm, slf.voice);
var int retVal; retVal = zCCSManager_LibSvmModuleStop (ou);
};