winstxnhdw / lc-hax

A powerful, feature-rich and highly performant internal cheat for the co-op indie horror video game, Lethal Company.
78 stars 25 forks source link

[FEATURE]: i wonder if is possible to make a command to sell everything #207

Closed xAstroBoy closed 5 months ago

xAstroBoy commented 5 months ago

What happened?

A command like /sellAll and it grabs all the scraps and such and sells them to the monster?

Current Commit Hash

None

Injector

If you selected "Others" above, please specify the injector you are using.

None

Log output

None

Acknowledgement

winstxnhdw commented 5 months ago

might be possible, i'll take a look

winstxnhdw commented 5 months ago

Haven't tested but please try /sell

xAstroBoy commented 5 months ago

@winstxnhdw it works, but it sells also the useful things that could be kept all, unless you add --all can you sell only the scraps items?

winstxnhdw commented 5 months ago

What are "useful things"?

xAstroBoy commented 5 months ago

What are "useful things"?

all the items bought in the shop and the shotguns

winstxnhdw commented 5 months ago

It sells those too? I thought I set it to not sell items that are $0

xAstroBoy commented 5 months ago

It sells those too? I thought I set it to not sell items that are $0

the shotgun still has some value , as well you should disable the sell amount of items, i seen a bunch of mods that do it, and yes all the items, not just the scraps gets teleported there

winstxnhdw commented 5 months ago

as well you should disable the sell amount of item

What does this mean?

xAstroBoy commented 5 months ago

as well you should disable the sell amount of item

What does this mean?

You can put only a certain amount of items by default in jeb's counter to sell, a bunch of mods disable this .

winstxnhdw commented 5 months ago

Don't I already do this? See https://github.com/winstxnhdw/lc-hax/commit/8254ef6f0edd6043db6d27d0f4843e6b763c9d95

Also, I just pushed a change where it won't deposit defensive weapons.

xAstroBoy commented 5 months ago

Don't I already do this? See 8254ef6

Also, I just pushed a change where it won't deposit defensive weapons.

Sell should exclude any shop items, keys, defensive weapons, stun weapons, walkie talkies, flashlights, everything that can be bought over the shop and stuff such as that by default, not just the weapons, i also noticed it steals stashed items items off the inventory as well

just a minor enhancement, you could as well (if you want, else ill try to work on it ) when typing /sell you can do a few args /sell -all (sells everything) /sell value sells as much needed to reach the value (useful if you want just to sell enough scraps to reach the quota and save the rest) to avoid angering the other players 😆

winstxnhdw commented 5 months ago

The game doesn't really classify items from shop or elsewhere. So currently, I am just assuming shop items do not have a scrap value > 0 and that any other useful item outside of the shop is a defensive weapon.

xAstroBoy commented 5 months ago

The game doesn't really classify items from shop or elsewhere. So currently, I am just assuming shop items do not have a scrap value > 0 and that any other useful item outside of the shop is a defensive weapon.

they actually do, all items can be sold even the shop ones, the only things that have no scrap value are the ones that come in the ship already such as the sticky note and the clipboard, you can easily debug it out using unity explorer and bepinex.

winstxnhdw commented 5 months ago
using System;
using System.Collections.Generic;
using UnityEngine;

// Token: 0x0200012E RID: 302
[CreateAssetMenu(menuName = "ScriptableObjects/Item", order = 1)]
public class Item : ScriptableObject
{
    // Token: 0x04000C1B RID: 3099
    public int itemId;

    // Token: 0x04000C1C RID: 3100
    public string itemName;

    // Token: 0x04000C1D RID: 3101
    [Space(3f)]
    public List<ItemGroup> spawnPositionTypes = new List<ItemGroup>();

    // Token: 0x04000C1E RID: 3102
    [Space(3f)]
    public bool twoHanded;

    // Token: 0x04000C1F RID: 3103
    public bool twoHandedAnimation;

    // Token: 0x04000C20 RID: 3104
    public bool canBeGrabbedBeforeGameStart;

    // Token: 0x04000C21 RID: 3105
    [Space(3f)]
    public float weight = 1f;

    // Token: 0x04000C22 RID: 3106
    public bool itemIsTrigger;

    // Token: 0x04000C23 RID: 3107
    public bool holdButtonUse;

    // Token: 0x04000C24 RID: 3108
    public bool itemSpawnsOnGround = true;

    // Token: 0x04000C25 RID: 3109
    [Space(5f)]
    public bool isConductiveMetal;

    // Token: 0x04000C26 RID: 3110
    [Header("Scrap-collection")]
    public bool isScrap;

