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

Advanced Special Spell

Reyn

On to the next One
Joined
May 15, 2010
Messages
259
Reaction score
1
Location
Germany ;3
Hey Guys ;p
everyone of you knows advanced spells like this
Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, xxDamage)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 0)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, x, x, x, x)
 

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_xxDamage)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, x)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, x, x, x, x)

 
arr1 = 	{1, 1, 1, 1, 1},
	{0, 1, 1, 1, 0},
	{0, 1, 1, 1, 0},
	{0, 0, 3, 0, 0}
}

arr2 = 	{1, 1, 1, 1, 1},
	{0, 1, 1, 1, 0},
	{0, 1, 1, 1, 0},
	{0, 0, 3, 0, 0}
}

 
local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)

local function onCastSpell1(parameters) 
doCombat(parameters.cid, parameters.combat1, parameters.var) 
end 

local function onCastSpell2(parameters) 
doCombat(parameters.cid, parameters.combat2, parameters.var) 
end 


function onCastSpell(cid, var) 
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2 } 
addEvent(onCastSpell1, 100, parameters) 
addEvent(onCastSpell2, 400, parameters) 
return TRUE
end

but does anyone know how to make this spell an advanced one?:
(Rhux made this spell for me)
Code:
local area = createCombatArea(AREA_WAVE4)

local combat = {createCombatObject(),createCombatObject(),createCombatObject(),createCombatObject()} 

for i = 1, #combat do 
    setAttackFormula(combat[i], COMBAT_FORMULA_LEVELMAGIC, 5, 5, 1.2, 2) 
end 

local param = { 
[combat[1]] = {{setCombatParam,COMBAT_PARAM_TYPE,COMBAT_FIREDAMAGE},{setCombatParam,COMBAT_PARAM_EFFECT,CONST_ME_FIREATTACK}}, 
[combat[2]] = {{setCombatParam,COMBAT_PARAM_TYPE,COMBAT_ICEDAMAGE},{setCombatParam,COMBAT_PARAM_EFFECT,CONST_ME_ICEAREA}}, 
[combat[3]] = {{setCombatParam,COMBAT_PARAM_TYPE,COMBAT_EARTHDAMAGE},{setCombatParam,COMBAT_PARAM_EFFECT,CONST_ME_SMALLPLANTS}}, 
[combat[4]] = {{setCombatParam,COMBAT_PARAM_TYPE,COMBAT_ENERGYDAMAGE},{setCombatParam,COMBAT_PARAM_EFFECT,CONST_ME_ENERGYAREA}} 
} 

for combat, params in pairs(param) do 
    for i = 1,#params do 
        params[i][1](combat, params[i][2],params[i][3]) 
    end 
end 

for i = 1,#combat do 
    setCombatArea(combat[i], area) 
end 
function onCastSpell(cid, var) 
    return doCombat(cid, combat[(getCreatureLookDirection(cid)+1)], var) 
end
Since i learned about this spell just a day ago i dont know much 'bout it, so i hope anyone could help me...
I'll give Rep++ for sure :)
Regards,
Reyn
 
Well it's my way to do spells.
Tell me what you want and I will add the areas and such tomorrow if I have time.
 
i just want it like the first one :P but that it changes the effect to every destination like urs ... Effects and so on doesnt matter :P need to be at least 2 combats xD if i see how 2 works i can figure out the rest ^^
 
#2nd
Code:
local combat = {}
local types, effects = {FIREDAMAGE, ICEDAMAGE, EARTHDAMAGE, ENERGYDAMAGE}, {FIREATTACK, ICEAREA, SMALLPLANTS, ENERGYAREA}
for i = 1, 4 do
	combat[i] = createCombatObject()
	setCombatParam(combat[i], COMBAT_PARAM_TYPE, types[i])
	setCombatParam(combat[i], COMBAT_PARAM_EFFECT, effects[i])
	setCombatArea(combat[i], createCombatArea(AREA_WAVE4))
	setAttackFormula(combat[i], COMBAT_FORMULA_LEVELMAGIC, 5, 5, 1.2, 2)
end
local function Spell(x)
	return isPlayer(x[1]) and doCombat(x[1], combat[x[2]], x[1])
end
function onCastSpell(cid, var)
	for i = 0, #combat-1 do
		addEvent(Spell, 1000, {cid, i + 1,var})
	end
	return true
end
 
are u sure that this is advanced one with 2 effects? :S
cant see the second combat on that script

i dont get how those spells are working :S maybe i didnt tell right what i want :p
i want a spell that changes effect to each destination, like rhux ones or Existances
but it should have 2 or 3 combats , idc . i will figure out how it works after i see how 2 work i guess.. the 1st effect to left should be for example 2 and second one 3.. same to each destination :S sry for my english i hope u get it >.<
 
Last edited:
Back
Top