generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit
This commit is contained in:
50
_module/nss/cont_cryst.nss
Normal file
50
_module/nss/cont_cryst.nss
Normal file
@@ -0,0 +1,50 @@
|
||||
#include "nw_i0_generic"
|
||||
/* Script generated by
|
||||
Lilac Soul's NWN Script Generator, v. 1.6
|
||||
|
||||
For download info, please visit:
|
||||
http://www.lilacsoul.revility.com */
|
||||
|
||||
//Put this OnUsed
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
if (!GetIsPC(oPC)) return;
|
||||
object oTarget;
|
||||
object oMod = GetModule();
|
||||
object oCrystal1 = GetObjectByTag("crystal1");
|
||||
object oCrystal2 = GetObjectByTag("crystal2");
|
||||
object oCrystal3 = GetObjectByTag("crystal3");
|
||||
int lState = GetLocalInt(oMod, "lever_state");
|
||||
if (lState!=1)
|
||||
{
|
||||
SoundObjectPlay(GetObjectByTag("gcsound"));
|
||||
SoundObjectPlay(GetObjectByTag("gcsound2"));
|
||||
PlaySound("gui_select");
|
||||
PlaySound("sce_positive");
|
||||
ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
|
||||
DelayCommand(1.0, FloatingTextStringOnCreature("Power Crystals activated", oPC));
|
||||
//ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
|
||||
DelayCommand(1.0, AssignCommand(oCrystal1, ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE)));
|
||||
DelayCommand(1.0, AssignCommand(oCrystal2, ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE)));
|
||||
DelayCommand(1.0, AssignCommand(oCrystal3, ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE)));
|
||||
SetLocalInt(oMod, "lever_state", 1);
|
||||
RecomputeStaticLighting(GetArea(OBJECT_SELF));
|
||||
}
|
||||
else
|
||||
{
|
||||
//ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
|
||||
PlaySound("gui_select");
|
||||
PlaySound("sce_negative");
|
||||
SoundObjectStop(GetObjectByTag("gcsound"));
|
||||
SoundObjectStop(GetObjectByTag("gcsound2"));
|
||||
ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
|
||||
DelayCommand(1.0, FloatingTextStringOnCreature("Power Crystals deactivated", oPC));
|
||||
DelayCommand(1.0, AssignCommand(oCrystal1, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)));
|
||||
DelayCommand(1.0, AssignCommand(oCrystal2, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)));
|
||||
DelayCommand(1.0, AssignCommand(oCrystal3, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)));
|
||||
SetLocalInt(oMod, "lever_state", 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user