mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-22 05:55:42 +00:00
Jav location
This commit is contained in:
parent
320d6854ac
commit
d4b2a72025
@ -116,6 +116,7 @@ resetBotVars()
|
||||
self.bot.targets = [];
|
||||
self.bot.target = undefined;
|
||||
self.bot.target_this_frame = undefined;
|
||||
self.bot.jav_loc = undefined;
|
||||
|
||||
self.bot.script_aimpos = undefined;
|
||||
|
||||
@ -188,6 +189,7 @@ onPlayerSpawned()
|
||||
self thread reload_watch();
|
||||
self thread grenade_watch();
|
||||
self thread lockon_watch();
|
||||
self thread jav_loc_watch();
|
||||
|
||||
self thread adsHack();
|
||||
self thread fireHack();
|
||||
@ -201,6 +203,32 @@ onPlayerSpawned()
|
||||
}
|
||||
}
|
||||
|
||||
jav_loc_watch()
|
||||
{
|
||||
self endon("disconnect");
|
||||
self endon("death");
|
||||
|
||||
for (;;)
|
||||
{
|
||||
wait 0.05;
|
||||
|
||||
if(!gameFlag( "prematch_done" ) || level.gameEnded || self.bot.isfrozen || self maps\mp\_flashgrenades::isFlashbanged())
|
||||
continue;
|
||||
|
||||
if (!isDefined(self.bot.jav_loc))
|
||||
continue;
|
||||
|
||||
weap = self getCurrentWeapon();
|
||||
if (weap != "javelin_mp")
|
||||
continue;
|
||||
|
||||
if (!self GetCurrentWeaponClipAmmo())
|
||||
continue;
|
||||
|
||||
self WeaponLockFinalize( self.bot.jav_loc, (0,0,0), true );
|
||||
}
|
||||
}
|
||||
|
||||
lockon_watch()
|
||||
{
|
||||
self endon("disconnect");
|
||||
@ -1642,6 +1670,16 @@ aim()
|
||||
|
||||
usingRemote = self IsUsingRemote();
|
||||
|
||||
if (isDefined(self.bot.jav_loc) && !usingRemote)
|
||||
{
|
||||
lookPos = self.bot.jav_loc;
|
||||
|
||||
self thread bot_lookat(lookPos, aimspeed);
|
||||
self thread pressAds();
|
||||
self botFire();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(isDefined(self.bot.target) && isDefined(self.bot.target.entity) && !self.bot.climbing)
|
||||
{
|
||||
no_trace_look_time = self.pers["bots"]["skill"]["no_trace_look_time"];
|
||||
@ -1929,12 +1967,12 @@ walk()
|
||||
continue;
|
||||
}
|
||||
|
||||
hasTarget = (isDefined(self.bot.target) && isDefined(self.bot.target.entity) && !self.bot.climbing);
|
||||
hasTarget = (((isDefined(self.bot.target) && isDefined(self.bot.target.entity)) || isDefined(self.bot.jav_loc)) && !self.bot.climbing);
|
||||
if(hasTarget)
|
||||
{
|
||||
curweap = self getCurrentWeapon();
|
||||
|
||||
if(entIsVehicle(self.bot.target.entity) || self.bot.isfraggingafter)
|
||||
if(isDefined(self.bot.jav_loc) || entIsVehicle(self.bot.target.entity) || self.bot.isfraggingafter)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -1080,8 +1080,6 @@ onBotSpawned()
|
||||
self waittill("bot_spawned");
|
||||
gameFlagWait("prematch_done");
|
||||
|
||||
self GiveWeapon("at4_mp");
|
||||
|
||||
self thread bot_killstreak_think();
|
||||
self thread bot_target_vehicle();
|
||||
self thread bot_weapon_think();
|
||||
@ -1091,6 +1089,22 @@ onBotSpawned()
|
||||
self thread bot_uav_think();
|
||||
self thread bot_listen_to_steps();
|
||||
self thread bot_equipment_kill_think();
|
||||
self thread bot_jav_loc_think();
|
||||
}
|
||||
}
|
||||
|
||||
bot_jav_loc_think()
|
||||
{
|
||||
self endon("disconnect");
|
||||
self endon("death");
|
||||
|
||||
self GiveWeapon("javelin_mp");
|
||||
for (;;)
|
||||
{
|
||||
wait 0.05;
|
||||
|
||||
self SetWeaponAmmoClip("javelin_mp", 1);
|
||||
self SetBotJavelinLocation((randomIntRange(-10000, 10000),randomIntRange(-10000, 10000),1000));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1693,6 +1707,14 @@ bot_weapon_think()
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (self HasBotJavelinLocation() && self GetAmmoCount("javelin_mp"))
|
||||
{
|
||||
if (curWeap != "javelin_mp")
|
||||
self setSpawnWeapon("javelin_mp");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if(curWeap != "none" && self getAmmoCount(curWeap) && curWeap != "stinger_mp" && curWeap != "javelin_mp" && curWeap != "onemanarmy_mp")
|
||||
{
|
||||
|
@ -134,6 +134,21 @@ ClearScriptGoal()
|
||||
self SetScriptGoal(undefined, 0);
|
||||
}
|
||||
|
||||
HasBotJavelinLocation()
|
||||
{
|
||||
return isDefined(self.bot.jav_loc);
|
||||
}
|
||||
|
||||
SetBotJavelinLocation(loc)
|
||||
{
|
||||
self.bot.jav_loc = loc;
|
||||
}
|
||||
|
||||
ClearBotJavelinLocation()
|
||||
{
|
||||
self SetBotJavelinLocation(undefined);
|
||||
}
|
||||
|
||||
/*
|
||||
Sets the script enemy for a bot.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user