--[[
Spell by Shawak - Edited by Jhon992.
Wolf transform
]]--
local time = 120 * 1000 -- 120 * 1000 = 2 min
local addShielding = 20 -- how much shielding should be added
local cooldown = 30
local effect = {32, 43, 23} -- efeitos ao usar spell, caso queira só 1 remova os outros, exemplo: local effect = {32}
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 42)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, time)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, addShielding)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)
local speed = createConditionObject(CONDITION_HASTE)
setConditionParam(speed, CONDITION_PARAM_TICKS, time)
setConditionFormula(speed, 0.7, -56, 0.7, -56)
setCombatCondition(combat, speed)
function cooldownready(cid)
if isPlayer(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Cooldown of Transform is ready!")
end
end
function sendMagic(cid)
if isPlayer(cid) then
for i=1, #effect do
doSendMagicEffect(getCreaturePosition(cid), effect[i])
end
end
end
function onCastSpell(cid, var)
local lvlMin = 20 -- lvl minimo
local lvlMax = 50 -- lvl minimo
if getPlayerLevel(cid) >= lvlMin and getPlayerLevel(cid) <= lvlMax then
if exhaustion.check(cid, 50001) == false then
exhaustion.set(cid, 50001, cooldown)
addEvent(cooldownready, cooldown*1000, cid)
tempo = 0
while (tempo ~= time) do
addEvent(sendMagic, tempo, cid)
tempo = tempo + 2000 -- se quiser diminuir o intervalo do effect, diminui de 2000 para 1000.
end
return doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, "Cooldown: [" ..exhaustion.get(cid, 50001).."] seconds.")
end
else
doPlayerSendCancel(cid, "Você só pode usar essa spell entre o level "..lvlMin.." e level "..lvlMax..".")
end
end