/// <summary>
        /// Create an instance inventory item from a blueprint
        /// </summary>
        /// <param name="blueprint">The blueprint to create the instance inventory item from</param>
        /// <param name="droppable">Whether the item should be dropable</param>
        /// <param name="pp">Whether the item should be pickpocketable</param>
        /// <returns>The instance inventory item</returns>
        private static NWN2InstanceInventoryItem createInstanceItemInfo(NWN2ItemBlueprint blueprint, bool droppable, bool pp)
        {
            NWN2InstanceInventoryItem itemInfo = new NWN2InstanceInventoryItem();
            itemInfo.Item = NWN2ItemInstance.CreateFromBlueprint(blueprint);

            itemInfo.Droppable = droppable;
            itemInfo.Pickpocketable = pp;
            itemInfo.InInventory = true;
            return itemInfo;
        }
Exemple #2
0
        /// <summary>
        /// Adds a inventory item to the actor
        /// </summary>
        /// <param name="item">The instance for the inventory item</param>
        public void addInv(NWN2InstanceInventoryItem item)
        {
            switch (type)
                {
                case EnumTypes.actorType.Creature:
                    ((NWN2CreatureInstance)instance).Inventory.Add(item);
                    break;

                case EnumTypes.actorType.Placeable:
                    ((NWN2PlaceableInstance)instance).Inventory.Add(item);
                    break;

                default:
                    throw new Exception("You must place an inventory Item in either a creature/NPC or a placable");
                }
        }
        // The following 2 methods comes from LazjensCPSInventoryManager
        /// <summary>
        /// Creates a instance inventroy item
        /// </summary>
        /// <param name="item">The instance item we want to make into an instance 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 instance inventory item</returns>
        private static NWN2InstanceInventoryItem createInstanceItemInfo(NWN2ItemInstance item, bool droppable, bool pp)
        {
            NWN2InstanceInventoryItem itemInfo = new NWN2InstanceInventoryItem();
            itemInfo.Item = item;

            itemInfo.Droppable = droppable;
            itemInfo.Pickpocketable = pp;
            itemInfo.InInventory = true;
            return itemInfo;
        }