Mercurial > mm7
annotate NPC.h @ 1113:39eaa6b00141
something to bool cast (performance warning) mostly fixed
author | Grumpy7 |
---|---|
date | Tue, 28 May 2013 00:19:45 +0200 |
parents | 1ff57450f090 |
children | ab6560001f5b |
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 | |
73 extern NPCTopic pNPCTopics[789]; | |
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 { | |
377 | 135 char *pGreeting1; //at first meet |
136 char *pGreeting2; // at latest meets | |
0 | 137 }; |
138 #pragma pack(pop) | |
139 | |
140 | |
141 /* 137 */ | |
142 #pragma pack(push, 1) | |
143 struct NPCStats | |
144 { | |
145 inline NPCStats(): | |
146 pNPCTextTXT_Raw(nullptr), pNPCTopicTXT_Raw(nullptr), pNPCDistTXT_Raw(nullptr) | |
147 { | |
148 uNumNPCNames[0] = uNumNPCNames[1] = 0; | |
149 } | |
150 | |
291 | 151 void InitializeNPCText(); |
152 void InitializeNPCData(); | |
0 | 153 void Initialize(); |
154 void Release(); | |
291 | 155 void InitializeAdditionalNPCs(NPCData *pNPCDataBuff, int npc_uid, int uLocation2D, int uMapId); |
0 | 156 void _476C60(); |
157 | |
237 | 158 |
291 | 159 NPCData pNPCData[501]; //0 - 94BCh count from 1 |
160 NPCData pNewNPCData[501]; //94BCh- 12978h count from 1 | |
0 | 161 char *pNPCNames[540][2]; |
291 | 162 NPCProfession pProfessions[59]; //count from 1 |
163 NPCData pAdditionalNPC[100]; | |
164 char *pCatchPhrases[52]; //15CA4h | |
165 char *pNPCUnicNames[500]; //from first batch | |
166 NPCProfessionChance pProfessionChance[77]; //16544h profession chance in each area | |
0 | 167 int field_17884; |
168 int field_17888; | |
169 NPCGreeting pNPCGreetings[205]; | |
170 unsigned __int16 pGroups[51]; | |
171 unsigned __int16 pGroups_copy[51]; | |
291 | 172 unsigned int uNewlNPCBufPos; |
0 | 173 unsigned int uNumNewNPCs; |
174 int field_17FC8; | |
175 unsigned int uNumNPCProfessions; | |
291 | 176 unsigned int uNumNPCNames[2]; //0 male 1 female |
0 | 177 char *pNPCDataTXT_Raw; |
178 char *pNPCNamesTXT_Raw; | |
179 char *pNPCProfTXT_Raw; | |
180 char *pNPCNewsTXT_Raw; | |
181 char *pNPCTopicTXT_Raw; | |
182 char *pNPCTextTXT_Raw; | |
183 char *pNPCDistTXT_Raw; | |
184 char *pNPCGreetTXT_Raw; | |
185 char *pNCPGroupTXT_Raw; | |
186 }; | |
187 #pragma pack(pop) | |
188 | |
629 | 189 extern int pDialogueNPCCount; |
190 extern struct Texture *pDialogueNPCPortraits[6]; | |
191 extern int uNumDialogueNPCPortraits; // weak | |
192 extern struct NPCStats *pNPCStats; | |
193 | |
253 | 194 bool PartyHasDragon(); |
251 | 195 bool CheckHiredNPCSpeciality(unsigned int uProfession); |