Ir para conteúdo
  • Cadastre-se

(Resolvido)Spell dando paralyze infinito


Ir para solução Resolvido por Storm,

Posts Recomendados

Quando uso a spell de paralyze no target, o target fica parado pra sempre. O tempo configurado na spell foi de 5 segundos, mas o player fica inifinamente paralizado, como posso resolver isso?

 

Script da magia:

Spoiler

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -5000)

function onCastSpell(cid, var)

local target = getCreatureTarget(cid)
local targetpos = getCreaturePosition(target)
local efepos = {x=targetpos.x, y=targetpos.y, z=targetpos.z}
local time = 5 -- tempo paralyzado

if isPlayer(cid) and exhaustion.check(cid, 11560) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, 11560) .. " segundos para usar novamente.")
return FALSE
end

local function No_Move_Target()
if isCreature(target) then
doCreatureSetNoMove(target, 0)
end
return TRUE
end

exhaustion.set(cid, 11560, 30)
doCreatureSetNoMove(target, 1)
doAddCondition(target, condition)
doSendMagicEffect(efepos, 24)
addEvent(No_Move_Target, time*1000)
return TRUE
end

 

Link para o post
Compartilhar em outros sites

@MarkCharlotte Tenta assim:

 

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -5000)

function onCastSpell(cid, var)
	
	local target = getCreatureTarget(cid)
	local targetpos = getCreaturePosition(target)
	local efepos = {x=targetpos.x, y=targetpos.y, z=targetpos.z}
	local time = 5 -- tempo paralyzado
	
	if isPlayer(cid) and exhaustion.check(cid, 11560) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, 11560) .. " segundos para usar novamente.")
		return FALSE
	end
	
	exhaustion.set(cid, 11560, 30)
	doCreatureSetNoMove(target, 1)
	doAddCondition(target, condition)
	doSendMagicEffect(efepos, 24)
	addEvent(No_Move_Target, time*1000, target)
	return TRUE
end

local function No_Move_Target(target)
	if isCreature(target) then
		doCreatureSetNoMove(target, 0)
	end
	return TRUE
end

 

Link para o post
Compartilhar em outros sites

@MarkCharlotte Tenta assim:

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -5000)

function onCastSpell(cid, var)
	
	local target = getCreatureTarget(cid)
	local targetpos = getCreaturePosition(target)
	local efepos = {x=targetpos.x, y=targetpos.y, z=targetpos.z}
	local time = 5 -- tempo paralyzado
	
	if isPlayer(cid) and exhaustion.check(cid, 11560) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, 11560) .. " segundos para usar novamente.")
		return FALSE
	end
	
	exhaustion.set(cid, 11560, 30)
	doCreatureSetNoMove(target, 1)
	doAddCondition(target, condition)
	doSendMagicEffect(efepos, 24)
	addEvent(No_Move_Target, time*1000, cid)
	return TRUE
end

local function No_Move_Target(cid)
	local target = getCreatureTarget(cid)
	if isCreature(target) then
		doCreatureSetNoMove(target, 0)
	end
	return TRUE
end

 

Link para o post
Compartilhar em outros sites

@MarkCharlotte Tenta assim: 

 

Spoiler

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -5000)

local function No_Move_Target(cid)
	local target = getCreatureTarget(cid)
	if isCreature(target) then
		doCreatureSetNoMove(target, 0)
	end
	return TRUE
end

function onCastSpell(cid, var)	
	local target = getCreatureTarget(cid)
	local targetpos = getCreaturePosition(target)
	local efepos = {x=targetpos.x, y=targetpos.y, z=targetpos.z}
	local time = 5 -- tempo paralyzado
	
	if isPlayer(cid) and exhaustion.check(cid, 11560) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, 11560) .. " segundos para usar novamente.")
		return FALSE
	end
	
	exhaustion.set(cid, 11560, 30)
	doCreatureSetNoMove(target, 1)
	doAddCondition(target, condition)
	doSendMagicEffect(efepos, 24)
	addEvent(No_Move_Target, time*1000, cid)
	return TRUE
end

 

 

Link para o post
Compartilhar em outros sites

@MarkCharlotte Tenta assim:

 

Spoiler

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -5000)

local function No_Move_Target(cid)
	local target = getCreatureTarget(cid)
	if isCreature(target) then
		doCreatureSetNoMove(target, FALSE)
	end
	return TRUE
end

function onCastSpell(cid, var)	
	local target = getCreatureTarget(cid)
	local targetpos = getCreaturePosition(target)
	local efepos = {x=targetpos.x, y=targetpos.y, z=targetpos.z}
	local time = 5 -- tempo paralyzado
	
	if isPlayer(cid) and exhaustion.check(cid, 11560) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, 11560) .. " segundos para usar novamente.")
		return FALSE
	end
	
	exhaustion.set(cid, 11560, 30)
	doCreatureSetNoMove(target, TRUE)
	doAddCondition(target, condition)
	doSendMagicEffect(efepos, 24)
	addEvent(No_Move_Target, time*1000, cid)
	return TRUE
end

 

 

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

@MarkCharlotte Removi a condition, não faz nenhum sentido ter ela ali

 

Spoiler

local function No_Move_Target(cid)
	local target = getCreatureTarget(cid)
	if isCreature(target) then
		doCreatureSetNoMove(target, FALSE)
	end
	return TRUE
end

function onCastSpell(cid, var)	
	local target = getCreatureTarget(cid)
	local targetpos = getCreaturePosition(target)
	local efepos = {x=targetpos.x, y=targetpos.y, z=targetpos.z}
	local time = 5 -- tempo paralyzado
	
	if isPlayer(cid) and exhaustion.check(cid, 11560) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, 11560) .. " segundos para usar novamente.")
		return FALSE
	end
	
	exhaustion.set(cid, 11560, 30)
	doCreatureSetNoMove(target, TRUE)
	doSendMagicEffect(efepos, 24)
	addEvent(No_Move_Target, time*1000, cid)
	return TRUE
end

 

 

Link para o post
Compartilhar em outros sites
Em 25/04/2020 em 17:40, Storm disse:

@MarkCharlotte Removi a condition, não faz nenhum sentido ter ela ali

 

  Mostrar conteúdo oculto


local function No_Move_Target(cid)
	local target = getCreatureTarget(cid)
	if isCreature(target) then
		doCreatureSetNoMove(target, FALSE)
	end
	return TRUE
end

function onCastSpell(cid, var)	
	local target = getCreatureTarget(cid)
	local targetpos = getCreaturePosition(target)
	local efepos = {x=targetpos.x, y=targetpos.y, z=targetpos.z}
	local time = 5 -- tempo paralyzado
	
	if isPlayer(cid) and exhaustion.check(cid, 11560) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, 11560) .. " segundos para usar novamente.")
		return FALSE
	end
	
	exhaustion.set(cid, 11560, 30)
	doCreatureSetNoMove(target, TRUE)
	doSendMagicEffect(efepos, 24)
	addEvent(No_Move_Target, time*1000, cid)
	return TRUE
end

 

 

 

Storm, testei aqui e o player fica 5 minutos paralisado, e tambem os outros jogadores nao conseguem atacar o player que fica paralisado.

Editado por One Punch Man (veja o histórico de edições)

x1fCxnI.png

Link para o post
Compartilhar em outros sites

@One Punch Man Em relação ao tempo, não faz sentido. Você provavelmente fez algo errado, não faz sentido já que o AddEvent é executado depois de 5 segundos, como tá na script time * 1000 , onde time é igual a 5, ou seja, 5 * 1000 = 5000 milissegundos que  é igual a 5 segundos. A não ser que o tempo do addEvent seja de uma unidade diferente de milissegundos, o que eu acho que não é.

Em relação ao player não conseguir ser atacado, não faz sentido também, já que a função tira apenas a capacidade do player de se mover. Verifique no seu creaturescripts se tem alguma script que não deixa o jogador ser atacado quando o mesmo não poder andar.

Link para o post
Compartilhar em outros sites
4 minutos atrás, Storm disse:

@One Punch Man Em relação ao tempo, não faz sentido. Você provavelmente fez algo errado, não faz sentido já que o AddEvent é executado depois de 5 segundos, como tá na script time * 1000 , onde time é igual a 5, ou seja, 5 * 1000 = 5000 milissegundos que  é igual a 5 segundos. A não ser que o tempo do addEvent seja de uma unidade diferente de milissegundos, o que eu acho que não é.

Em relação ao player não conseguir ser atacado, não faz sentido também, já que a função tira apenas a capacidade do player de se mover. Verifique no seu creaturescripts se tem alguma script que não deixa o jogador ser atacado quando o mesmo não poder andar.

 

Screenshot_234.png

A questão do tempo eu consegui arrumar, vou olhar os creaturescripts..

x1fCxnI.png

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