mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-02 02:15:48 -04:00
111 lines
2.6 KiB
Plaintext
111 lines
2.6 KiB
Plaintext
/**
|
|
|
|
*
|
|
* Title: captor.script
|
|
* Description: script for captors: POI = prisonbreak
|
|
|
|
*/
|
|
|
|
//------------------------------------------------
|
|
// Includes
|
|
//------------------------------------------------
|
|
|
|
include library.poi;
|
|
include library.scenario;
|
|
include library.ai_lib;
|
|
include ai.ai_combat;
|
|
|
|
//------------------------------------------------
|
|
// Constants
|
|
//------------------------------------------------
|
|
|
|
const string captorEmotes[] = { "scratch", "yawn", "fidget", "cough" };
|
|
|
|
//------------------------------------------------
|
|
// Methods
|
|
//------------------------------------------------
|
|
|
|
//------------------------------------------------
|
|
// OnAttach
|
|
//------------------------------------------------
|
|
|
|
trigger OnAttach()
|
|
{
|
|
//ai_lib.setIgnoreCombat( self, true );
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//------------------------------------------------
|
|
// OnTargeted
|
|
//
|
|
// If we are attacked by a player, enable mediator combat.
|
|
//------------------------------------------------
|
|
/*
|
|
// BUGGED: need to figure out why they run away instead of engaging.
|
|
trigger OnTargeted( obj_id attacker )
|
|
{
|
|
if ( (attacker == null) || (attacker == obj_id.NULL_ID) )
|
|
return SCRIPT_CONTINUE;
|
|
if ( !isPlayer( attacker ) )
|
|
return SCRIPT_CONTINUE;
|
|
|
|
// Get reference to base.
|
|
obj_id poiMaster = poi.getBaseObject( self );
|
|
if ( (poiMaster == null) || (poiMaster == obj_id.NULL_ID) )
|
|
return SCRIPT_CONTINUE;
|
|
|
|
// Make all of the mediators see combat.
|
|
obj_id mediators[] = scenario.getTeamMembers( poiMaster, "mediator" );
|
|
if ( mediators == null )
|
|
return SCRIPT_CONTINUE;
|
|
for ( int i=0; i<mediators.length; i++ )
|
|
{
|
|
// Find this guy.
|
|
obj_id found = mediators[i];
|
|
if ( (found == null) || (found == obj_id.NULL_ID) )
|
|
continue;
|
|
|
|
if ( isIncapacitated( found ) || isDead( found ) )
|
|
continue;
|
|
|
|
// Reset the faction on the others.
|
|
ai_lib.setIgnoreCombat( found, false );
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
*/
|
|
|
|
//------------------------------------------------
|
|
// OnLoiterWaiting
|
|
//------------------------------------------------
|
|
|
|
trigger OnLoiterWaiting( modifiable_float time )
|
|
{
|
|
stop( self );
|
|
messageTo( self, "emoteCaptor", null, 4, false );
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//------------------------------------------------
|
|
// emotePirate
|
|
//------------------------------------------------
|
|
|
|
messageHandler emoteCaptor()
|
|
{
|
|
// There is a chance we'll do a social.
|
|
int dosocial = rand( 1, 4 );
|
|
if ( dosocial == 1 )
|
|
{
|
|
// Perform a social.
|
|
int whichsocial = rand( 0, 3 );
|
|
queueCommand( self, ##"social", null, captorEmotes[whichsocial], COMMAND_PRIORITY_DEFAULT );
|
|
}
|
|
|
|
messageTo( self, "resumeDefaultCalmBehavior", null, 3, false );
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|