Quillboar Thornweaver v1
800
ID:
48
Family ID:
Author:
SirCoqaLot.
Rarity:
rare
Element:
nature
Attack Type:
Physical
Attack Range:
800
Attack CD:
0.9
Damage:
379-398
Abil. Factor:
0.5
Status:
Unapproved

Description:

Advanced Nature tower that is able to release a spray of thorns from it's back.

Latest Upload Comment:

Restored from 1.10
Quillspray
This tower deals 30% of its attack damage as physical damage to every unit in 800 range around it. A creep hit by a Quillspray receives 11% more damage than it did from the previous Quillspray, if hit again within 1.5 seconds. This effect stacks up to 40 times.

Hint: Save mana to amplify the effect of this ability.

Level Bonus:
+0.2% base damage
5% chance to doublecast Quillsprays at level 15
3% chance to triplecast Quillsprays at level 25
Occasional Quillspray
On attack this tower has a 12% chance to trigger a Quillspray. 

Hint: This Quillspray costs no mana. 

Level Bonus:
+0.15% chance
Download

Toggle Triggers

Autocast

AUTOCAST_cooldown: 0.2 AUTOCAST_autoRange: 700 AUTOCAST_manacost: 5 AUTOCAST_range: 800 AUTOCAST_targetType: 0 AUTOCAST_numBuffsBeforeIdle: 0 caster_art: target_art: AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_IMMEDIATE AUTOCAST_buffType: 0 AUTOCAST_isExtended: true AUTOCAST_targetSelf: true
private function onAutocast takes Tower tower returns nothing
    local integer level = tower.getLevel()
    call quillspray(tower,1350)
    if level == 25 then 
        if tower.calcChance(0.03) then
            call quillspray(tower,1500)
            call quillspray(tower,1700)
         elseif tower.calcChance(0.05) then
            call quillspray(tower,1500)
        endif
    elseif level > 15 then
        if tower.calcChance(0.05) then
            call quillspray(tower,1500)
        endif
    endif
endfunction

Header

    globals
    //@export
    ProjectileType sir_boar_proj
    //@export
    BuffType sir_boar_debuff
    endglobals
    
    //@export
    function quillspray takes Tower tower, real speed returns nothing
    local Iterate i
    local Unit u
    local Projectile p
    set i = Iterate.overUnitsInRangeOfCaster(tower,TARGET_TYPE_CREEPS,800)
    
    loop
        set u = i.next()
        exitwhen u == 0 
        set p = Projectile.createFromUnitToUnit(sir_boar_proj,tower,1.0,1.0,tower,u,true,false,false)
        call p.setScale(0.7)
        set p.speed = speed
    endloop
    endfunction
    
    private function sir_boar_hit takes Projectile p , Unit creep returns nothing
        local Tower tower = p.getCaster()
        local integer buffLevel = IMinBJ(creep.getBuffOfType(sir_boar_debuff).getLevel(),40)
        call tower.doAttackDamage(creep,(0.3+tower.getLevel()*0.002)*tower.getCurrentAttackDamageWithBonus()*Pow(1.11,I2R(buffLevel)),tower.calcAttackMulticrit(0,0,0))
        call sir_boar_debuff.applyAdvanced(tower,creep,buffLevel+1,0,1.5)
    endfunction
    
    
    //Do not remove or rename this function!
    //Put your initialization tasks here, this function will be called on map init
    private function init takes nothing returns nothing
    set sir_boar_debuff = BuffType.create(0,0,false)
    call sir_boar_debuff.setBuffIcon('@@0@@')
    set sir_boar_proj = ProjectileType.create("Abilities\\Weapons\\QuillSprayMissile\\QuillSprayMissile.mdl",2,1300)
    call sir_boar_proj.enableHoming(ProjectileTargetEvent.sir_boar_hit,0)
    endfunction

On Attack

ONATTACK_chance: 0.12 ONATTACK_chanceLevelAdd: 0.0015
function onAttack takes Tower tower returns nothing
    local integer level = tower.getLevel()
    call quillspray(tower,1350)
    if level == 25 then 
        if tower.calcChance(0.03) then
            call quillspray(tower,1500)
            call quillspray(tower,1700)
        elseif tower.calcChance(0.05) then
            call quillspray(tower,1500)
        endif
    elseif level > 15 then
        if tower.calcChance(0.05) then
            call quillspray(tower,1500)
        endif
    endif
endfunction