Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 7 of 7

Thread: [C++] Buff Npc

  1. #1
    Senior Sergeant
    MikExV™'s Avatar
    Join Date
    Feb 2010
    Location
    Ohio
    Posts
    117
    Post Thanks / Like
    Rep Power
    17
    Reputation
    35

    [C++] Buff Npc


    Register to remove this ad
    ArcEmu Buff Npc.
    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);
    }
    Enjoy!
    Compile
    Code:
    1>------ Build started: Project: ExtraScripts, Configuration: Release Win32 ------
    1>Compiling...
    1>Buff Npc.cpp
    1>Linking...
    1>   Creating library ..\..\..\bin\release\script_bin/ExtraScripts.lib and object ..\..\..\bin\release\script_bin/ExtraScripts.exp
    1>Embedding manifest...
    1>Build log was saved at "file://c:\WoWServer\High Rate Core\src\scripts\projects\2003_int_release\BuildLog.htm"
    1>ExtraScripts - 0 error(s), 0 warning(s)
    ========== Build: 1 succeeded, 0 failed, 5 up-to-date, 0 skipped ==========





    › See More: [C++] Buff Npc
    Last edited by MikExV™; 21-05-10 at 03:20 PM.

    Just got my pc back



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

  3. #2
    Contributor
    Cocain's Avatar
    Join Date
    Mar 2010
    Posts
    208
    Post Thanks / Like
    Rep Power
    17
    Reputation
    92
    Simple, yet effecient.


    Good job.

  4. #3
    Senior Sergeant
    MikExV™'s Avatar
    Join Date
    Feb 2010
    Location
    Ohio
    Posts
    117
    Post Thanks / Like
    Rep Power
    17
    Reputation
    35
    Thank you! one of my first C++ Scripts.

    Just got my pc back

  5. #4
    Senior Sergeant
    Milation's Avatar
    Join Date
    Aug 2008
    Posts
    109
    Post Thanks / Like
    Rep Power
    18
    Reputation
    73
    Cool

  6. #5
    Senior Sergeant
    MikExV™'s Avatar
    Join Date
    Feb 2010
    Location
    Ohio
    Posts
    117
    Post Thanks / Like
    Rep Power
    17
    Reputation
    35
    Why thank you Milation

    Just got my pc back

  7. #6
    Beginner

    Join Date
    Aug 2010
    Posts
    5
    Post Thanks / Like
    Rep Power
    16
    Reputation
    1
    Were to i put c++? don't get with c++ plz tell me.. i only know about Lua

    Nice Idea and good scripted

  8. #7
    Elite Member
    Dimman's Avatar
    Join Date
    Apr 2009
    Posts
    1,091
    Post Thanks / Like
    Rep Power
    22
    Reputation
    319

    Register to remove this ad
    Quote Originally Posted by mariobox View Post
    Were to i put c++? don't get with c++ plz tell me.. i only know about Lua

    Nice Idea and good scripted
    You will have to apply it to the core & re-compile it. (You cant recompile a repack without the orginal source)
    No touching please.

 

 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 04:50 AM.
Powered by vBulletin® Copyright ©2000-2026, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2026 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org