Array
(
    [scriptVersion] => 8
    [oeValues] => Array
        (
            [Ubertip] => Look the storm in the eye and you will have its respect.
            [Art] => ReplaceableTextures\CommandButtons\BTNSpell_Holy_SealOfMight.blp
            [abilList] => Array
                (
                )

            [Name] => Mjolner
        )

    [settings] => Array
        (
            [balanceTip] => Array
                (
                )

            [goldcost] => 1950
            [author] => Ashbringer
            [authorDisplay] => |cffff6600Ashbringer|r
            [version] => 1.0
            [rarity] => unique
        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Item Creation
                    [code] => set itm.userInt = 0
                    [values] => Array
                        (
                            [explain] => 
                            [visible] => false
                            [goldcost] => 0
                            [name] => 
                        )

                )

            [1] => Array
                (
                    [name] => On Attack
                    [code] => local Tower tower = itm.getCarrier()
    local Unit target = Event.getTarget()
    local real angle = AngleBetweenPoints(GetUnitLoc(tower.getUnit()), GetUnitLoc(target.getUnit()))
    local Projectile p
    
    if itm.userInt == 0 then
        set p = Projectile.create(ashbringer_mjolner, tower, 0.0, 0.0, tower.getX(), tower.getY(), 60.0, angle)
        call p.setScale(1.3)
        call p.setTeamcolor(ConvertPlayerColor(1))
        //call p.addAbility('@@0@@')
        set p.userInt = itm
        set p.userInt2 = 0
        set p.userReal = tower.getBaseAttackspeed()
        set itm.userInt = 1
    endif
                    [values] => Array
                        (
                            [explain] => Throw out Mjolner on atttack, which travels in a straight line for |cffFFFF801200|r range before returning to the tower. Deals |cffFFFF8050%|r of the tower's attack damage as spell damage to enemies in its path. Damage is attack speed adjusted and Mjolner must return to the tower before it can be thrown again.
                            [visible] => true
                            [goldcost] => 1950
                            [name] => Avenger's Throw
                            [ONATTACK_chance] => 1.0
                            [ONATTACK_chanceLevelAdd] => 0.0
                        )

                )

            [2] => Array
                (
                    [name] => Header
                    [code] => globals
        ProjectileType ashbringer_mjolner
    endglobals
    
    function ashbringer_mjolner_hit takes Projectile p, Unit target returns nothing
        local Tower tower = p.getCaster()
        
        //call tower.doCustomAttackDamage(target, tower.getCurrentAttackDamageWithBonus(), tower.calcAttackMulticrit(0, 0, 0), AttackType.ENERGY)
        call tower.doSpellDamage(target, (tower.getCurrentAttackDamageWithBonus() * 0.5) / p.userReal, tower.calcSpellCritNoBonus())
        call Effect.createSimpleOnUnit("Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl", target, "chest").destroy()
    endfunction
    
    function ashbringer_mjolner_end takes Projectile p returns nothing
        local Item itm = p.userInt
        if p.userInt2 ==0 then
            call p.avertDestruction()
            call p.aimAtUnit(p.getCaster(), false, true, true)
            call p.resetCollision()
            set p.userInt2 = 1
        elseif p.userInt2 == 1 then
            set itm.userInt = 0
        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 ashbringer_mjolner = ProjectileType.create("Abilities\\Spells\\Human\\StormBolt\\StormBoltMissile.mdl", 1, 1200)
        call ashbringer_mjolner.enableCollision(ProjectileTargetEvent.ashbringer_mjolner_hit, 60, TARGET_TYPE_CREEPS, false)
        call ashbringer_mjolner.setEventOnExpiration(ProjectileEvent.ashbringer_mjolner_end)
        call ashbringer_mjolner.disableExplodeOnExpiration()
	endfunction
                    [values] => Array
                        (
                            [explain] => 
                            [visible] => false
                            [goldcost] => 0
                            [name] => 
                        )

                )

        )

    [abilities] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => Apxf
                    [oeValues] => Array
                        (
                            [Dur1] => 0.1
                            [Art] => ReplaceableTextures\CommandButtons\BTNMarkOfFire.blp
                            [MissileHoming] => 0
                            [HeroDur1] => 0.1
                            [Missileart] => Doodads\Cinematic\Lightningbolt\Lightningbolt
                            [Missilespeed] => 10000
                            [Cool1] => 0.2
                            [DataA1] => 1000
                            [Area1] => 300
                            [Name] => mjolnerbolt
                            [DataB1] => 0
                        )

                )

        )

    [buffs] => Array
        (
        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

)