Olá tente usar esse script :
--[[
Tag:
<action actionid="xxx" event="script" value="Outland-waves.lua"/>
Não se esqueça de alterar o actionid.
]]--
function checkMonsters(area1, area2, pos, aid)
local monstros = getMonstersInArea(area1, area2)
if #monstros < 1 then
local a = doCreateItem(1945, 1, pos)
doItemSetAttribute(a, "aid", aid)
doSendMagicEffect(pos, 14)
addEvent(function()
local player = getPlayersInArea(area1, area2)
local alavanca = getTileItemById(pos, 1945).uid
local poss = {x = 2349, y = 2564, z = 6} --Para onde os jogadores serão teleportados, se não clicarem na alavanca.
for i = 1, #player do
if not isCreature(player[i]) then return true end
if alavanca > 0 then
doTeleportThing(player[i], poss)
doPlayerSendTextMessage(player[i], 27, "You lost in the Outland Main Quest.")
doRemoveItem(alavanca, 1)
end
end
end, 10*1000)
return true
end
return addEvent(checkMonsters, 1000, area1, area2, pos, aid)
end
function getMonstersInArea(area1, area2)
local monsters = {}
for x = area1.x, area2.x do
for y = area1.y, area2.y do
for z = area1.z, area2.z do
monsterpos = {x=x,y=y,z=z,stackpos=253}
monster = getThingFromPos(monsterpos)
if ehMonstro(monster.uid) then
table.insert(monsters, monster.uid)
end
end
end
end
return monsters
end
function getPlayersInArea(area1, area2)
local players = {}
for x = area1.x, area2.x do
for y = area1.y, area2.y do
for z = area1.z, area2.z do
monsterpos = {x=x,y=y,z=z,stackpos=253}
monster = getThingFromPos(monsterpos)
if isPlayer(monster.uid) then
table.insert(monsters, monster.uid)
end
end
end
end
return players
end
local function getRecorderPlayer(pos, cid)
local ret = 0
if cid and isPosEqual(getThingPos(cid), pos) then
return cid
end
local s = {}
s.x = pos.x
s.y = pos.y
s.z = pos.z
for a = 0, 255 do
s.stackpos = a
local b = getTileThingByPos(s).uid
if b > 1 and isPlayer(b) and getCreatureOutfit(b).lookType ~= 814 then
ret = b
end
end
return ret
end
------------[[ Configurações. ]]------------
local cfg = {
{1, {x = 2349, y = 2480, z = 14}, {x = 2438, y = 2496, z = 15}}, --{valor da storage do clan, posição que o jogador deve ficar, posição para qual o mesmo será teleportado},
{2, {x = 2345, y = 2477, z = 14}, {x = 2434, y = 2493, z = 15}},
{3, {x = 2353, y = 2477, z = 14}, {x = 2442, y = 2493, z = 15}},
{4, {x = 2346, y = 2480, z = 14}, {x = 2435, y = 2496, z = 15}},
{5, {x = 2352, y = 2474, z = 14}, {x = 2441, y = 2490, z = 15}},
{6, {x = 2346, y = 2474, z = 14}, {x = 2435, y = 2490, z = 15}},
{7, {x = 2352, y = 2480, z = 14}, {x = 2441, y = 2496, z = 15}},
{8, {x = 2349, y = 2474, z = 14}, {x = 2438, y = 2490, z = 15}},
}
local rank = {
need = true, --Precisará estar em x rank? [true/sim] [false/não]
what_rank = 5, --Se colocar true acima, configure aqui o rank necessário.
}
local min_lv = 200 --Level mínimo.
-----------[[ Fim das configurações. ]]---------
function onUse(cid, item, frompos, item2, topos)
for a, b in pairs(cfg) do
local pos = getRecorderPlayer(b[2])
if not isPlayer(pos) then
return doPlayerSendCancel(cid, "One or more players aren't in the correct clan's place.")
elseif rank.need == true then
if getPlayerStorageValue(pos, 862281) <= (rank.what_rank - 1) then
return doPlayerSendCancel(cid, "One or more players aren't at rank "..rank.what_rank..".")
end
elseif getPlayerLevel(pos) < min_lv then
return doPlayerSendCancel(cid, "Sorry, one or more players aren't level "..min_lv..".")
end
end
for c, d in pairs(cfg) do
local pos = getRecorderPlayer(d[2])
doTeleportThing(pos, d[3])
doPlayerSendTextMessage(pos, 27, "Good luck!")
doSendMagicEffect(getThingPos(pos), 14)
addEvent(function()
local monsters = {{"Elder Jynx", {x = 2437, y = 2493, z = 15}}, {"Elder Marowak", {x = 2441, y = 2487, z = 15}}}
local posi = {x = 2449, y = 2488, z = 15} --Coordenadas da posição superior esquerda da área.
local posis = {x = 2428, y = 2498, z = 15} --Coordenadas da posição inferior direita da área.
local pos = {x = 2438, y = 2492, z = 15} --Onde a alavanca será criada.
for i = 1, #monsters do
doCreateMonster(monsters[i][1], monsters[i][2])
end
end, 5*1000)
addEvent(function()
local posi = {x = 2428, y = 2488, z = 15} --Coordenadas da posição superior esquerda da área.
local posis = {x = 2449, y = 2498, z = 15} --Coordenadas da posição inferior direita da área.
local pos = {x = 2438, y = 2492, z = 15} --Onde a alavanca será criada.
checkMonsters(posi, posis, pos, 19381)
end, 5500)
end
return true
end
aguardo respostar =D







info
Grupo: Campones
Registrado: 28/07/12
Posts: 43
Reputação: +29
Eu quero coloca RANK 5 pra outland e level 150+ , como faz? :s
Aqui está :