Array
(
    [scriptVersion] => 7
    [oeValues] => Array
        (
            [RngBuff1] => 250
            [MissileHoming] => 1
            [Upgrade] => Array
                (
                )

            [targs1] => Array
                (
                )

            [goldcost] => 2500
            [weapsOn] => 1
            [dice1] => 1
            [Missilespeed] => 1200
            [file] => buildings\other\GoldMine\GoldMine.mdl
            [atkType1] => siege
            [modelScale] => 0.4
            [weapTp1] => missile
            [Missilearc] => 0.2
            [acquire] => 800
            [rangeN1] => 800
            [upgrades] => Array
                (
                )

            [cool1] => 2.5
            [Ubertip] => You should always consider goblin-made items to be a nuclear weapon with a faulty trigger, you just might live to see another day.
            [abilList] => @@0@@,@@1@@
            [Name] => Goblin Stronghold
            [Missileart] => Abilities\Weapons\CannonTowerMissile\CannonTowerMissile.mdl
            [Art] => ReplaceableTextures\CommandButtons\BTNMerchant.blp
            [buildingShadow] => Array
                (
                )

            [unitSound] => GoblinSapper
            [sides1] => 10
            [uberSplat] => OSMA
            [auto] => Array
                (
                )

            [dmgplus1] => 896
            [bldtm] => 1
        )

    [settings] => Array
        (
            [author] => cedi
            [element] => iron
            [authorDisplay] => DreamStrider
            [alpha] => 255
            [balanceTip] => Array
                (
                )

            [rarity] => unique
            [version] => 1.0
            [abil_factor] => 0.1
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -23.0173
                    [y] => -7.56666
                    [z] => 0
                    [scale] => 0.55
                    [rot] => 3.89017
                    [file] => buildings\other\Merchant\Merchant.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [1] => Array
                (
                    [x] => -11.7168
                    [y] => 12.7581
                    [z] => 0
                    [scale] => 0.3
                    [rot] => 4.05284
                    [file] => Units\Creeps\HeroTinkerFactory\HeroTinkerFactory.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => Header
                    [code] => globals
        ProjectileType cedi_gob_sapper
        ProjectileType cedi_gob_robot //Both robot and emitter
        
        BuffType cedi_gob_sapperB
        BuffType cedi_gob_robotB
        BuffType cedi_gob_emitterB
    endglobals
    
    function Sapper_Hit takes Projectile P, Unit U returns nothing
        local Tower T = P.getCaster()
        local Iterate I = Iterate.overUnitsInRangeOfUnit( T, TARGET_CREEPS, U, 250.00 )
        
        if T == 0 then
            //We got no caster, abbadon ship.
            call I.destroy()
            return
        endif
        
        call T.getOwner().displaySmallFloatingText( I2S( P.userInt / 10 ) + "% slow", U, 100, 100, 255, 40.0 )
        
        call DestroyEffect( AddSpecialEffect( "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", P.x, P.y ) )
        
        loop
            set U = I.next()
            exitwhen U == 0
            call T.doSpellDamage( U, P.userReal, T.calcSpellCritNoBonus() )
            call cedi_gob_sapperB.apply( T, U, P.userInt )
        endloop
    endfunction
    
    //Both robot and emitter
    function Robot_Hit takes Projectile P, Unit U returns nothing
        set P.explode = false
        
        if P.getCaster() == 0 then
            //We got no caster, abbadon ship.
            return
        endif
        
        if P.userInt == 1 then
            //robot
            call cedi_gob_robotB.apply( P.getCaster(), U, P.userInt2 )
            call P.getCaster().getOwner().displaySmallFloatingText( I2S( P.userInt2 / 10 ) + "% AS and DMG", U, 100, 255, 100, 40.0 )
        else
            //emitter
            call cedi_gob_emitterB.apply( P.getCaster(), U, P.userInt2 )
            call P.getCaster().getOwner().displaySmallFloatingText( I2S( P.userInt2 / 10 ) + "% Trigger Chance", U, 100, 255, 100, 40.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
        local Modifier m
        
        //sapper
        set cedi_gob_sapper = ProjectileType.create( "units\\creeps\\GoblinSapper\\GoblinSapper.mdl", 20.0, 700.00 )
        call cedi_gob_sapper.enableHoming( Sapper_Hit, 0 )
        //sapper buff
        set cedi_gob_sapperB = BuffType.create( 3.0, 0.0, false )
        call cedi_gob_sapperB.setBuffIcon( '@@2@@' )
        set m = Modifier.create()
        call m.addModification( MOD_MOVESPEED, 0.00, -0.001 )
        call cedi_gob_sapperB.setBuffModifier( m )
        
        //robot / emitter
        set cedi_gob_robot = ProjectileType.createInterpolate( "", 200.0 )
        call cedi_gob_robot.setEventOnInterpolationFinished( Robot_Hit )
        //robot buff
        set cedi_gob_robotB = BuffType.create( 5.0, 0.0, true )
        call cedi_gob_robotB.setBuffIcon( '@@3@@' )
        set m = Modifier.create()
        call m.addModification( MOD_DAMAGE_ADD_PERC, 0.00, 0.001 )
        call m.addModification( MOD_ATTACKSPEED, 0.00, 0.001 )
        call cedi_gob_robotB.setBuffModifier( m )
        call cedi_gob_robotB.setSpecialEffect( "Units\\Creeps\\HeroTinkerRobot\\HeroTinkerRobot.mdl", 120.0, 0.7 )
        
        //emitter buff
        set cedi_gob_emitterB = BuffType.create( 5.0, 0.0, true )
        call cedi_gob_emitterB.setBuffIcon( '@@4@@' )
        set m = Modifier.create()
        call m.addModification( MOD_TRIGGER_CHANCES, 0.00, 0.001 )
        call cedi_gob_emitterB.setBuffModifier( m )
        call cedi_gob_emitterB.setSpecialEffect( "units\\creeps\\GoblinLandMine\\GoblinLandMine.mdl", 120.0, 1.0 )
	endfunction
                    [values] => Array
                        (
                            [icon] => ReplaceableTextures\CommandButtons\BTNClockWerkGoblin.blp
                            [visible] => true
                            [name] => Clockwork Engineer
                            [short_explain] => Whenever this tower attacks it has a chance to launch a clockwork engineer at a random tower, increasing the target's attack damage and speed.
                            [long_explain] => Whenever this tower attacks it has a |cffFFFF8020%|r chance to launch a clockwork engineer at a random tower within |cffFFFF80500|r range, increasing attack speed and damage by |cffFFFF8010% - 40%|r for |cffFFFF805|r seconds.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.6%|r chance|n|cffFFFF80+0.6%|r attack speed and damage
                        )

                )

            [1] => Array
                (
                    [name] => On Attack
                    [code] => local Unit U = Event.getTarget()
    local Projectile P
    local integer lvl = tower.getLevel()
    local boolean b = false
    local Iterate I
    //sapper
    if tower.calcChance( 0.2 + 0.004 * lvl ) then
        set b = true 
        set P = Projectile.createFromUnitToUnit( cedi_gob_sapper, tower, 1.0, 1.0, tower, U, true, false, false )
        //set damage 4500 (0.3/1.7)  + 180
        set P.userReal = GetRandomReal( 1350.0, 7650.0 ) + 180.00 * lvl
        //set slow / 15% + 10%  / 0.001
        set P.userInt = GetRandomInt( 250, 450 ) + 6 * lvl
    endif
    
    //robot
    if tower.calcChance( 0.2 + 0.004 * lvl ) then
        set I = Iterate.overUnitsInRangeOfCaster( tower, TARGET_TOWERS, 500.00 )
        set U = I.nextRandom()
        
        //Don't target self
        if U == tower then
            set U = I.nextRandom()
        endif
        
        if U != 0 then
            call I.destroy()
        else
            //no sense doing anything more.
            return
        endif
    
        set b = true 
        set P = Projectile.createLinearInterpolationFromUnitToUnit( cedi_gob_robot, tower, 1.0, 1.0, tower, U, 0.35, true )
        //set model
        call P.setModel( "Units\\Creeps\\HeroTinkerRobot\\HeroTinkerRobot.mdl" )
        //set type
        set P.userInt = 1
        //set effect / 10% - 40%
        set P.userInt2 = GetRandomInt( 100, 400 ) + 6 * lvl
    endif
    
    //emitter
    if tower.calcChance( 0.2 + 0.004 * lvl ) then
        set I = Iterate.overUnitsInRangeOfCaster( tower, TARGET_TOWERS, 500.00 )
        set U = I.nextRandom()
        
        //Don't target self
        if U == tower then
            set U = I.nextRandom()
        endif
        
        if U != 0 then
            call I.destroy()
        else
            //no sense doing anything more.
            return
        endif
    
        set b = true 
        set P = Projectile.createLinearInterpolationFromUnitToUnit( cedi_gob_robot, tower, 1.0, 1.0, tower, U, 0.33, true )
        //set model
        call P.setModel( "units\\creeps\\GoblinLandMine\\GoblinLandMine.mdl" )
        //set type
        set P.userInt = 0
        //set effect / 30% - 60% +15%
        set P.userInt2 = GetRandomInt( 300, 600 ) + 6 * lvl
    endif
    
    //Economy
    if not b then
        //Nothing happened, add gold
        call tower.getOwner().giveGold( 5.0, tower.getUnit(), true, true )
    endif
                    [values] => Array
                        (
                            [icon] => ReplaceableTextures\CommandButtons\BTNGoblinSapper.blp
                            [visible] => true
                            [name] => Goblin Sapper
                            [short_explain] => Whenever this tower attacks it has a chance to launch a sapper team towards the enemy, dealing spell damage and slowing all creeps close to the target.
                            [ONATTACK_chance] => 1.0
                            [ONATTACK_chanceLevelAdd] => 0.0
                            [long_explain] => Whenever this tower attacks it has a |cffFFFF8020%|r chance to launch a sapper team at the attacked creep. On contact the sappers deal |cffFFFF801350 - 7650|r spell damage to the target and all creeps within |cffFFFF80250|r range. Also slows all affected creeps by |cffFFFF8025% - 45%|r for |cffFFFF803|r seconds.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.4%|r chance|n|cffFFFF80+180|r spell damage|n|cffFFFF80+0.6%|r slow
                        )

                )

        )

    [abilities] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => Amgl
                    [oeValues] => Array
                        (
                            [Name] => Reimbursement
                            [checkDep] => 0
                            [Art] => ReplaceableTextures\CommandButtons\BTNPillage.blp
                            [Ubertip] => Whenever this tower attacks and not a single one of the other abilities trigger the player is reimbursed |cffFFFF805|r gold.
                            [Requires] => Array
                                (
                                )

                            [Tip] => Reimbursement
                            [Unubertip] => Whenever this tower attacks and not a single one of the other abilities trigger the player is reimbursed some gold.
                        )

                )

            [1] => Array
                (
                    [id] => @@1@@
                    [derivedFrom] => Amgl
                    [oeValues] => Array
                        (
                            [Name] => Probability Field Emitter
                            [checkDep] => 0
                            [Art] => ReplaceableTextures\CommandButtons\BTNGoblinLandMine.blp
                            [Requires] => Array
                                (
                                )

                            [Ubertip] => Whenever this tower attacks it has a |cffFFFF8020%|r chance to launch a probability field emitter at a random tower within |cffFFFF80500|r range, increasing trigger chances by |cffFFFF8030% - 60%|r for |cffFFFF805|r seconds.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.6%|r chance|n|cffFFFF80+0.6%|r trigger chances
                            [Tip] => Probability Field Emitter
                            [Unubertip] => Whenever this tower attacks it has a chance to launch a probability field emitter at a random tower, increasing its trigger chances.
                        )

                )

        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@2@@
                    [derivedFrom] => BHfs
                    [oeValues] => Array
                        (
                            [Bufftip] => Concussed
                            [Targetattach] => overhead
                            [Buffubertip] => This creep's movement speed is slowed.
                            [Targetattachcount] => 1
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNSelfDestruct.blp
                            [TargetArt] => Abilities\Spells\Orc\StasisTrap\StasisTotemTarget.mdl
                            [EditorName] => Concussed
                        )

                )

            [1] => Array
                (
                    [id] => @@3@@
                    [derivedFrom] => BHfs
                    [oeValues] => Array
                        (
                            [Bufftip] => Clockwork Engineer
                            [Buffubertip] => This tower has increased attack speed and damage.
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNClockWerkGoblin.blp
                            [TargetArt] => Array
                                (
                                )

                            [EditorName] => Clockwork Engineer
                        )

                )

            [2] => Array
                (
                    [id] => @@4@@
                    [derivedFrom] => BHfs
                    [oeValues] => Array
                        (
                            [Bufftip] => Probability Field Emitter
                            [Buffubertip] => This tower has increased trigger chances.
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNGoblinLandMine.blp
                            [TargetArt] => Array
                                (
                                )

                            [EditorName] => Probability Field Emitter
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

)