Mercurial > mm7
annotate NPC.h @ 2391:5d866ee28376
delete stru176.h for MVS 2010 MMT project
author | Ritor1 |
---|---|
date | Fri, 04 Jul 2014 09:26:25 +0600 |
parents | 13e15d77b0f8 |
children | 0f17a30149ec |
rev | line source |
---|---|
0 | 1 #pragma once |
2 | |
652 | 3 enum NPCProf |
4 { | |
5 Smith = 1, // GM Weapon Repair; | |
6 Armorer = 2, // GM Armor Repair; | |
7 Alchemist = 3, // GM Potion Repair; | |
8 Scholar = 4, // GM Item ID; Learning: +5 | |
9 Guide = 5, // Travel by foot: -1 day; | |
10 Tracker = 6, // Travel by foot: -2 days; | |
11 Pathfinder = 7, // Travel by foot: -3 days; | |
12 Sailor = 8, // Travel by sea: -2 days; | |
13 Navigator = 9, // Travel by sea: -3 days; | |
14 Healer = 10, | |
15 ExpertHealer = 11, | |
16 MasterHealer = 12, | |
17 Teacher = 13, // Learning: +10; | |
18 Instructor = 14, // Learning: +15; | |
19 Armsmaster = 15, // Armsmaster: +2; | |
20 Weaponsmaster = 16, // Armsmaster: +3; | |
21 Apprentice = 17, // Fire: +2; Air: +2; Water: +2; Earth: +2; | |
22 Mystic = 18, // Fire: +3; Air: +3; Water: +3; Earth: +3; | |
23 Spellmaster = 19, // Fire: +4; Air: +4; Water: +4; Earth: +4; | |
24 Trader = 20, // Merchant: +4; | |
25 Merchant = 21, // Merchant: +6; | |
26 Scout = 22, // Perception: +6; | |
27 Herbalist = 23, // Alchemy: +4; | |
28 Apothecary = 24, // Alchemy: +8; | |
29 Tinker = 25, // Traps: +4; | |
30 Locksmith = 26, // Traps: +6; | |
31 Fool = 27, // Luck: +5; | |
32 ChimneySweep = 28, // Luck: +20; | |
33 Porter = 29, // Food for rest: -1; | |
34 QuarterMaster = 30, // Food for rest: -2; | |
35 Factor = 31, // Gold finds: +10%; | |
36 Banker = 32, // Gold finds: +20%; | |
37 Cook = 33, | |
38 Chef = 34, | |
39 Horseman = 35, // Travel by foot: -2 days; | |
40 Bard = 36, | |
41 Enchanter = 37, // Resist All: +20; | |
42 Cartographer = 38, // Wizard Eye level 2; | |
43 WindMaster = 39, | |
44 WaterMaster = 40, | |
45 GateMaster = 41, | |
46 Acolyte = 42, | |
47 Piper = 43, | |
48 Explorer = 44, // Travel by foot -1 day; Travel by sea: -1 day; | |
49 Pirate = 45, // Travel by sea: -2 days; Gold finds: +10%; Reputation: +5; | |
50 Squire = 46, | |
51 Psychic = 47, // Perception: +5; Luck: +10; | |
52 Gypsy = 48, // Food for rest: -1; Merchant: +3; Reputation: +5; | |
53 Diplomat = 49, | |
54 Duper = 50, // Merchant: +8; Reputation: +5; | |
55 Burglar = 51, // Traps: +8; Stealing: +8; Reputation: +5; | |
56 FallenWizard = 52, // Reputation: +5; | |
57 Acolyte2 = 53, // Spirit: +2; Mind: +2; Body: +2; | |
58 Initiate = 54, // Spirit: +3; Mind: +3; Body: +3; | |
59 Prelate = 55, // Spirit: +4; Mind: +4; Body: +4; | |
60 Monk = 56, // Unarmed: +2; Dodge: +2; | |
61 Sage = 57, // Monster ID: +6 | |
62 Hunter = 58 // Monster ID: +6 | |
63 }; | |
374 | 64 |
65 | |
0 | 66 |
67 struct NPCTopic | |
68 { | |
69 const char *pTopic; | |
70 const char *pText; | |
71 }; | |
72 | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1113
diff
changeset
|
73 extern std::array<NPCTopic, 789> pNPCTopics; |
0 | 74 |
75 | |
76 /* 136 */ | |
77 #pragma pack(push, 1) | |
291 | 78 struct NPCData //4Ch |
0 | 79 { |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
652
diff
changeset
|
80 inline bool Hired() {return (uFlags & 0x80) != 0;} |
248 | 81 |
291 | 82 char *pName; //0 |
83 unsigned int uPortraitID; //4 | |
84 unsigned int uFlags; //8 // & 0x80 no greeting on dialogue start; looks like hired | |
85 int fame; //c | |
86 int rep; //10 | |
87 unsigned int Location2D; //14 | |
652 | 88 unsigned int uProfession; //18 |
291 | 89 int greet; //1c |
90 int joins; //20 | |
0 | 91 int field_24; |
291 | 92 unsigned int evt_A; //28 |
93 unsigned int evt_B; //2c evtb | |
94 unsigned int evt_C; // 30 evtc | |
95 unsigned int evt_D; //34 | |
96 unsigned int evt_E; //38 | |
97 unsigned int evt_F; //3c | |
98 unsigned int uSex; //40 | |
99 int bHasUsedTheAbility; //44 | |
100 int news_topic; //48 | |
0 | 101 }; |
102 #pragma pack(pop) | |
103 | |
104 | |
105 /* 138 */ | |
106 #pragma pack(push, 1) | |
107 struct NPCProfession | |
108 { | |
618
5cfb5dadf330
Margareth righ-click (addded constructor to NPCProfession) and cleaned BLV debug logs
Nomad
parents:
437
diff
changeset
|
109 inline NPCProfession(): |
5cfb5dadf330
Margareth righ-click (addded constructor to NPCProfession) and cleaned BLV debug logs
Nomad
parents:
437
diff
changeset
|
110 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
|
111 {} |
5cfb5dadf330
Margareth righ-click (addded constructor to NPCProfession) and cleaned BLV debug logs
Nomad
parents:
437
diff
changeset
|
112 |
0 | 113 unsigned int uHirePrice; |
114 char *pBenefits; | |
115 char *pActionText; | |
116 char *pJoinText; | |
117 char *pDismissText; | |
118 }; | |
119 #pragma pack(pop) | |
120 | |
121 | |
122 /* 139 */ | |
123 #pragma pack(push, 1) | |
291 | 124 struct NPCProfessionChance |
0 | 125 { |
291 | 126 unsigned int uTotalprofChance; //summ |
127 char professionChancePerArea[60]; //prof position | |
0 | 128 }; |
129 #pragma pack(pop) | |
130 | |
131 /* 140 */ | |
132 #pragma pack(push, 1) | |
133 struct NPCGreeting | |
134 { | |
1655 | 135 union |
136 { | |
137 struct | |
138 { | |
139 char *pGreeting1; //at first meet | |
140 char *pGreeting2; // at latest meets | |
141 }; | |
142 char *pGreetings[2]; | |
143 }; | |
0 | 144 }; |
145 #pragma pack(pop) | |
146 | |
147 | |
148 /* 137 */ | |
149 #pragma pack(push, 1) | |
150 struct NPCStats | |
151 { | |
152 inline NPCStats(): | |
153 pNPCTextTXT_Raw(nullptr), pNPCTopicTXT_Raw(nullptr), pNPCDistTXT_Raw(nullptr) | |
154 { | |
155 uNumNPCNames[0] = uNumNPCNames[1] = 0; | |
156 } | |
157 | |
291 | 158 void InitializeNPCText(); |
159 void InitializeNPCData(); | |
0 | 160 void Initialize(); |
161 void Release(); | |
291 | 162 void InitializeAdditionalNPCs(NPCData *pNPCDataBuff, int npc_uid, int uLocation2D, int uMapId); |
0 | 163 void _476C60(); |
2229
10c909eb6766
dword_AE336C to NPCStats::dword_AE336C_LastMispronouncedNameFirstLetter,
Grumpy7
parents:
1655
diff
changeset
|
164 char * sub_495366_MispronounceName(unsigned __int8 firstLetter, unsigned __int8 genderId); |
0 | 165 |
237 | 166 |
291 | 167 NPCData pNPCData[501]; //0 - 94BCh count from 1 |
168 NPCData pNewNPCData[501]; //94BCh- 12978h count from 1 | |
0 | 169 char *pNPCNames[540][2]; |
291 | 170 NPCProfession pProfessions[59]; //count from 1 |
171 NPCData pAdditionalNPC[100]; | |
172 char *pCatchPhrases[52]; //15CA4h | |
173 char *pNPCUnicNames[500]; //from first batch | |
174 NPCProfessionChance pProfessionChance[77]; //16544h profession chance in each area | |
0 | 175 int field_17884; |
176 int field_17888; | |
177 NPCGreeting pNPCGreetings[205]; | |
178 unsigned __int16 pGroups[51]; | |
179 unsigned __int16 pGroups_copy[51]; | |
291 | 180 unsigned int uNewlNPCBufPos; |
0 | 181 unsigned int uNumNewNPCs; |
182 int field_17FC8; | |
183 unsigned int uNumNPCProfessions; | |
291 | 184 unsigned int uNumNPCNames[2]; //0 male 1 female |
0 | 185 char *pNPCDataTXT_Raw; |
186 char *pNPCNamesTXT_Raw; | |
187 char *pNPCProfTXT_Raw; | |
188 char *pNPCNewsTXT_Raw; | |
189 char *pNPCTopicTXT_Raw; | |
190 char *pNPCTextTXT_Raw; | |
191 char *pNPCDistTXT_Raw; | |
192 char *pNPCGreetTXT_Raw; | |
193 char *pNCPGroupTXT_Raw; | |
2229
10c909eb6766
dword_AE336C to NPCStats::dword_AE336C_LastMispronouncedNameFirstLetter,
Grumpy7
parents:
1655
diff
changeset
|
194 |
10c909eb6766
dword_AE336C to NPCStats::dword_AE336C_LastMispronouncedNameFirstLetter,
Grumpy7
parents:
1655
diff
changeset
|
195 static int dword_AE336C_LastMispronouncedNameFirstLetter; |
10c909eb6766
dword_AE336C to NPCStats::dword_AE336C_LastMispronouncedNameFirstLetter,
Grumpy7
parents:
1655
diff
changeset
|
196 static int dword_AE3370_LastMispronouncedNameResult; |
0 | 197 }; |
198 #pragma pack(pop) | |
199 | |
629 | 200 extern int pDialogueNPCCount; |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1113
diff
changeset
|
201 extern std::array<struct Texture *, 6> pDialogueNPCPortraits; |
629 | 202 extern int uNumDialogueNPCPortraits; // weak |
203 extern struct NPCStats *pNPCStats; | |
204 | |
253 | 205 bool PartyHasDragon(); |
251 | 206 bool CheckHiredNPCSpeciality(unsigned int uProfession); |
1413 | 207 |
208 int UseNPCSkill(NPCProf profession); | |
2343 | 209 void __fastcall ClickNPCTopic(signed int uMessageParam); |
210 const char *ContractSelectText(int pEventCode); | |
211 void NPCHireableDialogPrepare(); | |
212 void _4B4224_UpdateNPCTopics(int _this); | |
2344 | 213 const char *GetProfessionActionText(int a1); |
214 struct NPCData *__fastcall GetNPCData(signed int npcid); | |
215 struct NPCData * GetNewNPCData(signed int npcid, int* npc_indx); | |
216 int __fastcall GetGreetType(signed int SpeakingNPC_ID); | |
217 int NPC_EventProcessor(int npc_event_id, int entry_line = 0); |