//:://///////////////////////////////////////////// //:: Time Stop //:: NW_S0_TimeStop.nss //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* All persons in the Area are frozen in time except the caster. */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: Jan 7, 2002 //::////////////////////////////////////////////// //:: modified by mr_bumpkin Dec 4, 2003 //#include "spinc_common" #include "NW_I0_GENERIC" #include "x2_inc_spellhook" #include "NW_I0_SPELLS" #include "nw_i0_2q4luskan" // 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 int iroll = ((d4(1)) + 1); // Actual rounds float fDur = IntToFloat(iroll)*6.0; float fDist = 20.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) && (GetIsPC(oEffector) == FALSE) && (GetIsDMPossessed(oEffector) == FALSE)) { // 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)); if (GetPlotFlag(oEffector) == TRUE){ SetPlotFlag(oEffector, FALSE); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectPetrify(),oEffector,fDur); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION),oEffector,fDur); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_GLOW_LIGHT_BLUE),oEffector,fDur); SetPlotFlag(oEffector, TRUE); } else { ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectPetrify(),oEffector,fDur); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION),oEffector,fDur); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_GLOW_LIGHT_BLUE),oEffector,fDur); SetPlotFlag(oEffector, TRUE); DelayCommand(fDur, SetPlotFlag(oEffector, FALSE)); } /* effect eEffect = GetFirstEffect(oEffector); int nType; while (GetIsEffectValid(eEffect) == TRUE) { nType = GetEffectType(eEffect); if((nType == EFFECT_TYPE_VISUALEFFECT) && (GetEffectSpellId(eEffect) == SPELL_TIME_STOP)) RemoveEffect(oEffector, eEffect); eEffect = GetNextEffect(oEffector); }*/ } // 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 = GetFirstObjectInArea(GetArea(oTarget)); while(GetIsObjectValid(oNearestC)) { // To make sure it doesn't stop the caster or caster's familiar, first henchman, or summons if ((oNearestC != oTarget) && (GetObjectType(oNearestC) == OBJECT_TYPE_CREATURE)) // (GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oTarget) != oNearestC) && // (GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oTarget) != oNearestC) && // (GetAssociate(ASSOCIATE_TYPE_SUMMONED, oTarget) != oNearestC)) { // Start the Time Stop effects DelayCommand(0.75,TSEffects(oNearestC,oTarget)); } // Get the next creature in the fDist meter radius and continue loop oNearestC = GetNextObjectInArea(GetArea(oTarget)); } } // Begin Main Function void main() { DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_TRANSMUTATION); /* Spellcast Hook Code Added 2003-06-20 by Georg If you want to make changes to all spells, check x2_inc_spellhook.nss to find out more */ if (!X2PreSpellCastCode()) { // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell // return; } // End of Spell Cast Hook //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()); DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); // Getting rid of the integer used to hold the spells spell school }