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 :)
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.
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
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
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.
// 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");
}
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.
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.
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.
I appologize for the last posters comment although it has nothing to do with me, just making that completely clear. _________________________ §çà®Fãçë�
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 =)
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.
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.
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.