Ir para conteúdo

Featured Replies

Postado

boa noite galerinha do TK

estou com um erro no meu evento.

toda vez que vai iniciar ele da esse erro 

[Erro] Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).

 

Voces podem me ajudar a resolver??

ele funciona normal abre e funciona normal 

mas fica dando esse erro da distro.

 

GRANTOWER = {}
GRANTOWER.PREPARETIME = 2 -- Tempo até liberar a entrada para o evento.
GRANTOWER.CLOSETIME = 15 -- Tempo em minutos de duração do evento.
GRANTOWER.LEVEL = 80 -- Mínimo de level para participar do evento.
GRANTOWER.MAXGUILD = 7 -- Máximo de players por guild dentro do evento.     
GRANTOWER.DATES = {{"Monday", "19:30"}, {"Tuesday", "19:30"}, {"Wednesday", "19:30"}, {"Thursday", "19:30"}, {"Friday", "19:30"}, {"Saturday", "19:30"}, {"Sunday", "19:30"}} -- Dias e horários que ocorrem o evento.
GRANTOWER.ENTER = {x = 1183, y = 2284, z = 9} -- A posição da entrada do castelo, aonde os players são mandados pelo NPC.
GRANTOWER.TOWERPOSITION = {x = 1188, y = 2255, z = 6} -- Posição aonde fica o Gran Tower (o monstro).
GRANTOWER.AREA = {{x = 1168, y = 2230, z = 9}, {x = 1207, y = 2288, z = 6}} --[[A primeira posição é o canto superior esquerdo do mapa do castelo, e a segunda é o canto direito inferior
OBSERVAÇÃO IMPORTANTE: O script foi modificado por mim (xWhiteWolf) para aguentar diferentes andares, apenas coloque a posição dos cantos e o primeiro até o ultimo andar que ele irá remover todo mundo
em todos os andares quando alguém matar a gran tower, pra remover isso apenas coloque o z do mesmo andar da gran tower e apenas os membros que estão nesse andar serão teleportados,
contudo isso pode ocasionar que pessoas consigam ficar dentro do castelo mesmo após o evento ter sido encerrado!]]
GRANTOWER.AURAPERCENT = 0.8 --- porcentagem do dano que irá levar (0.8 = 80%) significa que ele ignora 20% de dano! (adicionado por xWhiteWolf)
GRANTOWER.SHURIAURA = true --- colocar true/false se quiser ativar/desativar a aura de shurikens pro player que tem a gran aura. (adicionado por xWhiteWolf)


--// Favor não mexer daqui para baixo se não souber oque está fazendo!!!
GRANTOWER.EMPTYWINNER = "# [Nobody] #"
GRANTOWER.PREPARE = 201405051746
GRANTOWER.RUNNING = 201405051747
GRANTOWER.AURA = 201405052018
GRANTOWER.DESTROYCOUNT = 201405051800
GRANTOWER.FINALWINNER = 201405051805
GRANTOWER.SAVELASTWINNER = 201405061333 
GRANTOWER.SAVEWINNERGUILDID = 201405061403

function doPrepareGranTower()
 if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= 1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= 1)) then
  setGlobalStorageValue(GRANTOWER.PREPARE, 1)
  addEvent(doStartGranTower, GRANTOWER.PREPARETIME * 60 * 1000)
  addEvent(doBroadcastMessage, ((GRANTOWER.PREPARETIME / 2) * 60 * 1000), "[Gran Tower] Missing "..tostring((GRANTOWER.PREPARETIME / 2)).." minutes NPC Melkrapo will release the entrance to the event, get ready!")
  doBroadcastMessage("[Gran Tower] The event will be started in "..tostring(GRANTOWER.PREPARETIME).." minutes, please prepare your weapons and your team.")
 else
  print("[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).")
 end
 return true
end

function doStartGranTower()
 if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= -1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= 1)) then
  setGlobalStorageValue(GRANTOWER.RUNNING, 1)
  setGlobalStorageValue(GRANTOWER.PREPARE, -1)
  setGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID, -1)
  setGlobalStorageValue(GRANTOWER.FINALWINNER, GRANTOWER.EMPTYWINNER)
  setGlobalStorageValue(GRANTOWER.SAVELASTWINNER, GRANTOWER.EMPTYWINNER)
  setGlobalStorageValue(GRANTOWER.DESTROYCOUNT, 0)
  doCreateMonster("Gran Tower", GRANTOWER.TOWERPOSITION)
  addEvent(doBroadcastMessage, ((GRANTOWER.CLOSETIME - 1) * 60 * 1000), "[Gran Tower] The event will be closed in one minute. Hurry up!")
  addEvent(doCloseGranTower, GRANTOWER.CLOSETIME * 60 * 1000)
  doBroadcastMessage("[Gran Tower] Open event! Run to destroy the Gran Tower.")
 else
  print("[Erro] Gran Tower tentou ser iniciado já ligado, favor verificar o código.")
 end
 return true
end

