mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-06 07:19:05 +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();
|
craftSuccessModifier = nodeCSM->getValue32();
|
||||||
}
|
}
|
||||||
// With the faber plan skill
|
// 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;
|
string successStr;
|
||||||
if( craftSuccessModifier == 0 )
|
if( bonus == 0 )
|
||||||
{
|
{
|
||||||
successStr = toString("@{FFFF}") + toString(success);
|
successStr = toString("@{FFFF}") + toString(success);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if( craftSuccessModifier > 0 ) // bonus
|
if( bonus > 0 ) // bonus
|
||||||
{
|
{
|
||||||
successStr = "@{0F0F}" + toString(success+craftSuccessModifier)
|
successStr = "@{0F0F}" + toString(success + bonus)
|
||||||
+ "@{FFFF}("
|
+ "@{FFFF}("
|
||||||
+ toString( success )
|
+ toString( success )
|
||||||
+ "@{0F0F} + "
|
+ "@{0F0F} + "
|
||||||
+ toString( craftSuccessModifier )
|
+ toString( bonus )
|
||||||
+ "@{FFFF})";
|
+ "@{FFFF})";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
successStr = "@{E42F}" + toString(success+craftSuccessModifier)
|
successStr = "@{E42F}" + toString(success + bonus)
|
||||||
+ "@{FFFF}("
|
+ "@{FFFF}("
|
||||||
+ toString( success )
|
+ toString( success )
|
||||||
+ "@{E42F} - "
|
+ "@{E42F} - "
|
||||||
+ toString( craftSuccessModifier )
|
+ toString( abs(bonus) )
|
||||||
+ "@{FFFF})";
|
+ "@{FFFF})";
|
||||||
}
|
}
|
||||||
strFindReplace(text, "%success", successStr );
|
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();
|
CSkillManager *pSM= CSkillManager::getInstance();
|
||||||
|
|
||||||
|
@ -1438,6 +1438,9 @@ sint CSPhraseManager::getCraftPhraseSuccessRate(const CSPhraseCom &phrase, SK
|
||||||
// take skill value of the skill
|
// take skill value of the skill
|
||||||
sint skillValue= pSM->getBestSkillValue(skill);
|
sint skillValue= pSM->getBestSkillValue(skill);
|
||||||
|
|
||||||
|
// apply success rate modifier from server
|
||||||
|
skillValue += successModifier;
|
||||||
|
|
||||||
// return the sr according to this skill
|
// return the sr according to this skill
|
||||||
return getPhraseSuccessRate(STCraft, phrase, skillValue, minMpLevel);
|
return getPhraseSuccessRate(STCraft, phrase, skillValue, minMpLevel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -338,7 +338,7 @@ public:
|
||||||
// Get the Phrase Success Rate %
|
// Get the Phrase Success Rate %
|
||||||
sint getPhraseSuccessRate(const CSPhraseCom &phrase);
|
sint getPhraseSuccessRate(const CSPhraseCom &phrase);
|
||||||
// Get the Phrase Success Rate %. Manually gives the Skill to do the comparison (for craft)
|
// 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)
|
// Get the Phrase Success Rate %. Manually gives the Skill to do the comparison (for Forage Extraction)
|
||||||
sint getForageExtractionPhraseSuccessRate(const CSPhraseCom &phrase, SKILLS::ESkills skill);
|
sint getForageExtractionPhraseSuccessRate(const CSPhraseCom &phrase, SKILLS::ESkills skill);
|
||||||
// return the fmt according to forage terrain specializing
|
// return the fmt according to forage terrain specializing
|
||||||
|
|
Loading…
Reference in a new issue