Likes: 0
Results 1 to 7 of 7
Thread: [C++] Disconnection
-
13-03-10, 08:29 AM #1
[C++] Disconnection
Register to remove this adHello 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 * 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);
}
› See More: [C++] Disconnection
-
13-03-10, 08:45 AM #2
Thanks for sharing, and good job QQ
No touching please.
-
13-03-10, 08:47 AM #3
thanks
-
14-03-10, 12:20 AM #4
-
27-03-10, 06:25 AM #5
Decently on using, but you can also use the progressed function of SoftDisconnect();
-
08-04-10, 02:26 PM #6
-
27-06-10, 02:17 PM #7
Register to remove this adBump!
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