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