Code:
/*Made by Performer of MMOwned and HypnoticWoW (www.hypnotic-wow.net)
give proper credits when re-releasing this script.
Performer, 30th September 2008*/
#include "StdAfx.h"
#include "Setup.h"
#define STONEID 1200001
class SCRIPT_DECL LevelHelper : 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 LevelHelper::GossipHello(Object* pObject, Player * Plr, bool AutoSend)
{
if(Plr->CombatStatus.IsInCombat())
{
Plr->BroadcastMessage("You are in combat!");
return; //stops the rest of the script from executing
}
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
if(Plr->GetTeam() == 0)
{
Menu->AddItem(0, "Take me To Leveling Zone", 40);
Menu->AddItem(0, "Take Me To Alliance Mall", 85); //alliance
Menu->AddItem(0, "Remove Rez Sickness", 80);
Menu->SendTo(Plr);
}
else
{
Menu->AddItem(0, "Take Me To Leveling Zone", 50);
Menu->AddItem(0, "Take Me To Horde Mall", 86); //horde
Menu->AddItem(0, "Remove Rez Sickness", 80);
Menu->SendTo(Plr);
}
if(AutoSend)
Menu->SendTo(Plr);
}
void LevelHelper::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
GossipMenu * Menu;
switch(IntId)
{
case 80: //Remove Rez Sickness
{
Plr->addSpell(15007);
Plr->removeSpell(15007,0,0,0);
}break;
case 85: //Alliance Mall
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}break;
case 86: //Horde Mall
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}break;
case 40: //Alliance Level Locations
{
if(Plr->getLevel() >= 1 && Plr->getLevel() <= 9)
{
Plr->EventTeleport(mapid, x, y, z)
}
else
if(Plr->getLevel() >= 10 && Plr->getLevel() <= 13)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 14 && Plr->getLevel() <= 17)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 18 && Plr->getLevel() <= 21)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 22 && Plr->getLevel() <= 25)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 26 && Plr->getLevel() <= 29)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 30 && Plr->getLevel() <= 33)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 34 && Plr->getLevel() <= 37)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 38 && Plr->getLevel() <= 41)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 42 && Plr->getLevel() <= 45)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 46 && Plr->getLevel() <= 49)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 50 && Plr->getLevel() <= 53)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 54 && Plr->getLevel() <= 57)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 58 && Plr->getLevel() <= 61)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 62 && Plr->getLevel() <= 64)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 65 && Plr->getLevel() <= 66)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 67 && Plr->getLevel() <= 68)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 69 && Plr->getLevel() <= 69)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() == 70)
{
Plr->BroadcastMessage("You are Level 70. You no longer need this stone");
}
}break;
case 50: //Horde Level Locations
{
if(Plr->getLevel() >= 1 && Plr->getLevel() <= 9)
{
Plr->EventTeleport(mapid, x, y, z)
}
else
if(Plr->getLevel() >= 10 && Plr->getLevel() <= 13)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 14 && Plr->getLevel() <= 17)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 18 && Plr->getLevel() <= 21)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 22 && Plr->getLevel() <= 25)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 26 && Plr->getLevel() <= 29)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 30 && Plr->getLevel() <= 33)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 34 && Plr->getLevel() <= 37)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 38 && Plr->getLevel() <= 41)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 42 && Plr->getLevel() <= 45)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 46 && Plr->getLevel() <= 49)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 50 && Plr->getLevel() <= 53)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 54 && Plr->getLevel() <= 57)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 58 && Plr->getLevel() <= 61)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 62 && Plr->getLevel() <= 64)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 65 && Plr->getLevel() <= 66)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 67 && Plr->getLevel() <= 68)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() >= 69 && Plr->getLevel() <= 69)
{
Plr->EventTeleport(mapid, x, y, z);
Plr->Gossip_Complete();
}
else
if(Plr->getLevel() == 70)
{
Plr->BroadcastMessage("You are Level 70. You no longer need this stone");
}
}break;
}
Plr->Gossip_Complete();
}
void LevelHelper::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}
void SetupLevelHelper(ScriptMgr * mgr)
{
GossipScript * gs = (GossipScript*) new LevelHelper();
mgr->register_item_gossip_script(STONEID, gs);
sLog.outColor(TBLUE, "Level Helper made by Performer of MMOwned (www.hypnotic-wow.com)");
sLog.outColor(TNORMAL, "n");
}
Thanks