• 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 Ice Storm Spell

FinTriesCode

New Member
Joined
Apr 19, 2024
Messages
9
Reaction score
0
Hello!

Me again...

Im trying to make an advanced ice storm spell based off of the eternal winter spell.

This is what I have so far: (see image at bottom of post!)

I am trying to remove the moddle tornado (the over the player (creature)) but cant seem to figure it out. The script is as below:





--set up local arrays
local combats = {}
local areas = {
--area 1
{
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 0, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 1, 3, 1, 1, 1, 1},
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 0, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0}
},
--area 2
{
{0, 0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 0, 1, 1, 0, 0},
{0, 0, 0, 0, 3, 0, 0, 0, 0},
{0, 0, 1, 1, 0, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0, 0, 0}
}
}
--loop used to set up both areas
for i = 1, #areas do
combats = Combat()
combats:setParameter(COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
combats:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO)
combats:setArea(createCombatArea(areas))
--included funciton to calculate the level/magicLevel -min & -max
function onGetFormulaValues(player, level, magicLevel)
local min = (level / 5) + (magicLevel * 8) + 50
local max = (level / 5) + (magicLevel * 12) + 75
return -min, -max
end
--setup callbacks (in loop to set up both)
combats:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
end
--function to cast the spell, altered to handle multiple areas/combats using the combatIndex
local function castSpell(creatureId, variant, combatIndex)
combats[combatIndex]:execute(creature, variant) --execute the instance(s) of the combat(s)
end

function onCastSpell(creature, variant)
for i = 2, #areas do
addEvent(castSpell, 250 * i, creature.uid, variant, i)
end
return combats[1]:execute(creature, variant)
end







1713743137665.png
 
1713752095562.png

Change the 3 to 1 or 2 can't remmember which number you must use
 
Thanks all! Any explanation as to why?

In that thread, there's an instruction stating that the number 3 is used as a pivot to represent the player.
Maybe 2 serves the same purpose, but 2 does not add the sprite to the player's tile, while 3 does.
 

In that thread, there's an instruction stating that the number 3 is used as a pivot to represent the player.
Maybe 2 serves the same purpose, but 2 does not add the sprite to the player's tile, while 3 does.
Yeah, both 2 and 3 set the centre, but 3 will also include the tile for both effect/damage on the centre pos
 
Back
Top