PDA

View Full Version : [Release] LevelNpc C++


Plexx
04-30-2009, 04:12 AM
OK I am brand new in scripting C++ in arcemu so go easy on me and tell me what you think!

//#####################################//
// WOOT! //
// Made By: Plexx //
// Of Plexx Productions //
// //
//#####################################//


#include "StdAfx.h"
#include "Setup.h"

#ifdef WIN32
#pragma warning(disable:4305)// warning C4305: 'argument' : truncation from 'double' to 'float'
#endif


class SCRIPT_DECL LevelNpc : public GossipScript
{
public:
void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
void GossipEnd(Object * pObject, Player* Plr);
void Destroy()
{
delete this;
}
};

void LevelNpc::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
{
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);

if (Plr->getLevel() < 80)
{
LevelInfo * Info = objmgr.GetLevelInfo (Plr->getRace(), Plr->getClass(), 80);
Plr->ApplyLevelInfo(Info, 80);
Menu->AddItem(2, "Your Level is now set to level 80.");
Menu->AddItem(2, "Thank you for playing our server!");
}
else
{
Menu->AddItem(2, "You are already level 80!");
Plr->BroadcastMessage("You are already level 80!");
}
if(AutoSend)
Menu->SendTo(Plr);
}

void LevelNpc::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}

void SetupLevelNpc(ScriptMgr * mgr)
{
GossipScript * gs = (GossipScript*) new LevelNpc();
mgr->register_gossip_script(55555, gs);
}



What this does is once a player talks to the Npc he/she will instantly become level 80. This script removes the need to make a quest at the spawn point for instant 80 servers, and it also removes the hassle of the player to accept the quest and talk to the Npc again.

Well anyways I thought this was cool.

+rep if you do too!

corpse911
04-30-2009, 10:03 AM
Nice thanx

Alvanaar
05-01-2009, 11:31 AM
Mm... Good work. :)

And it's fairly basic :P.

+rep for the effort!

Drikish
05-04-2009, 09:02 PM
It looks extremely complex to me lol
But of course..I don't know C++ xD
Cool script

~Virus~
05-04-2009, 09:12 PM
+rep bud

Foxx
05-06-2009, 01:43 PM
Thank's wont use but good job.

coldmen
05-06-2009, 03:56 PM
Please compile for download, thanks