• 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 Problem [ No Exhaust + Error]

johny5608

johny
Joined
Oct 5, 2008
Messages
120
Reaction score
0
Location
Wien
Hello Otlanders,
I have got problem with a spell.


Here is the Error:
Code:
[Error - Spell Interface] 
data/spells/scripts/attack/meteorio.lua:onCastSpell
Description: 
data/spells/scripts/attack/meteorio.lua:11: attempt to index a boolean value
stack traceback:
	data/spells/scripts/attack/meteorio.lua:11: in function <data/spells/scripts/attack/meteorio.lua:3>

Script:
Code:
local area = createCombatArea(AREA_SQUARE1X1)

function onCastSpell(cid, var) 

local target = getCreatureTarget(cid)

doSendDistanceShoot(getCreaturePosition(cid),{x = getCreaturePosition(cid).x - math.random(4,6), y = getCreaturePosition(cid).y - 5, z = getCreaturePosition(cid).z},CONST_ANI_FLAMMINGARROW)

for x = 1, 10 do

   addEvent(furyAttackTarget,200*x+500,cid,target,{x = getCreaturePosition(target).x + math.random(-1,1), y = getCreaturePosition(target).y + math.random(-1,1), z = getCreaturePosition(target).z})
end

end

function furyAttackTarget(cid,target,pos)

if isCreature(cid) == TRUE and isCreature(target) == TRUE then

  doSendDistanceShoot({x = getCreaturePosition(target).x - math.random(4,6), y = getCreaturePosition(target).y - 5, z = getCreaturePosition(target).z},pos,CONST_ANI_FIRE)

  doAreaCombatHealth(cid,COMBAT_FIREDAMAGE,pos,area,(-(getPlayerLevel(cid)*getPlayerMagLevel(cid))/5)+50,(-(getPlayerLevel(cid)*getPlayerMagLevel(cid))/5)-50,CONST_ME_HITBYFIRE)

end

end

In Spells.xml

Code:
    <instant name="meteorio" words="exevo flam tempest" lvl="200" mana="3" prem="1" selftarget="1" exhaustion="2000" needlearn="0" event="script" value="attack/meteorio.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
    </instant>

+ The Spells have no exhaustion

Please Help,
Thanks Johny5608
 
Code:
local area = createCombatArea(AREA_SQUARE1X1)

function onCastSpell(cid, var) 

local target = getCreatureTarget(cid)

doSendDistanceShoot(getCreaturePosition(cid),{x = getCreaturePosition(cid).x - math.random(4,6), y = getCreaturePosition(cid).y - 5, z = getCreaturePosition(cid).z},CONST_ANI_FLAMMINGARROW)

for x = 1, 10 do

   addEvent(furyAttackTarget,200*x+500,cid,target,{x = getCreaturePosition(target).x + math.random(-1,1), y = getCreaturePosition(target).y + math.random(-1,1), z = getCreaturePosition(target).z})
end

end

function furyAttackTarget(cid,target,pos)

if isCreature(cid) == TRUE and isCreature(target) == TRUE then

  doSendDistanceShoot({x = getCreaturePosition(target).x - math.random(4,6), y = getCreaturePosition(target).y - 5, z = getCreaturePosition(target).z},pos,CONST_ANI_FIRE)

  doAreaCombatHealth(cid,COMBAT_FIREDAMAGE,pos,area,(-(getPlayerLevel(cid)*getPlayerMagLevel(cid))/5)+50,(-(getPlayerLevel(cid)*getPlayerMagLevel(cid))/5)-50,CONST_ME_HITBYFIRE)

end

return TRUE
end

That should stop exhaust.
 
:/ There is still no Exhaust :/

and now there are 2 Errors
Code:
[Error - Spell Interface] 
data/spells/scripts/attack/meteorio.lua:onCastSpell
Description: 
(luaGetThingPosition) Thing not found

[Error - Spell Interface] 
data/spells/scripts/attack/meteorio.lua:onCastSpell
Description: 
data/spells/scripts/attack/meteorio.lua:11: attempt to index a boolean value
stack traceback:
	data/spells/scripts/attack/meteorio.lua:11: in function <data/spells/scripts/attack/meteorio.lua:3>
 
Back
Top