function doCloseGranTower()
 if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= 1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= -1)) then
  for index, creature in ipairs(getGranTowerPlayers()) do
   doTeleportThing(creature, getTownTemplePosition(getPlayerTown(creature)))
  end
  for index, creature in ipairs(getPlayersOnline()) do
   if (getPlayerGuildId(creature) >= 1) then
    if getPlayerGuildId(creature) ~= getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID) then
     setPlayerStorageValue(creature, GRANTOWER.AURA, -1)
    end
   end 
  end
  setGlobalStorageValue(GRANTOWER.RUNNING, -1)
  if (getCreatureByName("Gran Tower")) then
   doRemoveCreature(getCreatureByName("Gran Tower"), true)
  end
  local TMP_WINNER = getGlobalStorageValue(GRANTOWER.FINALWINNER)
  doBroadcastMessage("[Gran Tower] The event was completed with "..tostring(getGlobalStorageValue(GRANTOWER.DESTROYCOUNT)).." wrecks to Gran Tower, the final winner was "..(TMP_WINNER)..".")
  setGlobalStorageValue(GRANTOWER.DESTROYCOUNT, -1)
  setGlobalStorageValue(GRANTOWER.SAVELASTWINNER, TMP_WINNER)
  setGlobalStorageValue(GRANTOWER.FINALWINNER, -1)
  local TMP_WINNER = nil
 end
 return true
end

function getGranTowerPlayers() -- xWhiteWolf
local players = {}	
local andares = math.abs(GRANTOWER.AREA[1].z - GRANTOWER.AREA[2].z)
	for index, creature in ipairs(getPlayersOnline()) do		
		local z = 0
		local pos1 = {x = GRANTOWER.AREA[1].x, y = GRANTOWER.AREA[1].y, z = GRANTOWER.AREA[1].z}
		local pos2 = {x = GRANTOWER.AREA[2].x, y = GRANTOWER.AREA[2].y, z = GRANTOWER.AREA[2].z}
		
		for i = 0, andares do
			z = z or 0
			pos1.z = pos1.z > pos2.z and pos2.z + z or pos1.z + z
			pos2.z = pos1.z
			z = 1
	
			if isInArea(getThingPos(creature), pos1, pos2) then
					table.insert(players, creature)
			end
		end
	end
return players
end

function getGranTowerGuild(guild_id) -- xWhiteWolf
local players = {}	
local andares = math.abs(GRANTOWER.AREA[1].z - GRANTOWER.AREA[2].z)
	for index, creature in ipairs(getPlayersOnline()) do		
		local z = 0
		local pos1 = {x = GRANTOWER.AREA[1].x, y = GRANTOWER.AREA[1].y, z = GRANTOWER.AREA[1].z}
		local pos2 = {x = GRANTOWER.AREA[2].x, y = GRANTOWER.AREA[2].y, z = GRANTOWER.AREA[2].z}
		
		for i = 0, andares do
			z = z or 0
			pos1.z = pos1.z > pos2.z and pos2.z + z or pos1.z + z
			pos2.z = pos1.z
			z = 1
	
			if isInArea(getThingPos(creature), pos1, pos2) then
				if (getPlayerGuildId(creature) == guild_id) then
					table.insert(players, creature)
				end
			end
		end
	end
return players
end

-- // Gran Aura \/
 
function newColor(n)  
 local n = tonumber(n) or 0
 local n = n + 19
 return tonumber(n) or 0
end

function newColor(n) 
 local n = tonumber(n) or 132
 local n = n - 19
 return tonumber(n) or 132
end
 
-- comentario: se a cor for preta o addon vai para branco sendo que o certo é diminuir 19..
 
local events = {}
function changeOutfit(uid) -- arrumado por xWhiteWolf e adicionado a opção da Shuri
 local sec = 0.5
 local temp = getCreatureOutfit(uid) 

 if (type(temp) == "number") then 
  return true 
 end
   
if getGlobalStorageValue(GRANTOWER.SAVELASTWINNER) ~= getCreatureName(uid) then
	if getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID) ~= getPlayerGuildId(uid) then
			return true
	end
end
 
if GRANTOWER.SHURIAURA then
 local pos = getCreaturePosition(uid)
	local effectPos = {
	[1] = {x = pos.x - 2, y = pos.y - 2, z = pos.z},
	[2] = {x = pos.x + 2, y = pos.y + 2, z = pos.z}
	}

	for i = 1, #effectPos do
	position = effectPos[i + 1] or effectPos[i - 1]
	doSendDistanceShoot(effectPos[i], position, 27)
	end
end
 
 local outfit = {
  lookType = temp.lookType,
  lookHead = newColor(temp.lookHead),
  lookBody = newColor(temp.lookBody),
  lookLegs = newColor(temp.lookLegs),
  lookFeet = newColor(temp.lookFeet),
  lookAddons = getCreatureOutfit(uid).lookAddons,
 }
 doSetCreatureOutfit(uid, outfit, sec)
 local event = addEvent(function()
	 if isCreature(uid) then
	 changeOutfit(uid)
	 end
 end, 3.0 * sec * 450)
 events[uid] = event 
 return true
end

 

 


 

  • Respostas 6
  • Visualizações 357
  • Created
  • Última resposta

