• Страница 1 из 1
  • 1
Модератор форума: Dimitro  
[C++]NPC buff
[dezer]
Маршал
Собственно сам скрипт баффера
Code

#include "StdAfx.h"
#include "Setup.h"

#ifdef WIN32
#pragma warning(disable:4305)
#endif

#define NPCID 400035 //Put your NPC ID here and enjoy!!!

class SCRIPT_DECL GlobalNPC : public GossipScript
{
public:
     void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
     void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
     void GossipEnd(Object * pObject, Player* Plr);
     void Destroy()
     {
         delete this;
     }
};
void GlobalNPC::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
     {
             GossipMenu *Menu;
             objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
             if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
             {Menu->AddItem(6, "|CFF8B0000Buffs", 1);}else{Menu->AddItem(6, "|CFF191970Buffs", 1);}
             if(AutoSend)
             Menu->SendTo(Plr);
     }

void GlobalNPC::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
     {
     Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
     if(pCreature==NULL)
         return;

         GossipMenu * Menu;
         switch(IntId)
         {
         case 0:
         GossipHello(pObject, Plr, true);
         break;

         case 1:
             {
                 objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                 Menu->AddItem(6, "Blessing Of Kings", 333331);
                 Menu->AddItem(6, "Blessing Of Might", 333332);
                 Menu->AddItem(6, "Blessing Of Wisdom", 333333);
                 Menu->AddItem(6, "Power Word: Shield", 333334);
                 Menu->AddItem(6, "Shadow Protection", 333335);
                 Menu->AddItem(6, "Prayer of Fortitude", 333336);
                 Menu->AddItem(6, "Inner Fire", 333337);
                 Menu->AddItem(6, "Horn of Winter", 333338);
                 Menu->AddItem(6, "Frost Presence", 333339);
                 Menu->AddItem(6, "Unholy Presence", 333340);
                 Menu->AddItem(6, "Blood Presence", 3333341);
                 Menu->AddItem(6, "Aspect of the Cheetah", 3333342);
                 Menu->AddItem(6, "Aspect of the Beast", 333343);
                 Menu->AddItem(6, "Tureshot Aura", 333344);
                 Menu->AddItem(6, "Fel Armor", 333345);
                 Menu->AddItem(6, "Windfury Weapon", 333346);
                 Menu->AddItem(6, "Lightning Shield", 333347);
                 Menu->SendTo(Plr);
             }
             break;
          
         case 333331:
             {
                 Plr->CastSpell(Plr, 56525, 0);
             }
             break;

         case 333332:
             {
                 Plr->CastSpell(Plr, 48932, 0);
             }
             break;

         case 333333:
             {
                 Plr->CastSpell(Plr, 48932, 0);
             }
             break;

         case 333334:
             {
                 Plr->CastSpell(Plr, 48066, 0);
             }
             break;

         case 333335:
             {
                 Plr->CastSpell(Plr, 48169, 0);
             }
             break;

         case 333336:
             {
                 Plr->CastSpell(Plr, 48162, 0);
             }
             break;

         case 333337:
             {
                 Plr->CastSpell(Plr, 48168, 0);
             }
             break;

         case 333338:
             {
                 Plr->CastSpell(Plr, 57623, 0);
             }
             break;

         case 333339:
             {
                 Plr->CastSpell(Plr, 48263, 0);
             }
             break;

         case 333340:
             {
                 Plr->CastSpell(Plr, 48263, 0);
             }
             break;

         case 333341:
             {
                 Plr->CastSpell(Plr, 48266, 0);
             }
             break;

         case 333342:
             {
                 Plr->CastSpell(Plr, 5118, 0);
             }
             break;

         case 333343:
             {
                 Plr->CastSpell(Plr, 13161, 0);
             }
             break;

         case 333344:
             {
                 Plr->CastSpell(Plr, 19506, 0);
             }
             break;

         case 333345:
             {
                 Plr->CastSpell(Plr, 47893, 0);
             }
             break;

         case 333346:
             {
                 Plr->CastSpell(Plr, 58804, 0);
             }
             break;

         case 333347:
             {
                 Plr->CastSpell(Plr, 49281, 0);
             }
             break;
}
}

void GlobalNPC::GossipEnd(Object * pObject, Player* Plr)
{
     GossipScript::GossipEnd(pObject, Plr);
}

void SetupGlobalNPC(ScriptMgr * mgr)
{
     GossipScript * gs = (GossipScript*) new GlobalNPC();
     mgr->register_gossip_script(NPCID, gs);
}

Автор не я.Взято с англоязычного форума
Сообщение # 1 написано 25.09.2010 в 23:30
GiNeX
╚►Gm WoWFuN.ru◄╗
Что бафает?при каких условиях?кого бафает?
Помогаю ставить сервера Trinity, Mangos,ArcEmu.
Сообщение # 2 написано 26.09.2010 в 09:07
  • Страница 1 из 1
  • 1
Поиск: