I want to make the default zombie bots distracted and only focus on the pipe bomb. In the video, you'll see that the bots run to it first, then they leave it alone and go ahead and attack the player instead, then repeat. I just want them to focus on the pipe bomb instead of doing that. Then they can return to their normal roots after the pipe bomb explodes, of course. I tried looking at Bot_Dogs but I had no luck looking for something to use in that code, and I'm not sure how to do it myself.
I also ripped the weapon out of Gamemode_Zombie, but still functions the same.
Video of the Pipe BombHere's the code for the function to make the bots follow the weapon.
package PipeSpawn
{
function Projectile::spawnPipeFlash(%this,%flashcount)
{
%pos = %this.getPosition();
if(%flashCount % 4 == 0)
{
%radius = 5000;
%searchMasks = $TypeMasks::PlayerObjectType;
InitContainerRadiusSearch(%pos, %radius, %searchMasks);
while ((%targetid = containerSearchNext()) != 0 )
{
if(%targetid.getClassName() $= "AIPlayer")
{
if(%targetid.hType $= "Zombie")
{
%targetid.setMoveObject(%this);
%targetid.setAimObject(%this);
}
}
}
}
if(%flashcount < 5)
{
%sound = Phone_Tone_1_Sound;
%time = 750;
}
else if(%flashcount < 10)
{
%sound = Phone_Tone_3_Sound;
%time = 250;
}
else
{
%this.explode();
return;
}
%this.schedule(%time,spawnPipeFlash,%flashcount+1);
serverPlay3d(%sound,%pos); //if(%flashCount % 2 == 0)
%p = new Projectile()
{
dataBlock = sPipeBombLightProjectile;
initialPosition = %pos;
initialVelocity = "0 0 1";
sourceObject = %this.sourceObject;
client = %this.client;
sourceSlot = 0;
originPoint = %this.originPoint;
};
if(isObject(%p))
{
MissionCleanup.add(%p);
%p.setScale(%this.getScale());
}
}
};activatePackage(PipeSpawn);