Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Parabéns, seu tópico de conteúdo foi aprovado!
Muito obrigado pela sua contribuição, nós do Tibia King agradecemos.
Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.

Spoiler

Congratulations, your content has been approved!
Thank you for your contribution, we of Tibia King we are grateful.
Your content will help many other users, you received +1 REP.

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites
  • 3 months later...

achei um possível bug,

depois que você entra na guild e tals

pra sair dela não é possivel

porque diz que a sua guild esta em guerra..

consegue corrigir?

Link para o post
Compartilhar em outros sites
2 horas atrás, Soldoran disse:

achei um possível bug,

depois que você entra na guild e tals

pra sair dela não é possivel

porque diz que a sua guild esta em guerra..

consegue corrigir?


é na talkaction do sistema de guild wars...
bom, eu não tenho certeza se corrigi isso, mas tenta usar essa minha talkaction de guild war... (salve o seu... por garantia)

eu lembro que fiz algumas modificações a meu gosto talvez eu tenha arrumado isso sla kkkk (ou não)

 

Spoiler

function onSay(cid, words, param, channel)
	local guild = getPlayerGuildId(cid)
	if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then
		doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
		return true
	end

	local t = string.explode(param, ",")
	if(not t[2]) then
		doPlayerSendChannelMessage(cid, "", "Not enough param(s).", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
		return true
	end

	local enemy = getGuildId(t[2])
	if(not enemy) then
		doPlayerSendChannelMessage(cid, "", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
		return true
	end

	if(enemy == guild) then
		doPlayerSendChannelMessage(cid, "", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
		return true
	end

	local enemyName, tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy)
	if(tmp:getID() ~= -1) then
		enemyName = tmp:getDataString("name")
		tmp:free()
	end

	if(isInArray({"accept", "reject", "cancel"}, t[1])) then
		local query = "`guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild
		if(t[1] == "cancel") then
			query = "`guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy
		end

		tmp = db.getResult("SELECT `id`, `begin`, `end`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0")
		if(tmp:getID() == -1) then
			doPlayerSendChannelMessage(cid, "", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
			return true
		end

		if(t[1] == "accept") then
			local _tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild)
			local state = _tmp:getID() < 0 or _tmp:getDataInt("balance") < tmp:getDataInt("payment")

			_tmp:free()
			if(state) then
				doPlayerSendChannelMessage(cid, "", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
				return true
			end

			db.executeQuery("UPDATE `guilds` SET `balance` = `balance` - " .. tmp:getDataInt("payment") .. " WHERE `id` = " .. guild)
		end

		query = "UPDATE `guild_wars` SET "
		local msg = "accepted " .. enemyName .. " invitation to war."
		if(t[1] == "reject") then
			query = query .. "`end` = " .. os.time() .. ", `status` = 2"
			msg = "rejected " .. enemyName .. " invitation to war."
		elseif(t[1] == "cancel") then
			query = query .. "`end` = " .. os.time() .. ", `status` = 3"
			msg = "canceled invitation to a war with " .. enemyName .. "."
		else
			query = query .. "`begin` = " .. os.time() .. ", `end` = " .. (tmp:getDataInt("end") > 0 and (os.time() + ((tmp:getDataInt("begin") - tmp:getDataInt("end")) / 86400)) or 0) .. ", `status` = 1"
		end

		query = query .. " WHERE `id` = " .. tmp:getDataInt("id")
		if(t[1] == "accept") then
			doGuildAddEnemy(guild, enemy, tmp:getDataInt("id"), WAR_GUILD)
			doGuildAddEnemy(enemy, guild, tmp:getDataInt("id"), WAR_ENEMY)
		end

		tmp:free()
		db.executeQuery(query)
		doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE)
		return true
	end

	if(t[1] == "invite") then
		local str = ""
                tmp = db.getResult("SELECT `guild_id`, `status` FROM `guild_wars` WHERE `guild_id` IN (" .. guild .. "," .. enemy .. ") AND `enemy_id` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)")
                if(tmp:getID() ~= -1) then
                        if(tmp:getDataInt("status") == 0) then
                                if(tmp:getDataInt("guild_id") == guild) then
                                        str = "You have already invited " .. enemyName .. " to war."
                                else
                                        str = enemyName .. " have already invited you to war."
                                end
			else
				str = "You are already on a war with " .. enemyName .. "."
			end

			tmp:free()
		end

		if(str ~= "") then
			doPlayerSendChannelMessage(cid, "", str, TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
			return true
		end

		local frags = tonumber(t[3])
		if(frags ~= nil) then
			frags = math.max(10, math.min(1000, frags))
		else
			frags = 100
		end

		local payment = tonumber(t[4])
		if(payment ~= nil) then
			payment = math.max(100000, math.min(1000000000, payment))
			tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild)

			local state = tmp:getID() < 0 or tmp:getDataInt("balance") < payment
			tmp:free()
			if(state) then
				doPlayerSendChannelMessage(cid, "", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
				return true
			end

			db.executeQuery("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild)
		else
			payment = 0
		end

		local begining, ending = os.time(), tonumber(t[5])
		if(ending ~= nil and ending ~= 0) then
			ending = begining + (ending * 86400)
		else
			ending = 0
		end

		db.executeQuery("INSERT INTO `guild_wars` (`guild_id`, `enemy_id`, `begin`, `end`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");")
		doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE)
		return true
	end

	if(not isInArray({"end", "finish"}, t[1])) then
		return false
	end

	local status = (t[1] == "end" and 1 or 4)
	tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status)
	if(tmp:getID() ~= -1) then
		local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id")
		tmp:free()
		doGuildRemoveEnemy(guild, enemy)
		doGuildRemoveEnemy(enemy, guild)

		db.executeQuery(query)
		doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 4 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE)
		return true
	end

	if(status == 4) then
		doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
		return true
	end

	tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1")
	if(tmp:getID() ~= -1) then
		if(tmp:getDataInt("end") > 0) then
			tmp:free()
			doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
			return true
		end

		 --render
		local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id")
		tmp:free()
		doGuildRemoveEnemy(guild, enemy)
		doGuildRemoveEnemy(enemy, guild)
		

		db.executeQuery(query)
		doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE)
		
		
		
		return true
	end

	doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
	return true
end

 


caso n tiver, creio que nao seja dificil é só pegar um pouco de lógica do código, utilize ctrl+F  e procure mais ou menos a frase que esta dizendo que não pdoe sair da guild pois deve ter um if por lá verificando.. ou algo assim.

os comandos usados.

/war invite, guild name, fraglimit                 Enviar convite para war.   Example: /war invite, Black Ninjas, 50</b> <br>

/war accept, guild name                                     Aceitar o convite da war. 
/war reject, guild name                                   Rejeitar o convite da war. 
/war end, guild name                                Acabar com uma war ativa. 
/war cancel, guild name                           Cancelar um convite enviado. 
 

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

Scriptszinhos:

 

Não abandone seu tópico, quando você tiver a dúvida resolvida sozinho tente ensinar aos outros como resolve-la (você pode não ser o único com o problema) e quando ela for resolvida por outra pessoa não se esqueça de marcar como melhor resposta e deixar o gostei.

Link para o post
Compartilhar em outros sites
  • 1 year later...
Em 25/07/2017 em 04:35, thelifeofpbion disse:


é na talkaction do sistema de guild wars...
bom, eu não tenho certeza se corrigi isso, mas tenta usar essa minha talkaction de guild war... (salve o seu... por garantia)

eu lembro que fiz algumas modificações a meu gosto talvez eu tenha arrumado isso sla kkkk (ou não)

 

  Mostrar conteúdo oculto