Top Posters In This Topic

Postado
GRANTOWER = {}
GRANTOWER.PREPARETIME = 2 -- Tempo até liberar a entrada para o evento.
GRANTOWER.CLOSETIME = 15 -- Tempo em minutos de duração do evento.
GRANTOWER.LEVEL = 80 -- Mínimo de level para participar do evento.
GRANTOWER.MAXGUILD = 7 -- Máximo de players por guild dentro do evento.     
GRANTOWER.DATES = {{"Monday", "19:30"}, {"Tuesday", "19:30"}, {"Wednesday", "19:30"}, {"Thursday", "19:30"}, {"Friday", "19:30"}, {"Saturday", "19:30"}, {"Sunday", "19:30"}} -- Dias e horários que ocorrem o evento.
GRANTOWER.ENTER = {x = 1183, y = 2284, z = 9} -- A posição da entrada do castelo, aonde os players são mandados pelo NPC.
GRANTOWER.TOWERPOSITION = {x = 1188, y = 2255, z = 6} -- Posição aonde fica o Gran Tower (o monstro).
GRANTOWER.AREA = {{x = 1168, y = 2230, z = 9}, {x = 1207, y = 2288, z = 6}} --[[A primeira posição é o canto superior esquerdo do mapa do castelo, e a segunda é o canto direito inferior
OBSERVAÇÃO IMPORTANTE: O script foi modificado por mim (xWhiteWolf) para aguentar diferentes andares, apenas coloque a posição dos cantos e o primeiro até o ultimo andar que ele irá remover todo mundo
em todos os andares quando alguém matar a gran tower, pra remover isso apenas coloque o z do mesmo andar da gran tower e apenas os membros que estão nesse andar serão teleportados,
contudo isso pode ocasionar que pessoas consigam ficar dentro do castelo mesmo após o evento ter sido encerrado!]]
GRANTOWER.AURAPERCENT = 0.8 --- porcentagem do dano que irá levar (0.8 = 80%) significa que ele ignora 20% de dano! (adicionado por xWhiteWolf)
GRANTOWER.SHURIAURA = true --- colocar true/false se quiser ativar/desativar a aura de shurikens pro player que tem a gran aura. (adicionado por xWhiteWolf)


--// Favor não mexer daqui para baixo se não souber oque está fazendo!!!
GRANTOWER.EMPTYWINNER = "# [Nobody] #"
GRANTOWER.PREPARE = 201405051746
GRANTOWER.RUNNING = 201405051747
GRANTOWER.AURA = 201405052018
GRANTOWER.DESTROYCOUNT = 201405051800
GRANTOWER.FINALWINNER = 201405051805
GRANTOWER.SAVELASTWINNER = 201405061333 
GRANTOWER.SAVEWINNERGUILDID = 201405061403

function doPrepareGranTower()
 if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= 1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= -1)) then
  setGlobalStorageValue(GRANTOWER.PREPARE, 1)
  addEvent(doStartGranTower, GRANTOWER.PREPARETIME * 60 * 1000)
  addEvent(doBroadcastMessage, ((GRANTOWER.PREPARETIME / 2) * 60 * 1000), "[Gran Tower] Missing "..tostring((GRANTOWER.PREPARETIME / 2)).." minutes NPC Melkrapo will release the entrance to the event, get ready!")
  doBroadcastMessage("[Gran Tower] The event will be started in "..tostring(GRANTOWER.PREPARETIME).." minutes, please prepare your weapons and your team.")
 else
  print("[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).")
 end
 return true
end

function doStartGranTower()
 if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= -1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= 1)) then
  setGlobalStorageValue(GRANTOWER.RUNNING, 1)
  setGlobalStorageValue(GRANTOWER.PREPARE, -1)
  setGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID, -1)
  setGlobalStorageValue(GRANTOWER.FINALWINNER, GRANTOWER.EMPTYWINNER)
  setGlobalStorageValue(GRANTOWER.SAVELASTWINNER, GRANTOWER.EMPTYWINNER)
  setGlobalStorageValue(GRANTOWER.DESTROYCOUNT, 0)
  doCreateMonster("Gran Tower", GRANTOWER.TOWERPOSITION)
  addEvent(doBroadcastMessage, ((GRANTOWER.CLOSETIME - 1) * 60 * 1000), "[Gran Tower] The event will be closed in one minute. Hurry up!")
  addEvent(doCloseGranTower, GRANTOWER.CLOSETIME * 60 * 1000)
  doBroadcastMessage("[Gran Tower] Open event! Run to destroy the Gran Tower.")
 else
  print("[Erro] Gran Tower tentou ser iniciado já ligado, favor verificar o código.")
 end
 return true
end

