Advertisement
randy336

[Trinity] VIP token

Dec 25th, 2013
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.63 KB | None | 0 0
  1. /* Sql For Item Below
  2. INSERT INTO `item_template` VALUES (100003, 0, 0, 0, 'Donor Status Token', 50216, 6, 0, 0, 1, 0, 0, 0, -1, -1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1000, 0, 0, 18282, 0, 0, 0, 8000, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, '|cff00FF00Use: Activates donor status on your account.|r', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 'Vip_Activate', 0, 0, 0, 0, 0, -4);
  3. */
  4.  
  5. #include "ScriptMgr.h"
  6.  
  7. #define itemid = 100003
  8.  
  9. class Vip_Activate : public ItemScript
  10. {
  11.         public: Vip_Activate() : ItemScript("Vip_Activate") { }
  12.        
  13.         bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/)
  14.         {
  15.                 if(player->GetSession()->GetSecurity() >= 2) // Checks if you are gm lvl 1 or above if you are it will return false.
  16.                 {
  17.                         player->GetSession()->SendNotification("You are already a donor and can not use this item on your account.");
  18.                         return false;
  19.                 }
  20.                 else
  21.                 {
  22.                  LoginDatabase.PExecute("UPDATE account_access SET gmlevel = 2 WHERE id = %u",player->GetSession()->GetAccountId());
  23.                 player->DestroyItemCount(itemid, 1, true, false); // Token ID, Count.
  24.                 player->GetSession()->SendNotification("You are now a donor! Relog To Take Effect.");
  25.                 return true;
  26.         }
  27.     }
  28. };
  29.  
  30. void AddSC_Vip_Activate()
  31. {
  32.         new Vip_Activate();
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement