0

如果 BattleGround 被联盟赢得,联盟中的所有玩家(在 BG 上)都将获得一件305047物品。如果一个部落赢得了战场,部落中的所有玩家(在 BG 上)都会收到一件305048物品。

这些是奖励箱的物品。你能告诉我怎么做吗?

也许可以使用Eluna在 LUA 中完成?

if (player->GetTeamId(TEAM_HORDE))
    player->AddItem(305047, 1);
else
    player->AddItem(305048, 1);

upd2:此代码有效但不正确。它到处颁发奖项。在竞技场和BG。我需要仅在 BG 上授予该奖项。

4

3 回答 3

3
if (!isArena()) {
  if (bgTeamId == winnerTeamId) {
    if (TEAM_ALLIANCE == winnerTeamId) {
      player->AddItem(XXXXX, 1); // Here add Item for Alliance players to get on BG End
    } else {
      if (TEAM_HORDE == winnerTeamId) {
        player->AddItem(XXXXX, 1); // Here add Item For Horde players to get on BG end
      }
    }
  }

然后就用那个

于 2019-08-18T14:52:40.963 回答
2
local H2Item = ;
local A2Item = ;

local function onBattlegroundEnd(event, bg, bgId, instanceId, winner)
    for k, player in ipair(GetPlayersInWorld()) do
        if player:GetInstanceId() == instanceId then
            if winner == 1 and player:IsHorde() == 1 then
                player:AddItem(H2Item)
            elseif winner == 0 and player:IsHorde() == 0 then
                player:AddItem(A2Item)
            end
        end
    end
end
RegisterBGEvent(2, onBattlegroundEnd)

这可以吗?

于 2019-08-14T09:48:57.133 回答
0

您可以使用 C++ 执行此操作,编辑现有文件 Battleground.cpp 并在第 985 行使用:

if (bgTeamId == winnerTeamId)
    {
        if (TEAM_ALLIANCE == winnerTeamId)
            player->AddItem(XXXXX, 1); // Here add Item for Alliance players to get on BG End
        else
            if (TEAM_HORDE == winnerTeamId)
            {
                player->AddItem(XXXXX, 1); // Here add Item For Horde players to get on BG end
            }
于 2019-08-16T21:41:00.953 回答