forked from Oskar1121/Ravendawn
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathQ5_2.lua
35 lines (30 loc) · 830 Bytes
/
Q5_2.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
local config = {
amount = 5,
combat = Combat(),
area = createCombatArea({
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 3, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0}
})
}
function executeEffect(position, count)
if math.random(0, 1) == 1 then
position:sendMagicEffect(CONST_ME_ICETORNADO)
end
if count < config.amount then
count = count + 1
addEvent(executeEffect, math.random(250, 1000), position, count)
end
end
function onTargetTile(creature, position)
executeEffect(position, 0)
end
config.combat:setArea(config.area)
config.combat:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(creature, variant, isHotkey)
return config.combat:execute(creature, variant)
end