Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local target = { -- add targets u want to heal and at what percent
- ['Furpan'] = 40,
- ['Furpans Friend'] = 40
- }
- local option = {
- sio = true, -- use sio to heal friend
- rune = true, -- use rune to heal friend
- potion = true, -- use potion to heal friend
- rune_id = 3160, -- what rune to heal friend
- potion_id = 236, -- what potion to heal friend
- max_range = 5, -- maximum range to heal person
- min_hp = 1000, -- dont cast if below this health
- min_mana = 1000 -- dont cast if below this mana
- }
- local prio = {'sio', 'rune', 'potion'} -- in what order should we check?
- Module.New('HEAL', function(mod)
- local breaking = false
- for i = 1, 3 do
- if (option[prio[i]]) then
- if (prio[i] == 'sio') then
- for name, percent in pairs(target) do
- local c = Creature.New(name)
- if (c:isOnScreen()) then
- if (c:HealthPercent() < percent and c:DistanceFromSelf() =< option['max_range'] and c:isAlive() and Self.Health() > option['min_hp'] and Self.Mana() > option['min_mana']) then
- Self.Say('exura sio "' .. name)
- breaking = true
- break
- end
- end
- end
- if (breaking) then break end
- elseif (prio[i] == 'rune') then
- for name, percent in pairs(target) do
- local c = Creature.New(name)
- if (c:isOnScreen()) then
- if (c:HealthPercent() < percent and c:DistanceFromSelf() =< option['max_range'] and c:isAlive() and Self.Health() > option['min_hp'] and Self.Mana() > option['min_mana']) then
- Self.UseItemWithCreature(option['rune_id'], c:ID())
- breaking = true
- break
- end
- end
- end
- if (breaking) then break end
- elseif (prio[i] == 'potion') then
- for name, percent in pairs(target) do
- local c = Creature.New(name)
- if (c:isOnScreen()) then
- if (c:HealthPercent() < percent and c:DistanceFromSelf() == 1 and c:isAlive() and Self.Health() > option['min_hp'] and Self.Mana() > option['min_mana']) then
- Self.UseItemWithCreature(option['potion_id'], c:ID())
- breaking = true
- break
- end
- end
- end
- if (breaking) then break end
- end
- end
- end
- mod:Delay(500)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement