Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- #include "Chat.h"
- #include "GroupMgr.h"
- #include "Group.h"
- uint32 auras[] = { 48074, 47440, 53307, 132, 48170, 23737, 48470, 43002, 26393, 48162 };
- uint32 ITEM_ID = 100004;
- class Buffer_VIP : public ItemScript
- {
- public:
- Buffer_VIP() : ItemScript("Buffer_VIP") { }
- bool OnUse(Player * player, Item * /*item*/, SpellCastTargets const& /*targets*/)
- {
- if (player->IsInFlight())
- {
- player->GetSession()->SendNotification("You cannot use this in Flight!");
- return true;
- }
- if(player->IsInCombat())
- {
- player->GetSession()->SendNotification("You can't use this buff while in combat!");
- return false;
- }
- if (player->HasStealthAura() || player->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH) || player->isDead())
- {
- player->GetSession()->SendNotification("You cannot use this,you are dead!");
- return true;
- }
- if (Group* playerGroup = player->GetGroup())
- {
- if (playerGroup->isRaidGroup())
- {
- Player* GroupMember;
- const Group::MemberSlotList members = playerGroup->GetMemberSlots();
- for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr)
- {
- GroupMember = (Unit::GetPlayer(*player, itr->guid));
- for(int i = 0; i < 10; i++)
- {
- GroupMember->AddAura(auras[i], GroupMember);
- player->GetSession()->SendNotification("|cffff0000You have been buffed yourself and your group!");
- if(player->HasItemCount(ITEM_ID, 1))
- {
- player->DestroyItemCount(ITEM_ID, 1, true, false);
- }
- return false;
- }
- }
- }
- }
- else
- {
- for(int i = 0; i < 10; i++)
- {
- player->AddAura(auras[i], player);
- player->GetSession()->SendNotification("|cffff0000You have been buffed!");
- if(player->HasItemCount(ITEM_ID, 1))
- {
- player->DestroyItemCount(ITEM_ID, 1, true, false);
- }
- return false;
- }
- }
- }
- };
- void AddSC_Buffer_VIP()
- {
- new Buffer_VIP;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement