|
|
@ -149,14 +149,20 @@ namespace MWMechanics
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MWWorld::Ptr mCreature;
|
|
|
|
MWWorld::Ptr mCreature;
|
|
|
|
MWWorld::Ptr mActor;
|
|
|
|
MWWorld::Ptr mActor;
|
|
|
|
|
|
|
|
bool mTrapped;
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
SoulTrap(MWWorld::Ptr trappedCreature)
|
|
|
|
SoulTrap(MWWorld::Ptr trappedCreature)
|
|
|
|
: mCreature(trappedCreature) {}
|
|
|
|
: mCreature(trappedCreature)
|
|
|
|
|
|
|
|
, mTrapped(false)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
virtual void visit (MWMechanics::EffectKey key,
|
|
|
|
virtual void visit (MWMechanics::EffectKey key,
|
|
|
|
const std::string& sourceName, const std::string& sourceId, int casterActorId,
|
|
|
|
const std::string& sourceName, const std::string& sourceId, int casterActorId,
|
|
|
|
float magnitude, float remainingTime = -1, float totalTime = -1)
|
|
|
|
float magnitude, float remainingTime = -1, float totalTime = -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (mTrapped)
|
|
|
|
|
|
|
|
return;
|
|
|
|
if (key.mId != ESM::MagicEffect::Soultrap)
|
|
|
|
if (key.mId != ESM::MagicEffect::Soultrap)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
if (magnitude <= 0)
|
|
|
|
if (magnitude <= 0)
|
|
|
@ -203,6 +209,8 @@ namespace MWMechanics
|
|
|
|
gem->getContainerStore()->unstack(*gem, caster);
|
|
|
|
gem->getContainerStore()->unstack(*gem, caster);
|
|
|
|
gem->getCellRef().setSoul(mCreature.getCellRef().getRefId());
|
|
|
|
gem->getCellRef().setSoul(mCreature.getCellRef().getRefId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mTrapped = true;
|
|
|
|
|
|
|
|
|
|
|
|
if (caster == getPlayer())
|
|
|
|
if (caster == getPlayer())
|
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sSoultrapSuccess}");
|
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sSoultrapSuccess}");
|
|
|
|
|
|
|
|
|
|
|
|