Ir para conteúdo
  • Cadastre-se

(Resolvido)Teleport que muda estando com target ou não.


Ir para solução Resolvido por Vodkart,

Posts Recomendados

Olá novamente, estou atrás de uma spell a 2 dias e não encontrei nenhuma igual oque eu quero e nem consegui editar as existentes.

Se trata de um Kamui, para os não jogadores de derivado é uma spell que teleporta você ou o alvo para outro local do mapa.
Já existe diversos spells de Kamui mas nem todas completas, sempre falta alguma coisa que me impede de editar por não ter conhecimento em script.

Como quero que seja:
Primeiro o player vai ter duas possibilidades, primeiro ele usa com target, e segundo ele usa sem target. De preferencia na mesma spell. (Caso seja complicado fazer dessa forma pode fazer duas spells diferentes cada uma fazendo uma coisa).
Com target, o player ou monstro selecionado (se possível adicionar uma parte com exceções para mim adicionar o nome de alguns monstros), o target será enviado para o Kamui (x1000y1000z15) que eu editei no mapa.
Sem target quem será enviado para o Kamui será o próprio player que conjurou a spell. Mesma coordenada (x1000y1000z15).

Segundo, essa spell terá um cooldown de 5 min e também SE POSSIVEL, ela de um dano caso usada no target
Ela terá 2 effects, um no player e um no target e se possível também o teleport não ser instantâneo, ele levar uns 3 milissegundos para teleportar após o uso da spell.
Não vai voltar automático.

E terceiro, dentro desse mundo terá um portal que será responsável por fazer a pessoa voltar para o local de onde ela foi teleportada.(Até encontrei o script para esse portal mas é necessário que a spell grave 3 storages da posição do player e do target com os valores de x,y,z para que o portal possa teleportar essa pessoa de volta).

Ou seja, resumindo:
Uma spell de teleport no mapa que leva você ou caso esteja no target leve o target com exceção de alguns monstros, com cd ajustável, delay no teleport, 2 effects, causar dano, e dentro dessa área que leva o teleport ter um portal que leva de volta.

Bom, não faço a menor ideia se é difícil ou fácil criar essa spell, pois tudo que eu citei eu  vi em outras spells então possível eu sei que é, mas não tenho noção do grau de dificuldade, por isso coloquei alguns "se possível" para facilitar caso esteja muito complexo.
Muito obrigado a quem tentar ajudar, é uma spell bem dahora que vai ajudar muitos servidores de NTO caso seja feita.
Qualquer dúvida  perguntar ai que eu respondo.

TFS 0.4 8.60

 

Link para o post
Compartilhar em outros sites

Só tenho uma dúvida, se vários jogadores usarem essa mesma spell juntos? vai lotar a area de monstros ou de players... 

 

E como vai fazer para o monstro que foi enviado para lá voltar? pq ele não volta sozinho né?

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
7 horas atrás, Vodkart disse:

Só tenho uma dúvida, se vários jogadores usarem essa mesma spell juntos? vai lotar a area de monstros ou de players... 

 

E como vai fazer para o monstro que foi enviado para lá voltar? pq ele não volta sozinho né?

Então, nesse caso é só matando mesmo o monstro, por isso seria bom uma parte que eu coloque a exeção dos bixos, para não levarem boses, trainers entre outros.
E com um CD alto as pessoas não vão ficar o tempo todo puxando os monstros. Além de só 2 personagens terem essa spell.

No caso dos players e normal estar cheio mesmo

Editado por Nother (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

testa assim (só para teste)

 

spell:

 

local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui
local teleport = {x=1000, y=1000, z=15} -- para onde vai
local blocks = {"demon", "hydra"} -- defina o nome dos monstro em minusculo
local storage = 753159
function isInKamuiArea(cid)
	return isInRange(getCreaturePosition(cid), from, to) and true or false
end
function TeleportToKamui(alvo, pos)
	if not isCreature(alvo) then return LUA_ERROR end
	doTeleportThing(alvo, pos)
	doSendMagicEffect(getCreaturePosition(alvo), 3) -- target
end
function onCastSpell(cid, var)
	local target = var.number 
	if target and isCreature(target) then -- se tiver target
		if isMonster(target) then
			if isInArray(blocks, getCreatureName(target):lower()) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true
			end
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			addEvent(TeleportToKamui, 300, target,teleport) 
		elseif isPlayer(target) then -- salva a coordenada do target player
			if isInKamuiArea(target) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true
			end
			setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z)
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			addEvent(TeleportToKamui, 300, target,teleport)
		end	
	else
		if isInKamuiArea(cid) then
			doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true
		end
		setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z)
		doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
		addEvent(TeleportToKamui, 300, cid, teleport)
	end
	return true
end

 

 

e o movements o teleport:

 

function onStepIn(cid, item, position, fromPosition)
	local storage = 753159
	if not isPlayer(cid) then return true end
	if getPlayerStorageValue(cid, storage) == -1 then
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		return true
	end
	local w = tostring(getPlayerStorageValue(cid, storage)):gsub(':', ''):explode(',')
	doTeleportThing(cid, {x = tonumber(w[1]), y = tonumber(w[2]), z = tonumber(w[3])})
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
	return true
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
1 hora atrás, Vodkart disse:

testa assim (só para teste)

 

spell:

 


local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui
local teleport = {x=1000, y=1000, z=15} -- para onde vai
local blocks = {"demon", "hydra"} -- defina o nome dos monstro em minusculo
local storage = 753159
function isInKamuiArea(cid)
	return isInRange(getCreaturePosition(cid), from, to) and true or false
end
function TeleportToKamui(alvo, pos)
	if not isCreature(alvo) then return LUA_ERROR end
	doTeleportThing(alvo, pos)
	doSendMagicEffect(getCreaturePosition(alvo), 3) -- target
end
function onCastSpell(cid, var)
	local target = var.number 
	if target and isCreature(target) then -- se tiver target
		if isMonster(target) then
			if isInArray(blocks, getCreatureName(target):lower()) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true
			end
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			addEvent(TeleportToKamui, 300, target,teleport) 
		elseif isPlayer(target) then -- salva a coordenada do target player
			if isInKamuiArea(target) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true
			end
			setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z)
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			addEvent(TeleportToKamui, 300, target,teleport)
		end	
	else
		if isInKamuiArea(cid) then
			doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true
		end
		setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z)
		doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
		addEvent(TeleportToKamui, 300, cid, teleport)
	end
	return true
end

 

 

e o movements o teleport:

 


function onStepIn(cid, item, position, fromPosition)
	local storage = 753159
	if not isPlayer(cid) then return true end
	if getPlayerStorageValue(cid, storage) == -1 then
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		return true
	end
	local w = tostring(getPlayerStorageValue(cid, storage)):gsub(':', ''):explode(',')
	doTeleportThing(cid, {x = tonumber(w[1]), y = tonumber(w[2]), z = tonumber(w[3])})
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
	return true
end

 

Funcionou tudo que você adicionou ai, realmente muito bom. Bom falta apenas 3 coisinhas caso não dê a terceira de boa
falta agora o effect ser ajustável a posição, e sair no alvo (está saindo só em mim), só consigo usar no target se eu colocar no xml needtarget 1, se eu quiser usar em mim o kamui preciso colocar needtarget 0. e o ultimo e menos importante, dar dano no alvo.

Link para o post
Compartilhar em outros sites

@Nother n sou mto bom com spells, não manjo nada, mas vamo seguindo os testes... é que estou pelo celular e o computador do escritório kkkk sem tibia nem nada, só bloco de nota msm xD

 

local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui
local teleport = {x=1000, y=1000, z=15} -- para onde vai
local blocks = {"demon", "hydra"} -- defina o nome dos monstro em minusculo
local storage = 753159
function isInKamuiArea(cid)
	return isInRange(getCreaturePosition(cid), from, to) and true or false
end
function TeleportToKamui(alvo, pos)
	if not isCreature(alvo) then return LUA_ERROR end
	doTeleportThing(alvo, pos)
	doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui
end
function onCastSpell(cid, var)
	local target = getCreatureTarget(cid)
	if not target then -- executa no cid
		if isInKamuiArea(cid) then
			doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true
		end
		setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z)
		doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
		addEvent(TeleportToKamui, 300, cid, teleport)
	elseif target and isCreature(target) then -- se tiver target
		if isMonster(target) then
			if isInArray(blocks, getCreatureName(target):lower()) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true
			end
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui
			addEvent(TeleportToKamui, 300, target,teleport) 
		elseif isPlayer(target) then
			if isInKamuiArea(target) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true
			end
			setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z)
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui
			addEvent(TeleportToKamui, 300, target, teleport)
		end	
	end
	return true
end

 

 

(nao botei dano ainda)

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
6 minutos atrás, Vodkart disse:

@Nother n sou mto bom com spells, não manjo nada, mas vamo seguindo os testes... é que estou pelo celular e o computador do escritório kkkk sem tibia nem nada, só bloco de nota msm xD

 


local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui
local teleport = {x=1000, y=1000, z=15} -- para onde vai
local blocks = {"demon", "hydra"} -- defina o nome dos monstro em minusculo
local storage = 753159
function isInKamuiArea(cid)
	return isInRange(getCreaturePosition(cid), from, to) and true or false
end
function TeleportToKamui(alvo, pos)
	if not isCreature(alvo) then return LUA_ERROR end
	doTeleportThing(alvo, pos)
	doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui
end
function onCastSpell(cid, var)
	local target = getCreatureTarget(cid)
	if not target then -- executa no cid
		if isInKamuiArea(cid) then
			doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true
		end
		setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z)
		doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
		addEvent(TeleportToKamui, 300, cid, teleport)
	elseif target and isCreature(target) then -- se tiver target
		if isMonster(target) then
			if isInArray(blocks, getCreatureName(target):lower()) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true
			end
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui
			addEvent(TeleportToKamui, 300, target,teleport) 
		elseif isPlayer(target) then
			if isInKamuiArea(target) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true
			end
			setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z)
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui
			addEvent(TeleportToKamui, 300, target, teleport)
		end	
	end
	return true
end

 

 

(nao botei dano ainda)

Que isso, so oque vc ja fez aqui e mais doque eu faria em um ano kkk, seguinte, agora a spell com needtarget 0 pega no alvo mas não pega em mim, o effect agora esta funcionando nos 2.

Link para o post
Compartilhar em outros sites

@Nother

 

 

local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui
local teleport = {x=1000, y=1000, z=15} -- para onde vai
local blocks = {"demon", "hydra"} -- defina o nome dos monstro em minusculo
local storage = 753159
function isInKamuiArea(cid)
	return isInRange(getCreaturePosition(cid), from, to) and true or false
end
function TeleportToKamui(alvo, pos)
	if not isCreature(alvo) then return LUA_ERROR end
	doTeleportThing(alvo, pos)
	doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui
end
function onCastSpell(cid, var)
	local target = getCreatureTarget(cid)	
	if target > 0 and isCreature(target) then -- se tiver target
		if isMonster(target) then
			if isInArray(blocks, getCreatureName(target):lower()) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true
			end
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui
			addEvent(TeleportToKamui, 300, target,teleport) 
		elseif isPlayer(target) then
			if isInKamuiArea(target) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true
			end
			setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z)
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui
			addEvent(TeleportToKamui, 300, target, teleport)
		end	
	else
		if isInKamuiArea(cid) then
			doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true
		end
		setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z)
		doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
		addEvent(TeleportToKamui, 300, cid, teleport)
	end
	return true
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
3 minutos atrás, Vodkart disse:

@Nother

 

 


local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui
local teleport = {x=1000, y=1000, z=15} -- para onde vai
local blocks = {"demon", "hydra"} -- defina o nome dos monstro em minusculo
local storage = 753159
function isInKamuiArea(cid)
	return isInRange(getCreaturePosition(cid), from, to) and true or false
end
function TeleportToKamui(alvo, pos)
	if not isCreature(alvo) then return LUA_ERROR end
	doTeleportThing(alvo, pos)
	doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui
end
function onCastSpell(cid, var)
	local target = getCreatureTarget(cid)	
	if target > 0 and isCreature(target) then -- se tiver target
		if isMonster(target) then
			if isInArray(blocks, getCreatureName(target):lower()) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true
			end
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui
			addEvent(TeleportToKamui, 300, target,teleport) 
		elseif isPlayer(target) then
			if isInKamuiArea(target) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true
			end
			setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z)
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui
			addEvent(TeleportToKamui, 300, target, teleport)
		end	
	else
		if isInKamuiArea(cid) then
			doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true
		end
		setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z)
		doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
		addEvent(TeleportToKamui, 300, cid, teleport)
	end
	return true
end

 

Perfeito, dessa vez deu direitinho, agora só falta os detalhezinhos do effect pois ele fica na cabeça a esquerda dos personagens, e o dano no alvo, mas já esta ótimo, não precisa fazer com pressa se estiver ocupado.

Link para o post
Compartilhar em outros sites
  • Solução

testa o dano

 

local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui
local teleport = {x=1000, y=1000, z=15} -- para onde vai
local blocks = {"demon", "hydra"} -- defina o nome dos monstro em minusculo
local storage = 753159
function isInKamuiArea(cid)
	return isInRange(getCreaturePosition(cid), from, to) and true or false
end
function TeleportToKamui(alvo, pos)
	if not isCreature(alvo) then return LUA_ERROR end
	doTeleportThing(alvo, pos)
	doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui
end
function onCastSpell(cid, var)
	local target = getCreatureTarget(cid)	
	if target > 0 and isCreature(target) then -- se tiver target
		if isMonster(target) then
			if isInArray(blocks, getCreatureName(target):lower()) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true
			end
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui
			local min = (getPlayerLevel(cid) * 2 + getPlayerMagLevel(cid) * 20) * 5
            local max = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_BLOCKHIT)  -- defina combat e effect    COMBAT_PHYSICALDAMAGE / CONST_ME_BLOCKHIT
			addEvent(TeleportToKamui, 300, target,teleport) 
		elseif isPlayer(target) then
			if isInKamuiArea(target) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true
			end
			setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z)
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui
			local min = (getPlayerLevel(cid) * 2 + getPlayerMagLevel(cid) * 20) * 5
            local max = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_BLOCKHIT)  -- defina combat e effect    COMBAT_PHYSICALDAMAGE / CONST_ME_BLOCKHIT
			addEvent(TeleportToKamui, 300, target, teleport)
		end	
	else
		if isInKamuiArea(cid) then
			doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true
		end
		setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z)
		doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
		addEvent(TeleportToKamui, 300, cid, teleport)
		doCreatureAddHealth(cid, -100)
	end
	return true
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
11 minutos atrás, Vodkart disse:

testa o dano

 


local from, to = {x=980, y=980, z=15}, {x=1050, y=1050, z=15} -- area total do kamui
local teleport = {x=1000, y=1000, z=15} -- para onde vai
local blocks = {"demon", "hydra"} -- defina o nome dos monstro em minusculo
local storage = 753159
function isInKamuiArea(cid)
	return isInRange(getCreaturePosition(cid), from, to) and true or false
end
function TeleportToKamui(alvo, pos)
	if not isCreature(alvo) then return LUA_ERROR end
	doTeleportThing(alvo, pos)
	doSendMagicEffect(getThingPos(alvo), 40) -- effect target ao entrar no kamui
end
function onCastSpell(cid, var)
	local target = getCreatureTarget(cid)	
	if target > 0 and isCreature(target) then -- se tiver target
		if isMonster(target) then
			if isInArray(blocks, getCreatureName(target):lower()) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell neste monstro") return true
			end
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui
			local min = (getPlayerLevel(cid) * 2 + getPlayerMagLevel(cid) * 20) * 5
            local max = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_BLOCKHIT)  -- defina combat e effect    COMBAT_PHYSICALDAMAGE / CONST_ME_BLOCKHIT
			addEvent(TeleportToKamui, 300, target,teleport) 
		elseif isPlayer(target) then
			if isInKamuiArea(target) then
				doPlayerSendCancel(cid, "voce nao pode usar a spell em um target dentro do kamui") return true
			end
			setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z)
			doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
			doSendMagicEffect(getThingPos(target), 10) -- effect target ao usar kamui
			local min = (getPlayerLevel(cid) * 2 + getPlayerMagLevel(cid) * 20) * 5
            local max = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_BLOCKHIT)  -- defina combat e effect    COMBAT_PHYSICALDAMAGE / CONST_ME_BLOCKHIT
			addEvent(TeleportToKamui, 300, target, teleport)
		end	
	else
		if isInKamuiArea(cid) then
			doPlayerSendCancel(cid, "voce nao pode usar a spell dentro do kamui") return true
		end
		setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z)
		doSendMagicEffect(getCreaturePosition(cid), 4) -- cid
		addEvent(TeleportToKamui, 300, cid, teleport)
		doCreatureAddHealth(cid, -100)
	end
	return true
end

 

Show! funcionou certinho, agora so falta os effects no target e no player. Não querendo incomodar mas já incomodando, teria como adicionar o cooldown de 5 min na spell?

Link para o post
Compartilhar em outros sites
Agora, Vodkart disse:

ok dps me manda seu discord que fazemos isso rapidinho

 

 

mandei mensagem la kkk, quando tiver ok eu posto aqui para o pessoal

Ai galera, consegui editar o effect e o cooldown tbm, a spell ta muito boa, @Vodkart muito obrigado mesmo.

 

Deixei o CD em 5 minutos.
 

local from, to = {x=947, y=955, z=15}, {x=1055, y=1041, z=15} -- area total do kamui
local from, arena = {x=900, y=895, z=7}, {x=921, y=915, z=7} -- area total da arena
local teleport = {x=1000, y=1000, z=15} -- para onde vai
local blocks = {"tronco"} -- defina o nome dos monstro em minusculo
local storage = 753159
function isInKamuiArea(cid)
	return isInRange(getCreaturePosition(cid), from, to) and true or false
end
function isInKamuiArea(cid)
	return isInRange(getCreaturePosition(cid), from, arena) and true or false
end
function TeleportToKamui(alvo, pos)
	if not isCreature(alvo) then return LUA_ERROR end
	doTeleportThing(alvo, pos)
		local positionpk = {x=getThingPos(alvo).x+1, y=getThingPos(alvo).y+1, z=getThingPos(alvo).z}
		doSendMagicEffect(positionpk, 315) -- cid
end
function onCastSpell(cid, var)
	local tempo = 300 -- Tempo de exhaustion em segundos
	local sto = 545550 -- Storage de Spell, nunca usar a mesma em outra spell, a menos que não queira usar duas spell juntas!

	if exhaustion.check(cid, sto) then
	doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, sto) .. " segundos para usar o kamui novamente.")
	return false
	end

	local target = getCreatureTarget(cid)	
	if target > 0 and isCreature(target) then -- se tiver target
		if isMonster(target) then
			if isInArray(blocks, getCreatureName(target):lower()) then
				doPlayerSendCancel(cid, "voce nao pode usar o kamui neste alvo") return true
			end
			local positionp = {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}
			doSendMagicEffect(positionp, 315) -- effect que sai em voce
			local positiont = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z}
			doSendMagicEffect(positiont, 315) -- effect ao usar kamui em um player
			local min = ((30) * (getPlayerMagLevel(cid) + getPlayerLevel(cid)))
			local max = ((35) * (getPlayerMagLevel(cid) + getPlayerLevel(cid)))
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_BLOCKHIT)  -- defina combat e effect    COMBAT_PHYSICALDAMAGE / CONST_ME_BLOCKHIT
			addEvent(TeleportToKamui, 700, target,teleport) 
		elseif isPlayer(target) then
			if isInKamuiArea(target) then
				doPlayerSendCancel(cid, "voce nao pode usar o kamui em alguem nesta area") return true
			end
			setPlayerStorageValue(target, storage, ":".. getCreaturePosition(target).x ..",:".. getCreaturePosition(target).y ..",:".. getCreaturePosition(target).z)
			local positionp1 = {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}
			doSendMagicEffect(positionp1, 315) -- effect que sai em voce
			local positiont1 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z}
			doSendMagicEffect(positiont1, 315) -- effect ao usar kamui em um monstro
			local min = ((30) * (getPlayerMagLevel(cid) + getPlayerLevel(cid)))
			local max = ((35) * (getPlayerMagLevel(cid) + getPlayerLevel(cid)))
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_BLOCKHIT)  -- defina combat e effect    COMBAT_PHYSICALDAMAGE / CONST_ME_BLOCKHIT
			addEvent(TeleportToKamui, 700, target, teleport)
		end	
	else
		if isInKamuiArea(cid) then
			doPlayerSendCancel(cid, "voce nao pode usar o kamui nesta area") return true
		end
		setPlayerStorageValue(cid, storage, ":".. getCreaturePosition(cid).x ..",:".. getCreaturePosition(cid).y ..",:".. getCreaturePosition(cid).z)
			local positionp2 = {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z}
			doSendMagicEffect(positionp2, 315) -- effect ao usar o kamui em voce mesmo
		addEvent(TeleportToKamui, 700, cid, teleport)
		doCreatureAddHealth(cid, -100)
	end
	exhaustion.set(cid, sto, tempo)
	return true
end

 

O XML

 

	<instant name="Kamui" words="kamui in" lvl="300" mana="10000" prem="0" needtarget="0" range="4" exhaustion="0" blockwalls="1" needlearn="0" script="kakashi/kamui in.lua">
     	<vocation id="0"/>
	</instant>


O movements do portal é aquele mesmo que ele passou no inicio da spell.

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.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo