I'm trying to make it possible to gamble at the Bandit Camp with items that aren't scrap (in my case bleach), but can't seem to find a way to force it to accept other items. I tried using the CanMoveItem and CanAcceptItem hooks, but neither worked for this. This is the code I tried:
private object CanMoveItem(Item item, PlayerInventory playerLoot, uint targetContainerID, int targetSlot, int amount)
{
var basePlayer = item.GetOwnerPlayer();
if (basePlayer != null)
{
if (!basePlayer.IsNpc && basePlayer.IsAdmin) // For debugging
{
ItemContainer targetContainer = playerLoot.FindContainer(targetContainerID);
BigWheelBettingTerminal bigWheelBettingTerminal = (BigWheelBettingTerminal)targetContainer.entityOwner;
if (bigWheelBettingTerminal != null)
{
if (itemWhitelist.Contains(item.info.shortname))
{
item.MoveToContainer(targetContainer, 1, true);
basePlayer.ChatMessage($"Tried to move to container");
return true;
}
basePlayer.ChatMessage($"Not in whitelist");
return false;
}
}
}
return null;
}I noticed that the CanAcceptItem hook doesn't even fire for any item that isn't scrap, so it seems like I can't use it to override whether the betting terminal can accept an item or not. This is what I tried for it:
ItemContainer.CanAcceptResult? CanAcceptItem(ItemContainer targetContainer, Item item, int targetPos)
{
BigWheelBettingTerminal bigWheelBettingTerminal = (BigWheelBettingTerminal)targetContainer.entityOwner;
if (bigWheelBettingTerminal != null)
{
Puts("Container is a BigWheelBettingTerminal");
}
else
{
Puts("Container is not a BigWheelBettingTerminal");
}
return null;
}I only ever see the output "Container is a BigWheelBettingTerminal" if I put in scrap. Putting in any other item doesn't give any output.
Does anyone know what I am missing here?