Mercurial > mm7
diff Player.cpp @ 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 | cfca6297e4ae |
children | eb67721c5268 |
line wrap: on
line diff
--- 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);