• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Windows Help with a spell.

kozmo

Member
Joined
Jan 30, 2009
Messages
433
Solutions
2
Reaction score
22
I am having a problem with a certain spell that i cannot seem to figure out. Please help..

This is the Error i am getting.

Lua Script Error: [Spell Interface]
data/spells/scripts/elf.lua:eek:nCastSpell

luaDoCombat<>. Combat not found
 
Code:
local time = 120 * 1000 
local addDistance = 20
local addMagic = 2 


local elf_scout = {lookType = 64, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, time)
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, addDistance)
setConditionParam(condition, CONDITION_PARAM_SKILL_MAGIC, addMagic)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)

local speed = createConditionObject(CONDITION_HASTE)
setConditionParam(speed, CONDITION_PARAM_TICKS, time)
setConditionFormula(speed, 1.2, -68, 1.2, -68)
setCombatCondition(combat, speed)

local outfit = createConditionObject(CONDITION_OUTFIT)
setConditionParam(outfit, CONDITION_PARAM_TICKS, time)
addOutfitCondition(outfit, elf_scout)
setCombatCondition(combat, outfit)

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 0)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, time)
setCombatCondition(combat, exhaust)

function onCastSpell(cid, var)
  return doCombat(cid, combat, var)
end
 
Last edited by a moderator:
Is this the right script? I can't see anything wrong, so I just tested it myself and it works fine for me, no errors.
 
Look in spells.xml if it is using this script, because it shouldn't give an error like this. I can't see anything that's wrong and also when I tested it myself, it all works fine and does not give any error.
 
Back
Top