Lankhmar_PRC8/_module/nss/ent_bed_push_dwn.nss
Jaysyn904 ebc0c6a9b2 Initial commit
Initial commit [v9.7]
2025-04-03 12:54:47 -04:00

48 lines
1.4 KiB
Plaintext

void main()
{
effect eDamage;
object oTarget;
object oSpawn;
// 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);
// Cutscene functions:
BlackScreen(oPC);
// Have the PC perform a sequence of actions.
AssignCommand(oPC, ActionJumpToObject(GetObjectByTag("WP_MV_Crbtd1")));
// Have the PC perform a sequence of actions.
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 10.0));
// Spawn "crbtbdx2".
oTarget = GetWaypointByTag("WP_crbtbdx2");
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "crbtbdx2", GetLocation(oTarget));
// Cause damage.
eDamage = EffectDamage(d6(), DAMAGE_TYPE_BLUDGEONING);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oPC);
// Cutscene functions:
DelayCommand(1.1, FadeFromBlack(oPC));
// Have the PC say something.
DelayCommand(1.1, AssignCommand(oPC, SpeakString("The bed knocked you down!")));
// Destroy objects (not fully effective until this script ends).
// DelayCommand(1.1, DestroyObject(oSpawn));
DelayCommand(1.1, DestroyObject(GetObjectByTag("crbtbdx1")));
}