|
|
@ -29,6 +29,7 @@ local CounterShot = SpellBook:GetSpell(147362) |
|
|
|
local MendPet = SpellBook:GetSpell(136) |
|
|
|
local MendPet = SpellBook:GetSpell(136) |
|
|
|
local Exhilaration = SpellBook:GetSpell(109304) |
|
|
|
local Exhilaration = SpellBook:GetSpell(109304) |
|
|
|
local SurvivalOfTheFittest = SpellBook:GetSpell(264735) |
|
|
|
local SurvivalOfTheFittest = SpellBook:GetSpell(264735) |
|
|
|
|
|
|
|
local TranquilizingShot = SpellBook:GetSpell(19801) |
|
|
|
|
|
|
|
|
|
|
|
-- Buffs and Debuffs |
|
|
|
-- Buffs and Debuffs |
|
|
|
local FrenzyBuff = SpellBook:GetSpell(272790) |
|
|
|
local FrenzyBuff = SpellBook:GetSpell(272790) |
|
|
@ -76,6 +77,7 @@ local PetAPL = Bastion.APL:New('pet') |
|
|
|
local InterruptAPL = Bastion.APL:New('interrupt') |
|
|
|
local InterruptAPL = Bastion.APL:New('interrupt') |
|
|
|
local DefensiveAPL = Bastion.APL:New('defensive') |
|
|
|
local DefensiveAPL = Bastion.APL:New('defensive') |
|
|
|
local BossAPL = Bastion.APL:New('boss') |
|
|
|
local BossAPL = Bastion.APL:New('boss') |
|
|
|
|
|
|
|
local TranqAPL = Bastion.APL:New('tranq') |
|
|
|
|
|
|
|
|
|
|
|
-- Helper Functions |
|
|
|
-- Helper Functions |
|
|
|
local function GetBarbedShotCharges() |
|
|
|
local function GetBarbedShotCharges() |
|
|
@ -129,6 +131,43 @@ local function ShouldInterrupt(unit) |
|
|
|
return castPercentage >= randomThreshold |
|
|
|
return castPercentage >= randomThreshold |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Variables to manage the random delay for Tranquilizing Shot |
|
|
|
|
|
|
|
local tranqTargetTime = 0 -- Tracks when a valid target was first identified |
|
|
|
|
|
|
|
local tranqReactionDelay = 0 -- Stores the random reaction delay |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Function to generate a random reaction delay between 400ms and 2 seconds |
|
|
|
|
|
|
|
local function GetRandomReactionDelay() |
|
|
|
|
|
|
|
return math.random(400, 2000) / 1000 -- Convert milliseconds to seconds |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Function to check if the reaction delay has passed |
|
|
|
|
|
|
|
local function ShouldUseTranquilizingShot() |
|
|
|
|
|
|
|
local currentTime = GetTime() |
|
|
|
|
|
|
|
if tranqTargetTime == 0 then return false end |
|
|
|
|
|
|
|
return currentTime - tranqTargetTime >= tranqReactionDelay |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local TranqTarget = Bastion.UnitManager:CreateCustomUnit('tranqtarget', function() |
|
|
|
|
|
|
|
local target = nil |
|
|
|
|
|
|
|
Bastion.UnitManager:EnumEnemies(function(unit) |
|
|
|
|
|
|
|
if unit:IsAffectingCombat() and unit:GetDistance(Player) <= 40 and Player:CanSee(unit) |
|
|
|
|
|
|
|
and unit:GetAuras():HasAnyDispelableAura(TranquilizingShot) then |
|
|
|
|
|
|
|
target = unit |
|
|
|
|
|
|
|
-- Set the target identification time if it hasn't been set |
|
|
|
|
|
|
|
if tranqTargetTime == 0 then |
|
|
|
|
|
|
|
tranqTargetTime = GetTime() |
|
|
|
|
|
|
|
tranqReactionDelay = GetRandomReactionDelay() |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
return true |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end) |
|
|
|
|
|
|
|
-- Reset the target time if no valid target is found |
|
|
|
|
|
|
|
if not target then |
|
|
|
|
|
|
|
tranqTargetTime = 0 |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
return target or Bastion.UnitManager:Get('none') |
|
|
|
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
-- Default APL |
|
|
|
-- Default APL |
|
|
|
DefaultAPL:AddSpell( |
|
|
|
DefaultAPL:AddSpell( |
|
|
|
AutoShot:CastableIf(function(self) |
|
|
|
AutoShot:CastableIf(function(self) |
|
|
@ -356,11 +395,16 @@ BMHunterModule:Sync(function() |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
DefensiveAPL:Execute() |
|
|
|
DefensiveAPL:Execute() |
|
|
|
DefensiveAPL:Execute() -- Add this line to check defensives |
|
|
|
|
|
|
|
PetAPL:Execute() |
|
|
|
PetAPL:Execute() |
|
|
|
|
|
|
|
TranqAPL:Execute() -- This will now respect the random reaction delay |
|
|
|
|
|
|
|
|
|
|
|
if Player:IsAffectingCombat() then |
|
|
|
if Player:IsAffectingCombat() then |
|
|
|
InterruptAPL:Execute() |
|
|
|
InterruptAPL:Execute() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if BestTarget:Exists() and BestTarget:IsBoss() then |
|
|
|
|
|
|
|
BossAPL:Execute() |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local enemyCount = Player:GetEnemies(8) |
|
|
|
local enemyCount = Player:GetEnemies(8) |
|
|
|
if enemyCount >= 2 then |
|
|
|
if enemyCount >= 2 then |
|
|
|
AoEAPL:Execute() |
|
|
|
AoEAPL:Execute() |
|
|
|