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

Spells give errors TFS 0.3.6pl1

Thorun

New Member
Joined
Jun 17, 2010
Messages
69
Reaction score
0
Location
The Netherlands
Hey,

I use TFS 0.3.6pl1 (crying damson)

I have installed some spells from here and also own made. They work good, but since a day I get errors in console all with:

Code:
[Error - Spell Interface]
In a timer called event from:
data/spells/scripts/xxx.lua:onCastSpell
Description:
(luaDoCombat) Creature not found


Example of one of my spells:

solaris.lua

Lua:
-----------------This Spell was made with Mindrage's Spell Maker v0.56b ---------
--Do not post the spells in any forum without this line or you will be caught!---
--This Software is free to use and can't be for for real-life values!------------
local combat1 = createCombatObject() 
setCombatParam(combat1, COMBAT_PARAM_TYPE, 8)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 36)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 255)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -10,  0, -10,  0)
--=======================================================================
local combat2 = createCombatObject() 
setCombatParam(combat2, COMBAT_PARAM_TYPE, 8)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 6)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 255)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -10,  0, -10,  0)
--=======================================================================
local combat3 = createCombatObject() 
setCombatParam(combat3, COMBAT_PARAM_TYPE, 8)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 15)
setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 255)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -10,  0, -10,  0)
--=======================================================================
local combat4 = createCombatObject() 
setCombatParam(combat4, COMBAT_PARAM_TYPE, 1)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 5)
setCombatParam(combat4, COMBAT_PARAM_DISTANCEEFFECT, 255)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -10,  0, -10,  0)
--=======================================================================
local combat5 = createCombatObject() 
setCombatParam(combat5, COMBAT_PARAM_TYPE, 1)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 36)
setCombatParam(combat5, COMBAT_PARAM_DISTANCEEFFECT, 255)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -10,  0, -10,  0)
--=======================================================================
local combat6 = createCombatObject() 
setCombatParam(combat6, COMBAT_PARAM_TYPE, 1)
setCombatParam(combat6, COMBAT_PARAM_EFFECT, 36)
setCombatParam(combat6, COMBAT_PARAM_DISTANCEEFFECT, 255)
setCombatFormula(combat6, COMBAT_FORMULA_LEVELMAGIC, -10,  0, -10,  0)
--=======================================================================





