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

242 lines6.9 KB
APIRaw
syntax = "proto3";

package kbve.osrs.v1;

import "google/protobuf/timestamp.proto";
import "kbve/asset/v1/asset.proto";
import "kbve/common/v1/registry.proto";
import "kbve/market/v1/market.proto";
import "kbve/market/v1/market_strategy.proto";
import "kbve/osrs/v1/osrs.proto";
import "kbve/osrs/v1/osrs_content.proto";
import "kbve/osrs/v1/osrs_equipment.proto";
import "kbve/osrs/v1/osrs_source.proto";
import "kbve/osrs/v1/osrs_training.proto";

// Which spellbook a teleport spell is on.
enum Spellbook {
  SPELLBOOK_UNSPECIFIED = 0;
  SPELLBOOK_STANDARD = 1;
  SPELLBOOK_ANCIENT = 2;
  SPELLBOOK_LUNAR = 3;
  SPELLBOOK_ARCEUUS = 4;
}

// What carries a teleport.
enum TeleportType {
  TELEPORT_TYPE_UNSPECIFIED = 0;
  TELEPORT_TYPE_JEWELRY = 1;
  TELEPORT_TYPE_TABLET = 2;
  TELEPORT_TYPE_SCROLL = 3;
  TELEPORT_TYPE_SPELL = 4;
  TELEPORT_TYPE_OTHER = 5;
}

// Somewhere an item can take you.
message TeleportDestination {
  string name = 1;
  optional string location = 2;
  // e.g. "Completion of Desert Treasure".
  optional string requirements = 3;
  optional bool members_only = 4;
  optional bool wilderness = 5;
}

// An item's teleports.
message Teleport {
  repeated TeleportDestination destinations = 1;
  // Zero means unlimited.
  optional int32 charges = 2;
  optional string recharge_method = 3;
  // Coins.
  optional int64 recharge_cost = 4;
  TeleportType type = 5;

  // Spell teleports only.
  Spellbook spellbook = 6;
  optional int32 magic_level = 7;
  repeated string runes = 8;
  optional float magic_xp = 9;
}

// How an item figures in a quest.
enum QuestRole {
  QUEST_ROLE_UNSPECIFIED = 0;
  QUEST_ROLE_REQUIRED = 1;
  QUEST_ROLE_REWARD = 2;
  QUEST_ROLE_OPTIONAL = 3;
  QUEST_ROLE_STARTS = 4;
}

message QuestRequirement {
  string quest_name = 1;
  QuestRole role = 2;
  optional int32 quantity = 3;
  optional string notes = 4;
}

// What sets a passive effect off.
enum PassiveTrigger {
  PASSIVE_TRIGGER_UNSPECIFIED = 0;
  PASSIVE_TRIGGER_ALWAYS = 1;
  PASSIVE_TRIGGER_ON_HIT = 2;
  PASSIVE_TRIGGER_ON_KILL = 3;
  PASSIVE_TRIGGER_WHILE_WORN = 4;
  PASSIVE_TRIGGER_CHANCE = 5;
}

// Something an item does on its own, as distinct from a special attack.
message PassiveEffect {
  string name = 1;
  optional string description = 2;
  PassiveTrigger trigger = 3;
  // Zero to one, when the trigger is CHANCE.
  optional float chance = 4;
  optional Skill affected_skill = 5;
  optional int32 boost_value = 6;
  optional string boost_formula = 7;
}

// How an item wears out, and what it costs to keep it.
message Charges {
  optional int32 max_charges = 1;
  optional ItemRef charge_cost_item = 2;
  optional int32 charges_per_item = 3;
  optional ItemRef degrade_to = 4;
  optional bool repairable = 5;
  // Coins.
  optional int64 repair_cost = 6;
  optional string repair_npc = 7;
  optional float combat_hours = 8;
}

