frisk typo, hanf nur für gangs, 10 cannabis für 1 joint, no riot frisk
This commit is contained in:
@@ -49,9 +49,9 @@ namespace ReallifeGamemode.Server.Managers
|
||||
private const int MAX_SEEDS_PER_DAY = 50;
|
||||
|
||||
/// <summary>
|
||||
/// Wie viele Joints man aus einem Cannabis bekommt
|
||||
/// Wie viel Cannabis man für einen Joint braucht
|
||||
/// </summary>
|
||||
public static int CANNABIS_TO_JOINT_RATIO = 3;
|
||||
private const int CANNABIS_NEEDED_FOR_JOINT = 10;
|
||||
|
||||
/// <summary>
|
||||
/// Flag, ob der Verarbeiter aktuell benutzt wird
|
||||
@@ -91,7 +91,6 @@ namespace ReallifeGamemode.Server.Managers
|
||||
private static Random _random = new Random();
|
||||
|
||||
private static List<CannabisData> _currentCannabisData = new List<CannabisData>();
|
||||
|
||||
public static readonly Vector3 ASSERVATENKAMMER_POSITION = new Vector3(-5.45, -670.03, 32.33);
|
||||
|
||||
static HanfManager()
|
||||
@@ -154,7 +153,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
}
|
||||
|
||||
var user = player.GetUser();
|
||||
if (user?.Faction?.StateOwned == true)
|
||||
if (user?.Faction?.StateOwned == true || user.Faction?.GangOwned == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -186,7 +185,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
}
|
||||
|
||||
var user = player.GetUser();
|
||||
if (user?.Faction?.StateOwned == true)
|
||||
if (user?.Faction?.StateOwned == true || user.Faction?.GangOwned == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -215,7 +214,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
var dbContext = new DatabaseContext();
|
||||
var user = player.GetUser(dbContext);
|
||||
if (user.Faction?.StateOwned ?? false)
|
||||
if (user.Faction?.StateOwned ?? false || user.Faction?.GangOwned == false)
|
||||
{
|
||||
player.SendNotification("~r~Du darfst keine Hanfsamen einpflanzen");
|
||||
return;
|
||||
@@ -482,18 +481,10 @@ namespace ReallifeGamemode.Server.Managers
|
||||
IItem cannabisItem = InventoryManager.GetItem<Cannabis>();
|
||||
IItem jointItem = InventoryManager.GetItem<Joint>();
|
||||
|
||||
var addWeight = jointItem.Gewicht * CANNABIS_TO_JOINT_RATIO - cannabisItem.Gewicht;
|
||||
|
||||
if (!InventoryManager.CanPlayerHoldMoreWeight(player, addWeight))
|
||||
{
|
||||
player.SendNotification("~r~Für die Verarbeitung hast du nicht genug Platz im Rucksack");
|
||||
return;
|
||||
}
|
||||
|
||||
UserItem userCannabisItem = userItems.Where(i => i.ItemId == cannabisItem.Id).FirstOrDefault();
|
||||
if (userCannabisItem == null)
|
||||
if (userCannabisItem == null || userCannabisItem.Amount < CANNABIS_NEEDED_FOR_JOINT)
|
||||
{
|
||||
player.SendNotification("~r~Du hast kein Cannabis dabei");
|
||||
player.SendNotification($"~r~Du hast nicht genug Cannabis dabei~n~Zur Herstellung eines Joints werden {CANNABIS_NEEDED_FOR_JOINT} Hanfblüten benötigt");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -502,10 +493,10 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
player.SyncAnimation(_manufacturerAnim);
|
||||
|
||||
InventoryManager.RemoveUserItem(user, userCannabisItem, 1);
|
||||
InventoryManager.AddItemToInventory(player, jointItem.Id, CANNABIS_TO_JOINT_RATIO);
|
||||
InventoryManager.RemoveUserItem(user, userCannabisItem, CANNABIS_NEEDED_FOR_JOINT);
|
||||
InventoryManager.AddItemToInventory(player, jointItem.Id, 1);
|
||||
|
||||
player.SendNotification($"Du hast 1 Cannabis in {CANNABIS_TO_JOINT_RATIO} Joints verarbeitet");
|
||||
player.SendNotification($"Du hast{CANNABIS_NEEDED_FOR_JOINT} Hanfblüten in einen Joint verarbeitet");
|
||||
|
||||
NAPI.ClientEvent.TriggerClientEventInRange(player.Position, 100.0f, "SERVER:Hanf_PlayManufacturerAnim", _manufacturerAnim);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user