Holy Hand Grenade v1
2300
lvl: 69

ID:

241

Author:

cedi

Rarity:

unique

Status:

Approved

Description:

Remember worms?

Latest Upload Comment:

Restored from 1.10
Big Badaboom
Whenever the owner of this item attacks it has a 15% chance to launch a holy missile which deals 75% of the damage the last attack dealt as spell damage in 400 AoE around the target unit. Deals 50% more damage against undead.

Level Bonus:
+1% damage
Download

Toggle Triggers

Header

goldcost: 0
    globals
        ProjectileType PT
    endglobals
    
    function hit takes Projectile P, Unit U returns nothing
        local Effect e
        local Tower C = P.getCaster()
        local unit u
        if U != 0 then
            set u = U.getUnit()
            call C.doSpellDamageAoEUnit( U, 400.00, P.userReal, C.calcSpellCritNoBonus(), 0.00 )
            set e = Effect.createScaled( "Abilities\\Weapons\\FaerieDragonMissile\\FaerieDragonMissile.mdl", GetUnitX( u ), GetUnitY( u ), 80.00, 0.00, 5.0 )
            call e.setLifetime( 0.01 )
            set u = null
        endif
    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 PT = ProjectileType.create( "Abilities\\Spells\\Other\\Transmute\\GoldBottleMissile.mdl", 50.0, 1000.0 )
        call PT.enableHoming( hit, 0.0 )
    endfunction

On Damage

ONDAMAGE_chance: 0.15 goldcost: 2300 ONDAMAGE_chanceLevelAdd: 0.0
function onDamage takes Item itm returns nothing
    local Tower tower = itm.getCarrier()
    local real r = Event.damage * ( 0.75 + 0.01 * tower.getLevel() )
    local Projectile P
    if Event.isMainTarget() then
        if Event.getTarget().getCategory() == CATEGORY_UNDEAD then
            set r = r * 1.5
        endif
        set P = Projectile.createFromUnitToUnit( PT, tower, 1.0, tower.calcSpellCritNoBonus(), tower, Event.getTarget(), true, false, false )
        set P.userReal = r
    endif
endfunction