Beispiel #1
0
 /// <summary>
 /// Create a blueprint inventory item from a blueprint
 /// </summary>
 /// <param name="item">The blueprint we want to turn into a Blueprint inventory Item</param>
 /// <param name="droppable">Whether the item should be dropable</param>
 /// <param name="pp">Whether the item should be pickpocketable</param>
 /// <returns>The blueprint inventory item</returns>
 private static NWN2BlueprintInventoryItem createBlueprintItemInfo(NWN2ItemBlueprint item, bool droppable, bool pp)
 {
     NWN2BlueprintInventoryItem itemInfo = new NWN2BlueprintInventoryItem();
     itemInfo.Item = item.Resource;
     itemInfo.Droppable = droppable;
     itemInfo.Pickpocketable = pp;
     itemInfo.InInventory = true;
     return itemInfo;
 }
Beispiel #2
0
        /// <summary>
        /// Adds a inventory item to the actor
        /// </summary>
        /// <param name="item">The blueprint for the inventory item</param>
        public void addInv(NWN2BlueprintInventoryItem item)
        {
            switch (type)
                {
                case EnumTypes.actorType.Creature:
                    ((NWN2CreatureBlueprint)blueprint).Inventory.Add(item);
                    break;

                case EnumTypes.actorType.Placeable:
                    ((NWN2PlaceableBlueprint)blueprint).Inventory.Add(item);
                    break;

                default:
                    throw new Exception("You must place an inventory Item in either a creature/NPC or a placable");
                }
        }
Beispiel #3
0
        /// <summary>
        /// Turns an Item instance into a blueprint inventory item
        /// </summary>
        /// <param name="item">The iteminstance we want to turn into a Blueprint inventory Item</param>
        /// <param name="droppable">Whether the item should be dropable</param>
        /// <param name="pp">Whether the item should be pickpocketable</param>
        /// <returns>The blueprint inventory item</returns>
        private NWN2BlueprintInventoryItem createBlueprintItemInfo(NWN2ItemInstance item, bool droppable, bool pp)
        {
            var blueItem = NWN2ItemInstance.CreateBlueprintFromInstance(item, module.Repository, false);

            NWN2BlueprintInventoryItem itemInfo = new NWN2BlueprintInventoryItem();
            itemInfo.Item = blueItem.Resource;
            itemInfo.Droppable = droppable;
            itemInfo.Pickpocketable = pp;
            itemInfo.InInventory = true;
            return itemInfo;
        }