quarta-feira, 8 de fevereiro de 2012

Magia Life Drain "x"


Nome: Life Drain
.
Versão: Testado em TFS 8.54, mas funciona em qualquer ot..
Tipo do script: Spell.
Servidor Testado: Youots 8.54.
Autor:
Willlian BC
.
Explicação: A magia suga a vida de uma criatura, e pega pra ela.
.
Comentario: Bom, eu nao postei nem uma SS, por que ela nao tem efeito nem um em especial, (o mesmo efeito do exura quando enche a vida.) Ela Tem um dano balanceado de 10% da vida do alvo e nao pode ser usada para matar ( ela so tira no maximo 60% da vida, depois disso manda uma msg...) ,
eu nao escolhe as vocaçoes (ou seja todos podem usar).
DATA/SPELL/spell.xml
Código:
<instant name="Life Draw" words="life drain x"    lvl="50" mana="300"  range="5" needtarget="1" blockwalls="1"  exhaustion="2000"  event="script" value="Battle/support/lifedrain.lua">
</instant>
DATA/SPELL/Battle/support/lifedrain.lua

Código:
--[[
-- You can use this spell and copy and modify it. --
-- Created By SailorMoonLive --
-- But pls don't remove this comment --
]]

function onCastSpell(cid, var)
local CreatureMaxHealth = getCreatureMaxHealth(getCreatureTarget(cid))
if getCreatureTarget(cid) then
local CreatureHealth = getCreatureHealth(getCreatureTarget(cid))
local critLife = CreatureMaxHealth/2
local lifedraw = ( CreatureHealth / 10)
if CreatureHealth >= critLife then
local Target = getCreatureTarget(cid)
local targetPos = getPlayerPosition(Target)
doCreatureAddHealth(Target, -lifedraw, COMBAT_LIFEDRAIN)
doSendAnimatedText(targetPos, lifedraw , TEXTCOLOR_GOLD)
doSendMagicEffect(targetPos, 0)
local pos = getPlayerPosition(cid)
doCreatureAddHealth(cid, lifedraw, 1)
doSendAnimatedText(playerPos,
lifedraw , TEXTCOLOR_GOLD)
doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
else
doCreatureSay(getCreatureTarget(cid), "No Kill Me PLS", 1)
doCreatureSay(cid, "Vasa Daqui antes que eu mude de ideia", 1)
end
end
end

Nenhum comentário:

Postar um comentário