|
|
|
@ -295,17 +295,6 @@ namespace MWMechanics
|
|
|
|
|
return true; // must still apply to get visual effect and have target regard it as attack
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case ESM::MagicEffect::AlmsiviIntervention:
|
|
|
|
|
case ESM::MagicEffect::DivineIntervention:
|
|
|
|
|
case ESM::MagicEffect::Mark:
|
|
|
|
|
case ESM::MagicEffect::Recall:
|
|
|
|
|
if (!MWBase::Environment::get().getWorld()->isTeleportingEnabled())
|
|
|
|
|
{
|
|
|
|
|
if (castByPlayer)
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sTeleportDisabled}");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case ESM::MagicEffect::WaterWalking:
|
|
|
|
|
if (target.getClass().isPureWaterCreature(target) && MWBase::Environment::get().getWorld()->isSwimming(target))
|
|
|
|
|
return false;
|
|
|
|
@ -747,21 +736,19 @@ namespace MWMechanics
|
|
|
|
|
else if (target.getClass().isActor() && target == getPlayer())
|
|
|
|
|
{
|
|
|
|
|
MWRender::Animation* anim = MWBase::Environment::get().getWorld()->getAnimation(mCaster);
|
|
|
|
|
bool teleportingEnabled = MWBase::Environment::get().getWorld()->isTeleportingEnabled();
|
|
|
|
|
|
|
|
|
|
if (effectId == ESM::MagicEffect::DivineIntervention)
|
|
|
|
|
{
|
|
|
|
|
MWBase::Environment::get().getWorld()->teleportToClosestMarker(target, "divinemarker");
|
|
|
|
|
anim->removeEffect(ESM::MagicEffect::DivineIntervention);
|
|
|
|
|
const ESM::Static* fx = MWBase::Environment::get().getWorld()->getStore().get<ESM::Static>()
|
|
|
|
|
.search("VFX_Summon_end");
|
|
|
|
|
if (fx)
|
|
|
|
|
anim->addEffect("meshes\\" + fx->mModel, -1);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else if (effectId == ESM::MagicEffect::AlmsiviIntervention)
|
|
|
|
|
if (effectId == ESM::MagicEffect::DivineIntervention || effectId == ESM::MagicEffect::AlmsiviIntervention)
|
|
|
|
|
{
|
|
|
|
|
MWBase::Environment::get().getWorld()->teleportToClosestMarker(target, "templemarker");
|
|
|
|
|
anim->removeEffect(ESM::MagicEffect::AlmsiviIntervention);
|
|
|
|
|
if (!teleportingEnabled)
|
|
|
|
|
{
|
|
|
|
|
if (caster == getPlayer())
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sTeleportDisabled}");
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
std::string marker = (effectId == ESM::MagicEffect::DivineIntervention) ? "divinemarker" : "templemarker";
|
|
|
|
|
MWBase::Environment::get().getWorld()->teleportToClosestMarker(target, marker);
|
|
|
|
|
anim->removeEffect(effectId);
|
|
|
|
|
const ESM::Static* fx = MWBase::Environment::get().getWorld()->getStore().get<ESM::Static>()
|
|
|
|
|
.search("VFX_Summon_end");
|
|
|
|
|
if (fx)
|
|
|
|
@ -770,12 +757,26 @@ namespace MWMechanics
|
|
|
|
|
}
|
|
|
|
|
else if (effectId == ESM::MagicEffect::Mark)
|
|
|
|
|
{
|
|
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().markPosition(
|
|
|
|
|
target.getCell(), target.getRefData().getPosition());
|
|
|
|
|
if (teleportingEnabled)
|
|
|
|
|
{
|
|
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().markPosition(
|
|
|
|
|
target.getCell(), target.getRefData().getPosition());
|
|
|
|
|
}
|
|
|
|
|
else if (caster == getPlayer())
|
|
|
|
|
{
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sTeleportDisabled}");
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else if (effectId == ESM::MagicEffect::Recall)
|
|
|
|
|
{
|
|
|
|
|
if (!teleportingEnabled)
|
|
|
|
|
{
|
|
|
|
|
if (caster == getPlayer())
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sTeleportDisabled}");
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MWWorld::CellStore* markedCell = nullptr;
|
|
|
|
|
ESM::Position markedPosition;
|
|
|
|
|
|
|
|
|
@ -785,7 +786,7 @@ namespace MWMechanics
|
|
|
|
|
MWWorld::ActionTeleport action(markedCell->isExterior() ? "" : markedCell->getCell()->mName,
|
|
|
|
|
markedPosition, false);
|
|
|
|
|
action.execute(target);
|
|
|
|
|
anim->removeEffect(ESM::MagicEffect::Recall);
|
|
|
|
|
anim->removeEffect(effectId);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|