function doCloseGranTower()
 if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= 1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= -1)) then
  for index, creature in ipairs(getGranTowerPlayers()) do
   doTeleportThing(creature, getTownTemplePosition(getPlayerTown(creature)))
  end
  for index, creature in ipairs(getPlayersOnline()) do
   if (getPlayerGuildId(creature) >= 1) then
    if getPlayerGuildId(creature) ~= getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID) then
     setPlayerStorageValue(creature, GRANTOWER.AURA, -1)
    end
   end 
  end
  setGlobalStorageValue(GRANTOWER.RUNNING, -1)
  if (getCreatureByName("Gran Tower")) then
   doRemoveCreature(getCreatureByName("Gran Tower"), true)
  end
  local TMP_WINNER = getGlobalStorageValue(GRANTOWER.FINALWINNER)
  doBroadcastMessage("[Gran Tower] The event was completed with "..tostring(getGlobalStorageValue(GRANTOWER.DESTROYCOUNT)).." wrecks to Gran Tower, the final winner was "..(TMP_WINNER)..".")
  setGlobalStorageValue(GRANTOWER.DESTROYCOUNT, -1)
  setGlobalStorageValue(GRANTOWER.SAVELASTWINNER, TMP_WINNER)
  setGlobalStorageValue(GRANTOWER.FINALWINNER, -1)
  local TMP_WINNER = nil
 end
 return true
end

function getGranTowerPlayers() -- xWhiteWolf
local players = {}	
local andares = math.abs(GRANTOWER.AREA[1].z - GRANTOWER.AREA[2].z)
	for index, creature in ipairs(getPlayersOnline()) do		
		local z = 0
		local pos1 = {x = GRANTOWER.AREA[1].x, y = GRANTOWER.AREA[1].y, z = GRANTOWER.AREA[1].z}
		local pos2 = {x = GRANTOWER.AREA[2].x, y = GRANTOWER.AREA[2].y, z = GRANTOWER.AREA[2].z}
		
		for i = 0, andares do
			z = z or 0
			pos1.z = pos1.z > pos2.z and pos2.z + z or pos1.z + z
			pos2.z = pos1.z
			z = 1
	
			if isInArea(getThingPos(creature), pos1, pos2) then
					table.insert(players, creature)
			end
		end
	end
return players
end

function getGranTowerGuild(guild_id) -- xWhiteWolf
local players = {}	
local andares = math.abs(GRANTOWER.AREA[1].z - GRANTOWER.AREA[2].z)
	for index, creature in ipairs(getPlayersOnline()) do		
		local z = 0
		local pos1 = {x = GRANTOWER.AREA[1].x, y = GRANTOWER.AREA[1].y, z = GRANTOWER.AREA[1].z}
		local pos2 = {x = GRANTOWER.AREA[2].x, y = GRANTOWER.AREA[2].y, z = GRANTOWER.AREA[2].z}
		
		for i = 0, andares do
			z = z or 0
			pos1.z = pos1.z > pos2.z and pos2.z + z or pos1.z + z
			pos2.z = pos1.z
			z = 1
	
			if isInArea(getThingPos(creature), pos1, pos2) then
				if (getPlayerGuildId(creature) == guild_id) then
					table.insert(players, creature)
				end
			end
		end
	end
return players
end

-- // Gran Aura \/
 
function newColor(n)  
 local n = tonumber(n) or 0
 local n = n + 19
 return tonumber(n) or 0
end

function newColor(n) 
 local n = tonumber(n) or 132
 local n = n - 19
 return tonumber(n) or 132
end
 
-- comentario: se a cor for preta o addon vai para branco sendo que o certo é diminuir 19..
 
local events = {}
function changeOutfit(uid) -- arrumado por xWhiteWolf e adicionado a opção da Shuri
 local sec = 0.5
 local temp = getCreatureOutfit(uid) 

 if (type(temp) == "number") then 
  return true 
 end
   
if getGlobalStorageValue(GRANTOWER.SAVELASTWINNER) ~= getCreatureName(uid) then
	if getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID) ~= getPlayerGuildId(uid) then
			return true
	end
end
 
if GRANTOWER.SHURIAURA then
 local pos = getCreaturePosition(uid)
	local effectPos = {
	[1] = {x = pos.x - 2, y = pos.y - 2, z = pos.z},
	[2] = {x = pos.x + 2, y = pos.y + 2, z = pos.z}
	}

	for i = 1, #effectPos do
	position = effectPos[i + 1] or effectPos[i - 1]
	doSendDistanceShoot(effectPos[i], position, 27)
	end
end
 
 local outfit = {
  lookType = temp.lookType,
  lookHead = newColor(temp.lookHead),
  lookBody = newColor(temp.lookBody),
  lookLegs = newColor(temp.lookLegs),
  lookFeet = newColor(temp.lookFeet),
  lookAddons = getCreatureOutfit(uid).lookAddons,
 }
 doSetCreatureOutfit(uid, outfit, sec)
 local event = addEvent(function()
	 if isCreature(uid) then
	 changeOutfit(uid)
	 end
 end, 3.0 * sec * 450)
 events[uid] = event 
 return true
end

 

 

TESTA ESSE DAI MANO.

Postado
  • Autor
7 minutos atrás, JEAN JR disse:

GRANTOWER = {} GRANTOWER.PREPARETIME = 2 -- Tempo até liberar a entrada para o evento. GRANTOWER.CLOSETIME = 15 -- Tempo em minutos de duração do evento. GRANTOWER.LEVEL = 80 -- Mínimo de level para participar do evento. GRANTOWER.MAXGUILD = 7 -- Máximo de players por guild dentro do evento. GRANTOWER.DATES = {{"Monday", "19:30"}, {"Tuesday", "19:30"}, {"Wednesday", "19:30"}, {"Thursday", "19:30"}, {"Friday", "19:30"}, {"Saturday", "19:30"}, {"Sunday", "19:30"}} -- Dias e horários que ocorrem o evento. GRANTOWER.ENTER = {x = 1183, y = 2284, z = 9} -- A posição da entrada do castelo, aonde os players são mandados pelo NPC. GRANTOWER.TOWERPOSITION = {x = 1188, y = 2255, z = 6} -- Posição aonde fica o Gran Tower (o monstro). GRANTOWER.AREA = {{x = 1168, y = 2230, z = 9}, {x = 1207, y = 2288, z = 6}} --[[A primeira posição é o canto superior esquerdo do mapa do castelo, e a segunda é o canto direito inferior OBSERVAÇÃO IMPORTANTE: O script foi modificado por mim (xWhiteWolf) para aguentar diferentes andares, apenas coloque a posição dos cantos e o primeiro até o ultimo andar que ele irá remover todo mundo em todos os andares quando alguém matar a gran tower, pra remover isso apenas coloque o z do mesmo andar da gran tower e apenas os membros que estão nesse andar serão teleportados, contudo isso pode ocasionar que pessoas consigam ficar dentro do castelo mesmo após o evento ter sido encerrado!]] GRANTOWER.AURAPERCENT = 0.8 --- porcentagem do dano que irá levar (0.8 = 80%) significa que ele ignora 20% de dano! (adicionado por xWhiteWolf) GRANTOWER.SHURIAURA = true --- colocar true/false se quiser ativar/desativar a aura de shurikens pro player que tem a gran aura. (adicionado por xWhiteWolf) --// Favor não mexer daqui para baixo se não souber oque está fazendo!!! GRANTOWER.EMPTYWINNER = "# [Nobody] #" GRANTOWER.PREPARE = 201405051746 GRANTOWER.RUNNING = 201405051747 GRANTOWER.AURA = 201405052018 GRANTOWER.DESTROYCOUNT = 201405051800 GRANTOWER.FINALWINNER = 201405051805 GRANTOWER.SAVELASTWINNER = 201405061333 GRANTOWER.SAVEWINNERGUILDID = 201405061403 function doPrepareGranTower() if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= 1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= -1)) then setGlobalStorageValue(GRANTOWER.PREPARE, 1) addEvent(doStartGranTower, GRANTOWER.PREPARETIME * 60 * 1000) addEvent(doBroadcastMessage, ((GRANTOWER.PREPARETIME / 2) * 60 * 1000), "[Gran Tower] Missing "..tostring((GRANTOWER.PREPARETIME / 2)).." minutes NPC Melkrapo will release the entrance to the event, get ready!") doBroadcastMessage("[Gran Tower] The event will be started in "..tostring(GRANTOWER.PREPARETIME).." minutes, please prepare your weapons and your team.") else print("[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).") end return true end function doStartGranTower() if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= -1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= 1)) then setGlobalStorageValue(GRANTOWER.RUNNING, 1) setGlobalStorageValue(GRANTOWER.PREPARE, -1) setGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID, -1) setGlobalStorageValue(GRANTOWER.FINALWINNER, GRANTOWER.EMPTYWINNER) setGlobalStorageValue(GRANTOWER.SAVELASTWINNER, GRANTOWER.EMPTYWINNER) setGlobalStorageValue(GRANTOWER.DESTROYCOUNT, 0) doCreateMonster("Gran Tower", GRANTOWER.TOWERPOSITION) addEvent(doBroadcastMessage, ((GRANTOWER.CLOSETIME - 1) * 60 * 1000), "[Gran Tower] The event will be closed in one minute. Hurry up!") addEvent(doCloseGranTower, GRANTOWER.CLOSETIME * 60 * 1000) doBroadcastMessage("[Gran Tower] Open event! Run to destroy the Gran Tower.") else print("[Erro] Gran Tower tentou ser iniciado já ligado, favor verificar o código.") end return true end function doCloseGranTower() if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= 1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= -1)) then for index, creature in ipairs(getGranTowerPlayers()) do doTeleportThing(creature, getTownTemplePosition(getPlayerTown(creature))) end for index, creature in ipairs(getPlayersOnline()) do if (getPlayerGuildId(creature) >= 1) then if getPlayerGuildId(creature) ~= getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID) then setPlayerStorageValue(creature, GRANTOWER.AURA, -1) end end end setGlobalStorageValue(GRANTOWER.RUNNING, -1) if (getCreatureByName("Gran Tower")) then doRemoveCreature(getCreatureByName("Gran Tower"), true) end local TMP_WINNER = getGlobalStorageValue(GRANTOWER.FINALWINNER) doBroadcastMessage("[Gran Tower] The event was completed with "..tostring(getGlobalStorageValue(GRANTOWER.DESTROYCOUNT)).." wrecks to Gran Tower, the final winner was "..(TMP_WINNER)..".") setGlobalStorageValue(GRANTOWER.DESTROYCOUNT, -1) setGlobalStorageValue(GRANTOWER.SAVELASTWINNER, TMP_WINNER) setGlobalStorageValue(GRANTOWER.FINALWINNER, -1) local TMP_WINNER = nil end return true end function getGranTowerPlayers() -- xWhiteWolf local players = {} local andares = math.abs(GRANTOWER.AREA[1].z - GRANTOWER.AREA[2].z) for index, creature in ipairs(getPlayersOnline()) do local z = 0 local pos1 = {x = GRANTOWER.AREA[1].x, y = GRANTOWER.AREA[1].y, z = GRANTOWER.AREA[1].z} local pos2 = {x = GRANTOWER.AREA[2].x, y = GRANTOWER.AREA[2].y, z = GRANTOWER.AREA[2].z} for i = 0, andares do z = z or 0 pos1.z = pos1.z > pos2.z and pos2.z + z or pos1.z + z pos2.z = pos1.z z = 1 if isInArea(getThingPos(creature), pos1, pos2) then table.insert(players, creature) end end end return players end function getGranTowerGuild(guild_id) -- xWhiteWolf local players = {} local andares = math.abs(GRANTOWER.AREA[1].z - GRANTOWER.AREA[2].z) for index, creature in ipairs(getPlayersOnline()) do local z = 0 local pos1 = {x = GRANTOWER.AREA[1].x, y = GRANTOWER.AREA[1].y, z = GRANTOWER.AREA[1].z} local pos2 = {x = GRANTOWER.AREA[2].x, y = GRANTOWER.AREA[2].y, z = GRANTOWER.AREA[2].z} for i = 0, andares do z = z or 0 pos1.z = pos1.z > pos2.z and pos2.z + z or pos1.z + z pos2.z = pos1.z z = 1 if isInArea(getThingPos(creature), pos1, pos2) then if (getPlayerGuildId(creature) == guild_id) then table.insert(players, creature) end end end end return players end -- // Gran Aura \/ function newColor(n) local n = tonumber(n) or 0 local n = n + 19 return tonumber(n) or 0 end function newColor(n) local n = tonumber(n) or 132 local n = n - 19 return tonumber(n) or 132 end -- comentario: se a cor for preta o addon vai para branco sendo que o certo é diminuir 19.. local events = {} function changeOutfit(uid) -- arrumado por xWhiteWolf e adicionado a opção da Shuri local sec = 0.5 local temp = getCreatureOutfit(uid) if (type(temp) == "number") then return true end if getGlobalStorageValue(GRANTOWER.SAVELASTWINNER) ~= getCreatureName(uid) then if getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID) ~= getPlayerGuildId(uid) then return true end end if GRANTOWER.SHURIAURA then local pos = getCreaturePosition(uid) local effectPos = { [1] = {x = pos.x - 2, y = pos.y - 2, z = pos.z}, [2] = {x = pos.x + 2, y = pos.y + 2, z = pos.z} } for i = 1, #effectPos do position = effectPos[i + 1] or effectPos[i - 1] doSendDistanceShoot(effectPos[i], position, 27) end end local outfit = { lookType = temp.lookType, lookHead = newColor(temp.lookHead), lookBody = newColor(temp.lookBody), lookLegs = newColor(temp.lookLegs), lookFeet = newColor(temp.lookFeet), lookAddons = getCreatureOutfit(uid).lookAddons, } doSetCreatureOutfit(uid, outfit, sec) local event = addEvent(function() if isCreature(uid) then changeOutfit(uid) end end, 3.0 * sec * 450) events[uid] = event return true end

