T2-BoL/scripts/aiSurvival.cs
Robert MacGregor 9a05e8d86c Initial commit.
2012-07-27 17:22:05 -04:00

51 lines
1.1 KiB
C#

function SVGame::AIInit(%game)
{
//call the default AIInit() function
AIInit();
}
function SVGame::onAIRespawn(%game, %client)
{
//add the default task
if (! %client.defaultTasksAdded)
{
%client.defaultTasksAdded = true;
%client.addTask(AIEngageTask);
%client.addTask(AIPickupItemTask);
%client.addTask(AITauntCorpseTask);
%client.addTask(AIEngageTurretTask);
%client.addtask(AIDetectMineTask);
%client.addTask(AIPatrolTask);
}
//Now, force the bot to choose a player
%count = clientGroup.getCount();
%rnd = getRandom(0,%count);
%rndcl = clientGroup.getObject(%rnd);
%newObjective = new AIObjective(AIOAttackPlayer)
{
dataBlock = "AIObjectiveMarker";
weightLevel1 = 10000;
description = "Attack Player";
targetClient = %rndcl;
offense = true;
};
//echo(%newObjective);
MissionCleanup.add(%newObjective);
$ObjectiveQ[%client.team].add(%newObjective);
%client.objectiveTask = %newObjective;
%client.addTask(AIAttackPlayer);
%client.bountyTask = %client.addTask(AIBountyEngageTask);
Game.aiCount++;
//set the inv flag
%client.spawnUseInv = true;
}