function onSay(cid, words, param, channel)
	local guild = getPlayerGuildId(cid)
	if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then
		doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
		return true
	end

	local t = string.explode(param, ",")
	if(not t[2]) then
		doPlayerSendChannelMessage(cid, "", "Not enough param(s).", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
		return true
	end

	local enemy = getGuildId(t[2])
	if(not enemy) then
		doPlayerSendChannelMessage(cid, "", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
		return true
	end

	if(enemy == guild) then
		doPlayerSendChannelMessage(cid, "", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
		return true
	end

	local enemyName, tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy)
	if(tmp:getID() ~= -1) then
		enemyName = tmp:getDataString("name")
		tmp:free()
	end

	if(isInArray({"accept", "reject", "cancel"}, t[1])) then
		local query = "`guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild
		if(t[1] == "cancel") then
			query = "`guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy
		end

		tmp = db.getResult("SELECT `id`, `begin`, `end`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0")
		if(tmp:getID() == -1) then
			doPlayerSendChannelMessage(cid, "", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
			return true
		end

		if(t[1] == "accept") then
			local _tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild)
			local state = _tmp:getID() < 0 or _tmp:getDataInt("balance") < tmp:getDataInt("payment")

			_tmp:free()
			if(state) then
				doPlayerSendChannelMessage(cid, "", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
				return true
			end

			db.executeQuery("UPDATE `guilds` SET `balance` = `balance` - " .. tmp:getDataInt("payment") .. " WHERE `id` = " .. guild)
		end

		query = "UPDATE `guild_wars` SET "
		local msg = "accepted " .. enemyName .. " invitation to war."
		if(t[1] == "reject") then
			query = query .. "`end` = " .. os.time() .. ", `status` = 2"
			msg = "rejected " .. enemyName .. " invitation to war."
		elseif(t[1] == "cancel") then
			query = query .. "`end` = " .. os.time() .. ", `status` = 3"
			msg = "canceled invitation to a war with " .. enemyName .. "."
		else
			query = query .. "`begin` = " .. os.time() .. ", `end` = " .. (tmp:getDataInt("end") > 0 and (os.time() + ((tmp:getDataInt("begin") - tmp:getDataInt("end")) / 86400)) or 0) .. ", `status` = 1"
		end

		query = query .. " WHERE `id` = " .. tmp:getDataInt("id")
		if(t[1] == "accept") then
			doGuildAddEnemy(guild, enemy, tmp:getDataInt("id"), WAR_GUILD)
			doGuildAddEnemy(enemy, guild, tmp:getDataInt("id"), WAR_ENEMY)
		end

		tmp:free()
		db.executeQuery(query)
		doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE)
		return true
	end

	if(t[1] == "invite") then
		local str = ""
                tmp = db.getResult("SELECT `guild_id`, `status` FROM `guild_wars` WHERE `guild_id` IN (" .. guild .. "," .. enemy .. ") AND `enemy_id` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)")
                if(tmp:getID() ~= -1) then
                        if(tmp:getDataInt("status") == 0) then
                                if(tmp:getDataInt("guild_id") == guild) then
                                        str = "You have already invited " .. enemyName .. " to war."
                                else
                                        str = enemyName .. " have already invited you to war."
                                end
			else
				str = "You are already on a war with " .. enemyName .. "."
			end

			tmp:free()
		end

		if(str ~= "") then
			doPlayerSendChannelMessage(cid, "", str, TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
			return true
		end

		local frags = tonumber(t[3])
		if(frags ~= nil) then
			frags = math.max(10, math.min(1000, frags))
		else
			frags = 100
		end

		local payment = tonumber(t[4])
		if(payment ~= nil) then
			payment = math.max(100000, math.min(1000000000, payment))
			tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild)

			local state = tmp:getID() < 0 or tmp:getDataInt("balance") < payment
			tmp:free()
			if(state) then
				doPlayerSendChannelMessage(cid, "", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
				return true
			end

			db.executeQuery("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild)
		else
			payment = 0
		end

		local begining, ending = os.time(), tonumber(t[5])
		if(ending ~= nil and ending ~= 0) then
			ending = begining + (ending * 86400)
		else
			ending = 0
		end

		db.executeQuery("INSERT INTO `guild_wars` (`guild_id`, `enemy_id`, `begin`, `end`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");")
		doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE)
		return true
	end

	if(not isInArray({"end", "finish"}, t[1])) then
		return false
	end

	local status = (t[1] == "end" and 1 or 4)
	tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status)
	if(tmp:getID() ~= -1) then
		local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id")
		tmp:free()
		doGuildRemoveEnemy(guild, enemy)
		doGuildRemoveEnemy(enemy, guild)

		db.executeQuery(query)
		doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 4 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE)
		return true
	end

	if(status == 4) then
		doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
		return true
	end

	tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1")
	if(tmp:getID() ~= -1) then
		if(tmp:getDataInt("end") > 0) then
			tmp:free()
			doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
			return true
		end

		 --render
		local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id")
		tmp:free()
		doGuildRemoveEnemy(guild, enemy)
		doGuildRemoveEnemy(enemy, guild)
		

		db.executeQuery(query)
		doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE)
		
		
		
		return true
	end

	doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
	return true
