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

            [targs1] => Array
                (
                )

            [goldcost] => 1800
            [weapsOn] => 1
            [dice1] => 1
            [Missilespeed] => 1500
            [moveHeight] => 52
            [file] => units\creeps\NerubianQueen\NerubianQueen.mdl
            [atkType1] => siege
            [modelScale] => 0.7
            [weapTp1] => missile
            [acquire] => 950
            [rangeN1] => 950
            [upgrades] => Array
                (
                )

            [cool1] => 1.25
            [Ubertip] => The mother of all Nerubian spiders. She is very poisonous!
            [backSw1] => -0.6
            [abilList] => Array
                (
                )

            [Name] => Nerubian Queen
            [Missileart] => Abilities\Weapons\CryptFiendMissile\CryptFiendMissile.mdl
            [Art] => ReplaceableTextures\CommandButtons\BTNNerubianQueen.blp
            [buildingShadow] => Array
                (
                )

            [turnRate] => 2
            [sides1] => 40
            [uberSplat] => OSMA
            [auto] => Array
                (
                )

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

    [settings] => Array
        (
            [author] => Boekie
            [element] => darkness
            [authorDisplay] => |cff00CD00Boekie|r
            [alpha] => 255
            [balanceTip] => Array
                (
                )

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

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => -3.25088
                    [y] => -10.5333
                    [z] => 12.8
                    [scale] => 0.75
                    [rot] => 3.76292
                    [file] => Doodads\Northrend\Structures\AncientZiggurat\AncientZiggurat1.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [1] => Array
                (
                    [x] => -36.6906
                    [y] => -55.448
                    [z] => 0
                    [scale] => 0.5
                    [rot] => 2.54933
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [2] => Array
                (
                    [x] => 36.6268
                    [y] => -32.8506
                    [z] => 38.4
                    [scale] => 0.5
                    [rot] => 4.2586
                    [file] => Doodads\LordaeronSummer\Props\SkullPile\SkullPile0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [3] => Array
                (
                    [x] => 1.6863
                    [y] => -43.1007
                    [z] => 51.2
                    [scale] => 0.15
                    [rot] => 4.51502
                    [file] => units\creeps\Spider\Spider.mdl
                    [red] => 150
                    [green] => 150
                    [blue] => 150
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [4] => Array
                (
                    [x] => -31.9537
                    [y] => -47.0028
                    [z] => 57.6
                    [scale] => 0.15
                    [rot] => 4.28516
                    [file] => units\creeps\Spider\Spider.mdl
                    [red] => 150
                    [green] => 150
                    [blue] => 150
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [5] => Array
                (
                    [x] => 43.5529
                    [y] => -36.3254
                    [z] => 64
                    [scale] => 0.15
                    [rot] => 5.24346
                    [file] => units\creeps\Spider\Spider.mdl
                    [red] => 150
                    [green] => 150
                    [blue] => 150
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [6] => Array
                (
                    [x] => -43.551
                    [y] => 8.44852
                    [z] => 51.2
                    [scale] => 0.15
                    [rot] => 2.7288
                    [file] => units\creeps\Spider\Spider.mdl
                    [red] => 150
                    [green] => 150
                    [blue] => 150
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

            [7] => Array
                (
                    [x] => 43.8194
                    [y] => 40.6683
                    [z] => 57.6
                    [scale] => 0.15
                    [rot] => 1.01684
                    [file] => units\creeps\Spider\Spider.mdl
                    [red] => 150
                    [green] => 150
                    [blue] => 150
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Tower Creation
                    [code] => set tower.userReal = 0
                    [values] => Array
                        (
                            [icon] => 
                            [visible] => false
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => On Damage
                    [code] => call boekie_parasite_inject(tower, Event.getTarget())
                    [values] => Array
                        (
                            [ONDAMAGE_chance] => 0.30
                            [icon] => ReplaceableTextures\CommandButtons\BTNDeathCoil.blp
                            [visible] => true
                            [name] => Inject Parasite
                            [short_explain] => Has a chance to inject a parasite into a damaged creep.
                            [ONDAMAGE_chanceLevelAdd] => 0.004
                            [long_explain] => When the Queen damages a creep she has a |cffFFFF8030%|r chance to inject a parasite that lives for |cffFFFF8010|r seconds. Each second the creep will suffer |cffFFFF80500|r spelldamage and will permanently lose |cffFFFF802%|r armor. When an infected creep dies, the Nerubian Queen will gain |cffFFFF800.75%|r permanent bonus attackdamage and the parasite will attempt to jump to another host in |cffFFFF80500|r range.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+0.4%|r chance |n|cffFFFF80+100|r spelldamage|n|cffFFFF80+0.08%|r armor reduction
                        )

                )

            [2] => Array
                (
                    [name] => On Tower Details
                    [code] => call boekie_queen_damage.setValue(0, formatPercent(tower.userReal,0))
    return boekie_queen_damage
                    [values] => Array
                        (
                        )

                )

            [3] => Array
                (
                    [name] => Header
                    [code] => globals
        BuffType boekie_injectParasite_buff
        ProjectileType boekie_parasite_jump
        MultiboardValues boekie_queen_damage
    endglobals
    
    function boekie_poison takes Buff b returns nothing 
        local Unit target = b.getBuffedUnit()
        local Tower tower = b.getCaster()
        call tower.doSpellDamage(target,500+b.getLevel()*100,tower.calcSpellCritNoBonus())
        call target.modifyProperty(MOD_ARMOR_PERC, -(0.02 + (b.getLevel()*0.0008))) 
    endfunction  
        
    function boekie_parasite_onDeath takes Buff b returns nothing 
        local Creep creep = b.getBuffedUnit()
        local Tower tower = b.getCaster()
        local Iterate it = Iterate.overUnitsInRangeOfUnit(tower, TARGET_CREEPS, creep, 500)
        local Creep newHost = it.next()
        local Creep temp = 0
        local Projectile p
        
        call Effect.createSimple("Objects\\Spawnmodels\\Undead\\UndeadBlood\\UndeadBloodCryptFiend.mdl", creep.getX(), creep.getY()).destroy()
        if tower != 0 then
            call tower.modifyProperty(MOD_DAMAGE_ADD_PERC, 0.0075)
            set tower.userReal = tower.userReal + 0.0075
        endif
        
        //Find a new host! Prefers targets that aren't carrying parasites already.
        loop
            exitwhen newHost == 0 or newHost.getBuffOfType(boekie_injectParasite_buff) == 0
            if newHost != creep then
                set temp = newHost
            endif
            set newHost = it.next()
        endloop
        if newHost == 0 then
            if temp == 0 then
                //noone to jump to! parasite dies :(
                call Effect.createScaled("units\\creeps\\Spider\\Spider.mdl", creep.getX(), creep.getY(), 0.0, 0.0, 0.2).destroy()
                return
            else
                //can only jump to a target that already has a parasite. Do it anyway, to refresh the buff duration.
                set newHost = temp
            endif
        else
            call it.destroy()
        endif
        set p = Projectile.createLinearInterpolationFromUnitToUnit(boekie_parasite_jump, tower, 0.0, 0.0, creep, newHost, 0.5, true)
        call p.setScale(0.2)
        set p.userInt = newHost.getUID()
    endfunction
    
    function boekie_parasite_inject takes Tower tower, Creep newHost returns nothing
        local integer level = tower.getLevel()
        call boekie_injectParasite_buff.applyCustomTimed(tower,newHost,level,10)
    endfunction
    
    function boekie_parasite_jump_onCleanup takes Projectile p returns nothing
        local Creep creep = p.getHomingTarget()
        if creep.getUID() == p.userInt then
            call boekie_parasite_inject(p.getCaster(), creep)
        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 boekie_injectParasite_buff = BuffType.create(0,0,false) 
        call boekie_injectParasite_buff.setBuffIcon('@@0@@')  
        call boekie_injectParasite_buff.addPeriodicEvent(EventHandler.boekie_poison,1) 
        call boekie_injectParasite_buff.addEventOnDeath(EventHandler.boekie_parasite_onDeath)
        
        set boekie_parasite_jump = ProjectileType.createInterpolate("units\\creeps\\Spider\\Spider.mdl",500)
        call boekie_parasite_jump.setEventOnCleanup(boekie_parasite_jump_onCleanup)
        call boekie_parasite_jump.disableExplodeOnHit()
        
        set boekie_queen_damage = MultiboardValues.create(1)
        call boekie_queen_damage.setKey(0,"Damage Gained")
	endfunction
                    [values] => Array
                        (
                            [icon] => 
                            [visible] => false
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => BNab
                    [oeValues] => Array
                        (
                            [Bufftip] => Nerubian Poison
                            [Targetattach] => overhead
                            [Buffubertip] => This unit has been injected with Nerubian poison.
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNDeathCoil.blp
                            [TargetArt] => Abilities\Spells\Other\Parasite\ParasiteTarget.mdl
                            [EditorName] => Nerubian Poison
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

)