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

Spell request

LMASTER

New Member
Joined
Oct 27, 2007
Messages
22
Reaction score
0
Right, I tried a few things, but none seemed to work, I need a spell that when the player casts it, every monster within a certain area gets the damage equal to player's current mana after a short period of time and in this period, he cant move. So it's like, if he's with max mana and have 5k, he deals 5k to each monster surrounding him. Actually, the only problem i'm facing is the mana based damage part, if someone could help, I would be gratefull. Thanks
 
Use this as spell:
Lua:
function onCastSpell(cid, var, words, name)
local target = getCreatureTarget(cid)
local mana = getCreatureMana(cid)
	doTargetCombatHealth(cid, target, COMBAT_ENERGYDAMAGE, -mana, -mana, 37)
return TRUE
end
 
@up
Code:
[01/02/2011 11:15:50] Lua Script Error: [Spell Interface] 
[01/02/2011 11:15:50] in a timer event called from: 
[01/02/2011 11:15:50] data/spells/scripts/mana kill.lua:onCastSpell
[01/02/2011 11:15:50] data/spells/scripts/mana kill.lua:17: attempt to perform arithmetic on local 'mana' (a boolean value)
[01/02/2011 11:15:50] stack traceback:
[01/02/2011 11:15:50] 	[C]: in function '__unm'
[01/02/2011 11:15:50] 	data/spells/scripts/mana kill.lua:17: in function <data/spells/scripts/mana kill.lua:14>
Is the error i get, same one when i tried by myself... Also, i want it to be an area spell, not a "need a target" spell
 
Last edited:
Try this then:

Lua:
function onCastSpell(cid, var, words, name)
local target = getCreatureTarget(cid)
local dmg = getCreatureMana(cid)
	doTargetCombatHealth(cid, target, COMBAT_ENERGYDAMAGE, -dmg, -dmg, 37)
return TRUE
end
PS are you useing this script or another with this in it? If you have another with this in it and this isn't working post your script. As it could also be something with the timer event you called.
 
Back
Top