Fire Star v1
3000
ID:
374
Family ID:
Author:
cedi
Rarity:
unique
Element:
fire
Attack Type:
Elemental
Attack Range:
1000
Attack CD:
2
Damage:
900-900
Status:
Approved

Description:

The fire star, a war machine created by the mightiest fire lords to defend the old palace.
Burning Barrage:
Attacks up to 14 targets at once.
Burn!
When this tower damages a creep it will ignite and take the towers damage as attack damage every 2 seconds. The buff slows movement speed by 5%, lasts 2.5 seconds and stacks. Each stack increases the damage by 5% and the slow by 1%.

Level Bonus:
+4% initial damage
+0.2% damage per stack
Double the Trouble
When this tower damages a creep it has a 12.5% chance to launch an additional projectile that deals the same damage as a normal attack.

Level Bonus:
+0.5% chance
Download

Toggle Triggers

Header

    globals
        ProjectileType PT
        BuffType BT
    endglobals
    
    function refresh takes Buff B returns nothing
        set B.userReal = B.userReal + 0.05 + 0.002 * B.getCaster().getLevel()
    endfunction
    
    function periodic takes Buff B returns nothing
        local Tower T = B.getCaster()

        call T.doAttackDamage( B.getBuffedUnit(), T.getCurrentAttackDamageWithBonus() * B.userReal, T.calcAttackMulticrit(0,0,0))
    endfunction
    
    function Hit takes Projectile p, Unit t returns nothing
        local Tower T = p.getCaster()
        local Buff B
        local integer i
        set B = t.getBuffOfType( BT )
        if ( B != 0 ) then
            set i = B.getPower() + 1
            set B = BT.applyCustomPower( T, t, 1, i )
        else
            set i = 0
            set B = BT.applyCustomPower( T, t, 1, i )
            set B.userReal = 1.00 + 0.04 * T.getLevel()
        endif
        call T.doAttackDamage( t, T.getCurrentAttackDamageWithBonus(), T.calcAttackMulticrit(0,0,0))
    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
        local Modifier m = Modifier.create()
        set PT = ProjectileType.create( "Abilities\\Weapons\\LordofFlameMissile\\LordofFlameMissile.mdl", 7.00, 1000.00 )
        call PT.enableHoming( Hit, 0.00 )
        
        set BT = BuffType.create( 2.5, 0.00, false )
        call BT.setBuffIcon( '@@1@@' )
        call m.addModification( MOD_MOVESPEED, -0.05, -0.01 )
        call BT.setBuffModifier( m )
        call BT.setEventOnRefresh( refresh )
        call BT.addPeriodicEvent( periodic, 2.00 )
    endfunction

On Damage

ONDAMAGE_chance: 1.00 ONDAMAGE_chanceLevelAdd: 0.00
function onDamage takes Tower tower returns nothing
    local Buff B
    local integer i
    set B = Event.getTarget().getBuffOfType( BT )
    if ( B != 0 ) then
        set i = B.getPower() + 1
        set B = BT.applyCustomPower( tower, Event.getTarget(), 1, i )
    else
        set i = 0
        set B = BT.applyCustomPower( tower, Event.getTarget(), 1, i )
        set B.userReal = 1.00 + 0.04 * tower.getLevel()
    endif
    
    if tower.calcChance( 0.125 + tower.getLevel() * 0.005 ) then
        //Double the trouble
        call Projectile.createFromUnitToUnit( PT, tower, 1.00, 1, tower, Event.getTarget(), true, false, false )
    endif
endfunction