|
|
|
@ -838,6 +838,7 @@ namespace MWMechanics
|
|
|
|
|
if (item.getCellRef().getEnchantmentCharge() < castCost)
|
|
|
|
|
{
|
|
|
|
|
if (mCaster == getPlayer())
|
|
|
|
|
{
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicInsufficientCharge}");
|
|
|
|
|
|
|
|
|
|
// Failure sound
|
|
|
|
@ -848,11 +849,13 @@ namespace MWMechanics
|
|
|
|
|
const ESM::MagicEffect* magicEffect = MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find(effectId);
|
|
|
|
|
school = magicEffect->mData.mSchool;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const std::string schools[] = {
|
|
|
|
|
"alteration", "conjuration", "destruction", "illusion", "mysticism", "restoration"
|
|
|
|
|
};
|
|
|
|
|
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
|
|
|
|
sndMgr->playSound3D(mCaster, "Spell Failure " + schools[school], 1.0f, 1.0f);
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// Reduce charge
|
|
|
|
|