Ir para conteúdo
  • 0

ajuda cancel da spell


FelipeXT

Pergunta

bom fiz um script dentro da spell que so player com reset poderia usala e o seguinte

 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 40)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 1, 0,10)

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, 6000)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 2)
setCombatCondition(combat, condition)

local function Cooldown(cid)
if isPlayer(cid) == TRUE then
doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,'CD: Exeta Mas Regen')
end
end

local exhausted_seconds = 30 -- Segundos que o Player Poderá castar a spell novamente
local exhausted_storagevalue = 6784 -- Storage Value do Cool Down
local Resets = 1

function onCastSpell(cid, var)
if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
doPlayerSendCancel(cid,'O Cooldown não está pronto.')
else
if getResets(cid) >= Resets then
doPlayerSendCancel(cid,'Voce presisa de 1 reset para usala.')
return true
end
end






rand = math.random(1,1)
if rand == 1 and isPlayer(cid) == 1 then
doPlayerSay(cid,"Exeta mas regen",16)
addEvent(Cooldown, 1*30000,cid)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat, var)
elseif rand == 2 and isPlayer(cid) == 1 then
doPlayerSay(cid,"Exeta mas regen!",16)
addEvent(Cooldown, 1*30000,cid)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat, var)
else
addEvent(Cooldown, 1*30000,cid)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat, var)
end
end

 

so que ainda continua pedindo resets mesmo eu tendo!

 

7.92

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0
Tenta:



local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 40)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 1, 0,10)

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, 6000)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 2)
setCombatCondition(combat, condition)

local function Cooldown(cid)
if isPlayer(cid) == TRUE then
doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,'CD: Exeta Mas Regen')
end
end

local exhausted_seconds = 30 -- Segundos que o Player Poderá castar a spell novamente
local exhausted_storagevalue = 6784 -- Storage Value do Cool Down
local Resets = 1

function onCastSpell(cid, var)
if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
doPlayerSendCancel(cid,'O Cooldown não está pronto.')
else
if getResets(cid) < Resets then
doPlayerSendCancel(cid,'Voce presisa de 1 reset para usala.')
return true
end
end





rand = math.random(1,1)
if rand == 1 and isPlayer(cid) == 1 then
doPlayerSay(cid,"Exeta mas regen",16)
addEvent(Cooldown, 1*30000,cid)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat, var)
elseif rand == 2 and isPlayer(cid) == 1 then
doPlayerSay(cid,"Exeta mas regen!",16)
addEvent(Cooldown, 1*30000,cid)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat, var)
else
addEvent(Cooldown, 1*30000,cid)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat, var)
end
end


Editado por AdilsonTsunami
Link para o comentário
Compartilhar em outros sites

  • 0

vlw man com base no que vc fez eu consegui fazer oque eu queria eu estava errando os simbolos! rep+

 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 40)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 1, 0,10)

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, 6000)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 2)
setCombatCondition(combat, condition)

local function Cooldown(cid)
if isPlayer(cid) == TRUE then
doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,'CD: Exeta Mas Regen')
end
end

local exhausted_seconds = 30 -- Segundos que o Player Poderá castar a spell novamente
local exhausted_storagevalue = 6784 -- Storage Value do Cool Down
local Resets = 1

function onCastSpell(cid, var)
if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
doPlayerSendCancel(cid,'O Cooldown não está pronto.')
return TRUE
else
if getResets(cid) < Resets then
doPlayerSendCancel(cid,'Voce presisa de 1 reset para usala.')
return TRUE
end
end








rand = math.random(1,1)
if rand == 1 and isPlayer(cid) == 1 then
doPlayerSay(cid,"Exeta mas regen",16)
addEvent(Cooldown, 1*30000,cid)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat, var)
elseif rand == 2 and isPlayer(cid) == 1 then
doPlayerSay(cid,"Exeta mas regen!",16)
addEvent(Cooldown, 1*30000,cid)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat, var)
else
addEvent(Cooldown, 1*30000,cid)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat, var)
end
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...