Ir para conteúdo

Featured Replies

Postado

Estou criando uma Spell no qual quando o player Casta ele Muda o visual durante o efeito da skill ,

porém não consigo faze-lo voltar a forma original quando a skill acaba. Como Posso fazer isso ? 

 

 

Codigo da skill :

local tempo = 60 
local effect = {241} 
local ml = 55 
local outfit = {lookType = 605}

function magicEffect118(tempo2,tempo3,cid)
if (isCreature(cid)) then
    if getPlayerStorageValue(cid, 104053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then
		for i=1, #effect do
        local position = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
doSendMagicEffect(position, effect[i])  
        end
    end
end
end
                  
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 104053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then
    doCombat(cid, combat, var)
    tempo2 = 0
	tempo3 = 0
    while (tempo2 ~= (tempo*1000)) do
        addEvent(magicEffect118, tempo2, tempo2, tempo*1000, cid)
        tempo2 = tempo2 + 300
		doCreatureChangeOutfit(cid, outfit)
		tempo3 = tempo3 + 1
    end
    setPlayerStorageValue(cid, 104053,1) 
else
    doPlayerSendCancel(cid, "Sorry, you are transformed.")
end
end

 

Postado
local tempo = 60 
local effect = {241} 
local ml = 55 
local outfit = {lookType = 605}

function magicEffect118(tempo2,tempo3,cid)
if (isCreature(cid)) then
    if getPlayerStorageValue(cid, 104053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then
		for i=1, #effect do
        local position = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
doSendMagicEffect(position, effect[i])  
        end
    end
end
end
                  
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 104053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then
    
    doSetCreatureOutfit(cid, outfit, tempo * 1000)
    doCombat(cid, combat, var)
    tempo2 = 0
	tempo3 = 0
    while (tempo2 ~= (tempo*1000)) do
        addEvent(magicEffect118, tempo2, tempo2, tempo*1000, cid)
        tempo2 = tempo2 + 300
		tempo3 = tempo3 + 1
    end
    setPlayerStorageValue(cid, 104053,1) 
else
    doPlayerSendCancel(cid, "Sorry, you are transformed.")
end
end

 

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

Postado
  • Autor
  Em 04/04/2018 em 04:49, Sttorm disse:

local tempo = 60 
local effect = {241} 
local ml = 55 
local outfit = {lookType = 605}

function magicEffect118(tempo2,tempo3,cid)
if (isCreature(cid)) then
    if getPlayerStorageValue(cid, 104053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then
		for i=1, #effect do
        local position = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
doSendMagicEffect(position, effect[i])  
        end
    end
end
end
                  
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 104053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then
    
    doSetCreatureOutfit(cid, outfit, tempo * 1000)
    doCombat(cid, combat, var)
    tempo2 = 0
	tempo3 = 0
    while (tempo2 ~= (tempo*1000)) do
        addEvent(magicEffect118, tempo2, tempo2, tempo*1000, cid)
        tempo2 = tempo2 + 300
		tempo3 = tempo3 + 1
    end
    setPlayerStorageValue(cid, 104053,1) 
else
    doPlayerSendCancel(cid, "Sorry, you are transformed.")
end
end

 

 

 

Obrigado <3

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

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo