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

            [targs1] => Array
                (
                )

            [goldcost] => 120
            [weapsOn] => 1
            [dice1] => 1
            [Missilespeed] => 1237
            [moveHeight] => 30
            [file] => units\creeps\SpiderGreen\SpiderGreen.mdl
            [atkType1] => chaos
            [modelScale] => 0.4
            [weapTp1] => missile
            [Missilearc] => 0.4
            [acquire] => 825
            [rangeN1] => 825
            [upgrades] => Array
                (
                )

            [cool1] => 1.2
            [Ubertip] => A cute small spider.
Ugh... It spat at me!
            [abilList] => Array
                (
                )

            [Name] => Cute Small Spider
            [Missileart] => Abilities\Weapons\ChimaeraAcidMissile\ChimaeraAcidMissile.mdl
            [Art] => ReplaceableTextures\CommandButtons\BTNSpiderGreen.blp
            [buildingShadow] => Array
                (
                )

            [unitSound] => Spider
            [turnRate] => 3
            [sides1] => 10
            [uberSplat] => ESMB
            [auto] => Array
                (
                )

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

    [settings] => Array
        (
            [author] => D1000
            [element] => nature
            [authorDisplay] => |cff3A6B05D1000|r
            [alpha] => 255
            [balanceTip] => |cffFFFF00-30% |rdmg to nature|n|cffFFFF00+10% |rdmg to orcs|n|cffFFFF00+20% |rdmg to humanoids
            [rarity] => uncommon
            [version] => 1.0
            [abil_factor] => 0.4
        )

    [effects] => Array
        (
            [0] => Array
                (
                    [x] => 0.736956
                    [y] => -12.857
                    [z] => -108.8
                    [scale] => 1.5
                    [rot] => 1.05544
                    [file] => Doodads\Felwood\Plants\FelwoodBush\FelwoodBush0.mdl
                    [red] => 255
                    [green] => 255
                    [blue] => 255
                    [alpha] => 255
                    [pitch] => 0
                    [advanced] => false
                    [animation] => Array
                        (
                        )

                    [aniSpeed] => 50
                )

        )

    [dmgTable] => Array
        (
            [0] => Array
                (
                    [id] => MOD_DMG_TO_NATURE
                    [base] => -0.3
                    [add] => 0
                )

            [1] => Array
                (
                    [id] => MOD_DMG_TO_ORC
                    [base] => 0.1
                    [add] => 0
                )

            [2] => Array
                (
                    [id] => MOD_DMG_TO_HUMANOID
                    [base] => 0.2
                    [add] => 0
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Tower Creation
                    [code] => call tower.addEventList(D1000_Spider_Apply)
    set tower.userInt = 30
    set tower.userReal = 1.5
    set tower.userInt2 = 150
    set tower.userReal2 = 7.5
    set tower.userInt3 = 5
    set tower.userReal3 = 0.05
                    [values] => Array
                        (
                            [icon] => 
                            [visible] => false
                            [name] => 
                            [short_explain] => 
                            [long_explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => Header
                    [code] => globals
        //@export
        BuffType D1000_Spider_Poison
        //@export
        EventTypeList D1000_Spider_Apply
    endglobals
    
    function D1000_Spider_Damage takes Buff b returns nothing
        local Unit caster = b.getCaster()
        call caster.doSpellDamage(b.getBuffedUnit(),b.userReal,caster.calcSpellCritNoBonus()) 
    endfunction
    
    function hit takes Tower tower returns nothing
        local Unit target = Event.getTarget()
        local Buff b = target.getBuffOfType(D1000_Spider_Poison)
        local integer level = tower.getLevel()
        local real addDam = tower.userInt+tower.userReal*level
        local real maxDam = tower.userInt2 + tower.userReal2 * level + addDam * (R2I(level / 5))
        if b <= 0 then
            set b = D1000_Spider_Poison.apply(tower, target, level)
            set b.userReal = addDam
            set b.userReal2 = maxDam
            set b.userReal3 = tower.getProp_SpellDmgDealt()
        else
            if b.userReal2 >= maxDam then
                set maxDam = b.userReal2
            endif
            
            if b.userReal+addDam >= maxDam then
                set addDam = maxDam
            else
                set addDam = b.userReal+addDam
            endif
            
            if b.userReal3 < tower.getProp_SpellDmgDealt() then
                call b.removeBuff()
                set b = D1000_Spider_Poison.apply(tower, target, level)
                set b.userReal3 = tower.getProp_SpellDmgDealt()
            else
                call b.setRemainingDuration(tower.userInt3 + tower.userReal3 * level)
            endif
            set b.userReal = addDam
            set b.userReal2 = maxDam
        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 D1000_Spider_Poison = BuffType.create(5,0.05,false)
        call D1000_Spider_Poison.setBuffIcon('@@0@@')
        call D1000_Spider_Poison.addPeriodicEvent(EventHandler.D1000_Spider_Damage,1) 
        set D1000_Spider_Apply = EventTypeList.create()
        call D1000_Spider_Apply.addEventOnDamage(hit, 1, 0)
	endfunction
                    [values] => Array
                        (
                            [icon] => ReplaceableTextures\CommandButtons\BTNCorrosiveBreath.blp
                            [visible] => true
                            [name] => Poisonous Spittle
                            [short_explain] => Damage over time, increases every attack.
                            [long_explain] => Units damaged by the spider become infected and receive |cffFFFF8030|r spell damage per second for |cffFFFF805|r seconds. Further attacks on the same unit will increase the potency of the infection, stacking the damage and refreshing duration. Limit of |cffFFFF805|r stacks. The highest stack amount of any spider that has infected a unit will be used.|n|n|cffFF8000Level Bonus:|r|n|cffFFFF80+1.5|r damage per second|n|cffFFFF80+0.05|r second duration|n|cffFFFF80+1|r stack every |cffFFFF805|r levels
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
            [0] => Array
                (
                    [id] => @@0@@
                    [derivedFrom] => BHab
                    [oeValues] => Array
                        (
                            [Bufftip] => Poisonous Spittle
                            [Targetattach] => chest
                            [Buffubertip] => This unit gains damage over time.
                            [Targetattachcount] => 1
                            [Buffart] => ReplaceableTextures\CommandButtons\BTNCorrosiveBreath.blp
                            [TargetArt] => Abilities\Spells\NightElf\CorrosiveBreath\ChimaeraAcidTargetArt.mdl
                            [Spelldetail] => 0
                        )

                )

        )

    [units] => Array
        (
        )

    [references] => Array
        (
            [0] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => BuffType
                    [name] => D1000_Spider_Poison
                )

            [1] => Array
                (
                    [export] => true
                    [category] => global
                    [typ] => EventTypeList
                    [name] => D1000_Spider_Apply
                )

        )

)