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

Multi spell commands in single lua ( pause / break )

udxero

New Member
Joined
Mar 25, 2010
Messages
13
Reaction score
0
Okay, i done it long time ago but i dont' remember how..

I want to have a spell that does multiple movements

such as having a spell "wave" out infront of you

so that first it sends out explosion area effect then energy area effect.. ( not at the same time )1 then the other.. 0.o i forget what part of the code to edit..

currently what i'm wanting to do is have the spell move infront of the char
***
C = char
s = spell
***
example:
(step1)
Cs
(step2)
C-S
(step3)
C--S

this would make the spell seem to "wave" i have done it before, but it was a long time ago and i can't remember how now... my current spell ( un complete )

Code:
local combat = createCombatObject()
arr = {{0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0}}

local combat = createCombatObject()
arr1 = {
{0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}
}

local combat = createCombatObject()
arr2 = {
{0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}
}




setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)


local area = createCombatArea(arr)
local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)

setCombatArea(combat, area)
setCombatArea(combat, area1)
setCombatArea(combat, area2)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

all i need to do is add timing between each area...
 
Code:
local delay = 500
local combat, area = {}, {
	{
		{1},
		{3}
	},
	{
		{1},
		{0},
		{3}
	},
	{
		{1},
		{0},
		{0},
		{3}
	}
}

for i = 1, #area do
	setCombatParam(combat[i], COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
	setCombatParam(combat[i], COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
	setCombatFormula(combat[i], COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)
	setCombatArea(combat[i], createCombatArea(area[i]))
end

local function doIt(cid, i, var)
	return isPlayer(cid) == TRUE and doCombat(cid, combat[i], var)
end

function onCastSpell(cid, var)
	for i = 0, #combat - 1 do
		addEvent(doIt, i * delay, cid, i + 1, var)
	end
	return true
end
Remember to add direction="1" in spells.xml
 
Back
Top