1 /* GemRB - Infinity Engine Emulator
2 * Copyright (C) 2007 The GemRB Project
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 * Declares IniSpawn a class for the special creature re/spawn features
24 * PST has. The information is originally stored in <arearesref>.ini files
25 * @author The GemRB Project
34 #include "DataFileMgr.h"
40 * @struct CritterEntry
44 #define CF_IGNORECANSEE 1
46 #define CF_NO_DIFF_1 4
47 #define CF_NO_DIFF_2 8
48 #define CF_NO_DIFF_3 16
49 #define CF_CHECKVIEWPORT 32
50 #define CF_CHECKCROWD 64
51 #define CF_SAFESTPOINT 128
52 #define CF_NO_DIFF_MASK 28
53 #define CF_CHECK_NAME 256
61 #define AI_SPECIFICS 6
63 #define AI_ALIGNMENT 8
65 //spawn point could be:
69 // save_select_point saves the spawnpoint
73 ieResRef
*CreFile
; //spawn one of these creatures
74 ieByte Spec
[9]; //existance check IDS qualifier
75 ieByte SetSpec
[9]; //set IDS qualifier
76 ieVariable ScriptName
; //existance check scripting name
77 ieVariable SpecVar
; //condition variable
78 ieResRef SpecContext
; //condition variable context
79 ieResRef OverrideScript
; //override override script
80 ieResRef ClassScript
; //overrride class script
81 ieResRef RaceScript
; //override race script
82 ieResRef GeneralScript
; //override general script
83 ieResRef DefaultScript
; //override default script
84 ieResRef AreaScript
; //override area script
85 ieResRef SpecificScript
; //override specific script
86 ieResRef Dialog
; //override dialog
87 ieVariable SpawnPointVar
; //spawn point saved location
88 Point SpawnPoint
; //spawn point
89 int SpecVarOperator
; //operation performed on spec var
90 int SpecVarValue
; //using this value with the operation
91 int SpecVarInc
; //add this to spec var at each spawn
92 int Orientation
; //spawn orientation
93 int Flags
; //CF_IGNORENOSEE, CF_DEATHVAR, etc
94 int TotalQuantity
; //total number
95 int SpawnCount
; //create quantity
105 CritterEntry
*critters
;
113 for (int i
=0;i
<crittercount
;i
++) {
114 delete[] critters
[i
].CreFile
;
123 * Class for the special creature re/spawn features that are unique to PST.
126 struct VariableSpec
{
131 class GEM_EXPORT IniSpawn
{
133 IniSpawn(Map
*owner
);
138 ieResRef NamelessSpawnArea
;
139 int namelessvarcount
;
140 VariableSpec
*NamelessVar
;
142 VariableSpec
*Locals
;
143 Point NamelessSpawnPoint
;
145 SpawnEntry enterspawn
;
148 SpawnEntry
*eventspawns
;
150 void ReadCreature(DataFileMgr
*inifile
,
151 const char *crittername
, CritterEntry
&critter
);
152 void ReadSpawnEntry(DataFileMgr
*inifile
,
153 const char *entryname
, SpawnEntry
&entry
);
154 //spawns a single creature
155 void SpawnCreature(CritterEntry
&critter
);
156 void SpawnGroup(SpawnEntry
&event
);
157 //gets the spec var operation code from a keyword
158 int GetDiffMode(const char *keyword
);
160 void InitSpawn(const ieResRef DefaultArea
);
161 void RespawnNameless();
166 #endif // ! INISPAWN_H