local area1 = {
{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, 1, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 1, 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 area2 = {
{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, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 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 area3 = {
{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, 1, 1, 0, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 0, 1, 1, 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 area4 = {
{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, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 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 area5 = {
{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, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 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 area6 = {
{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, 1, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 1, 2, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 1, 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}}
--=======================================




setCombatArea(combat1, createCombatArea(area1))
setCombatArea(combat2, createCombatArea(area2))
setCombatArea(combat3, createCombatArea(area3))
setCombatArea(combat4, createCombatArea(area4))
setCombatArea(combat5, createCombatArea(area5))
setCombatArea(combat6, createCombatArea(area6))



function onCastSpell(cid, var)
addEvent(doCombat, 0, cid, combat1, var)
addEvent(doCombat, 0, cid, combat2, var)
addEvent(doCombat, 400, cid, combat3, var)
addEvent(doCombat, 400, cid, combat4, var)
addEvent(doCombat, 400, cid, combat5, var)
addEvent(doCombat, 400, cid, combat6, var)
return TRUE
end


Any help is appreciated!
 
Last edited:
Code:
local area, combat, cType, effect = {
	[1] = {
		{1, 0, 1},
		{0, 2, 0},
		{1, 0, 1}
	},
	[2] = {
		{0, 1, 0},
		{1, 2, 1},
		{0, 1, 0}
	},
	[3] = {
		{1, 1, 0, 1, 1},
		{1, 1, 1, 1, 1},
		{0, 1, 2, 1, 0},
		{1, 1, 1, 1, 1},
		{1, 1, 0, 1, 1}
	},
	[4] = {
		{1, 1, 0, 1, 0, 1, 1},
		{0, 0, 1, 0, 1, 0, 0},
		{1, 0, 0, 2, 0, 0, 1},
		{0, 0, 1, 0, 1, 0, 0},
		{1, 1, 0, 1, 0, 1, 1}
	},
	[5] = {
		{1, 1, 1, 1, 1},
		{1, 1, 0, 1, 1},
		{1, 0, 2, 0, 1},
		{1, 1, 0, 1, 1},
		{1, 1, 1, 1, 1}
	},
	[6] = {
		{0, 0, 1, 0, 1, 0},
		{0, 0, 1, 0, 1, 0},
		{0, 1, 0, 1, 0, 1},
		{1, 0, 1, 2, 1, 1},
		{0, 1, 0, 1, 0, 1},
		{0, 0, 1, 0, 1, 0},
		{0, 0, 1, 0, 1, 0}
	}
}, {}, {
	[1] = COMBAT_FIREDAMAGE,
	[2] = COMBAT_FIREDAMAGE,
	[3] = COMBAT_FIREDAMAGE,
	[4] = COMBAT_PHYSICALDAMAGE,
	[5] = COMBAT_PHYSICALDAMAGE,
	[6] = COMBAT_PHYSICALDAMAGE
}, {
	[1] = CONST_ME_FIREATTACK,
	[2] = CONST_ME_FIREAREA,
	[3] = CONST_ME_HITBYFIRE,
	[4] = CONST_ME_EXPLOSIONHIT,
	[5] = CONST_ME_FIREATTACK,
	[6] = CONST_ME_FIREATTACK
}

for i = 1, #area do
	combat[i] = createCombatObject()
	setCombatParam(combat[i], COMBAT_PARAM_TYPE, cType[i])
	setCombatParam(combat[i], COMBAT_PARAM_EFFECT, effect[i])
	setCombatFormula(combat[i], COMBAT_FORMULA_LEVELMAGIC, -10,  0, -10,  0)
	setCombatArea(combat[i], createCombatArea(area[i]))
end

local function _combat(cid, combat, var)
	return isPlayer(cid) and doCombat(cid, combat, var)
end

function onCastSpell(cid, var)
	for i = 1, #combat do
		addEvent(_combat, i < 3 and 0 or 400, cid, combat[i], var)
	end
	return true
end
 
Thanks.. but I have this with more spells :(
I have tryed to fix it myself, but I got problems with the addEvent doCombat.

This is the script for another spell of me:

Lua:
local area, combat, cType, effect = {
	[1] = {
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 2, 0, 0},
		{0, 1, 0, 0, 0},
		{1, 0, 0, 0, 0}
	},
	[2] = {
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 2, 0, 0},
		{0, 0, 1, 0, 0},
		{0, 0, 1, 0, 0}
	},
	[3] = {
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 2, 0, 0},
		{0, 0, 0, 1, 0},
		{0, 0, 0, 0, 1}
	},
	[4] = {
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 2, 1, 1},
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0}
	},
	[5] = {
		{0, 0, 0, 0, 1},
		{0, 0, 0, 1, 0},
		{0, 0, 2, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0}
	},
	[6] = {
		{0, 0, 1, 0, 0},
		{0, 0, 1, 0, 0},
		{0, 0, 2, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0}
	},
	[7] = {
		{1, 0, 0, 0, 0},
		{0, 1, 0, 0, 0},
		{0, 0, 2, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0}
	},
	[8] = {
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0},
		{1, 1, 2, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0}
	},
	[9] = {
		{0, 0, 0, 1, 0},
		{0, 1, 1, 1, 0},
		{0, 1, 2, 1, 0},
		{0, 1, 1, 1, 0},
		{0, 1, 0, 0, 0}
	},
	[10] = {
		{0, 1, 0, 0, 0},
		{0, 1, 1, 1, 0},
		{0, 1, 2, 1, 0},
		{0, 1, 1, 1, 0},
		{0, 0, 0, 1, 0}
	},
	[11] = {
		{0, 0, 0, 0, 0, 0},
		{0, 1, 1, 1, 1, 1},
		{0, 1, 1, 1, 1, 1},
		{0, 1, 1, 2, 1, 1},
		{0, 1, 1, 1, 1, 1},
		{0, 1, 1, 1, 1, 1},
		{0, 0, 0, 0, 0, 0}
	},
	[12] = {
		{0, 0, 0, 0, 1, 0, 0, 0, 0},
		{0, 0, 0, 1, 1, 1, 0, 0, 0},
		{0, 0, 1, 1, 1, 1, 1, 0, 0},
		{0, 1, 1, 1, 1, 1, 1, 1, 0},
		{1, 1, 1, 1, 2, 1, 1, 1, 1},
		{0, 1, 1, 1, 1, 1, 1, 1, 0},
		{0, 0, 1, 1, 1, 1, 1, 0, 0},
		{0, 0, 0, 1, 1, 1, 0, 0, 0},
		{0, 0, 0, 0, 1, 0, 0, 0, 0}		
	}
}, {}, {
	[1] = COMBAT_PHYSICALDAMAGE,
	[2] = COMBAT_PHYSICALDAMAGE,
	[3] = COMBAT_PHYSICALDAMAGE,
	[4] = COMBAT_PHYSICALDAMAGE,
	[5] = COMBAT_PHYSICALDAMAGE,
	[6] = COMBAT_PHYSICALDAMAGE,
	[7] = COMBAT_PHYSICALDAMAGE,
	[8] = COMBAT_PHYSICALDAMAGE,
	[9] = COMBAT_PHYSICALDAMAGE,
	[10] = COMBAT_PHYSICALDAMAGE,
	[11] = COMBAT_PHYSICALDAMAGE,
	[12] = COMBAT_PHYSICALDAMAGE
}, {
	[1] = CONST_ME_FIREWORK_YELLOW,
	[2] = CONST_ME_FIREWORK_RED,
	[3] = CONST_ME_FIREWORK_BLUE,
	[4] = CONST_ME_FIREWORK_YELLOW,
	[5] = CONST_ME_FIREWORK_RED,
	[6] = CONST_ME_FIREWORK_BLUE,
	[7] = CONST_ME_FIREWORK_YELLOW,
	[8] = CONST_ME_FIREWORK_RED,
	[9] = CONST_ME_FIREWORK_BLUE,
	[10] = CONST_ME_FIREWORK_BLUE,
	[11] = CONST_ME_FIREWORK_BLUE,
	[12] = CONST_ME_FIREWORK_BLUE

}

for i = 1, #area do
	combat[i] = createCombatObject()
	setCombatParam(combat[i], COMBAT_PARAM_TYPE, cType[i])
	setCombatParam(combat[i], COMBAT_PARAM_EFFECT, effect[i])
	setCombatFormula(combat[i], COMBAT_FORMULA_LEVELMAGIC, -9.2,  0, -9.2,  0)
	setCombatArea(combat[i], createCombatArea(area[i]))
end

local function _combat(cid, combat, var)
	return isPlayer(cid) and doCombat(cid, combat, var)
end

function onCastSpell(cid, var)
	for i = 1, #combat do
		addEvent(_combat, i < 3 and 0 or 400, cid, combat[i], var)
	end
	return true
end

Now I want it to have this time:

Lua:
addEvent(doCombat, 0, cid, combat1, var)
addEvent(doCombat, 150, cid, combat2, var)
addEvent(doCombat, 250, cid, combat3, var)
addEvent(doCombat, 350, cid, combat4, var)
addEvent(doCombat, 450, cid, combat5, var)
addEvent(doCombat, 550, cid, combat6, var)
addEvent(doCombat, 650, cid, combat7, var)
addEvent(doCombat, 750, cid, combat8, var)
addEvent(doCombat, 1000, cid, combat9, var)
addEvent(doCombat, 1500, cid, combat10, var)
addEvent(doCombat, 2000, cid, combat11, var)
addEvent(doCombat, 2500, cid, combat12, var)

I tryed to put

Lua:
		addEvent(_combat, i < 3 and 0 or 2500, cid, combat[i], var)

But the area's come all at the same time..
 
Last edited:
Code:
local area, combat, cType, effect = {
	[1] = {
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 2, 0, 0},
		{0, 1, 0, 0, 0},
		{1, 0, 0, 0, 0}
	},
	[2] = {
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 2, 0, 0},
		{0, 0, 1, 0, 0},
		{0, 0, 1, 0, 0}
	},
	[3] = {
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 2, 0, 0},
		{0, 0, 0, 1, 0},
		{0, 0, 0, 0, 1}
	},
	[4] = {
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 2, 1, 1},
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0}
	},
	[5] = {
		{0, 0, 0, 0, 1},
		{0, 0, 0, 1, 0},
		{0, 0, 2, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0}
	},
	[6] = {
		{0, 0, 1, 0, 0},
		{0, 0, 1, 0, 0},
		{0, 0, 2, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0}
	},
	[7] = {
		{1, 0, 0, 0, 0},
		{0, 1, 0, 0, 0},
		{0, 0, 2, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0}
	},
	[8] = {
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0},
		{1, 1, 2, 0, 0},
		{0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0}
	},
	[9] = {
		{0, 0, 0, 1, 0},
		{0, 1, 1, 1, 0},
		{0, 1, 2, 1, 0},
		{0, 1, 1, 1, 0},
		{0, 1, 0, 0, 0}
	},
	[10] = {
		{0, 1, 0, 0, 0},
		{0, 1, 1, 1, 0},
		{0, 1, 2, 1, 0},
		{0, 1, 1, 1, 0},
		{0, 0, 0, 1, 0}
	},
	[11] = {
		{0, 0, 0, 0, 0, 0},
		{0, 1, 1, 1, 1, 1},
		{0, 1, 1, 1, 1, 1},
		{0, 1, 1, 2, 1, 1},
		{0, 1, 1, 1, 1, 1},
		{0, 1, 1, 1, 1, 1},
		{0, 0, 0, 0, 0, 0}
	},
	[12] = {
		{0, 0, 0, 0, 1, 0, 0, 0, 0},
		{0, 0, 0, 1, 1, 1, 0, 0, 0},
		{0, 0, 1, 1, 1, 1, 1, 0, 0},
		{0, 1, 1, 1, 1, 1, 1, 1, 0},
		{1, 1, 1, 1, 2, 1, 1, 1, 1},
		{0, 1, 1, 1, 1, 1, 1, 1, 0},
		{0, 0, 1, 1, 1, 1, 1, 0, 0},
		{0, 0, 0, 1, 1, 1, 0, 0, 0},
		{0, 0, 0, 0, 1, 0, 0, 0, 0}        
	}
}, {}, {
	[1] = COMBAT_PHYSICALDAMAGE,
	[2] = COMBAT_PHYSICALDAMAGE,
	[3] = COMBAT_PHYSICALDAMAGE,
	[4] = COMBAT_PHYSICALDAMAGE,
	[5] = COMBAT_PHYSICALDAMAGE,
	[6] = COMBAT_PHYSICALDAMAGE,
	[7] = COMBAT_PHYSICALDAMAGE,
	[8] = COMBAT_PHYSICALDAMAGE,
	[9] = COMBAT_PHYSICALDAMAGE,
	[10] = COMBAT_PHYSICALDAMAGE,
	[11] = COMBAT_PHYSICALDAMAGE,
	[12] = COMBAT_PHYSICALDAMAGE
}, {
	[1] = CONST_ME_FIREWORK_YELLOW,
	[2] = CONST_ME_FIREWORK_RED,
	[3] = CONST_ME_FIREWORK_BLUE,
	[4] = CONST_ME_FIREWORK_YELLOW,
	[5] = CONST_ME_FIREWORK_RED,
	[6] = CONST_ME_FIREWORK_BLUE,
	[7] = CONST_ME_FIREWORK_YELLOW,
	[8] = CONST_ME_FIREWORK_RED,
	[9] = CONST_ME_FIREWORK_BLUE,
	[10] = CONST_ME_FIREWORK_BLUE,
	[11] = CONST_ME_FIREWORK_BLUE,
	[12] = CONST_ME_FIREWORK_BLUE

}

