Ir para conteúdo
  • Cadastre-se

Suporte Resolver bug war sobrevivência


Posts Recomendados

Posta o SEU city war.lua e citywarMovements.lua como implementou no seu servidor por favor

                                                                                                               destinyshield.gif.9f031b59b026058f32a1c50da92ebe2a.gif  mídias sociais  destinyshield.gif.02fca81ab0615e050b2bcefd8a73a2e8.gif

                                                                                                                            talk to me              

                                                                                                                               vídeos           

                                                                                             

                                                                                                            LOGONORMAL.png.815b40b04ec583be88d8a1e2626fe430.png

                                                                                                           

                               

Link para o post
Compartilhar em outros sites
5 horas atrás, Rogex Joyz disse:

Posta o SEU city war.lua e citywarMovements.lua como implementou no seu servidor por favor

Citar

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition)

if isPlayer(cid) and getGlobalStorageValue(configCW.stats) == 1 then
    doTeleportThing(cid, configCW.arenapos[math.random(1, #configCW.arenapos)])
    doSendMagicEffect(getPlayerPosition(cid), 28)
    if not(configCW:isPlayerInEvent(cid)) then
        setPlayerStorageValue(cid, configCW.stats, getGlobalStorageValue(configCW.ostime) + configCW.evttime*60 + configCW.finaltime)
        setPlayerStorageValue(cid, configCW.kill, -1)
        setPlayerStorageValue(cid, configCW.death, -1)
    end
else
    doTeleportThing(cid, fromPosition)
end

return true
end

Citar

<movevent type="StepIn" actionid="5540" event="script" value="citywarMovements.lua"/>

 

Link para o post
Compartilhar em outros sites

cade o citywar.lua?

                                                                                                               destinyshield.gif.9f031b59b026058f32a1c50da92ebe2a.gif  mídias sociais  destinyshield.gif.02fca81ab0615e050b2bcefd8a73a2e8.gif

                                                                                                                            talk to me              

                                                                                                                               vídeos           

                                                                                             

                                                                                                            LOGONORMAL.png.815b40b04ec583be88d8a1e2626fe430.png

                                                                                                           

                               

Link para o post
Compartilhar em outros sites
3 horas atrás, Rogex Joyz disse:

cade o citywar.lua?

Citar

Lib


 


configCW = {timetostart = 500, -- tempo para iniciar o evento em segundos by Absolute
			telpos = {x=32340, y=32213, z=7}, -- onde aparecerá o teleport
			stats = 201201201701,
			kill = 201201201702,
			death = 201201201703,
			ostime =  201201201704,
			evttime = 20, -- quanto tempo irá rolar o evento
			topleftPos = {x=32722, y=31336, z=6}, -- canto esquerdo superior
			botrightPos = {x=32791, y=31384, z=6}, -- canto direito inferior
			templepos = {x=32369, y=32241, z=7}, -- posição do templo principal
			arenapos = {{x=32722, y=31340, z=6}, {x=32786, y=31336, z=6}, {x=32722, y=31380, z=6}, {x=32783, y=31374, z=6}}, -- posição dos 4 tronos
			times = 8, -- não precisa mexer
			finaltime = 300 -- não precisa mexer
}

function configCW:new()

local newevt = {}

setmetatable(newevt, self)
self.__index = self

doBroadcastMessage("The City War will be open in " .. self.timetostart .. " seconds.")
setGlobalStorageValue(self.stats, 0)
addEvent(function () newevt:start() end, self.timetostart*1000)
end

function configCW:start()

if getGlobalStorageValue(self.stats) == 0 then
	setGlobalStorageValue(self.ostime, os.time())
	local teleport = doCreateItem(1387, self.telpos)
	doItemSetAttribute(teleport, "aid", 5540)
	setGlobalStorageValue(self.stats, 1)
	doBroadcastMessage("The City War is starting...")
	for _, posi in pairs(self.arenapos) do
		local item = getTileItemById(posi, 1387)
		if(item.uid ~= 0) then
			doRemoveItem(item.uid)
		end
	end
	addEvent(function () self:preclose() end, self.evttime*1000*60)
	addEvent(function () self:announce(0) end, (self.evttime/self.times)*1000*60)
end

end

function configCW:announce(times)

if times < self.times then
	if #self:getTopFrags(true) >= 1 then 
		doBroadcastMessage("Top City War fraggers: " .. self:getTopFrags())
	end
	addEvent(function () self:announce(times+1) end, (self.evttime/self.times)*1000*60)
end

end

function configCW:preclose()

if getGlobalStorageValue(self.stats) == 1 then
	setGlobalStorageValue(self.stats, 2)
	doBroadcastMessage("The City War will end in " .. self.finaltime .. " seconds.")
	addEvent(function () self:close() end, self.finaltime*1000)
	local item = getTileItemById(self.telpos, 1387)
	if(item.uid ~= 0) then
		doRemoveItem(item.uid)
	end
end

end

function configCW:close()

if getGlobalStorageValue(self.stats) == 2 then
	if #self:getTopFrags(true) >= 1 then
		doBroadcastMessage("The City War has ended. The winners are: " .. self:getTopFrags())
	else
		doBroadcastMessage("The City War has ended. There were no winners.")
	end
	doRemovePlayersFromArea(self.topleftPos, self.botrightPos, self.templepos)
	for _, posi in pairs(self.arenapos) do
		doCreateTeleport(1387, self.templepos, posi)
	end
	for place, info in ipairs(self:getTopFrags(true)) do
		if place > 5 then
			break
		end
		local cid = getPlayerByName(info)
		doPlayerSendTextMessage(cid, 4, "Congratulations, you were the " .. place .. "º place in the City War.")
		doPlayerAddItem(cid, 6571, 1)
	end
	setGlobalStorageValue(self.stats, -1)
end

end

function configCW:isPlayerInEvent(cid)

if getPlayerStorageValue(cid, self.stats) == -1 or getPlayerStorageValue(cid, self.stats) - os.time() <= -5 or getGlobalStorageValue(self.stats) < 1 then
	return false
end

return true
end

function configCW:getTopFrags(tab)

local frag = {}

for _, pid in pairs(getPlayersOnline()) do
	if (getPlayerStorageValue(pid, self.kill) ~= -1 or getPlayerStorageValue(pid, self.death) ~= -1) and self:isPlayerInEvent(pid) then
		local kill =  getPlayerStorageValue(pid, self.kill)+1
		local death =  getPlayerStorageValue(pid, self.death)+1
		print(getCreatureName(pid), kill-death)
		table.insert(frag, {getCreatureName(pid), kill-death})
	end
end

print(#frag)
local frag, str, n = doOrderTab(frag, 0), nil, 5
print(#frag)

if tab then
	return frag
else
	if #frag < 5 then
		n = #frag
	end
	for i = 1, n do
		local cid = getPlayerByName(frag[i])
		local kill =  getPlayerStorageValue(cid, self.kill)+1
		local death =  getPlayerStorageValue(cid, self.death)+1
		str = str and str .. ", " .. frag[i] .. "[" .. kill .. "/" .. death .. "]" or frag[i] .. "[" .. kill .. "/" .. death .. "]"
	end
end

return str
end

function doOrderTab(tabela, value)

local max, index = {}, nil

for i = 1, #tabela do
	valor = value
	for a, b in ipairs(tabela) do
		if b[2] > valor then
			valor = b[2]
			valor2 = b[1]
			index = a
		end
	end
	table.remove(tabela, index)
	if valor ~= value then
		table.insert(max, valor2)
	end
end

return max
end
Citar

Creature


 


function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

if isInRange(getCreaturePosition(cid), configCW.topleftPos, configCW.botrightPos) then
	setPlayerStorageValue(cid, configCW.death, getPlayerStorageValue(cid, configCW.death) +1)
	setPlayerStorageValue(lastHitKiller[1], configCW.kill, getPlayerStorageValue(lastHitKiller[1], configCW.kill) +1)
end

return true
end
Citar

Movemments

 


function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition)

if isPlayer(cid) and getGlobalStorageValue(configCW.stats) == 1 then
	doTeleportThing(cid, configCW.arenapos[math.random(1, #configCW.arenapos)])
	doSendMagicEffect(getPlayerPosition(cid), 28)
	if not(configCW:isPlayerInEvent(cid)) then
		setPlayerStorageValue(cid, configCW.stats, getGlobalStorageValue(configCW.ostime) + configCW.evttime*60 + configCW.finaltime)
		setPlayerStorageValue(cid, configCW.kill, -1)
		setPlayerStorageValue(cid, configCW.death, -1)
	end
else
	doTeleportThing(cid, fromPosition)
end

return true
end
Citar

talkactions

 


function onSay(cid, words, param)

if getGlobalStorageValue(configCW.stats) == -1 then
	configCW:new()
else
	doPlayerSendCancel(cid, "The event is already running.")
end

return true
end

 

Link para o post
Compartilhar em outros sites

tenta adicionar na lib:

 

function doRemovePlayersFromArea(from, to, pos)
	for _, pid in pairs(getPlayersOnline()) do
		if isInRange(getPlayerPosition(pid), from, to) then 
			doTeleportThing(pid, pos)
		end
	end
end

 

vodkart_logo.png

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

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
Em 26/08/2021 em 15:17, Vodkart disse:

tenta adicionar na lib:

 


function doRemovePlayersFromArea(from, to, pos)
	for _, pid in pairs(getPlayersOnline()) do
		if isInRange(getPlayerPosition(pid), from, to) then 
			doTeleportThing(pid, pos)
		end
	end
end

 

Fiz oq vc disse, apareceu uns tp.
Mas o problema e nao ta tendo ganhador, testei e casa e pedir pra uns plays entrar pra testar e nada man =[

Erro: 16:04 The City War has ended. There were no winners.

Link para o post
Compartilhar em outros sites

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 braianlomas
      Como faço para corrigir esse problema para meu cliente, eu uso o tfs 0.3.6  
      Quero resolver esse problema que tenho no meu cliente, como e onde posso resolver?  
      Eu uso o tfs 0.3.6, não tenho as fontes do cliente, se você puder me dar eu vou amá-las para sempre  
       

       
    • Por A.Mokk
      Ola pessoal, estou tentando compilar o TFS 1.5 Downgrade para 8.60 atraves do MSVC 2022, ao tentar compilar da o seguinte erro:
       
       
      Fiz o download do MSVC, GitDash, TFS-SDK-3.2, e de varios boosts que tentei, ao fazer o seguinte procedimento no GitDash:
       
      Ao chegar em ./bootstrap-vcpkg.bat o GitDash nao consegue realizar o procedimento corretamente, alguem poderia me ajudar ?

      Tentei de diversas formas mas o mesmo erro sempre persiste, atualmente meu servidor utiliza TFS 0.4, consigo compilar sem nenhum problema no MSVC 2010, porem, as limitações do TFS 0.4 estão me fazendo precisar atualizar, se alguem souber como corrigir esses erros eu agradeço !

      Tutoriais utilizados :
      Compiling on Windows (vcpkg) · otland/forgottenserver Wiki · GitHub
      Compiling on Windows · otland/forgottenserver Wiki · GitHub
      Compilando TFS 1.3 com vídeo-aula - Tutoriais Infraestrutura & Proteção - Tibia King - Tudo sobre Tibia, OTServ e Bots!
      Compilar TFS 1.3 Vcpkg - Tutoriais Infraestrutura & Proteção - Tibia King - Tudo sobre Tibia, OTServ e Bots!
       
      O que acontece no Powershell:
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      Canary 2.3.6
      Qual o motivo deste tópico? 
      Queria fazer com que os players não pudessem mexer no aleta sio, pois, agora os mesmos estão conseguindo mexer nos itens
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      canary para o cliente 13.16
      Qual o motivo deste tópico? 
      Não consigo encontrar onde ajusta
      to com o problema no 13.16  o exausted, por exemplo os kinas era pra combar exori, erori gran e exori min, porém não ta indo ta dando exausted o char ta soltando magia ou runa e não consegue usar as potions
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por Andersontatuador
      Olá galera da TK, me chamo Anderson estou procurando alguém profissional em otservs e site.
      Já tenho um servidor o site e o cliente preciso só de uma pessoal competente, que esteja empenhado a trabalhar,
      não quero nada de graça, pois nessa onda fui mais roubado do quer eu pagar um profissional.
      caso alguém se interesse entrar em contato comigo através do whatsapp
      82 9 9304-9462
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo