mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
32 lines
626 B
Plaintext
32 lines
626 B
Plaintext
//attach this script to the thing you want to make a pet
|
|
|
|
include library.pet_lib;
|
|
include library.ai_lib;
|
|
|
|
trigger OnAttach()
|
|
{
|
|
debugSpeakMsg( self, "attached." );
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnHearSpeech(obj_id speaker, string text)
|
|
{
|
|
if ( pet_lib.hasMaster( self ) )
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if ( ai_lib.isAiDead( self ) )
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if ( text.equals( "pet" ))
|
|
{
|
|
//pet_lib.makePet(self, speaker);
|
|
|
|
dictionary params = new dictionary();
|
|
params.put( "pet", self );
|
|
params.put( "master", speaker );
|
|
messageTo( self, "handleAddMaster", params, 1, true );
|
|
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|