Files
HeroesStone_PRC8/_module/nss/pl_coffin_us.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

54 lines
1.7 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Coffin OnUse Script
//:: pl_coffin_us
//:: Copyright (c) 2003 Joseph L. Berkley, Jr.
//:://////////////////////////////////////////////
/*
If a PC uses a coffin, start the conversation.
If a vampire or a gaseous form uses the coffin,
get inside.
*/
//:://////////////////////////////////////////////
//:: Created By: Joseph L. Berkley, Jr.
//:: Created On: 6 Mar 2003
//:://////////////////////////////////////////////
#include "00_debug"
void main()
{
object oUser = GetLastUsedBy();
if( GetIsPC( oUser ) )
ActionStartConversation( oUser );
else
{ // not a PC user
Debug("Opening");
ActionPlayAnimation( ANIMATION_PLACEABLE_OPEN );
string sTag = GetTag( oUser );
if( FindSubString( sTag, "VAMPIRE" ) >= 0 )
{ // vampire or gaseous form user
if( GetLocalInt( OBJECT_SELF, "VAMPIRE_INSIDE" ) )
{
SignalEvent( oUser, EventUserDefined( 5000 ) );
return;
}
SetLocalInt( OBJECT_SELF, "VAMPIRE_INSIDE", TRUE );
if( FindSubString( sTag, "_SHAD" ) >= 0 )
{
SetLocalString( OBJECT_SELF, "OCCUPANT_REF",
GetLocalString( oUser, "NW_L_MYCREATOR" ) );
SetLocalInt( OBJECT_SELF, "VAMPIRE_TIMER", 10 );
}
else
SetLocalString( OBJECT_SELF, "OCCUPANT_REF",
GetResRef( oUser ) );
DestroyObject( oUser, 0.5f );
} // vampire or gaseous form user
Debug( "Closing" );
DelayCommand( 2.5, ActionPlayAnimation( ANIMATION_PLACEABLE_CLOSE ) );
} // not a PC user
}