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
  1. #1
    Sergeant
    Dr. Fallen's Avatar
    Join Date
    Mar 2010
    Location
    Turkey
    Posts
    74
    Post Thanks / Like
    Rep Power
    15
    Reputation
    64

    [C++] Disconnection


    Register to remove this ad
    Hello MMOPro

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


    DisconnectNPC.cpp
    PHP Code:
    #include "StdAfx.h"
    #include "Setup.h"
     
    #ifdef WIN32
    #pragma warning(disable:4305)
    #endif
     
     
    class SCRIPT_DECL Disconnect : public GossipScript
    {
    public:
        
    void GossipHello(Object pObjectPlayerPlrbool AutoSend);
        
    void GossipSelectOption(Object pObjectPlayerPlruint32 Id,  uint32 IntId, const char Code);
        
    void GossipEnd(Object pObjectPlayerPlr);
            
    void Destroy()
            {
                    
    delete this;
            }
    };
    void Disconnect::GossipHello(Object pObjectPlayerPlrbool  AutoSend)
        {
            
    GossipMenu *Menu;
            
    objmgr.CreateGossipMenuForPlayer(&Menu,  pObject->GetGUID(), 1Plr);
                    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 pObjectPlayerPlr,  uint32 Iduint32 IntId, const char Code)
        {
            
    Creature pCreature =  (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
            if(
    pCreature==NULL)
                    return;
     
            
    GossipMenu Menu;
            switch(
    IntId)
            {
            case 
    0:
                    
    GossipHello(pObjectPlrtrue);
            break;
                            
            case 
    1:   
                    {
                    
    objmgr.CreateGossipMenuForPlayer(&Menu,  pObject->GetGUID(), 1Plr);
                    
    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 pObjectPlayerPlr)
    {
        
    GossipScript::GossipEnd(pObjectPlr);
    }
    void SetupDisconnect(ScriptMgr mgr)
    {
            
    GossipScript gs = (GossipScript*) new Disconnect();
        
    mgr->register_gossip_script("NPCID"gs);

    Credits: QQrofl


    › See More: [C++] Disconnection

  2. #2
    Elite Member
    Dimman's Avatar
    Join Date
    Apr 2009
    Posts
    1,091
    Post Thanks / Like
    Rep Power
    21
    Reputation
    319
    Thanks for sharing, and good job QQ
    No touching please.

  3. #3
    Sergeant
    Dr. Fallen's Avatar
    Join Date
    Mar 2010
    Location
    Turkey
    Posts
    74
    Post Thanks / Like
    Rep Power
    15
    Reputation
    64
    thanks

  4. #4
    Contributor
    StickyIcky's Avatar
    Join Date
    Jul 2008
    Location
    127.0.0.1
    Posts
    747
    Post Thanks / Like
    Rep Power
    19
    Reputation
    188
    Why would you make an item for instant log out?

    Why not make it a chat string?

    Like .logout or #logout or @logout or something....

    It'd be alot easier.


    But nice script, .

  5. #5
    Contributor
    Cocain's Avatar
    Join Date
    Mar 2010
    Posts
    208
    Post Thanks / Like
    Rep Power
    16
    Reputation
    92
    Decently on using, but you can also use the progressed function of SoftDisconnect();

  6. #6
    Grunt

    Join Date
    Feb 2010
    Posts
    42
    Post Thanks / Like
    Rep Power
    16
    Reputation
    98
    very nice

  7. #7
    Beginner

    Join Date
    May 2010
    Posts
    36
    Post Thanks / Like
    Rep Power
    15
    Reputation
    4

    Register to remove this ad
    Bump!




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

 

 

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!
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 06:03 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