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