I changed the timestop spell like you said so it looked like this:
#include "NW_I0_GENERIC"
#include "NW_I0_SPELLS"
#include "x2_inc_spellhook"
// Customize User Defined Variables
//float fDur = 15.0; // Duration in seconds -- Change this to however long you want Time Stop to last Uncomment and Comment out 3rd ed duration
// This is the formula for accurate 3rd ed. Duration
float fDur = IntToFloat(d4(1)+1)*6.0; // Least duration is 12 seconds, maximum duration is 30 seconds
float fDist = 10.0; // Radius in meters -- for a wider area of affect increase this float
// Function to resume creature(s) previous actions wrapped for Delay
void ResumeLast(object oResumee, object oIntruder)
{
// Delay DetermineCombatRound
DelayCommand(fDur+0.25,AssignCommand(oResumee,DetermineCombatRound(oIntruder)));
}
// Function to control Time Stop effects
void TSEffects(object oEffector, object oCaster)
{
// Check if stopped creature is a hostile
if (GetIsReactionTypeHostile(oCaster,oEffector) == TRUE)
{
// Start the resume combat round after Time Stop
ResumeLast(oEffector, oCaster);
}
// Clear the creature(s) action que
AssignCommand(oEffector,ClearAllActions(TRUE));
// Make module dominate the creature(s) for fDur seconds & Freeze the Animation to look like time stopped
AssignCommand(GetModule(),ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectCutsceneDominated(),oEffector,fDur));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION),oEffector,fDur);
}
// Function to get creature(s) within radius and apply the alternate Time Stop
void TimeStop(object oTarget)
{
object oNearestC; // Define nearest creature
// Begin loop to find all creatures within the fDist meter radius
oNearestC = GetFirstObjectInShape(SHAPE_SPHERE, fDist, GetSpellTargetLocation(), FALSE, OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oNearestC))
{
// To make sure it doesn't stop the caster or caster's familiar, first henchman, or summons
GetIsReactionTypeHostile(oNearestC);
{
if (!MyResistSpell(OBJECT_SELF, oTarget))
{
//Make Will Save to negate effect
if (!/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_MIND_SPELLS))
{
// Start the Time Stop effects
DelayCommand(0.75,TSEffects(oNearestC,oTarget));
}
else
{
effect eVisWill = EffectVisualEffect(VFX_IMP_WILL_SAVING_THROW_USE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisWill, oNearestC);
}
}
}
// Get the next creature in the fDist meter radius and continue loop
oNearestC = GetNextObjectInShape(SHAPE_SPHERE, fDist, GetSpellTargetLocation(), FALSE, OBJECT_TYPE_CREATURE);
}
}
// Begin Main Function
void main()
{
//Signal event to start the Time Stop
SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, SPELL_TIME_STOP, FALSE));
// Begin custom Time Stop
TimeStop(OBJECT_SELF);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_TIME_STOP), GetSpellTargetLocation());
}
But this line doesn't work the way it should:
GetIsReactionTypeHostile(oNearestC);
When the spell is cast still each creature in a 10m radius does a will save and is dominated if it fails, even the caster.
Then I tried to remove it with this line:
if (spellsIsTarget(oNearestC, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) && oNearestC != OBJECT_SELF)
but then I got an error message like:
"no right bracket in expression" ... sorry if the translation is not correct I have the german toolset
What wrong now??