Postado Julho 6, 2015 9 anos Pessoal, boa tarde! Estou com a ideia de fazer uma quest parecida com a annihilator, porém, pra 10 pessoas e espalhadas no mapa, e com um requisito, ter 100 gold ingots na backpack. Tenho esse script editado da annihilator normal, mais acho que as posições dos players não vão dar certo, porque na annihi normal só tem 2 posiçoes, de x até y e eu estou tentando espalhar pelo mapa todo as posições! Poderiam avaliar o script? local players_area = { {x = 32794, y = 31246, z = 5}, {x = 33299, y = 32287, z = 12}, {x = 33180, y = 32874, z = 8}, {x = 32317, y = 32168, z = 4}, {x = 32316, y = 31755, z = 1}, {x = 33176, y = 31630, z = 9}, {x = 32683, y = 31683, z = 9}, {x = 32533, y = 31844, z = 5}, {x = 32963, y = 32073, z = 8}, {x = 32590, y = 32747, z = 6} } local new_player_pos = { {x = 33221, y = 31659, z = 13}, {x = 33222, y = 31659, z = 13}, {x = 33220, y = 31659, z = 13}, {x = 33219, y = 31659, z = 13}, {x = 33219, y = 31659, z = 13}, {x = 33219, y = 31659, z = 13}, {x = 33219, y = 31659, z = 13}, {x = 33219, y = 31659, z = 13}, {x = 33219, y = 31659, z = 13}, {x = 33219, y = 31659, z = 13} } local demonPos = { {x = 33219, y = 31657, z = 13}, {x = 33221, y = 31657, z = 13}, {x = 33223, y = 31659, z = 13}, {x = 33224, y = 31659, z = 13}, {x = 33220, y = 31661, z = 13}, {x = 33222, y = 31661, z = 13} } function getPlayerCountInArea(toPos, fromPos) local count = 0 local cid = {} for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do for z = toPos.z, toPos.z do local creature = getTopCreature({x = x, y = y, z = z, stackpos = 255}).uid if(creature > 0) then if(isPlayer(creature)) then table.insert(cid, creature) count = count + 1 if(getPlayerLevel(creature) < 200) then return "All players must be above level 200." end elseif(isMonster(creature)) then return "Players are allowed only." end end end end end if(count < 10) then return "You need 10 players." else for i = 1,4 do Player(cid[5-i]):teleportTo(new_player_pos) Player(cid[5-i]):getPosition():sendMagicEffect(CONST_ME_TELEPORT) end end return true end function SummonDemon(Pos) local count = 0 local cid = {} for x = Pos[1].x, Pos[4].x do for y = Pos[1].y, Pos[6].y do for z = Pos[1].z, Pos[6].z do local creature = getTopCreature({x = x, y = y, z = z, stackpos = 255}).uid if(creature > 0) then if(isPlayer(creature)) then return "A team is already inside the quest room." elseif(isMonster(creature)) then table.insert(cid, creature) count = count + 1 end end end end end for i = 1, #cid do doRemoveCreature(cid) end for i = 1, #Pos do doSummonCreature("Demon", Pos) end return getPlayerCountInArea(players_area[1], players_area[2]) end function onUse(cid, item) if(item.itemid == 1946) then local condition = SummonDemon(demonPos) if(condition ~= true) then doPlayerSendCancel(cid, condition) end else Item(item.uid):transform(1946) end return true end Agradeço! Editado Julho 6, 2015 9 anos por Droox (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.