forked from Bastion/Bastion
parent
bef53be50e
commit
33ca6a0707
@ -0,0 +1,54 @@ |
||||
local |
||||
Tinkr, |
||||
---@type Bastion |
||||
Bastion = ... |
||||
|
||||
local ArcaneModule = Bastion.Module:New('arcane') |
||||
local Player = Bastion.UnitManager:Get('player') |
||||
local Target = Bastion.UnitManager:Get('target') |
||||
local None = Bastion.UnitManager:Get('none') |
||||
local AutoAttack = Bastion.SpellBook:GetSpell(6603) |
||||
|
||||
local CDsEnabled = false |
||||
|
||||
local Command = Bastion.Command:New('arcane') |
||||
|
||||
Command:Register('cooldowns', 'Toggle Arcane CDs', function() |
||||
CDsEnabled = not CDsEnabled |
||||
Bastion:Print('Arcane Cooldowns ' .. (CDsEnabled and 'enabled' or 'disabled')) |
||||
end) |
||||
|
||||
---@return boolean |
||||
local function CombatRotation() |
||||
return false |
||||
end |
||||
|
||||
|
||||
---@return boolean |
||||
local function OutOfCombatRotation() |
||||
return false |
||||
end |
||||
|
||||
|
||||
local isRunning = false |
||||
|
||||
ArcaneModule:Sync(function() |
||||
if not isRunning then |
||||
Bastion:Print('Arcane Started') |
||||
isRunning = true |
||||
end |
||||
|
||||
if not Player:IsAlive() or Player:IsMounted() then |
||||
return false |
||||
end |
||||
|
||||
if Player:IsAffectingCombat() or IsCurrentSpell(AutoAttack:GetID()) then |
||||
-- Combat Rotation |
||||
return CombatRotation() |
||||
else |
||||
-- Out Of Combat Rotation |
||||
return OutOfCombatRotation() |
||||
end |
||||
end) |
||||
|
||||
Bastion:Register(ArcaneModule) |
@ -0,0 +1,54 @@ |
||||
local |
||||
Tinkr, |
||||
---@type Bastion |
||||
Bastion = ... |
||||
|
||||
local FireModule = Bastion.Module:New('fire') |
||||
local Player = Bastion.UnitManager:Get('player') |
||||
local Target = Bastion.UnitManager:Get('target') |
||||
local None = Bastion.UnitManager:Get('none') |
||||
local AutoAttack = Bastion.SpellBook:GetSpell(6603) |
||||
|
||||
local CDsEnabled = false |
||||
|
||||
local Command = Bastion.Command:New('fire') |
||||
|
||||
Command:Register('cooldowns', 'Toggle Fire CDs', function() |
||||
CDsEnabled = not CDsEnabled |
||||
Bastion:Print('Fire Cooldowns ' .. (CDsEnabled and 'enabled' or 'disabled')) |
||||
end) |
||||
|
||||
---@return boolean |
||||
local function CombatRotation() |
||||
return false |
||||
end |
||||
|
||||
|
||||
---@return boolean |
||||
local function OutOfCombatRotation() |
||||
return false |
||||
end |
||||
|
||||
|
||||
local isRunning = false |
||||
|
||||
FireModule:Sync(function() |
||||
if not isRunning then |
||||
Bastion:Print('Fire Started') |
||||
isRunning = true |
||||
end |
||||
|
||||
if not Player:IsAlive() or Player:IsMounted() then |
||||
return false |
||||
end |
||||
|
||||
if Player:IsAffectingCombat() or IsCurrentSpell(AutoAttack:GetID()) then |
||||
-- Combat Rotation |
||||
return CombatRotation() |
||||
else |
||||
-- Out Of Combat Rotation |
||||
return OutOfCombatRotation() |
||||
end |
||||
end) |
||||
|
||||
Bastion:Register(FireModule) |
@ -0,0 +1,137 @@ |
||||
local |
||||
Tinkr, |
||||
---@type Bastion |
||||
Bastion = ... |
||||
|
||||
local FrostModule = Bastion.Module:New('frost') |
||||
local Player = Bastion.UnitManager:Get('player') |
||||
local Target = Bastion.UnitManager:Get('target') |
||||
local None = Bastion.UnitManager:Get('none') |
||||
local AutoAttack = Bastion.SpellBook:GetSpell(6603) |
||||
local Frostbolt = Bastion.SpellBook:GetSpell(116) |
||||
local IceLance = Bastion.SpellBook:GetSpell(30455) |
||||
local Flurry = Bastion.SpellBook:GetSpell(44614) |
||||
local BrainFreeze = Bastion.SpellBook:GetSpell(190446) |
||||
local FingersOfFrost = Bastion.SpellBook:GetSpell(44544) |
||||
local WintersChill = Bastion.SpellBook:GetSpell(228358) |
||||
local FrostNova = Bastion.SpellBook:GetSpell(122) |
||||
local IceNova = Bastion.SpellBook:GetSpell(157997) |
||||
|
||||
local CDsEnabled = false |
||||
|
||||
local Command = Bastion.Command:New('frost') |
||||
|
||||
Command:Register('cooldowns', 'Toggle Frost CDs', function() |
||||
CDsEnabled = not CDsEnabled |
||||
Bastion:Print('Frost Cooldowns ' .. (CDsEnabled and 'enabled' or 'disabled')) |
||||
end) |
||||
|
||||
---@type GetRangedTargetCount |
||||
local GetRangedTargetCount = Tinkr:require("scripts/bastion/scripts/shared/get-ranged-target-count", Bastion) |
||||
|
||||
---@param unit Unit |
||||
local function isUnitFrozen(unit) |
||||
if not unit:Exists() then return false end |
||||
|
||||
if unit:GetAuras():FindMy(IceNova):IsUp() or unit:GetAuras():FindMy(FrostNova):IsUp() or unit:GetAuras():FindMy(WintersChill):IsUp() then |
||||
return true |
||||
end |
||||
|
||||
return false |
||||
end |
||||
|
||||
local IceLanceTarget = Bastion.UnitManager:CreateCustomUnit('icelance', function() |
||||
if not IceLance:IsKnownAndUsable() then return None end |
||||
|
||||
local icelance_target = nil |
||||
|
||||
Bastion.UnitManager:EnumEnemies(function(unit) |
||||
if unit:IsDead() then |
||||
return false |
||||
end |
||||
|
||||
if not Player:CanSee(unit) then |
||||
return false |
||||
end |
||||
|
||||
if not IceLance:IsInRange(unit) then |
||||
return false |
||||
end |
||||
|
||||
if not Player:IsFacing(unit) then |
||||
return false |
||||
end |
||||
|
||||
if IceLance:IsInFlightToUnit(unit) then |
||||
return false |
||||
end |
||||
|
||||
if isUnitFrozen(unit) then |
||||
icelance_target = unit |
||||
return true |
||||
end |
||||
|
||||
return false |
||||
end) |
||||
|
||||
if icelance_target == nil then |
||||
icelance_target = None |
||||
end |
||||
|
||||
return icelance_target |
||||
end) |
||||
|
||||
---@return boolean |
||||
local function CombatRotation() |
||||
if IceLance:IsKnownAndUsable() and IceLanceTarget:Exists() then |
||||
return IceLance:Cast(IceLanceTarget) |
||||
end |
||||
|
||||
if Target:Exists() and Player:CanSee(Target) and IceLance:IsKnownAndUsable() and IceLance:IsInRange(Target) and (isUnitFrozen(Target) or Player:GetAuras():FindMy(FingersOfFrost):IsUp()) then |
||||
return IceLance:Cast(Target) |
||||
end |
||||
|
||||
if Target:Exists() and Player:CanSee(Target) and Flurry:IsKnownAndUsable() and Player:GetAuras():FindMy(BrainFreeze):IsUp() then |
||||
local CastingSpell = Player:GetCastingOrChannelingSpell() |
||||
|
||||
if Player:IsMoving() or (CastingSpell ~= nil and CastingSpell:GetID() == Frostbolt:GetID()) then |
||||
return Flurry:Cast(Target) |
||||
end |
||||
end |
||||
|
||||
if Target:Exists() and Player:CanSee(Target) and not Player:IsMoving() and Frostbolt:IsKnownAndUsable() and Frostbolt:IsInRange(Target) then |
||||
return Frostbolt:Cast(Target) |
||||
end |
||||
|
||||
return false |
||||
end |
||||
|
||||
|
||||
---@return boolean |
||||
local function OutOfCombatRotation() |
||||
return false |
||||
end |
||||
|
||||
|
||||
local isRunning = false |
||||
|
||||
FrostModule:Sync(function() |
||||
if not isRunning then |
||||
Bastion:Print('Frost Started') |
||||
isRunning = true |
||||
end |
||||
|
||||
if not Player:IsAlive() or Player:IsMounted() then |
||||
return false |
||||
end |
||||
|
||||
if Player:IsAffectingCombat() or IsCurrentSpell(AutoAttack:GetID()) then |
||||
-- Combat Rotation |
||||
return CombatRotation() |
||||
else |
||||
-- Out Of Combat Rotation |
||||
return OutOfCombatRotation() |
||||
end |
||||
end) |
||||
|
||||
Bastion:Register(FrostModule) |
@ -0,0 +1,25 @@ |
||||
local |
||||
Tinkr, |
||||
---@type Bastion |
||||
Bastion = ... |
||||
|
||||
local Player = Bastion.UnitManager:Get('player') |
||||
|
||||
---@alias GetRangedTargetCount fun(range: number): number |
||||
|
||||
---@type GetRangedTargetCount |
||||
local function GetRangedTargetCount(range) |
||||
local count = 0 |
||||
|
||||
Bastion.UnitManager:EnumEnemies(function(unit) |
||||
if not unit:IsDead() and unit:IsAffectingCombat() and Player:CanSee(unit) and Player:GetDistance(unit) <= range and Player:IsFacing(unit) then |
||||
count = count + 1 |
||||
return false |
||||
end |
||||
return false |
||||
end) |
||||
|
||||
return count |
||||
end |
||||
|
||||
return GetRangedTargetCount |
Loading…
Reference in new issue