mirror of
https://github.com/Ragora/T2-BoL.git
synced 2026-01-19 19:14:45 +00:00
51 lines
1.1 KiB
C#
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;
|
|
}
|
|
|
|
|
|
|
|
|
|
|