- Joined
- May 23, 2010
- Messages
- 185
- Reaction score
- 23
Error:
Script:
[Error - LuaScriptInterface::loadFile] data/spells/scripts/druid/icestorm.lua:98: 'end' expected (to close 'for' at line 88) near '<eof>'
[28/12/2010 22:09:36] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/druid/icestorm.lua)
[28/12/2010 22:09:36] data/spells/scripts/druid/icestorm.lua:98: 'end' expected (to close 'for' at line 88) near '<eof>'
Script:
Code:
local spellConfig = {
{effect = CONST_ME_GIANTICE,
area = createCombatArea({
{1, 0, 1},
{0, 2, 0},
{0, 1, 0}})
},
{effect = CONST_ME_GIANTICE,
area = createCombatArea({
{0, 1, 0, 0, 0},
{1, 0, 0, 1, 0},
{0, 0, 2, 0, 0},
{0, 0, 1, 0, 1},
{1, 0, 0, 1, 0}})
},
{effect = CONST_ME_GIANTICE,
area = createCombatArea({
{0, 0, 1, 0, 1},
{1, 0, 0, 0, 1},
{0, 0, 2, 1, 0},
{0, 1, 0, 0, 1},
{1, 0, 1, 0, 0}})
},
{effect = CONST_ME_ICETORNADO,
area = createCombatArea({
{0, 0, 1, 0, 1},
{1, 0, 0, 0, 1},
{0, 0, 2, 1, 0},
{0, 1, 0, 0, 1},
{1, 0, 1, 0, 0}})
},
{effect = CONST_ME_GIANTICE,
area = createCombatArea({
{0, 0, 1, 0, 1, 0, 0},
{0, 0, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 0, 0, 1},
{0, 0, 1, 2, 1, 0, 0},
{1, 0, 0, 0, 0, 0, 1},
{0, 0, 1, 0, 0, 0, 0},
{0, 0, 1, 0, 1, 0, 0}})
},
{effect = CONST_ME_ICETORNADO,
area = createCombatArea({
{0, 0, 1, 0, 1, 0, 0},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 0, 0, 1},
{0, 0, 0, 2, 1, 0, 0},
{0, 1, 0, 0, 0, 0, 1},
{1, 0, 0, 1, 0, 1, 0},
{0, 0, 1, 0, 1, 0, 0}})
},
{effect = CONST_ME_GIANTICE,
area = createCombatArea({
{0, 0, 1, 0, 1, 0, 0},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 0, 0, 1},
{0, 0, 0, 2, 1, 0, 0},
{0, 1, 0, 0, 0, 0, 1},
{1, 0, 0, 1, 0, 1, 0},
{0, 0, 1, 0, 1, 0, 0}})
}
}
local combats = {}
for k, config in ipairs(spellConfig) do
combats[k] = createCombatObject()
onTargetTile = function(cid, pos)
local basePos = getThingPosition(cid)
local fromPos = {x=basePos.x-6, y=basePos.y-8, z=basePos.z}
doSendDistanceShoot(fromPos, pos, CONST_ANI_ICE)
end
setCombatCallback(combats[k], CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatParam(combats[k], COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combats[k], COMBAT_PARAM_EFFECT, config.effect)
setCombatFormula(combats[k], COMBAT_FORMULA_LEVELMAGIC, 5, 29, 5, 36)
setCombatArea(combats[k], config.area)
end
local function castingSpellTime(p)
if(isCreature(p[1]) == TRUE) then
doCombat(unpack(p))
end
end
function onCastSpell(cid, var)
for k, combat in ipairs(combats) do
addEvent(castingSpellTime, (250*k), {cid, combat, var})
if exhaustion.check(cid, 23000) == false then
exhaustion.set(cid, 23000, 2)
if getPlayerMana(cid) >= 65 then
doPlayerAddMana(cid, -65)
doPlayerSendCancel(cid, "Now you have to wait two seconds to use this kind of spell again.")
else
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end