Northnorial
Member
I'm currently using this Utura Gran like spell. Basically a spell that heals over time.
The problem I have is the following, when a player logs out after using the spell I get this error message:
I know what it is supposed to mean, but I don't know how to fix it. Haalp plis.
Code:
healRegen = {}
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF_SPELL, true)
setCombatCondition(combat, condition)
function regen(cid,var,n)
n = n or 0
if isPlayer(cid) then
doCreatureAddHealth(cid, 500)
if (n < 20) then
healRegen[cid] = addEvent(regen, 3000, cid, var, n+1)
end
end
return true
end
function onCastSpell(cid, var)
if healRegen[cid] then
stopEvent(healRegen[cid])
end
doCombat(cid, combat, var)
healRegen[cid] = addEvent(regen, 250, cid, var, 0)
return true
end
The problem I have is the following, when a player logs out after using the spell I get this error message:
Code:
[01/11/2014 16:47:54] Lua Script Error: [Spell Interface]
[01/11/2014 16:47:54] in a timer event called from:
[01/11/2014 16:47:54] data/spells/scripts/healing/utura gran.lua:onCastSpell
[01/11/2014 16:47:54] luaDoCreatureAddHealth(). Creature not found
I know what it is supposed to mean, but I don't know how to fix it. Haalp plis.