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

Lua Spell error on death!

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
Hey i still have problem with my spells!
I wanna know how i can remove that error in consol any one know? i got alot of errors...
error message:
Code:
[30/01/2010 06:16:01] [Error - Spell Interface] 
[30/01/2010 06:16:01] In a timer event called from: 
[30/01/2010 06:16:02] mods/scripts/druid/wizardbeam.lua:onCastSpell
[30/01/2010 06:16:02] Description: 
[30/01/2010 06:16:02] (luaDoCombat) Creature not found

Code of the spell:
Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 37)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -23.3, -184, -38, -840)
 
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 47)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -26.3, -184, -38, -640)
 
local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 48)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -12.3, -184, -31, -540)
 
local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 37)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -22.3, -184, -38, -740)
 
local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 48)
setCombatFormula(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{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}
}
 
arr4 = {
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
{0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0},
{0, 1, 0, 0, 1, 2, 1, 0, 0, 1, 0},
{0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0},
{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 0, 1, 1, 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}
}
 
arr5 = {
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 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, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}
}
 
local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)
setCombatArea(combat5, area5)
 
local function onCastSpell1(parameters)
    doCombat(parameters.cid, combat1, parameters.var)
end
 
local function onCastSpell2(parameters)
    doCombat(parameters.cid, combat2, parameters.var)
end
 
local function onCastSpell3(parameters)
    doCombat(parameters.cid, combat3, parameters.var)
end
 
local function onCastSpell4(parameters)
    doCombat(parameters.cid, combat4, parameters.var)
end
 
local function onCastSpell5(parameters)
    doCombat(parameters.cid, combat5, parameters.var)
end
 
function onCastSpell(cid, var)
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4, combat5 = combat5 } 
addEvent(onCastSpell1, 100, parameters)
addEvent(onCastSpell2, 200, parameters)
addEvent(onCastSpell3, 300, parameters)
addEvent(onCastSpell4, 400, parameters)
addEvent(onCastSpell5, 500, parameters)
return true
end
 
Code:
 combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4, combat5 = combat5 }
I guess to delete it... Er, its not necessary.

I also guess to replace parameters variable with two variables: cid and var.

You can make a "global" (in spell) variable which will store cid and var. Then u may call it anywhere in the script (i mean - will be able to use addEvent without any parameters - just like: addEvent(onCast1, 2000))

Btw. if the problem is: Spell error on death!
You should check is the character online (and is not in peace zone? mm, may not) in each timer (as i think).
 
well when the player die before the whole spell have been used it hit on the same square many time witch couses this error i think!
i get many errors on that person that died and this is kinda enoying and i think it's cousing lags also!...
i need some one that can fix all this errors...
 
Code:
local effects, formulas, area, combat = {
	37, 47, 48, 37, 48
},
{
	{-23.3, -184, -38, -840},
	{-26.3, -184, -38, -640},
	{-12.3, -184, -31, -540},
	{-22.3, -184, -38, -740},
	{-23.3, -184, -39, -440}
},
{
	{
		{0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0},
		{0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0},
		{0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0},
		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, 0, 0},
		{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
		{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
		{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
		{0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0},
		{0, 1, 0, 0, 1, 2, 1, 0, 0, 1, 0},
		{0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0},
		{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
		{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
		{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0}
	},
	{
		{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
		{0, 0, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
		{0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0},
		{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 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, 1, 1, 1, 1, 1, 1, 1, 0, 0},
		{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}
	}
}, {}
for i = 1, #area do
	table.insert(combat, createCombatObject())
	setCombatParam(combat[i], COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
	setCombatParam(combat[i], COMBAT_PARAM_EFFECT, effects[i])
	setCombatFormula(combat[i], COMBAT_FORMULA_LEVELMAGIC, formulas[i][1], formulas[i][2], formulas[i][3], formulas[i][4])
	setCombatArea(combat[i], createCombatArea(area[i]))
end

function onCastSpell(cid, var)
	for i = 1, #area do
		addEvent(function(cid, combat, var) if isPlayer(cid) == TRUE then doCombat(cid, combat, var) end end, i * 100, cid, combat[i], var)
	end
	return TRUE
end
 
1 more spell here:
Code:
[30/01/2010 11:13:05] [Error - Spell Interface] 
[30/01/2010 11:13:05] In a timer event called from: 
[30/01/2010 11:13:06] mods/scripts/knight/star dude.lua:onCastSpell
[30/01/2010 11:13:06] Description: 
[30/01/2010 11:13:06] (luaDoCombat) Creature not found

[30/01/2010 11:13:07] [Error - Spell Interface] 
[30/01/2010 11:13:07] In a timer event called from: 
[30/01/2010 11:13:07] mods/scripts/knight/star dude.lua:onCastSpell
[30/01/2010 11:13:08] Description: 
[30/01/2010 11:13:08] (luaDoCombat) Creature not found

code:

Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 3)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -54.63, -124, -43.2, -240)
 
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 3)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -65.3, -114, -43.1, -640)
 
local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 3)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -42.44, -104, -53.6, -240)
 
local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 3)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -52.53, -124, -46.2, -540)
 
