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

Spell Gesior Noob-spells collection :)

Gesior.pl

Mega Noob&LOL 2012
Senator
Joined
Sep 18, 2007
Messages
2,955
Solutions
98
Reaction score
3,351
Location
Poland
GitHub
gesior
Nice spells for servers with fast connection (dont use much CPU/ram!). Tested on TFS 0.3 beta engine. Spells:
Mortocalypse - shot "mort" on area like UE, hit each tile 5 or more times
Hellfire - like Mortocalypse, but attack by fire
Area of Life - heal all creatures on area like UE, heal 1 time/sec, area stay 15 seconds
Area of Drain - drain HP (2 times/sec) from all creatures on area like UE and give their HP to player who casted spell (he can run away), stay 15 seconds
Xena - big stone hit player attacked on battle, find another target in range 3 sqm and hit, hit up to 8 enemies, if can't find enemy or hit 8 times stone come back to player who cast spell :)
Light Chain - hit creature attacked on battle and creatures near him >> find new target in range 3 sqm >> hit another target, hit up to 5 targets, max. one time one creature
1.
Code:
	<instant name="Mortocalypse" words="exevo gran mort" lvl="40" prem="1" aggressive="1" manapercent="40" exhaustion="5000" needlearn="0" script="custom/mortocalypse.lua">
		<vocation name="Master Sorcerer"/>
	</instant>
mortocalypse.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, TRUE)
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 spellCallbackMort(param)
	if (isPlayer(param.cid)) == 1 then
		if(param.hitmin == nil or param.hitmax == nil) then
			param.hitmin = math.floor(-getPlayerLevel(param.cid) * 0.5 + -getPlayerMagLevel(param.cid) * 1)
			param.hitmax = math.floor(-getPlayerLevel(param.cid) * 0.7 + -getPlayerMagLevel(param.cid) * 1.2)
		end
		if param.count > 0 or math.random(0, 1) == 1 then
			doAreaCombatHealth(param.cid, COMBAT_DEATHDAMAGE, param.pos, 0, param.hitmin, param.hitmax, CONST_ME_MORTAREA)
			doSendDistanceShoot(getCreaturePosition(param.cid), param.pos, CONST_ANI_DEATH)
		end

		if(param.count < 3) then
			param.count = param.count + 1
			addEvent(spellCallbackMort, math.random(1000, 3000), param)
		end
	end
end

function onTargetTileMort(cid, pos)
	local param = {}
	param.cid = cid
	param.pos = pos
	param.count = 0
	spellCallbackMort(param)
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileMort")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
2.
Code:
	<instant name="Hellfire" words="exevo gran flam" lvl="40" prem="1" aggressive="1" manapercent="40" exhaustion="5000" needlearn="0" script="custom/apocalypse.lua">
		<vocation name="Elder Druid"/>
	</instant>
apocalypse.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, TRUE)
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 spellCallbackFire(param)
	if (isPlayer(param.cid)) == 1 then
		if (param.hitmin == nil or param.hitmax == nil) then
			param.hitmin = math.floor(-getPlayerLevel(param.cid) * 0.5 + -getPlayerMagLevel(param.cid) * 1)
			param.hitmax = math.floor(-getPlayerLevel(param.cid) * 0.7 + -getPlayerMagLevel(param.cid) * 1.2)
		end
		if param.count > 0 or math.random(0, 1) == 1 then
			doAreaCombatHealth(param.cid, COMBAT_FIREDAMAGE, param.pos, 0, param.hitmin, param.hitmax, CONST_ME_HITBYFIRE)
			doSendDistanceShoot(getCreaturePosition(param.cid), param.pos, CONST_ANI_FIRE)
		end

		if(param.count < 3) then
			param.count = param.count + 1
			addEvent(spellCallbackFire, math.random(1000, 3000), param)
		end
	end
end

function onTargetTileFire(cid, pos)
	local param = {}
	param.cid = cid
	param.pos = pos
	param.count = 0
	spellCallbackFire(param)
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileFire")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
3.
Code:
	<instant name="Area of Life" words="exura mas area" lvl="40" aggressive="0" prem="1" manapercent="20" exhaustion="5000" needlearn="0" script="custom/areaoflife.lua">
		<vocation name="Elder Druid"/>
	</instant>
areaoflife.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
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 spellCallbackLifeArea(param)
	if (isPlayer(param.cid)) == 1 then
		if(param.hitmin == nil or param.hitmax == nil) then
			param.hitmin = math.floor(getPlayerLevel(param.cid) * 1 + getPlayerMagLevel(param.cid) * 1)
			param.hitmax = math.floor(getPlayerLevel(param.cid) * 1.4 + getPlayerMagLevel(param.cid) * 1.2)
		end
		if param.count > 0 or math.random(0, 1) == 1 then
			doAreaCombatHealth(param.cid, COMBAT_HEALING, param.pos, 0, param.hitmin, param.hitmax, CONST_ME_BUBBLES)
		end
		if math.random(0, 30) == 1 then
			doCreatureAddHealth(param.cid, math.random(param.hitmin, param.hitmax))
		end
		if(param.count < 15) then
			param.count = param.count + 1
			addEvent(spellCallbackLifeArea, 1000, param)
		end
	end
end

function onTargetTileLifeArea(cid, pos)
	local param = {}
	param.cid = cid
	param.pos = pos
	param.count = 0
	spellCallbackLifeArea(param)
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileLifeArea")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
4.
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
5.
Code:
	<instant name="Xena" words="exori xena" lvl="10" mana="250" prem="1" range="7" blockwalls="1" needtarget="1" exhaustion="2000" needlearn="0" script="custom/xena.lua">
		<vocation name="Royal Paladin"/>
	</instant>
xena.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, TRUE)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 3000)
setConditionFormula(condition, -0.3, 0, -0.3, 0)
setCombatCondition(combat, condition)

function getSpellDamageXena(cid, weaponSkill, weaponAttack, attackStrength)
	local attack = 35 --Spear's attack
	local skill = getPlayerSkill(cid, CONST_SKILL_DISTANCE)

	local maxWeaponDamage = (skill * attack) / 20 + attack
	local damage = -((math.random(0, maxWeaponDamage) * attackStrength) / 20) * 0.8 --0.8 is the multiplier

	return damage, damage --The random part of the formula has already been made, just return the normal damage
end

function xenaHit(param)
	if isCreature(param.cid) == TRUE and isCreature(variantToNumber(param.var)) == TRUE then
		doSendDistanceShoot(param.fromcidpos, getCreaturePosition(variantToNumber(param.var)), CONST_ANI_LARGEROCK)
		doCombat(param.cid, param.combat, param.var)
		param.fromcidpos = getCreaturePosition(variantToNumber(param.var))
		table.insert(param.notHitCidArray, variantToNumber(param.var))
		param.count = param.count + 1
		if (param.lastshot == 0) then
			local enemies = getMonstersInArea3(param.fromcidpos, param.notHitCidArray)
			if (enemies.number > 0) and (param.count < 8) then
				local enemiesList = enemies.list
				local randenemy = math.random(1, enemies.number)
				param.var = numberToVariant(enemiesList[randenemy])
			else
				param.var = numberToVariant(param.cid)
				param.lastshot = 1
			end
			addEvent(xenaHit, 200, param)
		end
	end
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamageXena")

function onCastSpell(cid, var)
	if(variantToNumber(var) ~= 0) then
		if isCreature(variantToNumber(var)) == TRUE then
			local param = {}
			param.cid = cid
			param.fromcidpos = getCreaturePosition(cid)
			param.var = var
			param.combat = combat
			param.count = 0
			param.lastshot = 0
			param.notHitCidArray = {cid}
			addEvent(xenaHit, 1, param)
		end
	end
	return true
end
6.
Code:
	<instant name="Light Chain" words="exevo vis mas" lvl="10" mana="1200" prem="1" range="7" blockwalls="1" needtarget="1" exhaustion="3000" needlearn="0" script="custom/lightchain.lua">
		<vocation name="Master Sorcerer"/>
		<vocation name="Elder Druid"/>
	</instant>
lightchain.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 3000)
setConditionFormula(condition, -0.2, 0, -0.2, 0)
setCombatCondition(combat, condition)

local combatSmall = createCombatObject()
setCombatParam(combatSmall, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)

function getSpellDamageLightChain(cid, level, maglevel)
	local damage = -math.floor(((math.random(200, 400) * level) + (math.random(200, 300) * maglevel)) / 100)
	return damage, damage --The random part of the formula has already been made, just return the normal damage
end

function getSpellDamageLightChainSmall(cid, level, maglevel)
	local damage = -math.floor(((math.random(200, 400) * level) + (math.random(200, 300) * maglevel)) / 400)
	return damage, damage --The random part of the formula has already been made, just return the normal damage
end

function lightChainHit(param)
	if isCreature(param.cid) == TRUE and isCreature(variantToNumber(param.var)) == TRUE then
		doSendDistanceShoot(param.fromcidpos, getCreaturePosition(variantToNumber(param.var)), CONST_ANI_HOLY)
		doCombat(param.cid, param.combat, param.var)
		param.fromcidpos = getCreaturePosition(variantToNumber(param.var))
		param.count = param.count + 1
		local enemies = getMonstersInArea3(param.fromcidpos, param.notHitCidArray)
		if (enemies.number > 0) and (param.count < 5) then
			local enemiesList = enemies.list
			local randenemy = math.random(1, enemies.number)
			param.var = numberToVariant(enemiesList[randenemy])
			table.insert(param.notHitCidArray, variantToNumber(param.var))
			local subenemies = getMonstersInArea1(param.fromcidpos, param.notHitCidArray)
			if (subenemies.number > 0) then
				local nearenemieslist = subenemies.list
				for i = 1, subenemies.number do
					doCombat(param.cid, param.combatSmall, numberToVariant(nearenemieslist[i]))
					doSendDistanceShoot(param.fromcidpos, numberToVariant(nearenemieslist[i]), CONST_ANI_ENERGY)
				end
			end
			addEvent(lightChainHit, 200, param)
		end
	end
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getSpellDamageLightChain")
setCombatCallback(combatSmall, CALLBACK_PARAM_LEVELMAGICVALUE, "getSpellDamageLightChainSmall")

function onCastSpell(cid, var)
	if(variantToNumber(var) ~= 0) then
		if isCreature(variantToNumber(var)) == TRUE then
			local param = {}
			param.cid = cid
			param.fromcidpos = getCreaturePosition(cid)
			param.var = var
			param.combat = combat
			param.combatSmall = combatSmall
			param.count = 0
			param.lastshot = 0
			param.notHitCidArray = {cid, variantToNumber(var)}
			addEvent(lightChainHit, 50, param)
		end
	end
	return true
end
Before you can use Xena or Light Chain spell you must add in functions.lua or global.lua
Code:
function getMonstersInArea3(cidpos, notCidArray)
	local playernumber = 0
	local playersInRange = {}
		local pPos = cidpos
		local positionsToCheck = {
		{x=pPos.x-3,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-3,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-3,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-3,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-3,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-3,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-3,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE}
		}
		for i = 1, table.maxn(positionsToCheck) do
			local creatureToHit = getThingfromPos(positionsToCheck[i])
			if getTilePzInfo(positionsToCheck[i]) == 0 then
				if isCreature(creatureToHit.uid) == TRUE and creatureToHit.uid ~= cid and isInArray(notCidArray, creatureToHit.uid) ~= TRUE then
					table.insert(playersInRange, creatureToHit.uid)
					playernumber = playernumber + 1
				end
			end
		end
	return {list = playersInRange, number = playernumber}
end

