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
225 stars 82 forks source link

Equipable items with null slots #55

Closed nwalsh1995 closed 5 years ago

nwalsh1995 commented 5 years ago

Seems like there is some data that is incomplete or something marked incorrectly. If an item is equipable it must have a slot. If you search for equipable items that have "slot": null you will see which ones that are marked incorrectly.

Reproduction:

EQUIPABLE_ITEMS = [item for item in AllItems() if item.equipable]

for item in EQUIPABLE_ITEMS:
    if item.item_equipment.slot is None:
        print(f"Item {item.name}:{item.id} is incorrect")
Item Crone-made amulet:10500 is incorrect
Item A jester stick:10840 is incorrect
Item Poisoned dagger(p):1235 is incorrect
Item Null:13206 is incorrect
Item Null:13211 is incorrect
Item Null:13219 is incorrect
Item Shayzien supply gloves (1):13538 is incorrect
Item Shayzien supply boots (1):13539 is incorrect
Item Shayzien supply helm (1):13540 is incorrect
Item Shayzien supply greaves (1):13541 is incorrect
Item Shayzien supply platebody (1):13542 is incorrect
Item Shayzien supply gloves (2):13543 is incorrect
Item Shayzien supply boots (2):13544 is incorrect
Item Shayzien supply helm (2):13545 is incorrect
Item Shayzien supply greaves (2):13546 is incorrect
Item Shayzien supply platebody (2):13547 is incorrect
Item Shayzien supply gloves (3):13548 is incorrect
Item Shayzien supply boots (3):13549 is incorrect
Item Shayzien supply helm (3):13550 is incorrect
Item Shayzien supply greaves (3):13551 is incorrect
Item Shayzien supply platebody (3):13552 is incorrect
Item Shayzien supply gloves (4):13553 is incorrect
Item Shayzien supply boots (4):13554 is incorrect
Item Shayzien supply helm (4):13555 is incorrect
Item Shayzien supply greaves (4):13556 is incorrect
Item Shayzien supply platebody (4):13557 is incorrect
Item Shayzien supply gloves (5):13558 is incorrect
Item Shayzien supply boots (5):13559 is incorrect
Item Shayzien supply helm (5):13560 is incorrect
Item Shayzien supply greaves (5):13561 is incorrect
Item Shayzien supply platebody (5):13562 is incorrect
Item Null:13661 is incorrect
Item Null:13662 is incorrect
Item Null:1450 is incorrect
Item Null:1459 is incorrect
Item Null:1460 is incorrect
Item Null:15297 is incorrect
Item Null:15303 is incorrect
Item Null:15304 is incorrect
Item Null:15309 is incorrect
Item Null:15344 is incorrect
Item Null:15345 is incorrect
Item Null:15346 is incorrect
Item Ring of nature:20005 is incorrect
Item Ring of coins:20017 is incorrect
Item Null:20391 is incorrect
Item Null:20392 is incorrect
Item Null:20398 is incorrect
Item Null:20399 is incorrect
Item Null:20400 is incorrect
Item Null:20404 is incorrect
Item Null:20409 is incorrect
Item Null:20410 is incorrect
Item Null:20411 is incorrect
Item Null:20412 is incorrect
Item Null:20413 is incorrect
Item Null:20414 is incorrect
Item Null:20419 is incorrect
Item Null:20420 is incorrect
Item Null:20427 is incorrect
Item Null:20569 is incorrect
Item Null:20570 is incorrect
Item Null:20762 is incorrect
Item Null:20763 is incorrect
Item Wilderness champion amulet:21433 is incorrect
Item Redundant hat:21826 is incorrect
Item Redundant top:21829 is incorrect
Item Redundant leggings:21832 is incorrect
Item Null:22329 is incorrect
Item Null:22779 is incorrect
Item Ring of forging:2568 is incorrect
Item Ring of life:2570 is incorrect
Item Orange goblin mail:286 is incorrect
Item Blue goblin mail:287 is incorrect
Item Goblin mail:288 is incorrect
Item Null:2885 is incorrect
Item Null:3667 is incorrect
Item Pet rock:3695 is incorrect
Item Mouth grip:4181 is incorrect
Item Ring of charos:4202 is incorrect
Item Lathas' amulet:421 is incorrect
Item Dwarven battleaxe:5056 is incorrect
Item Dwarven battleaxe:5057 is incorrect
Item Dwarven battleaxe:5058 is incorrect
Item Dwarven battleaxe:5059 is incorrect
Item Left boot:5062 is incorrect
Item Right boot:5063 is incorrect
Item Exquisite boots:5064 is incorrect
Item Exquisite clothes:5067 is incorrect
Item Null:5549 is incorrect
Item Null:5550 is incorrect
Item Null:5551 is incorrect
Item Null:5552 is incorrect
Item Poison dagger(p+):5684 is incorrect
Item Poison dagger(p++):5702 is incorrect
Item Null:6208 is incorrect
Item Ring of charos(a):6465 is incorrect
Item Ring of stone:6583 is incorrect
Item Torn robe:6788 is incorrect
Item Torn robe:6789 is incorrect
Item Bow-sword:6818 is incorrect
Item Marionette handle:6864 is incorrect
Item Null:6888 is incorrect
Item Clue scroll:713 is incorrect
Item Paddle:7414 is incorrect
Item Easter ring:7927 is incorrect
Item Poisoned dart(p):818 is incorrect
Item Null:8796 is incorrect
Item Red goblin mail:9054 is incorrect
Item Black goblin mail:9055 is incorrect
Item Yellow goblin mail:9056 is incorrect
Item Green goblin mail:9057 is incorrect
Item Purple goblin mail:9058 is incorrect
Item Pink goblin mail:9059 is incorrect
Item Torch:9665 is incorrect
Item Stick:9702 is incorrect
Item Null:980 is incorrect
Item Ghost buster 500:9906 is incorrect
Item Ghost buster 500:9907 is incorrect
Item Ghost buster 500:9908 is incorrect
Item Ghost buster 500:9909 is incorrect
Item Ghost buster 500:9910 is incorrect
Item Ghost buster 500:9911 is incorrect
nwalsh1995 commented 5 years ago

Potentially we want to have something marked as equipable by player? For instance, I bet a lot of this stuff is wielded by NPCs and only equipable by them.

osrsbox commented 5 years ago

@nwalsh1995 - I was aware of this problem with some equipable items not having a slot property. But it is nice to get an actual list documented of the affected items. Unfortunately, this is a difficult problem to fix.

Summary of how items are populated:

Couple of issues here:

Solution: I am not too sure what to do about these items. Currently they are handled in the normalized_names.txt file. If an item ID number has a status code of 6, it is equipable, but the stats (and slot/attack speed) are not obtainable. This file is loaded and used in the items_builder process. I do not really want to hard-code the values, as each week I use the items_builder to re-build the database. Couple of thoughts:

Sorry about the long-winded reply - it was a bit of a brain dump!

nwalsh1995 commented 5 years ago

Thanks, great explanation of whats happening.

@osrsbox tbh I think it is valid how they are being marked as equipable since by the game engine they are. I suggest to either alter the current .equipable property or make a new property .equipable_by_player where they check that it is equipable and that it has a valid slot (and potentially has valid bonuses? not sure about this one).

To me, it seems easier to just take an approach where we leave the data as in (besides a few cases like Null) and instead use some extra logic around them to determine their validity.

osrsbox commented 5 years ago

Just an update on this issue. I am planning to add a new attribute named equipable_by_player (as you suggested in your last comment). Currently writing the code that will perform a check when the item database is populated to see if there are:

If the requirements are met, the equipable_by_player will be set to True.