local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 3)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -62.43, -104, -47.3,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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
}
arr4 = {
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
}
 
arr5 = {
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
}
 
 
local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)

 
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)
setCombatArea(combat5, area5)
 
local function onCastSpell1(parameters)
    doCombat(parameters.cid, combat1, parameters.var)
end
 
local function onCastSpell2(parameters)
    doCombat(parameters.cid, combat2, parameters.var)
end
 
local function onCastSpell3(parameters)
    doCombat(parameters.cid, combat3, parameters.var)
end
 
local function onCastSpell4(parameters)
    doCombat(parameters.cid, combat4, parameters.var)
end
local function onCastSpell5(parameters)
    doCombat(parameters.cid, combat5, parameters.var)
end
 
function onCastSpell(cid, var)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 100, parameters)
addEvent(onCastSpell2, 300, parameters)
addEvent(onCastSpell3, 500, parameters)
addEvent(onCastSpell4, 700, parameters)
addEvent(onCastSpell5, 900, parameters)
return true
end
 
fuuuuuuuuuuuu
Code:
local formulas, area, combat = {
	{-54.63, -124, -43.2, -240},
	{-65.3,  -114, -43.1, -640},
	{-42.44, -104, -53.6, -240},
	{-52.53, -124, -46.2, -540},
	{-62.43, -104, -47.3, -440}
},
{
	{
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
	},
	{
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1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, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
	},
	{
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
	}
}, {}
for i = 1, 5 do
	table.insert(combat, createCombatObject())
	setCombatParam(combat[i], COMBAT_PARAM_TYPE, i == 5 and COMBAT_DEATHDAMAGE or COMBAT_PHYSICALDAMAGE)
	setCombatParam(combat[i], COMBAT_PARAM_EFFECT, 3)
	setCombatFormula(combat[i], COMBAT_FORMULA_LEVELMAGIC, formulas[i][1], formulas[i][2], formulas[i][3], formulas[i][4])
	setCombatArea(combat[i], createCombatArea(area[i]))
end

function onCastSpell(cid, var)
	for i = 1, 5 do
		addEvent(function(cid, combat, var) if isPlayer(cid) == TRUE then doCombat(cid, combat, var) end end, i * 200 - 100, cid, combat[i], var)
	end
	return TRUE
end
 
Last edited:
Cykotitan can you help me fix some bugged spells?:/


[30/01/2010 11:54:22] [Error - Spell Interface]
[30/01/2010 11:54:22] In a timer event called from:
[30/01/2010 11:54:23] mods/scripts/knight/berserk guard.lua:onCastSpell
[30/01/2010 11:54:23] Description:
[30/01/2010 11:54:23] (luaDoCombat) Creature not found
 
RageFace2.png
 
Back
Top