Neverwinter Vault

Expand AllContract All -Site -My Profile -Features

Neverwinter Nights 2

-NWN2 Files -NWN2 Game Info -NWN2 Resources -NWN2 Community

Neverwinter Nights

-NWN Files -NWN Game Info -NWN Resources -NWN Community

Vault Network
RPG Vault
VN Boards
IGN Vault
Vault Wiki
· Age of Conan
· Anarchy Online
· Asheron's Call
· Dark Age of Camelot
· City of Heroes
· D&D
· EVE Online
· EverQuest
· EverQuest 2
· Final Fantasy
· Guild Wars
· Lineage 2
· Lord of the Rings Online
· Middle Earth
· Neverwinter Nights
· Pirates of the Burning Sea
· Rise of the Argonauts
· Star Wars Galaxies
· Tabula Rasa
· The Matrix Online
· The Witcher
· Titan Quest
· Two Worlds
· Vanguard
· Warhammer
· World of Warcraft

Planet Network
Planet Hub

IGN
Games
Cheats
Entertainment

The Web   The Site  



NWN SCRIPTS

- Jump to comments -
Title  Ultimate Time Stop
Author  Donwulff
Submitted / Updated  02-23-2006 / 11-22-2006
Category  Spells
Expansions  Requires Both Expansions (SoU & HotU)
View Code  

Select All Text | View Code in separate window
Format  Module Only
Type  Type - Combat
Description
The purpose of this script is to limit Time Stop effect to area only, instead of whole server as the default timestop does. This is, ofcourse, highly desirable by PW's and occasionally by other multiplayer settings.

I want to thank MadRabbit who made using EffectCutsceneParalyze() and re-applying effect public so that I can post my own version without having to worry about my former PW sending shadowy assassins to silence me. It appears few other people, including Voxelus 41, have had same idea but I didn't notice them before. This script was completely rewritten by me from scratch (aka Bioware script) just a few minutes ago, so it has not received a lot of testing, but the concept has been in use without problems for years.

As an additional bonus, I have included three builder-configurable options. The first is to select whether you want to affect the casters associates or not. Set const int iHench = TRUE; to let your associates act during timestop. Looking through the vault this seemed popular. The second will let you affect sub-area only; set const float fSize = -1.0f; to the desired radius of the circle to stop time in. Set to negative values to affect whole area. Finally, set const int iClassic = TRUE; if you want Time Stop victims to be protected from offensive like with the PnP version.

NOTE: If iClassic is set to TRUE, you MUST call SetPlotFlag(oPC, FALSE); in your OnClientEnter event or players will be left invulnerable!! If you do that, it SHOULD be reliable, but just leave iClassic to FALSE if you're paranoid. Also, NPC's have no idea they won't be able to attack timestopped PC's, so only give them Time Stop if they do lots of buffs.

Features:
* Uses EffectCutsceneParalyze() for that perfect timestop effect
* Adds VFX_DUR_FREEZE_ANIMATION to make victioms LOOK time-frozen
* VFX_DUR_CUTSCENE_INVISIBILITY for undetectability as in SRD
* Timestop effect is non-dispellable
* Re-applies effect every second to catch late arrivals
* Works either for whole area or circle, builder decision
* Can protect victims against physical harm as per PnP rules
* Allows excluding direct associates of caster, builder setting
* Duration d4+1 rounds as per PnP rules, caster informed of duration
* Victims notified why they just froze
* DM's are never affected, but DM controlled NPC's are
* Plot flagged creatures are left flagged as Plot
* Now with support for Scarface's NO_PVP area-flag
* Internationalized
* Highly efficient

Please do not read the source code, due to high amount of customization it is not really meant to be human-readable :)

Files

NameTypeSizeDownloads
NO FILES
SCORE OUT OF 10
10
3 votes
View Stats
Cast Your Vote!

