Mercurial > mm7
changeset 652:1ff57450f090
* Some fixes to TravelByTransport
* Minor bug with npc profession names
* Fixed not loading npc profession decriptions
* NPC professions enum
author | Nomad |
---|---|
date | Tue, 12 Mar 2013 04:45:38 +0200 |
parents | 2bf48d11d742 |
children | 431a8b0c2bf1 2535151505da |
files | Actor.cpp NPC.cpp NPC.h Player.cpp Player.h mm7_1.cpp mm7_3.cpp mm7_4.cpp texts.cpp |
diffstat | 9 files changed, 204 insertions(+), 314 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Tue Mar 12 03:10:35 2013 +0200 +++ b/Actor.cpp Tue Mar 12 04:45:38 2013 +0200 @@ -3883,6 +3883,7 @@ break; case Removed: + case Disabled: return; default:
--- a/NPC.cpp Tue Mar 12 03:10:35 2013 +0200 +++ b/NPC.cpp Tue Mar 12 04:45:38 2013 +0200 @@ -456,6 +456,9 @@ decode_step=0; do { + while (*test_string == '\t') // some steps are separated by multiple \t's + ++test_string; + c = *(unsigned char*)test_string; temp_str_len = 0; while((c!='\t')&&(c>0))
--- a/NPC.h Tue Mar 12 03:10:35 2013 +0200 +++ b/NPC.h Tue Mar 12 04:45:38 2013 +0200 @@ -1,71 +1,68 @@ #pragma once -/* -enum NPCProffession - { - Smith 1 - Armorer 2 - Alchemist 3 - Scholar 4 - Guide 5 - Tracker 6 - Pathfinder 7 - Sailor 8 - Navigator 9 - Healer 10 - Expert Healer 11 - Master Healer 12 - Teacher 13 - Instructor 14 - Arms Master 15 - Weapons Master 16 - Apprentice 17 - Mystic 18 - Spell Master 19 - Trader 20 - Merchant 21 - Scout 22 - Herbalist 23 - Apothecary 24 - Tinker 25 - Locksmith 26 - Fool 27 - Chimney Sweep 28 - Porter 29 - Quarter Master 30 - Factor 31 - Banker 32 - Cook 33 - Chef 34 - Horseman 35 - Bard 36 - Enchanter 37 - Cartographer 38 - Wind Master 39 - Water Master 40 - Gate Master 41 - Acolyte 42 - Piper 43 - Explorer 44 - Pirate 45 - Squire 46 - Psychic 47 - Gypsy 48 - Diplomat 49 - Duper 50 - Burglar 51 - Fallen Wizard 52 - Acolyte 53 - Initiate 54 - Prelate 55 - Monk 56 - Sage 57 - Hunter 58 +enum NPCProf +{ + Smith = 1, // GM Weapon Repair; + Armorer = 2, // GM Armor Repair; + Alchemist = 3, // GM Potion Repair; + Scholar = 4, // GM Item ID; Learning: +5 + Guide = 5, // Travel by foot: -1 day; + Tracker = 6, // Travel by foot: -2 days; + Pathfinder = 7, // Travel by foot: -3 days; + Sailor = 8, // Travel by sea: -2 days; + Navigator = 9, // Travel by sea: -3 days; + Healer = 10, + ExpertHealer = 11, + MasterHealer = 12, + Teacher = 13, // Learning: +10; + Instructor = 14, // Learning: +15; + Armsmaster = 15, // Armsmaster: +2; + Weaponsmaster = 16, // Armsmaster: +3; + Apprentice = 17, // Fire: +2; Air: +2; Water: +2; Earth: +2; + Mystic = 18, // Fire: +3; Air: +3; Water: +3; Earth: +3; + Spellmaster = 19, // Fire: +4; Air: +4; Water: +4; Earth: +4; + Trader = 20, // Merchant: +4; + Merchant = 21, // Merchant: +6; + Scout = 22, // Perception: +6; + Herbalist = 23, // Alchemy: +4; + Apothecary = 24, // Alchemy: +8; + Tinker = 25, // Traps: +4; + Locksmith = 26, // Traps: +6; + Fool = 27, // Luck: +5; + ChimneySweep = 28, // Luck: +20; + Porter = 29, // Food for rest: -1; + QuarterMaster = 30, // Food for rest: -2; + Factor = 31, // Gold finds: +10%; + Banker = 32, // Gold finds: +20%; + Cook = 33, + Chef = 34, + Horseman = 35, // Travel by foot: -2 days; + Bard = 36, + Enchanter = 37, // Resist All: +20; + Cartographer = 38, // Wizard Eye level 2; + WindMaster = 39, + WaterMaster = 40, + GateMaster = 41, + Acolyte = 42, + Piper = 43, + Explorer = 44, // Travel by foot -1 day; Travel by sea: -1 day; + Pirate = 45, // Travel by sea: -2 days; Gold finds: +10%; Reputation: +5; + Squire = 46, + Psychic = 47, // Perception: +5; Luck: +10; + Gypsy = 48, // Food for rest: -1; Merchant: +3; Reputation: +5; + Diplomat = 49, + Duper = 50, // Merchant: +8; Reputation: +5; + Burglar = 51, // Traps: +8; Stealing: +8; Reputation: +5; + FallenWizard = 52, // Reputation: +5; + Acolyte2 = 53, // Spirit: +2; Mind: +2; Body: +2; + Initiate = 54, // Spirit: +3; Mind: +3; Body: +3; + Prelate = 55, // Spirit: +4; Mind: +4; Body: +4; + Monk = 56, // Unarmed: +2; Dodge: +2; + Sage = 57, // Monster ID: +6 + Hunter = 58 // Monster ID: +6 +}; - }; - */ - struct NPCTopic { @@ -88,100 +85,7 @@ int fame; //c int rep; //10 unsigned int Location2D; //14 - unsigned int uProfession; //18 CheckHiredNPCSpeciality(uProfession) - /* - - v0 = uDefaultTravelTime_ByFoot; - if ( CheckHiredNPCSpeciality(5u) ) - --v0; - if ( CheckHiredNPCSpeciality(6u) ) - v0 -= 2; - if ( CheckHiredNPCSpeciality(7u) ) - v0 -= 3; - if ( CheckHiredNPCSpeciality(0x2Cu) ) - --v0; - - - case PLAYER_SKILL_MONSTER_ID: - if ( CheckHiredNPCSpeciality(58) ) - skill += 6; - if ( CheckHiredNPCSpeciality(57) ) - skill += 6; - - case PLAYER_SKILL_ARMSMASTER: - if ( CheckHiredNPCSpeciality(15) ) - skill += 2; - if ( CheckHiredNPCSpeciality(16) ) - skill += 3; - - case PLAYER_SKILL_STEALING: - if (CheckHiredNPCSpeciality(51)) - skill += - - case PLAYER_SKILL_ALCHEMY: - if ( CheckHiredNPCSpeciality(23) ) - skill += 4; - if ( CheckHiredNPCSpeciality(24) ) - skill += 8 - - case PLAYER_SKILL_LEARNING: - if ( CheckHiredNPCSpeciality(13) ) - skill += 10; - if ( CheckHiredNPCSpeciality(14) ) - skill += 15; - if ( CheckHiredNPCSpeciality(4) ) - skill += 5; - - case PLAYER_SKILL_UNARMED: - if (CheckHiredNPCSpeciality(56) ) - skill + - - case PLAYER_SKILL_DODGE: - if ( CheckHiredNPCSpeciality(56) ) - skill+ - - case PLAYER_SKILL_MERCHANT: - if ( CheckHiredNPCSpeciality(20) ) - skill += 4; - if ( CheckHiredNPCSpeciality(21) ) - skill += 6; - if ( CheckHiredNPCSpeciality(48) ) - skill += 3; - if ( CheckHiredNPCSpeciality(50) ) - skill += 8; - - case PLAYER_SKILL_PERCEPTION: - if ( CheckHiredNPCSpeciality(22) ) - v2 = 6; - if ( CheckHiredNPCSpeciality(47) ) - v2 += 5; - - case PLAYER_SKILL_TRAP_DISARM: - if ( CheckHiredNPCSpeciality(25) ) - v2 = 4; - if ( CheckHiredNPCSpeciality(26) ) - v2 += 6; - if ( CheckHiredNPCSpeciality(51) ) - v2 += 8; - - FIRE WATER EARTH AIR - if ( CheckHiredNPCSpeciality(17) ) - v2 = 2; - if ( CheckHiredNPCSpeciality(18) ) - v2 += 3; - if ( CheckHiredNPCSpeciality(19) ) - v2 += 4; - if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) - v2 += 3; - - SPIRIT MIND BODY - if ( CheckHiredNPCSpeciality(53) ) - v2 = 2; - if ( CheckHiredNPCSpeciality(54) ) - v2 += 3; - if ( CheckHiredNPCSpeciality(55) ) - v2 += 4; - */ + unsigned int uProfession; //18 int greet; //1c int joins; //20 int field_24;
--- a/Player.cpp Tue Mar 12 03:10:35 2013 +0200 +++ b/Player.cpp Tue Mar 12 04:45:38 2013 +0200 @@ -1965,6 +1965,9 @@ signed int v6; // ebp@7 char *v7; // esi@7 signed int uSkillMultiplier; // [sp-4h] [bp-14h]@2 + + if (CheckHiredNPCSpeciality(Scholar)) + return true; v2 = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_ITEM_ID); v3 = v2; @@ -1980,11 +1983,7 @@ v5 = uSkillMult * (v3 & 0x3F); v6 = 0; v7 = (char *)&pItemsTable->pItems[pItem->uItemID].pIconName; - if ( CheckHiredNPCSpeciality(4) ) - { - v6 = 1; - return v6; - } + if ( (signed int)SkillToMastery(v3) >= 4 ) v6 = 1; if ( v5 >= (unsigned __int8)v7[46] ) @@ -1997,11 +1996,7 @@ v5 = uSkillMult * (v3 & 0x3F); v6 = 0; v7 = (char *)&pItemsTable->pItems[pItem->uItemID].pIconName; - if ( CheckHiredNPCSpeciality(4) ) - { - v6 = 1; - return v6; - } + if ( (signed int)SkillToMastery(v3) >= 4 ) v6 = 1; if ( v5 >= (unsigned __int8)v7[46] ) @@ -2020,6 +2015,13 @@ char v8; // al@10 signed int v10; // [sp-4h] [bp-14h]@2 + + auto v7 = &pItemsTable->pItems[a2->uItemID]; + if (CheckHiredNPCSpeciality(Smith) && v7->uEquipType <= 2 || + CheckHiredNPCSpeciality(Armorer) && v7->uEquipType >= 3 && v7->uEquipType <= 9 || + CheckHiredNPCSpeciality(Alchemist) && v7->uEquipType >= 9 ) + return true; + LOBYTE(v2) = GetActualSkillLevel(PLAYER_SKILL_REPAIR); v3 = v2; if ( HIBYTE(v2) & 1 ) @@ -2039,11 +2041,6 @@ LABEL_7: v5 = v4 * (v3 & 0x3F); v6 = 0; - auto v7 = &pItemsTable->pItems[a2->uItemID]; - if (CheckHiredNPCSpeciality(1) && v7->uEquipType <= 2 || - CheckHiredNPCSpeciality(2) && v7->uEquipType >= 3 && v7->uEquipType <= 9 || - CheckHiredNPCSpeciality(3) && v7->uEquipType >= 9 ) - return true; if ( (signed int)SkillToMastery(v3) >= 4 ) return true; if ( v5 >= *((char *)(v7 + 1) + 2) ) @@ -2629,11 +2626,11 @@ v8 = 0; v1 = this; - if ( CheckHiredNPCSpeciality(0x1Bu) ) + if ( CheckHiredNPCSpeciality(Fool) ) v8 = 5; - if ( CheckHiredNPCSpeciality(0x1Cu) ) + if ( CheckHiredNPCSpeciality(ChimneySweep) ) v8 += 20; - if ( CheckHiredNPCSpeciality(0x2Fu) ) + if ( CheckHiredNPCSpeciality(Psychic) ) v8 += 10; v2 = v1->sAgeModifier + GetBaseAge(); v3 = 0; @@ -4499,7 +4496,7 @@ v10 = 0; v9 = 0; v4 = GetRace(); - if ( CheckHiredNPCSpeciality(0x25u) ) + if ( CheckHiredNPCSpeciality(Enchanter) ) v10 = 20; if ( (a2 == CHARACTER_ATTRIBUTE_RESIST_FIRE || a2 == CHARACTER_ATTRIBUTE_RESIST_AIR @@ -5653,9 +5650,9 @@ { case PLAYER_SKILL_MONSTER_ID: { - if ( CheckHiredNPCSpeciality(58) ) + if ( CheckHiredNPCSpeciality(Hunter) ) v2 = 6; - if ( CheckHiredNPCSpeciality(57) ) + if ( CheckHiredNPCSpeciality(Sage) ) v2 += 6; v8 = (CHARACTER_ATTRIBUTE_TYPE)20; v2 += GetItemsBonus(v8, 0); @@ -5664,9 +5661,9 @@ case PLAYER_SKILL_ARMSMASTER: { - if ( CheckHiredNPCSpeciality(15) ) + if ( CheckHiredNPCSpeciality(Armsmaster) ) v2 = 2; - if ( CheckHiredNPCSpeciality(16) ) + if ( CheckHiredNPCSpeciality(Weaponsmaster) ) v2 += 3; v8 = (CHARACTER_ATTRIBUTE_TYPE)21; v2 += GetItemsBonus(v8, 0); @@ -5675,7 +5672,7 @@ case PLAYER_SKILL_STEALING: { - if (CheckHiredNPCSpeciality(51)) + if (CheckHiredNPCSpeciality(Burglar)) v2 = 8; v8 = (CHARACTER_ATTRIBUTE_TYPE)17; v2 += GetItemsBonus(v8, 0); @@ -5685,9 +5682,9 @@ case PLAYER_SKILL_ALCHEMY: { - if ( CheckHiredNPCSpeciality(23) ) + if ( CheckHiredNPCSpeciality(Herbalist) ) v2 = 4; - if ( CheckHiredNPCSpeciality(24) ) + if ( CheckHiredNPCSpeciality(Apothecary) ) v2 += 8; v8 = (CHARACTER_ATTRIBUTE_TYPE)16; v2 += GetItemsBonus(v8, 0); @@ -5696,11 +5693,11 @@ case PLAYER_SKILL_LEARNING: { - if ( CheckHiredNPCSpeciality(13) ) + if ( CheckHiredNPCSpeciality(Teacher) ) v2 = 10; - if ( CheckHiredNPCSpeciality(14) ) + if ( CheckHiredNPCSpeciality(Instructor) ) v2 += 15; - if ( CheckHiredNPCSpeciality(4) ) + if ( CheckHiredNPCSpeciality(Scholar) ) v2 += 5; v8 = (CHARACTER_ATTRIBUTE_TYPE)46; v2 += GetItemsBonus(v8, 0); @@ -5709,7 +5706,7 @@ case PLAYER_SKILL_UNARMED: { - if (CheckHiredNPCSpeciality(56) ) + if (CheckHiredNPCSpeciality(Monk) ) v2 = 2; v8 = (CHARACTER_ATTRIBUTE_TYPE)23; v2 += GetItemsBonus(v8, 0); @@ -5718,7 +5715,7 @@ case PLAYER_SKILL_DODGE: { - if ( CheckHiredNPCSpeciality(56) ) + if ( CheckHiredNPCSpeciality(Monk) ) v2 = 2; v8 = (CHARACTER_ATTRIBUTE_TYPE)22; v2 += GetItemsBonus(v8, 0); @@ -5735,11 +5732,11 @@ break; case PLAYER_SKILL_EARTH: - if ( CheckHiredNPCSpeciality(17) ) + if ( CheckHiredNPCSpeciality(Apprentice) ) v2 = 2; - if ( CheckHiredNPCSpeciality(18) ) + if ( CheckHiredNPCSpeciality(Mystic) ) v2 += 3; - if ( CheckHiredNPCSpeciality(19) ) + if ( CheckHiredNPCSpeciality(Spellmaster) ) v2 += 4; if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) v2 += 3; @@ -5747,11 +5744,11 @@ v2 += GetItemsBonus(v8, 0); break; case PLAYER_SKILL_FIRE: - if ( CheckHiredNPCSpeciality(17) ) + if ( CheckHiredNPCSpeciality(Apprentice) ) v2 = 2; - if ( CheckHiredNPCSpeciality(18) ) + if ( CheckHiredNPCSpeciality(Mystic) ) v2 += 3; - if ( CheckHiredNPCSpeciality(19) ) + if ( CheckHiredNPCSpeciality(Spellmaster) ) v2 += 4; if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) v2 += 3; @@ -5759,11 +5756,11 @@ v2 += GetItemsBonus(v8, 0); break; case PLAYER_SKILL_AIR: - if ( CheckHiredNPCSpeciality(17) ) + if ( CheckHiredNPCSpeciality(Apprentice) ) v2 = 2; - if ( CheckHiredNPCSpeciality(18) ) + if ( CheckHiredNPCSpeciality(Mystic) ) v2 += 3; - if ( CheckHiredNPCSpeciality(19) ) + if ( CheckHiredNPCSpeciality(Spellmaster) ) v2 += 4; if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) v2 += 3; @@ -5771,11 +5768,11 @@ v2 += GetItemsBonus(v8, 0); break; case PLAYER_SKILL_WATER: - if ( CheckHiredNPCSpeciality(17) ) + if ( CheckHiredNPCSpeciality(Apprentice) ) v2 = 2; - if ( CheckHiredNPCSpeciality(18) ) + if ( CheckHiredNPCSpeciality(Mystic) ) v2 += 3; - if ( CheckHiredNPCSpeciality(19) ) + if ( CheckHiredNPCSpeciality(Spellmaster) ) v2 += 4; if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) v2 += 3; @@ -5783,31 +5780,31 @@ v2 += GetItemsBonus(v8, 0); break; case PLAYER_SKILL_SPIRIT: - if ( CheckHiredNPCSpeciality(53) ) + if ( CheckHiredNPCSpeciality(Acolyte2) ) v2 = 2; - if ( CheckHiredNPCSpeciality(54) ) + if ( CheckHiredNPCSpeciality(Initiate) ) v2 += 3; - if ( CheckHiredNPCSpeciality(55) ) + if ( CheckHiredNPCSpeciality(Prelate) ) v2 += 4; v8 = (CHARACTER_ATTRIBUTE_TYPE)38; v2 += GetItemsBonus(v8, 0); break; case PLAYER_SKILL_MIND: - if ( CheckHiredNPCSpeciality(53) ) + if ( CheckHiredNPCSpeciality(Acolyte2) ) v2 = 2; - if ( CheckHiredNPCSpeciality(54) ) + if ( CheckHiredNPCSpeciality(Initiate) ) v2 += 3; - if ( CheckHiredNPCSpeciality(55) ) + if ( CheckHiredNPCSpeciality(Prelate) ) v2 += 4; v8 = (CHARACTER_ATTRIBUTE_TYPE)39; v2 += GetItemsBonus(v8, 0); break; case PLAYER_SKILL_BODY: - if ( CheckHiredNPCSpeciality(53) ) + if ( CheckHiredNPCSpeciality(Acolyte2) ) v2 = 2; - if ( CheckHiredNPCSpeciality(54) ) + if ( CheckHiredNPCSpeciality(Initiate) ) v2 += 3; - if ( CheckHiredNPCSpeciality(55) ) + if ( CheckHiredNPCSpeciality(Prelate) ) v2 += 4; v8 = (CHARACTER_ATTRIBUTE_TYPE)40; v2 += GetItemsBonus(v8, 0); @@ -5825,22 +5822,22 @@ case PLAYER_SKILL_MERCHANT: { - if ( CheckHiredNPCSpeciality(20) ) + if ( CheckHiredNPCSpeciality(Trader) ) v2 = 4; - if ( CheckHiredNPCSpeciality(21) ) + if ( CheckHiredNPCSpeciality(Merchant) ) v2 += 6; - if ( CheckHiredNPCSpeciality(48) ) + if ( CheckHiredNPCSpeciality(Gypsy) ) v2 += 3; - if ( CheckHiredNPCSpeciality(50) ) + if ( CheckHiredNPCSpeciality(Duper) ) v2 += 8; } break; case PLAYER_SKILL_PERCEPTION: { - if ( CheckHiredNPCSpeciality(22) ) + if ( CheckHiredNPCSpeciality(Scout) ) v2 = 6; - if ( CheckHiredNPCSpeciality(47) ) + if ( CheckHiredNPCSpeciality(Psychic) ) v2 += 5; } break; @@ -5855,11 +5852,11 @@ break; case PLAYER_SKILL_TRAP_DISARM: { - if ( CheckHiredNPCSpeciality(25) ) + if ( CheckHiredNPCSpeciality(Tinker) ) v2 = 4; - if ( CheckHiredNPCSpeciality(26) ) + if ( CheckHiredNPCSpeciality(Locksmith) ) v2 += 6; - if ( CheckHiredNPCSpeciality(51) ) + if ( CheckHiredNPCSpeciality(Burglar) ) v2 += 8; v8 = (CHARACTER_ATTRIBUTE_TYPE)18; v2 += GetItemsBonus(v8, 0);
--- a/Player.h Tue Mar 12 03:10:35 2013 +0200 +++ b/Player.h Tue Mar 12 04:45:38 2013 +0200 @@ -85,8 +85,8 @@ SPEECH_68 = 68, SPEECH_69 = 69, SPEECH_70 = 70, - SPEECH_71 = 71, - SPEECH_72 = 72, + SPEECH_CarriageReady = 71, // travelling by carriage + SPEECH_SetSail = 72, // travelling by sea SPEECH_73 = 73, SPEECH_74 = 74, SPEECH_75 = 75,
--- a/mm7_1.cpp Tue Mar 12 03:10:35 2013 +0200 +++ b/mm7_1.cpp Tue Mar 12 04:45:38 2013 +0200 @@ -3601,11 +3601,11 @@ if(v0->classType == PLAYER_CLASS_WARLOCK) ++uRestUI_FoodRequiredToRest; } - if ( CheckHiredNPCSpeciality(0x1Du) ) + if ( CheckHiredNPCSpeciality(Porter) ) --uRestUI_FoodRequiredToRest; - if ( CheckHiredNPCSpeciality(0x1Eu) ) + if ( CheckHiredNPCSpeciality(QuarterMaster) ) uRestUI_FoodRequiredToRest -= 2; - if ( CheckHiredNPCSpeciality(0x30u) ) + if ( CheckHiredNPCSpeciality(Gypsy) ) --uRestUI_FoodRequiredToRest; if ( uRestUI_FoodRequiredToRest < 1 ) uRestUI_FoodRequiredToRest = 1; @@ -3927,11 +3927,11 @@ } while ( (signed int)v2 < v14 ); } - if ( CheckHiredNPCSpeciality(0x1Fu) ) + if ( CheckHiredNPCSpeciality(Factor) ) v4 += (signed int)(10 * v4) / 100; - if ( CheckHiredNPCSpeciality(0x20u) ) + if ( CheckHiredNPCSpeciality(Banker) ) v4 += (signed int)(20 * v4) / 100; - if ( CheckHiredNPCSpeciality(0x2Du) ) + if ( CheckHiredNPCSpeciality(Pirate) ) v4 += (signed int)(10 * v4) / 100; if ( v3 ) {
--- a/mm7_3.cpp Tue Mar 12 03:10:35 2013 +0200 +++ b/mm7_3.cpp Tue Mar 12 04:45:38 2013 +0200 @@ -3917,15 +3917,15 @@ if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) v0 = &pIndoor->dlv; v1 = 0; - if ( CheckHiredNPCSpeciality(0x2Du) ) - v1 = 5; - if ( CheckHiredNPCSpeciality(0x33u) ) + if ( CheckHiredNPCSpeciality(Pirate) ) + v1 += 5; + if ( CheckHiredNPCSpeciality(Burglar) ) v1 += 5; - if ( CheckHiredNPCSpeciality(0x30u) ) + if ( CheckHiredNPCSpeciality(Gypsy) ) v1 += 5; - if ( CheckHiredNPCSpeciality(0x32u) ) + if ( CheckHiredNPCSpeciality(Duper) ) v1 += 5; - if ( CheckHiredNPCSpeciality(0x34u) ) + if ( CheckHiredNPCSpeciality(FallenWizard) ) v1 += 5; return v1 + v0->uReputation; } @@ -11946,7 +11946,7 @@ uBlue = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu); auto bWizardEyeActive = pParty->WizardEyeActive(); auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel(); - if (CheckHiredNPCSpeciality(0x26u)) + if (CheckHiredNPCSpeciality(Cartographer)) { bWizardEyeActive = true; uWizardEyeSkillLevel = 2; @@ -13864,13 +13864,13 @@ signed int v0; // esi@1 v0 = uDefaultTravelTime_ByFoot; - if ( CheckHiredNPCSpeciality(5u) ) + if ( CheckHiredNPCSpeciality(Guide) ) --v0; - if ( CheckHiredNPCSpeciality(6u) ) + if ( CheckHiredNPCSpeciality(Tracker) ) v0 -= 2; - if ( CheckHiredNPCSpeciality(7u) ) + if ( CheckHiredNPCSpeciality(Pathfinder) ) v0 -= 3; - if ( CheckHiredNPCSpeciality(0x2Cu) ) + if ( CheckHiredNPCSpeciality(Explorer) ) --v0; if ( v0 < 1 ) v0 = 1;
--- a/mm7_4.cpp Tue Mar 12 03:10:35 2013 +0200 +++ b/mm7_4.cpp Tue Mar 12 04:45:38 2013 +0200 @@ -10812,7 +10812,7 @@ //----- (004BC49B) -------------------------------------------------------- void OnSelectNPCDialogueOption(DIALOGUE_TYPE newDialogueType) - { +{ //unsigned int v1; // esi@1 NPCData *speakingNPC; // ebp@1 //unsigned int v3; // eax@1 @@ -10830,17 +10830,16 @@ const char *v15; // [sp-4h] [bp-14h]@60 //v1 = _this; - speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); + speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); //v3 = v1; - uDialogueType = newDialogueType; - if ( !speakingNPC->uFlags ) - { - speakingNPC->uFlags = 1; + uDialogueType = newDialogueType; + if (!speakingNPC->uFlags) + { + speakingNPC->uFlags = 1; //v3 = uDialogueType; - } - if ((newDialogueType>DIALOGUE_24)||(newDialogueType<DIALOGUE_19)) - { - + } + if ((newDialogueType > DIALOGUE_24) || (newDialogueType < DIALOGUE_19)) + { if (newDialogueType != DIALOGUE_76) { if (newDialogueType == DIALOGUE_PROFESSION_DETAILS) @@ -11350,8 +11349,8 @@ int v29; // eax@62 unsigned int v30; // ecx@62 char *v31; // eax@63 - char v32; // [sp-3Ch] [bp-2CCh]@62 - int v33; // [sp-38h] [bp-2C8h]@62 + MapInfo v32; // [sp-3Ch] [bp-2CCh]@62 + /*int v33; // [sp-38h] [bp-2C8h]@62 int v34; // [sp-34h] [bp-2C4h]@62 int v35; // [sp-30h] [bp-2C0h]@62 int v36; // [sp-2Ch] [bp-2BCh]@62 @@ -11365,17 +11364,17 @@ char *v44; // [sp-Ch] [bp-29Ch]@62 unsigned int v45; // [sp-8h] [bp-298h]@62 char *v46; // [sp-4h] [bp-294h]@62 - const char *v47[5]; // [sp+0h] [bp-290h]@7 - char v48; // [sp+14h] [bp-27Ch]@37 - char v49; // [sp+78h] [bp-218h]@68 - char v50; // [sp+DCh] [bp-1B4h]@68 - char v51; // [sp+140h] [bp-150h]@68 - char Dest; // [sp+1A4h] [bp-ECh]@36 + const char *v47[5]; // [sp+0h] [bp-290h]@7*/ + char v48[100]; // [sp+14h] [bp-27Ch]@37 + char v49[100]; // [sp+78h] [bp-218h]@68 + char v50[100]; // [sp+DCh] [bp-1B4h]@68 + char v51[100]; // [sp+140h] [bp-150h]@68 + char Dest[100]; // [sp+1A4h] [bp-ECh]@36 GUIWindow v53; // [sp+208h] [bp-88h]@1 int v54; // [sp+25Ch] [bp-34h]@36 int v55; // [sp+260h] [bp-30h]@36 unsigned int v56; // [sp+264h] [bp-2Ch]@1 - __int16 v57[2]; // [sp+268h] [bp-28h]@1 + int v57; // [sp+268h] [bp-28h]@1 Player *v58; // [sp+26Ch] [bp-24h]@36 GUIWindow *v59; // [sp+270h] [bp-20h]@1 unsigned int v60; // [sp+274h] [bp-1Ch]@36 @@ -11394,7 +11393,7 @@ v53.uFrameX = 483; v53.uFrameWidth = 148; v53.uFrameZ = 334; - *(int *)v57 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); + v57 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); v56 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); v3 = 52 * (unsigned int)v0->ptr_1C; //v59 = (GUIWindow *)((((p2DEvents_minus1___00[v3 / 2] != 27) - 1) & 0xFFFFFFE7) + 50); @@ -11414,8 +11413,8 @@ v17 = LOBYTE(pFontArrus->uFontHeight) - 3; v59 = pDialogueWindow; v54 = v17; - strcpy(&Dest, ""); - sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[405], s1); + strcpy(Dest, ""); + sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[405], s1); // Price: %lu gold v18 = pFontArrus->CalcTextHeight(pTmpBuf2, &v53, 0, 0); v19 = v16->pNumPresenceButton; v20 = v18 + v17 + 146; @@ -11426,13 +11425,13 @@ if ( v21 >= v21 + v19 ) goto LABEL_71; s1 = 2; - a1 = &v48; + a1 = v48; while ( 1 ) { - v47[1] = (const char *)v60; + int v47 = v60; v22 = window_SpeakInHouse->ptr_1C; - v23 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (signed int)v22] + v62); - v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (signed int)v22] + v62); + v23 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // negindex. actual address is around + 0x36 + v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // + 0x3F for sea travels, less for land v24 = v16->GetControl(v60); if ( v23 != v58 && ((signed int)s1 >= 6 ? (v25 = 1) : (v25 = (unsigned __int8)*(&byte_4F09B1[32 * (int)v23] @@ -11444,49 +11443,35 @@ v58 = v61; v27 = (const char *)v56; if ( pDialogueWindow->pCurrentPosActiveItem != s1 ) - v27 = *(const char **)v57; - v47[1] = v27; + v27 = (const char *)v57; + //v32.uRedbookTrackID = v27; sprintf(a1, "\xC" "%05d", v27); v66 = (unsigned __int8)byte_4F09B8[v26 * 4]; if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 ) { - if ( CheckHiredNPCSpeciality(8u) ) + if ( CheckHiredNPCSpeciality(Sailor) ) v66 -= 2; - if ( CheckHiredNPCSpeciality(9u) ) + if ( CheckHiredNPCSpeciality(Navigator) ) v66 -= 3; - v47[1] = (const char *)45; + //v47 = Pirate; + if ( CheckHiredNPCSpeciality(Pirate) ) + v66 -= 2; } else { - v47[1] = (const char *)35; - } - if ( CheckHiredNPCSpeciality((unsigned int)v47[1]) ) - v66 -= 2; - if ( CheckHiredNPCSpeciality(0x2Cu) ) + //v47 = Horseman; + if ( CheckHiredNPCSpeciality(Horseman) ) + v66 -= 2; + } + if ( CheckHiredNPCSpeciality(Explorer) ) --v66; if ( v66 < 1 ) v66 = 1; if ( v61 != (Player *)v2 ) { - memcpy(&v32, (char *)&pMapStats + 68 * (unsigned __int8)byte_4F09B0[v26 * 4], 0x44u); - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[404], - v66, - *(int *)&v32, - v33, - v34, - v35, - v36, - v37, - v38, - v39, - v40, - v41, - v42, - v43, - v44, - v45, - v46, - *(_QWORD *)v47); + memcpy(&v32, &pMapStats->pInfos[(unsigned __int8)byte_4F09B0[v26 * 4]], 0x44u); + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s + v66, v32.pName); strcat(a1, pTmpBuf); v28 = a1; a1 += 100; @@ -11523,23 +11508,20 @@ } if ( v63 != v55 ) { - v47[1] = &Dest; + /*v47[1] = &Dest; v47[0] = &v51; v46 = &v50; v45 = (unsigned int)&v49; v44 = &v48; - v43 = pTmpBuf2; - sprintf(pTmpBuf, "%s\n \n%s%s%s%s%s", pTmpBuf2, &v48, &v49, &v50, &v51, &Dest); + v43 = pTmpBuf2;*/ + sprintf(pTmpBuf, "%s\n \n%s%s%s%s%s", pTmpBuf2, v48, v49, v50, v51, Dest); v53.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); } else { LABEL_71: - v47[1] = (const char *)3; - v47[0] = pGlobalTXT_LocalizationStrings[561]; - v46 = *(char **)v57; - v45 = (174 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[561], &v53, 0, 0)) / 2 + 138; - v53.DrawTitleText(pFontArrus, 0, v45, (unsigned __int16)v46, v47[0], (unsigned int)v47[1]); + v53.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[561], &v53, 0, 0)) / 2 + 138, + v57, pGlobalTXT_LocalizationStrings[561], 3); pAudioPlayer->StopChannels(-1, -1); } } @@ -11560,8 +11542,8 @@ pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); } Party::TakeGold(s1); - v47[1] = (const char *)7; - v5 = &byte_4F09B0[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + dialog_menu_id)]; + //v47[1] = (const char *)7; + v5 = &byte_4F09B0[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + dialog_menu_id)]; // negindex with ptr_1C around +0x36 if ( v5[pParty->uDaysPlayed % 7 + 1] ) { if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[(unsigned __int8)*v5].pFilename) ) @@ -11597,25 +11579,28 @@ } HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); v12 = (unsigned __int8)v5[8]; + int _v47; if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 ) { - v63 = SPEECH_72; + v63 = SPEECH_SetSail; v13 = 2500; - if ( CheckHiredNPCSpeciality(8u) ) + if ( CheckHiredNPCSpeciality(Sailor) ) v12 -= 2; - if ( CheckHiredNPCSpeciality(9u) ) + if ( CheckHiredNPCSpeciality(Navigator) ) v12 -= 3; - v47[1] = (const char *)45; + //_v47 = 45; + if ( CheckHiredNPCSpeciality(Pirate) ) + v12 -= 2; } else { - v63 = SPEECH_71; + v63 = SPEECH_CarriageReady; v13 = 1500; - v47[1] = (const char *)35; - } - if ( CheckHiredNPCSpeciality((unsigned int)v47[1]) ) - v12 -= 2; - if ( CheckHiredNPCSpeciality(0x2Cu) ) + //_v47 = 35; + if ( CheckHiredNPCSpeciality(Horseman) ) + v12 -= 2; + } + if ( CheckHiredNPCSpeciality(Explorer) ) --v12; if ( v12 < 1 ) v12 = 1;
--- a/texts.cpp Tue Mar 12 03:10:35 2013 +0200 +++ b/texts.cpp Tue Mar 12 04:45:38 2013 +0200 @@ -305,7 +305,7 @@ aNPCProfessionNames[27] = pGlobalTXT_LocalizationStrings[329]; aNPCProfessionNames[28] = pGlobalTXT_LocalizationStrings[330]; aNPCProfessionNames[29] = pGlobalTXT_LocalizationStrings[331]; - aNPCProfessionNames[20] = pGlobalTXT_LocalizationStrings[332]; + aNPCProfessionNames[30] = pGlobalTXT_LocalizationStrings[332]; aNPCProfessionNames[31] = pGlobalTXT_LocalizationStrings[333]; aNPCProfessionNames[32] = pGlobalTXT_LocalizationStrings[334]; aNPCProfessionNames[33] = pGlobalTXT_LocalizationStrings[335];