如果联盟赢得了战场,联盟中的所有玩家(在BG上(都将获得305047
物品。 如果一个部落赢得了战场,部落中的所有玩家(在BG上(都会获得一个305048
物品。
这些是奖励宝箱的物品。你能告诉我怎么做吗?
也许可以使用 Eluna 在 LUA 中完成?
if (player->GetTeamId(TEAM_HORDE))
player->AddItem(305047, 1);
else
player->AddItem(305048, 1);
upd2:此代码有效,但不正确。它到处颁发奖项。在竞技场和BG。我需要只在BG上颁发奖项。
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
}
}
}
然后就用那个
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)
这个可以吗?
您可以使用C++执行此操作,编辑现有的文件战场.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
}