Código:
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "MapManager.h"
#include "Common.h"
#include "Language.h"
class vipcommands : public CommandScript
{
public:
vipcommands() : CommandScript("vipcommands") { }
ChatCommand* GetCommands() const
{
static ChatCommand vipCommandTable[] =
{
{ "summon", SEC_PLAYER, false, &HandleSummon, "", NULL },
{ "appear", SEC_PLAYER, false, &HandleAppear, "", NULL },
{ "mall", SEC_PLAYER, false, &HandleVipMallCommand, "", NULL },
{ "changerace", SEC_PLAYER, false, &HandleChangeRaceCommand, "", NULL },
{ "changefaction", SEC_PLAYER, false, &HandleChangeFactionCommand, "", NULL },
{ "maxskills", SEC_PLAYER, false, &HandleMaxSkillsCommand, "", NULL },
{ "customize", SEC_PLAYER, false, &HandleCustomizeCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
{
{ "vip", SEC_PLAYER, true, NULL, "", vipCommandTable},
{ NULL, 0, false, NULL, "", NULL }
};
return commandTable;
}
static bool HandleSummon(ChatHandler * handler, const char* args)
{
return true;
}
static bool HandleAppear(ChatHandler * handler, const char* args)
{
return true;
}
static bool HandlevipCommand(ChatHandler* handler, const char* args)
{
Player* me = handler->GetSession()->GetPlayer();
me->Say("vip command?", LANG_UNIVERSAL);
return true;
}
/* The commands */
static bool HandleChangeRaceCommand(ChatHandler* handler, const char* args)
{
Player* me = handler->GetSession()->GetPlayer();
me->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
handler->PSendSysMessage("Relog to change race of your character.");
return true;
}
static bool HandleChangeFactionCommand(ChatHandler* handler, const char* args)
{
Player* me = handler->GetSession()->GetPlayer();
me->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
handler->PSendSysMessage("Relog to change faction of your character.");
return true;
}
static bool HandleMaxSkillsCommand(ChatHandler* handler, const char* args)
{
Player* me = handler->GetSession()->GetPlayer();
me->UpdateSkillsForLevel();
handler->PSendSysMessage("Your weapon skills are now maximized.");
return true;
}
static bool HandleCustomizeCommand(ChatHandler* handler, const char* args)
{
Player* me = handler->GetSession()->GetPlayer();
me->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
handler->PSendSysMessage("Relog to customize your character.");
return true;
}
static bool HandleVipMallCommand(ChatHandler* handler, const char* args)
{
Player* me = handler->GetSession()->GetPlayer();
if (me->isInCombat())
{
handler->SendSysMessage(LANG_YOU_IN_COMBAT);
handler->SetSentErrorMessage(true);
return false;
}
// stop flight if need
if (me->isInFlight())
{
me->GetMotionMaster()->MovementExpired();
me->CleanupAfterTaxiFlight();
}
// stop flight if need
if (me->isInFlight())
{
me->GetMotionMaster()->MovementExpired();
me->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
me->SaveRecallPosition();
me->TeleportTo(571, 6224.2753f, 5757.725098f, -6.372915f, 0.75708f); // MapId, X, Y, Z, O
handler->PSendSysMessage("You Have Been Teleported!");
return true;
}
};
void AddSC_vipcommands()
{
new vipcommands();
}
Código:
#include "ScriptPCH.h"
class VIP_AREA : public PlayerScript
{
public:
VIP_AREA() : PlayerScript("VIP_AREA") { }
void VIPZONE(Player * me, ChatHandler * handler)
{
if(me->GetAreaId() == 10)
switch(me->GetSession()->GetSecurity())
{
case SEC_PLAYER:
{
handler->PSendSysMessage("Welcome to the VIP Zone");
me->TeleportTo(571, 6182.615234f, 5738.993652f, 1.402846f, 5.567000f); // Where you get teleported.
return;
}
case 1:
{
handler->PSendSysMessage("Welcome to the VIP Zone %s!"), me->GetName();
return;
}
default:
{
return;
}
}
}
};
void AddSC_VIP_AREA()
{
new VIP_AREA();
}
Código:
#include "ScriptPCH.h"
class VIP_NPC : public CreatureScript
{
public:
VIP_NPC() : CreatureScript("VIP_NPC") { }
bool OnGossipHello(Player * me, Creature * pCreature)
{
if (me->GetSession()->GetSecurity() >= 1)
{
me->ADD_GOSSIP_ITEM(6, "VIP VENDOR", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_VENDOR);
}
else
{
me->ADD_GOSSIP_ITEM(6, "Bye", GOSSIP_SENDER_MAIN,1);
}
me->PlayerTalkClass->SendGossipMenu(9452, pCreature->GetGUID());
return true;
}
bool OnGossipSelect(Player *player, Creature * m_creature, uint32 sender, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
switch (action)
{
case GOSSIP_OPTION_VENDOR:
player->GetSession()->SendListInventory(m_creature->GetGUID());
break;
case 1:
m_creature->MonsterWhisper("Why are you here? You are not a VIP! - You have been reported to a GM!", player -> GetGUID());
player->TeleportTo(571, 6182.615234f, 5738.993652f, 1.402846f, 5.567000f); // Where you get teleported.
player->CLOSE_GOSSIP_MENU();
break;
}
return true;
}
};
void AddSC_VIP_NPC()
{
new VIP_NPC();
}
como o fórum nao tem muito em lua to postando uns
Última edição por Erictemponi em Seg 27 Jul 2015 - 12:24, editado 1 vez(es) (Motivo da edição : Tag)