PORTFOLIO
Add this entry to your portfolio so you can track it
Manage your existing portfolios or create a new one.
SCREENS
No Images




You Must Be Logged In to Participate.
Comments (15):

Posted by luckybastardo at 2009-09-30 15:08:38    Voted 10.00 on 09/30/09
Superb

Posted by Caileanirl at 2007-06-17 15:45:10    Voted 10.00 on 06/17/07
Does exactly what I want thank you for adding it to the vault.

Posted by Lord_Fear at 2006-05-23 11:36:20    
I think I see what happened. You have the wording wrong...
const int iClassic = TRUE; // Should the caster be able to damage timefrozen targets.
And up above you describe it as this.
Finally, set const int iClassic = TRUE; if you want Time Stop victims to be protected from offensive like with the PnP version.
This line would be better written as:
const int iClassic = TRUE; // Set TRUE to protect players from dmg. during timestop.
I will go set it to TRUE and see if that cures my problem.

Posted by Lord_Fear at 2006-05-23 11:23:13    
I installed this in my PW and it seems to work fine except if the mage runs up and attacks with his weapon it still does dmg. His spells don't work on players but his weapon does. iClassic = FALSE

Posted by donwulff at 2006-02-28 01:46:57    
Big_Shoe: Thanks for the feedback. I considered putting in an optionf for a timer there myself, but there's a limit even to my preference for configurability :) Neither Bioware nor PnP prohibits chaining timestops, but at least if you use the PnP version the caster can't IGMS during the spell anyway. Ofcourse, it would allow freezing other players for several minutes, which is worse than the cost of death on many servers when you think about it, so at least on PvP servers it may be desirable.

Posted by Lanessar at 2006-02-27 16:01:46    Voted 10.00 on 02/27/06
While this is not "new", this puts the spell functions into a nice format so that I can tweak the effects to my liking pretty easily.

Past the problem with NPCs casting and OCE additions, it's pretty well done.
_________________________
Lan's Placeable Groups v1.5

Posted by Big_Shoe at 2006-02-27 06:35:46    
Donwulff, here is a modification of your nice Time Stop script that I hope you will like. It sets a one minute "lock timer" when Time Stop is cast that prevents that player from casting it again until the timer runs out. This prevents looping of Time Stop spells, which is nasty when combined with things like IGMS. The caster receives a message about the timer at various intervals, and is informed when he can cast Time Stop again. The lock duration and message prompts are all builder customizable simply by changing the numbers. Here is the your code with the timer added and commented:

//::///////////////////////////////////////////////
//:: 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
//:://////////////////////////////////////////////

#include "x2_inc_spellhook"

const int iHench = FALSE; // Some people prefer to not affect henchmen.
const float fSize = -1.0f; // Some people don't want to effect whole area.
const int iClassic = TRUE; // Should the caster be able to damage timefrozen targets.

void ApplyTimestop(object oCaster, float fTime)
{
location lTarget = GetLocation(oCaster);
object oArea = GetArea(oCaster);
object oTarget;

effect eParalyze = EffectCutsceneParalyze();
effect eFreeze = EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION);
eParalyze = EffectLinkEffects(eParalyze, eFreeze);

if(fSize > 0.0)
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, fSize, lTarget);
else
oTarget = GetFirstObjectInArea(oArea);
while(GetIsObjectValid(oTarget) == TRUE)
{
if(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE &&
GetHasSpellEffect(GetSpellId(), oTarget) == FALSE &&
GetIsDM(oTarget) == FALSE)
{
if(oTarget != oCaster ||
(iHench == TRUE && oTarget != GetMaster(oCaster)))
{
if(GetIsPC(oTarget) == TRUE)
{
FloatingTextStringOnCreature("* "+GetStringByStrRef(935)+" *", oTarget, FALSE);
}
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eParalyze, oTarget, fTime);
if(iClassic == TRUE && GetPlotFlag(oTarget) == FALSE)
{
SetPlotFlag(oTarget, TRUE);
AssignCommand(GetModule(), DelayCommand(fTime, SetPlotFlag(oTarget, FALSE)));
}
}
}
if(fSize > 0.0)
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, fSize, lTarget);
else
oTarget = GetNextObjectInArea(oArea);
}
if(fTime > 1.0f)
DelayCommand(1.0f, ApplyTimestop(oCaster, fTime - 1.0f));
}

