etqw-sdk/base/script/maps/routeconstraint.script

33 lines
912 B
Plaintext
Raw Permalink Normal View History

2008-05-29 00:00:00 +00:00
object mapObject_RouteConstraint : mapObject_Default {
void InitObjectives();
void OnMCPDestroyed( vector newLocation, vector newAngles );
void OnMCPDelivered( entity obj );
entity mcpRoute;
entity mcpSpawner;
}
mapObject_Base RouteConstraint_MapScript() {
return new mapObject_RouteConstraint;
}
void mapObject_RouteConstraint::InitObjectives() {
gdfTeam.SetRespawnWait( 1 );
stroggTeam.SetRespawnWait( 1 );
CreateRespawnTimeThread( gdfTeam );
mcpRoute = worldspawn.getEntityKey( "script_mcp_route" );
mcpSpawner = worldspawn.getEntityKey( "script_mcp_caller" );
}
void mapObject_RouteConstraint::OnMCPDestroyed( vector newLocation, vector newAngles ) {
mcpSpawner.vCallDrop( newLocation, newAngles );
}
void mapObject_RouteConstraint::OnMCPDelivered( entity obj ) {
obj.setTrackerEntity( mcpRoute );
objManager.SetObjectiveEntity( obj, 0 );
}