generated from Jaysyn/ModuleTemplate
53 lines
1.6 KiB
Plaintext
53 lines
1.6 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Gaseous Form User-defined Events
|
|
//:: cr_gaseous_ude
|
|
//:: Copyright (c) 2003 Joseph L. Berkley, Jr.
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Seek out and use a coffin with identical tag.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Joseph L. Berkley, Jr.
|
|
//:: Created On: 6 March 2003
|
|
//:://////////////////////////////////////////////
|
|
#include "00_debug"
|
|
#include "cr_vampire_inc"
|
|
|
|
void main()
|
|
{
|
|
switch( GetUserDefinedEventNumber() )
|
|
{
|
|
case 5000: // SEEK
|
|
{
|
|
object oCoffin = GetGoodCoffin( OBJECT_SELF, TRUE );
|
|
if( GetIsObjectValid( oCoffin ) )
|
|
{
|
|
CloseInterveningDoors( OBJECT_SELF, oCoffin );
|
|
ActionForceMoveToObject( oCoffin, TRUE, 1.0f, 10.0f );
|
|
ActionDoCommand( SignalEvent( OBJECT_SELF, EventUserDefined( 5001 ) ) );
|
|
SetCommandable( FALSE );
|
|
} // valid empty placeable coffin
|
|
else
|
|
DestroyObject( OBJECT_SELF, 0.1f );
|
|
}
|
|
break; // SEEK
|
|
case 5001: // ARRIVED
|
|
{
|
|
SetCommandable( TRUE );
|
|
|
|
object oCoffin = GetGoodCoffin( OBJECT_SELF, TRUE );
|
|
if( GetIsObjectValid( oCoffin ) )
|
|
{
|
|
CloseInterveningDoors( OBJECT_SELF, oCoffin );
|
|
ActionMoveToObject( oCoffin );
|
|
ActionInteractObject( oCoffin );
|
|
}
|
|
else
|
|
SignalEvent( OBJECT_SELF, EventUserDefined( 5000 ) );
|
|
}
|
|
break; // ARRIVED
|
|
} // switch
|
|
} // main
|
|
|
|
|