Jump to content

DrugsAPI 1.0.0

   (0 reviews)

1 Screenshot

  • 72
  • 5
  • 5.1 kB
  • Update details
    v1.0.0
    Released
    Download size5.1 kB
    Total versions1
    Freshness Updated today

About DrugsAPI

Centralized API for drug item definitions and creation across plugins.

Config

{
  "Drugs": [
    {
      "Item Shortname": "seed.hemp",
      "Item Amount": 1,
      "Skin ID": 3354230033,
      "Display Name": "Weed Seeds",
      "Item Description": "Grows into a Weed Leaf. 15 Weed Leafs required to package.",
      "Item Image Name": "weedseeds",
      "Drug Item": {
        "Drug Item Shortname": "cloth",
        "Drug Item Skin ID": 3354227129,
        "Drug Item Display Name": "Weed Leaf",
        "Drug Item Description": "Can be sold for currency.",
        "Drug Item Image Name": "weedleaf"
      },
      "Drug Item Clone": {
        "Drug Item Clone Shortname": "clone.hemp",
        "Drug Item Clone Display Name": "Weed Clone",
        "Drug Item Clone Image Name": "weedseeds",
        "Drug Item Clone Skin ID": 3354230033,
        "Drug Item Clones To Give When Cloning": 2
      }
    },
    {
      "Item Shortname": "seed.hemp",
      "Item Amount": 1,
      "Skin ID": 3354230311,
      "Display Name": "Coca Seeds",
      "Item Description": "Grows into a Cocaine Leaf. 20 Cocaine Leafs required to package.",
      "Item Image Name": "cocaseeds",
      "Drug Item": {
        "Drug Item Shortname": "cloth",
        "Drug Item Skin ID": 3354228232,
        "Drug Item Display Name": "Cocaine Leaf",
        "Drug Item Description": "Can be sold for currency.",
        "Drug Item Image Name": "cocaleaf"
      },
      "Drug Item Clone": {
        "Drug Item Clone Shortname": "clone.hemp",
        "Drug Item Clone Display Name": "Cocaine Clone",
        "Drug Item Clone Image Name": "cocaseeds",
        "Drug Item Clone Skin ID": 3354230311,
        "Drug Item Clones To Give When Cloning": 2
      }
    },
    {
      "Item Shortname": "seed.hemp",
      "Item Amount": 1,
      "Skin ID": 3354229737,
      "Display Name": "Tobacco Seeds",
      "Item Description": "Grows into a Tobacco Leaf. 25 Tobacco Leafs required to package.",
      "Item Image Name": "tobaccoseeds",
      "Drug Item": {
        "Drug Item Shortname": "cloth",
        "Drug Item Skin ID": 3354228677,
        "Drug Item Display Name": "Tobacco Leaf",
        "Drug Item Description": "Can be sold for currency.",
        "Drug Item Image Name": "tobaccoleaf"
      },
      "Drug Item Clone": {
        "Drug Item Clone Shortname": "clone.hemp",
        "Drug Item Clone Display Name": "Tobacco Clone",
        "Drug Item Clone Image Name": "tobaccoseeds",
        "Drug Item Clone Skin ID": 3354229737,
        "Drug Item Clones To Give When Cloning": 2
      }
    },
    {
      "Item Shortname": "seed.hemp",
      "Item Amount": 1,
      "Skin ID": 3354229356,
      "Display Name": "Poppy Seeds",
      "Item Description": "Grows into an Opium Leaf. 30 Weed Leafs required to package.",
      "Item Image Name": "poppyseeds",
      "Drug Item": {
        "Drug Item Shortname": "cloth",
        "Drug Item Skin ID": 3354228480,
        "Drug Item Display Name": "Opium Leaf",
        "Drug Item Description": "Can be sold for currency.",
        "Drug Item Image Name": "poppyleaf"
      },
      "Drug Item Clone": {
        "Drug Item Clone Shortname": "clone.hemp",
        "Drug Item Clone Display Name": "Opium Clone",
        "Drug Item Clone Image Name": "poppyseeds",
        "Drug Item Clone Skin ID": 3354229356,
        "Drug Item Clones To Give When Cloning": 2
      }
    }
  ],
  "Drug Genetics (sum of values for genes is # drugs player gets when harvesting)": {
    "Drug Genetic G": 3,
    "Drug Genetic Y": 5,
    "Drug Genetic H": 2,
    "Drug Genetic W": 1,
    "Drug Genetic X": 1
  },
  "Configuration version": {
    "Major": 1,
    "Minor": 0,
    "Patch": 0
  }
}

 

API

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

List<Dictionary<string, object>> API_GetAllItemConfigs()

Returns a list of all drug item configs.

Parameters:

  • none

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Dictionary<string, object> API_GetItemConfig(string displayName)

Returns the drug item config for the given display name, or null if not found.

Parameters:

  • displayName - drug seed display name specified in config

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Dictionary<string, object> API_GetItemConfigBySkinID(ulong skinID)

Returns the drug item config matching the given skin ID (seed or clone), or null if not found.

Parameters:

  • skinID - skin ID of the drug seed or drug clone item

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Item API_CreateDrugSeed(string displayName, int amount)

Creates and returns a drug seed item, or null if the display name is not found.

Parameters:

  • displayName - drug seed display name specified in config
  • amount - the amount of drug seeds to create

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Item API_CreateDrug(string displayName, int amount)

Creates and returns a drug item, or null if the display name is not found.

Parameters:

  • displayName - drug display name specified in config
  • amount - the amount of drugs to create

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Item API_CreateDrugClone(string displayName, int amount)

Creates and returns a drug clone item, or null if the display name is not found.

Parameters:

  • displayName - drug clone display name specified in config
  • amount - the amount of drug clones to create

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

int API_CalculateHarvestAmount(int yCount, int gCount, int hCount, int wCount, int xCount)

Total number of drugs to give when the drug is harvested. Calculated by the sum of each gene by the configured amount

Parameters:

  • yCount - the number of y genes in the drug plant
  • gCount - the number of g genes in the drug plant
  • hCount - the number of h genes in the drug plant
  • wCount - the number of w genes in the drug plant
  • xCount - the number of x genes in the drug plant

Yaki's Collection

User Feedback

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.4m
Total downloads
Customers
10.9k
Customers served
Files Sold
157.1k
Marketplace sales
Payments
3.4m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.