forked from Ascerr/Lua-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeal monster.lua
More file actions
37 lines (25 loc) · 1.05 KB
/
Heal monster.lua
File metadata and controls
37 lines (25 loc) · 1.05 KB
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
--[[
Script Name: Heal monster
Description: Heal monster using UH rune. Important! Script don't recognize it's you summon or not.
Author: Ascer - example
]]
local MONSTER = "Demon Skeleton" -- monster name with Capital letters
local HEAL_BELOW_PERC = 50 -- heal if creature perc is below.
local RUNE_ID = 3160 -- rune id to use
-- DONT EDIT BELOW THIS LINE
Module.New("Heal monster", function ()
-- load creatures
local creatures = Creature.iMonsters(7, false)
-- in loop for creatures.
for i = 1, #creatures do
-- load single creature.
local c = creatures[i]
-- check if creature have below HEAL_BELOW_PERC and monster name is this same as config.
if c.hpperc <= HEAL_BELOW_PERC and c.name == MONSTER then
-- use rune with creature. 2050 is delay in ms.
Self.UseItemWithCreature(c, RUNE_ID, 2050)
-- break loop
break
end
end
end)