Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- <--------------------------------------------------------------------------->
- - Developer(s): Ghostcrawler336
- - Edited by: Synth
- - Complete: %100
- - ScriptName: 'Faction Change Token'
- - Comment: Tested.
- - Shared for Emudevs !
- <--------------------------------------------------------------------------->
- */
- #include "ScriptMgr.h"
- #include "ScriptedCreature.h"
- #include "Spell.h"
- #define item_id 100003
- class item_faction : public ItemScript
- {
- public:
- item_faction() : ItemScript("item_faction") { }
- bool OnUse(Player* player, Item* item, const SpellCastTargets &)
- {
- if (player->IsInCombat())
- {
- player->GetSession()->SendNotification("You can't use this item in combat!");
- return true;
- }
- if (player->GetBattleground())
- {
- player->GetSession()->SendNotification("You cannot us this in Battleground!");
- return true;
- }
- if (player->IsInFlight())
- {
- player->GetSession()->SendNotification("You cannot use this in Flight!");
- return true;
- }
- if(player->InArena())
- {
- player->GetSession()->SendNotification("You cannot use this in an arena match!");
- return true;
- }
- player->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
- player->GetSession()->SendNotification("You need to relog,to change your faction !");
- player->DestroyItemCount(item_id, 1, true, false);
- return true;
- }
- };
- void AddSC_item_faction()
- {
- new item_faction();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement