From 83474bae4d593d62e57b53d55570d684b8964e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=9A=E7=BE=8E?= <2370337237@qq.com> Date: Wed, 19 Feb 2025 00:59:22 +0800 Subject: [PATCH] =?UTF-8?q?1V1=20=E6=A8=A1=E5=9D=97=E5=9C=A8=E6=96=B0?= =?UTF-8?q?=E7=89=88=E7=9A=84AZ=E4=B8=AD=E9=83=A8=E5=88=86=E6=9C=89?= =?UTF-8?q?=E5=8F=98=E5=8C=96=EF=BC=8C=E6=89=80=E4=BB=A5=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E4=BA=86=E5=AE=98=E6=96=B9=E7=9A=84=E6=A8=A1=E5=9D=97=E9=83=A8?= =?UTF-8?q?=E5=88=86=E4=BB=A3=E7=A0=81=EF=BC=8C=E5=90=8E=E7=BB=AD=E6=88=91?= =?UTF-8?q?=E8=A7=89=E5=BE=97=E5=BA=94=E8=AF=A5=E5=8F=96=E6=B6=88=E5=86=85?= =?UTF-8?q?=E9=83=A81V1=EF=BC=8C=E7=9B=B4=E6=8E=A5=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E5=AE=98=E6=96=B91V1=E6=A8=A1=E5=9D=97=E7=AE=97=E6=B1=82?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/mod-1v1-arena/src/npc_arena1v1.cpp | 37 +++++-------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/modules/mod_GhostScripts/src/mod-1v1-arena/src/npc_arena1v1.cpp b/modules/mod_GhostScripts/src/mod-1v1-arena/src/npc_arena1v1.cpp index dcf395412f..633a376d75 100644 --- a/modules/mod_GhostScripts/src/mod-1v1-arena/src/npc_arena1v1.cpp +++ b/modules/mod_GhostScripts/src/mod-1v1-arena/src/npc_arena1v1.cpp @@ -87,7 +87,7 @@ public: class playerscript_1v1arena : public PlayerScript { public: - playerscript_1v1arena() : PlayerScript("playerscript_1v1arena") { } + playerscript_1v1arena() : PlayerScript("playerscript_1v1arena") {} void OnLogin(Player* pPlayer) override { @@ -95,37 +95,20 @@ public: ChatHandler(pPlayer->GetSession()).SendSysMessage("这个服务器正在运行 |cff4CFF00竞技场1v1 |r 模块。"); } - void GetCustomGetArenaTeamId(const Player* player, uint8 slot, uint32& id) const override - { - if (slot == sConfigMgr->GetOption("Arena1v1.ArenaSlotID", 3)) - { - if (ArenaTeam* at = sArenaTeamMgr->GetArenaTeamByCaptain(player->GetGUID(), ARENA_TEAM_1V1)) - { - id = at->GetId(); - } - } - } - - void GetCustomArenaPersonalRating(const Player* player, uint8 slot, uint32& rating) const override - { - if (slot == sConfigMgr->GetOption("Arena1v1.ArenaSlotID", 3)) - { - if (ArenaTeam* at = sArenaTeamMgr->GetArenaTeamByCaptain(player->GetGUID(), ARENA_TEAM_1V1)) - { - rating = at->GetRating(); - } - } - } - void OnGetMaxPersonalArenaRatingRequirement(const Player* player, uint32 minslot, uint32& maxArenaRating) const override { if (sConfigMgr->GetOption("Arena1v1.VendorRating", false) && minslot < (uint32)sConfigMgr->GetOption("Arena1v1.ArenaSlotID", 3)) - { if (ArenaTeam* at = sArenaTeamMgr->GetArenaTeamByCaptain(player->GetGUID(), ARENA_TEAM_1V1)) - { maxArenaRating = std::max(at->GetRating(), maxArenaRating); - } - } + } + + void OnGetArenaTeamId(Player* player, uint8 slot, uint32& result) override + { + if (!player) + return; + + if (slot == ARENA_SLOT_1V1) + result = player->GetArenaTeamIdFromDB(player->GetGUID(), ARENA_TYPE_1V1); } };