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);
|
|
17 bool special_ability_use_check(struct Actor *pActor, int a2);
|
|
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();
|
0
|
190 void InitializeDialogue(int bPlayerSaysHello);
|
322
|
191 bool IsPeasant();
|
0
|
192
|
|
193
|
417
|
194 static void _SelectTarget(unsigned int uActorID, int *a2, bool can_target_party);
|
860
|
195 static void Pursue3(unsigned int uActorID, unsigned int a2, signed int uActionLength, struct AIDirection *a4);
|
|
196 static void Pursue2(unsigned int uActorID, unsigned int a2, signed int uActionLength, struct AIDirection *pDir, int a5);
|
|
197 static void Flee(unsigned int uActorID, signed int edx0, int uActionLength, struct AIDirection *a4);
|
|
198 static void Pursue1(unsigned int uActorID, unsigned int a2, signed int arg0, signed int uActionLength, struct AIDirection *pDir);
|
322
|
199 static void PlaySound(unsigned int uActorID, unsigned int uSoundID);
|
319
|
200 static void Die(unsigned int uActorID);
|
322
|
201 static void Resurrect(unsigned int uActorID);
|
414
|
202 static void AI_Bored(unsigned int uActorID, unsigned int uObjID, struct AIDirection *a4);
|
861
|
203 static void Stun(unsigned int uActorID, signed int edx0, int arg0);
|
0
|
204 static char __fastcall _4031C1_update_job(unsigned int uActorID, signed int a2, int a3);
|
322
|
205 static void _4032B2(unsigned int a1, unsigned int a2, int a3, int uActionLength);
|
861
|
206 static void MissileAttack1(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir);
|
|
207 static void MissileAttack2(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir);
|
|
208 static void SpellAttack1(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir);
|
|
209 static void SpellAttack2(unsigned int uActorID, signed int sTargetPid, struct AIDirection *pDir);
|
|
210 static void MeleeAttack(unsigned int uActorID, signed int sTargetPid, struct AIDirection *arg0);
|
0
|
211 static void __fastcall StandAwhile(unsigned int uActorID);
|
413
|
212 static void AI_Stand(unsigned int uActorID, unsigned int object_to_face_pid, unsigned int uActionLength, struct AIDirection *a4);
|
414
|
213 static void AI_StandOrBored(unsigned int uActorID, signed int uObjID, int uActionLength, struct AIDirection *a4);
|
322
|
214 static void FaceObject(unsigned int uActorID, unsigned int uObjID, int _48, struct AIDirection *a4);
|
0
|
215 static struct AIDirection *__fastcall GetDirectionInfo(unsigned int uObj1ID, unsigned int uObj2ID, struct AIDirection *pOut, int a4);
|
|
216 static signed int __fastcall Explode(unsigned int uActorID);
|
860
|
217 static char __fastcall RangedAttack(unsigned int uActorID, struct AIDirection *a2, int type, char a4);
|
|
218 static void __fastcall SpellAttack(unsigned int uActorID, struct AIDirection *pDir, int spellnum, int a4, unsigned int uSkillLevel);
|
322
|
219 static void AggroSurroundingPeasants(unsigned int uActorID, int a2);
|
|
220 static bool ArePeasantsOfSameFaction(Actor *a1, Actor *a2);
|
0
|
221 static bool StealFrom(unsigned int uActorID);
|
526
|
222 static void GiveItem(signed int uActorID, unsigned int uItemID, unsigned int bGive);
|
0
|
223 static void ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle);
|
322
|
224 static void ApplyFineForKillingPeasant(unsigned int uActorID);
|
0
|
225 static void DrawHealthBar(Actor *a1, struct GUIWindow *a2);
|
|
226 static int _43B3E0_CalcDamage(Actor *a1, signed int a2);
|
322
|
227 static void AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3);
|
0
|
228
|
|
229
|
|
230 char pActorName[32];
|
602
|
231 signed __int16 sNPC_ID;
|
0
|
232 __int16 field_22;
|
|
233 unsigned int uAttributes;
|
|
234 __int16 sCurrentHP;
|
|
235 char field_2A[2];
|
|
236 struct MonsterInfo pMonsterInfo;
|
|
237 __int16 word_000084_range_attack;
|
|
238 __int16 word_000086_some_monster_id;
|
|
239 unsigned __int16 uActorRadius;
|
|
240 unsigned __int16 uActorHeight;
|
|
241 unsigned __int16 uMovementSpeed;
|
|
242 struct Vec3_short_ vPosition;
|
|
243 struct Vec3_short_ vVelocity;
|
|
244 unsigned __int16 uYawAngle;
|
|
245 unsigned __int16 uPitchAngle;
|
|
246 __int16 uSectorID;
|
|
247 unsigned __int16 uCurrentActionLength;
|
|
248 struct Vec3_short_ vInitialPosition;
|
|
249 struct Vec3_short_ vGuardingPosition;
|
|
250 unsigned __int16 uTetherDistance;
|
|
251 AIState uAIState;
|
|
252 unsigned __int16 uCurrentActionAnimation;
|
|
253 unsigned __int16 uCarriedItemID;
|
|
254 char field_B6;
|
|
255 char field_B7;
|
|
256 unsigned int uCurrentActionTime;
|
|
257 unsigned __int16 pSpriteIDs[8];
|
417
|
258 unsigned __int16 pSoundSampleIDs[4]; // 1 die 3 bored
|
0
|
259 struct SpellBuff pActorBuffs[22];
|
|
260 struct ItemGen array_000234[4];
|
|
261 unsigned int uGroup;
|
|
262 unsigned int uAlly;
|
|
263 struct ActorJob pScheduledJobs[8];
|
|
264 unsigned int uSummonerID;
|
|
265 unsigned int uLastCharacterIDToHit;
|
|
266 int dword_000334_unique_name;
|
|
267 char field_338[12];
|
|
268 };
|
|
269 #pragma pack(pop)
|
|
270
|
|
271
|
|
272
|
|
273
|
|
274
|
|
275
|
|
276 //extern Actor pMonsterInfoUI_Doll;
|
|
277
|
|
278
|
|
279 extern Actor pActors[500];
|
760
|
280 extern int uNumActors; |