Array
(
    [scriptVersion] => 7
    [oeValues] => Array
        (
            [Name] => Spellbook of Item Mastery
            [Art] => ReplaceableTextures\CommandButtons\BTNTomeRed.blp
            [Ubertip] => This spellbook contains a variety of spells for items.
            [abilList] => Array
                (
                )

        )

    [settings] => Array
        (
            [author] => Majildian
            [authorDisplay] => |cff87cefaMajildian|r
            [balanceTip] => Array
                (
                )

            [rarity] => unique
            [goldcost] => 1500
            [version] => 1.0
        )

    [dmgTable] => Array
        (
        )

    [triggers] => Array
        (
            [0] => Array
                (
                    [name] => On Item Creation
                    [code] => set itm.userInt = 0
    set itm.userInt2 = itm.getOwner().getTeam().getLevel()
    set itm.userReal = 0.00
    set itm.userReal2 = 0.00
                    [values] => Array
                        (
                            [visible] => false
                            [name] => 
                            [goldcost] => 0
                            [explain] => 
                        )

                )

            [1] => Array
                (
                    [name] => On Tower Details
                    [code] => call Maj_spellbook.setValue(0,I2S(itm.userInt))
call Maj_spellbook.setValue(1,formatPercent(itm.userReal, 0))
call Maj_spellbook.setValue(2,formatPercent(itm.userReal2, 0))
return Maj_spellbook
                    [values] => Array
                        (
                            [visible] => false
                            [name] => 
                            [goldcost] => 0
                            [explain] => 
                        )

                )

            [2] => Array
                (
                    [name] => On Item Pickup
                    [code] => local Tower tower = itm.getCarrier()
    call tower.modifyProperty(MOD_ITEM_QUALITY_ON_KILL, itm.userReal)
    call tower.modifyProperty(MOD_ITEM_CHANCE_ON_KILL, itm.userReal2)
                    [values] => Array
                        (
                            [visible] => false
                            [name] => 
                            [goldcost] => 0
                            [explain] => 
                        )

                )

            [3] => Array
                (
                    [name] => Header
                    [code] => globals
        MultiboardValues Maj_spellbook
    endglobals    
    
    //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 Maj_spellbook = MultiboardValues.create(3)
        call Maj_spellbook.setKey(0,"Waves Left")
        call Maj_spellbook.setKey(1,"Item Quality")
        call Maj_spellbook.setKey(2,"Item Chance")
	endfunction
                    [values] => Array
                        (
                            [visible] => false
                            [name] => 
                            [goldcost] => 0
                            [explain] => 
                        )

                )

            [4] => Array
                (
                    [name] => On Item Drop
                    [code] => local Tower tower = itm.getCarrier()
call tower.modifyProperty(MOD_ITEM_QUALITY_ON_KILL, -itm.userReal)
call tower.modifyProperty(MOD_ITEM_CHANCE_ON_KILL, -itm.userReal2)
                    [values] => Array
                        (
                            [visible] => false
                            [name] => 
                            [goldcost] => 0
                            [explain] => 
                        )

                )

            [5] => Array
                (
                    [name] => Periodic
                    [code] => local integer level = itm.getOwner().getTeam().getLevel()
    if itm.userInt2 < level then
        set itm.userInt = itm.userInt - (level - itm.userInt2)
        set itm.userInt2 = level
    endif
                    [values] => Array
                        (
                            [visible] => false
                            [PERIODIC_period] => 5
                            [name] => 
                            [goldcost] => 0
                            [explain] => 
                        )

                )

            [6] => Array
                (
                    [name] => On Attack
                    [code] => local integer choose
local Creep target
local Tower tower
local Playor owner

if itm.userInt <= 0 then
    set tower = itm.getCarrier()
    set owner = itm.getOwner()
    set choose = GetRandomInt(1,6)
    if choose <= 4 then
        set target = Event.getTarget()
    endif
    if choose == 1 then
        call tower.modifyProperty(MOD_ITEM_QUALITY_ON_KILL, 1)
        call target.dropItem(tower,false)
        call tower.modifyProperty(MOD_ITEM_QUALITY_ON_KILL, -1)
        call owner.displayFloatingText("One Item",tower,0,0,255)
    elseif choose == 2 then
        call tower.modifyProperty(MOD_ITEM_QUALITY_ON_KILL, 0.5)
        call target.dropItem(tower,false)
        call target.dropItem(tower,false)
        call tower.modifyProperty(MOD_ITEM_QUALITY_ON_KILL, -0.5)
        call owner.displayFloatingText("Two Items",tower,0,0,255)
    elseif choose == 3 then
        call target.dropItem(tower,false)
        call target.dropItem(tower,false)
        call target.dropItem(tower,false)
        call owner.displayFloatingText("Three Items",tower,0,0,255)
    elseif choose == 4 then
        call tower.modifyProperty(MOD_ITEM_QUALITY_ON_KILL, -0.25)
        call target.dropItem(tower, false)
        call target.dropItem(tower, false)
        call tower.modifyProperty(MOD_ITEM_QUALITY_ON_KILL, 0.32)
        call tower.modifyProperty(MOD_ITEM_CHANCE_ON_KILL, 0.07)
        set itm.userReal = itm.userReal + 0.07
        set itm.userReal2 = itm.userReal2 + 0.07
        call owner.displayFloatingText("Two Items + Bonus!", tower, 0, 0, 255)
    elseif choose == 5 then
        call tower.modifyProperty(MOD_ITEM_CHANCE_ON_KILL,.15)
        set itm.userReal2 = itm.userReal2+0.15
        call owner.displayFloatingText("Item Chance",tower,0,255,0)
    elseif choose == 6 then
        call tower.modifyProperty(MOD_ITEM_QUALITY_ON_KILL,.25)
        set itm.userReal = itm.userReal+0.25
        call owner.displayFloatingText("Item Quality",tower,0,255,0)
    endif
    set itm.userInt = 15
endif
                    [values] => Array
                        (
                            [visible] => true
                            [name] => Cast a Spell
                            [goldcost] => 1500
                            [explain] => Casts one of these spells on attack:|n -Target drops a very high quality item|n -Two high quality items|n -Three normal quality items|n -Two low quality items and spellbook gains |cffffff80+7%|r item chance and item quality|n -Spellbook gains |cffffff80+25%|r item quality or |cffffff80+15%|r item chance|n|nCooldown of |cffffff8015|r waves.
                            [ONATTACK_chance] => 1.0
                            [ONATTACK_chanceLevelAdd] => 0.0
                        )

                )

        )

    [abilities] => Array
        (
        )

    [buffs] => Array
        (
        )

    [units] => Array
        (
        )

    [references] => Array
        (
        )

)