Taita, the Hermit v1
4000
ID:
215
Family ID:
Author:
DaveMatthews
Rarity:
unique
Element:
ice
Attack Type:
Elemental
Attack Range:
1000
Attack CD:
1.3
Damage:
3112-3112
Status:
Approved

Description:

Standing on a snowy peak, he's watched the world below for decades.
Frost Bolt
On attack, this tower has a chance, equal to the percentage of movement speed the attacked unit is missing, to launch a frost bolt, dealing 20% of the tower's attack damage as elemental damage in 200 AoE around the target for each stack of icy touch the creep has. This spell deals double damage to stunned targets. 

Level Bonus:
+0.4% damage per stack
Icy Touch
Each attack slows the attacked unit by 10% for 5 seconds, stacking up to 6 times. This tower deals additional 10% damage for every stack of icy touch the target has. 

Level Bonus:
+0.2% damage per stack
Cold Blood
Every time it kills a unit, this tower gains 50% attack speed for 3 seconds. 

Level Bonus:
+0.5% attack speed
Download

Toggle Triggers

Header

    globals
      BuffType dave_blood
      BuffType dave_touch
      ProjectileType dave_frostbolt
    endglobals
    
    
    function boltHit takes Projectile p, Unit creep returns nothing
    local Tower tower = p.getCaster()
    local integer level= tower.getLevel()
    local Buff b = creep.getBuffOfType(dave_touch)
    local real damage = tower.getCurrentAttackDamageWithBonus()
    local integer bufflevel = 0
    
    if b!= 0 then
      set bufflevel = b.getLevel()
    endif
    
    if creep.getBuffOfGroup( "stun" )!=0 then
       call tower.doAttackDamageAoEUnit(creep,200,2*(damage*(bufflevel*(0.2+(0.004*level)))), tower.calcAttackMulticrit(0,0,0),0)
    else
       call tower.doAttackDamageAoEUnit(creep,200,damage*(bufflevel*(0.2+(0.004*level))), tower.calcAttackMulticrit(0,0,0),0)
    endif
    endfunction

    private function init takes nothing returns nothing
    local Modifier m = Modifier.create()
    local Modifier o = Modifier.create()
        
    set dave_blood = BuffType.create(3.0,0.0,true)
    call dave_blood.setBuffModifier(m)
    call dave_blood.setBuffIcon( '@@0@@' )
    call m.addModification(MOD_ATTACKSPEED,0.5,0.005)
    
    set dave_touch = BuffType.create(5.0,0.0,false)
    call dave_touch.setBuffModifier(o)
    call dave_touch.setBuffIcon( '@@1@@' )
    call o.addModification(MOD_MOVESPEED,0.0,-0.1)
    
    set dave_frostbolt = ProjectileType.create("Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathMissile.mdl",4,900) 
    call dave_frostbolt.enableHoming(ProjectileTargetEvent.boltHit,0)
    endfunction

On Attack

ONATTACK_chance: 1.0 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
local Projectile p
local Unit creep = Event.getTarget()
local unit u = creep.getUnit()
local real speed = GetUnitDefaultMoveSpeed(u)
local real currentSpeed = GetUnitMoveSpeed(u)
local real slow = ((speed - currentSpeed) / speed)

if tower.calcChance(slow) then
   set p = Projectile.createFromUnitToUnit(dave_frostbolt, tower,1,1, tower, creep, true, false, false)
endif
set u = null
endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
local Unit target = Event.getTarget()
local Buff b = target.getBuffOfType(dave_touch)
local integer bufflevel = 0
local real damage = tower.getCurrentAttackDamageWithBonus()
local integer level = tower.getLevel()

if b != 0 then
   set bufflevel = b.getLevel()
   set Event.damage = Event.damage*(1+(bufflevel*(0.1+0.002*level)))
endif

if bufflevel < 6 then
    call dave_touch.apply(tower, target, bufflevel+1)
endif
endfunction

On Kill

function onKill takes Tower tower returns nothing
local integer level = tower.getLevel()

call dave_blood.apply(tower,tower,level)
endfunction