Example #1
0
        private void OnInventoryRequestUseMessage(InventoryRequestUseMessage inventoryRequestUseMessage)
        {
            uint targetItemId = inventoryRequestUseMessage.UsedOnItem;
            uint usedItemId = inventoryRequestUseMessage.UsedItem;
            int actionId = inventoryRequestUseMessage.Field1;
            Item usedItem = GetItem(usedItemId);
            Item targetItem = GetItem(targetItemId);

            usedItem.OnRequestUse(_owner, targetItem, actionId, inventoryRequestUseMessage.Location);
        }
Example #2
0
 private void OnInventoryRequestUseMessage(InventoryRequestUseMessage inventoryRequestUseMessage)
 {
     uint targetItemId = inventoryRequestUseMessage.UsedOnItem;
     uint usedItemId = inventoryRequestUseMessage.UsedItem;
     int actionId = inventoryRequestUseMessage.Field1; // guess 1 means dyeing. Probably other value for using identify scroll , selling , .... - angerwin
     Item usedItem = _owner.World.GetItem(usedItemId);
     Item targetItem = _owner.World.GetItem(targetItemId);
     if (actionId == 1) 
     {
         DyeColor.DyeItem(usedItem, targetItem);
     }
     DestroyInventoryItem(usedItem);
     SendVisualInventory(_owner);
 }
Example #3
0
        private void OnInventoryRequestUseMessage(InventoryRequestUseMessage inventoryRequestUseMessage)
        {
            uint targetItemId = inventoryRequestUseMessage.UsedOnItem;
            uint usedItemId = inventoryRequestUseMessage.UsedItem;
            int actionId = inventoryRequestUseMessage.Field1; // guess 1 means dyeing. Probably other value for using identify scroll , selling , .... - angerwin
            Item usedItem = _owner.World.GetItem(usedItemId);
            Item targetItem = _owner.World.GetItem(targetItemId);

            usedItem.OnRequestUse(_owner, targetItem, actionId, inventoryRequestUseMessage.Location);
        }