Gryphon Rider v1
3050
ID:
157
Family ID:
Author:
cedi
Rarity:
unique
Element:
storm
Attack Type:
Energy
Attack Range:
900
Attack CD:
2
Damage:
5040-5050
Mana:
55
Mana regen:
2
Status:
Approved

Description:

WC2 wasn't enough.
Specials:
Attacks GROUND only
+8% damage/lvl
Hammer Fall
Summons a hammer which falls from the sky. The hammer deals 10000 spell damage to all units in 600 AoE and stuns them for 1 second. Each of the player's storm tower in 2500 range loses 10% attack damage for 6 seconds but increases the spell damage of the Hammer by 5%. Can gain a maximum of 100% bonus damage.

Level Bonus:
+0.2% damage from towers

AC_TYPE_OFFENSIVE_UNIT
 50, 900.0 range, 10.0s cooldown
Mystical Storm Hammer
Whenever this tower damages a creep, part of the damage is dealt as spell damage and the rest as attack damage. The amount of spell damage depends on the magic resistance of the target. The higher the resistance, the smaller ratio of spell damage dealt. Deals no spell damage against immune creeps and deals no physical damage against banished creeps. If this ability deals all the damage in one type, it will have 5% increased critchance.

Level Bonus:
+1.8% crit chance
Storm Bolt
When this tower attacks it launches a storm bolt towards the target unit. Upon collision, the bolt deals the towers attack damage to the target and creates a trail of 5 storm explosions. The explosions deal the tower's attack damage to every unit in 85 AOE. Each explosion deals 40% less damage than the previous one.

Level Bonus:
-1.2% damage reduction
Download

Toggle Triggers

Autocast

caster_art: AUTOCAST_cooldown: 10.0 AUTOCAST_numBuffsBeforeIdle: 0 AUTOCAST_isExtended: false AUTOCAST_autocastType: AC_TYPE_OFFENSIVE_UNIT AUTOCAST_manacost: 50 AUTOCAST_range: 900.0 AUTOCAST_buffType: 0 AUTOCAST_targetSelf: true AUTOCAST_targetType: 0 target_art: AUTOCAST_autoRange: 900.0
private function onAutocast takes Tower tower returns nothing
    local Projectile P = Projectile.createFromUnit( HR, tower, Event.getTarget(), 0.0, 1.0, 1.0 )
    local Iterate I = Iterate.overUnitsInRangeOfCaster( tower, TARGET_PLAYER_TOWERS, 2500.0 )
    local Tower U
    local real r = 1
    call P.setScale( 8 )
    set P.z = 1000.0
    set P.userReal = 10000.0
    
    loop
        set U = I.next()
        exitwhen U == 0
        if U.getElement() == Element.STORM then
            set r = r + ( 0.05 + 0.002 * tower.getLevel() )
            call BT.apply( tower, U, 0 )
        endif
        if r >= 2.0 then
            call I.destroy()
            exitwhen true
        endif
    endloop
    set P.userReal = P.userReal * r
endfunction

Header

    globals
        ProjectileType PT
        ProjectileType HR
        BuffType BT
    endglobals
        
    function DealDamage takes Tower T, Creep C, real dmg returns nothing
        local real spell = C.getProp_SpellDmgReceived()
        local real phys = C.getProp_AtkDmgReceived()
        local real r
        local real crit = 0.0
        
        //calc spell damage taken
        //Immune?
        if C.isImmune() then
            //0% spell damage
            set spell = 0
        endif
        
        //calc physical damage taken
        //Banished?
        if C.isBanished() then
            //0% physical damage
            set phys = 0
        else
            //armor
            set phys = phys * C.getCurrentArmorDamageReduction()
        endif
        
        //we don't want anything below zero!
        if spell < 0.00 then
            set spell = 0
        endif
        if phys < 0.00 then
            set phys = 0
        endif
        
        //Result are how much physical and spell damage the unit takes.
        //Probably adding these two wont result in 100% so we have to scale them
        set r = spell + phys
        if r <= 0 then
            //shit happened...
            return
        endif
        if r != 1.0 then
            set spell = spell / r
            set phys = phys / r
        endif
        
        //crit bonus?
        if phys == 1.0 or spell == 1.0 then
            set crit = 0.05 + 0.018 * T.getLevel()
        endif
        //Now we know what we need to know to deal damage
        call T.doSpellDamage( C, dmg * spell, T.calcSpellCrit(crit, 0.0) )
        call T.doAttackDamage( C, dmg * phys, T.calcAttackMulticrit(crit, 0, 0) )
    endfunction
    
    function LineDamage takes Tower T, real sx, real sy, real angle returns nothing
        local Iterate I
        local Creep C
        local integer i = 0
        local real distance = 128.0
        local real x
        local real y
        local Effect E
        local real dmg = T.getCurrentAttackDamageWithBonus()
        local integer UID = T.getUID()
        set angle = angle * bj_DEGTORAD
        loop
            exitwhen i >= 5 or T.getUID() != UID
            set x = sx + Cos( angle ) * ( distance * i )
            set y = sy + Sin( angle ) * ( distance * i )
            set I = Iterate.overUnitsInRange( T, TARGET_CREEPS, x, y, 85.0 )
            loop
                set C = I.next()
                exitwhen C == 0
                call DealDamage( T, C, dmg )
            endloop
            //Effect creation
            call Effect.createScaled( "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl", x, y, 0.00, 0.00, 0.5 ).setLifetime(1.5)
            call Effect.createColored( "Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl", x, y, 0.00, 0.00, 2.0, 0, 0, 0, 255 ).setLifetime(2.5)
            
            set dmg = dmg * ( 0.6 + 0.012 * T.getLevel() )
            set i = i + 1
            call TriggerSleepAction( 0.15 )
        endloop
    endfunction
    
    function hit takes Projectile P, Creep C returns nothing
        local Tower T = P.getCaster()
        if C != 0 then
            //hit
            call DealDamage( T, C, T.getCurrentAttackDamageWithBonus() )
        endif
        call LineDamage( T, P.x, P.y, P.direction )
    endfunction
    
    function impact takes Projectile P returns nothing
        local Tower T = P.getCaster()
        local Iterate I = Iterate.overUnitsInRange( T, TARGET_CREEPS, P.x, P.y, 600.0 )
        local Unit U
        
        loop
            set U = I.next()
            exitwhen U == 0
            call DealDamage( T, U, P.userReal )
            call cb_stun.applyOnlyTimed( T, U, 1.0 )
        endloop
    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()
        call m.addModification( MOD_DAMAGE_ADD_PERC, -0.1, 0.0 )
        
        set PT = ProjectileType.createInterpolate( "Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl", 1100.0 )
        call PT.setEventOnInterpolationFinished( hit )
        
        set HR = ProjectileType.create( "Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl", 90.0, 0.0 )
        call HR.enablePhysics( 0, impact, -30, 0, 0.0 )
        
        set BT = BuffType.create( 6.0, 0.0, false )
        call BT.setBuffIcon( '@@0@@' )
        call BT.setBuffModifier( m )
    endfunction

On Attack

ONATTACK_chance: 1.0 ONATTACK_chanceLevelAdd: 0.0
function onAttack takes Tower tower returns nothing
    call Projectile.createLinearInterpolationFromUnitToUnit( PT, tower, 1.0, 1.0, tower, Event.getTarget(), 0.15, true )
endfunction

On Damage

ONDAMAGE_chance: 1.0 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Tower tower returns nothing
    set Event.damage = 0
endfunction