Mercurial > mm7
comparison Player.cpp @ 2203:4bfee77e900d
DoInteractionWithTopmostZObject cleaned
author | Ritor1 |
---|---|
date | Tue, 04 Feb 2014 17:29:04 +0600 |
parents | 42c8807225a2 |
children | 080fd5a5433d |
comparison
equal
deleted
inserted
replaced
2202:44d956d4f838 | 2203:4bfee77e900d |
---|---|
1994 || this->IsUnconcious() | 1994 || this->IsUnconcious() |
1995 || this->IsAsleep() ) | 1995 || this->IsAsleep() ) |
1996 { | 1996 { |
1997 return 0; | 1997 return 0; |
1998 } | 1998 } |
1999 pGlobalTXT_LocalizationStrings[1]; | 1999 //pGlobalTXT_LocalizationStrings[1];//Accuracy |
2000 if ( !(BYTE2(actroPtr->uAttributes) & 0x80) ) | 2000 if ( !(actroPtr->uAttributes & 0x800000) ) |
2001 actroPtr->SetRandomGoldIfTheresNoItem(); | 2001 actroPtr->SetRandomGoldIfTheresNoItem(); |
2002 unsigned __int16 v6 = this->pActiveSkills[PLAYER_SKILL_STEALING]; | 2002 unsigned __int16 v6 = this->pActiveSkills[PLAYER_SKILL_STEALING]; |
2003 v7 = v6 & 0x3F; | 2003 v7 = v6 & 0x3F; |
2004 stealingMastery = SkillToMastery(v6); | 2004 stealingMastery = SkillToMastery(v6); |
2005 int v30 = StealingMasteryBonuses[stealingMastery]; | 2005 int v30 = StealingMasteryBonuses[stealingMastery]; |
2006 int v29 = StealingRandomBonuses[rand() % 5]; | 2006 int v29 = StealingRandomBonuses[rand() % 5]; |
2007 fineIfFailed = actroPtr->pMonsterInfo.uLevel + 100 * (_steal_perm + reputation); | 2007 fineIfFailed = actroPtr->pMonsterInfo.uLevel + 100 * (_steal_perm + reputation); |
2008 currMaxItemValue = v29 + v7 * v30; | 2008 currMaxItemValue = v29 + v7 * v30; |
2009 pGlobalTXT_LocalizationStrings[200]; | 2009 //pGlobalTXT_LocalizationStrings[200];//Sell |
2010 if ( rand() % 100 < 5 || fineIfFailed > currMaxItemValue || BYTE2(actroPtr->uAttributes) & 8 ) | 2010 if ( rand() % 100 < 5 || fineIfFailed > currMaxItemValue || actroPtr->uAttributes & 0x80000 ) |
2011 { | 2011 { |
2012 Actor::AggroSurroundingPeasants(uActorID, 1); | 2012 Actor::AggroSurroundingPeasants(uActorID, 1); |
2013 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[376], this->pName); | 2013 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[376], this->pName);//"%s was caught stealing!" |
2014 ShowStatusBarString(pTmpBuf2.data(), 2u); | 2014 ShowStatusBarString(pTmpBuf2.data(), 2); |
2015 return 0; | 2015 return 0; |
2016 } | 2016 } |
2017 else | 2017 else |
2018 { | 2018 { |
2019 v11 = rand(); | 2019 v11 = rand(); |
2020 if ( v11 % 100 >= 70 ) //stealing gold | 2020 if ( v11 % 100 >= 70 ) //stealing gold |
2021 { | 2021 { |
2022 enchBonusSum = 0; | 2022 enchBonusSum = 0; |
2023 for (int i = 0; i < v7; i++) | 2023 for (int i = 0; i < v7; i++) |
2024 { | |
2025 enchBonusSum += rand() % StealingEnchantmentBonusForSkill[stealingMastery] + 1; | 2024 enchBonusSum += rand() % StealingEnchantmentBonusForSkill[stealingMastery] + 1; |
2026 } | |
2027 if ( actroPtr->array_000234[3].GetItemEquipType() != EQUIP_GOLD ) | 2025 if ( actroPtr->array_000234[3].GetItemEquipType() != EQUIP_GOLD ) |
2028 return 2; | 2026 return 2; |
2029 enchTypePtr = &actroPtr->array_000234[3].uSpecEnchantmentType; | 2027 enchTypePtr = &actroPtr->array_000234[3].uSpecEnchantmentType; |
2030 if ( (int)enchBonusSum >= *enchTypePtr ) | 2028 if ( (int)enchBonusSum >= *enchTypePtr ) |
2031 { | 2029 { |
2032 actroPtr->array_000234[3].uItemID = 0; | 2030 actroPtr->array_000234[3].uItemID = 0; |
2033 *enchTypePtr = 0; | 2031 *enchTypePtr = 0; |
2034 } | 2032 } |
2035 else | 2033 else |
2036 { | |
2037 *enchTypePtr -= enchBonusSum; | 2034 *enchTypePtr -= enchBonusSum; |
2038 } | |
2039 if ( enchBonusSum ) | 2035 if ( enchBonusSum ) |
2040 { | 2036 { |
2041 pParty->PartyFindsGold(enchBonusSum, 2); | 2037 pParty->PartyFindsGold(enchBonusSum, 2); |
2042 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[302], this->pName, enchBonusSum); //%stole %d gold | 2038 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[302], this->pName, enchBonusSum); //%stole %d gold |
2043 } | 2039 } |
2044 else | 2040 else |
2045 { | |
2046 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[377], this->pName); //%s failed to steal anything | 2041 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[377], this->pName); //%s failed to steal anything |
2047 } | 2042 ShowStatusBarString(pTmpBuf2.data(), 2); |
2048 ShowStatusBarString(pTmpBuf2.data(), 2u); | |
2049 return 2; | 2043 return 2; |
2050 } | 2044 } |
2051 else if ( v11 % 100 >= 40 ) //stealing an item | 2045 else if ( v11 % 100 >= 40 ) //stealing an item |
2052 { | 2046 { |
2053 tempItem.Reset(); | 2047 tempItem.Reset(); |
2095 return 2; | 2089 return 2; |
2096 } | 2090 } |
2097 } | 2091 } |
2098 } | 2092 } |
2099 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[377], this->pName); //%s failed to steal anything | 2093 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[377], this->pName); //%s failed to steal anything |
2100 ShowStatusBarString(pTmpBuf2.data(), 2u); | 2094 ShowStatusBarString(pTmpBuf2.data(), 2); |
2101 return 2; | 2095 return 2; |
2102 } | 2096 } |
2103 } | 2097 } |
2104 // 4EDEA0: using guessed type int dword_4EDEA0[]; | 2098 // 4EDEA0: using guessed type int dword_4EDEA0[]; |
2105 // 4EDEB4: using guessed type int dword_4EDEB4[]; | 2099 // 4EDEB4: using guessed type int dword_4EDEB4[]; |