- if player == nil then player = GetMyHero() end
- if player.charName ~= "Twitch" then return end
- targetFindRange = 1200
- eRange = 1200
- poisonTimeOut = 600
- enemies = {}
- poisonTable =
- {
- [1] = "Data\\Particles\\twitch_poison_counter_01.troy",
- [2] = "Data\\Particles\\twitch_poison_counter_02.troy",
- [3] = "Data\\Particles\\twitch_poison_counter_03.troy",
- [4] = "Data\\Particles\\twitch_poison_counter_04.troy",
- [5] = "Data\\Particles\\twitch_poison_counter_05.troy",
- }
- damageTable =
- {
- E = { base = 20, baseScale = 15 },
- }
- --[[ local function hasShield(enemy)
- for i =1, enemy:buffCount, 1 do
- local buff = enemy:GetBuff(i)
- if buff and (buff == "SpellShield" or buff == "bansheesveil" or buff == "UndyingRage or buff == "JudicatorIntervention" or buff = "NocturneShroudofDarkness") then
- PrintChat(enemy.charName .. " has " .. buff .. ", let's not cast E right now .. "\
- return true
- end
- end
- return false
- end ]]
- function tickHandler(tick)
- local eDmg = (damageTable.E.base + (damageTable.E.baseScale * player:GetSpellLevel(_E)))
- for i, enemy in pairs(enemies) do
- if (GetTick() - enemy.poison.tick > poisonTimeOut) or (enemy and enemy.dead) then enemy.poison.count = 0
- end
- if enemy and not enemy.dead and enemy.visible then
- if eDmg + (enemy.poison.count * 15) + (enemy.poison.count * .2 * player.ap) + (enemy.poison.count * .25 * player.addDamage) > (enemy.health) and CanUseSpell (Slots._E) == SpellState.READY and player:GetDistanceTo(enemy) < eRange then
- CastSpell(_E)
- enemy.pauseTickE = GetTick()
- --[[ if rDmg * ( 1.0 + rDmgRatioPerHemo * enemy.hemo.count ) > (enemy.health+33) and CanUseSpell(Slots._R) == SpellState.READY and player:GetDistanceTo(enemy) < rRange and not hasShield(enemy) then
- CastSpell(Slots._R,enemy)
- enemy.pauseTickR = GetTick()
- end]]
- end
- end
- end end
- function objectHandler( object )
- if object and string.find(string.lower(object.name),"twitch_poison_counter") then
- for i, enemy in pairs(enemies) do
- if enemy and not enemy.dead and enemy.visible and object:GetDistanceTo(enemy) <= targetFindRange then
- for k, poison in pairs(poisonTable) do
- if object.name == poison then enemy.poison.tick = GetTick() enemy.poison.count = k end
- end
- end
- end
- end
- end
- function doE()
- local playerObj = nil
- for i = 1, heroManager.iCount-1, 1 do
- playerObj = heroManager:getHero(i)
- if playerObj ~= nil and playerObj.visible and playerObj:GetDistance(myHero) < eRange and obj.team == 1200 then
- table.insert(enemies, playerObj)
- playerObj.poison = { tick = 0, count = 0, }
- playerObj.pauseTickE = 0
- end
- end
- end
- BoL:addCreateObjHandler(objectHandler)
- BoL:addTickHandler(tickhandler)
- PrintChat(" >> Expunge GG")