    // Token: 0x04000C27 RID: 3111
    public int creditsWorth;

    // Token: 0x04000C28 RID: 3112
    public bool lockedInDemo;

    // Token: 0x04000C29 RID: 3113
    public int highestSalePercentage = 80;

    // Token: 0x04000C2A RID: 3114
    [Space(3f)]
    public int maxValue;

    // Token: 0x04000C2B RID: 3115
    public int minValue;

    // Token: 0x04000C2C RID: 3116
    public GameObject spawnPrefab;

    // Token: 0x04000C2D RID: 3117
    [Space(3f)]
    [Header("Battery")]
    public bool requiresBattery = true;

    // Token: 0x04000C2E RID: 3118
    public float batteryUsage = 15f;

    // Token: 0x04000C2F RID: 3119
    public bool automaticallySetUsingPower = true;

    // Token: 0x04000C30 RID: 3120
    [Space(5f)]
    public Sprite itemIcon;

    // Token: 0x04000C31 RID: 3121
    [Space(5f)]
    [Header("Player animations")]
    public string grabAnim;

    // Token: 0x04000C32 RID: 3122
    public string useAnim;

    // Token: 0x04000C33 RID: 3123
    public string pocketAnim;

    // Token: 0x04000C34 RID: 3124
    public string throwAnim;

    // Token: 0x04000C35 RID: 3125
    [Space(5f)]
    public float grabAnimationTime;

    // Token: 0x04000C36 RID: 3126
    [Header("Player SFX")]
    public AudioClip grabSFX;

    // Token: 0x04000C37 RID: 3127
    public AudioClip dropSFX;

    // Token: 0x04000C38 RID: 3128
    public AudioClip pocketSFX;

    // Token: 0x04000C39 RID: 3129
    public AudioClip throwSFX;

    // Token: 0x04000C3A RID: 3130
    [Header("Netcode")]
    public bool syncGrabFunction = true;

    // Token: 0x04000C3B RID: 3131
    public bool syncUseFunction = true;

    // Token: 0x04000C3C RID: 3132
    public bool syncDiscardFunction = true;

    // Token: 0x04000C3D RID: 3133
    public bool syncInteractLRFunction = true;

    // Token: 0x04000C3E RID: 3134
    [Header("Save data")]
    public bool saveItemVariable;

    // Token: 0x04000C3F RID: 3135
    [Header("MISC")]
    public bool isDefensiveWeapon;

    // Token: 0x04000C40 RID: 3136
    [Space(3f)]
    public string[] toolTips;

    // Token: 0x04000C41 RID: 3137
    public float verticalOffset;

    // Token: 0x04000C42 RID: 3138
    public int floorYOffset;

    // Token: 0x04000C43 RID: 3139
    public bool allowDroppingAheadOfPlayer = true;

    // Token: 0x04000C44 RID: 3140
    public Vector3 restingRotation = new Vector3(0f, 0f, 90f);

    // Token: 0x04000C45 RID: 3141
    public Vector3 rotationOffset = Vector3.zero;

    // Token: 0x04000C46 RID: 3142
    public Vector3 positionOffset = Vector3.zero;

    // Token: 0x04000C47 RID: 3143
    public bool meshOffset = true;

    // Token: 0x04000C48 RID: 3144
    public Mesh[] meshVariants;

    // Token: 0x04000C49 RID: 3145
    public Material[] materialVariants;

    // Token: 0x04000C4A RID: 3146
    public bool usableInSpecialAnimations;

    // Token: 0x04000C4B RID: 3147
    public bool canBeInspected = true;
}

This is the entire Item class. Do you think isScrap is sufficient?

xAstroBoy commented 5 months ago
using System;
using System.Collections.Generic;
using UnityEngine;

// Token: 0x0200012E RID: 302
[CreateAssetMenu(menuName = "ScriptableObjects/Item", order = 1)]
public class Item : ScriptableObject
{
  // Token: 0x04000C1B RID: 3099
  public int itemId;

  // Token: 0x04000C1C RID: 3100
  public string itemName;

  // Token: 0x04000C1D RID: 3101
  [Space(3f)]
  public List<ItemGroup> spawnPositionTypes = new List<ItemGroup>();

  // Token: 0x04000C1E RID: 3102
  [Space(3f)]
  public bool twoHanded;

  // Token: 0x04000C1F RID: 3103
  public bool twoHandedAnimation;

  // Token: 0x04000C20 RID: 3104
  public bool canBeGrabbedBeforeGameStart;

  // Token: 0x04000C21 RID: 3105
  [Space(3f)]
  public float weight = 1f;

  // Token: 0x04000C22 RID: 3106
  public bool itemIsTrigger;

  // Token: 0x04000C23 RID: 3107
  public bool holdButtonUse;

  // Token: 0x04000C24 RID: 3108
  public bool itemSpawnsOnGround = true;

  // Token: 0x04000C25 RID: 3109
  [Space(5f)]
  public bool isConductiveMetal;

  // Token: 0x04000C26 RID: 3110
  [Header("Scrap-collection")]
  public bool isScrap;

  // Token: 0x04000C27 RID: 3111
  public int creditsWorth;

  // Token: 0x04000C28 RID: 3112
  public bool lockedInDemo;

  // Token: 0x04000C29 RID: 3113
  public int highestSalePercentage = 80;

  // Token: 0x04000C2A RID: 3114
  [Space(3f)]
  public int maxValue;

  // Token: 0x04000C2B RID: 3115
  public int minValue;

  // Token: 0x04000C2C RID: 3116
  public GameObject spawnPrefab;

  // Token: 0x04000C2D RID: 3117
  [Space(3f)]
  [Header("Battery")]
  public bool requiresBattery = true;

  // Token: 0x04000C2E RID: 3118
  public float batteryUsage = 15f;

  // Token: 0x04000C2F RID: 3119
  public bool automaticallySetUsingPower = true;

  // Token: 0x04000C30 RID: 3120
  [Space(5f)]
  public Sprite itemIcon;

  // Token: 0x04000C31 RID: 3121
  [Space(5f)]
  [Header("Player animations")]
  public string grabAnim;

  // Token: 0x04000C32 RID: 3122
  public string useAnim;

  // Token: 0x04000C33 RID: 3123
  public string pocketAnim;

  // Token: 0x04000C34 RID: 3124
  public string throwAnim;

  // Token: 0x04000C35 RID: 3125
  [Space(5f)]
  public float grabAnimationTime;

  // Token: 0x04000C36 RID: 3126
  [Header("Player SFX")]
  public AudioClip grabSFX;

  // Token: 0x04000C37 RID: 3127
  public AudioClip dropSFX;

  // Token: 0x04000C38 RID: 3128
  public AudioClip pocketSFX;

  // Token: 0x04000C39 RID: 3129
  public AudioClip throwSFX;

  // Token: 0x04000C3A RID: 3130
  [Header("Netcode")]
  public bool syncGrabFunction = true;

  // Token: 0x04000C3B RID: 3131
  public bool syncUseFunction = true;

  // Token: 0x04000C3C RID: 3132
  public bool syncDiscardFunction = true;

  // Token: 0x04000C3D RID: 3133
  public bool syncInteractLRFunction = true;

  // Token: 0x04000C3E RID: 3134
  [Header("Save data")]
  public bool saveItemVariable;

  // Token: 0x04000C3F RID: 3135
  [Header("MISC")]
  public bool isDefensiveWeapon;

  // Token: 0x04000C40 RID: 3136
  [Space(3f)]
  public string[] toolTips;

  // Token: 0x04000C41 RID: 3137
  public float verticalOffset;

  // Token: 0x04000C42 RID: 3138
  public int floorYOffset;

  // Token: 0x04000C43 RID: 3139
  public bool allowDroppingAheadOfPlayer = true;

  // Token: 0x04000C44 RID: 3140
  public Vector3 restingRotation = new Vector3(0f, 0f, 90f);

  // Token: 0x04000C45 RID: 3141
  public Vector3 rotationOffset = Vector3.zero;

  // Token: 0x04000C46 RID: 3142
  public Vector3 positionOffset = Vector3.zero;

  // Token: 0x04000C47 RID: 3143
  public bool meshOffset = true;

  // Token: 0x04000C48 RID: 3144
  public Mesh[] meshVariants;

  // Token: 0x04000C49 RID: 3145
  public Material[] materialVariants;

  // Token: 0x04000C4A RID: 3146
  public bool usableInSpecialAnimations;

  // Token: 0x04000C4B RID: 3147
  public bool canBeInspected = true;
}

This is the entire Item class. Do you think isScrap is sufficient?

i dont know how is set code wise, the best way to check out is to find the scrap item and check within unity explorer, this way you can determine everything out of it. could be the shop items can be set as isScrap as well.

https://github.com/yukieiji/UnityExplorer/releases/tag/v4.11.0 it will offer a huge help, ill try enchancing the sell command as well myself unless you beat me to it.

winstxnhdw commented 5 months ago

Oh UnityExplorer looks sick. I'll check it out.