Advertisement
TemplatesDoVitinho

Untitled

Aug 24th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.96 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Text;
  4. using System.Collections.Generic;
  5.  
  6. using Plus.HabboHotel.Items;
  7. using Plus.HabboHotel.Items.Utilities;
  8.  
  9. namespace Plus.HabboHotel.Catalog.Utilities
  10. {
  11.     public static class ItemUtility
  12.     {
  13.         public static bool CanGiftItem(CatalogItem Item)
  14.         {
  15.             if (!Item.Data.AllowGift || Item.IsLimited || Item.Amount > 1 || Item.Data.ItemName.ToLower().StartsWith("cf_") || Item.Data.ItemName.ToLower().StartsWith("cfc_") ||
  16.                 Item.Data.InteractionType == InteractionType.BADGE || (Item.Data.Type != 's' && Item.Data.Type != 'i') || Item.CostDiamonds > 0 ||
  17.                 Item.Data.InteractionType == InteractionType.TELEPORT || Item.Data.InteractionType == InteractionType.DEAL)
  18.                 return false;
  19.  
  20.             if (Item.Data.IsRare)
  21.                 return false;
  22.  
  23.             if (PetUtility.IsPet(Item.Data.InteractionType))
  24.                 return false;
  25.             return true;
  26.         }
  27.  
  28.         public static bool CanSelectAmount(CatalogItem Item)
  29.         {
  30.             if (Item.IsLimited || Item.Amount > 1 || Item.Data.ItemName.ToLower().StartsWith("cf_") || Item.Data.ItemName.ToLower().StartsWith("cfc_") || !Item.HaveOffer || Item.Data.InteractionType == InteractionType.BADGE || Item.Data.InteractionType == InteractionType.DEAL)
  31.                 return false;
  32.             return true;
  33.         }
  34.  
  35.         public static int GetSaddleId(int Saddle)
  36.         {
  37.             switch (Saddle)
  38.             {
  39.                 default:
  40.                 case 9:
  41.                     return 7100; //4221 Changed to the right BaseItem, so it can be saved.
  42.                 case 10:
  43.                     return 4450;
  44.             }
  45.         }
  46.  
  47.         public static bool IsRare(Item Item)
  48.         {
  49.             if (Item.LimitedNo > 0)
  50.                 return true;
  51.  
  52.             if (Item.Data.IsRare)
  53.                 return true;
  54.  
  55.             return false;
  56.         }
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement