• 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!

Update this spell please? :D

Frogq

New Member
Joined
Jun 1, 2010
Messages
45
Reaction score
1
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? :p 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:
( <~> b.u.m.p <~>) Or does anyone else have a similar spell that takes players health and adds it to the casters?
 
PHP:
<instant name="Area of Drain" words="exura mas drain" lvl="40" mana="XXXX" prem="1" blockwalls="1" exhaustion="5000" needlearn="0" event="script" value="custom/areaofdrain.lua">
		<vocation id="6"/>
	</instant>

Use the same script, just change the tag... And in this tag, instead of XXXX, put the amount of mana that the spell will need.
 
Try it out
PHP:
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) 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
 
Tried it out but doesn't work. I think that the script is buged or something, although its from Gesior.pl, so idk. Thanks for the help and maybe someone nice will try to fix it or make a new one with the same effects :D. Rep++ for the help

oh and thank you too half blood, although i had already done changed the xml format. rep++
 
Last edited:
Hey man, I don't understand too much about old spells, but I did a Model Spell, that it's only U change the values, if you wanna try, here you go:

PHP:
-----Model Spell By Yohan-----

local combat = createCombatObject() -- The Combat
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT) -- The type of Combat
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME) -- The type of Effect
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI) -- In case U don't want distance effect
setCombatFormula(combat, COMBAT_FORMULA, mult skill, min dam, mult lvl, max dam) -- The formula

-- This is the area
local arr = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}

local area = createCombatArea(arr) -- Create an area based on the matrix arr
setCombatArea(combat, area) -- Concat the created area with the combat

function onCastSpell(cid, var) -- In case it has more effects, remove this block and add the following
	return doCombat(cid, combat, var)
end

--[[
local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

local function onCastSpell2(parameters)                           
doCombat(parameters.cid, parameters.combat2, parameters.var)
end

function onCastSpell(cid, var)
local parameters = { cid=cid, var=var, combat1=combat1, combat2=combat2 }
addEvent(onCastSpell1, X*1000, parameters)
addEvent(onCastSpell2, X*1000, parameters) -- X = time in seconds.
end
]]--

And thanks for the rep... ;D
 
Back
Top