for i = 1, #area do
	combat[i] = createCombatObject()
	setCombatParam(combat[i], COMBAT_PARAM_TYPE, cType[i])
	setCombatParam(combat[i], COMBAT_PARAM_EFFECT, effect[i])
	setCombatFormula(combat[i], COMBAT_FORMULA_LEVELMAGIC, -9.2,  0, -9.2,  0)
	setCombatArea(combat[i], createCombatArea(area[i]))
end

local function _combat(cid, combat, var)
	return isPlayer(cid) and doCombat(cid, combat, var)
end

function onCastSpell(cid, var)
	for i = 1, #combat do
		addEvent(_combat, i == 1 and 0 or i < 9 and (50 + ((i-1) * 100)) or ((i-7) * 500), cid, combat[i], var)
	end
	return true
end
 
Thanks, I understand now how to use it, and I can do it by myself.
But this spell:

It has other time, how do I do this one?

Lua:
addEvent(onCastSpell1, 300, parameters)
addEvent(onCastSpell2, 600, parameters)
addEvent(onCastSpell3, 900, parameters)
addEvent(onCastSpell4, 1200, parameters)
addEvent(onCastSpell5, 450, parameters)
addEvent(onCastSpell6, 750, parameters)
addEvent(onCastSpell7, 1050, parameters)
addEvent(onCastSpell8, 0, parameters)
 
Last edited:
^.-
Code:
local time = {
	[1] = 300, [2] = 600, [3] = 900, [4] = 1200,
	[5] = 450, [6] = 750, [7] = 1050, [8] = 0
}
		addEvent(_combat, time[i], cid, combat[i], var)
 
Where do I put this

PHP:
local time = {
	[1] = 100, [2] = 200, [3] = 300, [4] = 400,
	[5] = 500, [6] = 600, [7] = 700, [8] = 800
}
		addEvent(_combat, time[i], cid, combat[i], var)
 
Last edited:
Help please!!


Where do I put this

PHP:
local time = {
    [1] = 100, [2] = 200, [3] = 300, [4] = 400,
    [5] = 500, [6] = 600, [7] = 700, [8] = 800
}
        addEvent(_combat, time[i], cid, combat[i], var)
 
Man, need help!!!


Help please!!


Where do I put this
PHP:
local time = {
    [1] = 100, [2] = 200, [3] = 300, [4] = 400,
    [5] = 500, [6] = 600, [7] = 700, [8] = 800
}
        addEvent(_combat, time[i], cid, combat[i], var)
 
Not work, spell no work please where i put this

PHP:
local time = {
    [1] = 100, [2] = 200, [3] = 300, [4] = 400,
    [5] = 500, [6] = 600, [7] = 700, [8] = 800
}
        addEvent(_combat, time[i], cid, combat[i], var)
 
in data/lib/000-constant.lua add:
Code:
t={}
repeat 
local time = {
    [1] = 100, [2] = 200, [3] = 300, [4] = 400,
    [5] = 500, [6] = 600, [7] = 700, [8] = 800
}
    table.insert(t, time)
until false
not tested, but should work
 
Back
Top