Ir para conteúdo
  • Cadastre-se

Suporte Spell - caster não tomar dano.


Posts Recomendados

.Qual servidor ou website você utiliza como base? 

Otx 8.60

Qual o motivo deste tópico? 

eu tenho uma magia em area que por x tempo ele da 5% de dano da vida maxima ao redor dele por segundo. mas quando o caster anda, ele passa a receber o dano tbm. como eu posso arrumar isso? gostariaque quem conjurou a spell n tomasse dano.


 

Spoiler

 

Você tem o código disponível? Se tiver publique-o aqui: 


 local config = {
    wallArea = {
        {1, 1, 1}, 
        {1, 2, 1},
        {1, 1, 1},
    },
    time = 3,              --Duração da parede.
    cooldown = {60, 10},   --{sucessCooldown, failCooldown},
    chance = 100,           --Chance da spell funcionar.
    storage = 115822,
}

function isWilksble(pos, creature, proj, pz)-- by Nord
    if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
    --if getTopCreature(pos).uid > 0 and creature then return false end
    if getTileInfo(pos).protection and pz then return false, true end
    local n = not proj and 3 or 2
    for i = 0, 255 do
        pos.stackpos = i
        local tile = getTileThingByPos(pos)
        if tile.itemid ~= 0 and not isCreature(tile.uid) then
            if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                return false
            end
        end
    end
    return true
end
function getPosfromArea(cid, area)    --by Dokmos
    icenter = math.floor(table.getn(area)/2)+1
    jcenter = math.floor(table.getn(area[1])/2)+1
    center = area[icenter]
    ivar = table.getn(area)
    jvar = table.getn(area[1])
    i = table.getn(area)^2
    j = table.getn(area[1])^2
    local mydir = isCreature(getCreatureTarget(cid)) or getCreatureLookDir(cid)
    setPlayerStorageValue(cid, 21101, -1)
    if center[jcenter] == 3 then
        if mydir == 0 then
            signal = {-1,1,1,2}
        elseif mydir == 1 then
            signal = {1,-1,2,1}
        elseif mydir == 2 then
            signal = {1,-1,1,2}
        elseif mydir == 3 then
            signal = {-1,1,2,1}
        end
    else
        signal = {-1,1,1,2}
    end
    POSITIONS = {}  
    P = 0      
    repeat
        pvar = {0,0}
        I = area[ivar]
        J = I[jvar]
        i = i-1
        j = j-1
        if J == 1 then
            if jvar < jcenter then  
                pvar[signal[3]] = signal[1]*math.abs((jcenter-jvar)) 
            elseif jvar > jcenter then  
                pvar[signal[3]] = signal[2]*math.abs((jcenter-jvar)) 
            end             
            if ivar < icenter then  
                pvar[signal[4]] = signal[1]*math.abs((icenter-ivar)) 
            elseif ivar > icenter then
                pvar[signal[4]] = signal[2]*math.abs((icenter-ivar))
            end
        end    
        if jvar > 1 then
            jvar = (jvar-1)
        elseif ivar > 1 then
            jvar = table.getn(area[1])
            ivar = (ivar-1)
        end  
        local pos = getThingPos(cid)
        local areapos = {x=pos.x+(pvar[1]),y=pos.y+(pvar[2]),z=pos.z}  
        if pos.x ~= areapos.x or pos.y ~= areapos.y then
            P = P+1
            POSITIONS[P] = areapos
        end  
    until i <= 0 and j <= 0
    return POSITIONS
end
function onCastSpell(cid)
if isPlayer(cid) and getPlayerAccess(cid) < 3 and getPlayerStorageValue(cid, 115822)-os.time() > 1 then
local seetime = getPlayerStorageValue(cid, 115822)-os.time()
local minutes, seconds = math.floor(seetime/60), math.floor(seetime%60)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde "..minutes.." minuto(s) e "..seconds.." segundo(s) para usar novamente!")
return false
end
        if math.random(1, 100) > config.chance then
            doPlayerSendCancel(cid, "Your spell failed.")
            doSendAnimatedText(getThingPos(cid), "FAIL!", 215)
            setPlayerStorageValue(cid, config.storage, os.time() + config.cooldown[2])
        else
            local positions = {}
            setPlayerStorageValue(cid, config.storage, os.time() + config.cooldown[1])
            for _, pos in pairs(getPosfromArea(cid, config.wallArea)) do
                if isWilksble(pos) and not getTileInfo(pos).protection then
                    table.insert(positions, pos)
                end
            end
	    
	    	for k = 1, 25 do
				addEvent(function()
					if isCreature(cid) then
						local pos1 = {x = getPlayerPosition(cid).x + 1, y = getPlayerPosition(cid).y + 1, z = getPlayerPosition(cid).z}
						doSendMagicEffect(pos1, 121)
					end
				end, 1 + ((k-1) * 500))
			end

			for k = 1, 25 do
            if #positions > 0 then
                addEvent(function()
                    for i = 1, #positions do
						local creature = getTopCreature({x = positions[i].x, y = positions[i].y, z = positions[i].z})
						if isPlayer(creature.uid) and creature.uid ~= 0 then
							vida = getCreatureMaxHealth(creature.uid)*0.05
							local posalvo = getCreaturePosition(creature.uid)
							doSendAnimatedText(posalvo, "- 5%." , TEXTCOLOR_RED)	
							doCreatureAddHealth(creature.uid, -vida)
                        end
                    end
                end, 1 + ((k-1) * 500))
            end
            end
        end
    return true
end

 


 

 

Spoiler

	<instant name="Jashin Ni Course" words="Jashin Ni Course" maglv="10" lvl="200" mana="2000" prem="0" exhaustion="0" needlearn="0" script="especial/jashin ni course.lua">
	</instant>

 

 

Link para o post
Compartilhar em outros sites

@elielder

 

Testa ae:

 

Spoiler

 local config = {
    wallArea = {
        {1, 1, 1}, 
        {1, 2, 1},
        {1, 1, 1},
    },
    time = 3,              --Duração da parede.
    cooldown = {60, 10},   --{sucessCooldown, failCooldown},
    chance = 100,           --Chance da spell funcionar.
    storage = 115822,
}

function isWalkable(pos, creature, proj, pz)-- by Nord
    if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
    --if getTopCreature(pos).uid > 0 and creature then return false end
    if getTileInfo(pos).protection and pz then return false, true end
    local n = not proj and 3 or 2
    for i = 0, 255 do
        pos.stackpos = i
        local tile = getTileThingByPos(pos)
        if tile.itemid ~= 0 and not isCreature(tile.uid) then
            if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                return false
            end
        end
    end
    return true
end
function getPosfromArea(cid, area)    --by Dokmos
    icenter = math.floor(table.getn(area)/2)+1
    jcenter = math.floor(table.getn(area[1])/2)+1
    center = area[icenter]
    ivar = table.getn(area)
    jvar = table.getn(area[1])
    i = table.getn(area)^2
    j = table.getn(area[1])^2
    local mydir = isCreature(getCreatureTarget(cid)) or getCreatureLookDir(cid)
    setPlayerStorageValue(cid, 21101, -1)
    if center[jcenter] == 3 then
        if mydir == 0 then
            signal = {-1,1,1,2}
        elseif mydir == 1 then
            signal = {1,-1,2,1}
        elseif mydir == 2 then
            signal = {1,-1,1,2}
        elseif mydir == 3 then
            signal = {-1,1,2,1}
        end
    else
        signal = {-1,1,1,2}
    end
    POSITIONS = {}  
    P = 0      
    repeat
        pvar = {0,0}
        I = area[ivar]
        J = I[jvar]
        i = i-1
        j = j-1
        if J == 1 then
            if jvar < jcenter then  
                pvar[signal[3]] = signal[1]*math.abs((jcenter-jvar)) 
            elseif jvar > jcenter then  
                pvar[signal[3]] = signal[2]*math.abs((jcenter-jvar)) 
            end             
            if ivar < icenter then  
                pvar[signal[4]] = signal[1]*math.abs((icenter-ivar)) 
            elseif ivar > icenter then
                pvar[signal[4]] = signal[2]*math.abs((icenter-ivar))
            end
        end    
        if jvar > 1 then
            jvar = (jvar-1)
        elseif ivar > 1 then
            jvar = table.getn(area[1])
            ivar = (ivar-1)
        end  
        local pos = getThingPos(cid)
        local areapos = {x=pos.x+(pvar[1]),y=pos.y+(pvar[2]),z=pos.z}  
        if pos.x ~= areapos.x or pos.y ~= areapos.y then
            P = P+1
            POSITIONS[P] = areapos
        end  
    until i <= 0 and j <= 0
    return POSITIONS
