osrsbox / osrsbox-db

A complete and up-to-date database of Old School Runescape (OSRS) items, monsters and prayers
https://www.osrsbox.com/projects/osrsbox-db/
GNU General Public License v3.0
227 stars 83 forks source link

Add new properties: level_req and skill_req #5

Closed osrsbox closed 5 years ago

osrsbox commented 6 years ago

The general idea is to add a new tag for all equipable items which specifies the skill level required to equip a specific item. This would require conveying two properties:

  1. Item skill requirement (e.g., attack, strength)
  2. Item level requirement (e.g., 10, 60)
osrsbox commented 5 years ago

Design:

Slight update on progress for this issue. The design for the requirements data is:

"bonuses": {
        ....
        "requirements": [
        {
            "skill_req": "attack",
            "level_req": 75
        },
        {
            "skill_req": "magic",
            "level_req": 75
        }
        ]
}

Rationale:

  1. The new entry should be put in bonuses as only equiped items have this entry - but since this entry is getting so big (it only started with bonuses), it might be prudent to rename it?? Could be called equipment?? Or similar. This would require changes to any tools that use the database!
  2. The entry needs to be a list, as some items have multiple requirements (see the example above)
  3. Two properties have been added: skill_req for the type of skill (attack, strength, defence, magic, range, prayer, and null), and level_req for the associated level in the specified skill (an integer such as 1, 10, 40 etc.)

Full example:

{
    "id": 12904,
    "name": "Toxic staff of the dead",
    "members": true,
    "tradeable": false,
    "stackable": false,
    "noted": false,
    "noteable": false,
    "equipable": true,
    "cost": 1000006,
    "lowalch": 400002,
    "highalch": 600003,
    "weight": 1.0,
    "buy_limit": null,
    "quest_item": null,
    "release_date": "08 January 2015",
    "examine": [
        "A ghastly weapon with evil origins, with a toxic fang attached."
    ],
    "url": "https://oldschool.runescape.wiki/w/Toxic_staff_of_the_dead",
    "bonuses": {
        "attack_stab": 55,
        "attack_slash": 70,
        "attack_crush": 0,
        "attack_magic": 25,
        "attack_ranged": 0,
        "defence_stab": 0,
        "defence_slash": 3,
        "defence_crush": 3,
        "defence_magic": 17,
        "defence_ranged": 0,
        "melee_strength": 72,
        "ranged_strength": 0,
        "magic_damage": 15,
        "prayer": 0,
        "slot": "weapon",
        "attack_speed": 6,
        "requirements": [
        {
            "skill_req": "attack",
            "level_req": 75
        },
        {
            "skill_req": "magic",
            "level_req": 75
        }
        ]
    }
}
osrsbox commented 5 years ago

After thinking more about the structure of equipable items, I have come up with the following: a new entry called equipment that houses slot, attack_speed and requirements. I think this will provide a better structure, keeping bonuses separate and clean.

{
   "id":12904,
   "name":"Toxic staff of the dead",
   "members":true,
   "tradeable":false,
   "stackable":false,
   "noted":false,
   "noteable":false,
   "equipable":true,
   "cost":1000006,
   "lowalch":400002,
   "highalch":600003,
   "weight":1.0,
   "buy_limit":null,
   "quest_item":null,
   "release_date":"08 January 2015",
   "examine":[
      "A ghastly weapon with evil origins, with a toxic fang attached."
   ],
   "url":"https://oldschool.runescape.wiki/w/Toxic_staff_of_the_dead",
   "equipment":{
      "slot":"weapon",
      "attack_speed":6,
      "skill_reqs":[
         {
            "skill":"attack",
            "level":75
         },
         {
            "skill":"magic",
            "level":75
         }
      ]
   },
   "bonuses":{
      "attack_stab":55,
      "attack_slash":70,
      "attack_crush":0,
      "attack_magic":25,
      "attack_ranged":0,
      "defence_stab":0,
      "defence_slash":3,
      "defence_crush":3,
      "defence_magic":17,
      "defence_ranged":0,
      "melee_strength":72,
      "ranged_strength":0,
      "magic_damage":15,
      "prayer":0
   }
}
osrsbox commented 5 years ago

Small update:

Have processed 854 out of 3,335 equipable items so far!

osrsbox commented 5 years ago

This issue is closed with 2e838ab4b29c3f4c20f8eef13cba4339c5b439eb. New skill requirements have been added to all equipable items.