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!
//#####################################//
// 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!