Array
(
    [scriptVersion] => 7
    [oeValues] => Array
        (
            [Ubertip] => Exists beyond reality.
            [Art] => replaceabletextures\commandbuttons\BTNUnbroken.blp
            [abilList] => Array
                (
                )

            [Name] => Distorted Idol
        )

    [settings] => Array
        (
            [balanceTip] => |n|cffFFFF80Specials:|r|n|cffFFFF00-60% |rattackspeed
            [goldcost] => 2750
            [author] => Deemzul
            [authorDisplay] => Deemzul
            [version] => 1.0
            [rarity] => unique
        )

    [dmgTable] => Array
        (
            [0] => Array
                (
                    [id] => MOD_ATTACKSPEED
                    [base] => -0.6
                    [add] => 0
                )

        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Item Drop
                    [code] => local copyList cl = itm.userInt
    local integer i = 0
    local Item cur_item
    if itm.userInt2 != 0 then
        loop
            set cur_item = cl.items[i]
            if cur_item != 0 then //the tower doesn't actually carry these items, they are hidden and at 0,0
                //Remove effects
                if cur_item.typ.effects != 0 then
                    call cur_item.currentEffect.remove()
                    set cur_item.currentEffect = 0
                endif
                call cur_item.destroy()
                set cl.items[i] = 0
            endif
            set i = i + 1
            exitwhen i == 6
        endloop
        set itm.userInt2 = 0
    endif
                    [values] => Array
                        (
                            [explain] => 
                            [visible] => false
                            [goldcost] => 0
                            [name] => 
                        )

                )

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

                )

            [2] => Array
                (
                    [name] => Header
                    [code] => globals
        constant real displayTime = 7
    endglobals
    struct copyList
        Item array items[6]
        static method create takes nothing returns copyList
            local copyList cl = copyList.allocate()
            local integer i = 0
            loop
                set cl.items[i] = 0
                set i = i + 1
                exitwhen i == 6
            endloop
            return cl
        endmethod
    endstruct
    //@export
    function deem_delayDrop takes nothing returns nothing //Should maybe make Item.drop() do this on default
        local timer t = GetExpiredTimer()
        call Item(GetTimerData(t)).drop()
        call ReleaseTimer(t)
    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
	endfunction
                    [values] => Array
                        (
                            [explain] => On pick up, this item copies the abilities and modifiers of every other item already on the tower, except other Distorted Idols and use-actives. The effects are lost when this item is dropped, or the carrier is upgraded or replaced.
                            [visible] => true
                            [goldcost] => 2750
                            [name] => Imitation
                        )

                )

            [3] => Array
                (
                    [name] => On Tower Details
                    [code] => local integer i = 0
    local Item tmpItm
    local item tmpitm
    local string s
    local Playor p = Event.getMBObserver()
    local integer i2  = 0
    local Tower t = itm.getCarrier()
    //Only want to view this when opening the multiboard
    if p.towerDisplay.curTower != t then
        set s = ""
        loop
            set tmpItm = copyList(itm.userInt).items[i]
            exitwhen i == 6
            if tmpItm != 0 then
                if i2 == 3 then
                    set s = s + "\n"
                elseif i2 > 0 then
                    set s = s + ", "
                endif
                set tmpitm = tmpItm.getItem()
                set s = s + GetItemName(tmpitm)
                set i2 = i2 + 1
            endif
            set i = i + 1
        endloop
        if i2 == 0 then
            call p.displayTimedText("|cffFF8000Distorted Idol is copying:|r Absolutely nothing",displayTime)
        else
            call p.displayTimedText("|cffFF8000Distorted Idol is copying the following items:|r",displayTime)
            call p.displayTimedText(s,displayTime)
        endif
        set tmpitm = null
    endif
    return 0
                    [values] => Array
                        (
                            [0] => Array
                                (
                                    [_value] => 0
                                    [typ] => string
                                )

                        )

                )

            [4] => Array
                (
                    [name] => On Item Pickup
                    [code] => local Tower tower = itm.getCarrier()
    local integer i = 1 //itemslots start from 1 for whatever reason
    local Item tmpItm
    local ItemEventList cur_iel
    local Item dummy_itm
    local ItemType cur_ityp
    local copyList cur_copy_list
    local real x = tower.getX()
    local real y = tower.getY()
    local integer cliff = 0
    local timer t
    if IsTerrainPathable(x,y-96,PATHING_TYPE_BUILDABILITY) then
        set cliff = cliff + 1
    endif
    if IsTerrainPathable(x,y+96,PATHING_TYPE_BUILDABILITY) then
        set cliff = cliff + 1
    endif
    if IsTerrainPathable(x-96,y,PATHING_TYPE_BUILDABILITY) then
        set cliff = cliff + 1
    endif
    if IsTerrainPathable(x+96,y,PATHING_TYPE_BUILDABILITY) then
        set cliff = cliff + 1
    endif
    if cliff != 2 then //Is tower not next to 2 cliffs?
        set t = NewTimer()
        call SetTimerData(t,itm)
        call TimerStart(t,0,false,function deem_delayDrop) //can't drop immediately, because of execution order
    else
        loop
            set itm.userInt2 = tower
            exitwhen i > 6
            set tmpItm = tower.getHeldItem(i)
            if tmpItm != 0 then
                set cur_ityp = tmpItm.typ
                set cur_iel = cur_ityp .effects
                set cur_copy_list = itm.userInt
                if cur_iel != itm.typ.effects then
                    //Create fake items for userInts and such
                    set dummy_itm = Item.create(tower.getOwner(),cur_ityp,0,0)
                    set dummy_itm.currentCarrier = tower
                    call SetItemVisible(dummy_itm.theItem,false)
                    call ItemEffect.create(dummy_itm,tower)
                    set cur_copy_list.items[i-1] = dummy_itm //-1 because array starts at 0 and getHeldItem at 1
                endif
            endif
            set i = i + 1
        endloop
    endif
                    [values] => Array
                        (
                            [explain] => This item can only be picked up by a tower in a corner with cliffs on two sides.
                            [visible] => true
                            [goldcost] => 0
                            [name] => Restriction
                        )

                )

            [5] => Array
                (
                    [name] => On Item Destruction
                    [code] => call copyList(itm.userInt).destroy()
                    [values] => Array
                        (
                            [explain] => 
                            [visible] => false
                            [goldcost] => 0
                            [name] => 
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

)