mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
Todo: * Make BTR spawn at random time during raid instead of at the start * Find out why some players receive error relating to `BTRBotAttachPatch` resulting BTR failing to initialise Co-authored-by: Nympfonic <arys.steam@gmail.com> Reviewed-on: SPT-AKI/Modules#67 Co-authored-by: Arys <arys@noreply.dev.sp-tarkov.com> Co-committed-by: Arys <arys@noreply.dev.sp-tarkov.com>
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using Aki.Common.Http;
|
|
using Aki.Custom.BTR.Models;
|
|
using Comfort.Common;
|
|
using EFT;
|
|
using EFT.InventoryLogic;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
|
|
namespace Aki.Custom.BTR.Utils
|
|
{
|
|
public static class BTRUtil
|
|
{
|
|
public static readonly string BTRTraderId = Profile.TraderInfo.BTR_TRADER_ID;
|
|
public static readonly string BTRMachineGunWeaponTplId = "657857faeff4c850222dff1b"; // BTR PKTM machine gun
|
|
public static readonly string BTRMachineGunAmmoTplId = "5e023d34e8a400319a28ed44"; // 7.62x54mmR BT
|
|
|
|
/// <summary>
|
|
/// Used to create an instance of the item in-raid.
|
|
/// </summary>
|
|
public static Item CreateItem(string tplId)
|
|
{
|
|
var id = Guid.NewGuid().ToString("N").Substring(0, 24);
|
|
return Singleton<ItemFactory>.Instance.CreateItem(id, tplId, null);
|
|
}
|
|
|
|
public static BTRConfigModel GetConfigFromServer()
|
|
{
|
|
string json = RequestHandler.GetJson("/singleplayer/btr/config");
|
|
return JsonConvert.DeserializeObject<BTRConfigModel>(json);
|
|
}
|
|
}
|
|
}
|