Fix damage abilities, TODO work out unit token changes from index? something that resolves a unit to a unitmanager guid

pull/2/head
4n0n 2 years ago
parent 1ba0cd7115
commit ac74c38f0d
  1. 17
      scripts/restodruid.lua
  2. 10
      src/UnitManager/UnitManager.lua

@ -553,8 +553,9 @@ DefaultAPL:AddSpell(
and Player:CanSee(Bastion.UnitManager['target']) and
(
not Bastion.UnitManager['target']:GetAuras():FindMy(SunfireAura):IsUp() or
Bastion.UnitManager['target']:GetAuras():FindMy(SunfireAura):GetRemainingTime() <= 5.4) and Bastion.UnitManager['target']:IsHostile() and
Bastion.UnitManager['target']:IsAffectingCombat()
Bastion.UnitManager['target']:GetAuras():FindMy(SunfireAura):GetRemainingTime() <= 5.4) and
Bastion.UnitManager['target']:IsHostile() and
Bastion.UnitManager['target']:IsAffectingCombat() and Player:GetPP() >= 25
end):SetTarget(Bastion.UnitManager['target'])
)
@ -564,8 +565,9 @@ DefaultAPL:AddSpell(
and Player:CanSee(Bastion.UnitManager['target']) and
(
not Bastion.UnitManager['target']:GetAuras():FindMy(MoonfireAura):IsUp() or
Bastion.UnitManager['target']:GetAuras():FindMy(MoonfireAura):GetRemainingTime() <= 5.4) and Bastion.UnitManager['target']:IsHostile() and
Bastion.UnitManager['target']:IsAffectingCombat()
Bastion.UnitManager['target']:GetAuras():FindMy(MoonfireAura):GetRemainingTime() <= 5.4) and
Bastion.UnitManager['target']:IsHostile() and
Bastion.UnitManager['target']:IsAffectingCombat() and Player:GetPP() >= 25
end):SetTarget(Bastion.UnitManager['target'])
)
@ -573,15 +575,16 @@ DefaultAPL:AddSpell(
Starsurge:CastableIf(function(self)
return Bastion.UnitManager['target']:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling()
and Player:CanSee(Bastion.UnitManager['target']) and Bastion.UnitManager['target']:IsHostile() and
Bastion.UnitManager['target']:IsAffectingCombat()
Bastion.UnitManager['target']:IsAffectingCombat() and Player:GetPP() >= 25
end):SetTarget(Bastion.UnitManager['target'])
)
DefaultAPL:AddSpell(
Wrath:CastableIf(function(self)
return Bastion.UnitManager['target']:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling()
and Player:CanSee(Bastion.UnitManager['target']) and not Player:IsMoving() and Bastion.UnitManager['target']:IsHostile() and
Bastion.UnitManager['target']:IsAffectingCombat()
and Player:CanSee(Bastion.UnitManager['target']) and not Player:IsMoving() and
Bastion.UnitManager['target']:IsHostile() and
Bastion.UnitManager['target']:IsAffectingCombat() and Player:GetPP() >= 25
end):SetTarget(Bastion.UnitManager['target'])
)

@ -56,6 +56,10 @@ local UnitManager = {
}
function UnitManager:__index(k)
if k == 'none' then
return self:Get('none')
end
if UnitManager[k] then
return UnitManager[k]
end
@ -112,7 +116,11 @@ function UnitManager:Get(token)
local tguid = ObjectGUID(token)
if self.objects[tguid] == nil then
self.objects[tguid] = Unit:New(Object(tguid))
if token == 'none' then
self.objects[tguid] = Unit:New(token)
else
self.objects[tguid] = Unit:New(Object(tguid))
end
end
return self.objects[tguid]

Loading…
Cancel
Save