[C++] Disconnection menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Trle94's Avatar Contributor
    Reputation
    167
    Join Date
    May 2009
    Posts
    329
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [C++] Disconnection

    Hello MMOwned

    This is an C++ script that alows you to instant disconnect from game.
    Save it as NAMEOFSCRIPT.cpp
    And rebuild your core


    Tutorial how to compile script: Tutorial: Compiling Custom Script

    DisconnectNPC.cpp
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
     
    #ifdef WIN32
    #pragma warning(disable:4305)
    #endif
     
     
    class SCRIPT_DECL Disconnect : 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 Disconnect::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
        {
            GossipMenu *Menu;
            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                    if(Plr->getLevel() < 25)
                    {
                            Menu->AddItem(2, "You must be a level 25!");
                    }
                    else{
                    if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
                    {Menu->AddItem(0, "|cffff0000 -=Logout!=- ", 1);}else{Menu->AddItem(1, "|cFF0000FF -=Logout!=- ", 1);}                        
                    
    
                    }
                    if(AutoSend)
                Menu->SendTo(Plr);
        }
     
    void Disconnect::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(7, "|cffff0000!-=Instant logout instead of waiting 30 seconds!=-|r", 0);
                    Menu->AddItem(5, "-=Disconnect Me Now!=-", 2);
    
     
                    Menu->SendTo(Plr);
                                    }
                    break;
     
            case 2: 
                {
                    Plr->GetGUID();
                    Plr->SaveToDB(1);    
                    Plr->SoftDisconnect();   
                }
                            break;
            }
    };
    
    void Disconnect::GossipEnd(Object * pObject, Player* Plr)
    {
        GossipScript::GossipEnd(pObject, Plr);
    }
    void SetupDisconnect(ScriptMgr * mgr)
    {
            GossipScript * gs = (GossipScript*) new Disconnect();
        mgr->register_gossip_script("NPCID", gs);
    }
    Credits: QQrofl
    Last edited by stoneharry; 01-28-2010 at 11:51 AM.


    [C++] Disconnection
  2. #2
    Warriar's Avatar Active Member
    Reputation
    31
    Join Date
    May 2009
    Posts
    149
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Heyhey, you know how to give credits ;o

  3. #3
    LilleCarl's Avatar Active Member
    Reputation
    65
    Join Date
    Feb 2008
    Posts
    132
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    good job ;D simple but goodie ;D 4/5 toasters
    Violence doesn't solve shit, but everything else.

  4. #4
    Algorithm's Avatar Member
    Reputation
    175
    Join Date
    Mar 2008
    Posts
    395
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On large servers this would create major problems.

    even "authentication failures" will start popping up.

  5. #5
    Warriar's Avatar Active Member
    Reputation
    31
    Join Date
    May 2009
    Posts
    149
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's good for combat bugs

  6. #6
    Hellgawd's Avatar Member
    Reputation
    710
    Join Date
    Jun 2007
    Posts
    2,480
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not so sure what the usefulness of this actually is, plus Algorithm pointed out a valid point. If someone needs to urgently logout... there's ALT-F4

  7. #7
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Algorithm, no...lol, btw don't select request guids Plr->GetGUID(), how the hell does disconnect make a problem?? Really?

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

Similar Threads

  1. CE speed hack disconnect
    By renegade121 in forum World of Warcraft General
    Replies: 10
    Last Post: 06-03-2007, 03:08 AM
  2. Replies: 15
    Last Post: 01-01-2007, 07:38 PM
  3. Disconnection Question
    By BlueHazard in forum Community Chat
    Replies: 2
    Last Post: 10-13-2006, 11:19 PM
  4. [Program] Re-login on Disconnect
    By Cypher in forum World of Warcraft Bots and Programs
    Replies: 4
    Last Post: 05-14-2006, 01:01 AM
  5. AQ40 Disconnect lazy players
    By Matt in forum World of Warcraft Exploits
    Replies: 0
    Last Post: 05-02-2006, 01:13 PM
All times are GMT -5. The time now is 06:26 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search