function getMonstersInArea1(cidpos, notCidArray)
	local playernumber = 0
	local playersInRange = {}
		local pPos = cidpos
		local positionsToCheck = {
		{x=pPos.x-1,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-1,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-1,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		}
		for i = 1, table.maxn(positionsToCheck) do
			local creatureToHit = getThingfromPos(positionsToCheck[i])
			if getTilePzInfo(positionsToCheck[i]) == 0 then
				if isCreature(creatureToHit.uid) == TRUE and creatureToHit.uid ~= cid and isInArray(notCidArray, creatureToHit.uid) ~= TRUE then
					table.insert(playersInRange, creatureToHit.uid)
					playernumber = playernumber + 1
				end
			end
		end
	return {list = playersInRange, number = playernumber}
end
 
No screens, that are animated spells, most important are animation effects :p
Maaaybe I'll post movie.
 
when I use light chain I got this error in console:

Code:
[14/07/2008  17:47:21] luaGetThingfromPos(). Tile not found

[14/07/2008  17:47:21] Lua Script Error: [Spell Interface] 
[14/07/2008  17:47:21] in a timer event called from: 
[14/07/2008  17:47:21] data/spells/scripts/custom/lightchain.lua:onCastSpell

[14/07/2008  17:47:21] luaGetTilePzInfo(). Tile not found

[14/07/2008  17:47:21] Lua Script Error: [Spell Interface] 
[14/07/2008  17:47:21] in a timer event called from: 
[14/07/2008  17:47:21] data/spells/scripts/custom/lightchain.lua:onCastSpell

[14/07/2008  17:47:21] luaGetThingfromPos(). Tile not found

[14/07/2008  17:47:21] Lua Script Error: [Spell Interface] 
[14/07/2008  17:47:21] in a timer event called from: 
[14/07/2008  17:47:21] data/spells/scripts/custom/lightchain.lua:onCastSpell

[14/07/2008  17:47:21] luaGetTilePzInfo(). Tile not found

[14/07/2008  17:47:21] Lua Script Error: [Spell Interface] 
[14/07/2008  17:47:21] in a timer event called from: 
[14/07/2008  17:47:21] data/spells/scripts/custom/lightchain.lua:onCastSpell

[14/07/2008  17:47:21] luaGetThingfromPos(). Tile not found

[14/07/2008  17:47:21] Lua Script Error: [Spell Interface] 
[14/07/2008  17:47:21] in a timer event called from: 
[14/07/2008  17:47:21] data/spells/scripts/custom/lightchain.lua:onCastSpell

[14/07/2008  17:47:21] luaGetTilePzInfo(). Tile not found

[14/07/2008  17:47:21] Lua Script Error: [Spell Interface] 
[14/07/2008  17:47:21] in a timer event called from: 
[14/07/2008  17:47:21] data/spells/scripts/custom/lightchain.lua:onCastSpell

[14/07/2008  17:47:21] luaGetThingfromPos(). Tile not found

[14/07/2008  17:47:21] Lua Script Error: [Spell Interface] 
[14/07/2008  17:47:21] in a timer event called from: 
[14/07/2008  17:47:21] data/spells/scripts/custom/lightchain.lua:onCastSpell

[14/07/2008  17:47:21] luaGetTilePzInfo(). Tile not found


and spell works, but very freeze my server ;(

it case just when there are no space (caves,towers), in open territory works fine
 
Last edited:
In getMonstersInArea cid is nil + it could be easier made :p
PHP:
function getCreatureInArea(cid, radius, exceptions)
	local creatures = {}
	local pPos = getPlayerPosition(cid)
	local fromPos = {x=pPos.x-radius, y=pPos.y-radius, z=pPos.z}
	local toPos = {x=pPos.x+radius, y=pPos.y+radius, z=pPos.z}
	for pos, thing in mapArea(fromPos, toPos, STACKPOS_TOP_CREATURE) do
		if getTilePzInfo(pos) == FALSE and isCreature(thing.uid) == TRUE and thing.uid ~= cid then
			if not exceptions or isInArray(exceptions, thing.uid) == FALSE then
				table.insert(creatures, thing.uid)
			end
		end
	end
	return creatures
end

You don't need to return amount, since you only need to write #creatures to get the amount ;p

And for this you will need my mapArea function that is in the Lua Functions subforum :)

Nice spells anyhow, keep 'em coming ;)
 
thanks, I will try now :>

edit, @colandus, can you show what I must change?


HTML:
function getCreatureInArea(cid, radius, exceptions) 
    local creatures = {} 
    local pPos = getPlayerPosition(cid) 
    local fromPos = {x=pPos.x-radius, y=pPos.y-radius, z=pPos.z} 
    local toPos = {x=pPos.x+radius, y=pPos.y+radius, z=pPos.z} 
    for pos, thing in mapArea(fromPos, toPos, STACKPOS_TOP_CREATURE) do 
        if getTilePzInfo(pos) == FALSE and isCreature(thing.uid) == TRUE and thing.uid ~= cid then 
            if not exceptions or isInArray(exceptions, thing.uid) == FALSE then 
                table.insert(creatures, thing.uid) 
            end 
        end 
    end 
    return creatures 
end 

function isInArea(pos, fromPos, toPos) 
    if pos.x >= fromPos.x and pos.x <= toPos.x then 
        if pos.y >= fromPos.y and pos.y <= toPos.y then 
            if pos.z >= fromPos.z and pos.z <= toPos.z then 
                return true 
            end 
        end 
    end 
    return false 
end


to functions and what more? ;D sorry for noobish, but really tryed :D
 
Last edited:
I think you should leave it for Gesior to edit, plus it was mapArea and not isInArea
 
anyone happen to know the full

spellCallback variaties??? or were to find them or what is the rule for them....

like:

spellCallbackMort
spellCallbackFire
spellCallbackLifedrain

ETC

And its there a way to add weapon effects to them? (axe, arrows, spears, etc)

Thanks!!
 
Last edited:
man..very cool spells!!i never see somthing that,lightchain is awful.

powodzenia,jesli sam je zrobiles to szacun,oby bylo takich spellow wiecej
 
I must ask, are they working with tfs 0.3.4? cuz dont know why but light chain (and xena probably) are hitting only one target, and rest of spells just show words and nothing happens, no errors in the console
 
Before you can use Xena or Light Chain spell you must add in functions.lua or global.lua
Code:
function getMonstersInArea3(cidpos, notCidArray)
	local playernumber = 0
	local playersInRange = {}
		local pPos = cidpos
		local positionsToCheck = {
		{x=pPos.x-3,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y+3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-3,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y+2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-3,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-3,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-3,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-3,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y-2,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-3,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-2,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x-1,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+2,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+3,y=pPos.y-3,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE}
		}
		for i = 1, table.maxn(positionsToCheck) do
			local creatureToHit = getThingfromPos(positionsToCheck[i])
			if getTilePzInfo(positionsToCheck[i]) == 0 then
				if isCreature(creatureToHit.uid) == TRUE and creatureToHit.uid ~= cid and isInArray(notCidArray, creatureToHit.uid) ~= TRUE then
					table.insert(playersInRange, creatureToHit.uid)
					playernumber = playernumber + 1
				end
			end
		end
	return {list = playersInRange, number = playernumber}
end

function getMonstersInArea1(cidpos, notCidArray)
	local playernumber = 0
	local playersInRange = {}
		local pPos = cidpos
		local positionsToCheck = {
		{x=pPos.x-1,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y+1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-1,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		{x=pPos.x-1,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},{x=pPos.x+1,y=pPos.y-1,z=pPos.z,stackpos=STACKPOS_TOP_CREATURE},
		}
		for i = 1, table.maxn(positionsToCheck) do
			local creatureToHit = getThingfromPos(positionsToCheck[i])
			if getTilePzInfo(positionsToCheck[i]) == 0 then
				if isCreature(creatureToHit.uid) == TRUE and creatureToHit.uid ~= cid and isInArray(notCidArray, creatureToHit.uid) ~= TRUE then
					table.insert(playersInRange, creatureToHit.uid)
					playernumber = playernumber + 1
				end
			end
		end
	return {list = playersInRange, number = playernumber}
end

Not sure if you read the above message in the first post..if you did then maybe it just does not work for 0.3.4.
 
Back
Top