• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Drain Spell

ZionOt

New Member
Joined
Aug 8, 2010
Messages
178
Reaction score
1
Hello, today i am requesting a Drain Spell.

What it does:
lets say the spell words are "Exori Drain" and i use the spell on a Rotworm, i would like it so when i use this spell, it will hit the Rotworm, the Rotworm will lose hp and i will gain some hp.

I would like it skill and level based please.
Thanks OT Land.
 
Lua:
local percentage = 100 / 3

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_LIFEDRAIN)

function onTargetCreature(cid, target) 
	local lvl, mag, hp = getPlayerLevel(cid), getPlayerMagLevel(cid), getCreatureHealth(target)
	local min = lvl / 5 + mag * 2.1
	local max = lvl / 5 + mag * 4.5
	local value = math.min(hp, math.random(min, max))
	doTargetCombatHealth(cid, target, COMBAT_LIFEDRAIN, -value, -value, CONST_ME_NONE)
	doTargetCombatHealth(0, cid, COMBAT_HEALING, value * (percentage / 100), value * (percentage / 100), CONST_ME_MAGIC_BLUE)
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
Don't forget needtarget="1" in spells.xml

Because you didn't mention which skill, I used magic level instead ;c
 
Thanks bud, This is a repp

the spell will be for knights and pallys so i need it uhmmm, skill and level based.
 
Back
Top