-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathNames.d
44 lines (37 loc) · 1.55 KB
/
Names.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
/***********************************\
NAMES
\***********************************/
var int Talent_Names;
//========================================
// Namen setzen
//========================================
func void SetName(var int npc, var string nname) {
var C_NPC slf; slf = Hlp_GetNpc(npc);
if (!Hlp_IsValidNpc(slf)) {
var zCPar_Symbol symb; symb = _^(MEM_GetSymbolByIndex(npc));
MEM_Warn(ConcatStrings("SetName failed! NPC does not exist in this world: ", symb.name));
return;
};
if (TAL_GetValue(slf, Talent_Names)) {
slf.name = nname;
};
// Gothic 1 compatibility. Deviation in class variable name: oCNpc.name_1 (G2), oCNpc.name1 (G1)
var oCNpc slf_int; slf_int = Hlp_GetNpc(npc);
MEM_WriteStringArray(_@(slf_int)+MEM_NpcName_Offset, 1, nname);
};
//========================================
// Namen anzeigen
//========================================
func void ShowName(var int npc) {
var C_NPC slf; slf = Hlp_GetNpc(npc);
if (!Hlp_IsValidNpc(slf)) {
var zCPar_Symbol symb; symb = _^(MEM_GetSymbolByIndex(npc));
MEM_Warn(ConcatStrings("ShowName failed! NPC does not exist in this world: ", symb.name));
return;
};
TAL_SetValue(slf, Talent_Names, 1);
// Gothic 1 compatibility. Deviation in class variable name: oCNpc.name_1 (G2), oCNpc.name1 (G1)
var oCNpc slf_int; slf_int = Hlp_GetNpc(npc);
var string name1; name1 = MEM_ReadStringArray(_@(slf_int)+MEM_NpcName_Offset, 1);
MEM_WriteStringArray(_@(slf_int)+MEM_NpcName_Offset, 0, name1);
};