SixNine
Active Member
- Joined
- Dec 12, 2018
- Messages
- 452
- Reaction score
- 41
Using this script
So issues im having is
1. attempt to index local
2. How can i make if i cast this spell once it executes this spell pattern
{ arr = {{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 3, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1}},
and if it casts second time it executes different pattern
{ arr = {{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 3, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0}},
and so on and on so patterns wont be the same because its easy to dodge you can just stand afk.
3. And last think before it casts the spell it would give warning for like 1or 2 seconds where the spell will appear example in this video
Lua:
local combats = {}
local areas = {
-- Area 1
{ arr = {{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 3, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1}},
effect = CONST_ME_POFF
},
-- Area 2
{ arr = {{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 3, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1}},
type = COMBAT_FIREDAMAGE,
effect = CONST_ME_FIREAREA
},
-- Area 3
{ arr = {{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 3, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0}},
effect = CONST_ME_POFF
},
-- Area 4
{ arr = {{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 3, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0}},
type = COMBAT_FIREDAMAGE,
effect = CONST_ME_FIREAREA
}
}
for i, arr in pairs(areas) do
combats[i] = Combat()
if arr.effect then combats[i]:setParameter(COMBAT_PARAM_EFFECT, arr.effect) end
combats[i]:setArea(createCombatArea(arr.arr))
if arr.type then
combats[i]:setParameter(COMBAT_PARAM_TYPE, arr.type)
function onGetFormulaValues(player, level, magicLevel)
local min = (level / 5) + (magicLevel * 8) + 50
local max = (level / 5) + (magicLevel * 12) + 75
return -min, -max
end
combats[i]:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
end
end
local function castSpell(creatureId, variant, combatIndex)
local creature = Creature(creatureId)
if creature then
combats[combatIndex]:execute(creature, variant)
end
end
function onCastSpell(creature, variant)
for i = 2, #areas do
addEvent(castSpell, 800 * i, creature:getId(), variant, i)
-- Stun
local stun = Condition(CONDITION_STUN)
stun:setParameter(CONDITION_PARAM_TICKS, stunDuration)
stunCreature:addCondition(stun)
end
return combats[1]:execute(creature, variant)
end
So issues im having is
1. attempt to index local
stun
(a nil value)2. How can i make if i cast this spell once it executes this spell pattern
{ arr = {{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 3, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1}},
and if it casts second time it executes different pattern
{ arr = {{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 3, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0}},
and so on and on so patterns wont be the same because its easy to dodge you can just stand afk.
3. And last think before it casts the spell it would give warning for like 1or 2 seconds where the spell will appear example in this video