Mercurial > mm7
annotate NPC.h @ 1967:05787232b571
Actor::LootActor cleaned up, fixed item looting not working
author | Grumpy7 |
---|---|
date | Fri, 25 Oct 2013 23:09:04 -0700 |
parents | a7eebb6ee7a2 |
children | 10c909eb6766 |
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(); |
164 | |
237 | 165 |
291 | 166 NPCData pNPCData[501]; //0 - 94BCh count from 1 |
167 NPCData pNewNPCData[501]; //94BCh- 12978h count from 1 | |
0 | 168 char *pNPCNames[540][2]; |
291 | 169 NPCProfession pProfessions[59]; //count from 1 |
170 NPCData pAdditionalNPC[100]; | |
171 char *pCatchPhrases[52]; //15CA4h | |
172 char *pNPCUnicNames[500]; //from first batch | |
173 NPCProfessionChance pProfessionChance[77]; //16544h profession chance in each area | |
0 | 174 int field_17884; |
175 int field_17888; | |
176 NPCGreeting pNPCGreetings[205]; | |
177 unsigned __int16 pGroups[51]; | |
178 unsigned __int16 pGroups_copy[51]; | |
291 | 179 unsigned int uNewlNPCBufPos; |
0 | 180 unsigned int uNumNewNPCs; |
181 int field_17FC8; | |
182 unsigned int uNumNPCProfessions; | |
291 | 183 unsigned int uNumNPCNames[2]; //0 male 1 female |
0 | 184 char *pNPCDataTXT_Raw; |
185 char *pNPCNamesTXT_Raw; | |
186 char *pNPCProfTXT_Raw; | |
187 char *pNPCNewsTXT_Raw; | |
188 char *pNPCTopicTXT_Raw; | |
189 char *pNPCTextTXT_Raw; | |
190 char *pNPCDistTXT_Raw; | |
191 char *pNPCGreetTXT_Raw; | |
192 char *pNCPGroupTXT_Raw; | |
193 }; | |
194 #pragma pack(pop) | |
195 | |
629 | 196 extern int pDialogueNPCCount; |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1113
diff
changeset
|
197 extern std::array<struct Texture *, 6> pDialogueNPCPortraits; |
629 | 198 extern int uNumDialogueNPCPortraits; // weak |
199 extern struct NPCStats *pNPCStats; | |
200 | |
253 | 201 bool PartyHasDragon(); |
251 | 202 bool CheckHiredNPCSpeciality(unsigned int uProfession); |
1413 | 203 |
204 int UseNPCSkill(NPCProf profession); |