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