end

 


caso n tiver, creio que nao seja dificil é só pegar um pouco de lógica do código, utilize ctrl+F  e procure mais ou menos a frase que esta dizendo que não pdoe sair da guild pois deve ter um if por lá verificando.. ou algo assim.

os comandos usados.

/war invite, guild name, fraglimit                 Enviar convite para war.   Example: /war invite, Black Ninjas, 50</b> <br>

/war accept, guild name                                     Aceitar o convite da war. 
/war reject, guild name                                   Rejeitar o convite da war. 
/war end, guild name                                Acabar com uma war ativa. 
/war cancel, guild name                           Cancelar um convite enviado. 
 

 

Continua mostrando que o player esta em guerra quando tendo sair da guild. Me ajuda ae!! Quero que aparece os escudinhos.

Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.

Link para o post
Compartilhar em outros sites
  • 7 months later...

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por FeeTads
      Salve rapaziada do  TK e da comunidade de tibia Otserv.

      Recentemente alguns invejosos estão atacando servidores (DDoS), bugando o guilds de varios sites (tirando o lider e membros), assim buga a guild e muita coisa no OT.
      Eles vão até o teu servidor e se passam por "adm do deletebra", já ouvi a uns tempos algumas pessoas falando disso, mas como eu tinha contato isso caiu por terra facilmente, um deles foi o ADM brendo, dono do antigo strongerFusion, onde ele me contou toda essa história, essa foi a primeira vez que me foi relatado sobre isso, hoje vejo que está parecendo ser mais frequente.

      Caso qualquer pessoa entre no seu OT se passando pelo ADM do deletebra, favor entrar em contato comigo via discord: FeeTads#0246 Te ajudarei a resolver problemas que eles exploram sem cobrar nada por isso, para provar que não necessito atacar outros OT's para ter algum publico. Já tenho em mente quem pode ser essas pessoas, caso alguém tenha numero de telefone, nome real, ou alguma informação a mais dessas pessoas atacando e se passando por mim ou meu sócio, favor enviar no discord, irei atrás de resolver isso.

      Vou deixar aqui alguns tutoriais de coisas básicas para você conseguir proteger o seu site desses SQL injections, e mais algumas coisinhas, caso futuramente eu resolva outros bugs explorados, vou postar aqui as correções.


      Configurando CloudFlare (SSL) E subDominio (sv.seuIP)
       
      Após isso para que a pessoa não entre no site pelo (sv.seudominio.com.br) 
      abra o index.php da pasta raiz (está dentro da pasta html)
       
      if($_SERVER['HTTP_HOST'] == 'sv.seuDominio.com.br') { header("Location: https://seuDominio.com.br"); } if($_SERVER['HTTP_HOST'] == 'IP NUMÉRICO') { header("Location: https://seuDominio.com.br"); }
      Isso fará que quando a pessoa tente entrar no seu site usando meios não seguros (DNS only) ele redirecione pro seguro > proxiado pela cloudflare

      _________________________________________________________________________________________________________________________________________


      CORREÇÃO GUILDS.PHP / INJECTION SQL TIRANDO LIDER DA GUILD
       

      PROTEÇÕES PARA DIMINUIR EFEITOS DE DDoS
       
       
       
      Espero que isso ajude a muitos, a se prevenir de pessoas que tentam atacar OT's se passando por outros, ou até que vão la pedir pontos para jogar se não eles irão atacar, se prevenir de pessoas mal intencionadas.

      PS: Caso você tenha no seu site a pagine "house" e "tickets" recomendo retirar do seu site, pois há maneira de injetar SQL por esses arquivos.
      Vou postar em breve o tickets arrumado.

      Boa sorte rapaziada, se cuidem, e caso alguém faça isso, por favor entre em contato comigo.
       
       
       
       
    • Por tataboy67
      Opa boa noite rapaziada, tudo bom?
       
      Eu estou treinando um pouco scripts e acabei que tendo a ideia de fazer algo relacionado com as Guilds.
      Então resolvi trazer 1 sistema de Guild Dungeon Lever para mim treinar  

      Estou em fase de treinamento, então por favor, deem dicas e criticas ao sistema ! Obrigado ...

      Como o sistema funciona?

      Terá uma alavanca com local para os jogadores de sua Guild ficarem... O jogador que estiver na posição principal e próxima a alavanca irá clicar na alavanca que fará com que todos entrem na Dungeon. Os jogadores terão um tempo "x" para terminar, porém se o tempo acabar, o jogador será teleportado de volta para a posição principal da alavanca (Aonde o jogador clicou).



      Como configurar o script?
      local config = { time = 10, -- 1 Second. (1*60 To Minutes) level = 100, -- Level Necessary. dungeonPos = Position(1454, 909, 7), -- Dungeon Pos. needPos = { [1] = Position(1447, 915, 7), -- Position (where the player will click on the lever) and back position. [2] = Position(1449, 914, 7) }, fromPos = {x = 1449, y = 904, z = 7}, -- Position /\ < from the dungeon toPos = {x = 1456, y = 911, z = 7}, -- Position \/ > from the dungeon Storagetime = 39320, -- Storage Time. StorageDay = 39321, -- Storage Day. Timer = 24*60*60 -- To re-enter in the dungeon. (24hours) } time ------------------ Tempo que os jogadores ficarão dentro da Dungeon.
      level ----------------- Nível que todos precisam ser para entrar.
      dungeonPos ------ Posição que todos os jogadores serão teleportados.
      needPos ------------ Posição que os jogadores devem estar para serem teleportados.
      fromPos ------------- Posição SUPERIOR ESQUERDO da sala.
      toPos ----------------- Posição INFERIOR DIREITO da sala.
      Storagetime -------- Não mexer se não souber.
      StorageDay ----------- Não mexer se não souber.
      Timer ------------------ Tempo que o jogador terá que esperar para entrar novamente na Dungeon.
       
       

      Sem mais delongas, vamos ao script:
      Adicione a linha em:
      (data/actions/actions.xml)
      <!-- Script GUILD --> <action actionid="29305" script="Dungeon_Guild.lua" />  
      Adicione a linha em:
      (data/actions/scripts/Dungeon_Guild.lua)
      local config = { time = 5, -- 1 Second. (1*60 To Minutes) inside the dungeon. level = 100, -- Level Necessary. dungeonPos = Position(1454, 909, 7), -- Dungeon Pos. needPos = { [1] = Position(1447, 915, 7), -- Position (where the player will click on the lever) and back position. [2] = Position(1449, 914, 7) }, fromPos = {x = 1449, y = 904, z = 7}, -- Position /\ < from the dungeon toPos = {x = 1456, y = 911, z = 7}, -- Position \/ > from the dungeon Storagetime = 39320, -- Storage Time. StorageDay = 39321, -- Storage Day. Timer = 24*60*60 -- To re-enter in the dungeon. (24hrs) } function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey) local guild = player:getGuild() for i = 1, #config.needPos do local playerTile = Tile(config.needPos[i]):getTopCreature() if not playerTile or not playerTile:isPlayer() then player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "You need 2 players and stay on the orange floor.") return true end if not playerTile:getGuild() and not player:getGuild() then player:getPosition():sendMagicEffect(CONST_ME_POFF) return player:sendTextMessage(MESSAGE_STATUS_SMALL, "One of the members does not have guild.") end if playerTile:getLevel() < config.level then player:getPosition():sendMagicEffect(CONST_ME_POFF) return player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level "..config.level.." or higher.") end if player:getGuild():getId() ~= playerTile:getGuild():getId() then player:getPosition():sendMagicEffect(CONST_ME_POFF) return player:sendTextMessage(MESSAGE_STATUS_SMALL, "Only players in your guild can join you.") end if player:getStorageValue(config.Storagetime) - os.time() > 0 and playerTile:getStorageValue(config.Storagetime) - os.time() > 0 then player:getPosition():sendMagicEffect(CONST_ME_POFF) return false end if player:getStorageValue(config.StorageDay) - os.time() > 0 and playerTile:getStorageValue(config.StorageDay) - os.time() > 0 then player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You're in cooldown to enter in a dungeon again. Cooldown: %s.", string.diff(player:getStorageValue(config.StorageDay)-os.time()))) return false end local players = {} for x = config.fromPos.x, config.toPos.x do for y = config.fromPos.y, config.toPos.y do for z = config.fromPos.z, config.toPos.z do local tile = Tile(x, y, z) local creature = tile:getTopCreature() if creature and creature:isPlayer() then players[#players+1] = creature end end end end if #players > 0 then player:getPosition():sendMagicEffect(CONST_ME_POFF) return player:sendTextMessage(MESSAGE_STATUS_SMALL, "Already has a guild inside.") end player:teleportTo(config.dungeonPos) playerTile:teleportTo(config.dungeonPos) playerTile:getPosition():sendMagicEffect(50) addEvent(function() player:teleportTo(config.needPos[i]) playerTile:teleportTo(config.needPos[i]) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) playerTile:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) player:setStorageValue(config.StorageDay, os.time() + config.Timer) playerTile:setStorageValue(config.StorageDay, os.time() + config.Timer) end, config.time*1000) return false end return true end
      Créditos:
      @KotZletY
      E eu  

      Espero que gostem ? ...

      Edit* Adicionado Tempo para que você possa entrar novamente na Dungeon:


      Rep+
    • Por Yan Liima
      Limite máximo de players em guild WEBSITE ?

       
      Bom, decidi postar essa modificação que fiz a muito tempo, pois vi que bastante gente queria
      Para Modern AAC e vi que ninguém soube ajudar. Como é algo bem simples e ta parado aqui faz tempo
      Decidi disponibilizar. Não só para Modern, mas para Gesior também!
      Estarei disponibilizando de duas maneiras:
      1º Será um valor configurado no proprio config.php, onde determinará o limite máximo de todas as guild.
      2º A verificação será feita por DB, onde terá um valor padrão para cada guilda criada, podendo ser alterado o valor de membros maximo.
      Ou seja, a guilda número UM pode ter máximo de 50 players, e a guilda número DOIS pode ter o máximo de 100.
      Vocês pode ser criativos e vender items que aumenta o limite ou fazer eventos/sorteios para aumentar...

       
      Enfim, vamos lá...
      Primeira maneira:
      Modern AAC:
      Gesior:
       
      Segunda maneira:
       
      Modern AAC:
      Gesior:
       
      Prontinho galera!!!
      Caso queiram para cmd in-game: LINK
    • Por eric77
      Galera! estou precisando de ajuda mesmo..

      Eu tou trabalhando no meu server já a um tempo, e agr me deparei com um erro na talkaction do meu war system...

      Tá tudo ok no war system menos isso, na hora de falar "/war" não acontece nada.. o player fala o comando, aparece apenas como uma fala comum e mais nada.

      Porque ?? eu vi outro tópico aqui no TK e o que disseram foi que a Distro não suportava o war system..

      Então achei outra distro aqui no TK com war system, baixei mas continua tudo igual.... a talkaction não funciona do mesmo jeito.

      Link da distro que baixei: Distro tfs 0.4 (ANTI-DV) (WARSYSTEM)

      Editado: Baixei outra distro disponivel aqui no site para testar e nada de diferença, será que é a distro mesmo ? link : Distro TFS 0.4 (segunda tentativa)

      Meu war.lua:




      É isso ai pessoal... porfavor me ajudem, mesmo que seja um problema que não dê pra resolver, me deem uma luz explicando o porque pelo menos!!

      Agradeço desde já, quem resolver essa bronca pra mim é REP+ na hora..

      Valeu!!
    • Por Raziel Frehley
      Olá, estou com um problema no evento "Castle war 24hrs"...
      A guild entra no teleport que leva pro castelo e o domina, porém aqui no tutorial não fala nada sobre um portal que seria necessario para que a guild dona do castelo pudesse entrar sem ter que passar por todo o caminho dos monstros de novo...
      Alguem tem alguma solução? Desde já agradeço!


      Segue o link do script: http://www.tibiaking.com/forum/topic/35731-castle-war-24h-conquiste-o-trono/
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo