[29] Item Combinations

01/31/2021, 01:28pm

This month, I finally got around to implementing item combinations. It wasn't that large of an addition, but was required for some crafting stuff I have planned. Down the line, it will also be useful for quests.

To define a combination between two items, you add an entry to combos in an items definition file. Here is an example of a combo for the egg item:

[[combos]] type = "combine" tgt_item_res_name = "bowl" output_item_res_name = "raw-scrambled-eggs" output_message = "You crack the egg into the bowl and stir it up."

The type parameter isn't important now, but you can use "event" to configure a combination that triggers a game event in the case that something special needs to happen (other than just making a new item). I'll talk about that more in a future post.

I had fun adding some new items (mostly cooking ingredients) to take advantage of that system. Here's a video of my character making dough with water + flour, then baking some bread:

There are still some issues. For example, why is the bowl consumed when you pour water out of it? Also, I'm not sure it makes sense to be able to bake a loaf of bread over an open fire.

New Packets

/// 72 - 0x48 - Inventory Item Combine Request /// Client InventoryItemCombineRequestPacket { source_item_slot: u8, target_item_slot: u8, }

Skill Requirements for Equipment

You can now specify skill_requirements on any equipment item:

name = "Chef's Toque" description = "The official hat of a Chef." types = ["armor"] model_id = 78 is_stackable = false value = 80 [attributes] armor = 0 equipment_slot = "head" skill_requirements = [{ skill = "cooking", lvl = 20}]

It's pretty self-explanatory. If you don't have the required levels in the required skills, you won't be able to equip the item. Not much else to talk about now. Next month, I hope to finish up more crafting related stuff.

- Declan (@dooskington)