Initial commit
Initial commit [v9.7]
This commit is contained in:
39
_module/nss/cavein.nss
Normal file
39
_module/nss/cavein.nss
Normal file
@@ -0,0 +1,39 @@
|
||||
void main()
|
||||
{
|
||||
effect eVFX;
|
||||
|
||||
// Get the creature who triggered this event.
|
||||
object oPC = GetEnteringObject();
|
||||
|
||||
// Only fire for (real) PCs.
|
||||
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
|
||||
return;
|
||||
|
||||
// Only fire once.
|
||||
if ( GetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF)) )
|
||||
return;
|
||||
SetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);
|
||||
|
||||
object oSelf = OBJECT_SELF;
|
||||
|
||||
//effect eVFX;
|
||||
// Apply a visual effect.
|
||||
eVFX = EffectVisualEffect(VFX_COM_CHUNK_STONE_MEDIUM);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oPC);
|
||||
|
||||
// Have text appear over the PC's head.
|
||||
FloatingTextStringOnCreature("Cave-In!", oPC);
|
||||
|
||||
if (!GetIsPC(oPC))return;
|
||||
int DoOnce = GetLocalInt(OBJECT_SELF,GetTag(OBJECT_SELF));
|
||||
if (DoOnce==TRUE)return;
|
||||
SetLocalInt(OBJECT_SELF,GetTag(OBJECT_SELF),TRUE);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SCREEN_SHAKE),oPC);
|
||||
PlaySound("as_na_rockfallg2");
|
||||
AssignCommand(oPC,ClearAllActions());
|
||||
AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT,1.0,999.0));
|
||||
|
||||
// Destroy an object (not fully effective until this script ends).
|
||||
DelayCommand(3.0, DestroyObject(oSelf));
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user