Advertisement
julienanid

[Trinity] Faction Change token

Aug 24th, 2013
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.29 KB | None | 0 0
  1.     /*
  2.     <--------------------------------------------------------------------------->
  3.      - Developer(s): Ghostcrawler336
  4.      - Edited by: Lea
  5.      - Complete: %100
  6.      - ScriptName: 'Faction Change Token'
  7.      - Comment: Tested.
  8.     <--------------------------------------------------------------------------->
  9.     */
  10.      
  11.     #include "ScriptMgr.h"
  12.     #include "ScriptedCreature.h"
  13.     #include "Spell.h"
  14.      
  15.     #define item_id 100003
  16.      
  17.     class item_faction : public ItemScript
  18.     {
  19.     public:
  20.         item_faction() : ItemScript("item_faction") { }
  21.      
  22.         bool OnUse(Player* player, Item* item, const SpellCastTargets &)
  23.         {
  24.                     if (player->IsInCombat())
  25.                     {      
  26.                             player->GetSession()->SendNotification("You can't use this item in combat!");
  27.                             return false;
  28.                     }
  29.                     player->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
  30.                     player->GetSession()->SendNotification("You need to relog,to change your faction !");
  31.                     player->DestroyItemCount(item_id, 1, true, false);
  32.                     return true;
  33.             }
  34.     };
  35.      
  36.     void AddSC_item_faction()
  37.     {
  38.         new item_faction();
  39.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement