Dayz_HardCore/BotMissions/Original/BotGroupMissionKab.c

361 lines
13 KiB
C
Raw Normal View History

2021-11-28 19:59:34 +00:00
class BotGroupMissionKab: MissionBase
{
void BotGroupMissionKab() { StartMissionAI(); }
AIWorld world = GetGame().GetWorld().GetAIWorld();
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
vector BotSpawnPoint = "4541.687500 317.593628 8324.727539"; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
int m_botAcuracy = 10; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
int BotSolderCountMin = 2; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
int BotSolderCountMax = 4; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
int botLootCountMin = 5; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
int botLootCountMax = 15; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
float Zone_Radius = 150; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
bool isUseCheckPoints = false; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> true - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, fslse - <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool isBotKaratist = false; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> true
bool onRespawnBot = false; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (true - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, fslse - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
bool canUseTrigger = true; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (true - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, fslse - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>), <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool useKilFeed = true; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
bool m_Frendly = false; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
bool onVoice = true; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
int m_spawnBotRadius = 30; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> BotSpawnPoint
int m_SpeedPatrol = 3; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (min = 1 max = 3)
int m_TargetDist = 100; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
bool canBotSpawned = true; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!!!!!!!
// ------------------------------- <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ------------------------------------------ //
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ref TStringArray Shirt = {"GorkaEJacket_Autumn", "GorkaEJacket_Flat", "GorkaEJacket_PautRev", "GorkaEJacket_Summer"}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ref TStringArray Jeans = {"GorkaPants_Autumn", "GorkaPants_Flat", "GorkaPants_PautRev", "GorkaPants_Summer"}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
ref TStringArray Shoes = {"TTSKOBoots", "WorkingBoots_Beige", "CombatBoots_Beige", "CombatBoots_Black", "CombatBoots_Brown"}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ref TStringArray BackPack = {"CoyoteBag_Brown", "CoyoteBag_Green", "HuntingBag", "TortillaBag", "WaterproofBag_Green"}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ref TStringArray Vest = {"HighCapacityVest_Black", "HighCapacityVest_Olive", "HuntingVest", "PlateCarrierVest", "UKAssVest_Camo"}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ref TStringArray Helm = {"GorkaHelmet", "Mich2001Helmet", "MotoHelmet_Black", "PumpkinHelmet", "SkateHelmet_Black"}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
ref TStringArray Gloves = {"WorkingGloves_Beige", "WorkingGloves_Black", "NBCGlovesGray", "OMNOGloves_Brown", "SurgicalGloves_Blue"}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ref TStringArray OtherEquip = {"CivilianBelt", "MilitaryBelt"}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :)
ref TStringArray RandomLoot = {"SardinesCan", "SodaCan_Cola", "SodaCan_Kvass", "Rice", "Rope", "Screwdriver", "AmmoBox_545x39_20Rnd"}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ref TStringArray MeleeWeap = {"WoodAxe", "FirefighterAxe", "Shovel", "Pickaxe"}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// -------------------------------- <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> -------------------------------------------------------//
EntityAI itemEnt; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!!!!
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>)
void AddCeckPoint(SurvivorBotBase m_BotSolder)
{
m_BotSolder.SetUseCheckpoint(); // <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!
m_BotSolder.AddCheckpoint("1724.632080 451.730408 14298.412109");
}
// ---------------------------------- <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -------------------------------------- /
ref array<SurvivorBotBase> m_BotMass = new array<SurvivorBotBase>;
ref array<SurvivorBotBase> m_PlaersZoneArray = new array<SurvivorBotBase>;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 7 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
void createWeapFromBot(SurvivorBotBase m_BotSolder)
{
int randomWeapon = Math.RandomInt(1, 7);
switch( randomWeapon )
{
case 1:
{
m_BotSolder.AddWeapon("M4A1"); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_BotSolder.AddWeaponAtt("M4_RISHndgrd"); //<2F><><EFBFBD><EFBFBD><EFBFBD>1
m_BotSolder.AddWeaponAtt("M4_MPBttstck"); //<2F><><EFBFBD><EFBFBD><EFBFBD>2
m_BotSolder.AddWeaponAtt("ACOGOptic"); //<2F><><EFBFBD><EFBFBD><EFBFBD>3
m_BotSolder.AddMagazine("Mag_STANAG_30Rnd"); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
break;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
case 2:
{
m_BotSolder.AddWeapon("AKM");
m_BotSolder.AddWeaponAtt("AK_WoodBttstck");
m_BotSolder.AddWeaponAtt("AK_WoodHndgrd");
m_BotSolder.AddMagazine("Mag_AKM_Drum75Rnd");
break;
}
case 3:
{
m_BotSolder.AddWeapon("AKM");
m_BotSolder.AddWeaponAtt("AK_WoodBttstck");
m_BotSolder.AddWeaponAtt("AK_WoodHndgrd");
m_BotSolder.AddMagazine("Mag_AKM_Drum75Rnd");
break;
}
case 4:
{
m_BotSolder.AddWeapon("SVD");
m_BotSolder.AddMagazine("Mag_SVD_10Rnd");
break;
}
case 5:
{
m_BotSolder.AddWeapon("M4A1");
m_BotSolder.AddWeaponAtt("M4_RISHndgrd");
m_BotSolder.AddWeaponAtt("M4_MPBttstck");
m_BotSolder.AddWeaponAtt("ACOGOptic");
m_BotSolder.AddMagazine("Mag_STANAG_30Rnd");
break;
}
case 6:
{
m_BotSolder.AddWeapon("AKM");
m_BotSolder.AddWeaponAtt("AK_WoodBttstck");
m_BotSolder.AddWeaponAtt("AK_WoodHndgrd");
m_BotSolder.AddMagazine("Mag_AKM_Drum75Rnd");
break;
}
case 7:
{
m_BotSolder.AddWeapon("AKM");
m_BotSolder.AddWeaponAtt("AK_WoodBttstck");
m_BotSolder.AddWeaponAtt("AK_WoodHndgrd");
m_BotSolder.AddMagazine("Mag_AKM_Drum75Rnd");
break;
}
}
}
// ----------------------------- <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ------------------------------------- //
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!!!)
void createBotUnit()
{
vector Navmesh;
vector botSpPos;
private SurvivorBotBase m_BotSolder;
ref TStringArray m_BotBody = { "BotM_Mirek", "BotM_Rolf", "BotM_Quinn", "BotM_Peter", "BotM_Oliver" };
PGFilter m_pgFilterNav = new PGFilter();
m_pgFilterNav.SetFlags(PGPolyFlags.WALK, PGPolyFlags.INSIDE, 0);
float bspX = BotSpawnPoint[0];
float bspY = BotSpawnPoint[2];
if (isUseCheckPoints)
botSpPos = Vector(bspX + Math.RandomInt(-7, 7), BotSpawnPoint[1], bspY + Math.RandomInt(-7, 7));
else
botSpPos = Vector(bspX + Math.RandomInt(-m_spawnBotRadius, m_spawnBotRadius), BotSpawnPoint[1], bspY + Math.RandomInt(-m_spawnBotRadius, m_spawnBotRadius));
bool IsNavmesh = world.SampleNavmeshPosition( botSpPos, 2, m_pgFilterNav, Navmesh );
if (IsNavmesh)
m_BotSolder = SurvivorBotBase.Cast(GetGame().CreatePlayer(null, m_BotBody.GetRandomElement(), Navmesh, 0, "NONE"));
else
m_BotSolder = SurvivorBotBase.Cast(GetGame().CreatePlayer(null, m_BotBody.GetRandomElement(), botSpPos, 0, "NONE"));
m_BotSolder.GetInventory().CreateInInventory(Shirt.GetRandomElement());
m_BotSolder.GetInventory().CreateInInventory(Jeans.GetRandomElement());
m_BotSolder.GetInventory().CreateInInventory(Shoes.GetRandomElement());
m_BotSolder.GetInventory().CreateInInventory(BackPack.GetRandomElement());
m_BotSolder.GetInventory().CreateInInventory(Vest.GetRandomElement());
m_BotSolder.GetInventory().CreateInInventory(Helm.GetRandomElement());
m_BotSolder.GetInventory().CreateInInventory(Gloves.GetRandomElement());
m_BotSolder.GetInventory().CreateInInventory(OtherEquip.GetRandomElement());
if (isBotKaratist)
m_BotSolder.GetHumanInventory().CreateInHands(MeleeWeap.GetRandomElement());
else
createWeapFromBot(m_BotSolder);
int rndLootCnt = Math.RandomInt(botLootCountMin, botLootCountMax);
for (int i = 0; i < rndLootCnt; i++)
{
itemEnt = m_BotSolder.GetInventory().CreateInInventory(RandomLoot.GetRandomElement());
if (itemEnt)
{
int rndHlt = Math.RandomInt(55,100);
itemEnt.SetHealth("","",rndHlt);
}
}
m_BotSolder.SetAcuracy(m_botAcuracy);
m_BotSolder.SetDistance(m_TargetDist);
m_BotSolder.SetUseVoice(onVoice);
m_BotSolder.SetUseKillFeed(useKilFeed);
m_BotSolder.SetFrendly(m_Frendly);
m_BotSolder.SetSpeedPatrol(m_SpeedPatrol);
if (isUseCheckPoints)
AddCeckPoint(m_BotSolder);
m_BotMass.Insert(m_BotSolder);
}
// ----------------------------- <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ------------------------------------- //
// ----------------------------- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ----------------------------------------//
private void respawnBotUnitKab(SurvivorBotBase m_Bot)
{
ref array<Man> players = new array<Man>;
GetGame().GetPlayers( players );
SurvivorBotBase Bot_Ar;
vector posB;
bool m_botRemoved = false;
float distB;
int m_countBot = m_BotMass.Count();
int plaersZoneCount = -1;
m_PlaersZoneArray.Clear();
if (canBotSpawned)
{
for ( int u = 0; u < players.Count(); u++ )
{
PlayerBase player;
Class.CastTo(player, players.Get(u));
vector pos = player.GetPosition();
float dist = vector.Distance( pos, BotSpawnPoint );
if ( dist < Zone_Radius && player.IsAlive() )
{
m_PlaersZoneArray.Insert(player);
// return;
}
}
Print("Players count in zone bots VMC = " + m_PlaersZoneArray.Count());
if (m_PlaersZoneArray.Count() == 0)
{
for ( int a = 0; a < m_countBot; a++ )
{
Bot_Ar = m_BotMass.Get(a);
if (Bot_Ar)
{
if (!Bot_Ar.IsAlive())
{
posB = Bot_Ar.GetPosition();
distB = vector.Distance( posB, BotSpawnPoint );
if (distB < Zone_Radius)
{
m_BotMass.Remove( a );
}
if (m_BotMass.Count() == 0)
m_botRemoved = true;
}
else
{
if (distB < Zone_Radius)
{
m_BotMass.Remove( a );
GetGame().ObjectDelete( Bot_Ar );
}
if (m_BotMass.Count() == 0)
m_botRemoved = true;
}
}
}
if (m_botRemoved && m_PlaersZoneArray.Count() == 0)
{
StartMissionAI();
GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Remove(respawnBotUnitKab);
m_botRemoved = false;
}
}
}
}
// ----------------------------- <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------------------------//
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
int delaySpawn = 0;
void spawnBotGroup()
{
int rndBotGrpCnt = Math.RandomInt(BotSolderCountMin, BotSolderCountMax);
Print("Bots spawned! Count " + rndBotGrpCnt);
for (int a = 0; a < rndBotGrpCnt; a++)
{
GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(createBotUnit, 500 + delaySpawn);
delaySpawn +=1000;
}
}
// --------------------------------------- <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> --------------------------------------- //
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void TriggerPlayersKab()
{
ref array<Man> players = new array<Man>;
GetGame().GetPlayers( players );
delaySpawn = 0;
if (canBotSpawned && IsGoodSrvFps())
{
for ( int u = 0; u < players.Count(); u++ )
{
PlayerBase player;
Class.CastTo(player, players.Get(u));
vector pos = player.GetPosition();
float dist = vector.Distance( pos, BotSpawnPoint );
if ( dist < Zone_Radius && !player.IsBot() )
{
spawnBotGroup();
GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Remove(TriggerPlayersKab);
if (onRespawnBot)
GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(respawnBotUnitKab, 60000, true);
}
}
}
}
// --------------------------------------- <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> --------------------------------------- //
// <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> initBotMissions.c
void StartMissionAI()
{
Print("Start mission bot");
if (canUseTrigger)
{
GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(TriggerPlayersKab, 5000, true);
}
else if (IsGoodSrvFps())
{
spawnBotGroup();
}
}
bool IsGoodSrvFps()
{
float TestFpsSrv = GetGame().GetFps();
if (TestFpsSrv < 2)
{
return true;
}
else
{
Print("Server FPS low! FPS = " + TestFpsSrv + " Bots not respawned!");
return false;
}
}
}