Skip to content

Instantly share code, notes, and snippets.

@Seregamil
Last active June 9, 2023 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Seregamil/730e44bd61feb62e0d1196efd12eb1d8 to your computer and use it in GitHub Desktop.
Save Seregamil/730e44bd61feb62e0d1196efd12eb1d8 to your computer and use it in GitHub Desktop.
public enum ItemType {
Food,
Key,
Weapon,
Cloth,
World,
License
}
public class WorldOffset {
public float X { get; set; }
public float Y { get; set; }
public float Z { get; set; }
public float rX { get; set; }
public float rY { get; set; }
public float rZ { get; set; }
}
public class DefaultItem {
public Guid Id { get; set; }
public string Name { get; set; }
public ItemType ItemType { get; set; }
public float WeightPerStack { get; set; }
public int MaxInStack { get; set; }
public decimal? Cost { get; set; }
public string Icon { get; set; }
public uint? WorldModel { get; set; }
public WorldOffset? WorldOffset { get; set; }
public string EncodedPayload { get; set; }
public bool CanBeSolded { get; set; }
public bool CanBeStacked { get; set; }
public bool CanBeDroped { get; set; }
public bool CanBeAttached { get; set; }
public bool CanBeInFastSlot { get; set; }
public bool CanBeUsed { get; set; }
public bool CanBeExchanged { get; set; }
}
public abstract class Item {
public int Id { get; set; }
public Guid DefaultItemId { get; set; }
public Guid InventoryId { get; set; }
public int CellId { get; set; }
public virtual Inventory Inventory { get; set; }
public virtual DefaultItem DefaultItem { get; set; }
}
public class FoodItem : Item {
public float HealthModifier { get; set; }
}
public class License : Item {
public int LicenseLevel { get; set; }
public LicenseType LicenseType { get; set; }
}
public enum LicenseType {
Car,
Fly,
Weapon
}
public class KeyItem : Item {
public Timespan? ExpiresAt { get; set; }
public Guid RelatedEntity { get; set; }
}
public class WorldItem : Item {
public float X { get; set; }
public float Y { get; set; }
public float Z { get; set; }
public int Dimension { get; set; }
}
public class ClothItem : Item {
public IEnumerable<ClothItemModel> ClothesModels { get; set; }
}
public class ClothItemModel {
public int ComponentId { get; set; }
public int DrawableId { get; set; }
public int TextureId { get; set; }
public ClothItemModel() {}
public ClothItemModel(int componentId, int drawableId, int textureId) {
ComponentId = componentId;
DrawableId = drawableId;
TextureId = textureId;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment