-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspells_single_multi.lua
52 lines (47 loc) · 1.59 KB
/
spells_single_multi.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
local singleTargetSpell = 'Barrier'
local multiTargetSpell = 'Ki Repulsion'
local distance = 3
local amountOfMonsters = 2
local manaPercent = 20
local hpPercent = 20
local yv=macro(250, "multi target spell", function()
local specAmount = 0
if not g_game.isAttacking() then
return
end
for i,mob in ipairs(getSpectators()) do
if (getDistanceBetween(player:getPosition(), mob:getPosition()) <= distance and mob:isMonster()) then
specAmount = specAmount + 1
end
end
if (specAmount >= amountOfMonsters) then
if (manapercent() >= storage.manaPercent) and (hppercent() >= storage.hpPercent) then
say(storage.multiTargetSpell)
end
else
if (manapercent() >= storage.manaPercent) and (hppercent() >= storage.hpPercent) then
say(storage.singleTargetSpell)
end
end
end)
local ICON_ID = 13414 -- id ikony
addIcon("nazwa ikony", {item={id = ICON_ID}, movable=true}, function(icon, isOn)
yv.setOn(isOn)
end)
UI.Label("Single Target Spell:")
UI.TextEdit(storage.singleTargetSpell or "Barrier", function(widget, text)
storage.singleTargetSpell = text
end)
UI.Label("Multi Target Spell:")
UI.TextEdit(storage.multiTargetSpell or "Ki Repulsion", function(widget, text)
storage.multiTargetSpell = text
end)
UI.Label("Mana Percent:")
UI.TextEdit(tostring(storage.manaPercent or 20), function(widget, text)
storage.manaPercent = tonumber(text)
end)
UI.Label("HP Percent:")
UI.TextEdit(tostring(storage.hpPercent or 20), function(widget, text)
storage.hpPercent = tonumber(text)
end)
UI.Separator()