Advertisement
Rochet2

Untitled

Mar 7th, 2015
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.81 KB | None | 0 0
  1. void Player::SetVisibleItemSlot(uint8 slot, Item* pItem)
  2. {
  3.     if (pItem)
  4.     {
  5.         QueryResult char_t = CharacterDatabase.PQuery("select item2 from transmog_force_item_character where item1 = %u and charid = %u;", pItem->GetEntry(), GetGUIDLow());
  6.         QueryResult class_t = CharacterDatabase.PQuery("select item2 from transmog_force_item_class where item1 = %u and classid = %u;", pItem->GetEntry(), uint32(getClass()));
  7.         QueryResult force_t = CharacterDatabase.PQuery("select item2 from transmog_force_item where item1 = %u;", pItem->GetEntry());
  8.  
  9.         if (char_t)
  10.         {
  11.             Field* char_tfield = char_t->Fetch();
  12.             uint32 item_2 = char_tfield[0].GetUInt32();
  13.  
  14.             SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), item_2);
  15.         }
  16.         else if (class_t)
  17.         {
  18.             Field* class_tfield = class_t->Fetch();
  19.             uint32 item_2 = class_tfield[0].GetUInt32();
  20.  
  21.             SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), item_2);
  22.         }
  23.         else if (force_t)
  24.         {
  25.             Field* force_tfield = force_t->Fetch();
  26.             uint32 item_2 = force_tfield[0].GetUInt32();
  27.  
  28.             SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), item_2);
  29.         }
  30.         else
  31.         {
  32.             SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), pItem->GetEntry());
  33.         }
  34.         SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 0, pItem->GetEnchantmentId(PERM_ENCHANTMENT_SLOT));
  35.         SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 1, pItem->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT));
  36.     }
  37.     else
  38.     {
  39.         SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), 0);
  40.         SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 0);
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement