• 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 do no damage...?

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
How come my spell dont do any damage at all?
and no errors in consol...

Code:
local formula, area, dmgtype, effect, combat = {
	[1] = {-54, -30, -12, -300}
},
{
[1]={
		{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
		{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
		{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
		{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
		{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
		{1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1},
		{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
		{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
		{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
		{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
		{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
	}
},
{
	[1] = COMBAT_PHYSICALDAMAGE
},
{
	[1] = CONST_ME_GIFT_WRAPS
},
{}
for i = 1, #formula do
	table.insert(combat, createCombatObject())
	setCombatParam(combat[i], COMBAT_PARAM_TYPE, dmgtype[i])
	setCombatParam(combat[i], COMBAT_PARAM_EFFECT, effect[i])
	setCombatFormula(combat[i], COMBAT_FORMULA_LEVELMAGIC, formula[i][1])
	setCombatArea(combat[i], createCombatArea(area[i]))
end

function onCastSpell(cid, var)
	for i = 1, #formula do
		addEvent(function(cid, combat, var) if isPlayer(cid) == TRUE then doCombat(cid, combat, var) end end, i * 100 + 100, cid, combat[i], var)
	end
	return TRUE
end
 
Back
Top