// The wiki infobox.
message ItemProperties {
  optional google.protobuf.Timestamp release_date = 1;
  optional string update = 2;
  optional bool tradeable = 3;
  optional bool tradeable_ge = 4;
  optional bool stackable = 5;
  optional bool noteable = 6;
  optional bool equipable = 7;
  optional bool edible = 8;
  optional bool quest_item = 9;
  optional string quest = 10;
  // Right-click options in the inventory.
  repeated string options = 11;
  optional bool bankable = 12;
  optional bool placeholder = 13;
  // Kilograms, for items that are not equipment.
  optional float weight = 14;
  optional string destroy = 15;
  // Ground respawn, in ticks.
  optional int32 respawn = 16;
  repeated string worn_options = 17;
  // Not everything can be alchemised.
  optional bool alchable = 18;
}

// One item.
//
// Still one message with every subsystem hanging off it, as in the frozen
// schema. Whether the page model and the game model should be the same message
// is a real question and it is left open here: splitting it is a decision about
// what consumers exist, and the answer changes 4064 pages either way.
message Item {
  // The game's own id.
  int64 id = 1;
  string name = 2;
  string slug = 3;
  string examine = 4;
  bool members = 5;
  string icon = 6;

  // Coins. int64 throughout: OSRS's cash cap is int32 max, so any aggregate of
  // these -- a stack, an inventory, a family roster total -- overflows a 32-bit
  // field at exactly the point the game stops counting.
  int64 value = 7;
  optional int64 lowalch = 8;
  optional int64 highalch = 9;

  // 10 was ge_limit, a bare count with its four-hour window in a comment. The
  // window is a property of the venue's rules, so both live in TradingRules
  // with buy_limit_window_seconds set to 14400.
  reserved 10;
  reserved "ge_limit";
  optional kbve.asset.v1.TradingRules trading_rules = 48;

  optional Equipment equipment = 11;
  optional SpecialAttack special_attack = 12;
  optional SetBonus set_bonus = 13;

  // Renamed from drop_sources: the downstream Zod config was already renaming
  // it to drop_table on the way out.
  repeated DropSource drop_table = 14;
  repeated ShopSource shops = 15;
  repeated SkillingSource skilling_sources = 16;

  repeated Recipe recipes = 17;

  // 18 was `consumable`, a potion-specific message under a generic name, and 19
  // was `food`, which overlapped it. One Consumable covers both.
  reserved 18, 19;
  reserved "consumable", "food";
  optional Consumable potion = 49;
  optional Cooking cooking = 20;

  repeated RelatedItem related_items = 21;
  optional TreasureTrail treasure_trail = 22;

  optional ItemProperties properties = 23;
  optional Meta meta = 24;

  // 25 was OSRSPrice: a high/low pair with an epoch each, which is a quote with
  // instant-buy and instant-sell under other names. 27 was a market strategy
  // modelled a second time. Both are the market domain's.
  reserved 25, 27;
  reserved "price", "market_strategy";
  optional kbve.market.v1.Quote quote = 50;
  optional kbve.market.v1.Strategy strategy = 51;

  optional About about = 26;
  repeated string trading_tips = 28;
  optional Material material = 29;

  optional Prayer prayer = 30;
  optional Gathering gathering = 31;
  optional Teleport teleport = 32;

  // 33 was quest_data, a message whose only field was a list.
  reserved 33;
  reserved "quest_data";
  repeated QuestRequirement quests = 52;

  optional Farming farming = 34;
  optional Charges charges = 35;
  optional Slayer slayer = 36;
  optional Construction construction = 37;
  repeated PassiveEffect passive_effects = 38;
  optional Ammunition ammunition = 39;

  optional int32 mdx_version = 40;
  // 41 was an ISO date string.
  reserved 41;
  reserved "mdx_updated";
  optional google.protobuf.Timestamp updated_at = 53;

  repeated FaqEntry faq = 42;
  repeated string trivia = 43;
  // This page.
  optional string url = 44;
  // Where a variant or dose page points instead.
  optional string canonical = 45;

  optional FamilyRef family_ref = 46;
  optional Family family = 47;
}

// Every item, as shipped to clients.
message ItemRegistry {
  kbve.common.v1.RegistryMeta meta = 1;
  repeated Item items = 2;
}