//Spell Time Lock duration (in seconds, use float values)
float iLockTimer = 60.0;
//Defining time variables
float f30togo = ( 30 - iLockTimer ) * -1;
float f10togo = ( 10 - iLockTimer ) * -1;

//Checking spell's caster
object oTarget = GetSpellTargetObject();
//Checking if he used GS recently
int iTimer = GetLocalInt(oTarget, "TSTimer");

void main()
{

/*
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


//Declare major variables
object oCaster = OBJECT_SELF;
location lTarget = GetSpellTargetLocation();
effect eVis = EffectVisualEffect(VFX_FNF_TIME_STOP);
effect eInvis = EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY);
// Change here to modify spell duration, this according to PnP 3.0 SRD
float fTime = RoundsToSeconds( d4(1) + 1 );
// If iClassic isn't set, use NWN default timestop duration instead.
if(iClassic == FALSE)
{
fTime = 9.0f;
}
//Set the timer
if (iTimer == 0)
{
SetLocalInt(oTarget, "TSTimer", 1);

//Fire cast spell at event for the specified target
SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, SPELL_TIME_STOP, FALSE));

//Apply the VFX impact and effects
if (!GetLocalInt(GetArea(oCaster), "NO_PVP")) {
DelayCommand(0.75, ApplyTimestop(oCaster, fTime));
}
DelayCommand(0.75, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eInvis, oCaster, fTime));

ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lTarget);

//Let caster know duration of effect.
FloatingTextStringOnCreature("* "+GetStringByStrRef(935)+" "+FloatToString(fTime,0,0)+"s *", oCaster, FALSE);

// Timer messages
SendMessageToPC(oTarget, "Time Stop has a timer of "+FloatToString(iLockTimer, 3, 1)+" seconds. You may not use Time Stop again for this period of time. Attempting to do so will waste the spell.");
DelayCommand(f30togo, SendMessageToPC(oTarget, "You have 30 seconds left on your Time Stop Lock Timer."));
DelayCommand(f10togo, SendMessageToPC(oTarget, "You have 10 seconds left on your Time Stop Lock Timer."));
DelayCommand(iLockTimer, SendMessageToPC(oTarget, "Time Stop is once again available for use."));
DelayCommand(iLockTimer, SetLocalInt(oTarget, "TSTimer", 0));
}

else
{
SendMessageToPC(oTarget, "You have used Time Stop too recently. The effect has been cancelled");
}

}

_________________________
Realms Of Destiny PW

Posted by donwulff at 2006-02-26 15:51:38    
I had a look at the 3.5 edition Time Stop, it clarifies the wording but has essentially stayed the same EXCEPT that the parenthesised comment about AoE spell duration not starting until Time Stop is over has been dropped. It can still be interepreted both ways, but because this was change of wording from 3.0 I believe the intention was that spell duration passes normally during timestop. Therefore, with iClassic set to TRUE this script can be seen as exact implementation of 3.5 Time Stop (and pretty close for 3.0). With iClassic left to FALSE, it's simply multiplayer friendly implementation of Bioware Time Stop.

Posted by donwulff at 2006-02-25 10:07:24    
Ok, added support for Scarface's NO_PVP flag. I've also modified defaults a bit in that if iClassic is FALSE it will use NWN default parameters, duration 9 seconds and fire at will. If iClassic is set to TRUE, it will use classic PnP SRD 3.0 default parameters - 1d4 + 1 rounds and timestopped targets protected from harm.

NOTE if you set iClassic to TRUE you will still need to add SetPlotFLag(OBJECT_SELF, FALSE); to OnClientEnter script and deal with NPC's that have TimeStop.

One of the best alternatives to fixing NPC's timestop use is putting into chooseTactics in NW_I0_GENERIC.NSS something like:
if(GetHasSpellEffect(SPELL_TIME_STOP, oIntruder))
nMagic = 100; nCompassion = 100; nOffense = 7;

This will ensure they will spend their time first buffing others and then themselves before moving to magic attacks. Unfortunately there is no easy way to restrict them into duration-based spells, but you need to take some care assigning their spells anyway, ie. giving them just Time Stop + IGMS is a poor idea in any case. AoE with duration is your best bet, they won't be used when the players have chance to move into melee anyway.

Posted by philipmilliorn at 2006-02-25 07:23:33    
ok...there was no need for scarface to apologize here. there is no affiliation in identity. what i said is my opinon. idk wtf or why he posted a comment, other than his name was mentioned in my post. his name is mentioned for authorship only though. thus, if this has created negativity, let it be drawn to me.

Posted by +scarface+ at 2006-02-25 04:08:38    
I appologize for the last posters comment although it has nothing to do with me, just making that completely clear.
_________________________
§çà®Fãçë�

NWN1 Submissions:
[Persistent Banking] - [Character Appearance Modifier]
[XP/GP Distribution] - [Item Crafting] - [Socketed Items]

NWN2 Submissions:
[Persistent Banking]

Posted by philipmilliorn at 2006-02-24 23:51:47    
i would vote a zero.......but im not flaming......but this is not effective this code for pvp pw world. here is an effective code...that works, its fair an balanced. no bugs ever. customizable.

//::////////////////////////////////////////////////////////////////////////////
//:: Scarface's Timestop Replacement
//:: This will replace the default "nw_s0_timestop" script
//:: For use with Scarface's No PVP Exploit Fixes
//::////////////////////////////////////////////////////////////////////////////
/*
Constants
*/
//:: Set the distance radius for for those to be effected by the spell
const int DISTANCE_TO_CASTER = 15; // Meters

//:: Example of the DICE_ROLL and MIN_DURATION:
//:: If the MIN_DURATION was set to 5 seconds (default) and the DICE_ROLL set
//:: to 4 (default) that would mean the spell would last a minumum 5 on a
//:: dice roll of 1, and a maximum 20 seconds on a dice roll of 4.

//:: Set the Minumum duration for the spell, this will be multiplied
//:: by the dice roll below
const int MIN_DURATION = 5; // Seconds minumum

//:: Set how many sided dice to roll to multiply the minumum duration
const int DICE_ROLL = 4; // Sided Dice

#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
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

object oCaster = OBJECT_SELF;
int iRoll = Random(DICE_ROLL)+1 * MIN_DURATION;
location lLoc = GetSpellTargetLocation();
effect eTimeStop = EffectVisualEffect(VFX_FNF_TIME_STOP);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eTimeStop, lLoc);
if (!GetLocalInt(GetArea(oCaster), "NO_PVP"))
{
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, IntToFloat(DISTANCE_TO_CASTER),lLoc, FALSE, OBJECT_TYPE_CREATURE);
while (GetIsObjectValid(oTarget))
{
if (oTarget != oCaster)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectCutsceneParalyze(), oTarget, IntToFloat(iRoll));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION), oTarget, IntToFloat(iRoll));
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, IntToFloat(DISTANCE_TO_CASTER),lLoc, FALSE, OBJECT_TYPE_CREATURE);
}
}
}
//now hopefully i got everything correct for compiling =)

