MichaelCrow

Untitled

Apr 25th, 2022
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.58 KB | None | 0 0
  1. class item_generic_thread : public ItemScript
  2. {
  3. public:
  4.     item_generic_thread() : ItemScript("item_generic_thread") {}
  5.  
  6.     bool OnUse(Player* player, Unit* /*unit*/, SpellInfo const* spellInfo, Item* item)
  7.     {
  8.  
  9.         uint32 itementryid = item->GetEntry();
  10.  
  11.         enum reagantList
  12.         {
  13.             RHINO_HAIR = 123,
  14.             SPIDER_HAIR = 124,
  15.             BODY_HAIR = 125
  16.         };
  17.  
  18.         enum threadtypes
  19.         {
  20.             WOOL_THREAD = 12345,
  21.             SILK_THREAD = 12346,
  22.             OTHER_THREAD = 12347
  23.         };
  24.  
  25.  
  26.         switch (itementryid)
  27.         {
  28.             case RHINO_HAIR:
  29.                 if (player->GetItemCount(RHINO_HAIR, 10))
  30.                 {
  31.                     player->DestroyItemCount(RHINO_HAIR, 10, true);
  32.                     player->AddItem(WOOL_THREAD, 1);
  33.                 }
  34.             break;
  35.  
  36.             case SPIDER_HAIR:
  37.                 if (player->GetItemCount(SPIDER_HAIR, 10))
  38.                 {
  39.                     player->DestroyItemCount(SPIDER_HAIR, 10, true);
  40.                     player->AddItem(SILK_THREAD, 1);
  41.                 }
  42.             break;
  43.  
  44.             case BODY_HAIR:
  45.                 if (player->GetItemCount(BODY_HAIR), 10)
  46.                 {
  47.                     player->DestroyItemCount(BODY_HAIR, 10, true);
  48.                     player->AddItem(OTHER_THREAD, 1);
  49.                 }
  50.                 break;
  51.  
  52.             //in case you get no itemid at all, fuck if i know how though lol
  53.             default:
  54.                 return;
  55.                 break;
  56.  
  57.            
  58.  
  59.         }
  60.     }
  61. };
Add Comment
Please, Sign In to add comment