annotate NPC.h @ 353:95be2dcecadf

Partial refactor for Player::GetActualSkillLevel
author Nomad
date Thu, 21 Feb 2013 03:49:33 +0200
parents 0ea5fbd16edb
children f0f66f690777
rev   line source
0
Ritor1
parents:
diff changeset
1 #pragma once
Ritor1
parents:
diff changeset
2
Ritor1
parents:
diff changeset
3
Ritor1
parents:
diff changeset
4 struct NPCTopic
Ritor1
parents:
diff changeset
5 {
Ritor1
parents:
diff changeset
6 const char *pTopic;
Ritor1
parents:
diff changeset
7 const char *pText;
Ritor1
parents:
diff changeset
8 };
Ritor1
parents:
diff changeset
9
Ritor1
parents:
diff changeset
10 extern NPCTopic pNPCTopics[789];
Ritor1
parents:
diff changeset
11
Ritor1
parents:
diff changeset
12
Ritor1
parents:
diff changeset
13 /* 136 */
Ritor1
parents:
diff changeset
14 #pragma pack(push, 1)
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
15 struct NPCData //4Ch
0
Ritor1
parents:
diff changeset
16 {
248
37dcbe8f3cca Dialogue stuff
Nomad
parents: 237
diff changeset
17 inline bool Hired() {return uFlags & 0x80;}
37dcbe8f3cca Dialogue stuff
Nomad
parents: 237
diff changeset
18
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
19 char *pName; //0
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
20 unsigned int uPortraitID; //4
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
21 unsigned int uFlags; //8 // & 0x80 no greeting on dialogue start; looks like hired
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
22 int fame; //c
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
23 int rep; //10
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
24 unsigned int Location2D; //14
353
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
25 unsigned int uProfession; //18 CheckHiredNPCSpeciality(uProfession)
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
26 /*
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
27
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
28 case PLAYER_SKILL_MONSTER_ID:
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
29 if ( CheckHiredNPCSpeciality(58) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
30 skill += 6;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
31 if ( CheckHiredNPCSpeciality(57) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
32 skill += 6;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
33
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
34 case PLAYER_SKILL_ARMSMASTER:
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
35 if ( CheckHiredNPCSpeciality(15) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
36 skill += 2;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
37 if ( CheckHiredNPCSpeciality(16) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
38 skill += 3;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
39
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
40 case PLAYER_SKILL_STEALING:
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
41 if (CheckHiredNPCSpeciality(51))
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
42 skill +=
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
43
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
44 case PLAYER_SKILL_ALCHEMY:
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
45 if ( CheckHiredNPCSpeciality(23) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
46 skill += 4;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
47 if ( CheckHiredNPCSpeciality(24) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
48 skill += 8
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
49
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
50 case PLAYER_SKILL_LEARNING:
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
51 if ( CheckHiredNPCSpeciality(13) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
52 skill += 10;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
53 if ( CheckHiredNPCSpeciality(14) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
54 skill += 15;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
55 if ( CheckHiredNPCSpeciality(4) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
56 skill += 5;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
57
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
58 case PLAYER_SKILL_UNARMED:
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
59 if (CheckHiredNPCSpeciality(56) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
60 skill +
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
61
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
62 case PLAYER_SKILL_DODGE:
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
63 if ( CheckHiredNPCSpeciality(56) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
64 skill+
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
65
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
66 case PLAYER_SKILL_MERCHANT:
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
67 if ( CheckHiredNPCSpeciality(20) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
68 skill += 4;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
69 if ( CheckHiredNPCSpeciality(21) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
70 skill += 6;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
71 if ( CheckHiredNPCSpeciality(48) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
72 skill += 3;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
73 if ( CheckHiredNPCSpeciality(50) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
74 skill += 8;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
75
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
76 case PLAYER_SKILL_PERCEPTION:
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
77 if ( CheckHiredNPCSpeciality(22) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
78 v2 = 6;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
79 if ( CheckHiredNPCSpeciality(47) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
80 v2 += 5;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
81
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
82 case PLAYER_SKILL_TRAP_DISARM:
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
83 if ( CheckHiredNPCSpeciality(25) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
84 v2 = 4;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
85 if ( CheckHiredNPCSpeciality(26) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
86 v2 += 6;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
87 if ( CheckHiredNPCSpeciality(51) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
88 v2 += 8;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
89
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
90 FIRE WATER EARTH AIR
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
91 if ( CheckHiredNPCSpeciality(17) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
92 v2 = 2;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
93 if ( CheckHiredNPCSpeciality(18) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
94 v2 += 3;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
95 if ( CheckHiredNPCSpeciality(19) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
96 v2 += 4;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
97 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
98 v2 += 3;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
99
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
100 SPIRIT MIND BODY
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
101 if ( CheckHiredNPCSpeciality(53) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
102 v2 = 2;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
103 if ( CheckHiredNPCSpeciality(54) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
104 v2 += 3;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
105 if ( CheckHiredNPCSpeciality(55) )
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
106 v2 += 4;
95be2dcecadf Partial refactor for Player::GetActualSkillLevel
Nomad
parents: 291
diff changeset
107 */
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
108 int greet; //1c
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
109 int joins; //20
0
Ritor1
parents:
diff changeset
110 int field_24;
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
111 unsigned int evt_A; //28
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
112 unsigned int evt_B; //2c evtb
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
113 unsigned int evt_C; // 30 evtc
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
114 unsigned int evt_D; //34
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
115 unsigned int evt_E; //38
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
116 unsigned int evt_F; //3c
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
117 unsigned int uSex; //40
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
118 int bHasUsedTheAbility; //44
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
119 int news_topic; //48
0
Ritor1
parents:
diff changeset
120 };
Ritor1
parents:
diff changeset
121 #pragma pack(pop)
Ritor1
parents:
diff changeset
122
Ritor1
parents:
diff changeset
123
Ritor1
parents:
diff changeset
124 /* 138 */
Ritor1
parents:
diff changeset
125 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
126 struct NPCProfession
Ritor1
parents:
diff changeset
127 {
Ritor1
parents:
diff changeset
128 unsigned int uHirePrice;
Ritor1
parents:
diff changeset
129 char *pBenefits;
Ritor1
parents:
diff changeset
130 char *pActionText;
Ritor1
parents:
diff changeset
131 char *pJoinText;
Ritor1
parents:
diff changeset
132 char *pDismissText;
Ritor1
parents:
diff changeset
133 };
Ritor1
parents:
diff changeset
134 #pragma pack(pop)
Ritor1
parents:
diff changeset
135
Ritor1
parents:
diff changeset
136
Ritor1
parents:
diff changeset
137 /* 139 */
Ritor1
parents:
diff changeset
138 #pragma pack(push, 1)
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
139 struct NPCProfessionChance
0
Ritor1
parents:
diff changeset
140 {
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
141 unsigned int uTotalprofChance; //summ
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
142 char professionChancePerArea[60]; //prof position
0
Ritor1
parents:
diff changeset
143 };
Ritor1
parents:
diff changeset
144 #pragma pack(pop)
Ritor1
parents:
diff changeset
145
Ritor1
parents:
diff changeset
146 /* 140 */
Ritor1
parents:
diff changeset
147 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
148 struct NPCGreeting
Ritor1
parents:
diff changeset
149 {
Ritor1
parents:
diff changeset
150 char *pGreeting1;
Ritor1
parents:
diff changeset
151 char *pGreeting2;
Ritor1
parents:
diff changeset
152 };
Ritor1
parents:
diff changeset
153 #pragma pack(pop)
Ritor1
parents:
diff changeset
154
Ritor1
parents:
diff changeset
155
Ritor1
parents:
diff changeset
156 /* 137 */
Ritor1
parents:
diff changeset
157 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
158 struct NPCStats
Ritor1
parents:
diff changeset
159 {
Ritor1
parents:
diff changeset
160 inline NPCStats():
Ritor1
parents:
diff changeset
161 pNPCTextTXT_Raw(nullptr), pNPCTopicTXT_Raw(nullptr), pNPCDistTXT_Raw(nullptr)
Ritor1
parents:
diff changeset
162 {
Ritor1
parents:
diff changeset
163 uNumNPCNames[0] = uNumNPCNames[1] = 0;
Ritor1
parents:
diff changeset
164 }
Ritor1
parents:
diff changeset
165
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
166 void InitializeNPCText();
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
167 void InitializeNPCData();
0
Ritor1
parents:
diff changeset
168 void Initialize();
Ritor1
parents:
diff changeset
169 void Release();
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
170 void InitializeAdditionalNPCs(NPCData *pNPCDataBuff, int npc_uid, int uLocation2D, int uMapId);
0
Ritor1
parents:
diff changeset
171 void _476C60();
Ritor1
parents:
diff changeset
172
237
2799737f8a74 more text parsers refactor
Gloval
parents: 188
diff changeset
173
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
174 NPCData pNPCData[501]; //0 - 94BCh count from 1
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
175 NPCData pNewNPCData[501]; //94BCh- 12978h count from 1
0
Ritor1
parents:
diff changeset
176 char *pNPCNames[540][2];
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
177 NPCProfession pProfessions[59]; //count from 1
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
178 NPCData pAdditionalNPC[100];
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
179 char *pCatchPhrases[52]; //15CA4h
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
180 char *pNPCUnicNames[500]; //from first batch
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
181 NPCProfessionChance pProfessionChance[77]; //16544h profession chance in each area
0
Ritor1
parents:
diff changeset
182 int field_17884;
Ritor1
parents:
diff changeset
183 int field_17888;
Ritor1
parents:
diff changeset
184 NPCGreeting pNPCGreetings[205];
Ritor1
parents:
diff changeset
185 unsigned __int16 pGroups[51];
Ritor1
parents:
diff changeset
186 unsigned __int16 pGroups_copy[51];
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
187 unsigned int uNewlNPCBufPos;
0
Ritor1
parents:
diff changeset
188 unsigned int uNumNewNPCs;
Ritor1
parents:
diff changeset
189 int field_17FC8;
Ritor1
parents:
diff changeset
190 unsigned int uNumNPCProfessions;
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 253
diff changeset
191 unsigned int uNumNPCNames[2]; //0 male 1 female
0
Ritor1
parents:
diff changeset
192 char *pNPCDataTXT_Raw;
Ritor1
parents:
diff changeset
193 char *pNPCNamesTXT_Raw;
Ritor1
parents:
diff changeset
194 char *pNPCProfTXT_Raw;
Ritor1
parents:
diff changeset
195 char *pNPCNewsTXT_Raw;
Ritor1
parents:
diff changeset
196 char *pNPCTopicTXT_Raw;
Ritor1
parents:
diff changeset
197 char *pNPCTextTXT_Raw;
Ritor1
parents:
diff changeset
198 char *pNPCDistTXT_Raw;
Ritor1
parents:
diff changeset
199 char *pNPCGreetTXT_Raw;
Ritor1
parents:
diff changeset
200 char *pNCPGroupTXT_Raw;
Ritor1
parents:
diff changeset
201 };
Ritor1
parents:
diff changeset
202 #pragma pack(pop)
Ritor1
parents:
diff changeset
203
253
Gloval
parents: 252
diff changeset
204 bool PartyHasDragon();
251
48f21f569328 Npc related stuff separated
Gloval
parents: 237
diff changeset
205 bool CheckHiredNPCSpeciality(unsigned int uProfession);