/script
local p = GetClientPlayer()
if p.IsInParty() and p.dwID == GetClientTeam().GetAuthorityInfo(TEAM_AUTHORITY_TYPE.MARK) then
local NearList = GetAllNpc()
local NpcList = {}
for i, v in pairs(NearList) do
if v.szName == "尸罐" then
table.insert(NpcList, {id = v.dwID, nMaxLife = v.nMaxLife})
end
end
if #NpcList<3 then
OutputMessage("MSG_ANNOUNCE_RED", "没有发现尸罐或数量低于3个\n",false,19)
else
table.sort(NpcList, function(a,b) return a.nMaxLife > b.nMaxLife end)
for i, v in pairs(NpcList) do
if i > 3 then break end
GetClientTeam().SetTeamMark(i, v.id)
end
OutputMessage("MSG_ANNOUNCE_RED", "已分别将3个真尸罐标记为云、剑、斧头\n",false,19,{255,255,255})
end
else
OutputMessage("MSG_ANNOUNCE_RED", "请先组队并取得标记权\n",false,19)
end