0
|
1 #pragma once
|
|
2 #include "VectorTypes.h"
|
|
3 #include "Items.h"
|
|
4 #include "Monsters.h"
|
|
5 #include "Spells.h"
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12 /* 357 */
|
|
13 #pragma pack(push, 1)
|
|
14 struct stru319
|
|
15 {
|
|
16 void LootActor(struct Actor *pActor);
|
|
17 int which_player_would_attack(struct Actor *pActor);
|
|
18 bool special_ability_use_check(struct Actor *pActor, int a2);
|
|
19 int _427102(struct Actor *pActor, signed int a2);
|
|
20 int PlayerHitOrMiss(struct Player *pPlayer, struct Actor *pActor, int a3, int a4);
|
|
21 bool _4273BB(struct Actor *pActor, struct Actor *a2, int a3, int a4);
|
|
22 bool ActorHitOrMiss(struct Actor *pActor, struct Player *pPlayer);
|
|
23 int _427546(int a2);
|
|
24 int CalcMagicalDamageToActor(struct Actor *pActor, int a2, signed int a3);
|
|
25 bool GetMagicalResistance(struct Actor *pActor, unsigned int uType);
|
271
|
26 int FindClosestActor(int a2, int a3, int a4);
|
0
|
27
|
|
28 char field_0;
|
|
29 };
|
|
30 #pragma pack(pop)
|
|
31
|
|
32
|
|
33 extern stru319 stru_50C198; // idb
|
|
34
|
|
35
|
|
36
|
|
37
|
|
38
|
|
39
|
|
40 /* 361 */
|
|
41 enum ACTOR_BUFF_INDEX
|
|
42 {
|
411
|
43 ACTOR_BUFF_CHARM = 1, // an assumption
|
|
44 ACTOR_BUFF_SHRINK = 3, // an assumption
|
142
|
45 ACTOR_BUFF_STONED = 5,
|
|
46 ACTOR_BUFF_PARALYZED = 6,
|
0
|
47 };
|
|
48
|
|
49
|
|
50
|
|
51
|
|
52
|
|
53 /* 295 */
|
|
54 enum ObjectType
|
|
55 {
|
194
|
56 OBJECT_Any = 0x0,
|
141
|
57 OBJECT_BLVDoor = 0x1,
|
0
|
58 OBJECT_Item = 0x2,
|
|
59 OBJECT_Actor = 0x3,
|
|
60 OBJECT_Player = 0x4,
|
|
61 OBJECT_Decoration = 0x5,
|
|
62 OBJECT_BModel = 0x6,
|
|
63 };
|
|
64
|
|
65
|
|
66
|
|
67
|
|
68
|
|
69
|
|
70
|
|
71 /* 337 */
|
|
72 enum AI_OBJECT_TYPE
|
|
73 {
|
|
74 AI_OBJECT_LAYING_ITEM = 0x2,
|
|
75 AI_OBJECT_ACTOR = 0x3,
|
|
76 AI_OBJECT_PARTY = 0x4,
|
|
77 AI_OBJECT_DECORATION = 0x5,
|
|
78 };
|
|
79
|
|
80 /* 264 */
|
|
81 enum AIState : unsigned __int16
|
|
82 {
|
|
83 Standing = 0x0,
|
|
84 Tethered = 0x1,
|
|
85 AttackingMelee = 0x2,
|
|
86 AttackingRanged1 = 0x3,
|
|
87 Dying = 0x4,
|
|
88 Dead = 0x5,
|
|
89 Pursuing = 0x6,
|
|
90 Fleeing = 0x7,
|
|
91 Stunned = 0x8,
|
|
92 Fidgeting = 0x9,
|
142
|
93 Interacting = 10,
|
|
94 Removed = 11,
|
0
|
95 AttackingRanged2 = 0xC,
|
|
96 AttackingRanged3 = 0xD,
|
|
97 Stoned = 0xE,
|
|
98 Paralyzed = 0xF,
|
142
|
99 Resurrected = 16,
|
141
|
100 Summoned = 17,
|
142
|
101 AttackingRanged4 = 18,
|
|
102 Disabled = 19,
|
0
|
103 };
|
|
104
|
|
105 /* 265 */
|
|
106 enum ActorAnimation : __int32
|
|
107 {
|
|
108 ANIM_Standing = 0x0,
|
|
109 ANIM_Walking = 0x1,
|
|
110 ANIM_AtkMelee = 0x2,
|
|
111 ANIM_AtkRanged = 0x3,
|
|
112 ANIM_GotHit = 0x4,
|
|
113 ANIM_Dying = 0x5,
|
|
114 ANIM_Dead = 0x6,
|
|
115 ANIM_Bored = 0x7,
|
|
116 };
|
|
117
|
|
118
|
|
119
|
|
120
|
|
121
|
|
122 /* 247 */
|
|
123 #pragma pack(push, 1)
|
|
124 struct AIDirection
|
|
125 {
|
|
126 Vec3_int_ vDirection;
|
|
127 unsigned int uDistance;
|
|
128 unsigned int uDistanceXZ;
|
|
129 unsigned int uYawAngle;
|
|
130 unsigned int uPitchAngle;
|
|
131 };
|
|
132 #pragma pack(pop)
|
|
133
|
|
134
|
|
135
|
|
136
|
|
137
|
|
138 /* 71 */
|
|
139 #pragma pack(push, 1)
|
|
140 struct ActorJob
|
|
141 {
|
|
142 struct Vec3_short_ vPos;
|
|
143 unsigned __int16 uAttributes;
|
|
144 unsigned __int8 uAction;
|
|
145 unsigned __int8 uHour;
|
|
146 unsigned __int8 uDay;
|
|
147 unsigned __int8 uMonth;
|
|
148 };
|
|
149 #pragma pack(pop)
|
|
150
|
|
151
|
|
152 /* 66 */
|
|
153 #pragma pack(push, 1)
|
|
154 struct Actor
|
|
155 {
|
|
156 //----- (0041F4C1) --------------------------------------------------------
|
|
157 inline Actor()
|
|
158 {
|
|
159 Actor *v1; // esi@1
|
|
160 SpellBuff *v2; // eax@1
|
|
161 signed int v3; // edx@1
|
|
162 ItemGen *v4; // edi@3
|
|
163 signed int v5; // ebx@3
|
|
164
|
|
165 v1 = this;
|
|
166 v2 = this->pActorBuffs;
|
|
167 v3 = 22;
|
|
168 do
|
|
169 {
|
|
170 v2->uSkill = 0;
|
|
171 v2->uPower = 0;
|
|
172 v2->uExpireTime = 0;
|
|
173 v2->uCaster = 0;
|
|
174 v2->uFlags = 0;
|
|
175 ++v2;
|
|
176 --v3;
|
|
177 }
|
|
178 while ( v3 );
|
|
179 v4 = this->array_000234;
|
|
180 v5 = 4;
|
|
181 do
|
|
182 {
|
|
183 v4->Reset();
|
|
184 ++v4;
|
|
185 --v5;
|
|
186 }
|
|
187 while ( v5 );
|
|
188 Reset();
|
|
189 }
|
|
190
|
|
191 int _44FD29(int a2);
|
|
192 void Reset();
|
|
193 void Remove();
|
|
194 void PrepareSprites(char load_sounds_if_bit1_set);
|
322
|
195 void UpdateAnimation();
|
0
|
196 signed int GetActorsRelation(Actor *a2);
|
|
197 void SetRandomGoldIfTheresNoItem();
|
|
198 bool CanAct();
|
303
|
199 bool IsNotAlive();
|
0
|
200 void InitializeDialogue(int bPlayerSaysHello);
|
322
|
201 bool IsPeasant();
|
0
|
202
|
|
203
|
417
|
204 static void _SelectTarget(unsigned int uActorID, int *a2, bool can_target_party);
|
322
|
205 static void _402686(unsigned int uActorID, unsigned int a2, signed int uActionLength, struct AIDirection *a4);
|
|
206 static void _40281C(unsigned int uActorID, unsigned int a2, signed int uActionLength, struct AIDirection *pDir, int a5);
|
|
207 static void _402968(unsigned int uActorID, signed int edx0, int uActionLength, struct AIDirection *a4);
|
|
208 static void _402AD7(unsigned int uActorID, unsigned int a2, signed int arg0, signed int uActionLength, struct AIDirection *pDir);
|
|
209 static void PlaySound(unsigned int uActorID, unsigned int uSoundID);
|
319
|
210 static void Die(unsigned int uActorID);
|
322
|
211 static void Resurrect(unsigned int uActorID);
|
414
|
212 static void AI_Bored(unsigned int uActorID, unsigned int uObjID, struct AIDirection *a4);
|
322
|
213 static void _4030AD(unsigned int uActorID, signed int edx0, int arg0);
|
0
|
214 static char __fastcall _4031C1_update_job(unsigned int uActorID, signed int a2, int a3);
|
322
|
215 static void _4032B2(unsigned int a1, unsigned int a2, int a3, int uActionLength);
|
|
216 static void _403476(unsigned int uActorID, signed int edx0, struct AIDirection *pDir);
|
|
217 static void _40368B(unsigned int uActorID, signed int edx0, struct AIDirection *pDir);
|
|
218 static void _403854(unsigned int uActorID, signed int edx0, struct AIDirection *pDir);
|
|
219 static void _403A60(unsigned int uActorID, signed int edx0, struct AIDirection *pDir);
|
|
220 static void _403C6C(unsigned int uActorID, signed int edx0, struct AIDirection *arg0);
|
0
|
221 static void __fastcall StandAwhile(unsigned int uActorID);
|
413
|
222 static void AI_Stand(unsigned int uActorID, unsigned int object_to_face_pid, unsigned int uActionLength, struct AIDirection *a4);
|
414
|
223 static void AI_StandOrBored(unsigned int uActorID, signed int uObjID, int uActionLength, struct AIDirection *a4);
|
322
|
224 static void FaceObject(unsigned int uActorID, unsigned int uObjID, int _48, struct AIDirection *a4);
|
0
|
225 static struct AIDirection *__fastcall GetDirectionInfo(unsigned int uObj1ID, unsigned int uObj2ID, struct AIDirection *pOut, int a4);
|
|
226 static signed int __fastcall Explode(unsigned int uActorID);
|
|
227 static char __fastcall _404874(unsigned int uActorID, struct AIDirection *a2, int a3, char a4);
|
|
228 static void __fastcall _404AC7(unsigned int uActorID, struct AIDirection *pDir, int spellnum, int a4, unsigned int uSkillLevel);
|
322
|
229 static void AggroSurroundingPeasants(unsigned int uActorID, int a2);
|
|
230 static bool ArePeasantsOfSameFaction(Actor *a1, Actor *a2);
|
0
|
231 static bool StealFrom(unsigned int uActorID);
|
|
232 static void GiveItem(unsigned int uActorID, unsigned int uItemID, unsigned int bGive);
|
|
233 static void ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle);
|
322
|
234 static void ApplyFineForKillingPeasant(unsigned int uActorID);
|
0
|
235 static void DrawHealthBar(Actor *a1, struct GUIWindow *a2);
|
|
236 static int _43B3E0_CalcDamage(Actor *a1, signed int a2);
|
322
|
237 static void AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3);
|
0
|
238
|
|
239
|
|
240 char pActorName[32];
|
|
241 unsigned __int16 uNPC_ID;
|
|
242 __int16 field_22;
|
|
243 unsigned int uAttributes;
|
|
244 __int16 sCurrentHP;
|
|
245 char field_2A[2];
|
|
246 struct MonsterInfo pMonsterInfo;
|
|
247 __int16 word_000084_range_attack;
|
|
248 __int16 word_000086_some_monster_id;
|
|
249 unsigned __int16 uActorRadius;
|
|
250 unsigned __int16 uActorHeight;
|
|
251 unsigned __int16 uMovementSpeed;
|
|
252 struct Vec3_short_ vPosition;
|
|
253 struct Vec3_short_ vVelocity;
|
|
254 unsigned __int16 uYawAngle;
|
|
255 unsigned __int16 uPitchAngle;
|
|
256 __int16 uSectorID;
|
|
257 unsigned __int16 uCurrentActionLength;
|
|
258 struct Vec3_short_ vInitialPosition;
|
|
259 struct Vec3_short_ vGuardingPosition;
|
|
260 unsigned __int16 uTetherDistance;
|
|
261 AIState uAIState;
|
|
262 unsigned __int16 uCurrentActionAnimation;
|
|
263 unsigned __int16 uCarriedItemID;
|
|
264 char field_B6;
|
|
265 char field_B7;
|
|
266 unsigned int uCurrentActionTime;
|
|
267 unsigned __int16 pSpriteIDs[8];
|
417
|
268 unsigned __int16 pSoundSampleIDs[4]; // 1 die 3 bored
|
0
|
269 struct SpellBuff pActorBuffs[22];
|
|
270 struct ItemGen array_000234[4];
|
|
271 unsigned int uGroup;
|
|
272 unsigned int uAlly;
|
|
273 struct ActorJob pScheduledJobs[8];
|
|
274 unsigned int uSummonerID;
|
|
275 unsigned int uLastCharacterIDToHit;
|
|
276 int dword_000334_unique_name;
|
|
277 char field_338[12];
|
|
278 };
|
|
279 #pragma pack(pop)
|
|
280
|
|
281
|
|
282
|
|
283
|
|
284
|
|
285
|
|
286 //extern Actor pMonsterInfoUI_Doll;
|
|
287
|
|
288
|
|
289 extern Actor pActors[500];
|
|
290 extern size_t uNumActors; |