Ir para conteúdo

Featured Replies

Postado

@Zazeros esqueci de excluir a linha, desculpa!!

 

function HaveCreatureArena(area, remove, clean)
	for x = area[1].x - 1, area[2].x + 1 do
		for y = area[1].y - 1, area[2].y + 1 do
			local pos = {x=x, y=y, z=area[1].z}
			local m = getTopCreature(pos).uid
			if remove ~= false and m ~= 0 and isMonster(m) then 
				doRemoveCreature(m) 
			end
			if clean ~= false then 
				doCleanTile(pos,false)
			end
		end
	end
end
local from, to = {x = 1105, y = 1113, z = 7}, {x = 1115, y = 1123, z = 7}
local t = {
	lvl = 100,
	Time = 15, -- em minutos
	entrada =
	{
		{x = 1045, y = 1014, z = 6}, -- pos players
		{x = 1045, y = 1015, z = 6}
	},
	saida =
	{
		{x = 1110, y = 1122, z = 7}, -- pos para onde eles irão
		{x = 1110, y = 1123, z = 7}
	},
	monstros =
	{
		{{x = 1108, y = 1116, z = 7}, "Orc"}, -- defina pos dos montros e nomes
		{{x = 1108, y = 1117, z = 7}, "Orc"},
		{{x = 1108, y = 1118, z = 7}, "Orc"},
		{{x = 1108, y = 1119, z = 7}, "Orc"}
	}
}
function VarAnihiPlayer(cid)
	if not isCreature(cid) then return LUA_ERROR end
	if isInRange(getPlayerPosition(cid), t.saida[1], t.saida[#t.saida]) then
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
	end
end
function getPlayersInArea(fromPos, toPos)
	local players = {}
	for _, pid in ipairs(getPlayersOnline()) do
		if isInRange(getPlayerPosition(pid), fromPos, toPos) then
			table.insert(players, pid)
		end
	end
	return players
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local check = {}
	if #getPlayersInArea(t.saida[1], t.saida[#t.saida]) > 0 then
		doPlayerSendCancel(cid, 'Aguarde, tem jogadores fazendo a quest.') return true
	end
	for _, k in ipairs(t.entrada) do
		local x = getTopCreature(k).uid
		if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.lvl) then
			doPlayerSendCancel(cid, 'Está faltando player ou alguém não possui level '..t.lvl..' ou mais.') return true
		end
		table.insert(check, x)
	end
	HaveCreatureArena({from,to}, true, true)
	for _, summon in pairs(t.monstros) do
		doCreateMonster(summon[2], summon[1])
	end
	for i, tid in ipairs(check) do
		doSendMagicEffect(t.entrada, CONST_ME_POFF)
		doTeleportThing(tid, t.saida, false)
		addEvent(VarAnihiPlayer, t.Time*1000, tid)
		doSendMagicEffect(t.saida, CONST_ME_ENERGYAREA)
	end
	doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
	return true
end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

  • Respostas 11
  • Visualizações 1.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • UP!

  • só agora que vi, erro meu   function HaveCreatureArena(area, remove, clean) for x = area[1].x - 1, area[2].x + 1 do for y = area[1].y - 1, area[2].y + 1 do local pos = {x=x, y=y, z=area

  • Aqui no TibiaKing mensagens como UP e BUMP são proibidas, utilize o botão subir este tópico. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!  

  • 2 weeks later...
  • 3 weeks later...
Postado

Aqui no TibiaKing mensagens como UP e BUMP são proibidas, utilize o botão subir este tópico. Esta é uma mensagem automática!
Pedimos que leia as regras do fórum!

Spoiler

Here in TibiaKing messages like UP and BUMP are prohibited, use the button raise this topic. This is an automated message!
Please read the forum rules.

 

Projeto ATS (Naruto)

Informações Abaixo

Facebook

Youtube
Discord

 

Tutoriais / Conteúdos

Clique Aqui

Postado

só agora que vi, erro meu

 

function HaveCreatureArena(area, remove, clean)
	for x = area[1].x - 1, area[2].x + 1 do
		for y = area[1].y - 1, area[2].y + 1 do
			local pos = {x=x, y=y, z=area[1].z}
			local m = getTopCreature(pos).uid
			if remove ~= false and m ~= 0 and isMonster(m) then 
				doRemoveCreature(m) 
			end
			if clean ~= false then 
				doCleanTile(pos,false)
			end
		end
	end
end
local from, to = {x = 1105, y = 1113, z = 7}, {x = 1115, y = 1123, z = 7}
local t = {
	lvl = 100,
	Time = 15, -- em minutos
	entrada =
	{
		{x = 1045, y = 1014, z = 6}, -- pos players
		{x = 1045, y = 1015, z = 6}
	},
	saida =
	{
		{x = 1110, y = 1122, z = 7}, -- pos para onde eles irão
		{x = 1110, y = 1123, z = 7}
	},
	monstros =
	{
		{{x = 1108, y = 1116, z = 7}, "Orc"}, -- defina pos dos montros e nomes
		{{x = 1108, y = 1117, z = 7}, "Orc"},
		{{x = 1108, y = 1118, z = 7}, "Orc"},
		{{x = 1108, y = 1119, z = 7}, "Orc"}
	}
}
function VarAnihiPlayer(cid)
	if not isCreature(cid) then return LUA_ERROR end
	if isInRange(getPlayerPosition(cid), from, to) then
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
	end
end
function getPlayersInArea(fromPos, toPos)
	local players = {}
	for _, pid in ipairs(getPlayersOnline()) do
		if isInRange(getPlayerPosition(pid), fromPos, toPos) then
			table.insert(players, pid)
		end
	end
	return players
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local check = {}
	if #getPlayersInArea(from, to) > 0 then
		doPlayerSendCancel(cid, 'Aguarde, tem jogadores fazendo a quest.') return true
	end
	for _, k in ipairs(t.entrada) do
		local x = getTopCreature(k).uid
		if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.lvl) then
			doPlayerSendCancel(cid, 'Está faltando player ou alguém não possui level '..t.lvl..' ou mais.') return true
		end
		table.insert(check, x)
	end
	HaveCreatureArena({from,to}, true, true)
	for _, summon in pairs(t.monstros) do
		doCreateMonster(summon[2], summon[1])
	end
	for i, tid in ipairs(check) do
		doSendMagicEffect(t.entrada, CONST_ME_POFF)
		doTeleportThing(tid, t.saida, false)
		addEvent(VarAnihiPlayer, t.Time*1000, tid)
		doSendMagicEffect(t.saida, CONST_ME_ENERGYAREA)
	end
	doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
	return true
end

 

 

Editado por Vodkart (veja o histórico de edições)

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo