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,
|
848
|
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 /* 264 */
|
|
72 enum AIState : unsigned __int16
|
|
73 {
|
|
74 Standing = 0x0,
|
|
75 Tethered = 0x1,
|
|
76 AttackingMelee = 0x2,
|
|
77 AttackingRanged1 = 0x3,
|
|
78 Dying = 0x4,
|
|
79 Dead = 0x5,
|
|
80 Pursuing = 0x6,
|
|
81 Fleeing = 0x7,
|
|
82 Stunned = 0x8,
|
|
83 Fidgeting = 0x9,
|
142
|
84 Interacting = 10,
|
|
85 Removed = 11,
|
0
|
86 AttackingRanged2 = 0xC,
|
|
87 AttackingRanged3 = 0xD,
|
|
88 Stoned = 0xE,
|
|
89 Paralyzed = 0xF,
|
142
|
90 Resurrected = 16,
|
141
|
91 Summoned = 17,
|
142
|
92 AttackingRanged4 = 18,
|
|
93 Disabled = 19,
|
0
|
94 };
|
|
95
|
|
96 /* 265 */
|
|
97 enum ActorAnimation : __int32
|
|
98 {
|
|
99 ANIM_Standing = 0x0,
|
|
100 ANIM_Walking = 0x1,
|
|
101 ANIM_AtkMelee = 0x2,
|
|
102 ANIM_AtkRanged = 0x3,
|
|
103 ANIM_GotHit = 0x4,
|
|
104 ANIM_Dying = 0x5,
|
|
105 ANIM_Dead = 0x6,
|
|
106 ANIM_Bored = 0x7,
|
|
107 };
|
|
108
|
|
109
|
|
110
|
|
111
|
|
112
|
|
113 /* 247 */
|
|
114 #pragma pack(push, 1)
|
|
115 struct AIDirection
|
|
116 {
|
|
117 Vec3_int_ vDirection;
|
|
118 unsigned int uDistance;
|
|
119 unsigned int uDistanceXZ;
|
|
120 unsigned int uYawAngle;
|
|
121 unsigned int uPitchAngle;
|
|
122 };
|
|
123 #pragma pack(pop)
|
|
124
|
|
125
|
|
126
|
|
127
|
|
128
|
|
129 /* 71 */
|
|
130 #pragma pack(push, 1)
|
|
131 struct ActorJob
|
|
132 {
|
|
133 struct Vec3_short_ vPos;
|
|
134 unsigned __int16 uAttributes;
|
|
135 unsigned __int8 uAction;
|
|
136 unsigned __int8 uHour;
|
|
137 unsigned __int8 uDay;
|
|
138 unsigned __int8 uMonth;
|
|
139 };
|
|
140 #pragma pack(pop)
|
|
141
|
|
142
|
|
143 /* 66 */
|
|
144 #pragma pack(push, 1)
|
|
145 struct Actor
|
|
146 {
|
|
147 //----- (0041F4C1) --------------------------------------------------------
|
|
148 inline Actor()
|
|
149 {
|
|
150 Actor *v1; // esi@1
|
|
151 SpellBuff *v2; // eax@1
|
|
152 signed int v3; // edx@1
|
|
153 ItemGen *v4; // edi@3
|
|
154 signed int v5; // ebx@3
|
|
155
|
|
156 v1 = this;
|
|
157 v2 = this->pActorBuffs;
|
|
158 v3 = 22;
|
|
159 do
|
|
160 {
|
|
161 v2->uSkill = 0;
|
|
162 v2->uPower = 0;
|
|
163 v2->uExpireTime = 0;
|
|
164 v2->uCaster = 0;
|
|
165 v2->uFlags = 0;
|
|
166 ++v2;
|
|
167 --v3;
|
|
168 }
|
|
169 while ( v3 );
|
|
170 v4 = this->array_000234;
|
|
171 v5 = 4;
|
|
172 do
|
|
173 {
|
|
174 v4->Reset();
|
|
175 ++v4;
|
|
176 --v5;
|
|
177 }
|
|
178 while ( v5 );
|
|
179 Reset();
|
|
180 }
|
|
181
|
|
182 int _44FD29(int a2);
|
|
183 void Reset();
|
|
184 void Remove();
|
|
185 void PrepareSprites(char load_sounds_if_bit1_set);
|
322
|
186 void UpdateAnimation();
|
0
|
187 signed int GetActorsRelation(Actor *a2);
|
|
188 void SetRandomGoldIfTheresNoItem();
|
|
189 bool CanAct();
|
303
|
190 bool IsNotAlive();
|
0
|
191 void InitializeDialogue(int bPlayerSaysHello);
|
322
|
192 bool IsPeasant();
|
0
|
193
|
|
194
|
417
|
195 static void _SelectTarget(unsigned int uActorID, int *a2, bool can_target_party);
|
322
|
196 static void _402686(unsigned int uActorID, unsigned int a2, signed int uActionLength, struct AIDirection *a4);
|
|
197 static void _40281C(unsigned int uActorID, unsigned int a2, signed int uActionLength, struct AIDirection *pDir, int a5);
|
|
198 static void _402968(unsigned int uActorID, signed int edx0, int uActionLength, struct AIDirection *a4);
|
|
199 static void _402AD7(unsigned int uActorID, unsigned int a2, signed int arg0, signed int uActionLength, struct AIDirection *pDir);
|
|
200 static void PlaySound(unsigned int uActorID, unsigned int uSoundID);
|
319
|
201 static void Die(unsigned int uActorID);
|
322
|
202 static void Resurrect(unsigned int uActorID);
|
414
|
203 static void AI_Bored(unsigned int uActorID, unsigned int uObjID, struct AIDirection *a4);
|
322
|
204 static void _4030AD(unsigned int uActorID, signed int edx0, int arg0);
|
0
|
205 static char __fastcall _4031C1_update_job(unsigned int uActorID, signed int a2, int a3);
|
322
|
206 static void _4032B2(unsigned int a1, unsigned int a2, int a3, int uActionLength);
|
848
|
207 static void _403476(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir);
|
|
208 static void _40368B(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir);
|
|
209 static void _403854(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir);
|
|
210 static void _403A60(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir);
|
|
211 static void _403C6C(unsigned int uActorID, signed int sTargetPid, struct AIDirection *arg0);
|
0
|
212 static void __fastcall StandAwhile(unsigned int uActorID);
|
413
|
213 static void AI_Stand(unsigned int uActorID, unsigned int object_to_face_pid, unsigned int uActionLength, struct AIDirection *a4);
|
414
|
214 static void AI_StandOrBored(unsigned int uActorID, signed int uObjID, int uActionLength, struct AIDirection *a4);
|
322
|
215 static void FaceObject(unsigned int uActorID, unsigned int uObjID, int _48, struct AIDirection *a4);
|
0
|
216 static struct AIDirection *__fastcall GetDirectionInfo(unsigned int uObj1ID, unsigned int uObj2ID, struct AIDirection *pOut, int a4);
|
|
217 static signed int __fastcall Explode(unsigned int uActorID);
|
|
218 static char __fastcall _404874(unsigned int uActorID, struct AIDirection *a2, int a3, char a4);
|
|
219 static void __fastcall _404AC7(unsigned int uActorID, struct AIDirection *pDir, int spellnum, int a4, unsigned int uSkillLevel);
|
322
|
220 static void AggroSurroundingPeasants(unsigned int uActorID, int a2);
|
|
221 static bool ArePeasantsOfSameFaction(Actor *a1, Actor *a2);
|
0
|
222 static bool StealFrom(unsigned int uActorID);
|
526
|
223 static void GiveItem(signed int uActorID, unsigned int uItemID, unsigned int bGive);
|
0
|
224 static void ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle);
|
322
|
225 static void ApplyFineForKillingPeasant(unsigned int uActorID);
|
0
|
226 static void DrawHealthBar(Actor *a1, struct GUIWindow *a2);
|
|
227 static int _43B3E0_CalcDamage(Actor *a1, signed int a2);
|
322
|
228 static void AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3);
|
0
|
229
|
|
230
|
|
231 char pActorName[32];
|
602
|
232 signed __int16 sNPC_ID;
|
0
|
233 __int16 field_22;
|
|
234 unsigned int uAttributes;
|
|
235 __int16 sCurrentHP;
|
|
236 char field_2A[2];
|
|
237 struct MonsterInfo pMonsterInfo;
|
|
238 __int16 word_000084_range_attack;
|
|
239 __int16 word_000086_some_monster_id;
|
|
240 unsigned __int16 uActorRadius;
|
|
241 unsigned __int16 uActorHeight;
|
|
242 unsigned __int16 uMovementSpeed;
|
|
243 struct Vec3_short_ vPosition;
|
|
244 struct Vec3_short_ vVelocity;
|
|
245 unsigned __int16 uYawAngle;
|
|
246 unsigned __int16 uPitchAngle;
|
|
247 __int16 uSectorID;
|
|
248 unsigned __int16 uCurrentActionLength;
|
|
249 struct Vec3_short_ vInitialPosition;
|
|
250 struct Vec3_short_ vGuardingPosition;
|
|
251 unsigned __int16 uTetherDistance;
|
|
252 AIState uAIState;
|
|
253 unsigned __int16 uCurrentActionAnimation;
|
|
254 unsigned __int16 uCarriedItemID;
|
|
255 char field_B6;
|
|
256 char field_B7;
|
|
257 unsigned int uCurrentActionTime;
|
|
258 unsigned __int16 pSpriteIDs[8];
|
417
|
259 unsigned __int16 pSoundSampleIDs[4]; // 1 die 3 bored
|
0
|
260 struct SpellBuff pActorBuffs[22];
|
|
261 struct ItemGen array_000234[4];
|
|
262 unsigned int uGroup;
|
|
263 unsigned int uAlly;
|
|
264 struct ActorJob pScheduledJobs[8];
|
|
265 unsigned int uSummonerID;
|
|
266 unsigned int uLastCharacterIDToHit;
|
|
267 int dword_000334_unique_name;
|
|
268 char field_338[12];
|
|
269 };
|
|
270 #pragma pack(pop)
|
|
271
|
|
272
|
|
273
|
|
274
|
|
275
|
|
276
|
|
277 //extern Actor pMonsterInfoUI_Doll;
|
|
278
|
|
279
|
|
280 extern Actor pActors[500];
|
760
|
281 extern int uNumActors; |