mesmo erro 

[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).
 

Postado

TESTA ASSIM ENTÃO...

 

GRANTOWER = {}
GRANTOWER.PREPARETIME = 2 -- Tempo até liberar a entrada para o evento.
GRANTOWER.CLOSETIME = 15 -- Tempo em minutos de duração do evento.
GRANTOWER.LEVEL = 80 -- Mínimo de level para participar do evento.
GRANTOWER.MAXGUILD = 7 -- Máximo de players por guild dentro do evento.     
GRANTOWER.DATES = {{"Monday", "19:30"}, {"Tuesday", "19:30"}, {"Wednesday", "19:30"}, {"Thursday", "19:30"}, {"Friday", "19:30"}, {"Saturday", "19:30"}, {"Sunday", "19:30"}} -- Dias e horários que ocorrem o evento.
GRANTOWER.ENTER = {x = 1183, y = 2284, z = 9} -- A posição da entrada do castelo, aonde os players são mandados pelo NPC.
GRANTOWER.TOWERPOSITION = {x = 1188, y = 2255, z = 6} -- Posição aonde fica o Gran Tower (o monstro).
GRANTOWER.AREA = {{x = 1168, y = 2230, z = 9}, {x = 1207, y = 2288, z = 6}} --[[A primeira posição é o canto superior esquerdo do mapa do castelo, e a segunda é o canto direito inferior
OBSERVAÇÃO IMPORTANTE: O script foi modificado por mim (xWhiteWolf) para aguentar diferentes andares, apenas coloque a posição dos cantos e o primeiro até o ultimo andar que ele irá remover todo mundo
em todos os andares quando alguém matar a gran tower, pra remover isso apenas coloque o z do mesmo andar da gran tower e apenas os membros que estão nesse andar serão teleportados,
contudo isso pode ocasionar que pessoas consigam ficar dentro do castelo mesmo após o evento ter sido encerrado!]]
GRANTOWER.AURAPERCENT = 0.8 --- porcentagem do dano que irá levar (0.8 = 80%) significa que ele ignora 20% de dano! (adicionado por xWhiteWolf)
GRANTOWER.SHURIAURA = true --- colocar true/false se quiser ativar/desativar a aura de shurikens pro player que tem a gran aura. (adicionado por xWhiteWolf)


