This commit is contained in:
Олег Цветков 2025-08-22 18:51:20 +03:00
parent ff43ac94e7
commit dfe66c3e74

View File

@ -6,6 +6,7 @@ textures['Kill Command'] = 'ability_hunter_killcommand'
textures['Baited Shot'] = 'inv_misc_food_66'
textures['Arcane Shot'] = 'Ability_ImpalingBolt'
textures['Multi-Shot'] = 'Ability_UpgradeMoonGlaive'
textures['Steady Shot'] = 'Ability_Hunter_SteadyShot'
textures['Concussive Shot'] = 'Spell_Frost_Stun'
textures['Throw'] = 'Ability_Throw'
textures['Blood Fury'] = 'Racial_Orc_BerserkerStrength'
@ -85,8 +86,8 @@ local function cast(spellName)
CastSpellByName(spellName)
end
local function healthGtThan(percent, health, max)
if health / max > percent / 100 then
local function gt(percent, value, max)
if value / max > percent / 100 then
return true
end
return false
@ -107,9 +108,9 @@ local function attack()
elseif UnitIsPlayer('target') == 1 then
ClearTarget()
return
-- elseif UnitHealth('target') ~= UnitHealthMax('target') and UnitIsUnit('player', 'targettarget') == nil then
-- ClearTarget()
-- return
-- elseif UnitHealth('target') ~= UnitHealthMax('target') and UnitIsUnit('player', 'targettarget') == nil then
-- ClearTarget()
-- return
end
local mana = UnitMana('player')
@ -125,19 +126,21 @@ local function attack()
cast('Hunter\'s Mark')
elseif isUsable('Blood Fury') and not onCooldown('Blood Fury') then
cast('Blood Fury')
elseif isUsable('Baited Shot') and not onCooldown('Baited Shot') then
elseif isUsable('Baited Shot') and not onCooldown('Baited Shot') and gt(40, mana, UnitManaMax('player')) then
cast('Baited Shot')
elseif isUsable('Kill Command') and not onCooldown('Kill Command') then
elseif isUsable('Kill Command') and not onCooldown('Kill Command') and gt(60, mana, UnitManaMax('player')) then
cast('Kill Command')
-- elseif isUsable('Steady Shot') and not onCooldown('Steady Shot') then
-- cast('Steady Shot')
elseif isUsable('Arcane Shot') and not onCooldown('Arcane Shot') then
cast('Arcane Shot(Rank 1)')
elseif isUsable('Multi-Shot') and not onCooldown('Multi-Shot') then
elseif isUsable('Multi-Shot') and not onCooldown('Multi-Shot') and gt(80, mana, UnitManaMax('player')) then
cast('Multi-Shot')
elseif not IsAutoRepeatAction(47) then
cast('Auto Shot')
elseif isUsable('Serpent Sting') and not buffed('Serpent Sting', 'target') and
healthGtThan(25, UnitHealth('target'), UnitHealthMax('target')) then
cast('Serpent Sting')
-- elseif isUsable('Serpent Sting') and not buffed('Serpent Sting', 'target') and
-- healthGtThan(25, UnitHealth('target'), UnitHealthMax('target')) then
-- cast('Serpent Sting')
elseif isUsable('Concussive Shot') and not onCooldown('Concussive Shot') then
cast('Concussive Shot')
end