end
function onCastSpell(cid)
if isPlayer(cid) and getPlayerAccess(cid) < 3 and getPlayerStorageValue(cid, 115822)-os.time() > 1 then
local seetime = getPlayerStorageValue(cid, 115822)-os.time()
local minutes, seconds = math.floor(seetime/60), math.floor(seetime%60)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde "..minutes.." minuto(s) e "..seconds.." segundo(s) para usar novamente!")
return false
end
        if math.random(1, 100) > config.chance then
            doPlayerSendCancel(cid, "Your spell failed.")
            doSendAnimatedText(getThingPos(cid), "FAIL!", 215)
            setPlayerStorageValue(cid, config.storage, os.time() + config.cooldown[2])
        else
            local positions = {}
            setPlayerStorageValue(cid, config.storage, os.time() + config.cooldown[1])
            for _, pos in pairs(getPosfromArea(cid, config.wallArea)) do
                if isWalkable(pos) and not getTileInfo(pos).protection then
                    table.insert(positions, pos)
                end
            end
	    
	    	for k = 1, 25 do
				addEvent(function()
					if isCreature(cid) then
						local pos1 = {x = getPlayerPosition(cid).x + 1, y = getPlayerPosition(cid).y + 1, z = getPlayerPosition(cid).z}
						doSendMagicEffect(pos1, 121)
					end
				end, 1 + ((k-1) * 500))
			end

			for k = 1, 25 do
            if #positions > 0 then
                addEvent(function()
                    for i = 1, #positions do
						local creature = getTopCreature({x = positions[i].x, y = positions[i].y, z = positions[i].z})
						if isPlayer(creature.uid) and creature.uid ~= 0 then
							vida = getCreatureMaxHealth(creature.uid)*0.05
							local posalvo = getCreaturePosition(creature.uid)
							doSendAnimatedText(posalvo, "- 5%." , TEXTCOLOR_RED)	
							doCreatureAddHealth(creature.uid, -vida)
                        end
                    end
                end, 1 + ((k-1) * 500))
            end
            end
        end
    return true
end

 

 

Não Testei!

Conteúdos Tragos Por Mim ao Fórum:

Venda de Vocações [Modern Aac] •

• Comando !Saga 

• [Modern Aac] DragonBall 

• Esconder •

• Naruto 2018

• • •

• •

'NtoProject - Breve'

[Show OFF] Disponível

Link para o post
Compartilhar em outros sites
Spoiler

 

18 horas atrás, D i M i T r E s C u disse:

@elielder

 

Testa ae:

 

  Ocultar conteúdo



 local config = {
    wallArea = {
        {1, 1, 1}, 
        {1, 2, 1},
        {1, 1, 1},
    },
    time = 3,              --Duração da parede.
    cooldown = {60, 10},   --{sucessCooldown, failCooldown},
    chance = 100,           --Chance da spell funcionar.
    storage = 115822,
}

function isWalkable(pos, creature, proj, pz)-- by Nord
    if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
    --if getTopCreature(pos).uid > 0 and creature then return false end
    if getTileInfo(pos).protection and pz then return false, true end
    local n = not proj and 3 or 2
    for i = 0, 255 do
        pos.stackpos = i
        local tile = getTileThingByPos(pos)
        if tile.itemid ~= 0 and not isCreature(tile.uid) then
            if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                return false
            end
        end
    end
    return true
