avatar
Untitled

Guest 66 10th Dec, 2019

MARKUP 2.45 KB
                                           
                         local MANA_TRAIN_ONLY_PZ = true

print('EvoluniaPro Loaded !')

local function GetMonsters(range)
    local result = {}
    for name, obj in Creature.iMonsters(range) do
        if obj:isValid() and obj:isAlive() and obj:isMonster() and not obj:isSelf() and obj:Position().z == Self.Position().z then
            table.insert(result, obj)
        end
    end
    return result
end

Module.New('Items', function()
    local mana = Self.Mana() / Self.MaxMana()
    if mana < 0.9 then
        Self.UseItemWithMe(23373)
    end
end)

local UtilityTimer = 0
Module.New('UtilitySpells', function()
    -- check if can use utility spells
    if not Self.CanCastSpell('utamo vita') then
        return
    end

    if Self.CanCastSpell('utamo vita') and not Self.isManaShielded() then
        Self.Cast('utamo vita', 50)
        UtilityTimer = os.clock() + 2
        return
    end

    if Self.CanCastSpell('utani gran hur') and not Self.isInPz() and (not Self.isHasted() or Self.isParalyzed()) then
        Self.Cast('utani gran hur', 100)
        UtilityTimer = os.clock() + 2
        return
    end

    if not Self.isBuffed() and not Self.isInPz() then
        Self.Say('utito mas vis')
        UtilityTimer = os.clock() + 2
        return
    end

    if os.clock() > UtilityTimer and Self.Mana() / Self.MaxMana() >= 0.9 and (not MANA_TRAIN_ONLY_PZ or Self.isInPz()) then
        Self.Say('utevo mana')
        UtilityTimer = os.clock() + 2
        return
    end
end)

local MaxMortTimer = os.clock()
Module.New('AttackSpells', function()
    -- stop in protection zone
    if Self.isInPz() then
        return
    end

    -- monsters, mana percent
    local monsters = GetMonsters(3)
    local mana_percent = Self.Mana() / Self.MaxMana()

    -- exevo gran max mort
    local ots_max_mort = 'exevo gran max mort'
    local tibia_exori_mort = 'exori mort'
    if Self.CanCastSpell(tibia_exori_mort) and #monsters > 1 and mana_percent > 0.6 then
        Self.Say(ots_max_mort)
        MaxMortTimer = os.clock() + 2
        return
    end

    monsters = GetMonsters(6)
    local ots_mas_flam = 'exevo mas pura'--'exevo mas flam'
    local tibia_min_flam = 'exori min flam'
    if os.clock() > MaxMortTimer and Self.CanCastSpell(tibia_min_flam) and #monsters > 0 and Self.Mana() > 500 then
        Self.Say(ots_mas_flam)
        return
    end
end)
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data
Recent Pastes