Skip to content
Mirror
Clone

Clone over HTTPS

No sign-in. Pulls work; pushes go upstream to the monorepo.

Download .tar.gz

Protocol buffer schemas shared by KBVE services, games and sites.

Last changed in19476db91on

177 lines4.8 KB
APIRaw
syntax = "proto3";

package kbve.osrs.v1;

import "kbve/osrs/v1/osrs.proto";

// How a boost is worked out.
enum BoostType {
  BOOST_TYPE_UNSPECIFIED = 0;
  BOOST_TYPE_FLAT = 1;
  BOOST_TYPE_PERCENTAGE = 2;
  // Given by `boost_formula` rather than a number.
  BOOST_TYPE_FORMULA = 3;
}

// What one dose of a potion does.
message Effect {
  optional Skill stat = 1;
  BoostType boost_type = 2;
  optional int32 boost_value = 3;
  // e.g. "floor(level * 0.15) + 2".
  optional string boost_formula = 4;
  // Ticks.
  optional int32 duration = 5;
}

// Anything that can be eaten or drunk.
//
// One message rather than three. OSRSConsumable and OSRSFood both carried
// `heals` and `cooking_level`, and OSRSItem held both plus OSRSCooking, so an
// edible item was described in three places at once. The Herblore level a
// potion needs was also spelled `cooking_level` on OSRSConsumable, which was a
// live bug rather than a naming quibble.
message Consumable {
  // Hitpoints restored.
  optional int32 heals = 1;
  // e.g. "floor(max_hp * 0.06)".
  optional string heals_formula = 2;
  // Whether it can take you above your maximum, as an anglerfish does.
  optional bool overheal = 3;

  // Potion doses, 0-4.
  optional int32 doses = 4;
  optional int32 herblore_level = 5;
  repeated Effect effects = 6;
}

// The chance of burning at one level.
message CookingBurnRate {
  int32 level = 1;
  // Success rate on a fire, zero to one.
  optional float fire_rate = 2;
  optional float range_rate = 3;
  optional float gauntlets_rate = 4;
}

// What it takes to cook something, and what happens when it goes wrong.
message Cooking {
  optional int32 level = 1;
  optional float xp = 2;
  // The level at which you stop burning it on a fire.
  optional int32 stop_burn_level = 3;
  optional int32 stop_burn_level_gauntlets = 4;
  optional int32 stop_burn_level_hosidius = 5;
  optional ItemRef raw_item = 6;
  optional ItemRef burnt_item = 7;
  // Game ticks per cook.
  optional int32 ticks = 8;
  repeated CookingBurnRate burn_rates = 9;
}

// Prayer experience for bones and ashes, by where they are offered.
message Prayer {
  optional float xp_bury = 1;
  optional float xp_gilded_altar = 2;
  optional float xp_chaos_altar = 3;
  optional float xp_ectofuntus = 4;
}

// Getting an item out of the world with a gathering skill.
message Gathering {
  Skill skill = 1;
  // 1-99.
  int32 level = 2;
  optional float xp = 3;
  repeated string locations = 4;
  optional string tool = 5;
  optional bool members_only = 6;
}

// Which patch a seed goes in.
enum PatchType {
  PATCH_TYPE_UNSPECIFIED = 0;
  PATCH_TYPE_ALLOTMENT = 1;
  PATCH_TYPE_HERB = 2;
  PATCH_TYPE_TREE = 3;
  PATCH_TYPE_FRUIT_TREE = 4;
  PATCH_TYPE_HOPS = 5;
  PATCH_TYPE_FLOWER = 6;
  PATCH_TYPE_BUSH = 7;
  PATCH_TYPE_CACTUS = 8;
  PATCH_TYPE_MUSHROOM = 9;
  PATCH_TYPE_BELLADONNA = 10;
  PATCH_TYPE_SPIRIT_TREE = 11;
  PATCH_TYPE_CALQUAT = 12;
  PATCH_TYPE_REDWOOD = 13;
  PATCH_TYPE_SEAWEED = 14;
  PATCH_TYPE_HARDWOOD = 15;
}

// What to treat a patch with.
enum CompostType {
  COMPOST_TYPE_UNSPECIFIED = 0;
  COMPOST_TYPE_NONE = 1;
  COMPOST_TYPE_COMPOST = 2;
  COMPOST_TYPE_SUPERCOMPOST = 3;
  COMPOST_TYPE_ULTRACOMPOST = 4;
}

// Growing something, from either end: the seed or what it produces.
message Farming {
  optional int32 level = 1;
  optional float plant_xp = 2;
  optional float harvest_xp = 3;
  // Trees give experience for checking their health.
  optional float check_health_xp = 4;

  PatchType patch_type = 5;
  // Minutes to fully grow.
  optional int32 growth_time = 6;
  optional int32 growth_cycles = 15;
  optional int32 cycle_minutes = 16;

  // What the farmer wants to watch it, e.g. "1 basket of apples".
  optional string payment = 7;
  optional ItemRef payment_item = 8;

  // Set on the produce, naming its seed; and on the seed, naming its produce.
  optional ItemRef seed = 9;
  optional ItemRef produce = 10;

  optional int32 min_yield = 12;
  optional int32 max_yield = 13;
  CompostType compost_type = 14;
  // Immune to disease, as the Hespori is.
  optional bool disease_free = 18;
}

// What Slayer has to do with an item.
message Slayer {
  optional int32 level = 1;
  optional string master = 2;
  // Weighting in the master's assignment table.
  optional int32 task_weight = 3;
  optional string category = 4;
  // Whether you must be on the task to obtain or use it.
  optional bool requires_task = 5;
}

// Building something in a player-owned house.
message Construction {
  optional int32 level = 1;
  optional float xp = 2;
  optional string room = 3;
  optional string hotspot = 4;
  optional bool flatpack = 5;
  // The furniture this flatpack becomes.
  optional ItemRef built_item = 6;
}

// What an item is made of, for the resource items that are a material.
message Material {
  // e.g. "log", "ore", "bone", "hide".
  string type = 1;
  // e.g. "low", "mid", "mid-high", "high".
  optional string tier = 2;
}