Posted by donwulff at 2006-02-24 12:37:40    
Someone pointed out to me that in their opinion a PnP Time Stop should also prevent dispelling ANY effects from opponents. I considered this for a while, but the SRD wording of "can create spell effects" implies they can still manipulate magic itself. Therefore as a DM I would allow dispell for consistency. Yes I know, mighty convenient. There isn't actually an easy way to prevent dispells from working - I will be thinking about the problem, though.

Posted by donwulff at 2006-02-23 22:27:46    
This should be as close to true PnP Time Stop as possible if you set iClassic to TRUE. It's not clear if the character should know the duration of the timestop, but in PnP the player generally knows (unless DM rolls hidden, but there's no suggestion they should). According to SRD, "Energy and effects present can still harm the character. While the time stop is in effect, other creatures are invulnerable to the character's attacks and spells; however, the character can create spell effects and leave them to take effect when the time stop spell ends. (The spells� durations do not begin until the time stop is over.)" The condition in the final parenthesis cannot be reproduced without complete overhaul of the NWN spell-system, so that's where the implementation differs from PnP.

Personally I prefer to have the spell affect whole area, as affecting radius only can lead to minor inconsistensies. Say the character chain-timestops to run to pick up a weapon at the other end of the area, meanwhile the intended victim gets out from under timestop and escapes. On busy servers/large ares radius might be preferred.

