generated from Jaysyn/ModuleTemplate
73 lines
2.6 KiB
Plaintext
73 lines
2.6 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Vampire User-defined Events
|
|
//:: cr_vampire_ude
|
|
//:: Copyright (c) 2003 Joseph L. Berkley, Jr.
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Joseph L. Berkley, Jr.
|
|
//:: Created On: 6 March 2003
|
|
//:://////////////////////////////////////////////
|
|
#include "00_debug"
|
|
#include "cr_vampire_inc"
|
|
|
|
void main()
|
|
{
|
|
switch( GetUserDefinedEventNumber() )
|
|
{
|
|
case 1001: // HEARTBEAT
|
|
{
|
|
if( !GetIsNight() )
|
|
{
|
|
if( FindSubString( GetTag( GetArea( OBJECT_SELF ) ), "OS" ) >= 0 )
|
|
{
|
|
Debug( "I'm outside. Dying." );
|
|
|
|
ClearAllActions( TRUE );
|
|
|
|
switch( d4() )
|
|
{
|
|
case 1: PlayVoiceChat( VOICE_CHAT_PAIN1 ); break;
|
|
case 2: PlayVoiceChat( VOICE_CHAT_PAIN2 ); break;
|
|
case 3: PlayVoiceChat( VOICE_CHAT_PAIN3 ); break;
|
|
case 4: PlayVoiceChat( VOICE_CHAT_DEATH ); break;
|
|
} // switch
|
|
ApplyEffectToObject( DURATION_TYPE_INSTANT,
|
|
EffectVisualEffect( VFX_FNF_SUNBEAM ), OBJECT_SELF );
|
|
ApplyEffectToObject( DURATION_TYPE_INSTANT,
|
|
EffectVisualEffect( VFX_COM_CHUNK_RED_LARGE ), OBJECT_SELF );
|
|
ApplyEffectToObject( DURATION_TYPE_INSTANT,
|
|
EffectDeath( TRUE ), OBJECT_SELF );
|
|
} // if outside
|
|
else
|
|
{
|
|
Debug( "I'm not outside. Where's my coffin?" );
|
|
if( GetIsInCombat() ) return;
|
|
|
|
object oCoffin = GetGoodCoffin( OBJECT_SELF, FALSE );
|
|
if( GetIsObjectValid( oCoffin ) )
|
|
{
|
|
ActionMoveToObject( oCoffin, TRUE );
|
|
ActionDoCommand( SignalEvent( OBJECT_SELF, EventUserDefined( 5001 ) ) );
|
|
} // valid empty placeable coffin
|
|
} // not outside
|
|
} // not night
|
|
}
|
|
break; // HEARTBEAT
|
|
case 5001: // ARRIVED
|
|
{
|
|
object oCoffin = GetGoodCoffin( OBJECT_SELF, FALSE );
|
|
if( GetIsObjectValid( oCoffin ) )
|
|
{
|
|
ActionMoveToObject( oCoffin );
|
|
ActionInteractObject( oCoffin );
|
|
}
|
|
else
|
|
DestroyObject( OBJECT_SELF, 0.1f );
|
|
}
|
|
break; // ARRIVED
|
|
} // switch
|
|
} // main
|