Battledale_PRC8/_module/nss/ty_alcovetrig2.nss
Jaysyn904 7b9e44ebbb 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.
2024-03-11 23:44:08 -04:00

48 lines
3.3 KiB
Plaintext

void main()
{
object oPedestal = GetObjectByTag("alc2pedestal");
object oPC = GetEnteringObject();
int iLuck = d2(1);
object oTrapStatue1 = GetObjectByTag("a2trapstatue1");
object oTrapStatue2 = GetObjectByTag("a2trapstatue2");
object oTrapStatue3 = GetObjectByTag("a2trapstatue3");
object oTrapStatue4 = GetObjectByTag("a2trapstatue4");
object oTrapStatue5 = GetObjectByTag("a2trapstatue5");
if(GetLocalInt(oPedestal, "alc2_trapset") == 1)
{
AssignCommand(GetNearestObject(OBJECT_TYPE_PLACEABLE, oPC), PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
if (iLuck == 1)
{
int iDamage = GetMaxHitPoints(oPC);
int nDamageAmount = FloatToInt(0.75 * iDamage);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamageAmount, DAMAGE_TYPE_ELECTRICAL), oPC);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oTrapStatue1, BODY_NODE_CHEST, FALSE), oPC, 3.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oTrapStatue2, BODY_NODE_CHEST, FALSE), oPC, 3.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oTrapStatue3, BODY_NODE_CHEST, FALSE), oPC, 3.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oTrapStatue4, BODY_NODE_CHEST, FALSE), oPC, 3.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oTrapStatue5, BODY_NODE_CHEST, FALSE), oPC, 3.0);
CreateObject(OBJECT_TYPE_PLACEABLE, "plc_weathmark", GetLocation(oPC), TRUE);
AssignCommand(oPC, PlaySound("al_mg_jacobs1"));
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_SPASM, 1.0, 1.0));
DelayCommand(1.0, AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0, 10.0)));
}
else
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oTrapStatue1, BODY_NODE_CHEST, FALSE), oPC, 3.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oTrapStatue2, BODY_NODE_CHEST, FALSE), oPC, 3.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oTrapStatue3, BODY_NODE_CHEST, FALSE), oPC, 3.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oTrapStatue4, BODY_NODE_CHEST, FALSE), oPC, 3.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oTrapStatue5, BODY_NODE_CHEST, FALSE), oPC, 3.0);
CreateObject(OBJECT_TYPE_PLACEABLE, "plc_weathmark", GetLocation(oPC), TRUE);
AssignCommand(oPC, PlaySound("al_mg_jacobs1"));
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_SPASM, 1.0, 1.0));
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), GetEnteringObject()));
}
AssignCommand(GetNearestObject(OBJECT_TYPE_PLACEABLE,oPC), DelayCommand(5.0, PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)));
}
else
{
}
}