Posted by donwulff at 2006-02-23 22:14:42    
There is a god rule of thumb that player characters should NEVER be SetPlotFlag(TRUE), because they're bound to find some way to make that stick. Generally, I agree with that view, however the alternative is to construct effect link with every kind of immunity possible and apply that. It's inefficient and ugly, and that's invariably also wrong. I can't think of a way players could shrug off the un-plotting set on module delay save by logging off which would be caught by OnClientEnter, but I have made iClassic default to off in any case.

You must be Logged In to post comments in this section.

 
Most recent posts on the MMO General Boards
Analyst: Star Wars: The Old Republic Could...Analyst: Star Wars: The Old Republic Could Sell 3M: more numbers
- last reply by Acao on Aug 15, 2011 06:15 PM
which class will your first character be
- last reply by Blisteringballs on Aug 15, 2011 05:50 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 05:00 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 04:00 PM
NWN Idea Database Update
- posted by Vault_News on Aug 15, 2011 03:46 PM
Missing Votes for NWN2 Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:40 PM
Missing Votes for NWN Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:39 PM
Random Questions and game altering suggest...Random Questions and game altering suggestions!!!
- last reply by ArkadyTepes on Aug 15, 2011 03:22 PM
State of the game?
- last reply by LyricOpera on Aug 15, 2011 01:37 PM
Yesterday streaming, now demanding downloa...Yesterday streaming, now demanding download :(
- last reply by Sinane-tk on Aug 15, 2011 10:23 AM
 

   


IGN Entertainment
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.
Copyright 1996-2011, IGN Entertainment, Inc. | Support | Privacy Policy | User Agreement | RSS Feeds
IGN’s enterprise databases running Oracle, SQL and MySQL are professionally monitored and managed by Pythian Remote DBA.


NWN2 Hall of Fame

HOF NWN2 Visual Effects


View all Hall of Fame entries


Neverwinter Nights 2

TOP NWN2 Modules

NEW Modules

NEW Reviews

NEW INTL. Modules

TOP Hakpaks

TOP Gameworlds

TOP Tutorials

TOP Prefab:Areas

TOP Blueprints

TOP Plugins

TOP UI

TOP Other

TOP Visual Effects

TOP Scripts

TOP Tools

TOP Movies

TOP Models

TOP Characters





Hall of Fame

HOF NWN Modules


View all Hall of Fame entries


TOP NWN Modules

NEW NWN Modules

NEW Reviews

TOP Intl. Modules

TOP NWN Hakpaks

TOP NWN Gameworlds

TOP NWN Models

TOP NWN Portraits

TOP NWN Scripts

TOP NWN Prefabs

TOP NWN Other

TOP NWN Movies

TOP Sounds

TOP NWN Textures

TOP NWN Creatures

TOP NWN Characters