bool SpawnBots(Vector3 zoneLocation, string zoneProfile, string zoneGroupID) { if (!String.IsNullOrEmpty(zoneProfile)) { string[] result = (string[])BotSpawn?.CallHook("AddGroupSpawn", zoneLocation, zoneProfile, zoneGroupID); if (result == null || result.Length < 2) { DebugPrint("AddGroupSpawn returned invalid response.", false); return(false); } switch (result[0]) { case "true": return(true); case "false": return(false); case "error": DebugPrint($"ERROR: AddGroupSpawn failed: {result[1]}", true); return(false); default: return(false); } } return(false); }
private void BotSpawnProfileCreate() { string[] result = (string[])BotSpawn?.CallHook("ProfileExists", "DynamicPVP"); if (true) //if (result[0] == "false") { //DebugPrint("BotsSpawn Does not contain custom profile `DynamicPVP`.", true); var _profile = JsonConvert.SerializeObject(new DataProfile()); result = (string[])BotSpawn?.CallHook("CreateNewProfile", BotSpawnProfileName, _profile); if (result[0] == "false") { DebugPrint($"BotsSpawn failed to add/update `DynamicPVP`.\n{result[1]}", true); } else { result = (string[])BotSpawn?.CallHook("ProfileExists", "DynamicPVP"); if (result[0] == "false") { DebugPrint($"Added but failed show `DynamicPVP`.\n{result[1]}", true); } else { DebugPrint("Succesfully updated custom profile `DynamicPVP`.", true); } } } else { DebugPrint("Custom profile `DynamicPVP` already exists.", true); } }
bool RemoveBots(string zoneGroupID) { string[] result = (string[])BotSpawn?.CallHook("RemoveGroupSpawn", zoneGroupID); if (result == null || result.Length < 2) { DebugPrint("RemoveGroupSpawn returned invalid response.", false); return(false); } else if (result[0] == "error") { DebugPrint($"ERROR: RemoveGroupSpawn failed: {result[1]}", true); return(false); } else { return(true); } }
string[] AddProfile(DataProfile profile) => (string[])BotSpawn?.CallHook("CreateNewProfile", "DynamicPVP", profile);
string[] CheckProfile(string profile) => (string[])BotSpawn?.CallHook("ProfileExists", profile);
string[] RemoveBots(string zoneGroupID) => (String[])BotSpawn?.CallHook("RemoveGroupSpawn", zoneGroupID);
// BotSpawn API string[] SpawnBots(Vector3 zoneLocation, string zoneProfile, string zoneGroupID) => (String[])BotSpawn?.CallHook("AddGroupSpawn", zoneLocation, zoneProfile, zoneGroupID);