MCPcopy Create free account
hub / github.com/crossuo/crossuo / Load

Method Load

src/Managers/ProfessionManager.cpp:302–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302bool CProfessionManager::Load()
303{
304 bool result = false;
305
306 CProfessionCategory *head = new CProfessionCategory();
307 head->TrueName = "parent";
308 head->Name = "Parent";
309 head->DescriptionIndex = -2;
310 head->Type = PT_CATEGORY;
311 head->Gump = 0x15A9;
312 head->TopLevel = true;
313 Add(head);
314
315 TextFileParser file(g_App.UOFilesPath("Prof.txt"), " \t,", "#;", "\"\"");
316
317 if (!file.IsEOF())
318 {
319 while (!file.IsEOF())
320 {
321 auto strings = file.ReadTokens();
322 if (!strings.empty())
323 {
324 if (str_lower(strings[0]) == astr_t("begin"))
325 {
326 result = ParseFilePart(file);
327
328 if (!result)
329 {
330 break;
331 }
332 }
333 }
334 }
335
336 g_Game.ExecuteGump(0x15A9);
337 g_Game.ExecuteGump(0x15AA);
338
339 CProfession *apc = new CProfession();
340 apc->TrueName = "advanced";
341 apc->Name = "Advanced";
342 apc->Type = PT_PROFESSION;
343 apc->Gump = 0x15A9;
344 apc->DescriptionIndex = -1;
345 apc->SetSkillIndex(0, 0xFF);
346 apc->SetSkillIndex(1, 0xFF);
347 apc->SetSkillIndex(2, 0xFF);
348 apc->SetSkillIndex(3, 0xFF);
349
350 if (g_Config.ProtocolClientVersion >= CV_70160)
351 {
352 apc->Str = 45;
353 apc->Int = 35;
354 apc->Dex = 10;
355
356 apc->SetSkillValue(0, 30);
357 apc->SetSkillValue(1, 30);
358 apc->SetSkillValue(2, 30);
359 apc->SetSkillValue(3, 30);

Callers 1

Calls 10

AddFunction · 0.85
str_lowerFunction · 0.85
UOFilesPathMethod · 0.80
ReadTokensMethod · 0.80
ExecuteGumpMethod · 0.80
SetSkillIndexMethod · 0.80
SetSkillValueMethod · 0.80
IsEOFMethod · 0.45
emptyMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected