吾爱尚玩资源基地

标题: WOW私服单机[TrinityCore C++]竞技场排队命令 [打印本页]

作者: admin    时间: 2016-4-26 23:35
标题: WOW私服单机[TrinityCore C++]竞技场排队命令
这里是三个GM命令,这些命令的作用就是。让玩家可以在世界任何一个地方进行竞技场排队、、

作为私服。作为单机。都是不错的选择,方便了玩家。也方便了自己、、玩家可以在任何地图加入竞技场,不需要来回传送了!

当然,目前来说十城魔兽世界私服还没用上这些功能。如果喜欢的话,可以试试
三个命令

分别对应进入竞技场的方式,这个不用说,都懂的



#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "MapManager.h"
#include "Chat.h"
#include "Common.h"
#include "Language.h"

class arenaqueue : public CommandScript
{
public:
  arenaqueue() : CommandScript("arenaqueue") { }

  ChatCommand* GetCommands() const
    {
        static ChatCommand arenaCommandTable[] =

        {
            { "2v2",    SEC_PLAYER,        false,    &Handle2v2Command,        "Queue's for 2v2", NULL },
            { "3v3",    SEC_PLAYER,        false,    &Handle3v3Command,        "Queue's for 3v3", NULL },
            { "5v5",    SEC_PLAYER,        false,    &Handle5v5Command,        "Queue's for 5v5", NULL },
            {  NULL,             0,        false,                 NULL,                       "", NULL }
        };

        static ChatCommand commandTable[] =
        {
            { "arena",    SEC_PLAYER,        true,                 NULL,                       "", arenaCommandTable},
            {    NULL,             0,       false,                 NULL,                       "",               NULL }
        };
        return commandTable;

    }

    static bool Handle2v2Command(ChatHandler* handler, const char* args)
        {
        Player* me = handler->GetSession()->GetPlayer();
            if(me->GetArenaTeamId(1) != 0)
                    {
                    me->AddBattlegroundQueueId(BATTLEGROUND_QUEUE_2v2);
                    }
            else
                    {
                    handler->PSendSysMessage("You aren't in an arena team.");
                    }
            return true;
        }

    static bool Handle3v3Command(ChatHandler* handler, const char* args)
        {
        Player* me = handler->GetSession()->GetPlayer();
            if(me->GetArenaTeamId(1) != 1)
                    {
                    me->AddBattlegroundQueueId(BATTLEGROUND_QUEUE_3v3);
                    }
            else
                    {
                    handler->PSendSysMessage("You aren't in an arena team.");
                    }
            return true;
        }

    static bool Handle5v5Command(ChatHandler* handler, const char* args)
        {
        Player* me = handler->GetSession()->GetPlayer();
            if(me->GetArenaTeamId(1) != 2)
                    {
                        me->AddBattlegroundQueueId(BATTLEGROUND_QUEUE_5v5);
                    }
            else
                    {
                    handler->PSendSysMessage("You aren't in an arena team.");
                    }
            return true;
        }

    };

void AddSC_arenaqueue()
{
    new arenaqueue();
}
Arena Queue Commands 竞技场命令代码完整下载



作者: 你懂的    时间: 2016-10-14 08:44
楼主好棒,终于找到需要的了!有需求就来吾爱尚玩!




欢迎光临 吾爱尚玩资源基地 (http://bbs.523play.com/) Powered by Discuz! X3.4