--// Favor não mexer daqui para baixo se não souber oque está fazendo!!!
GRANTOWER.EMPTYWINNER = "# [Nobody] #"
GRANTOWER.PREPARE = 201405051746
GRANTOWER.RUNNING = 201405051747
GRANTOWER.AURA = 201405052018
GRANTOWER.DESTROYCOUNT = 201405051800
GRANTOWER.FINALWINNER = 201405051805
GRANTOWER.SAVELASTWINNER = 201405061333 
GRANTOWER.SAVEWINNERGUILDID = 201405061403

if getGlobalStorageValue(GRANTOWER.PREPARE) == NULL and getGlobalStorageValue(GRANTOWER.RUNNING) == NULL then
  setGlobalStorageValue(GRANTOWER.PREPARE, -1)
  setGlobalStorageValue(GRANTOWER.RUNNING, -1)
end

function doPrepareGranTower()
 if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= 1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= 1)) then
  setGlobalStorageValue(GRANTOWER.PREPARE, 1)
  addEvent(doStartGranTower, GRANTOWER.PREPARETIME * 60 * 1000)
  addEvent(doBroadcastMessage, ((GRANTOWER.PREPARETIME / 2) * 60 * 1000), "[Gran Tower] Missing "..tostring((GRANTOWER.PREPARETIME / 2)).." minutes NPC Melkrapo will release the entrance to the event, get ready!")
  doBroadcastMessage("[Gran Tower] The event will be started in "..tostring(GRANTOWER.PREPARETIME).." minutes, please prepare your weapons and your team.")
 else
  print("[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).")
 end
 return true
end

function doStartGranTower()
 if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= -1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= 1)) then
  setGlobalStorageValue(GRANTOWER.RUNNING, 1)
  setGlobalStorageValue(GRANTOWER.PREPARE, -1)
  setGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID, -1)
  setGlobalStorageValue(GRANTOWER.FINALWINNER, GRANTOWER.EMPTYWINNER)
  setGlobalStorageValue(GRANTOWER.SAVELASTWINNER, GRANTOWER.EMPTYWINNER)
  setGlobalStorageValue(GRANTOWER.DESTROYCOUNT, 0)
  doCreateMonster("Gran Tower", GRANTOWER.TOWERPOSITION)
  addEvent(doBroadcastMessage, ((GRANTOWER.CLOSETIME - 1) * 60 * 1000), "[Gran Tower] The event will be closed in one minute. Hurry up!")
  addEvent(doCloseGranTower, GRANTOWER.CLOSETIME * 60 * 1000)
  doBroadcastMessage("[Gran Tower] Open event! Run to destroy the Gran Tower.")
 else
  print("[Erro] Gran Tower tentou ser iniciado já ligado, favor verificar o código.")
 end
 return true
end

function doCloseGranTower()
 if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= 1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= -1)) then
  for index, creature in ipairs(getGranTowerPlayers()) do
   doTeleportThing(creature, getTownTemplePosition(getPlayerTown(creature)))
  end
  for index, creature in ipairs(getPlayersOnline()) do
   if (getPlayerGuildId(creature) >= 1) then
    if getPlayerGuildId(creature) ~= getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID) then
     setPlayerStorageValue(creature, GRANTOWER.AURA, -1)
    end
   end 
  end
  setGlobalStorageValue(GRANTOWER.RUNNING, -1)
  if (getCreatureByName("Gran Tower")) then
   doRemoveCreature(getCreatureByName("Gran Tower"), true)
  end
  local TMP_WINNER = getGlobalStorageValue(GRANTOWER.FINALWINNER)
  doBroadcastMessage("[Gran Tower] The event was completed with "..tostring(getGlobalStorageValue(GRANTOWER.DESTROYCOUNT)).." wrecks to Gran Tower, the final winner was "..(TMP_WINNER)..".")
  setGlobalStorageValue(GRANTOWER.DESTROYCOUNT, -1)
  setGlobalStorageValue(GRANTOWER.SAVELASTWINNER, TMP_WINNER)
  setGlobalStorageValue(GRANTOWER.FINALWINNER, -1)
  local TMP_WINNER = nil
 end
 return true
