Script Name: Spike Corridor v0.9 By: Haelix
What it Does: Creates a Spiked Corridor with timed spikes popping up
in sequence..."if" you can run through them when they are down goody, "else"
you get spiked, hehe. Adds a little old school, run through the timed
spikes, D&D style action. Requires actual hand-eye timing, not based on a pc
dex stat.
I am going out of town for a week and i figured i should contribute
something, considering how much info i have kiefed from these boards..heh.
This is straight out of a small portion of my Mod, The Siege of Avondale.
Laters....
Requires: 1 invisible object, 3 triggers, 3 waypoints, these 4
scripts. (more details about use in the timer script)
sc_timer script to go into the onheartbeat of the invis. object:
NWScript:
void main()
{
DelayCommand(1.0f,SetLocalInt(OBJECT_SELF, "nTimer", 1));
DelayCommand(3.0f,SetLocalInt(OBJECT_SELF, "nTimer", 2));
DelayCommand(5.0f,SetLocalInt(OBJECT_SELF, "nTimer", 3));
DelayCommand(1.0f,ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_SPIKE_TRAP), GetLocation(GetWaypointByTag("wp_st_01")), 2.0f));
DelayCommand(3.0f,ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_SPIKE_TRAP), GetLocation(GetWaypointByTag("wp_st_02")), 2.0f));
DelayCommand(5.0f,ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_SPIKE_TRAP), GetLocation(GetWaypointByTag("wp_st_03")), 2.0f));
}
Script to be placed in the onenter of the first trigger:
NWScript: void main()
{
object oTime = GetObjectByTag("it_timer");
int nTime = GetLocalInt(oTime, "nTimer");
object oPc = GetEnteringObject();
if (GetIsPC (oPc))
{
if(nTime==1)
{
int nDamageAmmount = 50;
effect eEffectDamage = EffectDamage(50, DAMAGE_TYPE_PIERCING, DAMAGE_POWER_NORMAL);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffectDamage, oPc, 1.0f);
}
}
}
Script to be placed in the onenter of the second trigger:
NWScript: void main()
{
object oTime = GetObjectByTag("it_timer");
int nTime = GetLocalInt(oTime, "nTimer");
object oPc = GetEnteringObject();
if (GetIsPC (oPc))
{
if(nTime==2)
{
int nDamageAmmount = 50;
effect eEffectDamage = EffectDamage(50, DAMAGE_TYPE_PIERCING, DAMAGE_POWER_NORMAL);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffectDamage, oPc, 1.0f);
}
}
}
Script to be placed on the onenter of the third trigger:
NWScript: void main()
{
object oTime = GetObjectByTag("it_timer");
int nTime = GetLocalInt(oTime, "nTimer");
object oPc = GetEnteringObject();
if (GetIsPC (oPc))
{
if(nTime==3)
{
int nDamageAmmount = 50;
effect eEffectDamage = EffectDamage(50, DAMAGE_TYPE_PIERCING, DAMAGE_POWER_NORMAL);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffectDamage, oPc, 1.0f);
}
}
}
Final Notes: The invisible object creates the spike effect and sets
the timing variable. The triggers check the timing variable to determine if
you walk over them when the spikes are up, if so they apply 50 spike
damage(easily changeable).
The only real bug with it so far that i need to iron out for the next
release of it is the fact that the triggers only check if the spikes are up
onenter, so you could move over the trigger when they are down and then just
kinda stand there..next time they come up you wont get hurt...however it is
a minor bug and overall the effect is quite convincing..anyone with an idea
of how to have it check if your still standing there when the spikes come up
again post it..i will work it in, i'll be working on that myself.
Also I am using the spike trap vfx cause i cant for the life of me find the
vfx that nwn uses for the blade wall spell thingy..so you need to place the
spike traps in a narrow corridor area to get the proper visual effect.
|