Files
dsrc/sku.0/sys.server/compiled/game/script/e3demo/e3_bridge_vader.script
T

124 lines
2.3 KiB
Plaintext

include library.anims;
include library.utils;
include library.space_utils;
include library.factions;
trigger OnAttach()
{
setAnimationMood(self, "npc_imperial");
factions.setFaction( self, "Imperial");
attachScript(self, "e3demo.e3_faceto");
setObjVar(self, "intDestination", 1);
messageTo(self, "moveToLocationTwo", null, 0, false);
//createTriggerVolume("playerEnter", 8.0f, true);
return SCRIPT_CONTINUE;
}
trigger OnTriggerVolumeEntered(string volumeName, obj_id breacher)
{
if ( volumeName == "playerEnter" )
{
if(isPlayer(breacher))
{
//utils.setScriptVar(self, "objPlayer", breacher);
//messageTo(self, "moveToLocationTwo", null, 0, false);
}
}
return SCRIPT_CONTINUE;
}
messageHandler moveToLocationTwo()
{
pathToLocationTwo( self );
return SCRIPT_CONTINUE;
}
messageHandler moveToLocationOne()
{
pathToLocationOne( self );
return SCRIPT_CONTINUE;
}
trigger OnHearSpeech(obj_id objSpeaker, string strText)
{
if(strText=="reset")
{
pathToLocationOne(self);
}
if(strText=="playerEnter")
{
pathToLocationTwo(self);
}
return SCRIPT_CONTINUE;
}
void pathToLocationOne( obj_id self)
{
//debugSpeakMsg(self, "going to 1");
location destLoc = new location(getLocation( self));
destLoc.x = 8.6f;
destLoc.y = 455.2f;
destLoc.z = 330.7f;
setObjVar( self, "intIndex", 1);
pathTo( self, destLoc );
}
void pathToLocationTwo( obj_id self)
{
//debugSpeakMsg(self, "going to 2");
location destLoc = new location(getLocation( self));
destLoc.x = -.5f;
destLoc.y = 455.2f;
destLoc.z = 321.8f;
setObjVar( self, "intIndex", 2);
pathTo( self, destLoc );
}
trigger OnMovePathComplete()
{
// wait is
messageTo(self, "doFaceTo", null, 2.5f, false);
return SCRIPT_CONTINUE;
}
messageHandler doFaceTo()
{
int intIndex = getIntObjVar(self, "intIndex");
location locTest = getLocation(self);
if(intIndex==1)
{
obj_id[] objObjects= getAllObjectsWithTemplate(getLocation(self), 2000, "object/mobile/boba_fett.iff");
faceTo(self, getLocation(objObjects[0]));
}
else
{
faceTo(self, utils.getObjIdScriptVar(self, "objPlayer"));
// faceTo(self, getLocation(objObjects[0]);
}
return SCRIPT_CONTINUE;
}
messageHandler doLocationOne()
{
pathToLocationOne(self);
return SCRIPT_CONTINUE;
}
messageHandler doLocationTwo()
{
pathToLocationTwo(self);
return SCRIPT_CONTINUE;
}