Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function suck(cid, target)
- if isCreature(cid) then
- if isCreature(target) then
- local formula = math.random(getPlayerLevel(cid), getPlayerLevel(cid) * 1.5)
- doCreatureAddHealth(cid, formula)
- doCreatureAddHealth(target, -formula)
- doSendAnimatedText(getThingPos(cid), "+"..formula, COLOR_GREEN)
- doSendAnimatedText(getThingPos(target), "-"..formula, COLOR_RED)
- doSendMagicEffect(getThingPos(cid), 12)
- doSendMagicEffect(getThingPos(target), 3)
- return true
- end
- end
- return true
- end
- function onCastSpell(cid)
- local config = {
- arrounds = 3, -- Vezes que a magia vai atacar
- exaust = 25, -- tempo de exaust -> 1 = 1s
- level = 50,
- mana = 200, -- Mana que vai gastar
- time = 1000, -- tempo para executar a magia novamente (arrounds) -> 1 = 1s
- t = getCreatureTarget(cid), --- Não mexa.
- }
- if config.t <= 0 then
- doPlayerSendCancel(cid, "You need a target.")
- return false
- end
- if getCreatureMana(cid) < config.mana then
- doPlayerSendCancel(cid, "You need "..config.mana.." of mana to cast this spell.")
- return false
- end
- if getPlayerLevel(cid) < config.level then
- doPlayerSendCancel(cid, "You need level "..config.level.." to cast this spell.")
- return false
- end
- if exhaustion.get(cid, 21511) then
- doPlayerSendCancel(cid, "You need wait "..exhaustion.get(cid, 21511).." seconds.")
- return false
- end
- exhaustion.set(cid, 21511, config.exaust)
- doCreatureAddMana(cid, - config.mana)
- doCreatureSay(cid, "BLOOD SUCK", TALKTYPE_MONSTER)
- for a = 1, config.arrounds do
- addEvent(suck, config.time * a, cid, config.t)
- end
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement