Skip to content

Commit

Permalink
added more customizable configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain-P committed Mar 1, 2018
1 parent 8fdebaf commit 8ae037a
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 6 deletions.
36 changes: 35 additions & 1 deletion priest_disc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,19 @@ if not defined then
INTELLIGENT_BREAKS = {
ENABLED = true,
FILTERS = {filter_party_health},
STOPCASTING = false,
STOPCASTING = {
ENABLED = true,

--It won't stopcasting if you're casting a spell in the list below
BLACK_LIST = {
PriestSpells.PENANCE,
PriestSpells.FLASH_HEAL,
PriestSpells.BINDING_HEAL,
PriestSpells.MIND_CONTROL,
PriestSpells.HYMN_OF_HOPE,
PriestSpells.DIVINE_HYMN
}
},
SPELL_BREAKER = PriestSpells.MIND_SMOOTHE,
SPELL_LIST = {
WarriorSpells.REFLECT,
Expand All @@ -93,6 +105,17 @@ if not defined then
ENABLED = true,
FILTERS = {filter_party_health},
SPELL_ID = PriestSpells.DISPEL_MAGIC,
STOPCASTING = {
ENABLED = true,

--It won't stopcasting if you're casting a spell in the list below
BLACK_LIST = {
PriestSpells.PENANCE,
PriestSpells.MIND_CONTROL,
PriestSpells.HYMN_OF_HOPE,
PriestSpells.DIVINE_HYMN
}
},
AURA_LIST = {
Auras.HOJ,
Auras.REPENTANCE,
Expand Down Expand Up @@ -141,6 +164,17 @@ if not defined then
ENABLED = false,
FILTERS = {filter_party_health},
SPELL_ID = PriestSpells.DISPEL_MAGIC,
STOPCASTING = {
ENABLED = true,

--It won't stopcasting if you're casting a spell in the list below
BLACK_LIST = {
PriestSpells.PENANCE,
PriestSpells.MIND_CONTROL,
PriestSpells.HYMN_OF_HOPE,
PriestSpells.DIVINE_HYMN
}
},
AURA_LIST = {}
},
},
Expand Down
39 changes: 34 additions & 5 deletions shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

if not shared then shared = true
SharedConfiguration = {
melee_range = 7,
melee_range = 5,
gcd_value = 1.5,
latency = 0.15, -- latency in seconds

Expand Down Expand Up @@ -636,7 +636,7 @@ if not shared then shared = true
end

-- if equipped 2 weapons or interrupts not on cd, we dont stopcasting
if not MeleeRange(unit) or (unitHealth <= lastHealth and not firstime) or (hold.ITIME ~= nil and hold.ITIME + hold.IDURATION > GetTime()) then do return end end
if UnitTarget(unit) ~= player or not MeleeRange(unit) or (unitHealth <= lastHealth and not firstime) or (hold.ITIME ~= nil and hold.ITIME + hold.IDURATION > GetTime()) then return end

StopCasting()
overpowered = GetTime()
Expand Down Expand Up @@ -705,9 +705,16 @@ if not shared then shared = true
-- While a player has one of the defined auras in the list, it gonna try to cast the breaker spell
ListenSpellsAndThen(Configuration.Shared.INTELLIGENT_BREAKS.SPELL_LIST,
Configuration.Shared.INTELLIGENT_BREAKS.FILTERS,
Configuration.Shared.INTELLIGENT_BREAKS.ENABLED and Configuration.Shared.INTELLIGENT_BREAKS.STOPCASTING,
Configuration.Shared.INTELLIGENT_BREAKS.ENABLED and Configuration.Shared.INTELLIGENT_BREAKS.STOPCASTING.ENABLED,

function(_, _, _, _, _, _, object, _, _, _)
local castingSpell = select(1, UnitCastInfo(player))

if castingSpell ~= nil and TableContains(Configuration.Shared.INTELLIGENT_BREAKS.STOPCASTING.BLACK_LIST, GetSpellId(castingSpell)) then
return
end


if Cast(Configuration.Shared.INTELLIGENT_BREAKS.SPELL_BREAKER, object, enemy, true) then
StopCasting()
Cast(Configuration.Shared.INTELLIGENT_BREAKS.SPELL_BREAKER, object, enemy, true)
Expand All @@ -721,6 +728,14 @@ if not shared then shared = true
Configuration.Shared.AUTO_FRIENDLY_DISPEL.ENABLED,

function(_, unit)
local castingSpell = select(1, UnitCastInfo(player))

if not Configuration.Shared.AUTO_FRIENDLY_DISPEL.STOPCASTING.ENABLED and castingSpell ~= nil then return end

if castingSpell ~= nil and TableContains(Configuration.Shared.AUTO_FRIENDLY_DISPEL.STOPCASTING.BLACK_LIST, GetSpellId(castingSpell)) then
return
end

Cast(Configuration.Shared.AUTO_FRIENDLY_DISPEL.SPELL_ID, unit, ally)
end
)
Expand All @@ -731,6 +746,14 @@ if not shared then shared = true
Configuration.Shared.AUTO_ENEMY_DISPEL.ENABLED,

function(_, object, _, _, _, _)
local castingSpell = select(1, UnitCastInfo(player))

if not Configuration.Shared.AUTO_ENEMY_DISPEL.STOPCASTING.ENABLED and castingSpell ~= nil then return end

if castingSpell ~= nil and TableContains(Configuration.Shared.AUTO_ENEMY_DISPEL.STOPCASTING.BLACK_LIST, GetSpellId(castingSpell)) then
return
end

Cast(Configuration.Shared.AUTO_ENEMY_DISPEL.SPELL_ID, object, enemy)
end
)
Expand All @@ -743,7 +766,13 @@ if not shared then shared = true
function(_, object, _, _, _, _)
if not ValidUnit(object, enemy) then return end

if not Configuration.Shared.INTELLIGENT_BREAKS.STOPCASTING
local castingSpell = select(1, UnitCastInfo(player))

if castingSpell ~= nil and TableContains(Configuration.Shared.INTELLIGENT_BREAKS.STOPCASTING.BLACK_LIST, GetSpellId(castingSpell)) then
return
end

if not Configuration.Shared.INTELLIGENT_BREAKS.STOPCASTING.ENABLED
and UnitCastInfo(player) ~= nil then
return
end
Expand Down Expand Up @@ -780,7 +809,7 @@ if not shared then shared = true
if end_timestamp ~= nil then
local elapsed = 6 - (end_timestamp - GetTime())

if (elapsed < 0.5 + SharedConfiguration.latency) then
if (elapsed < 0.3 + SharedConfiguration.latency) then
if Configuration.Shared.FAKECAST_OVERPOWER.DEBUG then
print("Performed a fake cast for overpower from ".. UnitName(unit))
end
Expand Down
3 changes: 3 additions & 0 deletions shared_spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ if not shared_spells then
HOLY_FIRE = 48135,
SMITE = 48123,
MIND_BLAST = 48127,
MIND_CONTROL = 605,
HYMN_OF_HOPE = 64901,
DIVINE_HYMN = 64843,
MIND_SMOOTHE = 453,
INNER_FIRE = 48168,
FORTITUDE = 48161,
Expand Down

0 comments on commit 8ae037a

Please sign in to comment.