forked from mirror/openmw-tes3mp
Merge pull request #1644
This commit is contained in:
commit
308551ad49
3 changed files with 8 additions and 3 deletions
|
@ -214,7 +214,7 @@ void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_,
|
|||
}
|
||||
}
|
||||
|
||||
void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &class_, bool preserveProgress)
|
||||
void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &class_, bool preserveProgress, bool readBook)
|
||||
{
|
||||
int base = getSkill (skillIndex).getBase();
|
||||
|
||||
|
@ -256,9 +256,14 @@ void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &clas
|
|||
MWBase::Environment::get().getWindowManager()->playSound("skillraise");
|
||||
|
||||
std::stringstream message;
|
||||
|
||||
if (readBook)
|
||||
message << std::string("#{sBookSkillMessage}\n");
|
||||
|
||||
message << boost::format(MWBase::Environment::get().getWindowManager ()->getGameSettingString ("sNotifyMessage39", ""))
|
||||
% std::string("#{" + ESM::Skill::sSkillNameIds[skillIndex] + "}")
|
||||
% static_cast<int> (base);
|
||||
|
||||
MWBase::Environment::get().getWindowManager ()->messageBox(message.str(), MWGui::ShowInDialogueMode_Never);
|
||||
|
||||
if (mLevelProgress >= gmst.find("iLevelUpTotal")->getInt())
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace MWMechanics
|
|||
void useSkill (int skillIndex, const ESM::Class& class_, int usageType = -1, float extraFactor=1.f);
|
||||
///< Increase skill by usage.
|
||||
|
||||
void increaseSkill (int skillIndex, const ESM::Class& class_, bool preserveProgress);
|
||||
void increaseSkill (int skillIndex, const ESM::Class& class_, bool preserveProgress, bool readBook = false);
|
||||
|
||||
int getLevelProgress() const;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace MWWorld
|
|||
playerRef->mBase->mClass
|
||||
);
|
||||
|
||||
npcStats.increaseSkill (ref->mBase->mData.mSkillId, *class_, true);
|
||||
npcStats.increaseSkill (ref->mBase->mData.mSkillId, *class_, true, true);
|
||||
|
||||
npcStats.flagAsUsed (ref->mBase->mId);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue