Ir para conteúdo

Featured Replies

Postado

o titulo jah dis tudo entao aqui a spells.

local tempo = 30


local effect = {175}

local health = 1000
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000)
setCombatCondition(combat, condition)

function magicEffect10(tempo2,tempo3,cid)
if (isCreature(cid)) then
if getPlayerStorageValue(cid, 102053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then
for i=1, #effect do
local position = {x=getPlayerPosition(cid).x+1, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
doSendMagicEffect(position, effect)
end
end
end
end

function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 102053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then
doCombat(cid, combat, var)
tempo2 = 0
while (tempo2 ~= (tempo*1000)) do
addEvent(magicEffect10, tempo2, tempo2, tempo*1000, cid)
tempo2 = tempo2 + 300
end

setPlayerStorageValue(cid, 102053,1)
else
doPlayerSendCancel(cid, "O magia está sendo usado!.")
end
end

 

pra que n sabe o cooldown é um tempo para pode usa a magia novamente, muito gente manda coloca na tag da spells. mas so que na tag n avisa quando tempo falta pra pode usa a magia novamente. e tb queria quem ajuda-se explica-se como coloca pra min pode coloca nas outras spells.

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

Resolvido por Snowsz

Ir para solução
  • Respostas 13
  • Visualizações 1.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Reinicia o servidor e utiliza a spell de novo, só para eu verificar uma coisa... 

  • Logo após:   function onCastSpell(cid, var) Adicione:   if getPlayerStorageValue(cid, cooldownStorage) > os.time() then doPlayerSendCancel(cid, "You are exhausted.") re

  • tenta ai, nao mude nada, só tente assim

Postado

depois de

function onCastSpell(cid, var)

Adiciona

if exhaustion.check(cid, 23006) == false then
exhaustion.set(cid, 23006, 20)
else
doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23006).."]")
return false
end

23006 é a storage, para cada spell mude ela.

20 é o tempo em segundos que vai ficar exaust.

 

Depois disso, pule uma linha e tudo certo.

Postado
  • Autor

N funcionou, coloquei assim:

local tempo = 30


local effect = {175}

local health = 1000
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000)
setCombatCondition(combat, condition)

function magicEffect10(tempo2,tempo3,cid)
if (isCreature(cid)) then
if getPlayerStorageValue(cid, 102053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then
for i=1, #effect do
local position = {x=getPlayerPosition(cid).x+1, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
doSendMagicEffect(position, effect)
end
end
end
end

function onCastSpell(cid, var)
if exhaustion.check(cid, 2300100) == false then
exhaustion.set(cid, 2300100, 4000)
else
doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 2300100).."]")
return false
end
if getPlayerStorageValue(cid, 102053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then
doCombat(cid, combat, var)
tempo2 = 0
while (tempo2 ~= (tempo*1000)) do
addEvent(magicEffect10, tempo2, tempo2, tempo*1000, cid)
tempo2 = tempo2 + 300
end

setPlayerStorageValue(cid, 102053,1)
else
doPlayerSendCancel(cid, "nao pode usar essa magia!.")
end
end

Postado
local tempo = 30
local effect = {175}
local health = 1000
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000)
setCombatCondition(combat, condition)
function magicEffect10(tempo2,tempo3,cid)
if (isCreature(cid)) then
if getPlayerStorageValue(cid, 102053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then
for i=1, #effect do
local position = {x=getPlayerPosition(cid).x+1, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
doSendMagicEffect(position, effect[i])
end
end
end
end
function onCastSpell(cid, var)
local cooldown = 60 --Tempo de cooldown
if getPlayerStorageValue(cid, 102055) >= 1 then
doPlayerSendCancel(cid, "You're exhausted.")
return false
end
if getPlayerStorageValue(cid, 102053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then
doCombat(cid, combat, var)
addEvent(function () setPlayerStorageValue(cid, 102055, 1) end, os.clock()+cooldown)
tempo2 = 0
while (tempo2 ~= (tempo*1000)) do
addEvent(magicEffect10, tempo2, tempo2, tempo*1000, cid)
tempo2 = tempo2 + 300
end
setPlayerStorageValue(cid, 102053,1)
else
doPlayerSendCancel(cid, "O magia está sendo usada!.")
end
end

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

Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais...

________________________________________________________________________________

Minhas Sprites:

Mega Metagross

Mega Abomasnow

Pack de Shinys

[Posso atualizá-lo com novos shinys a qualquer momento]

Tutoriais:

[Completo] Criando e adicionando um novo Pokémon

[Actions] Criando quest no RME

Editores Lua/Xml/Sync Entre outros:

Editores Win/Mac/Linux

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.7k

Informação Importante

Confirmação de Termo