Initial upload
Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
This commit is contained in:
117
_module/nss/jw_negvortex_usd.nss
Normal file
117
_module/nss/jw_negvortex_usd.nss
Normal file
@@ -0,0 +1,117 @@
|
||||
//Generate a random spot around pos
|
||||
vector RandomSpot(vector pos)
|
||||
{
|
||||
vector ret = pos;
|
||||
|
||||
ret.x += IntToFloat(Random(100))/10.0 - 5.0;
|
||||
ret.y += IntToFloat(Random(100))/10.0 - 5.0;
|
||||
//ret.z += IntToFloat(Random(100))/5.0 - 10.0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void RandomBolts(int repeat = 1)
|
||||
{
|
||||
int i;
|
||||
string tag = "jw_lightrod";
|
||||
vector pos = GetPosition(OBJECT_SELF);
|
||||
vector pos2;
|
||||
location loc;
|
||||
effect e = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND);
|
||||
object o1, o2;
|
||||
|
||||
pos2 = RandomSpot(pos);
|
||||
loc = Location(GetArea(OBJECT_SELF), pos2, 0.0);
|
||||
o1 = CreateObject(OBJECT_TYPE_PLACEABLE, tag, loc);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e, o1, 0.3);
|
||||
|
||||
pos2 = RandomSpot(pos);
|
||||
loc = Location(GetArea(OBJECT_SELF), pos2, 0.0);
|
||||
o2 = CreateObject(OBJECT_TYPE_PLACEABLE, tag, loc);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e, o2, 0.3);
|
||||
|
||||
DelayCommand(0.4, DestroyObject(o1));
|
||||
DelayCommand(0.4, DestroyObject(o2));
|
||||
|
||||
/*
|
||||
for(i = 0; i < 2; i++)
|
||||
{
|
||||
pos2 = RandomSpot(pos);
|
||||
loc = Location(GetArea(OBJECT_SELF), pos2, 0.0);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, e, loc, 0.3);
|
||||
}
|
||||
*/
|
||||
|
||||
if(d4() == 1)
|
||||
{
|
||||
//Do a random lightning strike
|
||||
effect lStrike = EffectVisualEffect(VFX_IMP_FROST_L);
|
||||
|
||||
pos2 = RandomSpot(pos);
|
||||
loc = Location(GetArea(OBJECT_SELF), pos2, 0.0);
|
||||
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, lStrike, loc);
|
||||
}
|
||||
|
||||
if(repeat == 1)
|
||||
{
|
||||
DelayCommand(0.5, RandomBolts(0));
|
||||
DelayCommand(1.0, RandomBolts(0));
|
||||
DelayCommand(1.5, RandomBolts(0));
|
||||
DelayCommand(2.0, RandomBolts(0));
|
||||
DelayCommand(2.5, RandomBolts(0));
|
||||
DelayCommand(3.0, RandomBolts(0));
|
||||
DelayCommand(3.5, RandomBolts(0));
|
||||
DelayCommand(4.0, RandomBolts(0));
|
||||
DelayCommand(4.5, RandomBolts(0));
|
||||
DelayCommand(5.0, RandomBolts(0));
|
||||
DelayCommand(5.5, RandomBolts(0));
|
||||
}
|
||||
}
|
||||
|
||||
void ZapTargets()
|
||||
{
|
||||
effect e = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND);
|
||||
effect eDam;
|
||||
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF), TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
int nDamage;
|
||||
|
||||
while (GetIsObjectValid(oTarget))
|
||||
{
|
||||
if (!GetPlotFlag(oTarget)&&(!GetIsFriend(oTarget)))
|
||||
{
|
||||
nDamage = d8(2)+4;
|
||||
nDamage = GetReflexAdjustedDamage(nDamage, oTarget, 24, SAVING_THROW_TYPE_EVIL);
|
||||
eDam = EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE);
|
||||
if(nDamage > 0 )
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e, oTarget, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF), TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
}
|
||||
}
|
||||
|
||||
void Heartbeat()
|
||||
{
|
||||
//RandomBolts();
|
||||
ZapTargets();
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
int u = GetUserDefinedEventNumber();
|
||||
|
||||
if(u == 1001)
|
||||
{
|
||||
//create five random bolts and fire them off, then zap
|
||||
//whatever's close
|
||||
Heartbeat();
|
||||
}
|
||||
else if(u == 1007)
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_DISPEL_GREATER),OBJECT_SELF);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user