end

function getGranTowerPlayers() -- xWhiteWolf
local players = {}	
local andares = math.abs(GRANTOWER.AREA[1].z - GRANTOWER.AREA[2].z)
	for index, creature in ipairs(getPlayersOnline()) do		
		local z = 0
		local pos1 = {x = GRANTOWER.AREA[1].x, y = GRANTOWER.AREA[1].y, z = GRANTOWER.AREA[1].z}
		local pos2 = {x = GRANTOWER.AREA[2].x, y = GRANTOWER.AREA[2].y, z = GRANTOWER.AREA[2].z}
		
		for i = 0, andares do
			z = z or 0
			pos1.z = pos1.z > pos2.z and pos2.z + z or pos1.z + z
			pos2.z = pos1.z
			z = 1
	
			if isInArea(getThingPos(creature), pos1, pos2) then
					table.insert(players, creature)
			end
		end
	end
return players
end

function getGranTowerGuild(guild_id) -- xWhiteWolf
local players = {}	
local andares = math.abs(GRANTOWER.AREA[1].z - GRANTOWER.AREA[2].z)
	for index, creature in ipairs(getPlayersOnline()) do		
		local z = 0
		local pos1 = {x = GRANTOWER.AREA[1].x, y = GRANTOWER.AREA[1].y, z = GRANTOWER.AREA[1].z}
		local pos2 = {x = GRANTOWER.AREA[2].x, y = GRANTOWER.AREA[2].y, z = GRANTOWER.AREA[2].z}
		
		for i = 0, andares do
			z = z or 0
			pos1.z = pos1.z > pos2.z and pos2.z + z or pos1.z + z
			pos2.z = pos1.z
			z = 1
	
			if isInArea(getThingPos(creature), pos1, pos2) then
				if (getPlayerGuildId(creature) == guild_id) then
					table.insert(players, creature)
				end
			end
		end
	end
return players
end

-- // Gran Aura \/
 
function newColor(n)  
 local n = tonumber(n) or 0
 local n = n + 19
 return tonumber(n) or 0
end

function newColor(n) 
 local n = tonumber(n) or 132
 local n = n - 19
 return tonumber(n) or 132
end
 
-- comentario: se a cor for preta o addon vai para branco sendo que o certo é diminuir 19..
 
local events = {}
function changeOutfit(uid) -- arrumado por xWhiteWolf e adicionado a opção da Shuri
 local sec = 0.5
 local temp = getCreatureOutfit(uid) 

 if (type(temp) == "number") then 
  return true 
 end
   
if getGlobalStorageValue(GRANTOWER.SAVELASTWINNER) ~= getCreatureName(uid) then
	if getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID) ~= getPlayerGuildId(uid) then
			return true
	end
end
 
if GRANTOWER.SHURIAURA then
 local pos = getCreaturePosition(uid)
	local effectPos = {
	[1] = {x = pos.x - 2, y = pos.y - 2, z = pos.z},
	[2] = {x = pos.x + 2, y = pos.y + 2, z = pos.z}
	}

	for i = 1, #effectPos do
	position = effectPos[i + 1] or effectPos[i - 1]
	doSendDistanceShoot(effectPos[i], position, 27)
	end
end
 
 local outfit = {
  lookType = temp.lookType,
  lookHead = newColor(temp.lookHead),
  lookBody = newColor(temp.lookBody),
  lookLegs = newColor(temp.lookLegs),
  lookFeet = newColor(temp.lookFeet),
  lookAddons = getCreatureOutfit(uid).lookAddons,
 }
 doSetCreatureOutfit(uid, outfit, sec)
 local event = addEvent(function()
	 if isCreature(uid) then
	 changeOutfit(uid)
	 end
 end, 3.0 * sec * 450)
 events[uid] = event 
 return true
end

 

Postado
  • Autor

[Error - CreatureScript Interface]
data/creaturescripts/scripts/Gran Tower.lua:onTarget
Description:
data/creaturescripts/scripts/Gran Tower.lua:37: attempt to call global 'isPlayer' (a nil value)
stack traceback:
        data/creaturescripts/scripts/Gran Tower.lua:37: in function <data/creaturescripts/scripts/Gran Tower.lua:36>

[Error - CreatureScript Interface]
data/creaturescripts/scripts/events/realteambattle.lua:onTarget
Description:
...ta/creaturescripts/scripts/events/realteambattle.lua:21: attempt to call global 'isPlayer' (a nil value)
stack traceback:
        ...ta/creaturescripts/scripts/events/realteambattle.lua:21: in function <...ta/creaturescripts/scripts/events/realteambattle.lua:20>

[Error - CreatureScript Interface]
data/creaturescripts/scripts/Gran Tower.lua:onTarget
Description:
data/creaturescripts/scripts/Gran Tower.lua:37: attempt to call global 'isPlayer' (a nil value)
stack traceback:
        data/creaturescripts/scripts/Gran Tower.lua:37: in function <data/creaturescripts/scripts/Gran Tower.lua:36>

@Sttorm 

@Vodkart

Me ajudem consertar essse script por favor.

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