Skip to content

Commit

Permalink
fixed mistakes.. take new files, a lot of features were broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain-P committed Mar 1, 2018
1 parent 00cc78f commit 8fdebaf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
10 changes: 6 additions & 4 deletions priest_disc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if not defined then
INTELLIGENT_BREAKS = {
ENABLED = true,
FILTERS = {filter_party_health},
STOPCASTING = true,
STOPCASTING = false,
SPELL_BREAKER = PriestSpells.MIND_SMOOTHE,
SPELL_LIST = {
WarriorSpells.REFLECT,
Expand Down Expand Up @@ -269,7 +269,7 @@ if not defined then
Configuration.MASS_DISPEL.ENABLED,

function(_, _, _, _, _, _, object, _, _, _)
if GetDistanceBetweenObjects(player, object) > 30 or not InLos(player, object) or not ValidUnit(object, enemy) then return end
if object == nil or not CdRemains(PriestSpells.MASS_DISPEL) or GetDistanceBetweenObjects(player, object) > 30 or not InLos(player, object) or not ValidUnit(object, enemy) then return end
StopCasting()
end
)
Expand Down Expand Up @@ -300,10 +300,12 @@ if not defined then
Configuration.SWD_CASTING_CONTROL.FILTERS,
Configuration.SWD_CASTING_CONTROL.ENABLED,
function(object, _, _, _, _)
if not ValidUnit(object, enemy) or GetDistanceBetweenObjects(player, object) > 36 then return end
if not ValidUnit(object, enemy) then return end
if not IsCastingOnMe(object) or not UnitCastingInfo(object) then return end

StopCasting()
if CdRemains(PriestSpells.SWD) then
StopCasting()
end

if not Cast(PriestSpells.SWD, object, enemy) then
-- if the mage isnt in range, lf a closer target
Expand Down
28 changes: 16 additions & 12 deletions shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ if not shared then shared = true

-- Return true if a given type is checked
function ValidUnitType(unitType, unit)
if unit == nil then return false end

local isEnemyUnit = UnitCanAttack(player, unit) == 1
return (isEnemyUnit and unitType == enemy)
or (not isEnemyUnit and unitType == ally)
Expand Down Expand Up @@ -594,6 +596,8 @@ if not shared then shared = true

-- Return true if the given unit got an buff that increases max health
function HealthBuffed(unit)
if unit == nil then return end

return HasAura(Auras.BLESSING_OF_KING ,unit) or
HasAura(Auras.GREATER_BLESSING_OF_KING, unit) or
HasAura(Auras.FORTITUDE, unit) or
Expand Down Expand Up @@ -901,13 +905,13 @@ if not shared then shared = true
for i = 1, ObjectCount() do
local object = ObjectWithIndex(i)

if object == nil or GetDistanceBetweenObjects(player, object) > 40 then return end

local name = ObjectName(object)
local x, y, z = ObjectPosition(object)
if object ~= nil and GetDistanceBetweenObjects(player, object) <= 40 then
local name = ObjectName(object)
local x, y, z = ObjectPosition(object)

for j = 1, #aCallbacks do
aCallbacks[j](object, name, x, y, z)
for j = 1, #aCallbacks do
aCallbacks[j](object, name, x, y, z)
end
end
end
end
Expand All @@ -918,13 +922,13 @@ if not shared then shared = true

local object = ObjectWithIndex(i)

if object == nil then return end
if object ~= nil and GetDistanceBetweenObjects(player, object) <= 40 then
local objectName = ObjectName(object)

local objectName = ObjectName(object)

local hold = WorldObjects[objectName]
if hold ~= object then
WorldObjects[objectName] = object;
local hold = WorldObjects[objectName]
if hold ~= object then
WorldObjects[objectName] = object;
end
end
end
end
Expand Down

0 comments on commit 8fdebaf

Please sign in to comment.