mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-29 08:00:56 -04:00
Cap enchantment casting cost to 1 as displayed in enchanting window. Display current enchantment charge in spell window.
This commit is contained in:
parent
07408a4652
commit
14c9a4e1d3
@ -463,7 +463,7 @@ namespace MWClass
|
|||||||
// Check if we have enough charges
|
// Check if we have enough charges
|
||||||
const float enchantCost = enchantment->mData.mCost;
|
const float enchantCost = enchantment->mData.mCost;
|
||||||
int eSkill = stats.getSkill(ESM::Skill::Enchant).getModified();
|
int eSkill = stats.getSkill(ESM::Skill::Enchant).getModified();
|
||||||
const float castCost = enchantCost - (enchantCost / 100) * (eSkill - 10);
|
const int castCost = std::max(1.f, enchantCost - (enchantCost / 100) * (eSkill - 10));
|
||||||
|
|
||||||
if (weapon.getCellRef().mEnchantmentCharge == -1)
|
if (weapon.getCellRef().mEnchantmentCharge == -1)
|
||||||
weapon.getCellRef().mEnchantmentCharge = enchantment->mData.mCharge;
|
weapon.getCellRef().mEnchantmentCharge = enchantment->mData.mCharge;
|
||||||
|
@ -282,8 +282,16 @@ namespace MWGui
|
|||||||
MyGUI::Button* costCharge = mSpellView->createWidget<MyGUI::Button>(equipped ? "SpellText" : "SpellTextUnequipped",
|
MyGUI::Button* costCharge = mSpellView->createWidget<MyGUI::Button>(equipped ? "SpellText" : "SpellTextUnequipped",
|
||||||
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
||||||
|
|
||||||
std::string cost = boost::lexical_cast<std::string>(enchant->mData.mCost);
|
float enchantCost = enchant->mData.mCost;
|
||||||
std::string charge = boost::lexical_cast<std::string>(enchant->mData.mCharge); /// \todo track current charge
|
MWMechanics::NpcStats &stats = player.getClass().getNpcStats(player);
|
||||||
|
int eSkill = stats.getSkill(ESM::Skill::Enchant).getModified();
|
||||||
|
int castCost = std::max(1.f, enchantCost - (enchantCost / 100) * (eSkill - 10));
|
||||||
|
|
||||||
|
std::string cost = boost::lexical_cast<std::string>(castCost);
|
||||||
|
int currentCharge = int(item.getCellRef().mEnchantmentCharge);
|
||||||
|
if (currentCharge == -1)
|
||||||
|
currentCharge = enchant->mData.mCharge;
|
||||||
|
std::string charge = boost::lexical_cast<std::string>(currentCharge);
|
||||||
if (enchant->mData.mType == ESM::Enchantment::CastOnce)
|
if (enchant->mData.mType == ESM::Enchantment::CastOnce)
|
||||||
{
|
{
|
||||||
// this is Morrowind behaviour
|
// this is Morrowind behaviour
|
||||||
|
@ -295,7 +295,7 @@ namespace MWMechanics
|
|||||||
const float enchantCost = enchantment->mData.mCost;
|
const float enchantCost = enchantment->mData.mCost;
|
||||||
MWMechanics::NpcStats &stats = MWWorld::Class::get(mCaster).getNpcStats(mCaster);
|
MWMechanics::NpcStats &stats = MWWorld::Class::get(mCaster).getNpcStats(mCaster);
|
||||||
int eSkill = stats.getSkill(ESM::Skill::Enchant).getModified();
|
int eSkill = stats.getSkill(ESM::Skill::Enchant).getModified();
|
||||||
const float castCost = enchantCost - (enchantCost / 100) * (eSkill - 10);
|
const int castCost = std::max(1.f, enchantCost - (enchantCost / 100) * (eSkill - 10));
|
||||||
|
|
||||||
if (item.getCellRef().mEnchantmentCharge == -1)
|
if (item.getCellRef().mEnchantmentCharge == -1)
|
||||||
item.getCellRef().mEnchantmentCharge = enchantment->mData.mCharge;
|
item.getCellRef().mEnchantmentCharge = enchantment->mData.mCharge;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user