Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Search in project

创建项目模板


Item inventory system is really complex and versatile. You can define many different types of items which can be used in other modules. For example you can create loot table which will be something like a bag of items from which player will get something after he will defeat the mob which has that loot table attached. More about item types you can find in Items Plugin section.

Another example is crafting where you can define materials and result items.

Questing also has items to define a rewards where you can have rewards and optional rewards.

Items are also presented as gathered items for example materials like ore or wood or any kind of resources you would like to have in your game.

Finally, items are part of merchants trade system, where you can define something we called merchant table, which contains items available for purchase for a player when he will talk with a merchant.

Getting characters/mobs ready to equip items The first step in getting items and loot ready for your game is to prepare the characters to equip items. A new Script needs to be added to your character prefabs: AtavismMobAppearance. You then need to set the bones or sockets for the key item slots. This is achieved by dragging the prefab into a scene, finding the child object in the prefab for the slot in question, and dragging that into the slot in the component on the prefab. Once all the slots are set (Only need to worry about Main Hand and Off Hand for the moment).

Creating an Equipment Display For items that can be equipped an Equipment Display prefab is required. These are found under Resources/Content/EquipmentDisplay. Equipment displays are simple – Duplicate an existing one (an example one is provided), give it a new name and drag in the model to the model property.

Creating Items Click on the Items button in the left pane then on Items in the second pane. There are a lot of details here but a few are not active yet. The important ones that need to be filled in are:

  • Item Type (This is critical, it determines how the item works, choose the option that makes sense)
  • Item Sub-Type (Choose the one that makes sense)
  • Name (The name of the item)
  • Equipment Display (Only used for weapons/armor. Drag in your prefab here from the EquipmentDisplay folder found under Resources/Content/)
  • Slot (Only used for weapons/armor. Where the item gets equipped)
  • Damage Type (choose one from the drop down)
  • Damage amount (Weapons Only. How much damage the weapon does)
  • Delay (Weapons Only. How long between attacks when using this weapon – 2000 = 2 seconds)

Setting up Loot The Loot system works by creating loot tables which can have numerous items inside, each with a specified drop chance, then giving loot tables to mobs with a drop chance of that table being used. When a mob is killed, a dice roll is done for each loot table the mob has. Then if a table is successful, a roll is done to determine which item from inside the table is dropped. Numerous loot tables can be successful, but each table will only drop one item.

  • Step 1 – Create a loot table

Click on the Mob/NPC button in the left pane then on Loot Tables in the second pane.Give the loot table a name, then choose an item from the drop down, give it a chance to drop, and specify how many of the item will drop. To add additional items to the table click Add Item. Click Save when you are happy with your loot table.

  • Step 2 – Add the loot table to a mob template

Click on the Mob/NPC button in the left pane then on Mobs in the second pane.If you already have a mob, click on the Edit Mob button, otherwise make a new mob and click save. At the bottom of the page, there is a new button: Edit Mob Loot. Click it. Choose the loot table you want the mob to drop and the drop chance for it. Click Add Loot Table to add more.

  • Step 3 – Restart the server

With all changes to the database, you need to restart the server for it to take effect. Restart your server and your mobs will be ready to drop your loot!

Looting Mobs Upon killing a mob that has loot yellow particles will show up. Mousing over the dead mob will produce a new cursor: Right clicking on the mob will bring up a loot window showing you the loot available. Mousing over items will bring up a tooltip showing you the item name. Click on an item to loot it.

Using your Items At the bottom left of the screen you will have a bag icon, clicking it will bring up your inventory. You can right click on an item to equip/activate it or left click it to change the cursor to the item so you can move or delete the item. You can delete an item by left clicking on it to select the item, then move the cursor to an empty area of the screen and clicking again. A box comes up asking if you want to delete it. You can view your items equipped by clicking on the button on the top right.