Advertisement
Guest User

Untitled

a guest
Aug 29th, 2012
818
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.49 KB | None | 0 0
  1. ///////////////////////////////
  2. //**** Created By EroniX ****//
  3. ///////////////////////////////
  4. //
  5. // #Files: - TransmogHandler.cpp
  6. //
  7. // - TransmogEngine.cpp
  8. // - TransmogEngine.h
  9. //
  10. // - TransmogMgr.cpp
  11. // - TransmogMgr.h
  12. //
  13. //
  14. // #Core Mods: - Player.cpp:
  15. // - #include "TransmogEngine.h"
  16. // - EquipItem:
  17. // - TransmogEngine::SetTransmogDisplay(this, slot);
  18. //
  19. // - RemoveItem:
  20. // - TransmogEngine::RemoveTransmog(this, slot);
  21. //
  22. // - Player.h:
  23. // - uint32 selectedSlotID;
  24. // - Loot* selectedInterface;
  25. //
  26. // - LootHandler.cpp:
  27. // - #include "TransmogEngine.h"
  28. // - HandleAutostoreLootItemOpcode:
  29. // if(TransmogEngine::IsActiveInterface(lguid) && player)
  30. // {
  31. // if(Creature* creature = player->GetMap()->GetCreature(lguid))
  32. // TransmogEngine::HandleInterfaceSelect(player, creature, player->selectedInterface, lootSlot);
  33. //
  34. // return;
  35. // }
  36. //
  37. // - HandleLootReleaseOpcode:
  38. // if(Player* player = GetPlayer())
  39. // if(TransmogEngine::IsActiveInterface(guid))
  40. // {
  41. // if(Creature* creature = GetPlayer()->GetMap()->GetCreature(guid))
  42. // TransmogEngine::SendInterfaceClose(player, guid);
  43. //
  44. // return;
  45. // }
  46.  
  47. #ifndef TRANSMOG_ENGINE_H
  48. #define TRANSMOG_ENGINE_H
  49.  
  50. #include "ScriptPCH.h"
  51.  
  52. #define PROBLEM -255
  53. #define MENU_TEXT 100
  54.  
  55. #define BAG 255
  56. #define ENTRY 100002
  57.  
  58.  
  59. #define TransmogableItemsCount 12
  60.  
  61.  
  62. enum MenuText
  63. {
  64. TEXT_MAIN = 1,
  65. TEXT_INFORMATION = 2
  66. };
  67.  
  68. enum Spells
  69. {
  70. VANISH_VISUAL = 24222,
  71. SEAL_OF_LIGHT = 132
  72. };
  73.  
  74. enum ItemSlotTypes
  75. {
  76. HEAD = 0,
  77. SHOULDERS = 2,
  78. CHEST = 4,
  79. WAIST = 5,
  80. LEGS = 6,
  81. FEET = 7,
  82. WRIST = 8,
  83. HANDS = 9,
  84. BACK = 14,
  85. MAIN_HAND = 15,
  86. OFF_HAND = 16,
  87. RANGED = 17
  88. };
  89.  
  90. enum ColorCode
  91. {
  92. COLOR_BLACK = 7,
  93. COLOR_DARK_GREY = 6,
  94. COLOR_GOLD = 5,
  95. COLOR_PURPLE = 4,
  96. COLOR_BLUE = 3,
  97. COLOR_GREEN = 2,
  98. COLOR_GREY = 1
  99. };
  100.  
  101. const std::string colorCodes[7] =
  102. {
  103. "454545", "00ff00", "0000cd", "8a2be2", "ff8c00", "1e1e1e", "000000"
  104. };
  105.  
  106. const int32 itemSlotTypes[TransmogableItemsCount] =
  107. {
  108. HEAD, SHOULDERS, CHEST, WAIST, LEGS, FEET, WRIST, HANDS, BACK, MAIN_HAND, OFF_HAND, RANGED
  109. };
  110.  
  111. class TransmogEngine
  112. {
  113. public: // DB Helper Methods
  114. static void SetTransmogItem(Player* player, uint32 itemENTRY, uint32 slotID);
  115. static void RemoveAllTransmog(Player* player);
  116. static void RemoveTransmog(Player* player, uint32 slotID);
  117.  
  118. public: // DB Methods: Private
  119. static void ReplaceTransmogDB(uint32 playerGUID, uint32 itemGUID, uint32 itemENTRY);
  120. static void RemoveTransmogDB(uint32 itemGUID);
  121.  
  122. public: // DB Methods: Public
  123. static void RemoveAllTransmogDB(uint32 playerGUID);
  124.  
  125. public: // Display Methods: Public
  126. static bool SetAllTransmogDisplay(Player* player);
  127. static bool SetTransmogDisplay(Player* player, uint32 slotID);
  128. static bool RemoveAllTransmogDisplay(Player* player);
  129. static bool RemoveTransmogDisplay(Player* player, uint32 slotID);
  130.  
  131. private: // Checker Methods: Private
  132. static bool CheckItem(Player* itemOwner, Item* oldItem, const ItemTemplate* newItemTemplate);
  133. static bool TransmogDisplay(Player* player, int32 itemENTRY, int32 slotID);
  134. static bool IsInList(Loot* loot, LootStoreItem storeitem);
  135. static bool IsInList(uint32 value, uint32 subClassTwoHand[4], uint8 length);
  136.  
  137. public: // Checker Methods: Public
  138. static bool IsActiveInterface(uint64 creatureGUID);
  139.  
  140. private: // Helper Methods: Private
  141. static std::string GetString(int32 value);
  142. static std::string GetSlotName(uint32 slotID);
  143. static int32 GetVisualId(uint32 slotID) { return slotID * 2 + 283; }
  144.  
  145. public: // Helper Methods: Public
  146. static std::string CreateColorString(uint32 color, std::string text);
  147.  
  148. public: // Interface Methods: Public
  149. static void AddInterfacePreparation(Player* player, Creature* creature, Loot* loot, uint8 slotID);
  150. static void RemoveInterfacePreparation(Player* player);
  151. static void HandleInterfaceSelect(Player* player, Creature* creature, Loot* loot, uint8 lootSLOT);
  152. static void SendInterfaceOpen(Player* player, Creature* creature, Loot* loot);
  153. static void SendInterfaceClose(Player* player, uint64 creatureGUID);
  154. static Loot* CreateInterface(Player* player, Item* oldItem);
  155.  
  156. public: // TransmogHandler: Public
  157. static void GossipHelloMainMenu(Player* player, Creature* creature);
  158. };
  159. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement