Mercurial > mm7
annotate NPC.h @ 629:59713bb36033
houses func moved to uihouses
author | Gloval |
---|---|
date | Sun, 10 Mar 2013 20:57:52 +0400 |
parents | 5cfb5dadf330 |
children | 1ff57450f090 |
rev | line source |
---|---|
0 | 1 #pragma once |
2 | |
374 | 3 /* |
4 enum NPCProffession | |
5 { | |
6 Smith 1 | |
7 Armorer 2 | |
8 Alchemist 3 | |
9 Scholar 4 | |
10 Guide 5 | |
11 Tracker 6 | |
12 Pathfinder 7 | |
13 Sailor 8 | |
14 Navigator 9 | |
15 Healer 10 | |
16 Expert Healer 11 | |
17 Master Healer 12 | |
18 Teacher 13 | |
19 Instructor 14 | |
20 Arms Master 15 | |
21 Weapons Master 16 | |
22 Apprentice 17 | |
23 Mystic 18 | |
24 Spell Master 19 | |
25 Trader 20 | |
26 Merchant 21 | |
27 Scout 22 | |
28 Herbalist 23 | |
29 Apothecary 24 | |
30 Tinker 25 | |
31 Locksmith 26 | |
32 Fool 27 | |
33 Chimney Sweep 28 | |
34 Porter 29 | |
35 Quarter Master 30 | |
36 Factor 31 | |
37 Banker 32 | |
38 Cook 33 | |
39 Chef 34 | |
40 Horseman 35 | |
41 Bard 36 | |
42 Enchanter 37 | |
43 Cartographer 38 | |
44 Wind Master 39 | |
45 Water Master 40 | |
46 Gate Master 41 | |
47 Acolyte 42 | |
48 Piper 43 | |
49 Explorer 44 | |
50 Pirate 45 | |
51 Squire 46 | |
52 Psychic 47 | |
53 Gypsy 48 | |
54 Diplomat 49 | |
55 Duper 50 | |
56 Burglar 51 | |
57 Fallen Wizard 52 | |
58 Acolyte 53 | |
59 Initiate 54 | |
60 Prelate 55 | |
61 Monk 56 | |
62 Sage 57 | |
63 Hunter 58 | |
64 | |
65 | |
66 }; | |
67 */ | |
68 | |
0 | 69 |
70 struct NPCTopic | |
71 { | |
72 const char *pTopic; | |
73 const char *pText; | |
74 }; | |
75 | |
76 extern NPCTopic pNPCTopics[789]; | |
77 | |
78 | |
79 /* 136 */ | |
80 #pragma pack(push, 1) | |
291 | 81 struct NPCData //4Ch |
0 | 82 { |
248 | 83 inline bool Hired() {return uFlags & 0x80;} |
84 | |
291 | 85 char *pName; //0 |
86 unsigned int uPortraitID; //4 | |
87 unsigned int uFlags; //8 // & 0x80 no greeting on dialogue start; looks like hired | |
88 int fame; //c | |
89 int rep; //10 | |
90 unsigned int Location2D; //14 | |
353 | 91 unsigned int uProfession; //18 CheckHiredNPCSpeciality(uProfession) |
92 /* | |
93 | |
437 | 94 v0 = uDefaultTravelTime_ByFoot; |
95 if ( CheckHiredNPCSpeciality(5u) ) | |
96 --v0; | |
97 if ( CheckHiredNPCSpeciality(6u) ) | |
98 v0 -= 2; | |
99 if ( CheckHiredNPCSpeciality(7u) ) | |
100 v0 -= 3; | |
101 if ( CheckHiredNPCSpeciality(0x2Cu) ) | |
102 --v0; | |
103 | |
104 | |
353 | 105 case PLAYER_SKILL_MONSTER_ID: |
106 if ( CheckHiredNPCSpeciality(58) ) | |
107 skill += 6; | |
108 if ( CheckHiredNPCSpeciality(57) ) | |
109 skill += 6; | |
110 | |
111 case PLAYER_SKILL_ARMSMASTER: | |
112 if ( CheckHiredNPCSpeciality(15) ) | |
113 skill += 2; | |
114 if ( CheckHiredNPCSpeciality(16) ) | |
115 skill += 3; | |
116 | |
117 case PLAYER_SKILL_STEALING: | |
118 if (CheckHiredNPCSpeciality(51)) | |
119 skill += | |
120 | |
121 case PLAYER_SKILL_ALCHEMY: | |
122 if ( CheckHiredNPCSpeciality(23) ) | |
123 skill += 4; | |
124 if ( CheckHiredNPCSpeciality(24) ) | |
125 skill += 8 | |
126 | |
127 case PLAYER_SKILL_LEARNING: | |
128 if ( CheckHiredNPCSpeciality(13) ) | |
129 skill += 10; | |
130 if ( CheckHiredNPCSpeciality(14) ) | |
131 skill += 15; | |
132 if ( CheckHiredNPCSpeciality(4) ) | |
133 skill += 5; | |
134 | |
135 case PLAYER_SKILL_UNARMED: | |
136 if (CheckHiredNPCSpeciality(56) ) | |
137 skill + | |
138 | |
139 case PLAYER_SKILL_DODGE: | |
140 if ( CheckHiredNPCSpeciality(56) ) | |
141 skill+ | |
142 | |
143 case PLAYER_SKILL_MERCHANT: | |
144 if ( CheckHiredNPCSpeciality(20) ) | |
145 skill += 4; | |
146 if ( CheckHiredNPCSpeciality(21) ) | |
147 skill += 6; | |
148 if ( CheckHiredNPCSpeciality(48) ) | |
149 skill += 3; | |
150 if ( CheckHiredNPCSpeciality(50) ) | |
151 skill += 8; | |
152 | |
153 case PLAYER_SKILL_PERCEPTION: | |
154 if ( CheckHiredNPCSpeciality(22) ) | |
155 v2 = 6; | |
156 if ( CheckHiredNPCSpeciality(47) ) | |
157 v2 += 5; | |
158 | |
159 case PLAYER_SKILL_TRAP_DISARM: | |
160 if ( CheckHiredNPCSpeciality(25) ) | |
161 v2 = 4; | |
162 if ( CheckHiredNPCSpeciality(26) ) | |
163 v2 += 6; | |
164 if ( CheckHiredNPCSpeciality(51) ) | |
165 v2 += 8; | |
166 | |
167 FIRE WATER EARTH AIR | |
168 if ( CheckHiredNPCSpeciality(17) ) | |
169 v2 = 2; | |
170 if ( CheckHiredNPCSpeciality(18) ) | |
171 v2 += 3; | |
172 if ( CheckHiredNPCSpeciality(19) ) | |
173 v2 += 4; | |
174 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) | |
175 v2 += 3; | |
176 | |
177 SPIRIT MIND BODY | |
178 if ( CheckHiredNPCSpeciality(53) ) | |
179 v2 = 2; | |
180 if ( CheckHiredNPCSpeciality(54) ) | |
181 v2 += 3; | |
182 if ( CheckHiredNPCSpeciality(55) ) | |
183 v2 += 4; | |
184 */ | |
291 | 185 int greet; //1c |
186 int joins; //20 | |
0 | 187 int field_24; |
291 | 188 unsigned int evt_A; //28 |
189 unsigned int evt_B; //2c evtb | |
190 unsigned int evt_C; // 30 evtc | |
191 unsigned int evt_D; //34 | |
192 unsigned int evt_E; //38 | |
193 unsigned int evt_F; //3c | |
194 unsigned int uSex; //40 | |
195 int bHasUsedTheAbility; //44 | |
196 int news_topic; //48 | |
0 | 197 }; |
198 #pragma pack(pop) | |
199 | |
200 | |
201 /* 138 */ | |
202 #pragma pack(push, 1) | |
203 struct NPCProfession | |
204 { | |
618
5cfb5dadf330
Margareth righ-click (addded constructor to NPCProfession) and cleaned BLV debug logs
Nomad
parents:
437
diff
changeset
|
205 inline NPCProfession(): |
5cfb5dadf330
Margareth righ-click (addded constructor to NPCProfession) and cleaned BLV debug logs
Nomad
parents:
437
diff
changeset
|
206 uHirePrice(0), pBenefits(nullptr), pActionText(nullptr), pJoinText(nullptr), pDismissText(nullptr) |
5cfb5dadf330
Margareth righ-click (addded constructor to NPCProfession) and cleaned BLV debug logs
Nomad
parents:
437
diff
changeset
|
207 {} |
5cfb5dadf330
Margareth righ-click (addded constructor to NPCProfession) and cleaned BLV debug logs
Nomad
parents:
437
diff
changeset
|
208 |
0 | 209 unsigned int uHirePrice; |
210 char *pBenefits; | |
211 char *pActionText; | |
212 char *pJoinText; | |
213 char *pDismissText; | |
214 }; | |
215 #pragma pack(pop) | |
216 | |
217 | |
218 /* 139 */ | |
219 #pragma pack(push, 1) | |
291 | 220 struct NPCProfessionChance |
0 | 221 { |
291 | 222 unsigned int uTotalprofChance; //summ |
223 char professionChancePerArea[60]; //prof position | |
0 | 224 }; |
225 #pragma pack(pop) | |
226 | |
227 /* 140 */ | |
228 #pragma pack(push, 1) | |
229 struct NPCGreeting | |
230 { | |
377 | 231 char *pGreeting1; //at first meet |
232 char *pGreeting2; // at latest meets | |
0 | 233 }; |
234 #pragma pack(pop) | |
235 | |
236 | |
237 /* 137 */ | |
238 #pragma pack(push, 1) | |
239 struct NPCStats | |
240 { | |
241 inline NPCStats(): | |
242 pNPCTextTXT_Raw(nullptr), pNPCTopicTXT_Raw(nullptr), pNPCDistTXT_Raw(nullptr) | |
243 { | |
244 uNumNPCNames[0] = uNumNPCNames[1] = 0; | |
245 } | |
246 | |
291 | 247 void InitializeNPCText(); |
248 void InitializeNPCData(); | |
0 | 249 void Initialize(); |
250 void Release(); | |
291 | 251 void InitializeAdditionalNPCs(NPCData *pNPCDataBuff, int npc_uid, int uLocation2D, int uMapId); |
0 | 252 void _476C60(); |
253 | |
237 | 254 |
291 | 255 NPCData pNPCData[501]; //0 - 94BCh count from 1 |
256 NPCData pNewNPCData[501]; //94BCh- 12978h count from 1 | |
0 | 257 char *pNPCNames[540][2]; |
291 | 258 NPCProfession pProfessions[59]; //count from 1 |
259 NPCData pAdditionalNPC[100]; | |
260 char *pCatchPhrases[52]; //15CA4h | |
261 char *pNPCUnicNames[500]; //from first batch | |
262 NPCProfessionChance pProfessionChance[77]; //16544h profession chance in each area | |
0 | 263 int field_17884; |
264 int field_17888; | |
265 NPCGreeting pNPCGreetings[205]; | |
266 unsigned __int16 pGroups[51]; | |
267 unsigned __int16 pGroups_copy[51]; | |
291 | 268 unsigned int uNewlNPCBufPos; |
0 | 269 unsigned int uNumNewNPCs; |
270 int field_17FC8; | |
271 unsigned int uNumNPCProfessions; | |
291 | 272 unsigned int uNumNPCNames[2]; //0 male 1 female |
0 | 273 char *pNPCDataTXT_Raw; |
274 char *pNPCNamesTXT_Raw; | |
275 char *pNPCProfTXT_Raw; | |
276 char *pNPCNewsTXT_Raw; | |
277 char *pNPCTopicTXT_Raw; | |
278 char *pNPCTextTXT_Raw; | |
279 char *pNPCDistTXT_Raw; | |
280 char *pNPCGreetTXT_Raw; | |
281 char *pNCPGroupTXT_Raw; | |
282 }; | |
283 #pragma pack(pop) | |
284 | |
629 | 285 extern int pDialogueNPCCount; |
286 extern struct Texture *pDialogueNPCPortraits[6]; | |
287 extern int uNumDialogueNPCPortraits; // weak | |
288 extern struct NPCStats *pNPCStats; | |
289 | |
253 | 290 bool PartyHasDragon(); |
251 | 291 bool CheckHiredNPCSpeciality(unsigned int uProfession); |