mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-24 18:08:44 +00:00
Fix #161 fix craft success rate display on client
This commit is contained in:
parent
2f78b7dd68
commit
18c5c4df06
3 changed files with 13 additions and 9 deletions
|
@ -1688,29 +1688,30 @@ void CActionPhraseFaber::updateItemResult()
|
|||
craftSuccessModifier = nodeCSM->getValue32();
|
||||
}
|
||||
// With the faber plan skill
|
||||
sint success= pPM->getCraftPhraseSuccessRate(pPM->getPhrase(phraseSlot), _ExecuteFromItemPlanBrick->getSkill(), minLevel);
|
||||
sint success= pPM->getCraftPhraseSuccessRate(pPM->getPhrase(phraseSlot), _ExecuteFromItemPlanBrick->getSkill(), minLevel, 0);
|
||||
sint bonus = pPM->getCraftPhraseSuccessRate(pPM->getPhrase(phraseSlot), _ExecuteFromItemPlanBrick->getSkill(), minLevel, (sint) craftSuccessModifier) - success;
|
||||
string successStr;
|
||||
if( craftSuccessModifier == 0 )
|
||||
if( bonus == 0 )
|
||||
{
|
||||
successStr = toString("@{FFFF}") + toString(success);
|
||||
}
|
||||
else
|
||||
if( craftSuccessModifier > 0 ) // bonus
|
||||
if( bonus > 0 ) // bonus
|
||||
{
|
||||
successStr = "@{0F0F}" + toString(success+craftSuccessModifier)
|
||||
successStr = "@{0F0F}" + toString(success + bonus)
|
||||
+ "@{FFFF}("
|
||||
+ toString( success )
|
||||
+ "@{0F0F} + "
|
||||
+ toString( craftSuccessModifier )
|
||||
+ toString( bonus )
|
||||
+ "@{FFFF})";
|
||||
}
|
||||
else
|
||||
{
|
||||
successStr = "@{E42F}" + toString(success+craftSuccessModifier)
|
||||
successStr = "@{E42F}" + toString(success + bonus)
|
||||
+ "@{FFFF}("
|
||||
+ toString( success )
|
||||
+ "@{E42F} - "
|
||||
+ toString( craftSuccessModifier )
|
||||
+ toString( abs(bonus) )
|
||||
+ "@{FFFF})";
|
||||
}
|
||||
strFindReplace(text, "%success", successStr );
|
||||
|
|
|
@ -1428,7 +1428,7 @@ sint CSPhraseManager::getPhraseSuccessRate(const CSPhraseCom &phrase)
|
|||
}
|
||||
|
||||
// ***************************************************************************
|
||||
sint CSPhraseManager::getCraftPhraseSuccessRate(const CSPhraseCom &phrase, SKILLS::ESkills skill, uint minMpLevel)
|
||||
sint CSPhraseManager::getCraftPhraseSuccessRate(const CSPhraseCom &phrase, SKILLS::ESkills skill, uint minMpLevel, sint successModifier)
|
||||
{
|
||||
CSkillManager *pSM= CSkillManager::getInstance();
|
||||
|
||||
|
@ -1438,6 +1438,9 @@ sint CSPhraseManager::getCraftPhraseSuccessRate(const CSPhraseCom &phrase, SK
|
|||
// take skill value of the skill
|
||||
sint skillValue= pSM->getBestSkillValue(skill);
|
||||
|
||||
// apply success rate modifier from server
|
||||
skillValue += successModifier;
|
||||
|
||||
// return the sr according to this skill
|
||||
return getPhraseSuccessRate(STCraft, phrase, skillValue, minMpLevel);
|
||||
}
|
||||
|
|
|
@ -338,7 +338,7 @@ public:
|
|||
// Get the Phrase Success Rate %
|
||||
sint getPhraseSuccessRate(const CSPhraseCom &phrase);
|
||||
// Get the Phrase Success Rate %. Manually gives the Skill to do the comparison (for craft)
|
||||
sint getCraftPhraseSuccessRate(const CSPhraseCom &phrase, SKILLS::ESkills skill, uint minMpLevel);
|
||||
sint getCraftPhraseSuccessRate(const CSPhraseCom &phrase, SKILLS::ESkills skill, uint minMpLevel, sint successModifier);
|
||||
// Get the Phrase Success Rate %. Manually gives the Skill to do the comparison (for Forage Extraction)
|
||||
sint getForageExtractionPhraseSuccessRate(const CSPhraseCom &phrase, SKILLS::ESkills skill);
|
||||
// return the fmt according to forage terrain specializing
|
||||
|
|
Loading…
Reference in a new issue