|
|
@ -25,6 +25,7 @@
|
|
|
|
#include "../mwmechanics/creaturestats.hpp"
|
|
|
|
#include "../mwmechanics/creaturestats.hpp"
|
|
|
|
#include "../mwmechanics/npcstats.hpp"
|
|
|
|
#include "../mwmechanics/npcstats.hpp"
|
|
|
|
#include "../mwmechanics/actorutil.hpp"
|
|
|
|
#include "../mwmechanics/actorutil.hpp"
|
|
|
|
|
|
|
|
#include "../mwmechanics/spellcasting.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
#include "ref.hpp"
|
|
|
|
#include "ref.hpp"
|
|
|
|
|
|
|
|
|
|
|
@ -464,6 +465,16 @@ namespace MWScript
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Apply looping particles immediately for constant effects
|
|
|
|
// Apply looping particles immediately for constant effects
|
|
|
|
MWBase::Environment::get().getWorld()->applyLoopingParticles(ptr);
|
|
|
|
MWBase::Environment::get().getWorld()->applyLoopingParticles(ptr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// The spell may have an instant effect which must be handled immediately.
|
|
|
|
|
|
|
|
for (const auto& effect : creatureStats.getSpells().getMagicEffects())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (effect.second.getMagnitude() <= 0)
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
MWMechanics::CastSpell cast(ptr, ptr);
|
|
|
|
|
|
|
|
if (cast.applyInstantEffect(ptr, ptr, effect.first, effect.second.getMagnitude()))
|
|
|
|
|
|
|
|
creatureStats.getSpells().purgeEffect(effect.first.mId);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|