Well as the post said, I wanted to ask if anyone could update this spell to TFS 0.3.6 . I am not sure if it is even working because all it does is waste my mana, 30% of mana. It is supposed to drain health points from the players around the area and add it to the casters health.
If anyone is able to, can you please help me? I REP++
It is one of Gesior.pl spells:
http://otland.net/f82/gesior-noob-spells-collection-8019/
The name of the spell is Area of Drain:
areaofdrain.lua
Thanks in advance :thumbup:
If anyone is able to, can you please help me? I REP++
It is one of Gesior.pl spells:
http://otland.net/f82/gesior-noob-spells-collection-8019/
The name of the spell is Area of Drain:
Code:
<instant name="Area of Drain" words="exura mas drain" lvl="40" prem="1" aggressive="1" manapercent="30" exhaustion="5000" needlearn="0" script="custom/areaofdrain.lua">
<vocation name="Elder Druid"/>
</instant>
areaofdrain.lua
Code:
local combat = createCombatObject()
arr = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
function spellCallbackLifeDrainArea(param)
if (isPlayer(param.cid)) == 1 then
if (param.hitmin == nil or param.hitmax == nil or param.healmin == nil or param.healmax == nil) then
param.hitmin = math.floor(-getPlayerLevel(param.cid) * 0.1 + -getPlayerMagLevel(param.cid) * 0.1)
param.hitmax = math.floor(-getPlayerLevel(param.cid) * 0.2 + -getPlayerMagLevel(param.cid) * 0.15)
param.healmin = -param.hitmin
param.healmax = -param.hitmax
end
local onPos = param.pos
if param.count > 0 or math.random(0, 1) == 1 then
local creatureToHit = getThingfromPos({x=onPos.x,y=onPos.y,z=onPos.z,stackpos=STACKPOS_TOP_CREATURE})
if isCreature(creatureToHit.uid) == 1 and creatureToHit.uid ~= param.cid then
doCreatureAddHealth(param.cid, math.random(param.healmin, param.healmax+1))
doAreaCombatHealth(param.cid, COMBAT_LIFEDRAIN, param.pos, 0, param.hitmin, param.hitmax, CONST_ME_NONE)
end
end
if(param.count < 30) then
param.count = param.count + 1
addEvent(spellCallbackLifeDrainArea, 500, param)
end
end
end
function onTargetTileLifeDrainArea(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallbackLifeDrainArea(param)
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileLifeDrainArea")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
Thanks in advance :thumbup:
Last edited: