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
Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Grunt

    Join Date
    Jul 2008
    Posts
    36
    Post Thanks / Like
    Rep Power
    17
    Reputation
    30

    Title NPC in C++


    Register to remove this ad
    TITLE NPC IN C++




    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    /************************************ TITLE VENDOR **************************************/
    
    class SCRIPT_DECL Titler : 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 Titler::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
    {
        GossipMenu *Menu;
        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
        Menu->AddItem(2, "Get a title", 0);
        Menu->AddItem(3, "What requirements do I need to meet for a PVP Title ?", 1);
        Menu->SendTo(Plr);
    }
    void Titler::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: //Title
            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    
            for(int x = 1; x < 28; x++)
            {
                if(Plr->HasKnownTitle(x))
                    Plr->RemoveKnownTitle(x);
            }
    
            if (Plr->GetTeam() > 0)
            {
    
                if (Plr->m_killsLifetime < 50)
                {
                    if(!Plr->HasKnownTitle(15))
                        Plr->AddKnownTitle(15);
                    Plr->SetPVPRank(0);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Scout! Please relog for the rank to become visible" );
                }
    
                else if (Plr->m_killsLifetime >= 50 && Plr->m_killsLifetime < 100)
                {
                    if(!Plr->HasKnownTitle(16))
                        Plr->AddKnownTitle(16);
                    Plr->SetPVPRank(6);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Grunt!" );
                }
    
                else if (Plr->m_killsLifetime >= 100 && Plr->m_killsLifetime < 200)
                {
                    if(!Plr->HasKnownTitle(17))
                        Plr->AddKnownTitle(17);
                    Plr->SetPVPRank(7);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Sergeant!" );
    
                }
    
                else if (Plr->m_killsLifetime >= 200 && Plr->m_killsLifetime < 400)
                {
                    if(!Plr->HasKnownTitle(18))
                        Plr->AddKnownTitle(18);
                    Plr->SetPVPRank(8);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Senior Sergeant!" );
                }
    
                else if (Plr->m_killsLifetime >= 400 && Plr->m_killsLifetime < 800)
                {
                    if(!Plr->HasKnownTitle(19))
                        Plr->AddKnownTitle(19);
                    Plr->SetPVPRank(9);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to First Sergeant!" );
                }
    
                else if (Plr->m_killsLifetime >= 1200 && Plr->m_killsLifetime < 2400)
                {
                    if(!Plr->HasKnownTitle(20))
                        Plr->AddKnownTitle(20);
                    Plr->SetPVPRank(10);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Stone Guard!" );
                }
    
                else if (Plr->m_killsLifetime >= 2400 && Plr->m_killsLifetime < 4800)
                {
                    if(!Plr->HasKnownTitle(21))
                        Plr->AddKnownTitle(21);
                    Plr->SetPVPRank(11);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Blood Guard!" );
                }
    
                else if (Plr->m_killsLifetime >= 4800 && Plr->m_killsLifetime < 9000)
                {
                    if(!Plr->HasKnownTitle(22))
                        Plr->AddKnownTitle(22);
                    Plr->SetPVPRank(12);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Legionnaire!" );
                }
    
                else if (Plr->m_killsLifetime >= 9000 && Plr->m_killsLifetime < 13000)
                {
                    if(!Plr->HasKnownTitle(23))
                        Plr->AddKnownTitle(23);
                    Plr->SetPVPRank(13);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Centurion!" );
                }
    
                else if (Plr->m_killsLifetime >= 13000 && Plr->m_killsLifetime < 18000)
                {
                    if(!Plr->HasKnownTitle(24))
                        Plr->AddKnownTitle(24);
                    Plr->SetPVPRank(14);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Champion!" );
                }
    
                else if (Plr->m_killsLifetime >= 18000 && Plr->m_killsLifetime < 20000)
                {
                    if(!Plr->HasKnownTitle(25))
                        Plr->AddKnownTitle(25);
                    Plr->SetPVPRank(15);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Lieutenant General!" );
                }
    
                else if (Plr->m_killsLifetime >= 20000 && Plr->m_killsLifetime < 24000)
                {
                    if(!Plr->HasKnownTitle(26))
                        Plr->AddKnownTitle(26);
                    Plr->SetPVPRank(16);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to General!" );
                }
    
                else if (Plr->m_killsLifetime >= 24000 && Plr->m_killsLifetime < 50000)
                {
                    if(!Plr->HasKnownTitle(27))
                        Plr->AddKnownTitle(27);
                    Plr->SetPVPRank(17);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Warlord!" );
                }
    
                else if (Plr->m_killsLifetime >= 50000)
                {
                    if(!Plr->HasKnownTitle(28))
                        Plr->AddKnownTitle(28);
                    Plr->SetPVPRank(18);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to High Warlord!" );
                }
                Plr->Gossip_Complete();
            }
    
            else
            {
                if (Plr->m_killsLifetime < 50)
                {
                    if(!Plr->HasKnownTitle(1))
                        Plr->AddKnownTitle(1);
                    Plr->SetPVPRank(0);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Private! Please relog for the rank to become visible" );
                }
    
                else if (Plr->m_killsLifetime >= 50 && Plr->m_killsLifetime < 100)
                {
                    if(!Plr->HasKnownTitle(2))
                        Plr->AddKnownTitle(2);
                    Plr->SetPVPRank(6);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Corporal!" );
                }
    
                else if (Plr->m_killsLifetime >= 100 && Plr->m_killsLifetime < 200)
                {
                    if(!Plr->HasKnownTitle(3))
                        Plr->AddKnownTitle(3);
                    Plr->SetPVPRank(7);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Sergeant!" );
                }
    
                else if (Plr->m_killsLifetime >= 200 && Plr->m_killsLifetime < 400)
                {
                    if(!Plr->HasKnownTitle(4))
                        Plr->AddKnownTitle(4);
                    Plr->SetPVPRank(8);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Master Sergeant!" );
                }
    
                else if (Plr->m_killsLifetime >= 400 && Plr->m_killsLifetime < 800)
                {
                    if(!Plr->HasKnownTitle(5))
                        Plr->AddKnownTitle(5);
                    Plr->SetPVPRank(9);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Sergeant Major!" );
                }
    
                else if (Plr->m_killsLifetime >= 1200 && Plr->m_killsLifetime < 2400)
                {
                    if(!Plr->HasKnownTitle(6))
                        Plr->AddKnownTitle(6);
                    Plr->SetPVPRank(10);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Knight!" );
                }
    
                else if (Plr->m_killsLifetime >= 2400 && Plr->m_killsLifetime < 4800)
                {
                    if(!Plr->HasKnownTitle(7))
                        Plr->AddKnownTitle(7);
                    Plr->SetPVPRank(11);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Knight Lieutenant!" );
                }
    
                else if (Plr->m_killsLifetime >= 4800 && Plr->m_killsLifetime < 9000)
                {
                    if(!Plr->HasKnownTitle(8))
                        Plr->AddKnownTitle(8);
                    Plr->SetPVPRank(12);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Knight Captain!" );
                }
    
                else if (Plr->m_killsLifetime >= 9000 && Plr->m_killsLifetime < 13000)
                {
                    if(!Plr->HasKnownTitle(9))
                        Plr->AddKnownTitle(9);
                    Plr->SetPVPRank(13);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Knight Champion!" );
                }
    
                else if (Plr->m_killsLifetime >= 13000 && Plr->m_killsLifetime < 18000)
                {
                    if(!Plr->HasKnownTitle(10))
                        Plr->AddKnownTitle(10);
                    Plr->SetPVPRank(14);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Lieutenant Commander!" );
                }
    
                else if (Plr->m_killsLifetime >= 18000 && Plr->m_killsLifetime < 20000)
                {
                    if(!Plr->HasKnownTitle(11))
                        Plr->AddKnownTitle(11);
                    Plr->SetPVPRank(15);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Commander!" );
                }
    
                else if (Plr->m_killsLifetime >= 20000 && Plr->m_killsLifetime < 24000)
                {
                    if(!Plr->HasKnownTitle(12))
                        Plr->AddKnownTitle(12);
                    Plr->SetPVPRank(16);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Marshal!" );
                }
    
                else if (Plr->m_killsLifetime >= 24000 && Plr->m_killsLifetime < 50000)
                {
                    if(!Plr->HasKnownTitle(13))
                        Plr->AddKnownTitle(13);
                    Plr->SetPVPRank(17);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Field Marshal!" );
                }
    
                else if (Plr->m_killsLifetime >= 50000)
                {
                    if(!Plr->HasKnownTitle(14))
                        Plr->AddKnownTitle(14);
                    Plr->SetPVPRank(18);
                    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Your rank has been set to Grand Marshal!" );
                }
                Plr->Gossip_Complete();
            }
            break;
    
            case 1:
                GossipMenu *Menu;
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                if (Plr->GetTeam() > 0)
                {
                    Menu->AddItem(18, "Scout- 0 Kills", 0);
                    Menu->AddItem(19, "Grunt - 50 Kills", 0);
                    Menu->AddItem(20, "Sergeant - 100 Kills", 0);
                    Menu->AddItem(21, "Senior Sergeant - 200 Kills", 0);
                    Menu->AddItem(22, "First Sergeant - 400 Kills", 0);
                    Menu->AddItem(23, "Stone Guard - 1200 Kills", 0);
                    Menu->AddItem(24, "Blood Guard - 2400 Kills", 0);
                    Menu->AddItem(25, "Legionnaire - 4800 Kills", 0);
                    Menu->AddItem(26, "Centurion - 9000 Kills", 0);
                    Menu->AddItem(32, "Show more ranks", 32);
                }
                else
                {
                    Menu->AddItem(4, "Private - 0 Kills", 0);
                    Menu->AddItem(5, "Corporal - 50 Kills", 0);
                    Menu->AddItem(6, "Sergeant - 100 Kills", 0);
                    Menu->AddItem(7, "Master Sergeant - 200 Kills", 0);
                    Menu->AddItem(8, "Sergeant Major - 400 Kills", 0);
                    Menu->AddItem(9, "Knight - 1200 Kills", 0);
                    Menu->AddItem(10, "Knight Lieutenant - 2400 Kills", 0);
                    Menu->AddItem(11, "Knight Captain - 4800 Kills", 0);
                    Menu->AddItem(12, "Knight Champion - 9000 Kills", 0);
                    Menu->AddItem(33, "Show more ranks", 33);
                }
                Menu->SendTo(Plr);
                break;
    
            case 32:
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                Menu->AddItem(27, "Champion - 13000 Kills", 0);
                Menu->AddItem(28, "Lieutenant General - 18000 Kills", 0);
                Menu->AddItem(29, "General - 20000 Kills", 0);
                Menu->AddItem(30, "Warlord - 24000 Kills", 0);
                Menu->AddItem(31, "High Warlord - 50000 Kills", 0);
                Menu->AddItem(3, "What requirements do I need to meet for a PVP Title ?", 1);
                Menu->SendTo(Plr);
                break;
    
            case 33:
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                Menu->AddItem(13, "Lieutenant Commander - 13000 Kills", 0);
                Menu->AddItem(14, "Commander - 18000 Kills", 0);
                Menu->AddItem(15, "Marshal - 20000 Kills", 0);
                Menu->AddItem(16, "Field Marshal - 24000 Kills", 0);
                Menu->AddItem(17, "Grand Marshal - 50000 Kills", 0);
                Menu->AddItem(3, "What requirements do I need to meet for a PVP Title ?", 1);
                Menu->SendTo(Plr);
                break;
        }
    }
    
    void Titler::GossipEnd(Object * pObject, Player* Plr)
    {
        GossipScript::GossipEnd(pObject, Plr);
    }
    
    void SetupTitler(ScriptMgr * mgr)
    {
    GossipScript * gs = (GossipScript*) new Titler();
        mgr->register_gossip_script(30090, gs);
    }
    SETUP.CPP

    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    #include <ScriptSetup.h>
    
    extern "C" SCRIPT_DECL uint32 _exp_get_script_type()
    {
        return SCRIPT_TYPE_MISC;
    }
    
    extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
    {
        SetupTitler(mgr);
    }
    
    #ifdef WIN32
    
    BOOL APIENTRY DllMain( HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved )
    {
        return TRUE;
    }
    
    #endif
    SETUP.H

    Code:
    #ifndef INSTANCE_SCRIPTS_SETUP_H
    #define INSTANCE_SCRIPTS_SETUP_H
    
    void SetupTitler(ScriptMgr * mgr);
    ;
    
    #endif
    Thanks to Scyther for the Help.

    No pics ATM


    › See More: Title NPC in C++



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

  3. #2
    Contributor
    StickyIcky's Avatar
    Join Date
    Jul 2008
    Location
    127.0.0.1
    Posts
    747
    Post Thanks / Like
    Rep Power
    19
    Reputation
    188
    An NPC?

    Why not just make it so it will automatically update...?

    tho

  4. #3
    Grunt

    Join Date
    Jul 2008
    Posts
    36
    Post Thanks / Like
    Rep Power
    17
    Reputation
    30
    Becuase the more Npcs the leet your server iz

  5. #4
    Contributor
    StickyIcky's Avatar
    Join Date
    Jul 2008
    Location
    127.0.0.1
    Posts
    747
    Post Thanks / Like
    Rep Power
    19
    Reputation
    188
    Lol i'm working on one that will auto update...

    If i can base it off yours...i'll give credits of course

  6. #5
    Grunt

    Join Date
    Jul 2008
    Posts
    36
    Post Thanks / Like
    Rep Power
    17
    Reputation
    30
    and morez +Rep?

  7. #6
    Founder
    Apple's Avatar
    Join Date
    Jul 2008
    Location
    HeaveN
    Posts
    15,916
    Post Thanks / Like
    Rep Power
    10
    Reputation
    295
    lol s00n i am going to update the rules for =P , anyway gj + rep





  8. #7
    Grunt

    Join Date
    Jul 2008
    Posts
    36
    Post Thanks / Like
    Rep Power
    17
    Reputation
    30
    what about them?

    Edit:Can i get emu expert now? lol

  9. #8
    Contributor
    StickyIcky's Avatar
    Join Date
    Jul 2008
    Location
    127.0.0.1
    Posts
    747
    Post Thanks / Like
    Rep Power
    19
    Reputation
    188
    Yea i'll rep again once i can

  10. #9
    Grunt

    Join Date
    Jul 2008
    Posts
    36
    Post Thanks / Like
    Rep Power
    17
    Reputation
    30
    Wig could u unblock me from msn...

  11. #10
    Grunt

    Join Date
    Aug 2008
    Posts
    41
    Post Thanks / Like
    Rep Power
    17
    Reputation
    41

    Register to remove this ad
    This is pretty good, but shouldnt it already give you this one you get X number of kills?
    Edit: cannot give rep.. Need to spread...

 

 
Page 1 of 2 12 LastLast

Visitors found this page by searching for:

trinitycore title npc

trinity title npc

trinity core title npc

npc arena title

trinitycore npc arena rankTitle npc c trinity wowtitle vendor trinitynpc title ( trinity)trinitycore titles vendortitle npc trinitycorenpc with all titles c trinitywow trinity title vendorarena title npc c c Title NPc Trinitycoretitle npc for trinity coretitle vendor trinitycorenpc trinity title vendortitles npc trinitynpc title vendor.cpp
SEO Blog

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 02:55 AM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org