end
function getPosfromArea(cid, area)    --by Dokmos
    icenter = math.floor(table.getn(area)/2)+1
    jcenter = math.floor(table.getn(area[1])/2)+1
    center = area[icenter]
    ivar = table.getn(area)
    jvar = table.getn(area[1])
    i = table.getn(area)^2
    j = table.getn(area[1])^2
    local mydir = isCreature(getCreatureTarget(cid)) or getCreatureLookDir(cid)
    setPlayerStorageValue(cid, 21101, -1)
    if center[jcenter] == 3 then
        if mydir == 0 then
            signal = {-1,1,1,2}
        elseif mydir == 1 then
            signal = {1,-1,2,1}
        elseif mydir == 2 then
            signal = {1,-1,1,2}
        elseif mydir == 3 then
            signal = {-1,1,2,1}
        end
    else
        signal = {-1,1,1,2}
    end
    POSITIONS = {}  
    P = 0      
    repeat
        pvar = {0,0}
        I = area[ivar]
        J = I[jvar]
        i = i-1
        j = j-1
        if J == 1 then
            if jvar < jcenter then  
                pvar[signal[3]] = signal[1]*math.abs((jcenter-jvar)) 
            elseif jvar > jcenter then  
                pvar[signal[3]] = signal[2]*math.abs((jcenter-jvar)) 
            end             
            if ivar < icenter then  
                pvar[signal[4]] = signal[1]*math.abs((icenter-ivar)) 
            elseif ivar > icenter then
                pvar[signal[4]] = signal[2]*math.abs((icenter-ivar))
            end
        end    
        if jvar > 1 then
            jvar = (jvar-1)
        elseif ivar > 1 then
            jvar = table.getn(area[1])
            ivar = (ivar-1)
        end  
        local pos = getThingPos(cid)
        local areapos = {x=pos.x+(pvar[1]),y=pos.y+(pvar[2]),z=pos.z}  
        if pos.x ~= areapos.x or pos.y ~= areapos.y then
            P = P+1
            POSITIONS[P] = areapos
        end  
    until i <= 0 and j <= 0
    return POSITIONS
end
function onCastSpell(cid)
if isPlayer(cid) and getPlayerAccess(cid) < 3 and getPlayerStorageValue(cid, 115822)-os.time() > 1 then
local seetime = getPlayerStorageValue(cid, 115822)-os.time()
local minutes, seconds = math.floor(seetime/60), math.floor(seetime%60)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde "..minutes.." minuto(s) e "..seconds.." segundo(s) para usar novamente!")
return false
end
        if math.random(1, 100) > config.chance then
            doPlayerSendCancel(cid, "Your spell failed.")
            doSendAnimatedText(getThingPos(cid), "FAIL!", 215)
            setPlayerStorageValue(cid, config.storage, os.time() + config.cooldown[2])
        else
            local positions = {}
            setPlayerStorageValue(cid, config.storage, os.time() + config.cooldown[1])
            for _, pos in pairs(getPosfromArea(cid, config.wallArea)) do
                if isWalkable(pos) and not getTileInfo(pos).protection then
                    table.insert(positions, pos)
                end
            end
	    
	    	for k = 1, 25 do
				addEvent(function()
					if isCreature(cid) then
						local pos1 = {x = getPlayerPosition(cid).x + 1, y = getPlayerPosition(cid).y + 1, z = getPlayerPosition(cid).z}
						doSendMagicEffect(pos1, 121)
					end
				end, 1 + ((k-1) * 500))
			end

			for k = 1, 25 do
            if #positions > 0 then
                addEvent(function()
                    for i = 1, #positions do
						local creature = getTopCreature({x = positions[i].x, y = positions[i].y, z = positions[i].z})
						if isPlayer(creature.uid) and creature.uid ~= 0 then
							vida = getCreatureMaxHealth(creature.uid)*0.05
							local posalvo = getCreaturePosition(creature.uid)
							doSendAnimatedText(posalvo, "- 5%." , TEXTCOLOR_RED)	
							doCreatureAddHealth(creature.uid, -vida)
                        end
                    end
                end, 1 + ((k-1) * 500))
            end
            end
        end
    return true
end

 

 

Não Testei!

 

 

não funcionou, o dano não segue o caster, o dano fica aonde a spell foi solta. ai se eu passo por ela eu tomo dano tbm, só o efeito esta seguindo o caster.

segue prints:
https://prnt.sc/1h2nkoq
https://prnt.sc/1h2nylk
https://prnt.sc/1h2oa1d

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